aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-sta.c
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2009-10-30 17:36:12 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-11-02 15:39:46 -0500
commit9a9ca65fbfa1cd14a6c016b793d61492f9f613d0 (patch)
treef7eb095cd336c9566e349eadee4a25e2b9695d4d /drivers/net/wireless/iwlwifi/iwl-sta.c
parent89f186a8b64a4c90a219cfd94c26de5cfea54b84 (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/iwlwifi/iwl-sta.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c62
1 files changed, 62 insertions, 0 deletions
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