2016-10-19 15:05:28

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 01/37] staging:r8188eu: remove get_rxmem function

This simple one-line function used only once, and precvframe always not NULL.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 2 +-
drivers/staging/rtl8188eu/include/rtw_recv.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 3e6edb6..691623c 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1343,7 +1343,7 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
eth_type = 0x8712;
/* append rx status for mp test packets */
ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr)+2)-24);
- memcpy(ptr, get_rxmem(precvframe), 24);
+ memcpy(ptr, precvframe->rx_head, 24);
ptr += 24;
} else {
ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0)));
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 052af7b..4280fa1 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -258,14 +258,6 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter);

void rtw_reordering_ctrl_timeout_handler(unsigned long data);

-static inline u8 *get_rxmem(struct recv_frame *precvframe)
-{
- /* always return rx_head... */
- if (precvframe == NULL)
- return NULL;
- return precvframe->rx_head;
-}
-
static inline u8 *recvframe_pull(struct recv_frame *precvframe, int sz)
{
/* rx_data += sz; move rx_data sz bytes hereafter */
--
2.7.3


2016-10-19 15:06:05

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 17/37] staging:r8188eu: update pkt->data synchronously with rx_data

To replace rx_data with pkt->data.
Now pkt->data is equal to rx_data.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/rtw_recv.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index e661635..143e637 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -266,6 +266,7 @@ static inline u8 *recvframe_pull(struct recv_frame *precvframe, uint sz)

if (precvframe == NULL)
return NULL;
+ skb_pull(precvframe->pkt, sz);
precvframe->rx_data += sz;
if (precvframe->rx_data > precvframe->rx_tail) {
precvframe->rx_data -= sz;
--
2.7.3

2016-10-19 15:06:14

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 24/37] staging:r8188eu: remove rx_tail member of recv_frame structure

rx_end replaced with pkt->tail.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 2 +-
drivers/staging/rtl8188eu/include/rtw_recv.h | 3 ---
drivers/staging/rtl8188eu/os_dep/recv_linux.c | 2 +-
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 1 -
4 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index a210a43..0a520a2 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1381,7 +1381,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,
recvframe_pull_tail(prframe, pfhdr->attrib.icv_len);

/* memcpy */
- memcpy(pfhdr->rx_tail, pnfhdr->pkt->data, pnfhdr->len);
+ memcpy(pfhdr->pkt->tail, pnfhdr->pkt->data, pnfhdr->len);

recvframe_put(prframe, pnfhdr->len);

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 34d13f8..eab2bef 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -233,7 +233,6 @@ struct recv_frame {
struct adapter *adapter;
struct rx_pkt_attrib attrib;
uint len;
- u8 *rx_tail;
struct sta_info *psta;
/* for A-MPDU Rx reordering buffer control */
struct recv_reorder_ctrl *preorder_ctrl;
@@ -287,7 +286,6 @@ static inline u8 *recvframe_put(struct recv_frame *precvframe, uint sz)
tail = skb_put(precvframe->pkt, sz);
if (!tail)
return NULL;
- precvframe->rx_tail += sz;
precvframe->len += sz;
return tail;
}
@@ -305,7 +303,6 @@ static inline void recvframe_pull_tail(struct recv_frame *precvframe, uint sz)

if (precvframe->len < sz)
return;
- precvframe->rx_tail -= sz;
skb_trim(precvframe->pkt, precvframe->pkt->len - sz);
precvframe->len -= sz;
}
diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
index e405ea9..98b5817 100644
--- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
@@ -95,7 +95,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter,
precv_frame->pkt->data));
RT_TRACE(_module_recv_osdep_c_, _drv_info_,
("precv_frame->hdr.rx_tail =%p precv_frame->pkt->end =%p precv_frame->hdr.len =%d\n",
- precv_frame->rx_tail, precv_frame->pkt->end,
+ precv_frame->pkt->tail, precv_frame->pkt->end,
precv_frame->len));

skb_set_tail_pointer(skb, precv_frame->len);
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 45682ac..3fc4d84 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -127,7 +127,6 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
skb_reserve(pkt_copy, 8 - ((size_t)(pkt_copy->data) & 7));/* force pkt_copy->data at 8-byte alignment address */
skb_reserve(pkt_copy, shift_sz);/* force ip_hdr at 8-byte alignment address according to shift_sz. */
memcpy(pkt_copy->data, (pbuf + pattrib->drvinfo_sz + RXDESC_SIZE), skb_len);
- precvframe->rx_tail = pkt_copy->data;
} else {
DBG_88E("recvbuf2recvframe: alloc_skb fail , drop frag frame\n");
rtw_free_recvframe(precvframe, pfree_recv_queue);
--
2.7.3

2016-10-19 15:06:20

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 33/37] staging:r8188eu: remove rtw_calculate_wlan_pkt_size_by_attribue function

This function does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_xmit.c | 18 ------------------
drivers/staging/rtl8188eu/include/rtw_xmit.h | 1 -
2 files changed, 19 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 6697c86..6b00e6b 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -921,24 +921,6 @@ s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, struct pkt_attrib *pat
}

/*
- * Calculate wlan 802.11 packet MAX size from pkt_attrib
- * This function doesn't consider fragment case
- */
-u32 rtw_calculate_wlan_pkt_size_by_attribue(struct pkt_attrib *pattrib)
-{
- u32 len = 0;
-
- len = pattrib->hdrlen + pattrib->iv_len; /* WLAN Header and IV */
- len += SNAP_SIZE + sizeof(u16); /* LLC */
- len += pattrib->pktlen;
- if (pattrib->encrypt == _TKIP_)
- len += 8; /* MIC */
- len += ((pattrib->bswenc) ? pattrib->icv_len : 0); /* ICV */
-
- return len;
-}
-
-/*

This sub-routine will perform all the following:

diff --git a/drivers/staging/rtl8188eu/include/rtw_xmit.h b/drivers/staging/rtl8188eu/include/rtw_xmit.h
index dd6b7a9..37bca86 100644
--- a/drivers/staging/rtl8188eu/include/rtw_xmit.h
+++ b/drivers/staging/rtl8188eu/include/rtw_xmit.h
@@ -330,7 +330,6 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv,

s32 rtw_xmit_classifier(struct adapter *padapter,
struct xmit_frame *pxmitframe);
-u32 rtw_calculate_wlan_pkt_size_by_attribue(struct pkt_attrib *pattrib);
#define rtw_wlan_pkt_size(f) rtw_calculate_wlan_pkt_size_by_attribue(&f->attrib)
s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt,
struct xmit_frame *pxmitframe);
--
2.7.3

2016-10-19 15:06:22

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 25/37] staging:r8188eu: remove len member of recv_frame structure

len replaced with pkt->len.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 14 +++++++-------
drivers/staging/rtl8188eu/core/rtw_recv.c | 23 +++++++++--------------
drivers/staging/rtl8188eu/core/rtw_security.c | 6 +++---
drivers/staging/rtl8188eu/include/rtw_recv.h | 6 +-----
drivers/staging/rtl8188eu/os_dep/mon.c | 2 +-
drivers/staging/rtl8188eu/os_dep/recv_linux.c | 9 ++-------
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 1 -
7 files changed, 23 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 26639f0..08bb61d 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -2051,7 +2051,7 @@ static u8 collect_bss_info(struct adapter *padapter,
u8 *p;
u16 val16, subtype;
u8 *pframe = precv_frame->pkt->data;
- u32 packet_len = precv_frame->len;
+ u32 packet_len = precv_frame->pkt->len;
u8 ie_offset;
struct registry_priv *pregistrypriv = &padapter->registrypriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
@@ -2558,7 +2558,7 @@ static unsigned int OnProbeReq(struct adapter *padapter,
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct wlan_bssid_ex *cur = &(pmlmeinfo->network);
u8 *pframe = precv_frame->pkt->data;
- uint len = precv_frame->len;
+ uint len = precv_frame->pkt->len;

if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
return _SUCCESS;
@@ -2606,7 +2606,7 @@ static unsigned int OnBeacon(struct adapter *padapter,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct sta_priv *pstapriv = &padapter->stapriv;
u8 *pframe = precv_frame->pkt->data;
- uint len = precv_frame->len;
+ uint len = precv_frame->pkt->len;
struct wlan_bssid_ex *pbss;
int ret = _SUCCESS;
struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network);
@@ -2703,7 +2703,7 @@ static unsigned int OnAuth(struct adapter *padapter,
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u8 *pframe = precv_frame->pkt->data;
- uint len = precv_frame->len;
+ uint len = precv_frame->pkt->len;

if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
return _FAIL;
@@ -2866,7 +2866,7 @@ static unsigned int OnAuthClient(struct adapter *padapter,
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u8 *pframe = precv_frame->pkt->data;
- uint pkt_len = precv_frame->len;
+ uint pkt_len = precv_frame->pkt->len;

DBG_88E("%s\n", __func__);

@@ -2954,7 +2954,7 @@ static unsigned int OnAssocReq(struct adapter *padapter,
struct wlan_bssid_ex *cur = &(pmlmeinfo->network);
struct sta_priv *pstapriv = &padapter->stapriv;
u8 *pframe = precv_frame->pkt->data;
- uint pkt_len = precv_frame->len;
+ uint pkt_len = precv_frame->pkt->len;

if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
return _FAIL;
@@ -3386,7 +3386,7 @@ static unsigned int OnAssocRsp(struct adapter *padapter,
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
/* struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network); */
u8 *pframe = precv_frame->pkt->data;
- uint pkt_len = precv_frame->len;
+ uint pkt_len = precv_frame->pkt->len;

DBG_88E("%s\n", __func__);

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 0a520a2..5e47e25 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -80,7 +80,6 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
&(precvpriv->free_recv_queue.queue));

precvframe->pkt = NULL;
- precvframe->len = 0;

precvframe->adapter = padapter;
precvframe++;
@@ -149,8 +148,6 @@ int rtw_free_recvframe(struct recv_frame *precvframe,

list_del_init(&(precvframe->list));

- precvframe->len = 0;
-
list_add_tail(&(precvframe->list), get_list_head(pfree_recv_queue));

spin_unlock_bh(&pfree_recv_queue->lock);
@@ -261,7 +258,7 @@ static int recvframe_chkmic(struct adapter *adapter,
}

/* icv_len included the mic code */
- datalen = precvframe->len-prxattrib->hdrlen -
+ datalen = precvframe->pkt->len-prxattrib->hdrlen -
prxattrib->iv_len-prxattrib->icv_len-8;
pframe = precvframe->pkt->data;
payload = pframe+prxattrib->hdrlen+prxattrib->iv_len;
@@ -298,8 +295,8 @@ static int recvframe_chkmic(struct adapter *adapter,
uint i;
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_,
("\n ======demp packet (len=%d)======\n",
- precvframe->len));
- for (i = 0; i < precvframe->len; i += 8) {
+ precvframe->pkt->len));
+ for (i = 0; i < precvframe->pkt->len; i += 8) {
RT_TRACE(_module_rtl871x_recv_c_,
_drv_err_,
("0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x",
@@ -315,7 +312,7 @@ static int recvframe_chkmic(struct adapter *adapter,
RT_TRACE(_module_rtl871x_recv_c_,
_drv_err_,
("\n ====== demp packet end [len=%d]======\n",
- precvframe->len));
+ precvframe->pkt->len));
RT_TRACE(_module_rtl871x_recv_c_,
_drv_err_,
("\n hrdlen=%d,\n",
@@ -617,7 +614,7 @@ static void count_rx_stats(struct adapter *padapter,
struct rx_pkt_attrib *pattrib = &prframe->attrib;
struct recv_priv *precvpriv = &padapter->recvpriv;

- sz = prframe->len;
+ sz = prframe->pkt->len;
precvpriv->rx_bytes += sz;

padapter->mlmepriv.LinkDetectInfo.NumRxOkInPeriod++;
@@ -1297,7 +1294,7 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
}

rmv_len = pattrib->hdrlen + pattrib->iv_len + (bsnaphdr ? SNAP_SIZE : 0);
- len = precvframe->len - rmv_len;
+ len = precvframe->pkt->len - rmv_len;

RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
("\n===pattrib->hdrlen: %x, pattrib->iv_len:%x===\n\n", pattrib->hdrlen, pattrib->iv_len));
@@ -1381,9 +1378,9 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,
recvframe_pull_tail(prframe, pfhdr->attrib.icv_len);

/* memcpy */
- memcpy(pfhdr->pkt->tail, pnfhdr->pkt->data, pnfhdr->len);
+ memcpy(pfhdr->pkt->tail, pnfhdr->pkt->data, pnfhdr->pkt->len);

- recvframe_put(prframe, pnfhdr->len);
+ recvframe_put(prframe, pnfhdr->pkt->len);

pfhdr->attrib.icv_len = pnfhdr->attrib.icv_len;
plist = plist->next;
@@ -1516,7 +1513,7 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)
if (prframe->attrib.iv_len > 0)
recvframe_pull(prframe, prframe->attrib.iv_len);

- a_len = prframe->len;
+ a_len = prframe->pkt->len;

pdata = prframe->pkt->data;

@@ -1605,8 +1602,6 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)
}

exit:
-
- prframe->len = 0;
rtw_free_recvframe(prframe, pfree_recv_queue);/* free this recv_frame */

return _SUCCESS;
diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c b/drivers/staging/rtl8188eu/core/rtw_security.c
index d0d2f9a..7dae6f7 100644
--- a/drivers/staging/rtl8188eu/core/rtw_security.c
+++ b/drivers/staging/rtl8188eu/core/rtw_security.c
@@ -213,7 +213,7 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe)
keylength = psecuritypriv->dot11DefKeylen[keyindex];
memcpy(&wepkey[0], iv, 3);
memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength);
- length = ((struct recv_frame *)precvframe)->len-prxattrib->hdrlen-prxattrib->iv_len;
+ length = ((struct recv_frame *)precvframe)->pkt->len-prxattrib->hdrlen-prxattrib->iv_len;

payload = pframe+prxattrib->iv_len+prxattrib->hdrlen;

@@ -672,7 +672,7 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)

iv = pframe+prxattrib->hdrlen;
payload = pframe+prxattrib->iv_len+prxattrib->hdrlen;
- length = ((struct recv_frame *)precvframe)->len-prxattrib->hdrlen-prxattrib->iv_len;
+ length = ((struct recv_frame *)precvframe)->pkt->len-prxattrib->hdrlen-prxattrib->iv_len;

GET_TKIP_PN(iv, dot11txpn);

@@ -1476,7 +1476,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
} else {
prwskey = &stainfo->dot118021x_UncstKey.skey[0];
}
- length = ((struct recv_frame *)precvframe)->len-prxattrib->hdrlen-prxattrib->iv_len;
+ length = ((struct recv_frame *)precvframe)->pkt->len-prxattrib->hdrlen-prxattrib->iv_len;
res = aes_decipher(prwskey, prxattrib->hdrlen, pframe, length);
} else {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_encrypt: stainfo==NULL!!!\n"));
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index eab2bef..752c40fe 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -232,7 +232,6 @@ struct recv_frame {
struct sk_buff *pkt;
struct adapter *adapter;
struct rx_pkt_attrib attrib;
- uint len;
struct sta_info *psta;
/* for A-MPDU Rx reordering buffer control */
struct recv_reorder_ctrl *preorder_ctrl;
@@ -268,7 +267,6 @@ static inline u8 *recvframe_pull(struct recv_frame *precvframe, uint sz)
data = skb_pull(precvframe->pkt, sz);
if (!data)
return NULL;
- precvframe->len -= sz;
return data;
}

@@ -286,7 +284,6 @@ static inline u8 *recvframe_put(struct recv_frame *precvframe, uint sz)
tail = skb_put(precvframe->pkt, sz);
if (!tail)
return NULL;
- precvframe->len += sz;
return tail;
}

@@ -301,10 +298,9 @@ static inline void recvframe_pull_tail(struct recv_frame *precvframe, uint sz)
if (precvframe == NULL)
return;

- if (precvframe->len < sz)
+ if (precvframe->pkt->len < sz)
return;
skb_trim(precvframe->pkt, precvframe->pkt->len - sz);
- precvframe->len -= sz;
}

static inline s32 translate_percentage_to_dbm(u32 sig_stren_index)
diff --git a/drivers/staging/rtl8188eu/os_dep/mon.c b/drivers/staging/rtl8188eu/os_dep/mon.c
index 263c6d5..9b3f3ec 100644
--- a/drivers/staging/rtl8188eu/os_dep/mon.c
+++ b/drivers/staging/rtl8188eu/os_dep/mon.c
@@ -93,7 +93,7 @@ void rtl88eu_mon_recv_hook(struct net_device *dev, struct recv_frame *frame)

attr = &frame->attrib;
data = frame->pkt->data;
- data_len = frame->len;
+ data_len = frame->pkt->len;

