Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1503831 > unrolled thread
| Started by | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| First post | 2016-10-19 17:10 +0200 |
| Last post | 2016-10-20 16:00 +0200 |
| Articles | 20 on this page of 43 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 01/37] staging:r8188eu: remove get_rxmem function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:10 +0200
[PATCH 25/37] staging:r8188eu: remove len member of recv_frame structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:10 +0200
[PATCH 32/37] staging:r8188eu: remove SET_EARLYMODE_* definitions Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:10 +0200
[PATCH 24/37] staging:r8188eu: remove rx_tail member of recv_frame structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:10 +0200
[PATCH 13/37] staging:r8188eu: remove debug messages after memory allocation failed Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
Re: [PATCH 13/37] staging:r8188eu: remove debug messages after memory allocation failed Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-25 11:20 +0200
[PATCH 21/37] staging:r8188eu: change recvframe_pull_tail last argument type Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
[PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-10-19 19:00 +0200
Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-10-19 19:10 +0200
Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call Ivan Safonov <insafonov@gmail.com> - 2016-10-20 14:20 +0200
Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-25 11:00 +0200
Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-20 10:50 +0200
[PATCH 37/37] staging:r8188eu: remove P2P_* enumerations. Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
[PATCH 19/37] staging:r8188eu: remove rx_end member of recv_frame structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
[PATCH 04/37] staging:r8188eu: remove WIFI_MP_* definitions and all corresponding code Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
[PATCH 30/37] staging:r8188eu: remove eth_type member of rx_pkt_attrib structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
[PATCH 16/37] staging:r8188eu: change recvframe_pull last argument type Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
[PATCH 36/37] staging:r8188eu: remove unused structures from include/rtw_mlme.h Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
[PATCH 03/37] staging:r8188eu: remove skb cloning after netdev_alloc_skb fail Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
Re: [PATCH 03/37] staging:r8188eu: remove skb cloning after netdev_alloc_skb fail Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-20 10:50 +0200
[PATCH 27/37] staging:r8188eu: remove recvframe_put function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
[PATCH 07/37] staging:r8188eu: remove is2t argument if the phy_iq_calibrate function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
[PATCH 11/37] staging:r8188eu: remove is_(multicast|broadcast)_mac_addr Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
[PATCH 10/37] staging:r8188eu: remove type cast for first argument of memset Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:20 +0200
[PATCH 14/37] staging:r8188eu: remove ieee80211_is_empty_essid function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 15/37] staging:r8188eu: remove rx_head member of recv_frame structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 34/37] staging:r8188eu: remove update_bcn member of mlme_priv structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 23/37] staging:r8188eu: update rx_tail and pkt->tail synchronously Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 20/37] staging:r8188eu: change recvframe_put last argument type Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 22/37] staging:r8188eu: change recvframe_pull_tail type to void Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 31/37] staging:r8188eu: remove pscanned member of mlme_priv structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 35/37] staging:r8188eu: remove clr_fwstate* functions Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 29/37] staging:r8188eu: take out stripping of iv and icv space from wlanhdr_to_ethhdr function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
Re: [PATCH 29/37] staging:r8188eu: take out stripping of iv and icv space from wlanhdr_to_ethhdr function Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-20 11:20 +0200
[PATCH 12/37] staging:r8188eu: remove ieee80211_get_hdrlen function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 26/37] staging:r8188eu: remove recvframe_pull function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 09/37] staging:r8188eu: remove is2t argument of phy_lc_calibrate function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 28/37] staging:r8188eu: remove recvframe_pull_tail function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 18/37] staging:r8188eu: remove rx_data member of recv_frame structure Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
[PATCH 08/37] staging:r8188eu: refactor path_adda_on function Ivan Safonov <insafonov@gmail.com> - 2016-10-19 17:30 +0200
Re: [PATCH 01/37] staging:r8188eu: remove get_rxmem function Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-20 11:20 +0200
Re: [PATCH 01/37] staging:r8188eu: remove get_rxmem function Ivan Safonov <insafonov@gmail.com> - 2016-10-20 16:00 +0200
Page 1 of 3 [1] 2 3 Next page →
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:10 +0200 |
| Subject | [PATCH 01/37] staging:r8188eu: remove get_rxmem function |
| Message-ID | <su0Fb-2Wq-3@gated-at.bofh.it> |
This simple one-line function used only once, and precvframe always not NULL.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:10 +0200 |
| Subject | [PATCH 25/37] staging:r8188eu: remove len member of recv_frame structure |
| Message-ID | <su0Fd-2Wq-71@gated-at.bofh.it> |
| In reply to | #1503831 |
len replaced with pkt->len.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:10 +0200 |
| Subject | [PATCH 32/37] staging:r8188eu: remove SET_EARLYMODE_* definitions |
| Message-ID | <su0Fe-2Wq-89@gated-at.bofh.it> |
| In reply to | #1503831 |
These definitions does not used. Signed-off-by: Ivan Safonov <insafonov@gmail.com> --- 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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:10 +0200 |
| Subject | [PATCH 24/37] staging:r8188eu: remove rx_tail member of recv_frame structure |
| Message-ID | <su0Fe-2Wq-95@gated-at.bofh.it> |
| In reply to | #1503831 |
rx_end replaced with pkt->tail.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:20 +0200 |
| Subject | [PATCH 13/37] staging:r8188eu: remove debug messages after memory allocation failed |
| Message-ID | <su0OR-308-5@gated-at.bofh.it> |
| In reply to | #1503831 |
These messages are redundant.
Also break rtw_usb_if1_init function if HalData allocation failed.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [prev] | [next] | [standalone]
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2016-10-25 11:20 +0200 |
| Subject | Re: [PATCH 13/37] staging:r8188eu: remove debug messages after memory allocation failed |
| Message-ID | <sw63M-3ER-19@gated-at.bofh.it> |
| In reply to | #1503853 |
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 <insafonov@gmail.com> 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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:20 +0200 |
| Subject | [PATCH 21/37] staging:r8188eu: change recvframe_pull_tail last argument type |
| Message-ID | <su0OR-308-7@gated-at.bofh.it> |
| In reply to | #1503831 |
uint instead of int used.
This function always called with positive sz argument.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:20 +0200 |
| Subject | [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call |
| Message-ID | <su0OR-308-11@gated-at.bofh.it> |
| In reply to | #1503831 |
netdev_alloc_skb function
already set dev member of pkt_copy.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [prev] | [next] | [standalone]
| From | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
|---|---|
| Date | 2016-10-19 19:00 +0200 |
| Subject | Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call |
| Message-ID | <su2nE-3Wn-63@gated-at.bofh.it> |
| In reply to | #1503859 |
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 <insafonov@gmail.com>
> ---
> 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 <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
[toc] | [prev] | [next] | [standalone]
| From | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
|---|---|
| Date | 2016-10-19 19:10 +0200 |
| Subject | Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call |
| Message-ID | <su2xj-4eW-15@gated-at.bofh.it> |
| In reply to | #1504139 |
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 <insafonov@gmail.com>
> > ---
> > 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 <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-20 14:20 +0200 |
| Subject | Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call |
| Message-ID | <sukuf-7se-71@gated-at.bofh.it> |
| In reply to | #1504148 |
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 <insafonov@gmail.com>
>>> ---
>>> 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;
>>
>
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-10-25 11:00 +0200 |
| Subject | Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call |
| Message-ID | <sw5Kp-3jn-11@gated-at.bofh.it> |
| In reply to | #1504827 |
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
[toc] | [prev] | [next] | [standalone]
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2016-10-20 10:50 +0200 |
| Subject | Re: [PATCH 02/37] staging:r8188eu: remove device assignment after netdev_alloc_skb call |
| Message-ID | <suhcZ-5ak-19@gated-at.bofh.it> |
| In reply to | #1503859 |
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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:20 +0200 |
| Subject | [PATCH 37/37] staging:r8188eu: remove P2P_* enumerations. |
| Message-ID | <su0OR-308-15@gated-at.bofh.it> |
| In reply to | #1503831 |
Driver does not use this definitions.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:20 +0200 |
| Subject | [PATCH 19/37] staging:r8188eu: remove rx_end member of recv_frame structure |
| Message-ID | <su0OS-308-27@gated-at.bofh.it> |
| In reply to | #1503831 |
rx_end replaced with pkt->end.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:20 +0200 |
| Subject | [PATCH 04/37] staging:r8188eu: remove WIFI_MP_* definitions and all corresponding code |
| Message-ID | <su0OS-308-29@gated-at.bofh.it> |
| In reply to | #1503831 |
fw_state member of mlme_priv
never obtain WIFI_MP_STATE value.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:20 +0200 |
| Subject | [PATCH 30/37] staging:r8188eu: remove eth_type member of rx_pkt_attrib structure |
| Message-ID | <su0OS-308-35@gated-at.bofh.it> |
| In reply to | #1503831 |
Prepare to replacing wlanhdr_to_ethhdr by ieee80211_data_to_8023.
Calculate it locally.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:20 +0200 |
| Subject | [PATCH 16/37] staging:r8188eu: change recvframe_pull last argument type |
| Message-ID | <su0OS-308-49@gated-at.bofh.it> |
| In reply to | #1503831 |
uint instead of int used.
This function always called with positive sz argument.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:20 +0200 |
| Subject | [PATCH 36/37] staging:r8188eu: remove unused structures from include/rtw_mlme.h |
| Message-ID | <su0OS-308-55@gated-at.bofh.it> |
| In reply to | #1503831 |
Also SCAN_RESULT_TYPE enum removed.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2016-10-19 17:20 +0200 |
| Subject | [PATCH 03/37] staging:r8188eu: remove skb cloning after netdev_alloc_skb fail |
| Message-ID | <su0OT-308-67@gated-at.bofh.it> |
| In reply to | #1503831 |
In accordance with the KISS principle.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
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
[toc] | [prev] | [next] | [standalone]
Page 1 of 3 [1] 2 3 Next page →
Back to top | Article view | linux.kernel
csiph-web