linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mwifiex: remove mwifiex_recv_complete function
@ 2011-05-12  2:47 Bing Zhao
  2011-05-12  2:47 ` [PATCH] cfg80211: make stripping of 802.11 header optional from AMSDU Bing Zhao
  0 siblings, 1 reply; 4+ messages in thread
From: Bing Zhao @ 2011-05-12  2:47 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
	Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao

From: Amitkumar Karwar <akarwar@marvell.com>

The function
- increments dropped rx_packet count if status code
  passed to it is "-1".
- frees SKB buffer.

But currently the function is being called with "0" status code.
This patch replaces above function by dev_kfree_skb_any() call.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/cmdevt.c |    6 +++---
 drivers/net/wireless/mwifiex/main.h   |    4 ----
 drivers/net/wireless/mwifiex/util.c   |   25 -------------------------
 3 files changed, 3 insertions(+), 32 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index 5c75399..cd89fed 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -91,7 +91,7 @@ mwifiex_clean_cmd_node(struct mwifiex_adapter *adapter,
 	cmd_node->wait_q_enabled = false;
 
 	if (cmd_node->resp_skb) {
-		mwifiex_recv_complete(adapter, cmd_node->resp_skb, 0);
+		dev_kfree_skb_any(cmd_node->resp_skb);
 		cmd_node->resp_skb = NULL;
 	}
 }
@@ -339,7 +339,7 @@ int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter)
 		}
 		if (!cmd_array[i].resp_skb)
 			continue;
-		mwifiex_recv_complete(adapter, cmd_array[i].resp_skb, 0);
+		dev_kfree_skb_any(cmd_array[i].resp_skb);
 	}
 	/* Release struct cmd_ctrl_node */
 	if (adapter->cmd_pool) {
@@ -402,7 +402,7 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter)
 	adapter->event_cause = 0;
 	adapter->event_skb = NULL;
 
-	mwifiex_recv_complete(adapter, skb, 0);
+	dev_kfree_skb_any(skb);
 
 	return ret;
 }
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index b4bb5ec..672701d 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -692,10 +692,6 @@ int mwifiex_shutdown_fw_complete(struct mwifiex_adapter *adapter);
 
 int mwifiex_dnld_fw(struct mwifiex_adapter *, struct mwifiex_fw_image *);
 
-int mwifiex_recv_complete(struct mwifiex_adapter *,
-			  struct sk_buff *skb,
-			  int status);
-
 int mwifiex_recv_packet(struct mwifiex_adapter *, struct sk_buff *skb);
 
 int mwifiex_process_event(struct mwifiex_adapter *adapter);
diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c
index a8d53aa..d412915 100644
--- a/drivers/net/wireless/mwifiex/util.c
+++ b/drivers/net/wireless/mwifiex/util.c
@@ -177,31 +177,6 @@ int mwifiex_recv_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb)
 }
 
 /*
- * Receive packet completion callback handler.
- *
- * This function updates the statistics and frees the buffer SKB.
- */
-int mwifiex_recv_complete(struct mwifiex_adapter *adapter,
-			  struct sk_buff *skb, int status)
-{
-	struct mwifiex_private *priv;
-	struct mwifiex_rxinfo *rx_info;
-
-	if (!skb)
-		return 0;
-
-	rx_info = MWIFIEX_SKB_RXCB(skb);
-	priv = mwifiex_bss_index_to_priv(adapter, rx_info->bss_index);
-
-	if (priv && (status == -1))
-		priv->stats.rx_dropped++;
-
-	dev_kfree_skb_any(skb);
-
-	return 0;
-}
-
-/*
  * IOCTL completion callback handler.
  *
  * This function is called when a pending IOCTL is completed.
-- 
1.7.0.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] cfg80211: make stripping of 802.11 header optional from AMSDU
  2011-05-12  2:47 [PATCH] mwifiex: remove mwifiex_recv_complete function Bing Zhao
@ 2011-05-12  2:47 ` Bing Zhao
  2011-05-12  8:28   ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Bing Zhao @ 2011-05-12  2:47 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
	Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao

From: Yogesh Ashok Powar <yogeshp@marvell.com>