/* Broadcast and multicast frames don't have attr->{iv,icv}_len set */
SET_ICE_IV_LEN(iv_len, icv_len, attr->encrypt);
diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
index 98b5817..0496348 100644
--- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
@@ -94,14 +94,9 @@ int rtw_recv_indicatepkt(struct adapter *padapter,
("rtw_recv_indicatepkt(): precv_frame->pkt->rx_data =%p\n",
precv_frame->pkt->data));
RT_TRACE(_module_recv_osdep_c_, _drv_info_,
- ("precv_frame->hdr.rx_tail =%p precv_frame->pkt->end =%p precv_frame->hdr.len =%d\n",
+ ("precv_frame->hdr.rx_tail =%p precv_frame->pkt->end =%p precv_frame->pkt->len =%d\n",
precv_frame->pkt->tail, precv_frame->pkt->end,
- precv_frame->len));
-
- skb_set_tail_pointer(skb, precv_frame->len);
-
- skb->len = precv_frame->len;
-
+ precv_frame->pkt->len));
RT_TRACE(_module_recv_osdep_c_, _drv_info_,
("skb->head =%p skb->data =%p skb->tail =%p skb->end =%p skb->len =%d\n",
skb->head, skb->data, skb_tail_pointer(skb),
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 3fc4d84..572a89f 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -73,7 +73,6 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
}

INIT_LIST_HEAD(&precvframe->list);
- precvframe->len = 0;

update_recvframe_attrib_88e(precvframe, prxstat);

--
2.7.3

2016-10-19 15:06:41

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 05/37] staging:r8188eu: remove mp_mode member of odm_dm_struct and odm_dm_struct structures

Value of this variable always is 0.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 8 +-------
drivers/staging/rtl8188eu/hal/odm.c | 3 +--
drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 19 -------------------
drivers/staging/rtl8188eu/hal/phy.c | 8 +-------
drivers/staging/rtl8188eu/hal/rtl8188e_dm.c | 6 ------
drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c | 16 ++++++----------
drivers/staging/rtl8188eu/hal/usb_halinit.c | 25 +++++++------------------
drivers/staging/rtl8188eu/include/drv_types.h | 1 -
drivers/staging/rtl8188eu/include/odm.h | 1 -
drivers/staging/rtl8188eu/os_dep/os_intfs.c | 1 -
10 files changed, 16 insertions(+), 72 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
index 4032121..c92807e 100644
--- a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
@@ -127,9 +127,6 @@ void ips_enter(struct adapter *padapter)
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
struct xmit_priv *pxmit_priv = &padapter->xmitpriv;

- if (padapter->registrypriv.mp_mode == 1)
- return;
-
if (pxmit_priv->free_xmitbuf_cnt != NR_XMITBUFF ||
pxmit_priv->free_xmit_extbuf_cnt != NR_XMIT_EXTBUFF) {
DBG_88E_LEVEL(_drv_info_, "There are some pkts to transmit\n");
@@ -520,10 +517,7 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)
pwrctrlpriv->bkeepfwalive = false;

pwrctrlpriv->LpsIdleCount = 0;
- if (padapter->registrypriv.mp_mode == 1)
- pwrctrlpriv->power_mgnt = PS_MODE_ACTIVE;
- else
- pwrctrlpriv->power_mgnt = padapter->registrypriv.power_mgnt;/* PS_MODE_MIN; */
+ pwrctrlpriv->power_mgnt = padapter->registrypriv.power_mgnt;/* PS_MODE_MIN; */
pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt) ? true : false;

pwrctrlpriv->bFwCurrentInPSMode = false;
diff --git a/drivers/staging/rtl8188eu/hal/odm.c b/drivers/staging/rtl8188eu/hal/odm.c
index 16476e7..322eb31 100644
--- a/drivers/staging/rtl8188eu/hal/odm.c
+++ b/drivers/staging/rtl8188eu/hal/odm.c
@@ -991,8 +991,7 @@ void odm_TXPowerTrackingThermalMeterInit(struct odm_dm_struct *pDM_Odm)
{
pDM_Odm->RFCalibrateInfo.bTXPowerTracking = true;
pDM_Odm->RFCalibrateInfo.TXPowercount = 0;
- if (*(pDM_Odm->mp_mode) != 1)
- pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = true;
+ pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = true;
MSG_88E("pDM_Odm TxPowerTrackControl = %d\n", pDM_Odm->RFCalibrateInfo.TxPowerTrackControl);

pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = true;
diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c
index dd9b902..5a0bc8b 100644
--- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c
+++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c
@@ -21,13 +21,6 @@ static void dm_rx_hw_antena_div_init(struct odm_dm_struct *dm_odm)
struct adapter *adapter = dm_odm->Adapter;
u32 value32;

- if (*(dm_odm->mp_mode) == 1) {
- dm_odm->AntDivType = CGCS_RX_SW_ANTDIV;
- phy_set_bb_reg(adapter, ODM_REG_IGI_A_11N, BIT(7), 0);
- phy_set_bb_reg(adapter, ODM_REG_LNA_SWITCH_11N, BIT(31), 1);
- return;
- }
-
/* MAC Setting */
value32 = phy_query_bb_reg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord);
phy_set_bb_reg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord,
@@ -52,14 +45,6 @@ static void dm_trx_hw_antenna_div_init(struct odm_dm_struct *dm_odm)
struct adapter *adapter = dm_odm->Adapter;
u32 value32;

- if (*(dm_odm->mp_mode) == 1) {
- dm_odm->AntDivType = CGCS_RX_SW_ANTDIV;
- phy_set_bb_reg(adapter, ODM_REG_IGI_A_11N, BIT(7), 0);
- phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N,
- BIT(5) | BIT(4) | BIT(3), 0);
- return;
- }
-
/* MAC Setting */
value32 = phy_query_bb_reg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord);
phy_set_bb_reg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord,
@@ -98,10 +83,6 @@ static void dm_fast_training_init(struct odm_dm_struct *dm_odm)
struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable;
u32 AntCombination = 2;

- if (*(dm_odm->mp_mode) == 1) {
- return;
- }
-
for (i = 0; i < 6; i++) {
dm_fat_tbl->Bssid[i] = 0;
dm_fat_tbl->antSumRSSI[i] = 0;
diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 35c91e0..8462a91 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -981,7 +981,7 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
u8 t, bool is2t)
{
struct odm_dm_struct *dm_odm = &adapt->HalData->odmpriv;
- u32 i;
+ u32 i, retry_count = 2;
u8 path_a_ok, path_b_ok;
u32 adda_reg[IQK_ADDA_REG_NUM] = {
rFPGA0_XCD_SwitchControl, rBlue_Tooth,
@@ -1004,12 +1004,6 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
rFPGA0_XAB_RFInterfaceSW, rFPGA0_XA_RFInterfaceOE,
rFPGA0_XB_RFInterfaceOE, rFPGA0_RFMOD};

- u32 retry_count = 9;
- if (*(dm_odm->mp_mode) == 1)
- retry_count = 9;
- else
- retry_count = 2;
-
if (t == 0) {

/* Save ADDA parameters, turn Path A ADDA on */
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
index d04b7fb..9ab9218 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
@@ -94,11 +94,6 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
if (hal_data->AntDivCfg)
pdmpriv->InitODMFlag |= ODM_BB_ANT_DIV;

- if (Adapter->registrypriv.mp_mode == 1) {
- pdmpriv->InitODMFlag = ODM_RF_CALIBRATION |
- ODM_RF_TX_PWR_TRACK;
- }
-
dm_odm->SupportAbility = pdmpriv->InitODMFlag;

dm_odm->pNumTxBytesUnicast = &Adapter->xmitpriv.tx_bytes;
@@ -109,7 +104,6 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
dm_odm->pBandWidth = (u8 *)&hal_data->CurrentChannelBW;
dm_odm->pChannel = &hal_data->CurrentChannel;
dm_odm->pbNet_closed = (bool *)&Adapter->net_closed;
- dm_odm->mp_mode = &Adapter->registrypriv.mp_mode;
dm_odm->pbScanInProcess = (bool *)&pmlmepriv->bScanInProcess;
dm_odm->pbPowerSaving = (bool *)&pwrctrlpriv->bpower_saving;
dm_odm->AntDivType = hal_data->TRxAntDivType;
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
index 85650b2..7a704d9 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
@@ -177,11 +177,9 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
int bmcst = IS_MCAST(pattrib->ra);

- if (adapt->registrypriv.mp_mode == 0) {
- if ((!bagg_pkt) && (urb_zero_packet_chk(adapt, sz) == 0)) {
- ptxdesc = (struct tx_desc *)(pmem+PACKET_OFFSET_SZ);
- pull = 1;
- }
+ if ((!bagg_pkt) && (urb_zero_packet_chk(adapt, sz) == 0)) {
+ ptxdesc = (struct tx_desc *)(pmem+PACKET_OFFSET_SZ);
+ pull = 1;
}

memset(ptxdesc, 0, sizeof(struct tx_desc));
@@ -197,11 +195,9 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag
if (bmcst)
ptxdesc->txdw0 |= cpu_to_le32(BMC);

- if (adapt->registrypriv.mp_mode == 0) {
- if (!bagg_pkt) {
- if ((pull) && (pxmitframe->pkt_offset > 0))
- pxmitframe->pkt_offset = pxmitframe->pkt_offset - 1;
- }
+ if (!bagg_pkt) {
+ if ((pull) && (pxmitframe->pkt_offset > 0))
+ pxmitframe->pkt_offset = pxmitframe->pkt_offset - 1;
}

/* pkt_offset, unit:8 bytes padding */
diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index 3675edb..ae923f3 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -411,12 +411,6 @@ static void _InitRDGSetting(struct adapter *Adapter)
usb_write8(Adapter, REG_RD_RESP_PKT_TH, 0x05);
}

-static void _InitRxSetting(struct adapter *Adapter)
-{
- usb_write32(Adapter, REG_MACID, 0x87654321);
- usb_write32(Adapter, 0x0700, 0x87654321);
-}
-
static void _InitRetryFunction(struct adapter *Adapter)
{
u8 value8;
@@ -715,20 +709,15 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
_InitTxBufferBoundary(Adapter, 0);

HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_DOWNLOAD_FW);
- if (Adapter->registrypriv.mp_mode == 1) {
- _InitRxSetting(Adapter);
- Adapter->bFWReady = false;
- } else {
- status = rtl88eu_download_fw(Adapter);
+ status = rtl88eu_download_fw(Adapter);

- if (status) {
- DBG_88E("%s: Download Firmware failed!!\n", __func__);
- Adapter->bFWReady = false;
- return status;
- }
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Initializeadapt8192CSdio(): Download Firmware Success!!\n"));
- Adapter->bFWReady = true;
+ if (status) {
+ DBG_88E("%s: Download Firmware failed!!\n", __func__);
+ Adapter->bFWReady = false;
+ return status;
}
+ RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Initializeadapt8192CSdio(): Download Firmware Success!!\n"));
+ Adapter->bFWReady = true;
rtl8188e_InitializeFirmwareVars(Adapter);

rtl88eu_phy_mac_config(Adapter);
diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h
index e86419e..090f295 100644
--- a/drivers/staging/rtl8188eu/include/drv_types.h
+++ b/drivers/staging/rtl8188eu/include/drv_types.h
@@ -64,7 +64,6 @@ struct registry_priv {
u8 power_mgnt;
u8 ips_mode;
u8 smart_ps;
- u8 mp_mode;
u8 software_encrypt;
u8 software_decrypt;
u8 acm_method;
diff --git a/drivers/staging/rtl8188eu/include/odm.h b/drivers/staging/rtl8188eu/include/odm.h
index 4fb3bb0..4fcab74 100644
--- a/drivers/staging/rtl8188eu/include/odm.h
+++ b/drivers/staging/rtl8188eu/include/odm.h
@@ -861,7 +861,6 @@ struct odm_dm_struct {
u8 BbSwingIdxCckCurrent;
u8 BbSwingIdxCckBase;
bool BbSwingFlagCck;
- u8 *mp_mode;
/* ODM system resource. */

/* ODM relative time. */
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index 8fc3fad..3e37981 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -165,7 +165,6 @@ static void loadparam(struct adapter *padapter, struct net_device *pnetdev)
registry_par->smart_ps = (u8)rtw_smart_ps;
registry_par->power_mgnt = (u8)rtw_power_mgnt;
registry_par->ips_mode = (u8)rtw_ips_mode;
- registry_par->mp_mode = 0;
registry_par->software_encrypt = (u8)rtw_software_encrypt;
registry_par->software_decrypt = (u8)rtw_software_decrypt;
registry_par->acm_method = (u8)rtw_acm_method;
--
2.7.3

2016-10-19 15:06:26

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 06/37] staging:r8188eu: refactor rtl88eu_phy_iq_calibrate function

is2t local variable always is false.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/phy.c | 57 +------------------------------------
1 file changed, 1 insertion(+), 56 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 8462a91..c344882 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -768,53 +768,6 @@ static void patha_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8],
}
}

-static void pathb_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8],
- u8 final_candidate, bool txonly)
-{
- u32 oldval_1, x, tx1_a, reg;
- s32 y, tx1_c;
-
- if (final_candidate == 0xFF) {
- return;
- } else if (iqkok) {
- oldval_1 = (phy_query_bb_reg(adapt, rOFDM0_XBTxIQImbalance, bMaskDWord) >> 22) & 0x3FF;
-
- x = result[final_candidate][4];
- if ((x & 0x00000200) != 0)
- x = x | 0xFFFFFC00;
- tx1_a = (x * oldval_1) >> 8;
- phy_set_bb_reg(adapt, rOFDM0_XBTxIQImbalance, 0x3FF, tx1_a);
-
- phy_set_bb_reg(adapt, rOFDM0_ECCAThreshold, BIT(27),
- ((x * oldval_1>>7) & 0x1));
-
- y = result[final_candidate][5];
- if ((y & 0x00000200) != 0)
- y = y | 0xFFFFFC00;
-
- tx1_c = (y * oldval_1) >> 8;
-
- phy_set_bb_reg(adapt, rOFDM0_XDTxAFE, 0xF0000000,
- ((tx1_c&0x3C0)>>6));
- phy_set_bb_reg(adapt, rOFDM0_XBTxIQImbalance, 0x003F0000,
- (tx1_c&0x3F));
- phy_set_bb_reg(adapt, rOFDM0_ECCAThreshold, BIT(25),
- ((y * oldval_1>>7) & 0x1));
-
- if (txonly)
- return;
-
- reg = result[final_candidate][6];
- phy_set_bb_reg(adapt, rOFDM0_XBRxIQImbalance, 0x3FF, reg);
-
- reg = result[final_candidate][7] & 0x3F;
- phy_set_bb_reg(adapt, rOFDM0_XBRxIQImbalance, 0xFC00, reg);
-
- reg = (result[final_candidate][7] >> 6) & 0xF;
- phy_set_bb_reg(adapt, rOFDM0_AGCRSSITable, 0x0000F000, reg);
- }
-}
-
static void save_adda_registers(struct adapter *adapt, u32 *addareg,
u32 *backup, u32 register_num)
{
@@ -1232,9 +1185,6 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
rOFDM0_XATxIQImbalance, rOFDM0_XBTxIQImbalance,
rOFDM0_XCTxAFE, rOFDM0_XDTxAFE,
rOFDM0_RxIQExtAnta};
- bool is2t;
-
- is2t = false;

if (!(dm_odm->SupportAbility & ODM_RF_CALIBRATION))
return;
@@ -1267,7 +1217,7 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
is13simular = false;

for (i = 0; i < 3; i++) {
- phy_iq_calibrate(adapt, result, i, is2t);
+ phy_iq_calibrate(adapt, result, i, 0);

if (i == 1) {
is12simular = simularity_compare(adapt, result, 0, 1);
@@ -1324,11 +1274,6 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
if (reg_e94 != 0)
patha_fill_iqk(adapt, pathaok, result, final,
(reg_ea4 == 0));
- if (is2t) {
- if (reg_eb4 != 0)
- pathb_fill_iqk(adapt, pathbok, result, final,
- (reg_ec4 == 0));
- }

chn_index = get_right_chnl_for_iqk(adapt->HalData->CurrentChannel);

--
2.7.3

2016-10-19 15:06:33

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 32/37] staging:r8188eu: remove SET_EARLYMODE_* definitions

These definitions does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/rtl8188e_xmit.h | 16 ----------------
1 file changed, 16 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
index 66205b7..32f7522 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
@@ -28,22 +28,6 @@
#define QSLT_MGNT 0x12
#define QSLT_CMD 0x13

-/* For 88e early mode */
-#define SET_EARLYMODE_PKTNUM(__pAddr, __Value) \
- SET_BITS_TO_LE_4BYTE(__pAddr, 0, 3, __Value)
-#define SET_EARLYMODE_LEN0(__pAddr, __Value) \
- SET_BITS_TO_LE_4BYTE(__pAddr, 4, 12, __Value)
-#define SET_EARLYMODE_LEN1(__pAddr, __Value) \
- SET_BITS_TO_LE_4BYTE(__pAddr, 16, 12, __Value)
-#define SET_EARLYMODE_LEN2_1(__pAddr, __Value) \
- SET_BITS_TO_LE_4BYTE(__pAddr, 28, 4, __Value)
-#define SET_EARLYMODE_LEN2_2(__pAddr, __Value) \
- SET_BITS_TO_LE_4BYTE(__pAddr+4, 0, 8, __Value)
-#define SET_EARLYMODE_LEN3(__pAddr, __Value) \
- SET_BITS_TO_LE_4BYTE(__pAddr+4, 8, 12, __Value)
-#define SET_EARLYMODE_LEN4(__pAddr, __Value) \
- SET_BITS_TO_LE_4BYTE(__pAddr+4, 20, 12, __Value)
-
/* */
/* defined for TX DESC Operation */
/* */
--
2.7.3

2016-10-19 15:10:16

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 21/37] staging:r8188eu: change recvframe_pull_tail last argument type

