aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2011-07-08 11:46:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-11 15:02:09 -0400
commit4e308119771573f949203f9f4732bcbfb9628279 (patch)
tree8a2ebe78cb3b58dbd642e9f43e6250bc906f09eb /drivers/net
parenteedb6e357a4b1bd3d7e4544e77fbd71718492547 (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')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c28
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tx.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sv-open.c2
4 files changed, 30 insertions, 12 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 */
339static void rs_program_fix_rate(struct iwl_priv *priv, 345static 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," : "",
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index db3ec7aaf944..07c1242599f7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -436,6 +436,16 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv,
436 if (ieee80211_is_data(fc)) { 436 if (ieee80211_is_data(fc)) {
437 tx_cmd->initial_rate_index = 0; 437 tx_cmd->initial_rate_index = 0;
438 tx_cmd->tx_flags |= TX_CMD_FLG_STA_RATE_MSK; 438 tx_cmd->tx_flags |= TX_CMD_FLG_STA_RATE_MSK;
439 if (priv->tm_fixed_rate) {
440 /*
441 * rate overwrite by testmode
442 * we not only send lq command to change rate
443 * we also re-enforce per data pkt base.
444 */
445 tx_cmd->tx_flags &= ~TX_CMD_FLG_STA_RATE_MSK;
446 memcpy(&tx_cmd->rate_n_flags, &priv->tm_fixed_rate,
447 sizeof(tx_cmd->rate_n_flags));
448 }
439 return; 449 return;
440 } 450 }
441 451
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index fa0827f4d243..a0cca02032e7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1605,7 +1605,7 @@ struct iwl_priv {
1605#ifdef CONFIG_IWLWIFI_DEVICE_SVTOOL 1605#ifdef CONFIG_IWLWIFI_DEVICE_SVTOOL
1606 struct iwl_testmode_trace testmode_trace; 1606 struct iwl_testmode_trace testmode_trace;
1607#endif 1607#endif
1608 u32 dbg_fixed_rate; 1608 u32 tm_fixed_rate;
1609 1609
1610}; /*iwl_priv */ 1610}; /*iwl_priv */
1611 1611
diff --git a/drivers/net/wireless/iwlwifi/iwl-sv-open.c b/drivers/net/wireless/iwlwifi/iwl-sv-open.c
index ed9bd91ece7a..a322f5e80759 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sv-open.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sv-open.c
@@ -454,7 +454,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
454 "Error finding fixrate setting\n"); 454 "Error finding fixrate setting\n");
455 return -ENOMSG; 455 return -ENOMSG;
456 } 456 }
457 priv->dbg_fixed_rate = nla_get_u32(tb[IWL_TM_ATTR_FIXRATE]); 457 priv->tm_fixed_rate = nla_get_u32(tb[IWL_TM_ATTR_FIXRATE]);
458 break; 458 break;
459 459
460 default: 460 default: