diff options
author | Yogesh Ashok Powar <yogeshp@marvell.com> | 2013-01-03 02:54:03 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-01-07 15:18:27 -0500 |
commit | cfacba12f573abd04a202e3e86c09f246339071f (patch) | |
tree | 776e0d50367162d6660c56e43ecdf7f9db8f1674 /drivers/net | |
parent | 07f6dda1e7ed653c87ed329c99d6ae12ee114d52 (diff) |
mwl8k: Handle Watchdog events for the new ampdu streams
With more ampdu streams, we need to handle watchdog
events for the new ampdu streams. Handle these
events appropriately.
Earlier mwl8k_cmd_get_watchdog_bitmap used to return
only one stream index and hence bitwise operations
on the return value were not required. Now the function
returns a bitmap with different bits are mapped with
different stream indices.
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 76b2f9133159..19afd2cdaced 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -3603,7 +3603,11 @@ static int mwl8k_cmd_get_watchdog_bitmap(struct ieee80211_hw *hw, u8 *bitmap) | |||
3603 | return rc; | 3603 | return rc; |
3604 | } | 3604 | } |
3605 | 3605 | ||
3606 | #define INVALID_BA 0xAA | 3606 | #define MWL8K_WMM_QUEUE_NUMBER 3 |
3607 | |||
3608 | static void mwl8k_destroy_ba(struct ieee80211_hw *hw, | ||
3609 | u8 idx); | ||
3610 | |||
3607 | static void mwl8k_watchdog_ba_events(struct work_struct *work) | 3611 | static void mwl8k_watchdog_ba_events(struct work_struct *work) |
3608 | { | 3612 | { |
3609 | int rc; | 3613 | int rc; |
@@ -3611,24 +3615,40 @@ static void mwl8k_watchdog_ba_events(struct work_struct *work) | |||
3611 | struct mwl8k_ampdu_stream *streams; | 3615 | struct mwl8k_ampdu_stream *streams; |
3612 | struct mwl8k_priv *priv = | 3616 | struct mwl8k_priv *priv = |
3613 | container_of(work, struct mwl8k_priv, watchdog_ba_handle); | 3617 | container_of(work, struct mwl8k_priv, watchdog_ba_handle); |
3618 | struct ieee80211_hw *hw = priv->hw; | ||
3619 | int i; | ||
3620 | u32 status = 0; | ||
3621 | |||
3622 | mwl8k_fw_lock(hw); | ||
3614 | 3623 | ||
3615 | rc = mwl8k_cmd_get_watchdog_bitmap(priv->hw, &bitmap); | 3624 | rc = mwl8k_cmd_get_watchdog_bitmap(priv->hw, &bitmap); |
3616 | if (rc) | 3625 | if (rc) |
3617 | return; | 3626 | goto done; |
3618 | 3627 | ||
3619 | if (bitmap == INVALID_BA) | 3628 | spin_lock(&priv->stream_lock); |
3620 | return; | ||
3621 | 3629 | ||
3622 | /* the bitmap is the hw queue number. Map it to the ampdu queue. */ | 3630 | /* the bitmap is the hw queue number. Map it to the ampdu queue. */ |
3623 | stream_index = bitmap - MWL8K_TX_WMM_QUEUES; | 3631 | for (i = 0; i < TOTAL_HW_TX_QUEUES; i++) { |
3624 | 3632 | if (bitmap & (1 << i)) { | |
3625 | BUG_ON(stream_index >= priv->num_ampdu_queues); | 3633 | stream_index = (i + MWL8K_WMM_QUEUE_NUMBER) % |
3626 | 3634 | TOTAL_HW_TX_QUEUES; | |
3627 | streams = &priv->ampdu[stream_index]; | 3635 | streams = &priv->ampdu[stream_index]; |
3628 | 3636 | if (streams->state == AMPDU_STREAM_ACTIVE) { | |
3629 | if (streams->state == AMPDU_STREAM_ACTIVE) | 3637 | ieee80211_stop_tx_ba_session(streams->sta, |
3630 | ieee80211_stop_tx_ba_session(streams->sta, streams->tid); | 3638 | streams->tid); |
3639 | spin_unlock(&priv->stream_lock); | ||
3640 | mwl8k_destroy_ba(hw, stream_index); | ||
3641 | spin_lock(&priv->stream_lock); | ||
3642 | } | ||
3643 | } | ||
3644 | } | ||
3631 | 3645 | ||
3646 | spin_unlock(&priv->stream_lock); | ||
3647 | done: | ||
3648 | status = ioread32(priv->regs + MWL8K_HIU_A2H_INTERRUPT_STATUS_MASK); | ||
3649 | iowrite32((status | MWL8K_A2H_INT_BA_WATCHDOG), | ||
3650 | priv->regs + MWL8K_HIU_A2H_INTERRUPT_STATUS_MASK); | ||
3651 | mwl8k_fw_unlock(hw); | ||
3632 | return; | 3652 | return; |
3633 | } | 3653 | } |
3634 | 3654 | ||