diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2009-10-30 17:36:12 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-02 15:39:46 -0500 |
commit | 9a9ca65fbfa1cd14a6c016b793d61492f9f613d0 (patch) | |
tree | f7eb095cd336c9566e349eadee4a25e2b9695d4d /drivers/net/wireless | |
parent | 89f186a8b64a4c90a219cfd94c26de5cfea54b84 (diff) |
iwlwifi: split adding broadcast station from others
In preparation for some station management changes we split the addition of
a broadcast station from the other stations. Later we will rely on mac80211
to direct all management (addition/removal) of all stations except the
broadcast station.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 62 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.h | 1 |
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 2814565fa3b4..4a13f7e21d63 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 dc74c16d36a8..ce1ceac19c7d 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) | |||
1030 | EXPORT_SYMBOL(iwl_rxon_add_station); | 1030 | EXPORT_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 | */ | ||
1039 | static 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 | */ | ||
1085 | void 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 | } | ||
1092 | EXPORT_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 6deebade6361..1c382de80d49 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 | ||
54 | int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, bool is_ap); | 54 | int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, bool is_ap); |
55 | void iwl_add_bcast_station(struct iwl_priv *priv); | ||
55 | int iwl_remove_station(struct iwl_priv *priv, const u8 *addr, bool is_ap); | 56 | int iwl_remove_station(struct iwl_priv *priv, const u8 *addr, bool is_ap); |
56 | void iwl_clear_stations_table(struct iwl_priv *priv); | 57 | void iwl_clear_stations_table(struct iwl_priv *priv); |
57 | int iwl_get_free_ucode_key_index(struct iwl_priv *priv); | 58 | int iwl_get_free_ucode_key_index(struct iwl_priv *priv); |