aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwl8k.c
diff options
context:
space:
mode:
authorYogesh Ashok Powar <yogeshp@marvell.com>2013-01-03 02:52:56 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-01-07 15:17:00 -0500
commit7fb978b7e93b5c4a378eba5767c7513540b56642 (patch)
treedb5e295b57c8c992e6abf0a6a6648e9dc81263fb /drivers/net/wireless/mwl8k.c
parent5f2a14940db23350612071a3c906c8960e3ceb9a (diff)
mwl8k: Enable support to support additional ampdu streams
Currently, we have 2 ampdu streams that can be created simultaneously. Firmware is capable of supporting additional streams. Add support to use these streams. 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/wireless/mwl8k.c')
-rw-r--r--drivers/net/wireless/mwl8k.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 7df18faae1b6..9e08fc601bb4 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -101,6 +101,18 @@ MODULE_PARM_DESC(ap_mode_default,
101#define MWL8K_MAX_TX_QUEUES (MWL8K_TX_WMM_QUEUES + MWL8K_MAX_AMPDU_QUEUES) 101#define MWL8K_MAX_TX_QUEUES (MWL8K_TX_WMM_QUEUES + MWL8K_MAX_AMPDU_QUEUES)
102#define mwl8k_tx_queues(priv) (MWL8K_TX_WMM_QUEUES + (priv)->num_ampdu_queues) 102#define mwl8k_tx_queues(priv) (MWL8K_TX_WMM_QUEUES + (priv)->num_ampdu_queues)
103 103
104/* txpriorities are mapped with hw queues.
105 * Each hw queue has a txpriority.
106 */
107#define TOTAL_HW_TX_QUEUES 8
108
109/* Each HW queue can have one AMPDU stream.
110 * But, because one of the hw queue is reserved,
111 * maximum AMPDU queues that can be created are
112 * one short of total tx queues.
113 */
114#define MWL8K_NUM_AMPDU_STREAMS (TOTAL_HW_TX_QUEUES - 1)
115
104struct rxd_ops { 116struct rxd_ops {
105 int rxd_size; 117 int rxd_size;
106 void (*rxd_init)(void *rxd, dma_addr_t next_dma_addr); 118 void (*rxd_init)(void *rxd, dma_addr_t next_dma_addr);
@@ -1733,7 +1745,7 @@ mwl8k_add_stream(struct ieee80211_hw *hw, struct ieee80211_sta *sta, u8 tid)
1733 struct mwl8k_priv *priv = hw->priv; 1745 struct mwl8k_priv *priv = hw->priv;
1734 int i; 1746 int i;
1735 1747
1736 for (i = 0; i < priv->num_ampdu_queues; i++) { 1748 for (i = 0; i < MWL8K_NUM_AMPDU_STREAMS; i++) {
1737 stream = &priv->ampdu[i]; 1749 stream = &priv->ampdu[i];
1738 if (stream->state == AMPDU_NO_STREAM) { 1750 if (stream->state == AMPDU_NO_STREAM) {
1739 stream->sta = sta; 1751 stream->sta = sta;
@@ -1780,7 +1792,7 @@ mwl8k_lookup_stream(struct ieee80211_hw *hw, u8 *addr, u8 tid)
1780 struct mwl8k_priv *priv = hw->priv; 1792 struct mwl8k_priv *priv = hw->priv;
1781 int i; 1793 int i;
1782 1794
1783 for (i = 0 ; i < priv->num_ampdu_queues; i++) { 1795 for (i = 0; i < MWL8K_NUM_AMPDU_STREAMS; i++) {
1784 struct mwl8k_ampdu_stream *stream; 1796 struct mwl8k_ampdu_stream *stream;
1785 stream = &priv->ampdu[i]; 1797 stream = &priv->ampdu[i];
1786 if (stream->state == AMPDU_NO_STREAM) 1798 if (stream->state == AMPDU_NO_STREAM)
@@ -1827,6 +1839,13 @@ static inline void mwl8k_tx_count_packet(struct ieee80211_sta *sta, u8 tid)
1827 tx_stats->pkts++; 1839 tx_stats->pkts++;
1828} 1840}
1829 1841
1842/* The hardware ampdu queues start from 5.
1843 * txpriorities for ampdu queues are
1844 * 5 6 7 0 1 2 3 4 ie., queue 5 is highest
1845 * and queue 3 is lowest (queue 4 is reserved)
1846 */
1847#define BA_QUEUE 5
1848
1830static void 1849static void
1831mwl8k_txq_xmit(struct ieee80211_hw *hw, 1850mwl8k_txq_xmit(struct ieee80211_hw *hw,
1832 int index, 1851 int index,
@@ -1927,8 +1946,12 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw,
1927 if (stream != NULL) { 1946 if (stream != NULL) {
1928 if (stream->state == AMPDU_STREAM_ACTIVE) { 1947 if (stream->state == AMPDU_STREAM_ACTIVE) {
1929 WARN_ON(!(qos & MWL8K_QOS_ACK_POLICY_BLOCKACK)); 1948 WARN_ON(!(qos & MWL8K_QOS_ACK_POLICY_BLOCKACK));
1930 txpriority = stream->idx + MWL8K_TX_WMM_QUEUES; 1949 txpriority = (BA_QUEUE + stream->idx) %
1931 index = stream->idx + MWL8K_TX_WMM_QUEUES; 1950 TOTAL_HW_TX_QUEUES;
1951 if (stream->idx <= 1)
1952 index = stream->idx +
1953 MWL8K_TX_WMM_QUEUES;
1954
1932 } else if (stream->state == AMPDU_STREAM_NEW) { 1955 } else if (stream->state == AMPDU_STREAM_NEW) {
1933 /* We get here if the driver sends us packets 1956 /* We get here if the driver sends us packets
1934 * after we've initiated a stream, but before 1957 * after we've initiated a stream, but before