Skip to contentSkip to conversation

staging:r8188eu: remove RTW_STATUS_CODE()

PATCH New Ivan Safonov 1 participant 5 messages Jan 4, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 staging:r8188eu: remove RTW_STATUS_CODE()

RTW_STATUS_CODE() does not used. Remove it.

---
 drivers/staging/rtl8188eu/include/osdep_service.h |  2 --
 drivers/staging/rtl8188eu/os_dep/osdep_service.c  | 12 ------------
 2 files changed, 14 deletions(-)
drivers/staging/rtl8188eu/include/osdep_service.h +0 -2
index 9047b6d..b940baf 100644
@@ -69,8 +69,6 @@ static inline int rtw_netif_queue_stopped(struct net_device *pnetdev)
 		netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 3));
 }
 
-int RTW_STATUS_CODE(int error_code);
-
 #define rtw_update_mem_stat(flag, sz) do {} while (0)
 u8 *_rtw_malloc(u32 sz);
 #define rtw_malloc(sz)			_rtw_malloc((sz))
drivers/staging/rtl8188eu/os_dep/osdep_service.c +0 -12
index 51abfe9..3be8725 100644
@@ -21,18 +21,6 @@
 #include <linux/vmalloc.h>
 #include <rtw_ioctl_set.h>
 
-/*
- * Translate the OS dependent @param error_code to OS independent
- * RTW_STATUS_CODE
- * @return: one of RTW_STATUS_CODE
- */
-inline int RTW_STATUS_CODE(int error_code)
-{
-	if (error_code >= 0)
-		return _SUCCESS;
-	return _FAIL;
-}
-
 u8 *_rtw_malloc(u32 sz)
 {
 	return kmalloc(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
Signature · 1 line
2.10.2
#1 lore raw

PATCH 2/5 staging:r8188eu: remove rtw_update_mem_stat definition

rtw_update_mem_stat definition does not used. Remove it.

---
 drivers/staging/rtl8188eu/include/osdep_service.h | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/rtl8188eu/include/osdep_service.h +0 -1
index b940baf..a3cdd1f 100644
@@ -69,7 +69,6 @@ static inline int rtw_netif_queue_stopped(struct net_device *pnetdev)
 		netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 3));
 }
 
-#define rtw_update_mem_stat(flag, sz) do {} while (0)
 u8 *_rtw_malloc(u32 sz);
 #define rtw_malloc(sz)			_rtw_malloc((sz))
 
Signature · 1 line
2.10.2
#2 lore raw

PATCH 3/5 staging:r8188eu: remove (NDEV|ADPT)_(FMT|ARG) definitions

In reply to Ivan Safonov

(NDEV|ADPT)_(FMT|ARG) definitions does not used. Remove it.

---
 drivers/staging/rtl8188eu/include/osdep_service.h | 4 ----
 1 file changed, 4 deletions(-)
drivers/staging/rtl8188eu/include/osdep_service.h +0 -4
index a3cdd1f..ee3f5ee 100644
@@ -85,10 +85,6 @@ struct net_device *rtw_alloc_etherdev_with_old_priv(void *old_priv);
 	(((struct rtw_netdev_priv_indicator *)netdev_priv(netdev))->priv)
 void rtw_free_netdev(struct net_device *netdev);
 
-#define NDEV_FMT "%s"
-#define NDEV_ARG(ndev) ndev->name
-#define ADPT_FMT "%s"
-#define ADPT_ARG(adapter) adapter->pnetdev->name
 #define FUNC_NDEV_FMT "%s(%s)"
 #define FUNC_NDEV_ARG(ndev) __func__, ndev->name
 #define FUNC_ADPT_FMT "%s(%s)"
Signature · 1 line
2.10.2
#3 lore raw

PATCH 4/5 staging:r8188eu: eleminate recovery attemp using skb_clone after netdev_alloc_skb fail

In reply to Ivan Safonov

It is wrong to create new skb using skb_clone instead netdev_alloc_skb, because buffer data will be changed later.

---
 drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c +3 -16
index e2dbe1b..5f6cbe0 100644
@@ -133,22 +133,9 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
 			precvframe->rx_tail = pkt_copy->data;
 			precvframe->rx_data = pkt_copy->data;
 		} else {
-			if ((pattrib->mfrag == 1) && (pattrib->frag_num == 0)) {
-				DBG_88E("recvbuf2recvframe: alloc_skb fail , drop frag frame\n");
-				rtw_free_recvframe(precvframe, pfree_recv_queue);
-				goto _exit_recvbuf2recvframe;
-			}
-			precvframe->pkt = skb_clone(pskb, GFP_ATOMIC);
-			if (precvframe->pkt) {
-				precvframe->rx_tail = pbuf + pattrib->drvinfo_sz + RXDESC_SIZE;
-				precvframe->rx_head = precvframe->rx_tail;
-				precvframe->rx_data = precvframe->rx_tail;
-				precvframe->rx_end =  pbuf + pattrib->drvinfo_sz + RXDESC_SIZE + alloc_sz;
-			} else {
-				DBG_88E("recvbuf2recvframe: skb_clone fail\n");
-				rtw_free_recvframe(precvframe, pfree_recv_queue);
-				goto _exit_recvbuf2recvframe;
-			}
+			DBG_88E("recvbuf2recvframe: alloc_skb fail , drop frag frame\n");
+			rtw_free_recvframe(precvframe, pfree_recv_queue);
+			goto _exit_recvbuf2recvframe;
 		}
 
 		recvframe_put(precvframe, skb_len);