Currently the devices that have already stripped IEEE 802.11
header from the AMSDU SKB can not use ieee80211_amsdu_to_8023s
routine. This patch enhances ieee80211_amsdu_to_8023s() API by
changing mandatory removing of IEEE 802.11 header from AMSDU
to optional.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/iwmc3200wifi/rx.c |    3 ++-
 include/net/cfg80211.h                 |    5 ++++-
 net/mac80211/rx.c                      |    2 +-
 net/wireless/util.c                    |   21 +++++++++++++--------
 4 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/iwmc3200wifi/rx.c b/drivers/net/wireless/iwmc3200wifi/rx.c
index 9a57cf6..f9bfa10 100644
--- a/drivers/net/wireless/iwmc3200wifi/rx.c
+++ b/drivers/net/wireless/iwmc3200wifi/rx.c
@@ -1576,7 +1576,8 @@ static void iwm_rx_process_amsdu(struct iwm_priv *iwm, struct sk_buff *skb)
 	IWM_HEXDUMP(iwm, DBG, RX, "A-MSDU: ", skb->data, skb->len);
 
 	__skb_queue_head_init(&list);
-	ieee80211_amsdu_to_8023s(skb, &list, ndev->dev_addr, wdev->iftype, 0);
+	ieee80211_amsdu_to_8023s(skb, &list, ndev->dev_addr, wdev->iftype, 0,
+									false);
 
 	while ((frame = __skb_dequeue(&list))) {
 		ndev->stats.rx_packets++;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 1f1e221..cd8f7c6 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2173,10 +2173,13 @@ int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
  * @addr: The device MAC address.
  * @iftype: The device interface type.
  * @extra_headroom: The hardware extra headroom for SKBs in the @list.
+ * @stripped_80211_header: Set it true if SKB is without IEEE 802.11
+ *	header.
  */
 void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
 			      const u8 *addr, enum nl80211_iftype iftype,
-			      const unsigned int extra_headroom);
+			      const unsigned int extra_headroom,
+			      bool stripped_80211_header);
 
 /**
  * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index b6bde2e..0b36e35 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1783,7 +1783,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
 
 	ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr,
 				 rx->sdata->vif.type,
-				 rx->local->hw.extra_tx_headroom);
+				 rx->local->hw.extra_tx_headroom, false);
 
 	while (!skb_queue_empty(&frame_list)) {
 		rx->skb = __skb_dequeue(&frame_list);
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 6a750bc..1da1a7c 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -544,7 +544,8 @@ EXPORT_SYMBOL(ieee80211_data_from_8023);
 
 void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
 			      const u8 *addr, enum nl80211_iftype iftype,
-			      const unsigned int extra_headroom)
+			      const unsigned int extra_headroom,
+			      bool stripped_80211_header)
 {
 	struct sk_buff *frame = NULL;
 	u16 ethertype;
@@ -553,14 +554,18 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
 	int remaining, err;
 	u8 dst[ETH_ALEN], src[ETH_ALEN];
 
-	err = ieee80211_data_to_8023(skb, addr, iftype);
-	if (err)
-		goto out;
+	if (!stripped_80211_header) {
+		err = ieee80211_data_to_8023(skb, addr, iftype);
+		if (err)
+			goto out;
 
-	/* skip the wrapping header */
-	eth = (struct ethhdr *) skb_pull(skb, sizeof(struct ethhdr));
-	if (!eth)
-		goto out;
+		/* skip the wrapping header */
+		eth = (struct ethhdr *) skb_pull(skb, sizeof(struct ethhdr));
+		if (!eth)
+			goto out;
+	} else {
+		eth = (struct ethhdr *) skb->data;
+	}
 
 	while (skb != frame) {
 		u8 padding;
-- 
1.7.0.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] cfg80211: make stripping of 802.11 header optional from AMSDU
  2011-05-12  2:47 ` [PATCH] cfg80211: make stripping of 802.11 header optional from AMSDU Bing Zhao
@ 2011-05-12  8:28   ` Johannes Berg
  2011-05-13 17:40     ` Bing Zhao
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2011-05-12  8:28 UTC (permalink / raw)
  To: Bing Zhao
  Cc: linux-wireless, John W. Linville, Amitkumar Karwar, Kiran Divekar,
	Yogesh Powar, Marc Yang, Frank Huang

On Wed, 2011-05-11 at 19:47 -0700, Bing Zhao wrote:
> From: Yogesh Ashok Powar <yogeshp@marvell.com>
> 
> Currently the devices that have already stripped IEEE 802.11
> header from the AMSDU SKB can not use ieee80211_amsdu_to_8023s
> routine. This patch enhances ieee80211_amsdu_to_8023s() API by
> changing mandatory removing of IEEE 802.11 header from AMSDU
> to optional.

Nice.

> @@ -2173,10 +2173,13 @@ int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
>   * @addr: The device MAC address.
>   * @iftype: The device interface type.
>   * @extra_headroom: The hardware extra headroom for SKBs in the @list.
> + * @stripped_80211_header: Set it true if SKB is without IEEE 802.11
> + *	header.

I think I'd prefer this be the other way around though, like
"has_80211_header" (or so), that seems more natural here and in the
code? Not that it matters much.

johannes


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] cfg80211: make stripping of 802.11 header optional from AMSDU
  2011-05-12  8:28   ` Johannes Berg