uint instead of int used.
This function always called with positive sz argument.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/rtw_recv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 9a7aa9e..0804e88 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -292,7 +292,7 @@ static inline u8 *recvframe_put(struct recv_frame *precvframe, uint sz)
return precvframe->rx_tail;
}

-static inline u8 *recvframe_pull_tail(struct recv_frame *precvframe, int sz)
+static inline u8 *recvframe_pull_tail(struct recv_frame *precvframe, uint sz)
{
/* rmv data from rx_tail (by yitsen) */

--
2.7.3

2016-10-19 15:10:32

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 16/37] staging:r8188eu: change recvframe_pull last argument type

uint instead of int used.
This function always called with positive sz argument.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/rtw_recv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 6a34e15..e661635 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -257,7 +257,7 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter);

void rtw_reordering_ctrl_timeout_handler(unsigned long data);

-static inline u8 *recvframe_pull(struct recv_frame *precvframe, int sz)
+static inline u8 *recvframe_pull(struct recv_frame *precvframe, uint sz)
{
/* rx_data += sz; move rx_data sz bytes hereafter */

--
2.7.3

2016-10-19 15:12:16

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 04/37] staging:r8188eu: remove WIFI_MP_* definitions and all corresponding code

fw_state member of mlme_priv
never obtain WIFI_MP_STATE value.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_cmd.c | 4 ---
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(+), 66 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 36109ce..cfa5648 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -1320,10 +1320,6 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *
psta->mac_id = passocsta_rsp->cam_id;

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);

diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
index 6ed23f4..67508a6 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
@@ -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;
diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 691623c..dd71894 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -647,7 +647,6 @@ int sta2sta_data_frame(
int sta2sta_data_frame(struct adapter *adapter, struct recv_frame *precv_frame,
struct sta_info **psta)
{
- u8 *ptr = precv_frame->rx_data;
int ret = _SUCCESS;
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
struct sta_priv *pstapriv = &adapter->stapriv;
@@ -703,14 +702,6 @@ int sta2sta_data_frame(struct adapter *adapter, struct recv_frame *precv_frame,

sta_addr = pattrib->src;
}
- } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
- memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
- memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
- memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
- memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
- memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
-
- sta_addr = mybssid;
} else {
ret = _FAIL;
}
@@ -799,23 +790,6 @@ static int ap2sta_data_frame(
ret = RTW_RX_HANDLED;
goto exit;
}
- } else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) &&
- (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
- memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
- memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
- memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
- memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
- memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
-
- /* */
- memcpy(pattrib->bssid, mybssid, ETH_ALEN);
-
- *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get sta_info */
- if (*psta == NULL) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't get psta under MP_MODE ; drop pkt\n"));
- ret = _FAIL;
- goto exit;
- }
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* Special case */
ret = RTW_RX_HANDLED;
@@ -1303,8 +1277,6 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
u8 *psnap_type;
struct ieee80211_snap_hdr *psnap;

- struct adapter *adapter = precvframe->adapter;
- struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
u8 *ptr = precvframe->rx_data;
struct rx_pkt_attrib *pattrib = &precvframe->attrib;

@@ -1335,19 +1307,7 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
eth_type = ntohs(be_tmp); /* pattrib->ether_type */
pattrib->eth_type = eth_type;

- if ((check_fwstate(pmlmepriv, WIFI_MP_STATE))) {
- ptr += rmv_len;
- *ptr = 0x87;
- *(ptr+1) = 0x12;
-
- eth_type = 0x8712;
- /* append rx status for mp test packets */
- ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr)+2)-24);
- memcpy(ptr, precvframe->rx_head, 24);
- ptr += 24;
- } else {
- ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0)));
- }
+ ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0)));

memcpy(ptr, pattrib->dst, ETH_ALEN);
memcpy(ptr+ETH_ALEN, pattrib->src, ETH_ALEN);
diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index b60b126..0f73b3f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -530,7 +530,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;
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h
index 9434b86..a30448a 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h
@@ -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
diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index 4de9dbc..6364a05 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -442,7 +442,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) {
;
@@ -1086,12 +1086,6 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
struct ndis_802_11_ssid ssid[RTW_SSID_SCAN_AMOUNT];
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;
--
2.7.3

2016-10-19 15:12:17

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 36/37] staging:r8188eu: remove unused structures from include/rtw_mlme.h

Also SCAN_RESULT_TYPE enum removed.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/rtw_mlme.h | 188 ---------------------------
1 file changed, 188 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h
index d27b2ad..14ead5c 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h
@@ -67,17 +67,6 @@ enum rt_scan_type {
SCAN_MIX,
};

-enum SCAN_RESULT_TYPE {
- SCAN_RESULT_P2P_ONLY = 0, /* Will return all the P2P devices. */
- SCAN_RESULT_ALL = 1, /* Will return all the scanned device,
- * include AP. */
- SCAN_RESULT_WFD_TYPE = 2 /* Will just return the correct WFD
- * device. */
- /* If this device is Miracast sink
- * device, it will just return all the
- * Miracast source devices. */
-};
-
/*
there are several "locks" in mlme_priv,
since mlme_priv is a shared resource between many threads,
@@ -107,183 +96,6 @@ struct rt_link_detect {
* to Tx traffic. */
};

-struct profile_info {
- u8 ssidlen;
- u8 ssid[WLAN_SSID_MAXLEN];
- u8 peermac[ETH_ALEN];
-};
-
-struct tx_invite_req_info {
- u8 token;
- u8 benable;
- u8 go_ssid[WLAN_SSID_MAXLEN];
- u8 ssidlen;
- u8 go_bssid[ETH_ALEN];
- u8 peer_macaddr[ETH_ALEN];
- u8 operating_ch; /* This information will be set by using the
- * p2p_set op_ch=x */
- u8 peer_ch; /* The listen channel for peer P2P device */
-};
-
-struct tx_invite_resp_info {
- u8 token; /* Used to record the dialog token of p2p invitation
- * request frame. */
-};
-
-struct tx_provdisc_req_info {
- u16 wps_config_method_request; /* Used when sending the
- * provisioning request frame*/
- u16 peer_channel_num[2]; /* The channel number which the
- * receiver stands. */
- struct ndis_802_11_ssid ssid;
- u8 peerDevAddr[ETH_ALEN]; /* Peer device address */
- u8 peerIFAddr[ETH_ALEN]; /* Peer interface address */
- u8 benable; /* This provision discovery
- * request frame is trigger
- * to send or not */
-};
-
-/* When peer device issue prov_disc_req first, we should store the following
- * information */
-/* The UI must know this information to know which config method the
- * remote p2p device needs. */
-struct rx_provdisc_req_info {
- u8 peerDevAddr[ETH_ALEN]; /* Peer device address */
- u8 strconfig_method_desc_of_prov_disc_req[4]; /* description
- * for the config method located in the provisioning
- * discovery request frame. */
-};
-
-struct tx_nego_req_info {
- u16 peer_channel_num[2]; /* The channel number. */
- u8 peerDevAddr[ETH_ALEN]; /* Peer device address */
- u8 benable; /* This negotiation request frame is
- * trigger to send or not */
-};
-
-struct group_id_info {
- u8 go_device_addr[ETH_ALEN]; /* The GO's device address of
- * this P2P group */
- u8 ssid[WLAN_SSID_MAXLEN]; /* The SSID of this P2P group */
-};
-
-struct scan_limit_info {
- u8 scan_op_ch_only; /* When this flag is set, the driver
- * should only scan the op. channel */
- u8 operation_ch[2]; /* Store the op. chan of invitation */
-};
-
-struct wifidirect_info {
- struct adapter *padapter;
- struct timer_list find_phase_timer;
- struct timer_list restore_p2p_state_timer;
-
- /* Used to do the scanning. After confirming the peer is availalble,
- * the driver transmits the P2P frame to peer. */
- struct timer_list pre_tx_scan_timer;
- struct timer_list reset_ch_sitesurvey;
- struct timer_list reset_ch_sitesurvey2; /* Just for resetting the scan
- * limit function by using p2p nego */
- struct tx_provdisc_req_info tx_prov_disc_info;
- struct rx_provdisc_req_info rx_prov_disc_info;
- struct tx_invite_req_info invitereq_info;
- /* Store the profile information of persistent group */
- struct profile_info profileinfo[P2P_MAX_PERSISTENT_GROUP_NUM];
- struct tx_invite_resp_info inviteresp_info;
- struct tx_nego_req_info nego_req_info;
- /* Store the group id info when doing the group negot handshake. */
- struct group_id_info groupid_info;
- /* Used for get the limit scan channel from the Invitation procedure */
- struct scan_limit_info rx_invitereq_info;
- /* Used for get the limit scan chan from the P2P negotiation handshake*/
- struct scan_limit_info p2p_info;
- enum P2P_ROLE role;
- enum P2P_STATE pre_p2p_state;
- enum P2P_STATE p2p_state;
- /* The device address should be the mac address of this device. */
- u8 device_addr[ETH_ALEN];
- u8 interface_addr[ETH_ALEN];
- u8 social_chan[4];
- u8 listen_channel;
- u8 operating_channel;
- u8 listen_dwell; /* This value should be between 1 and 3 */
- u8 support_rate[8];
- u8 p2p_wildcard_ssid[P2P_WILDCARD_SSID_LEN];
- u8 intent; /* should only include the intent value. */
- u8 p2p_peer_interface_addr[ETH_ALEN];
- u8 p2p_peer_device_addr[ETH_ALEN];
- u8 peer_intent; /* Included the intent value and tie breaker value. */
- /* Device name for displaying on searching device screen */
- u8 device_name[WPS_MAX_DEVICE_NAME_LEN];
- u8 device_name_len;
- u8 profileindex; /* Used to point to the index of profileinfo array */
- u8 peer_operating_ch;
- u8 find_phase_state_exchange_cnt;
- /* The device password ID for group negotiation */
- u16 device_password_id_for_nego;
- u8 negotiation_dialog_token;
- /* SSID information for group negotitation */
- u8 nego_ssid[WLAN_SSID_MAXLEN];
- u8 nego_ssidlen;
- u8 p2p_group_ssid[WLAN_SSID_MAXLEN];
- u8 p2p_group_ssid_len;
- /* Flag to know if the persistent function should be supported or not.*/
- u8 persistent_supported;
- /* In the Sigma test, the Sigma will provide this enable from the
- * sta_set_p2p CAPI. */
- /* 0: disable */
- /* 1: enable */
- u8 session_available; /* Flag to set the WFD session available to
- * enable or disable "by Sigma" */
- /* In the Sigma test, the Sigma will disable the session available
- * by using the sta_preset CAPI. */
- /* 0: disable */
- /* 1: enable */
- u8 wfd_tdls_enable; /* Flag to enable or disable the TDLS by WFD Sigma*/
- /* 0: disable */
- /* 1: enable */
- u8 wfd_tdls_weaksec; /* Flag to enable or disable the weak security
- * function for TDLS by WFD Sigma */
- /* 0: disable */
- /* In this case, the driver can't issue the tdsl
- * setup request frame. */
- /* 1: enable */
- /* In this case, the driver can issue the tdls
- * setup request frame */
- /* even the current security is weak security. */
-
- /* This field will store the WPS value (PIN value or PBC) that UI had
- * got from the user. */
- enum P2P_WPSINFO ui_got_wps_info;
- u16 supported_wps_cm; /* This field describes the WPS config method
- * which this driver supported. */
- /* The value should be the combination of config
- * method defined in page104 of WPS v2.0 spec.*/
- /* This field will contain the length of body of P2P Channel List
- * attribute of group negotiation response frame. */
- uint channel_list_attr_len;
- /* This field will contain the body of P2P Channel List attribute of
- * group negotitation response frame. */
- /* We will use the channel_cnt and channel_list fields when constructing
- * the group negotiation confirm frame. */
- u8 channel_list_attr[100];
- enum P2P_PS_MODE p2p_ps_mode; /* indicate p2p ps mode */
- enum P2P_PS_STATE p2p_ps_state; /* indicate p2p ps state */
- u8 noa_index; /* Identifies and instance of Notice of Absence timing. */
- u8 ctwindow; /* Client traffic window. A period of time in TU after TBTT. */
- u8 opp_ps; /* opportunistic power save. */
- u8 noa_num; /* number of NoA descriptor in P2P IE. */
- u8 noa_count[P2P_MAX_NOA_NUM]; /* Count for owner, Type of client. */
- /* Max duration for owner, preferred or min acceptable duration for
- * client. */
- u32 noa_duration[P2P_MAX_NOA_NUM];
- /* Length of interval for owner, preferred or max acceptable interval
- * of client. */
- u32 noa_interval[P2P_MAX_NOA_NUM];
- /* schedule expressed in terms of the lower 4 bytes of the TSF timer. */
- u32 noa_start_time[P2P_MAX_NOA_NUM];
-};
-
struct mlme_priv {
spinlock_t lock;
int fw_state; /* shall we protect this variable? maybe not necessarily... */
--
2.7.3

2016-10-19 15:06:31

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 37/37] staging:r8188eu: remove P2P_* enumerations.

Driver does not use this definitions.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/wifi.h | 73 --------------------------------
1 file changed, 73 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/wifi.h b/drivers/staging/rtl8188eu/include/wifi.h
index 9e08e68..cc5621c 100644
--- a/drivers/staging/rtl8188eu/include/wifi.h
+++ b/drivers/staging/rtl8188eu/include/wifi.h
@@ -855,64 +855,6 @@ enum ht_cap_ampdu_factor {
#define WPS_CM_SW_DISPLAY_P 0x2008
#define WPS_CM_LCD_DISPLAY_P 0x4008

-enum P2P_ROLE {
- P2P_ROLE_DISABLE = 0,
- P2P_ROLE_DEVICE = 1,
- P2P_ROLE_CLIENT = 2,
- P2P_ROLE_GO = 3
-};
-
-enum P2P_STATE {
- P2P_STATE_NONE = 0, /* P2P disable */
- /* P2P had enabled and do nothing */
- P2P_STATE_IDLE = 1,
- P2P_STATE_LISTEN = 2, /* In pure listen state */
- P2P_STATE_SCAN = 3, /* In scan phase */
- /* In the listen state of find phase */
- P2P_STATE_FIND_PHASE_LISTEN = 4,
- /* In the search state of find phase */
- P2P_STATE_FIND_PHASE_SEARCH = 5,
- /* In P2P provisioning discovery */
- P2P_STATE_TX_PROVISION_DIS_REQ = 6,
- P2P_STATE_RX_PROVISION_DIS_RSP = 7,
- P2P_STATE_RX_PROVISION_DIS_REQ = 8,
- /* Doing the group owner negotiation handshake */
- P2P_STATE_GONEGO_ING = 9,
- /* finish the group negotiation handshake with success */
- P2P_STATE_GONEGO_OK = 10,
- /* finish the group negotiation handshake with failure */
- P2P_STATE_GONEGO_FAIL = 11,
- /* receiving the P2P Invitation request and match with the profile. */
- P2P_STATE_RECV_INVITE_REQ_MATCH = 12,
- /* Doing the P2P WPS */
- P2P_STATE_PROVISIONING_ING = 13,
- /* Finish the P2P WPS */
- P2P_STATE_PROVISIONING_DONE = 14,
- /* Transmit the P2P Invitation request */
- P2P_STATE_TX_INVITE_REQ = 15,
- /* Receiving the P2P Invitation response */
- P2P_STATE_RX_INVITE_RESP_OK = 16,
- /* receiving the P2P Invitation request and dismatch with the profile. */
- P2P_STATE_RECV_INVITE_REQ_DISMATCH = 17,
- /* receiving the P2P Invitation request and this wifi is GO. */
- P2P_STATE_RECV_INVITE_REQ_GO = 18,
- /* receiving the P2P Invitation request to join an existing P2P Group. */
- P2P_STATE_RECV_INVITE_REQ_JOIN = 19,
- /* receiving the P2P Invitation response with failure */
- P2P_STATE_RX_INVITE_RESP_FAIL = 20,
- /* receiving p2p negotiation response with information is not available */
- P2P_STATE_RX_INFOR_NOREADY = 21,
- /* sending p2p negotiation response with information is not available */
- P2P_STATE_TX_INFOR_NOREADY = 22,
-};
-
-enum P2P_WPSINFO {
- P2P_NO_WPSINFO = 0,
- P2P_GOT_WPSINFO_PEER_DISPLAY_PIN = 1,
- P2P_GOT_WPSINFO_SELF_DISPLAY_PIN = 2,
- P2P_GOT_WPSINFO_PBC = 3,
-};
-
#define P2P_PRIVATE_IOCTL_SET_LEN 64

enum P2P_PROTO_WK_ID {
@@ -925,21 +867,6 @@ enum P2P_PROTO_WK_ID {
P2P_RO_CH_WK = 6,
};

-enum P2P_PS_STATE {
- P2P_PS_DISABLE = 0,
- P2P_PS_ENABLE = 1,
- P2P_PS_SCAN = 2,
- P2P_PS_SCAN_DONE = 3,
- P2P_PS_ALLSTASLEEP = 4, /* for P2P GO */
-};
-
-enum P2P_PS_MODE {
- P2P_PS_NONE = 0,
- P2P_PS_CTWINDOW = 1,
- P2P_PS_NOA = 2,
- P2P_PS_MIX = 3, /* CTWindow and NoA */
-};
-
/* =====================WFD Section===================== */
/* For Wi-Fi Display */
#define WFD_ATTR_DEVICE_INFO 0x00
--
2.7.3

2016-10-19 15:13:12

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 27/37] staging:r8188eu: remove recvframe_put function

skb_put used instead.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 2 +-
drivers/staging/rtl8188eu/include/rtw_recv.h | 17 -----------------
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 2 +-
3 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 1d29808..3f7812f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1380,7 +1380,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,
/* memcpy */
memcpy(pfhdr->pkt->tail, pnfhdr->pkt->data, pnfhdr->pkt->len);

- recvframe_put(prframe, pnfhdr->pkt->len);
+ skb_put(prframe->pkt, pnfhdr->pkt->len);

pfhdr->attrib.icv_len = pnfhdr->attrib.icv_len;
plist = plist->next;
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index f0ce2e6..5357a8d 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -253,23 +253,6 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter);

