diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-08-23 04:46:42 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-08-27 12:25:31 -0400 |
commit | 2995bafafd4d9d2f840b51b0121997be09fb8b47 (patch) | |
tree | 1e25d3888e0489687c2dbbbdc731ec0a147d6319 | |
parent | 95c38dd429712366739299579b0785625cba66d6 (diff) |
iwlwifi: move AP sta ID to context
Each context needs to use a different AP sta
ID, so we need to move that into the context
struct instead of hardcoding it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 1 |
5 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 5e1df24bdb5f..a67b04b309e0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3585,7 +3585,7 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3585 | switch (cmd) { | 3585 | switch (cmd) { |
3586 | case SET_KEY: | 3586 | case SET_KEY: |
3587 | if (is_default_wep_key) | 3587 | if (is_default_wep_key) |
3588 | ret = iwl_set_default_wep_key(priv, key); | 3588 | ret = iwl_set_default_wep_key(priv, vif_priv->ctx, key); |
3589 | else | 3589 | else |
3590 | ret = iwl_set_dynamic_key(priv, vif_priv->ctx, | 3590 | ret = iwl_set_dynamic_key(priv, vif_priv->ctx, |
3591 | key, sta_id); | 3591 | key, sta_id); |
@@ -4208,6 +4208,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
4208 | priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING; | 4208 | priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING; |
4209 | priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC; | 4209 | priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC; |
4210 | priv->contexts[IWL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM; | 4210 | priv->contexts[IWL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM; |
4211 | priv->contexts[IWL_RXON_CTX_BSS].ap_sta_id = IWL_AP_ID; | ||
4211 | BUILD_BUG_ON(NUM_IWL_RXON_CTX != 1); | 4212 | BUILD_BUG_ON(NUM_IWL_RXON_CTX != 1); |
4212 | 4213 | ||
4213 | SET_IEEE80211_DEV(hw, &pdev->dev); | 4214 | SET_IEEE80211_DEV(hw, &pdev->dev); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index a332ec55f149..d1400a0926eb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1129,7 +1129,7 @@ struct iwl_rxon_context { | |||
1129 | 1129 | ||
1130 | struct iwl_qos_info qos_data; | 1130 | struct iwl_qos_info qos_data; |
1131 | 1131 | ||
1132 | u8 bcast_sta_id; | 1132 | u8 bcast_sta_id, ap_sta_id; |
1133 | 1133 | ||
1134 | u8 rxon_cmd, rxon_assoc_cmd, rxon_timing_cmd; | 1134 | u8 rxon_cmd, rxon_assoc_cmd, rxon_timing_cmd; |
1135 | u8 qos_cmd; | 1135 | u8 qos_cmd; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 29235626ac0b..f5500cc8a44e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -236,7 +236,7 @@ static u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | |||
236 | u16 rate; | 236 | u16 rate; |
237 | 237 | ||
238 | if (is_ap) | 238 | if (is_ap) |
239 | sta_id = IWL_AP_ID; | 239 | sta_id = ctx->ap_sta_id; |
240 | else if (is_broadcast_ether_addr(addr)) | 240 | else if (is_broadcast_ether_addr(addr)) |
241 | sta_id = ctx->bcast_sta_id; | 241 | sta_id = ctx->bcast_sta_id; |
242 | else | 242 | else |
@@ -810,6 +810,7 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv, | |||
810 | EXPORT_SYMBOL(iwl_remove_default_wep_key); | 810 | EXPORT_SYMBOL(iwl_remove_default_wep_key); |
811 | 811 | ||
812 | int iwl_set_default_wep_key(struct iwl_priv *priv, | 812 | int iwl_set_default_wep_key(struct iwl_priv *priv, |
813 | struct iwl_rxon_context *ctx, | ||
813 | struct ieee80211_key_conf *keyconf) | 814 | struct ieee80211_key_conf *keyconf) |
814 | { | 815 | { |
815 | int ret; | 816 | int ret; |
@@ -824,7 +825,7 @@ int iwl_set_default_wep_key(struct iwl_priv *priv, | |||
824 | 825 | ||
825 | keyconf->flags &= ~IEEE80211_KEY_FLAG_GENERATE_IV; | 826 | keyconf->flags &= ~IEEE80211_KEY_FLAG_GENERATE_IV; |
826 | keyconf->hw_key_idx = HW_KEY_DEFAULT; | 827 | keyconf->hw_key_idx = HW_KEY_DEFAULT; |
827 | priv->stations[IWL_AP_ID].keyinfo.cipher = keyconf->cipher; | 828 | priv->stations[ctx->ap_sta_id].keyinfo.cipher = keyconf->cipher; |
828 | 829 | ||
829 | priv->wep_keys[keyconf->keyidx].key_size = keyconf->keylen; | 830 | priv->wep_keys[keyconf->keyidx].key_size = keyconf->keylen; |
830 | memcpy(&priv->wep_keys[keyconf->keyidx].key, &keyconf->key, | 831 | memcpy(&priv->wep_keys[keyconf->keyidx].key, &keyconf->key, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h index 269a3ed0f3fb..b7f700638dae 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.h +++ b/drivers/net/wireless/iwlwifi/iwl-sta.h | |||
@@ -46,6 +46,7 @@ | |||
46 | int iwl_remove_default_wep_key(struct iwl_priv *priv, | 46 | int iwl_remove_default_wep_key(struct iwl_priv *priv, |
47 | struct ieee80211_key_conf *key); | 47 | struct ieee80211_key_conf *key); |
48 | int iwl_set_default_wep_key(struct iwl_priv *priv, | 48 | int iwl_set_default_wep_key(struct iwl_priv *priv, |
49 | struct iwl_rxon_context *ctx, | ||
49 | struct ieee80211_key_conf *key); | 50 | struct ieee80211_key_conf *key); |
50 | int iwl_restore_default_wep_keys(struct iwl_priv *priv); | 51 | int iwl_restore_default_wep_keys(struct iwl_priv *priv); |
51 | int iwl_set_dynamic_key(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | 52 | int iwl_set_dynamic_key(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 6b5629570582..29d13765ff66 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -4021,6 +4021,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
4021 | priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING; | 4021 | priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING; |
4022 | priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC; | 4022 | priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC; |
4023 | priv->contexts[IWL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM; | 4023 | priv->contexts[IWL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM; |
4024 | priv->contexts[IWL_RXON_CTX_BSS].ap_sta_id = IWL_AP_ID; | ||
4024 | 4025 | ||
4025 | /* | 4026 | /* |
4026 | * Disabling hardware scan means that mac80211 will perform scans | 4027 | * Disabling hardware scan means that mac80211 will perform scans |