aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-23 04:46:49 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-08-27 12:28:36 -0400
commitece9c4ee5e590f96d7221c746126eaafac15a60c (patch)
tree919cbdeb4277e99a9b3313a338f9e9ef3622040f /drivers/net/wireless/iwlwifi/iwl-agn.c
parent946ba30d61d47ee634a39d27b4d067b6418eaa08 (diff)
iwlagn: detect PAN capability
Detect whether or not the ucode is PAN capable and adjust the valid contexts accordingly. To be able to do this, add the PAN context to the array as well. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 55d1cd4c1369..bad97f47eb9f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1718,6 +1718,7 @@ static void iwl_nic_start(struct iwl_priv *priv)
1718struct iwlagn_ucode_capabilities { 1718struct iwlagn_ucode_capabilities {
1719 u32 max_probe_length; 1719 u32 max_probe_length;
1720 u32 standard_phy_calibration_size; 1720 u32 standard_phy_calibration_size;
1721 bool pan;
1721}; 1722};
1722 1723
1723static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context); 1724static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context);
@@ -1955,6 +1956,11 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
1955 capa->max_probe_length = 1956 capa->max_probe_length =
1956 le32_to_cpup((__le32 *)tlv_data); 1957 le32_to_cpup((__le32 *)tlv_data);
1957 break; 1958 break;
1959 case IWL_UCODE_TLV_PAN:
1960 if (tlv_len)
1961 goto invalid_tlv_len;
1962 capa->pan = true;
1963 break;
1958 case IWL_UCODE_TLV_INIT_EVTLOG_PTR: 1964 case IWL_UCODE_TLV_INIT_EVTLOG_PTR:
1959 if (tlv_len != sizeof(u32)) 1965 if (tlv_len != sizeof(u32))
1960 goto invalid_tlv_len; 1966 goto invalid_tlv_len;
@@ -2230,10 +2236,11 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
2230 priv->_agn.inst_evtlog_size = priv->cfg->max_event_log_size; 2236 priv->_agn.inst_evtlog_size = priv->cfg->max_event_log_size;
2231 priv->_agn.inst_errlog_ptr = pieces.inst_errlog_ptr; 2237 priv->_agn.inst_errlog_ptr = pieces.inst_errlog_ptr;
2232 2238
2233 if (priv->valid_contexts == BIT(IWL_RXON_CTX_BSS)) 2239 if (ucode_capa.pan) {
2234 priv->sta_key_max_num = STA_KEY_MAX_NUM; 2240 priv->valid_contexts |= BIT(IWL_RXON_CTX_PAN);
2235 else
2236 priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN; 2241 priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN;
2242 } else
2243 priv->sta_key_max_num = STA_KEY_MAX_NUM;
2237 2244
2238 /* Copy images into buffers for card's bus-master reads ... */ 2245 /* Copy images into buffers for card's bus-master reads ... */
2239 2246
@@ -4226,7 +4233,17 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
4226 priv->contexts[IWL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM; 4233 priv->contexts[IWL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM;
4227 priv->contexts[IWL_RXON_CTX_BSS].ap_sta_id = IWL_AP_ID; 4234 priv->contexts[IWL_RXON_CTX_BSS].ap_sta_id = IWL_AP_ID;
4228 priv->contexts[IWL_RXON_CTX_BSS].wep_key_cmd = REPLY_WEPKEY; 4235 priv->contexts[IWL_RXON_CTX_BSS].wep_key_cmd = REPLY_WEPKEY;
4229 BUILD_BUG_ON(NUM_IWL_RXON_CTX != 1); 4236
4237 priv->contexts[IWL_RXON_CTX_PAN].rxon_cmd = REPLY_WIPAN_RXON;
4238 priv->contexts[IWL_RXON_CTX_PAN].rxon_timing_cmd = REPLY_WIPAN_RXON_TIMING;
4239 priv->contexts[IWL_RXON_CTX_PAN].rxon_assoc_cmd = REPLY_WIPAN_RXON_ASSOC;
4240 priv->contexts[IWL_RXON_CTX_PAN].qos_cmd = REPLY_WIPAN_QOS_PARAM;
4241 priv->contexts[IWL_RXON_CTX_PAN].ap_sta_id = IWL_AP_ID_PAN;
4242 priv->contexts[IWL_RXON_CTX_PAN].wep_key_cmd = REPLY_WIPAN_WEPKEY;
4243 priv->contexts[IWL_RXON_CTX_PAN].bcast_sta_id = IWLAGN_PAN_BCAST_ID;
4244 priv->contexts[IWL_RXON_CTX_PAN].station_flags = STA_FLG_PAN_STATION;
4245
4246 BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2);
4230 4247
4231 SET_IEEE80211_DEV(hw, &pdev->dev); 4248 SET_IEEE80211_DEV(hw, &pdev->dev);
4232 4249