summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/txrx.c
diff options
context:
space:
mode:
authorAvinash Patil <patila@marvell.com>2012-10-19 19:19:21 -0700
committerJohn W. Linville <linville@tuxdriver.com>2012-10-29 15:20:34 -0400
commitf3b369e40a0fbf975ab0e39c2104f184e188afc3 (patch)
treeee515cc33fb1c9c817d93179441aaf2289af1376 /drivers/net/wireless/mwifiex/txrx.c
parent3a5b8a16856a4864efa5405e40eb05086b6956e6 (diff)
downloadblackbird-obmc-linux-f3b369e40a0fbf975ab0e39c2104f184e188afc3.tar.gz
blackbird-obmc-linux-f3b369e40a0fbf975ab0e39c2104f184e188afc3.zip
mwifiex: rx path enhancement to derive priv only once
We derive mwifiex_private structure which is per interface from received skb's rx_info. Once priv is derived, same priv can be propagated to other functions instead of callee deriving priv from rx_info again. Signed-off-by: Avinash Patil <patila@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/txrx.c')
-rw-r--r--drivers/net/wireless/mwifiex/txrx.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c
index 2af263992e83..5cb3f7af8749 100644
--- a/drivers/net/wireless/mwifiex/txrx.c
+++ b/drivers/net/wireless/mwifiex/txrx.c
@@ -48,13 +48,19 @@ int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter,
if (!priv)
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
+ if (!priv) {
+ dev_err(adapter->dev, "data: priv not found. Drop RX packet\n");
+ dev_kfree_skb_any(skb);
+ return -1;
+ }
+
rx_info->bss_num = priv->bss_num;
rx_info->bss_type = priv->bss_type;
if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
- return mwifiex_process_uap_rx_packet(adapter, skb);
+ return mwifiex_process_uap_rx_packet(priv, skb);
- return mwifiex_process_sta_rx_packet(adapter, skb);
+ return mwifiex_process_sta_rx_packet(priv, skb);
}
EXPORT_SYMBOL_GPL(mwifiex_handle_rx_packet);
OpenPOWER on IntegriCloud