diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2014-09-12 10:38:58 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-09-15 15:00:52 -0400 |
commit | d8d91253ba11bb6e98105c2bc88a40d08fac06ff (patch) | |
tree | 62ab4e47c86d5f180c1fbde0b1790de03c0b1a3d /drivers/net/wireless/mwifiex/main.c | |
parent | 971a73f5523ea0512267949bd6ae3f68b9f3431f (diff) |
mwifiex: remove low priority scan handling
We have a logic in driver to delay or abort low priority scan
to serve Tx traffic effectively. With scan channel
gap support added, firmware now allows driver to send Tx data while
scan operation is in progress. Hence low priority scan handling
in driver is not required now. This patch removes related code.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@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/main.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/main.c | 96 |
1 files changed, 1 insertions, 95 deletions
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index d6d2342ffbac..f1393868d04c 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -28,91 +28,6 @@ const char driver_version[] = "mwifiex " VERSION " (%s) "; | |||
28 | static char *cal_data_cfg; | 28 | static char *cal_data_cfg; |
29 | module_param(cal_data_cfg, charp, 0); | 29 | module_param(cal_data_cfg, charp, 0); |
30 | 30 | ||
31 | static void scan_delay_timer_fn(unsigned long data) | ||
32 | { | ||
33 | struct mwifiex_private *priv = (struct mwifiex_private *)data; | ||
34 | struct mwifiex_adapter *adapter = priv->adapter; | ||
35 | struct cmd_ctrl_node *cmd_node, *tmp_node; | ||
36 | spinlock_t *scan_q_lock = &adapter->scan_pending_q_lock; | ||
37 | unsigned long flags; | ||
38 | |||
39 | if (adapter->surprise_removed) | ||
40 | return; | ||
41 | |||
42 | if (adapter->scan_delay_cnt == MWIFIEX_MAX_SCAN_DELAY_CNT || | ||
43 | !adapter->scan_processing) { | ||
44 | /* | ||
45 | * Abort scan operation by cancelling all pending scan | ||
46 | * commands | ||
47 | */ | ||
48 | spin_lock_irqsave(scan_q_lock, flags); | ||
49 | list_for_each_entry_safe(cmd_node, tmp_node, | ||
50 | &adapter->scan_pending_q, list) { | ||
51 | list_del(&cmd_node->list); | ||
52 | mwifiex_insert_cmd_to_free_q(adapter, cmd_node); | ||
53 | } | ||
54 | spin_unlock_irqrestore(scan_q_lock, flags); | ||
55 | |||
56 | spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); | ||
57 | adapter->scan_processing = false; | ||
58 | adapter->scan_delay_cnt = 0; | ||
59 | adapter->empty_tx_q_cnt = 0; | ||
60 | spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); | ||
61 | |||
62 | if (priv->scan_request) { | ||
63 | dev_dbg(adapter->dev, "info: aborting scan\n"); | ||
64 | cfg80211_scan_done(priv->scan_request, 1); | ||
65 | priv->scan_request = NULL; | ||
66 | } else { | ||
67 | priv->scan_aborting = false; | ||
68 | dev_dbg(adapter->dev, "info: scan already aborted\n"); | ||
69 | } | ||
70 | goto done; | ||
71 | } | ||
72 | |||
73 | if (!atomic_read(&priv->adapter->is_tx_received)) { | ||
74 | adapter->empty_tx_q_cnt++; | ||
75 | if (adapter->empty_tx_q_cnt == MWIFIEX_MAX_EMPTY_TX_Q_CNT) { | ||
76 | /* | ||
77 | * No Tx traffic for 200msec. Get scan command from | ||
78 | * scan pending queue and put to cmd pending queue to | ||
79 | * resume scan operation | ||
80 | */ | ||
81 | adapter->scan_delay_cnt = 0; | ||
82 | adapter->empty_tx_q_cnt = 0; | ||
83 | spin_lock_irqsave(scan_q_lock, flags); | ||
84 | |||
85 | if (list_empty(&adapter->scan_pending_q)) { | ||
86 | spin_unlock_irqrestore(scan_q_lock, flags); | ||
87 | goto done; | ||
88 | } | ||
89 | |||
90 | cmd_node = list_first_entry(&adapter->scan_pending_q, | ||
91 | struct cmd_ctrl_node, list); | ||
92 | list_del(&cmd_node->list); | ||
93 | spin_unlock_irqrestore(scan_q_lock, flags); | ||
94 | |||
95 | mwifiex_insert_cmd_to_pending_q(adapter, cmd_node, | ||
96 | true); | ||
97 | queue_work(adapter->workqueue, &adapter->main_work); | ||
98 | goto done; | ||
99 | } | ||
100 | } else { | ||
101 | adapter->empty_tx_q_cnt = 0; | ||
102 | } | ||
103 | |||
104 | /* Delay scan operation further by 20msec */ | ||
105 | mod_timer(&priv->scan_delay_timer, jiffies + | ||
106 | msecs_to_jiffies(MWIFIEX_SCAN_DELAY_MSEC)); | ||
107 | adapter->scan_delay_cnt++; | ||
108 | |||
109 | done: | ||
110 | if (atomic_read(&priv->adapter->is_tx_received)) | ||
111 | atomic_set(&priv->adapter->is_tx_received, false); | ||
112 | |||
113 | return; | ||
114 | } | ||
115 | |||
116 | /* | 31 | /* |
117 | * This function registers the device and performs all the necessary | 32 | * This function registers the device and performs all the necessary |
118 | * initializations. | 33 | * initializations. |
@@ -160,10 +75,6 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, | |||
160 | 75 | ||
161 | adapter->priv[i]->adapter = adapter; | 76 | adapter->priv[i]->adapter = adapter; |
162 | adapter->priv_num++; | 77 | adapter->priv_num++; |
163 | |||
164 | setup_timer(&adapter->priv[i]->scan_delay_timer, | ||
165 | scan_delay_timer_fn, | ||
166 | (unsigned long)adapter->priv[i]); | ||
167 | } | 78 | } |
168 | mwifiex_init_lock_list(adapter); | 79 | mwifiex_init_lock_list(adapter); |
169 | 80 | ||
@@ -207,7 +118,6 @@ static int mwifiex_unregister(struct mwifiex_adapter *adapter) | |||
207 | for (i = 0; i < adapter->priv_num; i++) { | 118 | for (i = 0; i < adapter->priv_num; i++) { |
208 | if (adapter->priv[i]) { | 119 | if (adapter->priv[i]) { |
209 | mwifiex_free_curr_bcn(adapter->priv[i]); | 120 | mwifiex_free_curr_bcn(adapter->priv[i]); |
210 | del_timer_sync(&adapter->priv[i]->scan_delay_timer); | ||
211 | kfree(adapter->priv[i]); | 121 | kfree(adapter->priv[i]); |
212 | } | 122 | } |
213 | } | 123 | } |
@@ -285,7 +195,6 @@ process_start: | |||
285 | break; | 195 | break; |
286 | 196 | ||
287 | if ((!adapter->scan_chan_gap_enabled && | 197 | if ((!adapter->scan_chan_gap_enabled && |
288 | !adapter->scan_delay_cnt && | ||
289 | adapter->scan_processing) || adapter->data_sent || | 198 | adapter->scan_processing) || adapter->data_sent || |
290 | mwifiex_wmm_lists_empty(adapter)) { | 199 | mwifiex_wmm_lists_empty(adapter)) { |
291 | if (adapter->cmd_sent || adapter->curr_cmd || | 200 | if (adapter->cmd_sent || adapter->curr_cmd || |
@@ -341,7 +250,7 @@ process_start: | |||
341 | } | 250 | } |
342 | 251 | ||
343 | if ((adapter->scan_chan_gap_enabled || | 252 | if ((adapter->scan_chan_gap_enabled || |
344 | (!adapter->scan_processing || adapter->scan_delay_cnt)) && | 253 | !adapter->scan_processing) && |
345 | !adapter->data_sent && !mwifiex_wmm_lists_empty(adapter)) { | 254 | !adapter->data_sent && !mwifiex_wmm_lists_empty(adapter)) { |
346 | mwifiex_wmm_process_tx(adapter); | 255 | mwifiex_wmm_process_tx(adapter); |
347 | if (adapter->hs_activated) { | 256 | if (adapter->hs_activated) { |
@@ -600,9 +509,6 @@ int mwifiex_queue_tx_pkt(struct mwifiex_private *priv, struct sk_buff *skb) | |||
600 | atomic_inc(&priv->adapter->tx_pending); | 509 | atomic_inc(&priv->adapter->tx_pending); |
601 | mwifiex_wmm_add_buf_txqueue(priv, skb); | 510 | mwifiex_wmm_add_buf_txqueue(priv, skb); |
602 | 511 | ||
603 | if (priv->adapter->scan_delay_cnt) | ||
604 | atomic_set(&priv->adapter->is_tx_received, true); | ||
605 | |||
606 | queue_work(priv->adapter->workqueue, &priv->adapter->main_work); | 512 | queue_work(priv->adapter->workqueue, &priv->adapter->main_work); |
607 | 513 | ||
608 | return 0; | 514 | return 0; |