diff options
author | Sujith Manoharan <Sujith.Manoharan@atheros.com> | 2011-04-13 01:55:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-13 15:23:16 -0400 |
commit | 658ef04fd42a587b17a379ad9208023473442ddd (patch) | |
tree | 6924eb7847c62cce0ef4125ecb76aa448407535d /drivers/net | |
parent | ee3fa1bdadd998652083a7814af745f765a06a25 (diff) |
ath9k_htc: Move TX specific stuff to a separate structure
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc.h | 19 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_main.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 24 |
5 files changed, 40 insertions, 35 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 1568c3692da4..3af8a58d400f 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h | |||
@@ -260,6 +260,13 @@ struct ath9k_htc_rx { | |||
260 | spinlock_t rxbuflock; | 260 | spinlock_t rxbuflock; |
261 | }; | 261 | }; |
262 | 262 | ||
263 | struct ath9k_htc_tx { | ||
264 | bool tx_queues_stop; | ||
265 | spinlock_t tx_lock; | ||
266 | |||
267 | struct sk_buff_head tx_queue; | ||
268 | }; | ||
269 | |||
263 | struct ath9k_htc_tx_ctl { | 270 | struct ath9k_htc_tx_ctl { |
264 | u8 type; /* ATH9K_HTC_* */ | 271 | u8 type; /* ATH9K_HTC_* */ |
265 | }; | 272 | }; |
@@ -433,22 +440,20 @@ struct ath9k_htc_priv { | |||
433 | u16 nstations; | 440 | u16 nstations; |
434 | bool rearm_ani; | 441 | bool rearm_ani; |
435 | bool reconfig_beacon; | 442 | bool reconfig_beacon; |
443 | unsigned int rxfilter; | ||
436 | 444 | ||
437 | struct ath9k_hw_cal_data caldata; | 445 | struct ath9k_hw_cal_data caldata; |
446 | struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; | ||
438 | 447 | ||
439 | spinlock_t beacon_lock; | 448 | spinlock_t beacon_lock; |
449 | struct htc_beacon_config cur_beacon_conf; | ||
440 | 450 | ||
441 | bool tx_queues_stop; | 451 | struct ath9k_htc_rx rx; |
442 | spinlock_t tx_lock; | 452 | struct ath9k_htc_tx tx; |
443 | 453 | ||
444 | struct htc_beacon_config cur_beacon_conf; | ||
445 | unsigned int rxfilter; | ||
446 | struct tasklet_struct swba_tasklet; | 454 | struct tasklet_struct swba_tasklet; |
447 | struct tasklet_struct rx_tasklet; | 455 | struct tasklet_struct rx_tasklet; |
448 | struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; | ||
449 | struct ath9k_htc_rx rx; | ||
450 | struct tasklet_struct tx_tasklet; | 456 | struct tasklet_struct tx_tasklet; |
451 | struct sk_buff_head tx_queue; | ||
452 | struct delayed_work ani_work; | 457 | struct delayed_work ani_work; |
453 | struct work_struct ps_work; | 458 | struct work_struct ps_work; |
454 | struct work_struct fatal_work; | 459 | struct work_struct fatal_work; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c index 459ba0d36f4c..1f6df4a1d224 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | |||
@@ -398,9 +398,9 @@ void ath9k_htc_radio_enable(struct ieee80211_hw *hw) | |||
398 | 398 | ||
399 | /* Start TX */ | 399 | /* Start TX */ |
400 | htc_start(priv->htc); | 400 | htc_start(priv->htc); |
401 | spin_lock_bh(&priv->tx_lock); | 401 | spin_lock_bh(&priv->tx.tx_lock); |
402 | priv->tx_queues_stop = false; | 402 | priv->tx.tx_queues_stop = false; |
403 | spin_unlock_bh(&priv->tx_lock); | 403 | spin_unlock_bh(&priv->tx.tx_lock); |
404 | ieee80211_wake_queues(hw); | 404 | ieee80211_wake_queues(hw); |
405 | 405 | ||
406 | WMI_CMD(WMI_ENABLE_INTR_CMDID); | 406 | WMI_CMD(WMI_ENABLE_INTR_CMDID); |
@@ -431,7 +431,7 @@ void ath9k_htc_radio_disable(struct ieee80211_hw *hw) | |||
431 | ieee80211_stop_queues(hw); | 431 | ieee80211_stop_queues(hw); |
432 | htc_stop(priv->htc); | 432 | htc_stop(priv->htc); |
433 | WMI_CMD(WMI_DRAIN_TXQ_ALL_CMDID); | 433 | WMI_CMD(WMI_DRAIN_TXQ_ALL_CMDID); |
434 | skb_queue_purge(&priv->tx_queue); | 434 | skb_queue_purge(&priv->tx.tx_queue); |
435 | 435 | ||
436 | /* Stop RX */ | 436 | /* Stop RX */ |
437 | WMI_CMD(WMI_STOP_RECV_CMDID); | 437 | WMI_CMD(WMI_STOP_RECV_CMDID); |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 921d76f32016..c270da7be10f 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -673,7 +673,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, | |||
673 | 673 | ||
674 | spin_lock_init(&priv->wmi->wmi_lock); | 674 | spin_lock_init(&priv->wmi->wmi_lock); |
675 | spin_lock_init(&priv->beacon_lock); | 675 | spin_lock_init(&priv->beacon_lock); |
676 | spin_lock_init(&priv->tx_lock); | 676 | spin_lock_init(&priv->tx.tx_lock); |
677 | mutex_init(&priv->mutex); | 677 | mutex_init(&priv->mutex); |
678 | mutex_init(&priv->htc_pm_lock); | 678 | mutex_init(&priv->htc_pm_lock); |
679 | tasklet_init(&priv->rx_tasklet, ath9k_rx_tasklet, | 679 | tasklet_init(&priv->rx_tasklet, ath9k_rx_tasklet, |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index 400226702e0a..ff3a49577a02 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -707,9 +707,9 @@ static int ath9k_htc_tx_aggr_oper(struct ath9k_htc_priv *priv, | |||
707 | (aggr.aggr_enable) ? "Starting" : "Stopping", | 707 | (aggr.aggr_enable) ? "Starting" : "Stopping", |
708 | sta->addr, tid); | 708 | sta->addr, tid); |
709 | 709 | ||
710 | spin_lock_bh(&priv->tx_lock); | 710 | spin_lock_bh(&priv->tx.tx_lock); |
711 | ista->tid_state[tid] = (aggr.aggr_enable && !ret) ? AGGR_START : AGGR_STOP; | 711 | ista->tid_state[tid] = (aggr.aggr_enable && !ret) ? AGGR_START : AGGR_STOP; |
712 | spin_unlock_bh(&priv->tx_lock); | 712 | spin_unlock_bh(&priv->tx.tx_lock); |
713 | 713 | ||
714 | return ret; | 714 | return ret; |
715 | } | 715 | } |
@@ -853,9 +853,9 @@ static void ath9k_htc_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
853 | ath_dbg(ath9k_hw_common(priv->ah), ATH_DBG_XMIT, | 853 | ath_dbg(ath9k_hw_common(priv->ah), ATH_DBG_XMIT, |
854 | "Stopping TX queues\n"); | 854 | "Stopping TX queues\n"); |
855 | ieee80211_stop_queues(hw); | 855 | ieee80211_stop_queues(hw); |
856 | spin_lock_bh(&priv->tx_lock); | 856 | spin_lock_bh(&priv->tx.tx_lock); |
857 | priv->tx_queues_stop = true; | 857 | priv->tx.tx_queues_stop = true; |
858 | spin_unlock_bh(&priv->tx_lock); | 858 | spin_unlock_bh(&priv->tx.tx_lock); |
859 | } else { | 859 | } else { |
860 | ath_dbg(ath9k_hw_common(priv->ah), ATH_DBG_XMIT, | 860 | ath_dbg(ath9k_hw_common(priv->ah), ATH_DBG_XMIT, |
861 | "Tx failed\n"); | 861 | "Tx failed\n"); |
@@ -923,9 +923,9 @@ static int ath9k_htc_start(struct ieee80211_hw *hw) | |||
923 | priv->op_flags &= ~OP_INVALID; | 923 | priv->op_flags &= ~OP_INVALID; |
924 | htc_start(priv->htc); | 924 | htc_start(priv->htc); |
925 | 925 | ||
926 | spin_lock_bh(&priv->tx_lock); | 926 | spin_lock_bh(&priv->tx.tx_lock); |
927 | priv->tx_queues_stop = false; | 927 | priv->tx.tx_queues_stop = false; |
928 | spin_unlock_bh(&priv->tx_lock); | 928 | spin_unlock_bh(&priv->tx.tx_lock); |
929 | 929 | ||
930 | ieee80211_wake_queues(hw); | 930 | ieee80211_wake_queues(hw); |
931 | 931 | ||
@@ -965,7 +965,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw) | |||
965 | tasklet_kill(&priv->rx_tasklet); | 965 | tasklet_kill(&priv->rx_tasklet); |
966 | tasklet_kill(&priv->tx_tasklet); | 966 | tasklet_kill(&priv->tx_tasklet); |
967 | 967 | ||
968 | skb_queue_purge(&priv->tx_queue); | 968 | skb_queue_purge(&priv->tx.tx_queue); |
969 | 969 | ||
970 | ath9k_wmi_event_drain(priv); | 970 | ath9k_wmi_event_drain(priv); |
971 | 971 | ||
@@ -1563,9 +1563,9 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw, | |||
1563 | break; | 1563 | break; |
1564 | case IEEE80211_AMPDU_TX_OPERATIONAL: | 1564 | case IEEE80211_AMPDU_TX_OPERATIONAL: |
1565 | ista = (struct ath9k_htc_sta *) sta->drv_priv; | 1565 | ista = (struct ath9k_htc_sta *) sta->drv_priv; |
1566 | spin_lock_bh(&priv->tx_lock); | 1566 | spin_lock_bh(&priv->tx.tx_lock); |
1567 | ista->tid_state[tid] = AGGR_OPERATIONAL; | 1567 | ista->tid_state[tid] = AGGR_OPERATIONAL; |
1568 | spin_unlock_bh(&priv->tx_lock); | 1568 | spin_unlock_bh(&priv->tx.tx_lock); |
1569 | break; | 1569 | break; |
1570 | default: | 1570 | default: |
1571 | ath_err(ath9k_hw_common(priv->ah), "Unknown AMPDU action\n"); | 1571 | ath_err(ath9k_hw_common(priv->ah), "Unknown AMPDU action\n"); |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index ab55dff4721f..6f7987d7b6b0 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | |||
@@ -239,10 +239,10 @@ static bool ath9k_htc_check_tx_aggr(struct ath9k_htc_priv *priv, | |||
239 | { | 239 | { |
240 | bool ret = false; | 240 | bool ret = false; |
241 | 241 | ||
242 | spin_lock_bh(&priv->tx_lock); | 242 | spin_lock_bh(&priv->tx.tx_lock); |
243 | if ((tid < ATH9K_HTC_MAX_TID) && (ista->tid_state[tid] == AGGR_STOP)) | 243 | if ((tid < ATH9K_HTC_MAX_TID) && (ista->tid_state[tid] == AGGR_STOP)) |
244 | ret = true; | 244 | ret = true; |
245 | spin_unlock_bh(&priv->tx_lock); | 245 | spin_unlock_bh(&priv->tx.tx_lock); |
246 | 246 | ||
247 | return ret; | 247 | return ret; |
248 | } | 248 | } |
@@ -257,7 +257,7 @@ void ath9k_tx_tasklet(unsigned long data) | |||
257 | struct sk_buff *skb = NULL; | 257 | struct sk_buff *skb = NULL; |
258 | __le16 fc; | 258 | __le16 fc; |
259 | 259 | ||
260 | while ((skb = skb_dequeue(&priv->tx_queue)) != NULL) { | 260 | while ((skb = skb_dequeue(&priv->tx.tx_queue)) != NULL) { |
261 | 261 | ||
262 | hdr = (struct ieee80211_hdr *) skb->data; | 262 | hdr = (struct ieee80211_hdr *) skb->data; |
263 | fc = hdr->frame_control; | 263 | fc = hdr->frame_control; |
@@ -292,9 +292,9 @@ void ath9k_tx_tasklet(unsigned long data) | |||
292 | 292 | ||
293 | if (ath9k_htc_check_tx_aggr(priv, ista, tid)) { | 293 | if (ath9k_htc_check_tx_aggr(priv, ista, tid)) { |
294 | ieee80211_start_tx_ba_session(sta, tid, 0); | 294 | ieee80211_start_tx_ba_session(sta, tid, 0); |
295 | spin_lock_bh(&priv->tx_lock); | 295 | spin_lock_bh(&priv->tx.tx_lock); |
296 | ista->tid_state[tid] = AGGR_PROGRESS; | 296 | ista->tid_state[tid] = AGGR_PROGRESS; |
297 | spin_unlock_bh(&priv->tx_lock); | 297 | spin_unlock_bh(&priv->tx.tx_lock); |
298 | } | 298 | } |
299 | } | 299 | } |
300 | } | 300 | } |
@@ -307,16 +307,16 @@ void ath9k_tx_tasklet(unsigned long data) | |||
307 | } | 307 | } |
308 | 308 | ||
309 | /* Wake TX queues if needed */ | 309 | /* Wake TX queues if needed */ |
310 | spin_lock_bh(&priv->tx_lock); | 310 | spin_lock_bh(&priv->tx.tx_lock); |
311 | if (priv->tx_queues_stop) { | 311 | if (priv->tx.tx_queues_stop) { |
312 | priv->tx_queues_stop = false; | 312 | priv->tx.tx_queues_stop = false; |
313 | spin_unlock_bh(&priv->tx_lock); | 313 | spin_unlock_bh(&priv->tx.tx_lock); |
314 | ath_dbg(ath9k_hw_common(priv->ah), ATH_DBG_XMIT, | 314 | ath_dbg(ath9k_hw_common(priv->ah), ATH_DBG_XMIT, |
315 | "Waking up TX queues\n"); | 315 | "Waking up TX queues\n"); |
316 | ieee80211_wake_queues(priv->hw); | 316 | ieee80211_wake_queues(priv->hw); |
317 | return; | 317 | return; |
318 | } | 318 | } |
319 | spin_unlock_bh(&priv->tx_lock); | 319 | spin_unlock_bh(&priv->tx.tx_lock); |
320 | } | 320 | } |
321 | 321 | ||
322 | void ath9k_htc_txep(void *drv_priv, struct sk_buff *skb, | 322 | void ath9k_htc_txep(void *drv_priv, struct sk_buff *skb, |
@@ -348,13 +348,13 @@ void ath9k_htc_txep(void *drv_priv, struct sk_buff *skb, | |||
348 | if (txok) | 348 | if (txok) |
349 | tx_info->flags |= IEEE80211_TX_STAT_ACK; | 349 | tx_info->flags |= IEEE80211_TX_STAT_ACK; |
350 | 350 | ||
351 | skb_queue_tail(&priv->tx_queue, skb); | 351 | skb_queue_tail(&priv->tx.tx_queue, skb); |
352 | tasklet_schedule(&priv->tx_tasklet); | 352 | tasklet_schedule(&priv->tx_tasklet); |
353 | } | 353 | } |
354 | 354 | ||
355 | int ath9k_tx_init(struct ath9k_htc_priv *priv) | 355 | int ath9k_tx_init(struct ath9k_htc_priv *priv) |
356 | { | 356 | { |
357 | skb_queue_head_init(&priv->tx_queue); | 357 | skb_queue_head_init(&priv->tx.tx_queue); |
358 | return 0; | 358 | return 0; |
359 | } | 359 | } |
360 | 360 | ||