Signature · 1 line
2.10.2
#4 lore raw

PATCH 5/5 staging:r8188eu: remove unused WIFI_MP_*STATE and WIFI_MP_CTX* definitions

In reply to Ivan Safonov

fw_state member of struct mlme_priv never obtain WIFI_MP_STATE value, so code only for (fw_state == WIFI_MP_STATE) is dead. Remove it, WIFI_MP_*STATE and WIFI_MP_CTX* definitions.

---
 drivers/staging/rtl8188eu/core/rtw_cmd.c       |  3 --
 drivers/staging/rtl8188eu/core/rtw_ioctl_set.c |  5 ---
 drivers/staging/rtl8188eu/core/rtw_recv.c      | 42 +-------------------------
 drivers/staging/rtl8188eu/core/rtw_xmit.c      |  2 +-
 drivers/staging/rtl8188eu/include/rtw_mlme.h   |  8 -----
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c |  8 +----
 6 files changed, 3 insertions(+), 65 deletions(-)
drivers/staging/rtl8188eu/core/rtw_cmd.c +0 -3
index 36109ce..1497966 100644
@@ -1321,9 +1321,6 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter,  struct cmd_obj *
 
 	spin_lock_bh(&pmlmepriv->lock);
 
-	if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true))
-		_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
-
 	set_fwstate(pmlmepriv, _FW_LINKED);
 	spin_unlock_bh(&pmlmepriv->lock);
 
drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +0 -5
index 6ed23f4..67508a6 100644
@@ -573,11 +573,6 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
 	u8	bw_40MHz = 0, short_GI_20 = 0, short_GI_40 = 0;
 	u32	ht_ielen = 0;
 
-	if (adapter->registrypriv.mp_mode == 1) {
-		if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
-			return 0;
-	}
-
 	if ((!check_fwstate(pmlmepriv, _FW_LINKED)) &&
 	    (!check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)))
 		return 0;
drivers/staging/rtl8188eu/core/rtw_recv.c +1 -41

72 lines not on this page · raw message

drivers/staging/rtl8188eu/core/rtw_xmit.c +1 -1
index c99c3c1..484d20a 100644
@@ -532,7 +532,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
 
 		pattrib->encrypt = 0;
 
-		if ((pattrib->ether_type != ETH_P_PAE) && !check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
+		if (pattrib->ether_type != ETH_P_PAE) {
 			RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("\npsta->ieee8021x_blocked == true,  pattrib->ether_type(%.4x) != ETH_P_PAE\n", pattrib->ether_type));
 			res = _FAIL;
 			goto exit;
drivers/staging/rtl8188eu/include/rtw_mlme.h +0 -8
index 18fb7e7..6d03f94 100644
@@ -47,14 +47,6 @@
 #define	WIFI_STA_ALIVE_CHK_STATE	0x00000400
 #define	WIFI_SITE_MONITOR		0x00000800	/* to indicate the station is under site surveying */
 
-#define	WIFI_MP_STATE			0x00010000
-#define	WIFI_MP_CTX_BACKGROUND		0x00020000	/*  in continuous tx background */
-#define	WIFI_MP_CTX_ST			0x00040000	/*  in continuous tx with single-tone */
-#define	WIFI_MP_CTX_BACKGROUND_PENDING	0x00080000	/*  pending in continuous tx background due to out of skb */
-#define	WIFI_MP_CTX_CCK_HW		0x00100000	/*  in continuous tx */
-#define	WIFI_MP_CTX_CCK_CS		0x00200000	/*  in continuous tx with carrier suppression */
-#define WIFI_MP_LPBK_STATE		0x00400000
-
 #define _FW_UNDER_LINKING	WIFI_UNDER_LINKING
 #define _FW_LINKED			WIFI_ASOC_STATE
 #define _FW_UNDER_SURVEY	WIFI_SITE_MONITOR
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +1 -7
index d1658d6..763eccd 100644
@@ -443,7 +443,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
 		struct sta_info *psta, *pbcmc_sta;
 		struct sta_priv *pstapriv = &padapter->stapriv;
 
-		if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_MP_STATE)) { /* sta mode */
+		if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { /* sta mode */
 			psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv));
 			if (!psta) {
 				;
@@ -1089,12 +1089,6 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
 
 	RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_set_scan\n"));
 
-	if (padapter->registrypriv.mp_mode == 1) {
-		if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
-			ret = -1;
-			goto exit;
-		}
-	}
 	if (_FAIL == rtw_pwr_wakeup(padapter)) {
 		ret = -1;
 		goto exit;
Signature · 1 line
2.10.2