@ 2011-05-13 17:40     ` Bing Zhao
  0 siblings, 0 replies; 4+ messages in thread
From: Bing Zhao @ 2011-05-13 17:40 UTC (permalink / raw)
  To: Johannes Berg
  Cc: linux-wireless@vger.kernel.org, John W. Linville,
	Amitkumar Karwar, Kiran Divekar, Yogesh Powar, Marc Yang,
	Frank Huang

SGkgSm9oYW5uZXMsDQoNCj4gPiBDdXJyZW50bHkgdGhlIGRldmljZXMgdGhhdCBoYXZlIGFscmVh
ZHkgc3RyaXBwZWQgSUVFRSA4MDIuMTENCj4gPiBoZWFkZXIgZnJvbSB0aGUgQU1TRFUgU0tCIGNh
biBub3QgdXNlIGllZWU4MDIxMV9hbXNkdV90b184MDIzcw0KPiA+IHJvdXRpbmUuIFRoaXMgcGF0
Y2ggZW5oYW5jZXMgaWVlZTgwMjExX2Ftc2R1X3RvXzgwMjNzKCkgQVBJIGJ5DQo+ID4gY2hhbmdp
bmcgbWFuZGF0b3J5IHJlbW92aW5nIG9mIElFRUUgODAyLjExIGhlYWRlciBmcm9tIEFNU0RVDQo+
ID4gdG8gb3B0aW9uYWwuDQo+IA0KPiBOaWNlLg0KPiANCj4gPiBAQCAtMjE3MywxMCArMjE3Mywx
MyBAQCBpbnQgaWVlZTgwMjExX2RhdGFfZnJvbV84MDIzKHN0cnVjdCBza19idWZmICpza2IsIGNv
bnN0IHU4ICphZGRyLA0KPiA+ICAgKiBAYWRkcjogVGhlIGRldmljZSBNQUMgYWRkcmVzcy4NCj4g
PiAgICogQGlmdHlwZTogVGhlIGRldmljZSBpbnRlcmZhY2UgdHlwZS4NCj4gPiAgICogQGV4dHJh
X2hlYWRyb29tOiBUaGUgaGFyZHdhcmUgZXh0cmEgaGVhZHJvb20gZm9yIFNLQnMgaW4gdGhlIEBs
aXN0Lg0KPiA+ICsgKiBAc3RyaXBwZWRfODAyMTFfaGVhZGVyOiBTZXQgaXQgdHJ1ZSBpZiBTS0Ig
aXMgd2l0aG91dCBJRUVFIDgwMi4xMQ0KPiA+ICsgKgloZWFkZXIuDQo+IA0KPiBJIHRoaW5rIEkn
ZCBwcmVmZXIgdGhpcyBiZSB0aGUgb3RoZXIgd2F5IGFyb3VuZCB0aG91Z2gsIGxpa2UNCj4gImhh
c184MDIxMV9oZWFkZXIiIChvciBzbyksIHRoYXQgc2VlbXMgbW9yZSBuYXR1cmFsIGhlcmUgYW5k
IGluIHRoZQ0KPiBjb2RlPyBOb3QgdGhhdCBpdCBtYXR0ZXJzIG11Y2guDQoNClRoYW5rcyBmb3Ig
eW91ciBzdWdnZXN0aW9uLiBJIHdpbGwgcmVzZW5kIHRoZSB1cGRhdGVkIHBhdGNoLg0KDQpSZWdh
cmRzLA0KQmluZw0KDQo=

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-13 17:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-12  2:47 [PATCH] mwifiex: remove mwifiex_recv_complete function Bing Zhao
2011-05-12  2:47 ` [PATCH] cfg80211: make stripping of 802.11 header optional from AMSDU Bing Zhao
2011-05-12  8:28   ` Johannes Berg
2011-05-13 17:40     ` Bing Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).