Commit b16db50a authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville

iwlegacy: move bcast_sta_id to hw_params

Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8f9e5645
...@@ -140,7 +140,7 @@ il3945_set_ccmp_dynamic_key_info(struct il_priv *il, ...@@ -140,7 +140,7 @@ il3945_set_ccmp_dynamic_key_info(struct il_priv *il,
key_flags |= (STA_KEY_FLG_CCMP | STA_KEY_FLG_MAP_KEY_MSK); key_flags |= (STA_KEY_FLG_CCMP | STA_KEY_FLG_MAP_KEY_MSK);
key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
if (sta_id == il->ctx.bcast_sta_id) if (sta_id == il->hw_params.bcast_id)
key_flags |= STA_KEY_MULTICAST_MSK; key_flags |= STA_KEY_MULTICAST_MSK;
keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
...@@ -2598,7 +2598,7 @@ il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif) ...@@ -2598,7 +2598,7 @@ il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
/* We don't build a direct scan probe request; the uCode will do /* We don't build a direct scan probe request; the uCode will do
* that based on the direct_mask added to each channel entry */ * that based on the direct_mask added to each channel entry */
scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK; scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK;
scan->tx_cmd.sta_id = il->ctx.bcast_sta_id; scan->tx_cmd.sta_id = il->hw_params.bcast_id;
scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
/* flags + rate selection */ /* flags + rate selection */
......
...@@ -342,7 +342,7 @@ il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_id) ...@@ -342,7 +342,7 @@ il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_id)
int i; int i;
D_INFO("enter\n"); D_INFO("enter\n");
if (sta_id == il->ctx.bcast_sta_id) if (sta_id == il->hw_params.bcast_id)
goto out; goto out;
psta = (struct il3945_sta_priv *)sta->drv_priv; psta = (struct il3945_sta_priv *)sta->drv_priv;
......
...@@ -2396,6 +2396,8 @@ il3945_hw_set_hw_params(struct il_priv *il) ...@@ -2396,6 +2396,8 @@ il3945_hw_set_hw_params(struct il_priv *il)
return -ENOMEM; return -ENOMEM;
} }
il->hw_params.bcast_id = IL3945_BROADCAST_ID;
/* Assign number of Usable TX queues */ /* Assign number of Usable TX queues */
il->hw_params.max_txq_num = il->cfg->base_params->num_of_queues; il->hw_params.max_txq_num = il->cfg->base_params->num_of_queues;
...@@ -2404,7 +2406,6 @@ il3945_hw_set_hw_params(struct il_priv *il) ...@@ -2404,7 +2406,6 @@ il3945_hw_set_hw_params(struct il_priv *il)
il->hw_params.max_rxq_size = RX_QUEUE_SIZE; il->hw_params.max_rxq_size = RX_QUEUE_SIZE;
il->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG; il->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG;
il->hw_params.max_stations = IL3945_STATION_COUNT; il->hw_params.max_stations = IL3945_STATION_COUNT;
il->ctx.bcast_sta_id = IL3945_BROADCAST_ID;
il->sta_key_max_num = STA_KEY_MAX_NUM; il->sta_key_max_num = STA_KEY_MAX_NUM;
...@@ -2425,7 +2426,7 @@ il3945_hw_get_beacon_cmd(struct il_priv *il, struct il3945_frame *frame, ...@@ -2425,7 +2426,7 @@ il3945_hw_get_beacon_cmd(struct il_priv *il, struct il3945_frame *frame,
tx_beacon_cmd = (struct il3945_tx_beacon_cmd *)&frame->u; tx_beacon_cmd = (struct il3945_tx_beacon_cmd *)&frame->u;
memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd)); memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd));
tx_beacon_cmd->tx.sta_id = il->ctx.bcast_sta_id; tx_beacon_cmd->tx.sta_id = il->hw_params.bcast_id;
tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
frame_size = frame_size =
......
...@@ -919,7 +919,7 @@ il4965_request_scan(struct il_priv *il, struct ieee80211_vif *vif) ...@@ -919,7 +919,7 @@ il4965_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
D_SCAN("Start passive scan.\n"); D_SCAN("Start passive scan.\n");
scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK; scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK;
scan->tx_cmd.sta_id = ctx->bcast_sta_id; scan->tx_cmd.sta_id = il->hw_params.bcast_id;
scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
switch (il->scan_band) { switch (il->scan_band) {
...@@ -1678,7 +1678,7 @@ il4965_tx_skb(struct il_priv *il, struct sk_buff *skb) ...@@ -1678,7 +1678,7 @@ il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
/* For management frames use broadcast id to do not break aggregation */ /* For management frames use broadcast id to do not break aggregation */
if (!ieee80211_is_data(fc)) if (!ieee80211_is_data(fc))
sta_id = ctx->bcast_sta_id; sta_id = il->hw_params.bcast_id;
else { else {
/* Find idx into station table for destination station */ /* Find idx into station table for destination station */
sta_id = il_sta_id_or_broadcast(il, ctx, info->control.sta); sta_id = il_sta_id_or_broadcast(il, ctx, info->control.sta);
...@@ -2938,7 +2938,7 @@ il4965_set_wep_dynamic_key_info(struct il_priv *il, struct il_rxon_context *ctx, ...@@ -2938,7 +2938,7 @@ il4965_set_wep_dynamic_key_info(struct il_priv *il, struct il_rxon_context *ctx,
if (keyconf->keylen == WEP_KEY_LEN_128) if (keyconf->keylen == WEP_KEY_LEN_128)
key_flags |= STA_KEY_FLG_KEY_SIZE_MSK; key_flags |= STA_KEY_FLG_KEY_SIZE_MSK;
if (sta_id == ctx->bcast_sta_id) if (sta_id == il->hw_params.bcast_id)
key_flags |= STA_KEY_MULTICAST_MSK; key_flags |= STA_KEY_MULTICAST_MSK;
spin_lock_irqsave(&il->sta_lock, flags); spin_lock_irqsave(&il->sta_lock, flags);
...@@ -2988,7 +2988,7 @@ il4965_set_ccmp_dynamic_key_info(struct il_priv *il, ...@@ -2988,7 +2988,7 @@ il4965_set_ccmp_dynamic_key_info(struct il_priv *il,
key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
key_flags &= ~STA_KEY_FLG_INVALID; key_flags &= ~STA_KEY_FLG_INVALID;
if (sta_id == ctx->bcast_sta_id) if (sta_id == il->hw_params.bcast_id)
key_flags |= STA_KEY_MULTICAST_MSK; key_flags |= STA_KEY_MULTICAST_MSK;
keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
...@@ -3035,7 +3035,7 @@ il4965_set_tkip_dynamic_key_info(struct il_priv *il, ...@@ -3035,7 +3035,7 @@ il4965_set_tkip_dynamic_key_info(struct il_priv *il,
key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
key_flags &= ~STA_KEY_FLG_INVALID; key_flags &= ~STA_KEY_FLG_INVALID;
if (sta_id == ctx->bcast_sta_id) if (sta_id == il->hw_params.bcast_id)
key_flags |= STA_KEY_MULTICAST_MSK; key_flags |= STA_KEY_MULTICAST_MSK;
keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
...@@ -3253,7 +3253,7 @@ il4965_update_bcast_station(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -3253,7 +3253,7 @@ il4965_update_bcast_station(struct il_priv *il, struct il_rxon_context *ctx)
{ {
unsigned long flags; unsigned long flags;
struct il_link_quality_cmd *link_cmd; struct il_link_quality_cmd *link_cmd;
u8 sta_id = ctx->bcast_sta_id; u8 sta_id = il->hw_params.bcast_id;
link_cmd = il4965_sta_alloc_lq(il, sta_id); link_cmd = il4965_sta_alloc_lq(il, sta_id);
if (!link_cmd) { if (!link_cmd) {
...@@ -3510,7 +3510,7 @@ il4965_hw_get_beacon_cmd(struct il_priv *il, struct il_frame *frame) ...@@ -3510,7 +3510,7 @@ il4965_hw_get_beacon_cmd(struct il_priv *il, struct il_frame *frame)
/* Set up TX command fields */ /* Set up TX command fields */
tx_beacon_cmd->tx.len = cpu_to_le16((u16) frame_size); tx_beacon_cmd->tx.len = cpu_to_le16((u16) frame_size);
tx_beacon_cmd->tx.sta_id = il->beacon_ctx->bcast_sta_id; tx_beacon_cmd->tx.sta_id = il->hw_params.bcast_id;
tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
tx_beacon_cmd->tx.tx_flags = tx_beacon_cmd->tx.tx_flags =
TX_CMD_FLG_SEQ_CTL_MSK | TX_CMD_FLG_TSF_MSK | TX_CMD_FLG_SEQ_CTL_MSK | TX_CMD_FLG_TSF_MSK |
...@@ -6082,6 +6082,7 @@ il4965_hw_detect(struct il_priv *il) ...@@ -6082,6 +6082,7 @@ il4965_hw_detect(struct il_priv *il)
static int static int
il4965_set_hw_params(struct il_priv *il) il4965_set_hw_params(struct il_priv *il)
{ {
il->hw_params.bcast_id = IL4965_BROADCAST_ID;
il->hw_params.max_rxq_size = RX_QUEUE_SIZE; il->hw_params.max_rxq_size = RX_QUEUE_SIZE;
il->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG; il->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG;
if (il->cfg->mod_params->amsdu_size_8K) if (il->cfg->mod_params->amsdu_size_8K)
......
...@@ -624,7 +624,6 @@ il4965_hw_set_hw_params(struct il_priv *il) ...@@ -624,7 +624,6 @@ il4965_hw_set_hw_params(struct il_priv *il)
sizeof(struct il4965_scd_bc_tbl); sizeof(struct il4965_scd_bc_tbl);
il->hw_params.tfd_size = sizeof(struct il_tfd); il->hw_params.tfd_size = sizeof(struct il_tfd);
il->hw_params.max_stations = IL4965_STATION_COUNT; il->hw_params.max_stations = IL4965_STATION_COUNT;
il->ctx.bcast_sta_id = IL4965_BROADCAST_ID;
il->hw_params.max_data_size = IL49_RTC_DATA_SIZE; il->hw_params.max_data_size = IL49_RTC_DATA_SIZE;
il->hw_params.max_inst_size = IL49_RTC_INST_SIZE; il->hw_params.max_inst_size = IL49_RTC_INST_SIZE;
il->hw_params.max_bsm_size = BSM_SRAM_SIZE; il->hw_params.max_bsm_size = BSM_SRAM_SIZE;
...@@ -1968,7 +1967,7 @@ il4965_find_station(struct il_priv *il, const u8 * addr) ...@@ -1968,7 +1967,7 @@ il4965_find_station(struct il_priv *il, const u8 * addr)
start = IL_STA_ID; start = IL_STA_ID;
if (is_broadcast_ether_addr(addr)) if (is_broadcast_ether_addr(addr))
return il->ctx.bcast_sta_id; return il->hw_params.bcast_id;
spin_lock_irqsave(&il->sta_lock, flags); spin_lock_irqsave(&il->sta_lock, flags);
for (i = start; i < il->hw_params.max_stations; i++) for (i = start; i < il->hw_params.max_stations; i++)
......
...@@ -1901,7 +1901,7 @@ il_prep_station(struct il_priv *il, struct il_rxon_context *ctx, ...@@ -1901,7 +1901,7 @@ il_prep_station(struct il_priv *il, struct il_rxon_context *ctx,
if (is_ap) if (is_ap)
sta_id = IL_AP_ID; sta_id = IL_AP_ID;
else if (is_broadcast_ether_addr(addr)) else if (is_broadcast_ether_addr(addr))
sta_id = ctx->bcast_sta_id; sta_id = il->hw_params.bcast_id;
else else
for (i = IL_STA_ID; i < il->hw_params.max_stations; i++) { for (i = IL_STA_ID; i < il->hw_params.max_stations; i++) {
if (!compare_ether_addr if (!compare_ether_addr
......
...@@ -816,6 +816,7 @@ struct il_sensitivity_ranges { ...@@ -816,6 +816,7 @@ struct il_sensitivity_ranges {
/** /**
* struct il_hw_params * struct il_hw_params
* @bcast_id: f/w broadcast station ID
* @max_txq_num: Max # Tx queues supported * @max_txq_num: Max # Tx queues supported
* @dma_chnl_num: Number of Tx DMA/FIFO channels * @dma_chnl_num: Number of Tx DMA/FIFO channels
* @scd_bc_tbls_size: size of scheduler byte count tables * @scd_bc_tbls_size: size of scheduler byte count tables
...@@ -836,6 +837,7 @@ struct il_sensitivity_ranges { ...@@ -836,6 +837,7 @@ struct il_sensitivity_ranges {
* @struct il_sensitivity_ranges: range of sensitivity values * @struct il_sensitivity_ranges: range of sensitivity values
*/ */
struct il_hw_params { struct il_hw_params {
u8 bcast_id;
u8 max_txq_num; u8 max_txq_num;
u8 dma_chnl_num; u8 dma_chnl_num;
u16 scd_bc_tbls_size; u16 scd_bc_tbls_size;
...@@ -1173,8 +1175,6 @@ struct il_rxon_context { ...@@ -1173,8 +1175,6 @@ struct il_rxon_context {
struct il_qos_info qos_data; struct il_qos_info qos_data;
u8 bcast_sta_id;
struct il_wep_key wep_keys[WEP_KEYS_MAX]; struct il_wep_key wep_keys[WEP_KEYS_MAX];
u8 key_mapping_keys; u8 key_mapping_keys;
...@@ -2372,7 +2372,7 @@ il_sta_id_or_broadcast(struct il_priv *il, struct il_rxon_context *context, ...@@ -2372,7 +2372,7 @@ il_sta_id_or_broadcast(struct il_priv *il, struct il_rxon_context *context,
int sta_id; int sta_id;
if (!sta) if (!sta)
return context->bcast_sta_id; return il->hw_params.bcast_id;
sta_id = il_sta_id(sta); sta_id = il_sta_id(sta);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment