aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c62
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.h1
3 files changed, 65 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 2814565fa3b..4a13f7e21d6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -190,11 +190,7 @@ int iwl_commit_rxon(struct iwl_priv *priv)
190 priv->start_calib = 0; 190 priv->start_calib = 0;
191 191
192 /* Add the broadcast address so we can send broadcast frames */ 192 /* Add the broadcast address so we can send broadcast frames */
193 if (iwl_rxon_add_station(priv, iwl_bcast_addr, 0) == 193 iwl_add_bcast_station(priv);
194 IWL_INVALID_STATION) {
195 IWL_ERR(priv, "Error adding BROADCAST address for transmit.\n");
196 return -EIO;
197 }
198 194
199 /* If we have set the ASSOC_MSK and we are in BSS mode then 195 /* If we have set the ASSOC_MSK and we are in BSS mode then
200 * add the IWL_AP_ID to the station rate table */ 196 * add the IWL_AP_ID to the station rate table */
@@ -2524,7 +2520,7 @@ void iwl_config_ap(struct iwl_priv *priv)
2524 spin_lock_irqsave(&priv->lock, flags); 2520 spin_lock_irqsave(&priv->lock, flags);
2525 iwl_activate_qos(priv, 1); 2521 iwl_activate_qos(priv, 1);
2526 spin_unlock_irqrestore(&priv->lock, flags); 2522 spin_unlock_irqrestore(&priv->lock, flags);
2527 iwl_rxon_add_station(priv, iwl_bcast_addr, 0); 2523 iwl_add_bcast_station(priv);
2528 } 2524 }
2529 iwl_send_beacon_cmd(priv); 2525 iwl_send_beacon_cmd(priv);
2530 2526
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index dc74c16d36a..ce1ceac19c7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -1030,6 +1030,68 @@ int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, bool is_ap)
1030EXPORT_SYMBOL(iwl_rxon_add_station); 1030EXPORT_SYMBOL(iwl_rxon_add_station);
1031 1031
1032/** 1032/**
1033 * iwl_sta_init_bcast_lq - Initialize a bcast station's hardware rate table
1034 *
1035 * NOTE: Run REPLY_ADD_STA command to set up station table entry, before
1036 * calling this function (which runs REPLY_TX_LINK_QUALITY_CMD,
1037 * which requires station table entry to exist).
1038 */
1039static void iwl_sta_init_bcast_lq(struct iwl_priv *priv)
1040{
1041 int i, r;
1042 struct iwl_link_quality_cmd link_cmd = {
1043 .reserved1 = 0,
1044 };
1045 u32 rate_flags;
1046
1047 /* Set up the rate scaling to start at selected rate, fall back
1048 * all the way down to 1M in IEEE order, and then spin on 1M */
1049 if (priv->band == IEEE80211_BAND_5GHZ)
1050 r = IWL_RATE_6M_INDEX;
1051 else
1052 r = IWL_RATE_1M_INDEX;
1053
1054 for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) {
1055 rate_flags = 0;
1056 if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE)
1057 rate_flags |= RATE_MCS_CCK_MSK;
1058
1059 rate_flags |= first_antenna(priv->hw_params.valid_tx_ant) <<
1060 RATE_MCS_ANT_POS;
1061
1062 link_cmd.rs_table[i].rate_n_flags =
1063 iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags);
1064 r = iwl_get_prev_ieee_rate(r);
1065 }
1066
1067 link_cmd.general_params.single_stream_ant_msk =
1068 first_antenna(priv->hw_params.valid_tx_ant);
1069 link_cmd.general_params.dual_stream_ant_msk = 3;
1070 link_cmd.agg_params.agg_dis_start_th = LINK_QUAL_AGG_DISABLE_START_DEF;
1071 link_cmd.agg_params.agg_time_limit =
1072 cpu_to_le16(LINK_QUAL_AGG_TIME_LIMIT_DEF);
1073
1074 /* Update the rate scaling for control frame Tx to AP */
1075 link_cmd.sta_id = priv->hw_params.bcast_sta_id;
1076
1077 iwl_send_cmd_pdu_async(priv, REPLY_TX_LINK_QUALITY_CMD,
1078 sizeof(link_cmd), &link_cmd, NULL);
1079}
1080
1081
1082/**
1083 * iwl_add_bcast_station - add broadcast station into station table.
1084 */
1085void iwl_add_bcast_station(struct iwl_priv *priv)
1086{
1087 iwl_add_station(priv, iwl_bcast_addr, false, CMD_SYNC, NULL);
1088
1089 /* Set up default rate scaling table in device's station table */
1090 iwl_sta_init_bcast_lq(priv);
1091}
1092EXPORT_SYMBOL(iwl_add_bcast_station);
1093
1094/**
1033 * iwl_get_sta_id - Find station's index within station table 1095 * iwl_get_sta_id - Find station's index within station table
1034 * 1096 *
1035 * If new IBSS station, create new entry in station table 1097 * If new IBSS station, create new entry in station table
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h
index 6deebade636..1c382de80d4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.h
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.h
@@ -52,6 +52,7 @@ void iwl_update_tkip_key(struct iwl_priv *priv,
52 const u8 *addr, u32 iv32, u16 *phase1key); 52 const u8 *addr, u32 iv32, u16 *phase1key);
53 53
54int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, bool is_ap); 54int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, bool is_ap);
55void iwl_add_bcast_station(struct iwl_priv *priv);
55int iwl_remove_station(struct iwl_priv *priv, const u8 *addr, bool is_ap); 56int iwl_remove_station(struct iwl_priv *priv, const u8 *addr, bool is_ap);
56void iwl_clear_stations_table(struct iwl_priv *priv); 57void iwl_clear_stations_table(struct iwl_priv *priv);
57int iwl_get_free_ucode_key_index(struct iwl_priv *priv); 58int iwl_get_free_ucode_key_index(struct iwl_priv *priv);