diff options
author | Nishant Sarmukadam <nishants@marvell.com> | 2011-03-17 14:58:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-03-30 14:15:14 -0400 |
commit | a0e7c6cfe2a04af450274638845802b5c384e8df (patch) | |
tree | 58a5fba2a2f9f3f114fd20898b0818b7005a625a /drivers | |
parent | 170335432ad36584a6d24fc1fd903024d221ef55 (diff) |
mwl8k: Queue ADDBA requests in respective data queues
Queue ADDBA requests in respective data queues to avoid ADDBA
requests and the the related data packets (to the same ra/tid)
queued in the hardware to be sent out asynchronously.
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 5473f4ca0ca0..ae56d2f32b2e 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -1518,6 +1518,33 @@ static int mwl8k_tx_wait_empty(struct ieee80211_hw *hw) | |||
1518 | MWL8K_TXD_STATUS_OK_RETRY | \ | 1518 | MWL8K_TXD_STATUS_OK_RETRY | \ |
1519 | MWL8K_TXD_STATUS_OK_MORE_RETRY)) | 1519 | MWL8K_TXD_STATUS_OK_MORE_RETRY)) |
1520 | 1520 | ||
1521 | static int mwl8k_tid_queue_mapping(u8 tid) | ||
1522 | { | ||
1523 | BUG_ON(tid > 7); | ||
1524 | |||
1525 | switch (tid) { | ||
1526 | case 0: | ||
1527 | case 3: | ||
1528 | return IEEE80211_AC_BE; | ||
1529 | break; | ||
1530 | case 1: | ||
1531 | case 2: | ||
1532 | return IEEE80211_AC_BK; | ||
1533 | break; | ||
1534 | case 4: | ||
1535 | case 5: | ||
1536 | return IEEE80211_AC_VI; | ||
1537 | break; | ||
1538 | case 6: | ||
1539 | case 7: | ||
1540 | return IEEE80211_AC_VO; | ||
1541 | break; | ||
1542 | default: | ||
1543 | return -1; | ||
1544 | break; | ||
1545 | } | ||
1546 | } | ||
1547 | |||
1521 | /* The firmware will fill in the rate information | 1548 | /* The firmware will fill in the rate information |
1522 | * for each packet that gets queued in the hardware | 1549 | * for each packet that gets queued in the hardware |
1523 | * in this structure | 1550 | * in this structure |
@@ -1745,6 +1772,7 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb) | |||
1745 | u8 tid = 0; | 1772 | u8 tid = 0; |
1746 | struct mwl8k_ampdu_stream *stream = NULL; | 1773 | struct mwl8k_ampdu_stream *stream = NULL; |
1747 | bool start_ba_session = false; | 1774 | bool start_ba_session = false; |
1775 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; | ||
1748 | 1776 | ||
1749 | wh = (struct ieee80211_hdr *)skb->data; | 1777 | wh = (struct ieee80211_hdr *)skb->data; |
1750 | if (ieee80211_is_data_qos(wh->frame_control)) | 1778 | if (ieee80211_is_data_qos(wh->frame_control)) |
@@ -1788,6 +1816,24 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb) | |||
1788 | qos |= MWL8K_QOS_ACK_POLICY_NORMAL; | 1816 | qos |= MWL8K_QOS_ACK_POLICY_NORMAL; |
1789 | } | 1817 | } |
1790 | 1818 | ||
1819 | /* Queue ADDBA request in the respective data queue. While setting up | ||
1820 | * the ampdu stream, mac80211 queues further packets for that | ||
1821 | * particular ra/tid pair. However, packets piled up in the hardware | ||
1822 | * for that ra/tid pair will still go out. ADDBA request and the | ||
1823 | * related data packets going out from different queues asynchronously | ||
1824 | * will cause a shift in the receiver window which might result in | ||
1825 | * ampdu packets getting dropped at the receiver after the stream has | ||
1826 | * been setup. | ||
1827 | */ | ||
1828 | if (unlikely(ieee80211_is_action(wh->frame_control) && | ||
1829 | mgmt->u.action.category == WLAN_CATEGORY_BACK && | ||
1830 | mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ && | ||
1831 | priv->ap_fw)) { | ||
1832 | u16 capab = le16_to_cpu(mgmt->u.action.u.addba_req.capab); | ||
1833 | tid = (capab & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2; | ||
1834 | index = mwl8k_tid_queue_mapping(tid); | ||
1835 | } | ||
1836 | |||
1791 | txpriority = index; | 1837 | txpriority = index; |
1792 | 1838 | ||
1793 | if (ieee80211_is_data_qos(wh->frame_control) && | 1839 | if (ieee80211_is_data_qos(wh->frame_control) && |