void rtw_reordering_ctrl_timeout_handler(unsigned long data);

-static inline u8 *recvframe_put(struct recv_frame *precvframe, uint sz)
-{
- /* used for append sz bytes from ptr to rx_tail, update rx_tail
- * and return the updated rx_tail to the caller */
- /* after putting, rx_tail must be still larger than rx_end. */
-
- u8 *tail;
-
- if (precvframe == NULL)
- return NULL;
-
- tail = skb_put(precvframe->pkt, sz);
- if (!tail)
- return NULL;
- return tail;
-}
-
static inline void recvframe_pull_tail(struct recv_frame *precvframe, uint sz)
{
/* rmv data from rx_tail (by yitsen) */
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 572a89f..2f29968 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -132,7 +132,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
goto _exit_recvbuf2recvframe;
}

- recvframe_put(precvframe, skb_len);
+ skb_put(precvframe->pkt, skb_len);

switch (haldata->UsbRxAggMode) {
case USB_RX_AGG_DMA:
--
2.7.3

2016-10-19 15:13:37

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 03/37] staging:r8188eu: remove skb cloning after netdev_alloc_skb fail

In accordance with the KISS principle.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index f19b203..4b078b5 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -132,22 +132,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);
--
2.7.3

2016-10-19 15:06:18

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 30/37] staging:r8188eu: remove eth_type member of rx_pkt_attrib structure

Prepare to replacing wlanhdr_to_ethhdr by ieee80211_data_to_8023.
Calculate it locally.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 26 ++++++++++++++++++++------
drivers/staging/rtl8188eu/include/rtw_recv.h | 2 --
2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 630d9eb..2de4289 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1267,7 +1267,7 @@ static int validate_recv_frame(struct adapter *adapter,
static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
{
int rmv_len;
- u16 eth_type, len;
+ u16 len;
__be16 be_tmp;
u8 bsnaphdr;
u8 *psnap_type;
@@ -1296,10 +1296,6 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
("\n===pattrib->hdrlen: %x===\n\n", pattrib->hdrlen));

- memcpy(&be_tmp, ptr+rmv_len, 2);
- eth_type = ntohs(be_tmp); /* pattrib->ether_type */
- pattrib->eth_type = eth_type;
-
ptr = skb_pull(precvframe->pkt, (rmv_len-sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0)));

memcpy(ptr, pattrib->dst, ETH_ALEN);
@@ -1745,14 +1741,32 @@ static int recv_indicatepkt_reorder(struct adapter *padapter,
struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;

if (!pattrib->amsdu) {
+ u16 eth_type;
+ u8 *ptr = prframe->pkt->data;
+ u8 *psnap_type;
+ int eth_type_offset;
+ struct ieee80211_snap_hdr *psnap;
+
/* s1. */
strip_iv_icv(prframe->pkt, prframe->attrib.hdrlen,
prframe->attrib.iv_len,
prframe->attrib.encrypt ? prframe->attrib.icv_len : 0);

+ psnap = (struct ieee80211_snap_hdr *)(ptr + pattrib->hdrlen);
+ psnap_type = ptr + pattrib->hdrlen + SNAP_SIZE;
+ eth_type_offset = pattrib->hdrlen;
+
+ if ((!memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) &&
+ (!memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == false) &&
+ (!memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2) == false)) ||
+ !memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE))
+ eth_type_offset += SNAP_SIZE;
+
+ eth_type = ntohs(*(__be16 *)(ptr + eth_type_offset));
+
wlanhdr_to_ethhdr(prframe);

- if ((pattrib->qos != 1) || (pattrib->eth_type == 0x0806) ||
+ if ((pattrib->qos != 1) || eth_type == 0x0806 ||
(pattrib->ack_policy != 0)) {
if ((!padapter->bDriverStopped) &&
(!padapter->bSurpriseRemoved)) {
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 748c014e..b86ec85 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -112,8 +112,6 @@ struct rx_pkt_attrib {
u8 crc_err;
u8 icv_err;

- u16 eth_type;
-
u8 dst[ETH_ALEN];
u8 src[ETH_ALEN];
u8 ta[ETH_ALEN];
--
2.7.3

2016-10-19 15:16:30

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call

netdev_alloc_skb function
already set dev member of pkt_copy.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 34198fe..f19b203 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -123,7 +123,6 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)

pkt_copy = netdev_alloc_skb(adapt->pnetdev, alloc_sz);
if (pkt_copy) {
- pkt_copy->dev = adapt->pnetdev;
precvframe->pkt = pkt_copy;
precvframe->rx_head = pkt_copy->data;
precvframe->rx_end = pkt_copy->data + alloc_sz;
--
2.7.3

2016-10-19 15:17:02

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 10/37] staging:r8188eu: remove type cast for first argument of memset

Typecasting here is unnecessary.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_ap.c | 2 +-
drivers/staging/rtl8188eu/core/rtw_efuse.c | 2 +-
drivers/staging/rtl8188eu/core/rtw_mlme.c | 10 +++++-----
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 4 ++--
drivers/staging/rtl8188eu/core/rtw_recv.c | 2 +-
drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 2 +-
drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 +-
drivers/staging/rtl8188eu/core/rtw_xmit.c | 2 +-
drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 2 +-
9 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c
index 553e8d5..fe1ba9e 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -1852,7 +1852,7 @@ void stop_ap_mode(struct adapter *padapter)
pmlmeext->bstart_bss = false;

/* reset and init security priv , this can refine with rtw_reset_securitypriv */
- memset((unsigned char *)&padapter->securitypriv, 0, sizeof(struct security_priv));
+ memset(&padapter->securitypriv, 0, sizeof(struct security_priv));
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;

diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c b/drivers/staging/rtl8188eu/core/rtw_efuse.c
index 16cc770..6953f7f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c
@@ -786,7 +786,7 @@ hal_EfusePgCheckAvailableAddr(

static void hal_EfuseConstructPGPkt(u8 offset, u8 word_en, u8 *pData, struct pgpkt *pTargetPkt)
{
- memset((void *)pTargetPkt->data, 0xFF, sizeof(u8)*8);
+ memset(pTargetPkt->data, 0xFF, sizeof(u8)*8);
pTargetPkt->offset = offset;
pTargetPkt->word_en = word_en;
efuse_WordEnableDataRead(word_en, pData, pTargetPkt->data);
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index 032f783..249e004 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -892,11 +892,11 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
padapter->securitypriv.bgrpkey_handshake = false;
psta->ieee8021x_blocked = true;
psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
- memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype));
- memset((u8 *)&psta->dot11tkiprxmickey, 0, sizeof(union Keytype));
- memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof(union Keytype));
- memset((u8 *)&psta->dot11txpn, 0, sizeof(union pn48));
- memset((u8 *)&psta->dot11rxpn, 0, sizeof(union pn48));
+ memset(&psta->dot118021x_UncstKey, 0, sizeof(union Keytype));
+ memset(&psta->dot11tkiprxmickey, 0, sizeof(union Keytype));
+ memset(&psta->dot11tkiptxmickey, 0, sizeof(union Keytype));
+ memset(&psta->dot11txpn, 0, sizeof(union pn48));
+ memset(&psta->dot11rxpn, 0, sizeof(union pn48));
}
/*
* Commented by Albert 2012/07/21
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index c94700c..0bb24fa 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -199,7 +199,7 @@ void update_mgntframe_attrib(struct adapter *padapter, struct pkt_attrib *pattri
{
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);

- memset((u8 *)(pattrib), 0, sizeof(struct pkt_attrib));
+ memset(pattrib, 0, sizeof(struct pkt_attrib));

pattrib->hdrlen = 24;
pattrib->nr_frags = 1;
@@ -2847,7 +2847,7 @@ static unsigned int OnAuth(struct adapter *padapter,
rtw_free_stainfo(padapter, pstat);

pstat = &stat;
- memset((char *)pstat, '\0', sizeof(stat));
+ memset(pstat, '\0', sizeof(stat));
pstat->auth_seq = 2;
memcpy(pstat->hwaddr, sa, 6);

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index dd71894..74220f3 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -44,7 +44,7 @@ static void rtw_signal_stat_timer_hdl(unsigned long data);
void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
{

- memset((u8 *)psta_recvpriv, 0, sizeof(struct sta_recv_priv));
+ memset(psta_recvpriv, 0, sizeof(struct sta_recv_priv));

spin_lock_init(&psta_recvpriv->lock);

diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
index 941d1a0..43cace2 100644
--- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
@@ -24,7 +24,7 @@

static void _rtw_init_stainfo(struct sta_info *psta)
{
- memset((u8 *)psta, 0, sizeof(struct sta_info));
+ memset(psta, 0, sizeof(struct sta_info));

spin_lock_init(&psta->lock);
INIT_LIST_HEAD(&psta->list);
diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 2a65ac7..b62569b 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -507,7 +507,7 @@ void flush_all_cam_entry(struct adapter *padapter)

rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, NULL);

- memset((u8 *)(pmlmeinfo->FW_sta_info), 0, sizeof(pmlmeinfo->FW_sta_info));
+ memset(pmlmeinfo->FW_sta_info, 0, sizeof(pmlmeinfo->FW_sta_info));
}

int WMM_param_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE)
diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 0f73b3f..6697c86 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -33,7 +33,7 @@ static void _init_txservq(struct tx_servq *ptxservq)

void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv)
{
- memset((unsigned char *)psta_xmitpriv, 0, sizeof(struct sta_xmit_priv));
+ memset(psta_xmitpriv, 0, sizeof(struct sta_xmit_priv));
spin_lock_init(&psta_xmitpriv->lock);
_init_txservq(&psta_xmitpriv->be_q);
_init_txservq(&psta_xmitpriv->bk_q);
diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
index bc75626..ef29f15 100644
--- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
@@ -60,7 +60,7 @@ void rtw_reset_securitypriv(struct adapter *adapter)
backup_index = adapter->securitypriv.PMKIDIndex;
backup_counter = adapter->securitypriv.btkip_countermeasure;
backup_time = adapter->securitypriv.btkip_countermeasure_time;
- memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv));
+ memset(&adapter->securitypriv, 0, sizeof(struct security_priv));

/* Restore the PMK information to securitypriv structure for the following connection. */
memcpy(&adapter->securitypriv.PMKIDList[0],
--
2.7.3

2016-10-19 15:06:11

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 07/37] staging:r8188eu: remove is2t argument if the phy_iq_calibrate function

is2t argument of this function is constant.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/phy.c | 101 +++---------------------------------
1 file changed, 6 insertions(+), 95 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index c344882..6c6becf 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -687,41 +687,6 @@ static u8 phy_path_a_rx_iqk(struct adapter *adapt, bool configPathB)
return result;
}

-static u8 phy_path_b_iqk(struct adapter *adapt)
-{
- u32 regeac, regeb4, regebc, regec4, regecc;
- u8 result = 0x00;
- struct odm_dm_struct *dm_odm = &adapt->HalData->odmpriv;
-
- /* One shot, path B LOK & IQK */
- phy_set_bb_reg(adapt, rIQK_AGC_Cont, bMaskDWord, 0x00000002);
- phy_set_bb_reg(adapt, rIQK_AGC_Cont, bMaskDWord, 0x00000000);
-
- mdelay(IQK_DELAY_TIME_88E);
-
- regeac = phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord);
- regeb4 = phy_query_bb_reg(adapt, rTx_Power_Before_IQK_B, bMaskDWord);
- regebc = phy_query_bb_reg(adapt, rTx_Power_After_IQK_B, bMaskDWord);
- regec4 = phy_query_bb_reg(adapt, rRx_Power_Before_IQK_B_2, bMaskDWord);
- regecc = phy_query_bb_reg(adapt, rRx_Power_After_IQK_B_2, bMaskDWord);
-
- if (!(regeac & BIT(31)) &&
- (((regeb4 & 0x03FF0000)>>16) != 0x142) &&
- (((regebc & 0x03FF0000)>>16) != 0x42))
- result |= 0x01;
- else
- return result;
-
- if (!(regeac & BIT(30)) &&
- (((regec4 & 0x03FF0000)>>16) != 0x132) &&
- (((regecc & 0x03FF0000)>>16) != 0x36))
- result |= 0x02;
- else
- ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION,
- ODM_DBG_LOUD, ("Path B Rx IQK fail!!\n"));
- return result;
-}
-
static void patha_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8],
u8 final_candidate, bool txonly)
{
@@ -839,14 +804,6 @@ static void mac_setting_calibration(struct adapter *adapt, u32 *mac_reg, u32 *ba
usb_write8(adapt, mac_reg[i], (u8)(backup[i]&(~BIT(5))));
}

-static void path_a_standby(struct adapter *adapt)
-{
-
- phy_set_bb_reg(adapt, rFPGA0_IQK, bMaskDWord, 0x0);
- phy_set_bb_reg(adapt, 0x840, bMaskDWord, 0x00010000);
- phy_set_bb_reg(adapt, rFPGA0_IQK, bMaskDWord, 0x80800000);
-}
-
static void pi_mode_switch(struct adapter *adapt, bool pi_mode)
{
u32 mode;
@@ -930,12 +887,11 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8],
}
}

-static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
- u8 t, bool is2t)
+static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8], u8 t)
{
struct odm_dm_struct *dm_odm = &adapt->HalData->odmpriv;
u32 i, retry_count = 2;
- u8 path_a_ok, path_b_ok;
+ u8 path_a_ok;
u32 adda_reg[IQK_ADDA_REG_NUM] = {
rFPGA0_XCD_SwitchControl, rBlue_Tooth,
rRx_Wait_CCA, rTx_CCK_RFON,
@@ -968,7 +924,7 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
dm_odm->RFCalibrateInfo.IQK_BB_backup, IQK_BB_REG_NUM);
}

- path_adda_on(adapt, adda_reg, true, is2t);
+ path_adda_on(adapt, adda_reg, true, 0);
if (t == 0)
dm_odm->RFCalibrateInfo.bRfPiEnable = (u8)phy_query_bb_reg(adapt, rFPGA0_XA_HSSIParameter1,
BIT(8));
@@ -989,13 +945,6 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
phy_set_bb_reg(adapt, rFPGA0_XA_RFInterfaceOE, BIT(10), 0x00);
phy_set_bb_reg(adapt, rFPGA0_XB_RFInterfaceOE, BIT(10), 0x00);

- if (is2t) {
- phy_set_bb_reg(adapt, rFPGA0_XA_LSSIParameter, bMaskDWord,
- 0x00010000);
- phy_set_bb_reg(adapt, rFPGA0_XB_LSSIParameter, bMaskDWord,
- 0x00010000);
- }
-
/* MAC settings */
mac_setting_calibration(adapt, iqk_mac_reg,
dm_odm->RFCalibrateInfo.IQK_MAC_backup);
@@ -1004,16 +953,13 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
/* AP or IQK */
phy_set_bb_reg(adapt, rConfig_AntA, bMaskDWord, 0x0f600000);

- if (is2t)
- phy_set_bb_reg(adapt, rConfig_AntB, bMaskDWord, 0x0f600000);
-
/* IQ calibration setting */
phy_set_bb_reg(adapt, rFPGA0_IQK, bMaskDWord, 0x80800000);
phy_set_bb_reg(adapt, rTx_IQK, bMaskDWord, 0x01007c00);
phy_set_bb_reg(adapt, rRx_IQK, bMaskDWord, 0x81004800);

