diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-07-08 11:46:28 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-07-11 15:02:09 -0400 |
commit | 4e308119771573f949203f9f4732bcbfb9628279 (patch) | |
tree | 8a2ebe78cb3b58dbd642e9f43e6250bc906f09eb /drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |
parent | eedb6e357a4b1bd3d7e4544e77fbd71718492547 (diff) |
iwlagn: separate and enhance the fixed rate from
For testing purpose, we need better control of msc from user application.
Separate the fixed_rate between debugfs and testmode and enforce it.
Signed-off-by: Kenny Hsu <kenny.hsu@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 85e082830c1e..ebcd13bc10d9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -336,6 +336,12 @@ static u8 rs_tl_add_packet(struct iwl_lq_sta *lq_data, | |||
336 | } | 336 | } |
337 | 337 | ||
338 | #ifdef CONFIG_MAC80211_DEBUGFS | 338 | #ifdef CONFIG_MAC80211_DEBUGFS |
339 | /** | ||
340 | * Program the device to use fixed rate for frame transmit | ||
341 | * This is for debugging/testing only | ||
342 | * once the device start use fixed rate, we need to reload the module | ||
343 | * to being back the normal operation. | ||
344 | */ | ||
339 | static void rs_program_fix_rate(struct iwl_priv *priv, | 345 | static void rs_program_fix_rate(struct iwl_priv *priv, |
340 | struct iwl_lq_sta *lq_sta) | 346 | struct iwl_lq_sta *lq_sta) |
341 | { | 347 | { |
@@ -348,13 +354,15 @@ static void rs_program_fix_rate(struct iwl_priv *priv, | |||
348 | lq_sta->active_mimo2_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */ | 354 | lq_sta->active_mimo2_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */ |
349 | lq_sta->active_mimo3_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */ | 355 | lq_sta->active_mimo3_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */ |
350 | 356 | ||
351 | lq_sta->dbg_fixed_rate = priv->dbg_fixed_rate; | 357 | /* testmode has higher priority to overwirte the fixed rate */ |
358 | if (priv->tm_fixed_rate) | ||
359 | lq_sta->dbg_fixed_rate = priv->tm_fixed_rate; | ||
352 | 360 | ||
353 | IWL_DEBUG_RATE(priv, "sta_id %d rate 0x%X\n", | 361 | IWL_DEBUG_RATE(priv, "sta_id %d rate 0x%X\n", |
354 | lq_sta->lq.sta_id, priv->dbg_fixed_rate); | 362 | lq_sta->lq.sta_id, lq_sta->dbg_fixed_rate); |
355 | 363 | ||
356 | if (priv->dbg_fixed_rate) { | 364 | if (lq_sta->dbg_fixed_rate) { |
357 | rs_fill_link_cmd(NULL, lq_sta, priv->dbg_fixed_rate); | 365 | rs_fill_link_cmd(NULL, lq_sta, lq_sta->dbg_fixed_rate); |
358 | iwl_send_lq_cmd(lq_sta->drv, ctx, &lq_sta->lq, CMD_ASYNC, | 366 | iwl_send_lq_cmd(lq_sta->drv, ctx, &lq_sta->lq, CMD_ASYNC, |
359 | false); | 367 | false); |
360 | } | 368 | } |
@@ -1073,7 +1081,8 @@ done: | |||
1073 | if (sta && sta->supp_rates[sband->band]) | 1081 | if (sta && sta->supp_rates[sband->band]) |
1074 | rs_rate_scale_perform(priv, skb, sta, lq_sta); | 1082 | rs_rate_scale_perform(priv, skb, sta, lq_sta); |
1075 | #ifdef CONFIG_MAC80211_DEBUGFS | 1083 | #ifdef CONFIG_MAC80211_DEBUGFS |
1076 | if (priv->dbg_fixed_rate != lq_sta->dbg_fixed_rate) | 1084 | if ((priv->tm_fixed_rate) && |
1085 | (priv->tm_fixed_rate != lq_sta->dbg_fixed_rate)) | ||
1077 | rs_program_fix_rate(priv, lq_sta); | 1086 | rs_program_fix_rate(priv, lq_sta); |
1078 | #endif | 1087 | #endif |
1079 | if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist) | 1088 | if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist) |
@@ -2896,7 +2905,7 @@ void iwl_rs_rate_init(struct iwl_priv *priv, struct ieee80211_sta *sta, u8 sta_i | |||
2896 | lq_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE; | 2905 | lq_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE; |
2897 | lq_sta->is_agg = 0; | 2906 | lq_sta->is_agg = 0; |
2898 | 2907 | ||
2899 | priv->dbg_fixed_rate = 0; | 2908 | priv->tm_fixed_rate = 0; |
2900 | #ifdef CONFIG_MAC80211_DEBUGFS | 2909 | #ifdef CONFIG_MAC80211_DEBUGFS |
2901 | lq_sta->dbg_fixed_rate = 0; | 2910 | lq_sta->dbg_fixed_rate = 0; |
2902 | #endif | 2911 | #endif |
@@ -3095,7 +3104,6 @@ static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, | |||
3095 | IWL_DEBUG_RATE(priv, "Fixed rate ON\n"); | 3104 | IWL_DEBUG_RATE(priv, "Fixed rate ON\n"); |
3096 | } else { | 3105 | } else { |
3097 | lq_sta->dbg_fixed_rate = 0; | 3106 | lq_sta->dbg_fixed_rate = 0; |
3098 | priv->dbg_fixed_rate = 0; | ||
3099 | IWL_ERR(priv, | 3107 | IWL_ERR(priv, |
3100 | "Invalid antenna selection 0x%X, Valid is 0x%X\n", | 3108 | "Invalid antenna selection 0x%X, Valid is 0x%X\n", |
3101 | ant_sel_tx, valid_tx_ant); | 3109 | ant_sel_tx, valid_tx_ant); |
@@ -3123,9 +3131,9 @@ static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file, | |||
3123 | return -EFAULT; | 3131 | return -EFAULT; |
3124 | 3132 | ||
3125 | if (sscanf(buf, "%x", &parsed_rate) == 1) | 3133 | if (sscanf(buf, "%x", &parsed_rate) == 1) |
3126 | priv->dbg_fixed_rate = lq_sta->dbg_fixed_rate = parsed_rate; | 3134 | lq_sta->dbg_fixed_rate = parsed_rate; |
3127 | else | 3135 | else |
3128 | priv->dbg_fixed_rate = lq_sta->dbg_fixed_rate = 0; | 3136 | lq_sta->dbg_fixed_rate = 0; |
3129 | 3137 | ||
3130 | rs_program_fix_rate(priv, lq_sta); | 3138 | rs_program_fix_rate(priv, lq_sta); |
3131 | 3139 | ||
@@ -3155,7 +3163,7 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file, | |||
3155 | lq_sta->total_failed, lq_sta->total_success, | 3163 | lq_sta->total_failed, lq_sta->total_success, |
3156 | lq_sta->active_legacy_rate); | 3164 | lq_sta->active_legacy_rate); |
3157 | desc += sprintf(buff+desc, "fixed rate 0x%X\n", | 3165 | desc += sprintf(buff+desc, "fixed rate 0x%X\n", |
3158 | priv->dbg_fixed_rate); | 3166 | lq_sta->dbg_fixed_rate); |
3159 | desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n", | 3167 | desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n", |
3160 | (priv->hw_params.valid_tx_ant & ANT_A) ? "ANT_A," : "", | 3168 | (priv->hw_params.valid_tx_ant & ANT_A) ? "ANT_A," : "", |
3161 | (priv->hw_params.valid_tx_ant & ANT_B) ? "ANT_B," : "", | 3169 | (priv->hw_params.valid_tx_ant & ANT_B) ? "ANT_B," : "", |