iwlwifi: mvm: fix bug with OTP memory size
authorEran Harary <eran.harary@intel.com>
Tue, 22 Apr 2014 07:47:48 +0000 (10:47 +0300)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 6 May 2014 17:40:01 +0000 (20:40 +0300)
OTP size changed in family 7000 and in family 8000.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/iwl-7000.c
drivers/net/wireless/iwlwifi/iwl-8000.c
drivers/net/wireless/iwlwifi/iwl-agn-hw.h
drivers/net/wireless/iwlwifi/iwl-config.h
drivers/net/wireless/iwlwifi/mvm/nvm.c

index f73de239cdc112d09f0f65097063a59bd9378bca..48730064da73f5e1e058f756d9473a2a0a5bc376 100644 (file)
@@ -98,7 +98,7 @@
 #define NVM_HW_SECTION_NUM_FAMILY_7000         0
 
 static const struct iwl_base_params iwl7000_base_params = {
-       .eeprom_size = OTP_LOW_IMAGE_SIZE,
+       .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_7000,
        .num_of_queues = IWLAGN_NUM_QUEUES,
        .pll_cfg_val = 0,
        .shadow_ram_support = true,
index f5bd82b885929a8c1188dc44ffdd27892dc2739b..b26b68ce8205bcc4b2259b42835988c5bd750ad6 100644 (file)
@@ -85,7 +85,7 @@
 #define NVM_HW_SECTION_NUM_FAMILY_8000         10
 
 static const struct iwl_base_params iwl8000_base_params = {
-       .eeprom_size = OTP_LOW_IMAGE_SIZE,
+       .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_8000,
        .num_of_queues = IWLAGN_NUM_QUEUES,
        .pll_cfg_val = 0,
        .shadow_ram_support = true,
index 7f37fb86837b7a46569ba74f90df0a7bdb8d0271..04a483d386592c4cf359d741328844b2c0f02e51 100644 (file)
 
 /* EEPROM */
 #define IWLAGN_EEPROM_IMG_SIZE         2048
-/* OTP */
-/* lower blocks contain EEPROM image and calibration data */
-#define OTP_LOW_IMAGE_SIZE             (2 * 512 * sizeof(u16)) /* 2 KB */
+
 /* high blocks contain PAPD data */
 #define OTP_HIGH_IMAGE_SIZE_6x00        (6 * 512 * sizeof(u16)) /* 6 KB */
 #define OTP_HIGH_IMAGE_SIZE_1000        (0x200 * sizeof(u16)) /* 1024 bytes */
index 7ce82d9c72226d7ee2e76a3d9a3f0426df1cbf25..b73eac9428a76016353f4dddaa3203161b18360c 100644 (file)
@@ -193,6 +193,11 @@ struct iwl_ht_params {
 #define EEPROM_6000_REG_BAND_24_HT40_CHANNELS  0x80
 #define EEPROM_REGULATORY_BAND_NO_HT40         0
 
+/* lower blocks contain EEPROM image and calibration data */
+#define OTP_LOW_IMAGE_SIZE             (2 * 512 * sizeof(u16)) /* 2 KB */
+#define OTP_LOW_IMAGE_SIZE_FAMILY_7000 (4 * 512 * sizeof(u16)) /* 4 KB */
+#define OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(u16)) /* 32 KB */
+
 struct iwl_eeprom_params {
        const u8 regulatory_bands[7];
        bool enhanced_txpower;
index cf2d09f53782b0227f9a47d9a8761af8b5ea7ffe..4092422cb8498ea751b4c61f490e962d8369dba4 100644 (file)
@@ -463,7 +463,6 @@ int iwl_nvm_init(struct iwl_mvm *mvm)
                /* Read From FW NVM */
                IWL_DEBUG_EEPROM(mvm->trans->dev, "Read from NVM\n");
 
-               /* TODO: find correct NVM max size for a section */
                nvm_buffer = kmalloc(mvm->cfg->base_params->eeprom_size,
                                     GFP_KERNEL);
                if (!nvm_buffer)