for (i = 0; i < retry_count; i++) {
- path_a_ok = phy_path_a_iqk(adapt, is2t);
+ path_a_ok = phy_path_a_iqk(adapt, 0);
if (path_a_ok == 0x01) {
result[t][0] = (phy_query_bb_reg(adapt, rTx_Power_Before_IQK_A,
bMaskDWord)&0x3FF0000)>>16;
@@ -1024,7 +970,7 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
}

for (i = 0; i < retry_count; i++) {
- path_a_ok = phy_path_a_rx_iqk(adapt, is2t);
+ path_a_ok = phy_path_a_rx_iqk(adapt, 0);
if (path_a_ok == 0x03) {
result[t][2] = (phy_query_bb_reg(adapt, rRx_Power_Before_IQK_A_2,
bMaskDWord)&0x3FF0000)>>16;
@@ -1042,38 +988,6 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
("Path A IQK failed!!\n"));
}

- if (is2t) {
- path_a_standby(adapt);
-
- /* Turn Path B ADDA on */
- path_adda_on(adapt, adda_reg, false, is2t);
-
- for (i = 0; i < retry_count; i++) {
- path_b_ok = phy_path_b_iqk(adapt);
- if (path_b_ok == 0x03) {
- result[t][4] = (phy_query_bb_reg(adapt, rTx_Power_Before_IQK_B,
- bMaskDWord)&0x3FF0000)>>16;
- result[t][5] = (phy_query_bb_reg(adapt, rTx_Power_After_IQK_B,
- bMaskDWord)&0x3FF0000)>>16;
- result[t][6] = (phy_query_bb_reg(adapt, rRx_Power_Before_IQK_B_2,
- bMaskDWord)&0x3FF0000)>>16;
- result[t][7] = (phy_query_bb_reg(adapt, rRx_Power_After_IQK_B_2,
- bMaskDWord)&0x3FF0000)>>16;
- break;
- } else if (i == (retry_count - 1) && path_b_ok == 0x01) { /* Tx IQK OK */
- result[t][4] = (phy_query_bb_reg(adapt, rTx_Power_Before_IQK_B,
- bMaskDWord)&0x3FF0000)>>16;
- result[t][5] = (phy_query_bb_reg(adapt, rTx_Power_After_IQK_B,
- bMaskDWord)&0x3FF0000)>>16;
- }
- }
-
- if (0x00 == path_b_ok) {
- ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
- ("Path B IQK failed!!\n"));
- }
- }
-
/* Back to BB mode, load original value */
phy_set_bb_reg(adapt, rFPGA0_IQK, bMaskDWord, 0);

@@ -1099,9 +1013,6 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
/* Restore RX initial gain */
phy_set_bb_reg(adapt, rFPGA0_XA_LSSIParameter,
bMaskDWord, 0x00032ed3);
- if (is2t)
- phy_set_bb_reg(adapt, rFPGA0_XB_LSSIParameter,
- bMaskDWord, 0x00032ed3);

/* load 0xe30 IQC default value */
phy_set_bb_reg(adapt, rTx_IQK_Tone_A, bMaskDWord, 0x01008c00);
@@ -1217,7 +1128,7 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
is13simular = false;

for (i = 0; i < 3; i++) {
- phy_iq_calibrate(adapt, result, i, 0);
+ phy_iq_calibrate(adapt, result, i);

if (i == 1) {
is12simular = simularity_compare(adapt, result, 0, 1);
--
2.7.3

2016-10-19 15:06:08

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 13/37] staging:r8188eu: remove debug messages after memory allocation failed

These messages are redundant.
Also break rtw_usb_if1_init function if HalData allocation failed.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_efuse.c | 4 +---
drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c | 4 +---
drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c | 2 --
drivers/staging/rtl8188eu/os_dep/osdep_service.c | 4 +---
drivers/staging/rtl8188eu/os_dep/usb_intf.c | 2 +-
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 1 -
6 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c b/drivers/staging/rtl8188eu/core/rtw_efuse.c
index 6953f7f..471f9c8 100644
--- a/drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c
@@ -103,10 +103,8 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf)
return;

eFuseWord = (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
- if (!eFuseWord) {
- DBG_88E("%s: alloc eFuseWord fail!\n", __func__);
+ if (!eFuseWord)
goto eFuseWord_failed;
- }

/* 0. Refresh efuse init map as all oxFF. */
for (i = 0; i < EFUSE_MAX_SECTION_88E; i++)
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
index d0f59b7..210d89b 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
@@ -461,10 +461,8 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)

DBG_88E("%s\n", __func__);
ReservedPagePacket = kzalloc(1000, GFP_KERNEL);
- if (!ReservedPagePacket) {
- DBG_88E("%s: alloc ReservedPagePacket fail!\n", __func__);
+ if (!ReservedPagePacket)
return;
- }

pxmitpriv = &adapt->xmitpriv;
pmlmeext = &adapt->mlmeextpriv;
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
index 0fc093e..a79bb3a 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
@@ -41,8 +41,6 @@ int rtw_hal_init_recv_priv(struct adapter *padapter)
kcalloc(NR_RECVBUFF, sizeof(struct recv_buf), GFP_KERNEL);
if (!precvpriv->precv_buf) {
res = _FAIL;
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_,
- ("alloc recv_buf fail!\n"));
goto exit;
}
precvbuf = precvpriv->precv_buf;
diff --git a/drivers/staging/rtl8188eu/os_dep/osdep_service.c b/drivers/staging/rtl8188eu/os_dep/osdep_service.c
index 7cd2655..8985c80 100644
--- a/drivers/staging/rtl8188eu/os_dep/osdep_service.c
+++ b/drivers/staging/rtl8188eu/os_dep/osdep_service.c
@@ -44,10 +44,8 @@ void *rtw_malloc2d(int h, int w, int size)
int j;

void **a = kzalloc(h*sizeof(void *) + h*w*size, GFP_KERNEL);
- if (!a) {
- pr_info("%s: alloc memory fail!\n", __func__);
+ if (!a)
return NULL;
- }

for (j = 0; j < h; j++)
a[j] = ((char *)(a+h)) + j*w*size;
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index c6316ff..ba72f06 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -354,7 +354,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,

padapter->HalData = kzalloc(sizeof(struct hal_data_8188e), GFP_KERNEL);
if (!padapter->HalData)
- DBG_88E("cant not alloc memory for HAL DATA\n");
+ goto free_adapter;

/* step read_chip_version */
rtw_hal_read_chip_version(padapter);
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 4b078b5..315b077 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -239,7 +239,6 @@ static int usbctrl_vendorreq(struct adapter *adapt, u8 request, u16 value, u16 i
pIo_buf = kmalloc(MAX_USB_IO_CTL_SIZE, GFP_ATOMIC);

if (pIo_buf == NULL) {
- DBG_88E("[%s] pIo_buf == NULL\n", __func__);
status = -ENOMEM;
goto release_mutex;
}
--
2.7.3

2016-10-19 15:17:27

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 19/37] staging:r8188eu: remove rx_end member of recv_frame structure

rx_end replaced with pkt->end.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/rtw_recv.h | 3 +--
drivers/staging/rtl8188eu/os_dep/recv_linux.c | 4 ++--
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 1 -
3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index e6cc3af..ee0d9a56 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -234,7 +234,6 @@ struct recv_frame {
struct rx_pkt_attrib attrib;
uint len;
u8 *rx_tail;
- u8 *rx_end;
struct sta_info *psta;
/* for A-MPDU Rx reordering buffer control */
struct recv_reorder_ctrl *preorder_ctrl;
@@ -285,7 +284,7 @@ static inline u8 *recvframe_put(struct recv_frame *precvframe, int sz)

precvframe->rx_tail += sz;

- if (precvframe->rx_tail > precvframe->rx_end) {
+ if (precvframe->rx_tail > precvframe->pkt->end) {
precvframe->rx_tail -= sz;
return NULL;
}
diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
index 3c41c5e..e405ea9 100644
--- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
@@ -94,8 +94,8 @@ int rtw_recv_indicatepkt(struct adapter *padapter,
("rtw_recv_indicatepkt(): precv_frame->pkt->rx_data =%p\n",
precv_frame->pkt->data));
RT_TRACE(_module_recv_osdep_c_, _drv_info_,
- ("precv_frame->hdr.rx_tail =%p precv_frame->rx_end =%p precv_frame->hdr.len =%d\n",
- precv_frame->rx_tail, precv_frame->rx_end,
+ ("precv_frame->hdr.rx_tail =%p precv_frame->pkt->end =%p precv_frame->hdr.len =%d\n",
+ precv_frame->rx_tail, precv_frame->pkt->end,
precv_frame->len));

skb_set_tail_pointer(skb, precv_frame->len);
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 8ed42e3..45682ac 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -124,7 +124,6 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
pkt_copy = netdev_alloc_skb(adapt->pnetdev, alloc_sz);
if (pkt_copy) {
precvframe->pkt = pkt_copy;
- precvframe->rx_end = pkt_copy->data + alloc_sz;
skb_reserve(pkt_copy, 8 - ((size_t)(pkt_copy->data) & 7));/* force pkt_copy->data at 8-byte alignment address */
skb_reserve(pkt_copy, shift_sz);/* force ip_hdr at 8-byte alignment address according to shift_sz. */
memcpy(pkt_copy->data, (pbuf + pattrib->drvinfo_sz + RXDESC_SIZE), skb_len);
--
2.7.3

2016-10-19 15:18:49

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 11/37] staging:r8188eu: remove is_(multicast|broadcast)_mac_addr

is_multicast_ether_addr used instead.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 3 +--
drivers/staging/rtl8188eu/include/ieee80211.h | 11 -----------
2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 74220f3..9333535 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1023,8 +1023,7 @@ static int validate_recv_mgnt_frame(struct adapter *padapter,
if (!memcmp(padapter->eeprompriv.mac_addr,
GetAddr1Ptr(precv_frame->rx_data), ETH_ALEN))
psta->sta_stats.rx_probersp_pkts++;
- else if (is_broadcast_mac_addr(GetAddr1Ptr(precv_frame->rx_data)) ||
- is_multicast_mac_addr(GetAddr1Ptr(precv_frame->rx_data)))
+ else if (is_multicast_ether_addr(GetAddr1Ptr(precv_frame->rx_data)))
psta->sta_stats.rx_probersp_bm_pkts++;
else
psta->sta_stats.rx_probersp_uo_pkts++;
diff --git a/drivers/staging/rtl8188eu/include/ieee80211.h b/drivers/staging/rtl8188eu/include/ieee80211.h
index fc58621..4c2fe53 100644
--- a/drivers/staging/rtl8188eu/include/ieee80211.h
+++ b/drivers/staging/rtl8188eu/include/ieee80211.h
@@ -623,17 +623,6 @@ enum ieee80211_state {
#define DEFAULT_MAX_SCAN_AGE (15 * HZ)
#define DEFAULT_FTS 2346

-static inline int is_multicast_mac_addr(const u8 *addr)
-{
- return ((addr[0] != 0xff) && (0x01 & addr[0]));
-}
-
-static inline int is_broadcast_mac_addr(const u8 *addr)
-{
- return (addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) &&
- (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff);
-}
-
#define CFG_IEEE80211_RESERVE_FCS (1<<0)
#define CFG_IEEE80211_COMPUTE_FCS (1<<1)

--
2.7.3

2016-10-19 15:06:03

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 20/37] staging:r8188eu: change recvframe_put last argument type

uint instead of int used.
This function always called with positive sz argument.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/rtw_recv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index ee0d9a56..9a7aa9e 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -273,7 +273,7 @@ static inline u8 *recvframe_pull(struct recv_frame *precvframe, uint sz)
return data;
}

-static inline u8 *recvframe_put(struct recv_frame *precvframe, int sz)
+static inline u8 *recvframe_put(struct recv_frame *precvframe, uint sz)
{
/* used for append sz bytes from ptr to rx_tail, update rx_tail
* and return the updated rx_tail to the caller */
--
2.7.3

2016-10-19 15:20:57

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 08/37] staging:r8188eu: refactor path_adda_on function

Remove is_path_a_on and is2t arguments.
These argument always are constant.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/phy.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 6c6becf..6b70d09 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -774,19 +774,13 @@ static void reload_mac_registers(struct adapter *adapt,
usb_write32(adapt, mac_reg[i], backup[i]);
}

-static void path_adda_on(struct adapter *adapt, u32 *adda_reg,
- bool is_path_a_on, bool is2t)
+static void path_adda_on(struct adapter *adapt, u32 *adda_reg)
{
u32 path_on;
u32 i;

- if (!is2t) {
- path_on = 0x0bdb25a0;
- phy_set_bb_reg(adapt, adda_reg[0], bMaskDWord, 0x0b1b25a0);
- } else {
- path_on = is_path_a_on ? 0x04db25a4 : 0x0b1b25a4;
- phy_set_bb_reg(adapt, adda_reg[0], bMaskDWord, path_on);
- }
+ path_on = 0x0bdb25a0;
+ phy_set_bb_reg(adapt, adda_reg[0], bMaskDWord, 0x0b1b25a0);

for (i = 1; i < IQK_ADDA_REG_NUM; i++)
phy_set_bb_reg(adapt, adda_reg[i], bMaskDWord, path_on);
@@ -924,7 +918,7 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8], u8 t)
dm_odm->RFCalibrateInfo.IQK_BB_backup, IQK_BB_REG_NUM);
}

- path_adda_on(adapt, adda_reg, true, 0);
+ path_adda_on(adapt, adda_reg);
if (t == 0)
dm_odm->RFCalibrateInfo.bRfPiEnable = (u8)phy_query_bb_reg(adapt, rFPGA0_XA_HSSIParameter1,
BIT(8));
--
2.7.3

2016-10-19 15:06:00

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 18/37] staging:r8188eu: remove rx_data member of recv_frame structure

