aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-11-10 16:32:59 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-11-16 10:47:10 -0500
commit21a5b3c6b19a8b8972ccdd55389be28a8b7c9180 (patch)
tree4c96bbe4405cab9ac87cc9afd5d782705039f270 /drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
parentf4115d46599464a49a3055d33d499d97ac81fccb (diff)
iwlagn: use SKU information in the EEPROM
EEPROM contain the SKU information for the device, use it. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
index a650baba0809..8a4d3acb9b79 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
@@ -248,6 +248,27 @@ err:
248 248
249} 249}
250 250
251int iwl_eeprom_check_sku(struct iwl_priv *priv)
252{
253 u16 eeprom_sku;
254
255 eeprom_sku = iwl_eeprom_query16(priv, EEPROM_SKU_CAP);
256
257 priv->cfg->sku = ((eeprom_sku & EEPROM_SKU_CAP_BAND_SELECTION) >>
258 EEPROM_SKU_CAP_BAND_POS);
259 if (eeprom_sku & EEPROM_SKU_CAP_11N_ENABLE)
260 priv->cfg->sku |= IWL_SKU_N;
261
262 if (!priv->cfg->sku) {
263 IWL_ERR(priv, "Invalid device sku\n");
264 return -EINVAL;
265 }
266
267 IWL_INFO(priv, "Device SKU: 0X%x\n", priv->cfg->sku);
268
269 return 0;
270}
271
251void iwl_eeprom_get_mac(const struct iwl_priv *priv, u8 *mac) 272void iwl_eeprom_get_mac(const struct iwl_priv *priv, u8 *mac)
252{ 273{
253 const u8 *addr = priv->cfg->ops->lib->eeprom_ops.query_addr(priv, 274 const u8 *addr = priv->cfg->ops->lib->eeprom_ops.query_addr(priv,