diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-sta.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index dc74c16d36a8..eba36f737388 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -182,6 +182,11 @@ static void iwl_set_ht_add_station(struct iwl_priv *priv, u8 index, | |||
182 | goto done; | 182 | goto done; |
183 | 183 | ||
184 | mimo_ps_mode = (sta_ht_inf->cap & IEEE80211_HT_CAP_SM_PS) >> 2; | 184 | mimo_ps_mode = (sta_ht_inf->cap & IEEE80211_HT_CAP_SM_PS) >> 2; |
185 | IWL_DEBUG_ASSOC(priv, "spatial multiplexing power save mode: %s\n", | ||
186 | (mimo_ps_mode == WLAN_HT_CAP_SM_PS_STATIC) ? | ||
187 | "static" : | ||
188 | (mimo_ps_mode == WLAN_HT_CAP_SM_PS_DYNAMIC) ? | ||
189 | "dynamic" : "disabled"); | ||
185 | 190 | ||
186 | sta_flags = priv->stations[index].sta.station_flags; | 191 | sta_flags = priv->stations[index].sta.station_flags; |
187 | 192 | ||
@@ -1012,7 +1017,7 @@ int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, bool is_ap) | |||
1012 | */ | 1017 | */ |
1013 | if (priv->current_ht_config.is_ht) { | 1018 | if (priv->current_ht_config.is_ht) { |
1014 | rcu_read_lock(); | 1019 | rcu_read_lock(); |
1015 | sta = ieee80211_find_sta(priv->hw, addr); | 1020 | sta = ieee80211_find_sta(priv->vif, addr); |
1016 | if (sta) { | 1021 | if (sta) { |
1017 | memcpy(&ht_config, &sta->ht_cap, sizeof(ht_config)); | 1022 | memcpy(&ht_config, &sta->ht_cap, sizeof(ht_config)); |
1018 | cur_ht_config = &ht_config; | 1023 | cur_ht_config = &ht_config; |
@@ -1030,6 +1035,68 @@ int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, bool is_ap) | |||
1030 | EXPORT_SYMBOL(iwl_rxon_add_station); | 1035 | EXPORT_SYMBOL(iwl_rxon_add_station); |
1031 | 1036 | ||
1032 | /** | 1037 | /** |
1038 | * iwl_sta_init_bcast_lq - Initialize a bcast station's hardware rate table | ||
1039 | * | ||
1040 | * NOTE: Run REPLY_ADD_STA command to set up station table entry, before | ||
1041 | * calling this function (which runs REPLY_TX_LINK_QUALITY_CMD, | ||
1042 | * which requires station table entry to exist). | ||
1043 | */ | ||
1044 | static void iwl_sta_init_bcast_lq(struct iwl_priv *priv) | ||
1045 | { | ||
1046 | int i, r; | ||
1047 | struct iwl_link_quality_cmd link_cmd = { | ||
1048 | .reserved1 = 0, | ||
1049 | }; | ||
1050 | u32 rate_flags; | ||
1051 | |||
1052 | /* Set up the rate scaling to start at selected rate, fall back | ||
1053 | * all the way down to 1M in IEEE order, and then spin on 1M */ | ||
1054 | if (priv->band == IEEE80211_BAND_5GHZ) | ||
1055 | r = IWL_RATE_6M_INDEX; | ||
1056 | else | ||
1057 | r = IWL_RATE_1M_INDEX; | ||
1058 | |||
1059 | for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) { | ||
1060 | rate_flags = 0; | ||
1061 | if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE) | ||
1062 | rate_flags |= RATE_MCS_CCK_MSK; | ||
1063 | |||
1064 | rate_flags |= first_antenna(priv->hw_params.valid_tx_ant) << | ||
1065 | RATE_MCS_ANT_POS; | ||
1066 | |||
1067 | link_cmd.rs_table[i].rate_n_flags = | ||
1068 | iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags); | ||
1069 | r = iwl_get_prev_ieee_rate(r); | ||
1070 | } | ||
1071 | |||
1072 | link_cmd.general_params.single_stream_ant_msk = | ||
1073 | first_antenna(priv->hw_params.valid_tx_ant); | ||
1074 | link_cmd.general_params.dual_stream_ant_msk = 3; | ||
1075 | link_cmd.agg_params.agg_dis_start_th = LINK_QUAL_AGG_DISABLE_START_DEF; | ||
1076 | link_cmd.agg_params.agg_time_limit = | ||
1077 | cpu_to_le16(LINK_QUAL_AGG_TIME_LIMIT_DEF); | ||
1078 | |||
1079 | /* Update the rate scaling for control frame Tx to AP */ | ||
1080 | link_cmd.sta_id = priv->hw_params.bcast_sta_id; | ||
1081 | |||
1082 | iwl_send_cmd_pdu_async(priv, REPLY_TX_LINK_QUALITY_CMD, | ||
1083 | sizeof(link_cmd), &link_cmd, NULL); | ||
1084 | } | ||
1085 | |||
1086 | |||
1087 | /** | ||
1088 | * iwl_add_bcast_station - add broadcast station into station table. | ||
1089 | */ | ||
1090 | void iwl_add_bcast_station(struct iwl_priv *priv) | ||
1091 | { | ||
1092 | iwl_add_station(priv, iwl_bcast_addr, false, CMD_SYNC, NULL); | ||
1093 | |||
1094 | /* Set up default rate scaling table in device's station table */ | ||
1095 | iwl_sta_init_bcast_lq(priv); | ||
1096 | } | ||
1097 | EXPORT_SYMBOL(iwl_add_bcast_station); | ||
1098 | |||
1099 | /** | ||
1033 | * iwl_get_sta_id - Find station's index within station table | 1100 | * iwl_get_sta_id - Find station's index within station table |
1034 | * | 1101 | * |
1035 | * If new IBSS station, create new entry in station table | 1102 | * If new IBSS station, create new entry in station table |