iwlwifi: move AP sta ID to context
authorJohannes Berg <johannes.berg@intel.com>
Mon, 23 Aug 2010 08:46:42 +0000 (10:46 +0200)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 27 Aug 2010 16:25:31 +0000 (09:25 -0700)
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>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl-sta.c
drivers/net/wireless/iwlwifi/iwl-sta.h
drivers/net/wireless/iwlwifi/iwl3945-base.c

index 5e1df24bdb5f8301165533b1f45294830bcadf1f..a67b04b309e043b10064122ca3581c228bb3da85 100644 (file)
@@ -3585,7 +3585,7 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        switch (cmd) {
        case SET_KEY:
                if (is_default_wep_key)
-                       ret = iwl_set_default_wep_key(priv, key);
+                       ret = iwl_set_default_wep_key(priv, vif_priv->ctx, key);
                else
                        ret = iwl_set_dynamic_key(priv, vif_priv->ctx,
                                                  key, sta_id);
@@ -4208,6 +4208,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING;
        priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC;
        priv->contexts[IWL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM;
+       priv->contexts[IWL_RXON_CTX_BSS].ap_sta_id = IWL_AP_ID;
        BUILD_BUG_ON(NUM_IWL_RXON_CTX != 1);
 
        SET_IEEE80211_DEV(hw, &pdev->dev);
index a332ec55f149c0d4c9a2cadb7f8b35306dfc91b4..d1400a0926eb70c6793c26e8b5e12c92b3c9940a 100644 (file)
@@ -1129,7 +1129,7 @@ struct iwl_rxon_context {
 
        struct iwl_qos_info qos_data;
 
-       u8 bcast_sta_id;
+       u8 bcast_sta_id, ap_sta_id;
 
        u8 rxon_cmd, rxon_assoc_cmd, rxon_timing_cmd;
        u8 qos_cmd;
index 29235626ac0bf67d626d9bc4c88b0ae627d4c07c..f5500cc8a44e8dc23742c6967cd58d33f9b3b2de 100644 (file)
@@ -236,7 +236,7 @@ static u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
        u16 rate;
 
        if (is_ap)
-               sta_id = IWL_AP_ID;
+               sta_id = ctx->ap_sta_id;
        else if (is_broadcast_ether_addr(addr))
                sta_id = ctx->bcast_sta_id;
        else
@@ -810,6 +810,7 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv,
 EXPORT_SYMBOL(iwl_remove_default_wep_key);
 
 int iwl_set_default_wep_key(struct iwl_priv *priv,
+                           struct iwl_rxon_context *ctx,
                            struct ieee80211_key_conf *keyconf)
 {
        int ret;
@@ -824,7 +825,7 @@ int iwl_set_default_wep_key(struct iwl_priv *priv,
 
        keyconf->flags &= ~IEEE80211_KEY_FLAG_GENERATE_IV;
        keyconf->hw_key_idx = HW_KEY_DEFAULT;
-       priv->stations[IWL_AP_ID].keyinfo.cipher = keyconf->cipher;
+       priv->stations[ctx->ap_sta_id].keyinfo.cipher = keyconf->cipher;
 
        priv->wep_keys[keyconf->keyidx].key_size = keyconf->keylen;
        memcpy(&priv->wep_keys[keyconf->keyidx].key, &keyconf->key,
index 269a3ed0f3fb068cd222a8111f208f53c5ae201b..b7f700638daed5de521c1aabdbc59833b2b58445 100644 (file)
@@ -46,6 +46,7 @@
 int iwl_remove_default_wep_key(struct iwl_priv *priv,
                               struct ieee80211_key_conf *key);
 int iwl_set_default_wep_key(struct iwl_priv *priv,
+                           struct iwl_rxon_context *ctx,
                            struct ieee80211_key_conf *key);
 int iwl_restore_default_wep_keys(struct iwl_priv *priv);
 int iwl_set_dynamic_key(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
index 6b5629570582d8b18dddf61385ffa47d57c541ae..29d13765ff6679792a43c425586a6693a7d79feb 100644 (file)
@@ -4021,6 +4021,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
        priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING;
        priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC;
        priv->contexts[IWL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM;
+       priv->contexts[IWL_RXON_CTX_BSS].ap_sta_id = IWL_AP_ID;
 
        /*
         * Disabling hardware scan means that mac80211 will perform scans