diff options
author | Avinash Patil <patila@marvell.com> | 2014-09-12 16:38:59 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-09-15 21:00:52 +0200 |
commit | 6e251174c77a28a4ebaad9be963843898b658039 (patch) | |
tree | 2f52e5110018cb9189f5149ad50893485d6cd947 /drivers/net/wireless/mwifiex/pcie.c | |
parent | mwifiex: remove low priority scan handling (diff) | |
download | linux-6e251174c77a28a4ebaad9be963843898b658039.tar.xz linux-6e251174c77a28a4ebaad9be963843898b658039.zip |
mwifiex: add rx workqueue support
This patch adds RX work queue support to mwifiex.
Packets received are queued to internal queue which are then
processed by scheduling a work item for RX process.
RX work is enabled only on SMP systems.
Reviewed-by: James Cameron <quozl@laptop.org>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/pcie.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/pcie.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c index 2ada1b709778..1504b16e248e 100644 --- a/drivers/net/wireless/mwifiex/pcie.c +++ b/drivers/net/wireless/mwifiex/pcie.c @@ -1233,6 +1233,7 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter) struct sk_buff *skb_tmp = NULL; struct mwifiex_pcie_buf_desc *desc; struct mwifiex_pfu_buf_desc *desc2; + unsigned long flags; if (!mwifiex_pcie_ok_to_access_hw(adapter)) mwifiex_pm_wakeup_card(adapter); @@ -1283,7 +1284,16 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter) "info: RECV DATA: Rd=%#x, Wr=%#x, Len=%d\n", card->rxbd_rdptr, wrptr, rx_len); skb_pull(skb_data, INTF_HEADER_LEN); - mwifiex_handle_rx_packet(adapter, skb_data); + if (adapter->rx_work_enabled) { + spin_lock_irqsave(&adapter->rx_q_lock, flags); + skb_queue_tail(&adapter->rx_data_q, skb_data); + spin_unlock_irqrestore(&adapter->rx_q_lock, + flags); + adapter->data_received = true; + atomic_inc(&adapter->rx_pending); + } else { + mwifiex_handle_rx_packet(adapter, skb_data); + } } skb_tmp = dev_alloc_skb(MWIFIEX_RX_DATA_BUF_SIZE); |