diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2012-06-20 23:21:12 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-06-22 13:59:50 -0400 |
commit | e80c81dc1416e326482c601af3a19d0f9989638e (patch) | |
tree | f7e73db805d9ab285f03206dbbf17c1b2be581ab /drivers/net/wireless/mwifiex/sta_event.c | |
parent | f03ba7e9a24e5e9efaad56bd1713b994ea556b16 (diff) |
mwifiex: fix bugs in event handling code
This patch ensures uniformity in event skb sent by interface code
(USB/PCIe/SDIO) which automatically fixes following bugs.
1) For USB interface, same buffer is reused for receiving cmd and
events from firmware. While handling events, we perform
skb_pull(skb, 4) to remove event header. Corresponding skb_push()
call is missing while submitting the buffer.
2) For PCIe interface, event skb is passed with event header.
Recently added uAP events EVENT_UAP_STA_ASSOC, EVENT_UAP_STA_DEAUTH
will not work for PCIe, as they assume event skb points to event body.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/sta_event.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_event.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c index 4ace5a3dcd23..11e731f3581c 100644 --- a/drivers/net/wireless/mwifiex/sta_event.c +++ b/drivers/net/wireless/mwifiex/sta_event.c | |||
@@ -406,9 +406,9 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) | |||
406 | break; | 406 | break; |
407 | 407 | ||
408 | case EVENT_UAP_STA_ASSOC: | 408 | case EVENT_UAP_STA_ASSOC: |
409 | skb_pull(adapter->event_skb, MWIFIEX_UAP_EVENT_EXTRA_HEADER); | ||
410 | memset(&sinfo, 0, sizeof(sinfo)); | 409 | memset(&sinfo, 0, sizeof(sinfo)); |
411 | event = (struct mwifiex_assoc_event *)adapter->event_skb->data; | 410 | event = (struct mwifiex_assoc_event *) |
411 | (adapter->event_body + MWIFIEX_UAP_EVENT_EXTRA_HEADER); | ||
412 | if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) { | 412 | if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) { |
413 | len = -1; | 413 | len = -1; |
414 | 414 | ||
@@ -433,9 +433,8 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) | |||
433 | GFP_KERNEL); | 433 | GFP_KERNEL); |
434 | break; | 434 | break; |
435 | case EVENT_UAP_STA_DEAUTH: | 435 | case EVENT_UAP_STA_DEAUTH: |
436 | skb_pull(adapter->event_skb, MWIFIEX_UAP_EVENT_EXTRA_HEADER); | 436 | cfg80211_del_sta(priv->netdev, adapter->event_body + |
437 | cfg80211_del_sta(priv->netdev, adapter->event_skb->data, | 437 | MWIFIEX_UAP_EVENT_EXTRA_HEADER, GFP_KERNEL); |
438 | GFP_KERNEL); | ||
439 | break; | 438 | break; |
440 | case EVENT_UAP_BSS_IDLE: | 439 | case EVENT_UAP_BSS_IDLE: |
441 | priv->media_connected = false; | 440 | priv->media_connected = false; |