mwifiex: pass priv pointer instead of adapter
authorAvinash Patil <patila@marvell.com>
Wed, 25 Jan 2012 04:50:24 +0000 (20:50 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 27 Jan 2012 19:57:02 +0000 (14:57 -0500)
Pass mwifiex_private pointer directly to wmm_add_buf_txqueue()
instead of passing adapter and then deriving priv again in
mwifiex_get_priv_by_id(). This reduces a 'for' loop in TX path.

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>
drivers/net/wireless/mwifiex/main.c
drivers/net/wireless/mwifiex/wmm.c
drivers/net/wireless/mwifiex/wmm.h

index 1a0775d19ade94ca66b9010437d6186f32224feb..80e44566bf6ecd15bf093ccb9c597088c6ed91c9 100644 (file)
@@ -462,7 +462,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
        tx_info->bss_type = priv->bss_type;
        mwifiex_fill_buffer(skb);
 
-       mwifiex_wmm_add_buf_txqueue(priv->adapter, skb);
+       mwifiex_wmm_add_buf_txqueue(priv, skb);
        atomic_inc(&priv->adapter->tx_pending);
 
        if (atomic_read(&priv->adapter->tx_pending) >= MAX_TX_PENDING) {
index e6a2cb127d2bc946781c13af0dbda44585a679d6..75f79ef9f6cfed068497e384a36384224985bb83 100644 (file)
@@ -599,12 +599,10 @@ mwifiex_is_ralist_valid(struct mwifiex_private *priv,
  * is queued at the list tail.
  */
 void
-mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter,
+mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv,
                            struct sk_buff *skb)
 {
-       struct mwifiex_txinfo *tx_info = MWIFIEX_SKB_TXCB(skb);
-       struct mwifiex_private *priv = mwifiex_get_priv_by_id(adapter,
-                       tx_info->bss_num, tx_info->bss_type);
+       struct mwifiex_adapter *adapter = priv->adapter;
        u32 tid;
        struct mwifiex_ra_list_tbl *ra_list;
        u8 ra[ETH_ALEN], tid_down;
index fcea1f68792f8c06e053352a69a17164194d0987..ec839952d2e77bc01bf57bb63be53086913821f0 100644 (file)
@@ -80,8 +80,8 @@ mwifiex_wmm_is_ra_list_empty(struct list_head *ra_list_hhead)
        return true;
 }
 
-void mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter,
-                                struct sk_buff *skb);
+void mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv,
+                                       struct sk_buff *skb);
 void mwifiex_ralist_add(struct mwifiex_private *priv, u8 *ra);
 
 int mwifiex_wmm_lists_empty(struct mwifiex_adapter *adapter);