diff options
author | Ron Rindjunsky <ron.rindjunsky@intel.com> | 2008-06-11 21:46:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-14 12:18:05 -0400 |
commit | 7f3e4bb60f81dd172d5e4b89220cb3f80c6dc552 (patch) | |
tree | 8cc593c25bbb8c4bc74c54e1dcace793ff194a02 /drivers/net | |
parent | 203566f359b5702be72238a8b1d37655c986cc7c (diff) |
iwlwifi: map sw and hw ampdu queues
This patch maps sw and hw queues (for aggregations), so the right
mac80211 queue will be waken when ieee80211_wake_queue is invoked.
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965-hw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000-hw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 2 |
5 files changed, 15 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h index fc118335b60f..721f505ae47b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h | |||
@@ -82,7 +82,7 @@ | |||
82 | */ | 82 | */ |
83 | #define IWL_CMD_QUEUE_NUM 4 | 83 | #define IWL_CMD_QUEUE_NUM 4 |
84 | #define IWL_CMD_FIFO_NUM 4 | 84 | #define IWL_CMD_FIFO_NUM 4 |
85 | #define IWL_BACK_QUEUE_FIRST_ID 7 | 85 | #define IWL49_FIRST_AMPDU_QUEUE 7 |
86 | 86 | ||
87 | /* Tx rates */ | 87 | /* Tx rates */ |
88 | #define IWL_CCK_RATES 4 | 88 | #define IWL_CCK_RATES 4 |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 6d249bbd7950..4d47dd7acc15 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -913,6 +913,7 @@ int iwl4965_hw_set_hw_params(struct iwl_priv *priv) | |||
913 | } | 913 | } |
914 | 914 | ||
915 | priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; | 915 | priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; |
916 | priv->hw_params.first_ampdu_q = IWL49_FIRST_AMPDU_QUEUE; | ||
916 | priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto; | 917 | priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto; |
917 | priv->hw_params.max_rxq_size = RX_QUEUE_SIZE; | 918 | priv->hw_params.max_rxq_size = RX_QUEUE_SIZE; |
918 | priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG; | 919 | priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG; |
@@ -2893,7 +2894,7 @@ static void iwl4965_tx_queue_stop_scheduler(struct iwl_priv *priv, | |||
2893 | } | 2894 | } |
2894 | 2895 | ||
2895 | /** | 2896 | /** |
2896 | * txq_id must be greater than IWL_BACK_QUEUE_FIRST_ID | 2897 | * txq_id must be greater than IWL49_FIRST_AMPDU_QUEUE |
2897 | * priv->lock must be held by the caller | 2898 | * priv->lock must be held by the caller |
2898 | */ | 2899 | */ |
2899 | static int iwl4965_txq_agg_disable(struct iwl_priv *priv, u16 txq_id, | 2900 | static int iwl4965_txq_agg_disable(struct iwl_priv *priv, u16 txq_id, |
@@ -2901,9 +2902,9 @@ static int iwl4965_txq_agg_disable(struct iwl_priv *priv, u16 txq_id, | |||
2901 | { | 2902 | { |
2902 | int ret = 0; | 2903 | int ret = 0; |
2903 | 2904 | ||
2904 | if (IWL_BACK_QUEUE_FIRST_ID > txq_id) { | 2905 | if (IWL49_FIRST_AMPDU_QUEUE > txq_id) { |
2905 | IWL_WARNING("queue number too small: %d, must be > %d\n", | 2906 | IWL_WARNING("queue number too small: %d, must be > %d\n", |
2906 | txq_id, IWL_BACK_QUEUE_FIRST_ID); | 2907 | txq_id, IWL49_FIRST_AMPDU_QUEUE); |
2907 | return -EINVAL; | 2908 | return -EINVAL; |
2908 | } | 2909 | } |
2909 | 2910 | ||
@@ -2991,7 +2992,7 @@ static void iwl4965_rx_reply_compressed_ba(struct iwl_priv *priv, | |||
2991 | if (txq->q.read_ptr != (ba_resp_scd_ssn & 0xff)) { | 2992 | if (txq->q.read_ptr != (ba_resp_scd_ssn & 0xff)) { |
2992 | /* calculate mac80211 ampdu sw queue to wake */ | 2993 | /* calculate mac80211 ampdu sw queue to wake */ |
2993 | int ampdu_q = | 2994 | int ampdu_q = |
2994 | scd_flow - IWL_BACK_QUEUE_FIRST_ID + priv->hw->queues; | 2995 | scd_flow - priv->hw_params.first_ampdu_q + priv->hw->queues; |
2995 | int freed = iwl_tx_queue_reclaim(priv, scd_flow, index); | 2996 | int freed = iwl_tx_queue_reclaim(priv, scd_flow, index); |
2996 | priv->stations[ba_resp->sta_id]. | 2997 | priv->stations[ba_resp->sta_id]. |
2997 | tid[ba_resp->tid].tfds_in_queue -= freed; | 2998 | tid[ba_resp->tid].tfds_in_queue -= freed; |
@@ -3036,7 +3037,7 @@ static int iwl4965_tx_queue_set_q2ratid(struct iwl_priv *priv, u16 ra_tid, | |||
3036 | /** | 3037 | /** |
3037 | * iwl4965_tx_queue_agg_enable - Set up & enable aggregation for selected queue | 3038 | * iwl4965_tx_queue_agg_enable - Set up & enable aggregation for selected queue |
3038 | * | 3039 | * |
3039 | * NOTE: txq_id must be greater than IWL_BACK_QUEUE_FIRST_ID, | 3040 | * NOTE: txq_id must be greater than IWL49_FIRST_AMPDU_QUEUE, |
3040 | * i.e. it must be one of the higher queues used for aggregation | 3041 | * i.e. it must be one of the higher queues used for aggregation |
3041 | */ | 3042 | */ |
3042 | static int iwl4965_txq_agg_enable(struct iwl_priv *priv, int txq_id, | 3043 | static int iwl4965_txq_agg_enable(struct iwl_priv *priv, int txq_id, |
@@ -3046,9 +3047,9 @@ static int iwl4965_txq_agg_enable(struct iwl_priv *priv, int txq_id, | |||
3046 | int ret; | 3047 | int ret; |
3047 | u16 ra_tid; | 3048 | u16 ra_tid; |
3048 | 3049 | ||
3049 | if (IWL_BACK_QUEUE_FIRST_ID > txq_id) | 3050 | if (IWL49_FIRST_AMPDU_QUEUE > txq_id) |
3050 | IWL_WARNING("queue number too small: %d, must be > %d\n", | 3051 | IWL_WARNING("queue number too small: %d, must be > %d\n", |
3051 | txq_id, IWL_BACK_QUEUE_FIRST_ID); | 3052 | txq_id, IWL49_FIRST_AMPDU_QUEUE); |
3052 | 3053 | ||
3053 | ra_tid = BUILD_RAxTID(sta_id, tid); | 3054 | ra_tid = BUILD_RAxTID(sta_id, tid); |
3054 | 3055 | ||
@@ -3398,7 +3399,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
3398 | txq_id >= 0 && priv->mac80211_registered && | 3399 | txq_id >= 0 && priv->mac80211_registered && |
3399 | agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) { | 3400 | agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) { |
3400 | /* calculate mac80211 ampdu sw queue to wake */ | 3401 | /* calculate mac80211 ampdu sw queue to wake */ |
3401 | ampdu_q = txq_id - IWL_BACK_QUEUE_FIRST_ID + | 3402 | ampdu_q = txq_id - IWL49_FIRST_AMPDU_QUEUE + |
3402 | priv->hw->queues; | 3403 | priv->hw->queues; |
3403 | if (agg->state == IWL_AGG_OFF) | 3404 | if (agg->state == IWL_AGG_OFF) |
3404 | ieee80211_wake_queue(priv->hw, txq_id); | 3405 | ieee80211_wake_queue(priv->hw, txq_id); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000-hw.h b/drivers/net/wireless/iwlwifi/iwl-5000-hw.h index 9e557ce315b7..4efe0c06b5b2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000-hw.h +++ b/drivers/net/wireless/iwlwifi/iwl-5000-hw.h | |||
@@ -81,7 +81,7 @@ | |||
81 | #define IWL50_QUEUE_SIZE 256 | 81 | #define IWL50_QUEUE_SIZE 256 |
82 | #define IWL50_CMD_FIFO_NUM 7 | 82 | #define IWL50_CMD_FIFO_NUM 7 |
83 | #define IWL50_NUM_QUEUES 20 | 83 | #define IWL50_NUM_QUEUES 20 |
84 | #define IWL50_BACK_QUEUE_FIRST_ID 10 | 84 | #define IWL50_FIRST_AMPDU_QUEUE 10 |
85 | 85 | ||
86 | #define IWL_sta_id_POS 12 | 86 | #define IWL_sta_id_POS 12 |
87 | #define IWL_sta_id_LEN 4 | 87 | #define IWL_sta_id_LEN 4 |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 31ea363c62c7..0ae5421c81c7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -825,6 +825,7 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv) | |||
825 | } | 825 | } |
826 | 826 | ||
827 | priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; | 827 | priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; |
828 | priv->hw_params.first_ampdu_q = IWL50_FIRST_AMPDU_QUEUE; | ||
828 | priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto; | 829 | priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto; |
829 | priv->hw_params.max_rxq_size = RX_QUEUE_SIZE; | 830 | priv->hw_params.max_rxq_size = RX_QUEUE_SIZE; |
830 | priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG; | 831 | priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG; |
@@ -1183,7 +1184,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv, | |||
1183 | txq_id >= 0 && priv->mac80211_registered && | 1184 | txq_id >= 0 && priv->mac80211_registered && |
1184 | agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) { | 1185 | agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) { |
1185 | /* calculate mac80211 ampdu sw queue to wake */ | 1186 | /* calculate mac80211 ampdu sw queue to wake */ |
1186 | ampdu_q = txq_id - IWL_BACK_QUEUE_FIRST_ID + | 1187 | ampdu_q = txq_id - IWL50_FIRST_AMPDU_QUEUE + |
1187 | priv->hw->queues; | 1188 | priv->hw->queues; |
1188 | if (agg->state == IWL_AGG_OFF) | 1189 | if (agg->state == IWL_AGG_OFF) |
1189 | ieee80211_wake_queue(priv->hw, txq_id); | 1190 | ieee80211_wake_queue(priv->hw, txq_id); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index bf4b8831c0a7..fa35193e5a7a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -583,6 +583,7 @@ struct iwl_sensitivity_ranges { | |||
583 | * @max_xxx_size: for ucode uses | 583 | * @max_xxx_size: for ucode uses |
584 | * @ct_kill_threshold: temperature threshold | 584 | * @ct_kill_threshold: temperature threshold |
585 | * @struct iwl_sensitivity_ranges: range of sensitivity values | 585 | * @struct iwl_sensitivity_ranges: range of sensitivity values |
586 | * @first_ampdu_q: first HW queue available for ampdu | ||
586 | */ | 587 | */ |
587 | struct iwl_hw_params { | 588 | struct iwl_hw_params { |
588 | u16 max_txq_num; | 589 | u16 max_txq_num; |
@@ -603,6 +604,7 @@ struct iwl_hw_params { | |||
603 | u32 max_bsm_size; | 604 | u32 max_bsm_size; |
604 | u32 ct_kill_threshold; /* value in hw-dependent units */ | 605 | u32 ct_kill_threshold; /* value in hw-dependent units */ |
605 | const struct iwl_sensitivity_ranges *sens; | 606 | const struct iwl_sensitivity_ranges *sens; |
607 | u8 first_ampdu_q; | ||
606 | }; | 608 | }; |
607 | 609 | ||
608 | #define HT_SHORT_GI_20MHZ (1 << 0) | 610 | #define HT_SHORT_GI_20MHZ (1 << 0) |