iwlagn: Sanity check for 11n capability
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Mon, 6 Jun 2011 23:28:54 +0000 (16:28 -0700)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Sat, 11 Jun 2011 14:13:15 +0000 (07:13 -0700)
Make sure when we say 11n enable, we really support it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c

index 512d8beb3dfd4c8a6a5a58f62041da5cb0819a1a..7745816eaff443474b4cbdb8ab20781707444985 100644 (file)
@@ -113,6 +113,11 @@ int iwl_eeprom_check_sku(struct iwl_priv *priv)
        if (!priv->cfg->sku) {
                /* not using sku overwrite */
                priv->cfg->sku = iwl_eeprom_query16(priv, EEPROM_SKU_CAP);
+               if (priv->cfg->sku & EEPROM_SKU_CAP_11N_ENABLE &&
+                   !priv->cfg->ht_params) {
+                       IWL_ERR(priv, "Invalid 11n configuration\n");
+                       return -EINVAL;
+               }
        }
        if (!priv->cfg->sku) {
                IWL_ERR(priv, "Invalid device sku\n");