rx_data replaced with pkt->data.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 38 ++++++++---------
drivers/staging/rtl8188eu/core/rtw_recv.c | 54 ++++++++++++------------
drivers/staging/rtl8188eu/core/rtw_security.c | 6 +--
drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c | 2 +-
drivers/staging/rtl8188eu/include/rtw_recv.h | 14 +++---
drivers/staging/rtl8188eu/os_dep/mon.c | 2 +-
drivers/staging/rtl8188eu/os_dep/recv_linux.c | 6 +--
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 7 ++-
8 files changed, 62 insertions(+), 67 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 0bb24fa..26639f0 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -2050,7 +2050,7 @@ static u8 collect_bss_info(struct adapter *padapter,
u32 len;
u8 *p;
u16 val16, subtype;
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
u32 packet_len = precv_frame->len;
u8 ie_offset;
struct registry_priv *pregistrypriv = &padapter->registrypriv;
@@ -2557,7 +2557,7 @@ static unsigned int OnProbeReq(struct adapter *padapter,
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct wlan_bssid_ex *cur = &(pmlmeinfo->network);
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
uint len = precv_frame->len;

if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
@@ -2605,7 +2605,7 @@ static unsigned int OnBeacon(struct adapter *padapter,
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct sta_priv *pstapriv = &padapter->stapriv;
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
uint len = precv_frame->len;
struct wlan_bssid_ex *pbss;
int ret = _SUCCESS;
@@ -2702,7 +2702,7 @@ static unsigned int OnAuth(struct adapter *padapter,
struct security_priv *psecuritypriv = &padapter->securitypriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
uint len = precv_frame->len;

if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
@@ -2865,7 +2865,7 @@ static unsigned int OnAuthClient(struct adapter *padapter,
unsigned int go2asoc = 0;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
uint pkt_len = precv_frame->len;

DBG_88E("%s\n", __func__);
@@ -2953,7 +2953,7 @@ static unsigned int OnAssocReq(struct adapter *padapter,
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct wlan_bssid_ex *cur = &(pmlmeinfo->network);
struct sta_priv *pstapriv = &padapter->stapriv;
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
uint pkt_len = precv_frame->len;

if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
@@ -3385,7 +3385,7 @@ static unsigned int OnAssocRsp(struct adapter *padapter,
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
/* struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network); */
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
uint pkt_len = precv_frame->len;

DBG_88E("%s\n", __func__);
@@ -3471,7 +3471,7 @@ static unsigned int OnDeAuth(struct adapter *padapter,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network);

/* check A3 */
@@ -3526,7 +3526,7 @@ static unsigned int OnDisassoc(struct adapter *padapter,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network);

/* check A3 */
@@ -3585,7 +3585,7 @@ static unsigned int on_action_spct(struct adapter *padapter,
{
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);
u8 category;
u8 action;
@@ -3641,7 +3641,7 @@ static unsigned int OnAction_back(struct adapter *padapter,
unsigned short tid, status, reason_code = 0;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
struct sta_priv *pstapriv = &padapter->stapriv;
/* check RA matches or not */
if (memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe),
@@ -3714,7 +3714,7 @@ static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token)
{
struct adapter *adapter = recv_frame->adapter;
struct mlme_ext_priv *mlmeext = &(adapter->mlmeextpriv);
- u8 *frame = recv_frame->rx_data;
+ u8 *frame = recv_frame->pkt->data;
u16 seq_ctrl = ((recv_frame->attrib.seq_num&0xffff) << 4) |
(recv_frame->attrib.frag_num & 0xf);

@@ -3744,7 +3744,7 @@ static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token)

static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
{
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
u8 *frame_body;
u8 dialogToken = 0;
frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));
@@ -3760,7 +3760,7 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
static unsigned int on_action_public_vendor(struct recv_frame *precv_frame)
{
unsigned int ret = _FAIL;
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);

if (!memcmp(frame_body + 2, P2P_OUI, 4))
@@ -3772,7 +3772,7 @@ static unsigned int on_action_public_vendor(struct recv_frame *precv_frame)
static unsigned int on_action_public_default(struct recv_frame *precv_frame, u8 action)
{
unsigned int ret = _FAIL;
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);
u8 token;

@@ -3791,7 +3791,7 @@ static unsigned int on_action_public(struct adapter *padapter,
struct recv_frame *precv_frame)
{
unsigned int ret = _FAIL;
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);
u8 category, action;

@@ -3862,7 +3862,7 @@ static unsigned int OnAction(struct adapter *padapter,
unsigned char category;
struct action_handler *ptable;
unsigned char *frame_body;
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;

frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));

@@ -4119,7 +4119,7 @@ void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext)
static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptable, struct recv_frame *precv_frame)
{
u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;

if (ptable->func) {
/* receive the frames that ra(a1) is my address or ra(a1) is bc address. */
@@ -4138,7 +4138,7 @@ void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
#endif /* CONFIG_88EU_AP_MODE */
u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;
struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, GetAddr2Ptr(pframe));

RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 9333535..a210a43 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -263,7 +263,7 @@ static int recvframe_chkmic(struct adapter *adapter,
/* icv_len included the mic code */
datalen = precvframe->len-prxattrib->hdrlen -
prxattrib->iv_len-prxattrib->icv_len-8;
- pframe = precvframe->rx_data;
+ pframe = precvframe->pkt->data;
payload = pframe+prxattrib->hdrlen+prxattrib->iv_len;

RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n prxattrib->iv_len=%d prxattrib->icv_len=%d\n", prxattrib->iv_len, prxattrib->icv_len));
@@ -303,14 +303,14 @@ static int recvframe_chkmic(struct adapter *adapter,
RT_TRACE(_module_rtl871x_recv_c_,
_drv_err_,
("0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x",
- *(precvframe->rx_data+i),
- *(precvframe->rx_data+i+1),
- *(precvframe->rx_data+i+2),
- *(precvframe->rx_data+i+3),
- *(precvframe->rx_data+i+4),
- *(precvframe->rx_data+i+5),
- *(precvframe->rx_data+i+6),
- *(precvframe->rx_data+i+7)));
+ *(precvframe->pkt->data+i),
+ *(precvframe->pkt->data+i+1),
+ *(precvframe->pkt->data+i+2),
+ *(precvframe->pkt->data+i+3),
+ *(precvframe->pkt->data+i+4),
+ *(precvframe->pkt->data+i+5),
+ *(precvframe->pkt->data+i+6),
+ *(precvframe->pkt->data+i+7)));
}
RT_TRACE(_module_rtl871x_recv_c_,
_drv_err_,
@@ -372,7 +372,7 @@ static struct recv_frame *decryptor(struct adapter *padapter,
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("prxstat->decrypted=%x prxattrib->encrypt=0x%03x\n", prxattrib->bdecrypted, prxattrib->encrypt));

if (prxattrib->encrypt > 0) {
- u8 *iv = precv_frame->rx_data+prxattrib->hdrlen;
+ u8 *iv = precv_frame->pkt->data+prxattrib->hdrlen;
prxattrib->key_index = (((iv[3])>>6)&0x3);

if (prxattrib->key_index > WEP_KEYS) {
@@ -440,7 +440,7 @@ static struct recv_frame *portctrl(struct adapter *adapter,

auth_alg = adapter->securitypriv.dot11AuthAlgrthm;

- ptr = precv_frame->rx_data;
+ ptr = precv_frame->pkt->data;
pfhdr = precv_frame;
pattrib = &pfhdr->attrib;
psta_addr = pattrib->ta;
@@ -529,7 +529,7 @@ static void process_pwrbit_data(struct adapter *padapter,
{
#ifdef CONFIG_88EU_AP_MODE
unsigned char pwrbit;
- u8 *ptr = precv_frame->rx_data;
+ u8 *ptr = precv_frame->pkt->data;
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
struct sta_priv *pstapriv = &padapter->stapriv;
struct sta_info *psta = NULL;
@@ -726,7 +726,7 @@ static int ap2sta_data_frame(
struct recv_frame *precv_frame,
struct sta_info **psta)
{
- u8 *ptr = precv_frame->rx_data;
+ u8 *ptr = precv_frame->pkt->data;
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
int ret = _SUCCESS;
struct sta_priv *pstapriv = &adapter->stapriv;
@@ -819,7 +819,7 @@ static int sta2ap_data_frame(struct adapter *adapter,
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
struct sta_priv *pstapriv = &adapter->stapriv;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
- u8 *ptr = precv_frame->rx_data;
+ u8 *ptr = precv_frame->pkt->data;
unsigned char *mybssid = get_bssid(pmlmepriv);
int ret = _SUCCESS;

@@ -875,7 +875,7 @@ static int validate_recv_ctrl_frame(struct adapter *padapter,
#ifdef CONFIG_88EU_AP_MODE
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
struct sta_priv *pstapriv = &padapter->stapriv;
- u8 *pframe = precv_frame->rx_data;
+ u8 *pframe = precv_frame->pkt->data;

if (GetFrameType(pframe) != WIFI_CTRL_TYPE)
return _FAIL;
@@ -1012,18 +1012,18 @@ static int validate_recv_mgnt_frame(struct adapter *padapter,

/* for rx pkt statistics */
psta = rtw_get_stainfo(&padapter->stapriv,
- GetAddr2Ptr(precv_frame->rx_data));
+ GetAddr2Ptr(precv_frame->pkt->data));
if (psta) {
psta->sta_stats.rx_mgnt_pkts++;
- if (GetFrameSubType(precv_frame->rx_data) == WIFI_BEACON) {
+ if (GetFrameSubType(precv_frame->pkt->data) == WIFI_BEACON) {
psta->sta_stats.rx_beacon_pkts++;
- } else if (GetFrameSubType(precv_frame->rx_data) == WIFI_PROBEREQ) {
+ } else if (GetFrameSubType(precv_frame->pkt->data) == WIFI_PROBEREQ) {
psta->sta_stats.rx_probereq_pkts++;
- } else if (GetFrameSubType(precv_frame->rx_data) == WIFI_PROBERSP) {
+ } else if (GetFrameSubType(precv_frame->pkt->data) == WIFI_PROBERSP) {
if (!memcmp(padapter->eeprompriv.mac_addr,
- GetAddr1Ptr(precv_frame->rx_data), ETH_ALEN))
+ GetAddr1Ptr(precv_frame->pkt->data), ETH_ALEN))
psta->sta_stats.rx_probersp_pkts++;
- else if (is_multicast_ether_addr(GetAddr1Ptr(precv_frame->rx_data)))
+ else if (is_multicast_ether_addr(GetAddr1Ptr(precv_frame->pkt->data)))
psta->sta_stats.rx_probersp_bm_pkts++;
else
psta->sta_stats.rx_probersp_uo_pkts++;
@@ -1041,7 +1041,7 @@ static int validate_recv_data_frame(struct adapter *adapter,
u8 bretry;
u8 *psa, *pda, *pbssid;
struct sta_info *psta = NULL;
- u8 *ptr = precv_frame->rx_data;
+ u8 *ptr = precv_frame->pkt->data;
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
struct security_priv *psecuritypriv = &adapter->securitypriv;
int ret = _SUCCESS;
@@ -1164,7 +1164,7 @@ static int validate_recv_frame(struct adapter *adapter,
int retval = _SUCCESS;
u8 bDumpRxPkt;
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
- u8 *ptr = precv_frame->rx_data;
+ u8 *ptr = precv_frame->pkt->data;
u8 ver = (unsigned char)(*ptr)&0x3;
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;

@@ -1276,7 +1276,7 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
u8 *psnap_type;
struct ieee80211_snap_hdr *psnap;

- u8 *ptr = precvframe->rx_data;
+ u8 *ptr = precvframe->pkt->data;
struct rx_pkt_attrib *pattrib = &precvframe->attrib;

if (pattrib->encrypt)
@@ -1381,7 +1381,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,
recvframe_pull_tail(prframe, pfhdr->attrib.icv_len);

/* memcpy */
- memcpy(pfhdr->rx_tail, pnfhdr->rx_data, pnfhdr->len);
+ memcpy(pfhdr->rx_tail, pnfhdr->pkt->data, pnfhdr->len);

recvframe_put(prframe, pnfhdr->len);

@@ -1424,7 +1424,7 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter,
psta_addr = pfhdr->attrib.ta;
psta = rtw_get_stainfo(pstapriv, psta_addr);
if (psta == NULL) {
- u8 type = GetFrameType(pfhdr->rx_data);
+ u8 type = GetFrameType(pfhdr->pkt->data);
if (type != WIFI_DATA_TYPE) {
psta = rtw_get_bcmc_stainfo(padapter);
pdefrag_q = &psta->sta_recvpriv.defrag_q;
@@ -1518,7 +1518,7 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)

a_len = prframe->len;

- pdata = prframe->rx_data;
+ pdata = prframe->pkt->data;

while (a_len > ETH_HLEN) {
/* Offset 12 denote 2 mac address */
diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c b/drivers/staging/rtl8188eu/core/rtw_security.c
index 85bb441..d0d2f9a 100644
--- a/drivers/staging/rtl8188eu/core/rtw_security.c
+++ b/drivers/staging/rtl8188eu/core/rtw_security.c
@@ -204,7 +204,7 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe)
struct security_priv *psecuritypriv = &padapter->securitypriv;


- pframe = (unsigned char *)((struct recv_frame *)precvframe)->rx_data;
+ pframe = (unsigned char *)((struct recv_frame *)precvframe)->pkt->data;

/* start to decrypt recvframe */
if ((prxattrib->encrypt == _WEP40_) || (prxattrib->encrypt == _WEP104_)) {
@@ -652,7 +652,7 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
u32 res = _SUCCESS;


- pframe = (unsigned char *)((struct recv_frame *)precvframe)->rx_data;
+ pframe = (unsigned char *)((struct recv_frame *)precvframe)->pkt->data;

/* 4 start to decrypt recvframe */
if (prxattrib->encrypt == _TKIP_) {
@@ -1452,7 +1452,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
struct rx_pkt_attrib *prxattrib = &((struct recv_frame *)precvframe)->attrib;
struct security_priv *psecuritypriv = &padapter->securitypriv;
u32 res = _SUCCESS;
- pframe = (unsigned char *)((struct recv_frame *)precvframe)->rx_data;
+ pframe = (unsigned char *)((struct recv_frame *)precvframe)->pkt->data;
/* 4 start to encrypt each fragment */
if (prxattrib->encrypt == _AES_) {
stainfo = rtw_get_stainfo(&padapter->stapriv, &prxattrib->ta[0]);
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c b/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c
index fa2cfd5..d9fa290 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c
@@ -150,7 +150,7 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe,
pkt_info.bPacketToSelf = false;
pkt_info.bPacketBeacon = false;

- wlanhdr = precvframe->rx_data;
+ wlanhdr = precvframe->pkt->data;

pkt_info.bPacketMatchBSSID = ((!IsFrameTypeCtrl(wlanhdr)) &&
!pattrib->icv_err && !pattrib->crc_err &&
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 143e637..e6cc3af 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -233,7 +233,6 @@ struct recv_frame {
struct adapter *adapter;
struct rx_pkt_attrib attrib;
uint len;
- u8 *rx_data;
u8 *rx_tail;
u8 *rx_end;
struct sta_info *psta;
@@ -264,16 +263,15 @@ static inline u8 *recvframe_pull(struct recv_frame *precvframe, uint sz)
/* used for extract sz bytes from rx_data, update rx_data and return
* the updated rx_data to the caller */

+ u8 *data;
+
if (precvframe == NULL)
return NULL;
- skb_pull(precvframe->pkt, sz);
- precvframe->rx_data += sz;
- if (precvframe->rx_data > precvframe->rx_tail) {
- precvframe->rx_data -= sz;
+ data = skb_pull(precvframe->pkt, sz);
+ if (!data)
return NULL;
- }
precvframe->len -= sz;
- return precvframe->rx_data;
+ return data;
}

static inline u8 *recvframe_put(struct recv_frame *precvframe, int sz)
@@ -306,7 +304,7 @@ static inline u8 *recvframe_pull_tail(struct recv_frame *precvframe, int sz)
if (precvframe == NULL)
return NULL;
precvframe->rx_tail -= sz;
- if (precvframe->rx_tail < precvframe->rx_data) {
+ if (precvframe->rx_tail < precvframe->pkt->data) {
precvframe->rx_tail += sz;
return NULL;
}
diff --git a/drivers/staging/rtl8188eu/os_dep/mon.c b/drivers/staging/rtl8188eu/os_dep/mon.c
index d976e5e..263c6d5 100644
--- a/drivers/staging/rtl8188eu/os_dep/mon.c
+++ b/drivers/staging/rtl8188eu/os_dep/mon.c
@@ -92,7 +92,7 @@ void rtl88eu_mon_recv_hook(struct net_device *dev, struct recv_frame *frame)
return;

attr = &frame->attrib;
- data = frame->rx_data;
+ data = frame->pkt->data;
data_len = frame->len;

/* Broadcast and multicast frames don't have attr->{iv,icv}_len set */
diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
index f6af89e..3c41c5e 100644
--- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
@@ -91,15 +91,13 @@ int rtw_recv_indicatepkt(struct adapter *padapter,
RT_TRACE(_module_recv_osdep_c_, _drv_info_,
("rtw_recv_indicatepkt():skb != NULL !!!\n"));
RT_TRACE(_module_recv_osdep_c_, _drv_info_,
- ("rtw_recv_indicatepkt(): precv_frame->hdr.rx_data =%p\n",
- precv_frame->rx_data));
+ ("rtw_recv_indicatepkt(): precv_frame->pkt->rx_data =%p\n",
+ precv_frame->pkt->data));
RT_TRACE(_module_recv_osdep_c_, _drv_info_,
("precv_frame->hdr.rx_tail =%p precv_frame->rx_end =%p precv_frame->hdr.len =%d\n",
precv_frame->rx_tail, precv_frame->rx_end,
precv_frame->len));

- skb->data = precv_frame->rx_data;
-
skb_set_tail_pointer(skb, precv_frame->len);

skb->len = precv_frame->len;
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 62dec1e..8ed42e3 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -129,7 +129,6 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
skb_reserve(pkt_copy, shift_sz);/* force ip_hdr at 8-byte alignment address according to shift_sz. */
memcpy(pkt_copy->data, (pbuf + pattrib->drvinfo_sz + RXDESC_SIZE), skb_len);
precvframe->rx_tail = pkt_copy->data;
- precvframe->rx_data = pkt_copy->data;
} else {
DBG_88E("recvbuf2recvframe: alloc_skb fail , drop frag frame\n");
rtw_free_recvframe(precvframe, pfree_recv_queue);
@@ -159,19 +158,19 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
}
} else if (pattrib->pkt_rpt_type == TX_REPORT1) {
/* CCX-TXRPT ack for xmit mgmt frames. */
- handle_txrpt_ccx_88e(adapt, precvframe->rx_data);
+ handle_txrpt_ccx_88e(adapt, precvframe->pkt->data);
rtw_free_recvframe(precvframe, pfree_recv_queue);
} else if (pattrib->pkt_rpt_type == TX_REPORT2) {
ODM_RA_TxRPT2Handle_8188E(
&haldata->odmpriv,
- precvframe->rx_data,
+ precvframe->pkt->data,
pattrib->pkt_len,
pattrib->MacIDValidEntry[0],
pattrib->MacIDValidEntry[1]
);
rtw_free_recvframe(precvframe, pfree_recv_queue);
} else if (pattrib->pkt_rpt_type == HIS_REPORT) {
- interrupt_handler_8188eu(adapt, pattrib->pkt_len, precvframe->rx_data);
+ interrupt_handler_8188eu(adapt, pattrib->pkt_len, precvframe->pkt->data);
rtw_free_recvframe(precvframe, pfree_recv_queue);
}
pkt_cnt--;
--
2.7.3

2016-10-19 15:05:57

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 14/37] staging:r8188eu: remove ieee80211_is_empty_essid function

This function is unused.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 17 -----------------
drivers/staging/rtl8188eu/include/ieee80211.h | 3 ---
2 files changed, 20 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index 0c17004..2212f3a 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -952,23 +952,6 @@ void rtw_macaddr_cfg(u8 *mac_addr)
DBG_88E("rtw_macaddr_cfg MAC Address = %pM\n", (mac_addr));
}

-/* Baron adds to avoid FreeBSD warning */
-int ieee80211_is_empty_essid(const char *essid, int essid_len)
-{
- /* Single white space is for Linksys APs */
- if (essid_len == 1 && essid[0] == ' ')
- return 1;
-
- /* Otherwise, if the entire essid is 0, we assume it is hidden */
- while (essid_len) {
- essid_len--;
- if (essid[essid_len] != '\0')
- return 0;
- }
-
- return 1;
-}
-
static int rtw_get_cipher_info(struct wlan_network *pnetwork)
{
u32 wpa_ielen;
diff --git a/drivers/staging/rtl8188eu/include/ieee80211.h b/drivers/staging/rtl8188eu/include/ieee80211.h
index a4bbd2b..f7f1b70 100644
--- a/drivers/staging/rtl8188eu/include/ieee80211.h
+++ b/drivers/staging/rtl8188eu/include/ieee80211.h
@@ -633,9 +633,6 @@ enum ieee80211_state {
#define IEEE_G (1<<2)
#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G)

-/* Baron move to ieee80211.c */
-int ieee80211_is_empty_essid(const char *essid, int essid_len);
-
/* Action category code */
enum rtw_ieee80211_category {
RTW_WLAN_CATEGORY_SPECTRUM_MGMT = 0,
--
2.7.3

2016-10-19 15:21:34

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 29/37] staging:r8188eu: take out stripping of iv and icv space from wlanhdr_to_ethhdr function

Prepare to replacing wlanhdr_to_ethhdr by ieee80211_data_to_8023.
This stripping procedure placed into new strip_iv_icv function.
Also strip_iv_icv used inside unprotect_frame.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 27 +++++++++++++++++++--------
drivers/staging/rtl8188eu/include/rtw_recv.h | 3 ++-
drivers/staging/rtl8188eu/os_dep/mon.c | 4 +---
3 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index c07a3f5..630d9eb 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1276,12 +1276,8 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
u8 *ptr = precvframe->pkt->data;
struct rx_pkt_attrib *pattrib = &precvframe->attrib;

- if (pattrib->encrypt)
- skb_trim(precvframe->pkt,
- precvframe->pkt->len - pattrib->icv_len);
-
- psnap = (struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen + pattrib->iv_len);
- psnap_type = ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
+ psnap = (struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen);
+ psnap_type = ptr+pattrib->hdrlen + SNAP_SIZE;
/* convert hdr + possible LLC headers into Ethernet header */
if ((!memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) &&
(!memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == false) &&
@@ -1294,11 +1290,11 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
bsnaphdr = false;
}

- rmv_len = pattrib->hdrlen + pattrib->iv_len + (bsnaphdr ? SNAP_SIZE : 0);
+ rmv_len = pattrib->hdrlen + (bsnaphdr ? SNAP_SIZE : 0);
len = precvframe->pkt->len - rmv_len;

RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
- ("\n===pattrib->hdrlen: %x, pattrib->iv_len:%x===\n\n", pattrib->hdrlen, pattrib->iv_len));
+ ("\n===pattrib->hdrlen: %x===\n\n", pattrib->hdrlen));

memcpy(&be_tmp, ptr+rmv_len, 2);
eth_type = ntohs(be_tmp); /* pattrib->ether_type */
@@ -1733,6 +1729,13 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
return bPktInBuf;
}

+void strip_iv_icv(struct sk_buff *skb, uint header_len,
+ uint iv_len, uint icv_len) {
+ memmove(skb->data + iv_len, skb->data, header_len);
+ skb_pull(skb, iv_len);
+ skb_trim(skb, skb->len - icv_len);
+}
+
static int recv_indicatepkt_reorder(struct adapter *padapter,
struct recv_frame *prframe)
{
@@ -1743,6 +1746,10 @@ static int recv_indicatepkt_reorder(struct adapter *padapter,

if (!pattrib->amsdu) {
/* s1. */
+ strip_iv_icv(prframe->pkt, prframe->attrib.hdrlen,
+ prframe->attrib.iv_len,
+ prframe->attrib.encrypt ? prframe->attrib.icv_len : 0);
+
wlanhdr_to_ethhdr(prframe);

if ((pattrib->qos != 1) || (pattrib->eth_type == 0x0806) ||
@@ -1861,6 +1868,10 @@ static int process_recv_indicatepkts(struct adapter *padapter,
}
}
} else { /* B/G mode */
+ strip_iv_icv(prframe->pkt, prframe->attrib.hdrlen,
+ prframe->attrib.iv_len,
+ prframe->attrib.encrypt ? prframe->attrib.icv_len : 0);
+
retval = wlanhdr_to_ethhdr(prframe);
if (retval != _SUCCESS) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("wlanhdr_to_ethhdr: drop pkt\n"));
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index cacf35c..748c014e 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -270,5 +270,6 @@ struct sta_info;
void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv);

void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame);
-
+void strip_iv_icv(struct sk_buff *skb, uint header_len,
+ uint iv_len, uint icv_len);
#endif
diff --git a/drivers/staging/rtl8188eu/os_dep/mon.c b/drivers/staging/rtl8188eu/os_dep/mon.c
index 9b3f3ec..b1fd49d 100644
--- a/drivers/staging/rtl8188eu/os_dep/mon.c
+++ b/drivers/staging/rtl8188eu/os_dep/mon.c
@@ -40,9 +40,7 @@ static void unprotect_frame(struct sk_buff *skb, int iv_len, int icv_len)

hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_PROTECTED);

- memmove(skb->data + iv_len, skb->data, hdr_len);
- skb_pull(skb, iv_len);
- skb_trim(skb, skb->len - icv_len);
+ strip_iv_icv(skb, hdr_len, iv_len, icv_len);
}

static void mon_recv_decrypted(struct net_device *dev, const u8 *data,
--
2.7.3

2016-10-19 15:22:33

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 23/37] staging:r8188eu: update rx_tail and pkt->tail synchronously

To replace rx_tail with pkt->tail.
Now pkt->tail is equal to rx_tail and pkt->len is equal to len.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/rtw_recv.h | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 9a3a978..34d13f8 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -279,17 +279,17 @@ static inline u8 *recvframe_put(struct recv_frame *precvframe, uint sz)
* and return the updated rx_tail to the caller */
/* after putting, rx_tail must be still larger than rx_end. */

+ u8 *tail;
+
if (precvframe == NULL)
return NULL;

- precvframe->rx_tail += sz;
-
- if (precvframe->rx_tail > precvframe->pkt->end) {
- precvframe->rx_tail -= sz;
+ tail = skb_put(precvframe->pkt, sz);
+ if (!tail)
return NULL;
- }
+ precvframe->rx_tail += sz;
precvframe->len += sz;
- return precvframe->rx_tail;
+ return tail;
}

static inline void recvframe_pull_tail(struct recv_frame *precvframe, uint sz)
@@ -302,11 +302,11 @@ static inline void recvframe_pull_tail(struct recv_frame *precvframe, uint sz)

if (precvframe == NULL)
return;
- precvframe->rx_tail -= sz;
- if (precvframe->rx_tail < precvframe->pkt->data) {
- precvframe->rx_tail += sz;
+
+ if (precvframe->len < sz)
return;
- }
+ precvframe->rx_tail -= sz;
+ skb_trim(precvframe->pkt, precvframe->pkt->len - sz);
precvframe->len -= sz;
}

--
2.7.3

2016-10-19 15:25:48

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 12/37] staging:r8188eu: remove ieee80211_get_hdrlen function

This function does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 27 --------------------------
drivers/staging/rtl8188eu/include/ieee80211.h | 1 -
2 files changed, 28 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index 914c492..0c17004 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -969,33 +969,6 @@ int ieee80211_is_empty_essid(const char *essid, int essid_len)
return 1;
}

-int ieee80211_get_hdrlen(u16 fc)
-{
- int hdrlen = 24;
-
- switch (WLAN_FC_GET_TYPE(fc)) {
- case RTW_IEEE80211_FTYPE_DATA:
- if (fc & RTW_IEEE80211_STYPE_QOS_DATA)
- hdrlen += 2;
- if ((fc & RTW_IEEE80211_FCTL_FROMDS) && (fc & RTW_IEEE80211_FCTL_TODS))
- hdrlen += 6; /* Addr4 */
- break;
- case RTW_IEEE80211_FTYPE_CTL:
- switch (WLAN_FC_GET_STYPE(fc)) {
- case RTW_IEEE80211_STYPE_CTS:
- case RTW_IEEE80211_STYPE_ACK:
- hdrlen = 10;
- break;
- default:
- hdrlen = 16;
- break;
- }
- break;
- }
-
- return hdrlen;
-}
-
static int rtw_get_cipher_info(struct wlan_network *pnetwork)
{
u32 wpa_ielen;
diff --git a/drivers/staging/rtl8188eu/include/ieee80211.h b/drivers/staging/rtl8188eu/include/ieee80211.h
index 4c2fe53..a4bbd2b 100644
--- a/drivers/staging/rtl8188eu/include/ieee80211.h
+++ b/drivers/staging/rtl8188eu/include/ieee80211.h
@@ -635,7 +635,6 @@ enum ieee80211_state {

/* Baron move to ieee80211.c */
int ieee80211_is_empty_essid(const char *essid, int essid_len);
-int ieee80211_get_hdrlen(u16 fc);

/* Action category code */
enum rtw_ieee80211_category {
--
2.7.3

2016-10-19 15:26:07

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 31/37] staging:r8188eu: remove pscanned member of mlme_priv structure

This member used only as local variable.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 2 --
drivers/staging/rtl8188eu/core/rtw_mlme.c | 11 +++++------
drivers/staging/rtl8188eu/include/rtw_mlme.h | 1 -
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 19 +++++++++++--------
4 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
index 67508a6..9d4472a 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
@@ -40,8 +40,6 @@ u8 rtw_do_join(struct adapter *padapter)

set_fwstate(pmlmepriv, _FW_UNDER_LINKING);

- pmlmepriv->pscanned = plist;
-
pmlmepriv->to_join = true;

if (list_empty(&queue->queue)) {
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index 249e004..1322688 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -42,8 +42,6 @@ int rtw_init_mlme_priv(struct adapter *padapter)
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */

pmlmepriv->nic_hdl = (u8 *)padapter;
-
- pmlmepriv->pscanned = NULL;
pmlmepriv->fw_state = 0;
pmlmepriv->cur_network.network.InfrastructureMode = Ndis802_11AutoUnknown;
pmlmepriv->scan_mode = SCAN_ACTIVE;/* 1: active, 0: pasive. Maybe someday we should rename this varable to "active_mode" (Jeff) */
@@ -1504,19 +1502,20 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
struct wlan_network *pnetwork = NULL;
struct wlan_network *candidate = NULL;
u8 supp_ant_div = false;
+ struct list_head *scanned;

spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
phead = get_list_head(queue);
adapter = (struct adapter *)pmlmepriv->nic_hdl;
- pmlmepriv->pscanned = phead->next;
- while (phead != pmlmepriv->pscanned) {
- pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
+ scanned = phead->next;
+ while (phead != scanned) {
+ pnetwork = container_of(scanned, struct wlan_network, list);
if (pnetwork == NULL) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s return _FAIL:(pnetwork==NULL)\n", __func__));
ret = _FAIL;
goto exit;
}
- pmlmepriv->pscanned = pmlmepriv->pscanned->next;
+ scanned = scanned->next;
rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
}
if (candidate == NULL) {
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h
index a30448a..e1e46ce 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h
@@ -293,7 +293,6 @@ struct mlme_priv {

u8 *nic_hdl;

- struct list_head *pscanned;
struct __queue free_bss_pool;
struct __queue scanned_queue;
u8 *free_bss_buf;
diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index 6364a05..2a81796 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -966,6 +966,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
struct __queue *queue = &(pmlmepriv->scanned_queue);
struct wlan_network *pnetwork = NULL;
enum ndis_802_11_auth_mode authmode;
+ struct list_head *scanned;

if (_FAIL == rtw_pwr_wakeup(padapter)) {
ret = -1;
@@ -985,12 +986,12 @@ static int rtw_wx_set_wap(struct net_device *dev,
authmode = padapter->securitypriv.ndisauthtype;
spin_lock_bh(&queue->lock);
phead = get_list_head(queue);
- pmlmepriv->pscanned = phead->next;
+ scanned = phead->next;

- while (phead != pmlmepriv->pscanned) {
- pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
+ while (phead != scanned) {
+ pnetwork = container_of(scanned, struct wlan_network, list);

- pmlmepriv->pscanned = pmlmepriv->pscanned->next;
+ scanned = scanned->next;

dst_bssid = pnetwork->network.MacAddress;

@@ -1313,6 +1314,8 @@ static int rtw_wx_set_essid(struct net_device *dev,
authmode = padapter->securitypriv.ndisauthtype;
DBG_88E("=>%s\n", __func__);
if (wrqu->essid.flags && wrqu->essid.length) {
+ struct list_head *scanned;
+
len = min_t(uint, wrqu->essid.length, IW_ESSID_MAX_SIZE);

if (wrqu->essid.length != 33)
@@ -1326,12 +1329,12 @@ static int rtw_wx_set_essid(struct net_device *dev,
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("rtw_wx_set_essid: ssid =[%s]\n", src_ssid));
spin_lock_bh(&queue->lock);
phead = get_list_head(queue);
- pmlmepriv->pscanned = phead->next;
+ scanned = phead->next;

- while (phead != pmlmepriv->pscanned) {
- pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
+ while (phead != scanned) {
+ pnetwork = container_of(scanned, struct wlan_network, list);

- pmlmepriv->pscanned = pmlmepriv->pscanned->next;
+ scanned = scanned->next;

dst_ssid = pnetwork->network.Ssid.Ssid;

--
2.7.3

2016-10-19 15:26:26

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 09/37] staging:r8188eu: remove is2t argument of phy_lc_calibrate function

is2t is constant.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/phy.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 6b70d09..93dbb395 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -1014,10 +1014,10 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8], u8 t)
}
}

-static void phy_lc_calibrate(struct adapter *adapt, bool is2t)
+static void phy_lc_calibrate(struct adapter *adapt)
{
u8 tmpreg;
- u32 rf_a_mode = 0, rf_b_mode = 0, lc_cal;
+ u32 rf_a_mode = 0, lc_cal;

/* Check continuous TX and Packet TX */
tmpreg = usb_read8(adapt, 0xd03);
@@ -1033,20 +1033,10 @@ static void phy_lc_calibrate(struct adapter *adapt, bool is2t)
rf_a_mode = rtw_hal_read_rfreg(adapt, RF_PATH_A, RF_AC,
bMask12Bits);

- /* Path-B */
- if (is2t)
- rf_b_mode = rtw_hal_read_rfreg(adapt, RF_PATH_B, RF_AC,
- bMask12Bits);
-
/* 2. Set RF mode = standby mode */
/* Path-A */
phy_set_rf_reg(adapt, RF_PATH_A, RF_AC, bMask12Bits,
(rf_a_mode&0x8FFFF)|0x10000);
-
- /* Path-B */
- if (is2t)
- phy_set_rf_reg(adapt, RF_PATH_B, RF_AC, bMask12Bits,
- (rf_b_mode&0x8FFFF)|0x10000);
}

/* 3. Read RF reg18 */
@@ -1064,11 +1054,6 @@ static void phy_lc_calibrate(struct adapter *adapt, bool is2t)
/* Path-A */
usb_write8(adapt, 0xd03, tmpreg);
phy_set_rf_reg(adapt, RF_PATH_A, RF_AC, bMask12Bits, rf_a_mode);
-
- /* Path-B */
- if (is2t)
- phy_set_rf_reg(adapt, RF_PATH_B, RF_AC, bMask12Bits,
- rf_b_mode);
} else {
/* Deal with Packet TX case */
usb_write8(adapt, REG_TXPAUSE, 0x00);
@@ -1210,7 +1195,7 @@ void rtl88eu_phy_lc_calibrate(struct adapter *adapt)

dm_odm->RFCalibrateInfo.bLCKInProgress = true;

- phy_lc_calibrate(adapt, false);
+ phy_lc_calibrate(adapt);

dm_odm->RFCalibrateInfo.bLCKInProgress = false;
}
--
2.7.3

2016-10-19 15:05:48

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 26/37] staging:r8188eu: remove recvframe_pull function

skb_pull used instead.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 8 ++++----
drivers/staging/rtl8188eu/include/rtw_recv.h | 17 -----------------
2 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 5e47e25..1d29808 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1303,7 +1303,7 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
eth_type = ntohs(be_tmp); /* pattrib->ether_type */
pattrib->eth_type = eth_type;

- ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0)));
+ ptr = skb_pull(precvframe->pkt, (rmv_len-sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0)));

memcpy(ptr, pattrib->dst, ETH_ALEN);
memcpy(ptr+ETH_ALEN, pattrib->src, ETH_ALEN);
@@ -1372,7 +1372,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,

wlanhdr_offset = pnfhdr->attrib.hdrlen + pnfhdr->attrib.iv_len;

- recvframe_pull(pnextrframe, wlanhdr_offset);
+ skb_pull(pnextrframe->pkt, wlanhdr_offset);

/* append to first fragment frame's tail (if privacy frame, pull the ICV) */
recvframe_pull_tail(prframe, pfhdr->attrib.icv_len);
@@ -1508,10 +1508,10 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)

pattrib = &prframe->attrib;

- recvframe_pull(prframe, prframe->attrib.hdrlen);
+ skb_pull(prframe->pkt, prframe->attrib.hdrlen);

if (prframe->attrib.iv_len > 0)
- recvframe_pull(prframe, prframe->attrib.iv_len);
+ skb_pull(prframe->pkt, prframe->attrib.iv_len);

a_len = prframe->pkt->len;

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 752c40fe..f0ce2e6 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -253,23 +253,6 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter);

void rtw_reordering_ctrl_timeout_handler(unsigned long data);

-static inline u8 *recvframe_pull(struct recv_frame *precvframe, uint sz)
-{
- /* rx_data += sz; move rx_data sz bytes hereafter */
-
- /* used for extract sz bytes from rx_data, update rx_data and return
- * the updated rx_data to the caller */
-
- u8 *data;
-
- if (precvframe == NULL)
- return NULL;
- data = skb_pull(precvframe->pkt, sz);
- if (!data)
- return NULL;
- return data;
-}
-
static inline u8 *recvframe_put(struct recv_frame *precvframe, uint sz)
{
/* used for append sz bytes from ptr to rx_tail, update rx_tail
--
2.7.3

2016-10-19 15:26:40

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 28/37] staging:r8188eu: remove recvframe_pull_tail function

skb_trim used instead.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 8 +++++---
drivers/staging/rtl8188eu/include/rtw_recv.h | 16 ----------------
2 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 3f7812f..c07a3f5 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -349,7 +349,7 @@ static int recvframe_chkmic(struct adapter *adapter,
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chkmic: rtw_get_stainfo==NULL!!!\n"));
}

- recvframe_pull_tail(precvframe, 8);
+ skb_trim(precvframe->pkt, precvframe->pkt->len - 8);
}

exit:
@@ -1277,7 +1277,8 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
struct rx_pkt_attrib *pattrib = &precvframe->attrib;

if (pattrib->encrypt)
- recvframe_pull_tail(precvframe, pattrib->icv_len);
+ skb_trim(precvframe->pkt,
+ precvframe->pkt->len - pattrib->icv_len);

psnap = (struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen + pattrib->iv_len);
psnap_type = ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
@@ -1375,7 +1376,8 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,
skb_pull(pnextrframe->pkt, wlanhdr_offset);

/* append to first fragment frame's tail (if privacy frame, pull the ICV) */
- recvframe_pull_tail(prframe, pfhdr->attrib.icv_len);
+ skb_trim(prframe->pkt,
+ prframe->pkt->len - pfhdr->attrib.icv_len);

/* memcpy */
memcpy(pfhdr->pkt->tail, pnfhdr->pkt->data, pnfhdr->pkt->len);
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 5357a8d..cacf35c 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -253,22 +253,6 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter);

void rtw_reordering_ctrl_timeout_handler(unsigned long data);

-static inline void recvframe_pull_tail(struct recv_frame *precvframe, uint sz)
-{
- /* rmv data from rx_tail (by yitsen) */
-
- /* used for extract sz bytes from rx_end, update rx_end and return
- * the updated rx_end to the caller */
- /* after pulling, rx_end must be still larger than rx_data. */
-
- if (precvframe == NULL)
- return;
-
- if (precvframe->pkt->len < sz)
- return;
- skb_trim(precvframe->pkt, precvframe->pkt->len - sz);
-}
-
static inline s32 translate_percentage_to_dbm(u32 sig_stren_index)
{
s32 power; /* in dBm. */
--
2.7.3

2016-10-19 15:27:14

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 35/37] staging:r8188eu: remove clr_fwstate* functions

These functions are unused.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/rtw_mlme.h | 19 -------------------
1 file changed, 19 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h
index 47a3f2d..d27b2ad 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h
@@ -456,25 +456,6 @@ static inline void _clr_fwstate_(struct mlme_priv *pmlmepriv, int state)
pmlmepriv->bScanInProcess = false;
}

-/*
- * No Limit on the calling context,
- * therefore set it to be the critical section...
- */
-static inline void clr_fwstate(struct mlme_priv *pmlmepriv, int state)
-{
- spin_lock_bh(&pmlmepriv->lock);
- if (check_fwstate(pmlmepriv, state) == true)
- pmlmepriv->fw_state ^= state;
- spin_unlock_bh(&pmlmepriv->lock);
-}
-
-static inline void clr_fwstate_ex(struct mlme_priv *pmlmepriv, int state)
-{
- spin_lock_bh(&pmlmepriv->lock);
- _clr_fwstate_(pmlmepriv, state);
- spin_unlock_bh(&pmlmepriv->lock);
-}
-
u16 rtw_get_capability(struct wlan_bssid_ex *bss);
void rtw_update_scanned_network(struct adapter *adapter,
struct wlan_bssid_ex *target);
--
2.7.3

2016-10-19 15:05:45

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 34/37] staging:r8188eu: remove update_bcn member of mlme_priv structure

Value of this member does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_ap.c | 7 -------
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 1 -
drivers/staging/rtl8188eu/include/rtw_mlme.h | 1 -
3 files changed, 9 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c
index fe1ba9e..90b88f3 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -43,11 +43,9 @@ void free_mlme_ap_info(struct adapter *padapter)
{
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
- struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);

- pmlmepriv->update_bcn = false;
pmlmeext->bstart_bss = false;

rtw_sta_flush(padapter);
@@ -1360,8 +1358,6 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
break;
}

- pmlmepriv->update_bcn = true;
-
spin_unlock_bh(&pmlmepriv->bcn_update_lock);

if (tx)
@@ -1800,8 +1796,6 @@ void start_ap_mode(struct adapter *padapter)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;

- pmlmepriv->update_bcn = false;
-
pmlmeext->bstart_bss = false;

pmlmepriv->num_sta_non_erp = 0;
@@ -1848,7 +1842,6 @@ void stop_ap_mode(struct adapter *padapter)
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
struct __queue *pacl_node_q = &pacl_list->acl_node_q;

- pmlmepriv->update_bcn = false;
pmlmeext->bstart_bss = false;

/* reset and init security priv , this can refine with rtw_reset_securitypriv */
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 08bb61d..243e9df 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -439,7 +439,6 @@ static void issue_beacon(struct adapter *padapter, int timeout_ms)
_issue_bcn:

#if defined(CONFIG_88EU_AP_MODE)
- pmlmepriv->update_bcn = false;

spin_unlock_bh(&pmlmepriv->bcn_update_lock);
#endif /* if defined (CONFIG_88EU_AP_MODE) */
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h
index e1e46ce..47a3f2d 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h
@@ -375,7 +375,6 @@ struct mlme_priv {
u32 wps_assoc_resp_ie_len;

spinlock_t bcn_update_lock;
- u8 update_bcn;
#endif /* if defined (CONFIG_88EU_AP_MODE) */
};

--
2.7.3

2016-10-19 15:27:33

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 22/37] staging:r8188eu: change recvframe_pull_tail type to void

Return value of this function does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/rtw_recv.h | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 0804e88..9a3a978 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -292,7 +292,7 @@ static inline u8 *recvframe_put(struct recv_frame *precvframe, uint sz)
return precvframe->rx_tail;
}

-static inline u8 *recvframe_pull_tail(struct recv_frame *precvframe, uint sz)
+static inline void recvframe_pull_tail(struct recv_frame *precvframe, uint sz)
{
/* rmv data from rx_tail (by yitsen) */

@@ -301,14 +301,13 @@ static inline u8 *recvframe_pull_tail(struct recv_frame *precvframe, uint sz)
/* after pulling, rx_end must be still larger than rx_data. */

if (precvframe == NULL)
- return NULL;
+ return;
precvframe->rx_tail -= sz;
if (precvframe->rx_tail < precvframe->pkt->data) {
precvframe->rx_tail += sz;
- return NULL;
+ return;
}
precvframe->len -= sz;
- return precvframe->rx_tail;
}

static inline s32 translate_percentage_to_dbm(u32 sig_stren_index)
--
2.7.3

2016-10-19 15:27:55

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 15/37] staging:r8188eu: remove rx_head member of recv_frame structure

Value of rx_head used only to produce debug output.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/rtw_recv.h | 1 -
drivers/staging/rtl8188eu/os_dep/recv_linux.c | 4 ++--
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 1 -
3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 4280fa1..6a34e15 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -233,7 +233,6 @@ struct recv_frame {
struct adapter *adapter;
struct rx_pkt_attrib attrib;
uint len;
- u8 *rx_head;
u8 *rx_data;
u8 *rx_tail;
u8 *rx_end;
diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
index b85824e..f6af89e 100644
--- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
@@ -91,8 +91,8 @@ int rtw_recv_indicatepkt(struct adapter *padapter,
RT_TRACE(_module_recv_osdep_c_, _drv_info_,
("rtw_recv_indicatepkt():skb != NULL !!!\n"));
RT_TRACE(_module_recv_osdep_c_, _drv_info_,
- ("rtw_recv_indicatepkt():precv_frame->rx_head =%p precv_frame->hdr.rx_data =%p\n",
- precv_frame->rx_head, precv_frame->rx_data));
+ ("rtw_recv_indicatepkt(): precv_frame->hdr.rx_data =%p\n",
+ precv_frame->rx_data));
RT_TRACE(_module_recv_osdep_c_, _drv_info_,
("precv_frame->hdr.rx_tail =%p precv_frame->rx_end =%p precv_frame->hdr.len =%d\n",
precv_frame->rx_tail, precv_frame->rx_end,
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 315b077..62dec1e 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -124,7 +124,6 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
pkt_copy = netdev_alloc_skb(adapt->pnetdev, alloc_sz);
if (pkt_copy) {
precvframe->pkt = pkt_copy;
- precvframe->rx_head = pkt_copy->data;
precvframe->rx_end = pkt_copy->data + alloc_sz;
skb_reserve(pkt_copy, 8 - ((size_t)(pkt_copy->data) & 7));/* force pkt_copy->data at 8-byte alignment address */
skb_reserve(pkt_copy, shift_sz);/* force ip_hdr at 8-byte alignment address according to shift_sz. */
--
2.7.3

2016-10-19 16:53:53

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call

On Wed, 2016-10-19 at 22:07 +0700, Ivan Safonov wrote:
> netdev_alloc_skb function
> already set dev member of pkt_copy.

It might be one line.

Some special references:
functions: function()
structs: struct my_struct

P.S. Entire series lacks of cover letter.

>
> Signed-off-by: Ivan Safonov <[email protected]>
> ---
>  drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
> b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
> index 34198fe..f19b203 100644
> --- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
> +++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
> @@ -123,7 +123,6 @@ static int recvbuf2recvframe(struct adapter
> *adapt, struct sk_buff *pskb)
>  
>   pkt_copy = netdev_alloc_skb(adapt->pnetdev,
> alloc_sz);
>   if (pkt_copy) {
> - pkt_copy->dev = adapt->pnetdev;
>   precvframe->pkt = pkt_copy;
>   precvframe->rx_head = pkt_copy->data;
>   precvframe->rx_end = pkt_copy->data +
> alloc_sz;

--
Andy Shevchenko <[email protected]>
Intel Finland Oy

2016-10-19 17:05:58

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call

On Wed, 2016-10-19 at 19:53 +0300, Andy Shevchenko wrote:
> On Wed, 2016-10-19 at 22:07 +0700, Ivan Safonov wrote:
> >
> > netdev_alloc_skb function
> > already set dev member of pkt_copy.
>
> It might be one line.
>
> Some special references:
> functions: function()
> structs: struct my_struct
>
> P.S. Entire series lacks of cover letter.

And couple more things:
 - Use min percentage when run git format-patch to avoid inclusion non-
maintainers / non-active developers
 - Adjust your commit messages to be a bit more verbose and put
explanation "why you create the patch" before "what is done in the
patch".

>
> >
> >
> > Signed-off-by: Ivan Safonov <[email protected]>
> > ---
> >  drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
> > b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
> > index 34198fe..f19b203 100644
> > --- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
> > +++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
> > @@ -123,7 +123,6 @@ static int recvbuf2recvframe(struct adapter
> > *adapt, struct sk_buff *pskb)
> >  
> >   pkt_copy = netdev_alloc_skb(adapt->pnetdev,
> > alloc_sz);
> >   if (pkt_copy) {
> > - pkt_copy->dev = adapt->pnetdev;
> >   precvframe->pkt = pkt_copy;
> >   precvframe->rx_head = pkt_copy->data;
> >   precvframe->rx_end = pkt_copy->data +
> > alloc_sz;
>

--
Andy Shevchenko <[email protected]>
Intel Finland Oy

2016-10-20 08:43:47

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 03/37] staging:r8188eu: remove skb cloning after netdev_alloc_skb fail

On Wed, Oct 19, 2016 at 10:07:31PM +0700, Ivan Safonov wrote:
> In accordance with the KISS principle.
>

The changelog is not complete enough.

Some people are going to read only the subject, but other people are
only going to read the body of the changelog. They can be far apart
depending on how you look at patches. For example:
http://marc.info/?l=linux-driver-devel&m=147688960328996&w=2

It should say: "Just drop the packet if we can't allocate data. Don't
go to a lot of work to try recover. Let the other side resend the
data."

regards,
dan carpenter


2016-10-20 08:47:35

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call

On Wed, Oct 19, 2016 at 10:07:30PM +0700, Ivan Safonov wrote:
> netdev_alloc_skb function
> already set dev member of pkt_copy.
>

I'm coming back to this one after sending a response to patch 3. Here
again, this patch was complicated for me to review because I mostly read
the body of the email and not the subject.

regards,
dan carpenter

2016-10-20 09:04:18

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 17/37] staging:r8188eu: update pkt->data synchronously with rx_data

On Wed, Oct 19, 2016 at 10:07:45PM +0700, Ivan Safonov wrote:
> To replace rx_data with pkt->data.
> Now pkt->data is equal to rx_data.
>

I'm not smart enough to tell on my own... Is this a bugfix?

regards,
dan carpenter

2016-10-20 09:12:03

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 29/37] staging:r8188eu: take out stripping of iv and icv space from wlanhdr_to_ethhdr function

On Wed, Oct 19, 2016 at 10:07:57PM +0700, Ivan Safonov wrote:
> @@ -1733,6 +1729,13 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
> return bPktInBuf;
> }
>
> +void strip_iv_icv(struct sk_buff *skb, uint header_len,
> + uint iv_len, uint icv_len) {

Curly braces go down a line.

> + memmove(skb->data + iv_len, skb->data, header_len);
> + skb_pull(skb, iv_len);
> + skb_trim(skb, skb->len - icv_len);
> +}

regards,
dan carpenter

2016-10-20 09:19:17

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 01/37] staging:r8188eu: remove get_rxmem function

I don't know exactly what the game plan is for the rtl8188eu driver but
these patches seem to be on the right path to me.

regards,
dan carpenter

2016-10-20 12:13:39

by Ivan Safonov

[permalink] [raw]
Subject: Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call

Andy,
thank you for reviewing patches and tips.

On 10/19/2016 11:59 PM, Andy Shevchenko wrote:
> On Wed, 2016-10-19 at 19:53 +0300, Andy Shevchenko wrote:
>> On Wed, 2016-10-19 at 22:07 +0700, Ivan Safonov wrote:
>>>
>>> netdev_alloc_skb function
>>> already set dev member of pkt_copy.
>>
>> It might be one line.
>>
>> Some special references:
>> functions: function()
>> structs: struct my_struct
>>
>> P.S. Entire series lacks of cover letter.
>
> And couple more things:
> - Use min percentage when run git format-patch to avoid inclusion non-
> maintainers / non-active developers
> - Adjust your commit messages to be a bit more verbose and put
> explanation "why you create the patch" before "what is done in the
> patch".
>
>>
>>>
>>>
>>> Signed-off-by: Ivan Safonov <[email protected]>
>>> ---
>>> drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 1 -
>>> 1 file changed, 1 deletion(-)
>>>
>>> diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
>>> b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
>>> index 34198fe..f19b203 100644
>>> --- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
>>> +++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
>>> @@ -123,7 +123,6 @@ static int recvbuf2recvframe(struct adapter
>>> *adapt, struct sk_buff *pskb)
>>>
>>> pkt_copy = netdev_alloc_skb(adapt->pnetdev,
>>> alloc_sz);
>>> if (pkt_copy) {
>>> - pkt_copy->dev = adapt->pnetdev;
>>> precvframe->pkt = pkt_copy;
>>> precvframe->rx_head = pkt_copy->data;
>>> precvframe->rx_end = pkt_copy->data +
>>> alloc_sz;
>>
>

2016-10-20 13:13:16

by Ivan Safonov

[permalink] [raw]
Subject: Re: [PATCH 17/37] staging:r8188eu: update pkt->data synchronously with rx_data

On 10/20/2016 04:03 PM, Dan Carpenter wrote:
> On Wed, Oct 19, 2016 at 10:07:45PM +0700, Ivan Safonov wrote:
>> To replace rx_data with pkt->data.
>> Now pkt->data is equal to rx_data.
>>
>
> I'm not smart enough to tell on my own... Is this a bugfix?

It is not bugfix, only variable replacement.
recv_frame structure duplicates sk_buff. Most of the ieee80211_*
functions require a pointer to sk_buff. Therefore, easier to use sk_buff
instead of recv_frame structure.

>
> regards,
> dan carpenter
>

2016-10-20 13:53:23

by Ivan Safonov

[permalink] [raw]
Subject: Re: [PATCH 01/37] staging:r8188eu: remove get_rxmem function

On 10/20/2016 04:18 PM, Dan Carpenter wrote:
> I don't know exactly what the game plan is for the rtl8188eu driver but
> these patches seem to be on the right path to me.
>
> regards,
> dan carpenter
>

If this driver has no future and will be removed, then what code is
better to invest my efforts?
Linux programming is only my hobby and point in CV.

2016-10-25 08:51:26

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call

On Thu, Oct 20, 2016 at 07:16:20PM +0700, Ivan Safonov wrote:
> Andy,
> thank you for reviewing patches and tips.

Please redo this series based on these responses and resend.

thanks,

greg k-h

2016-10-25 09:12:22

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 13/37] staging:r8188eu: remove debug messages after memory allocation failed

On Wed, Oct 19, 2016 at 10:07:41PM +0700, Ivan Safonov wrote:
> These messages are redundant.
> Also break rtw_usb_if1_init function if HalData allocation failed.
>
> Signed-off-by: Ivan Safonov <[email protected]>

Since you're redoing this anyway, please split this one into two
patches. We really frown on mixing bugfixes with cleanups. I wasn't
frowning on it enough to ask you to redo the series but since you're
already doing that...

regards,
dan carpenter