iwlwifi: SRAM size moves from hw_params to cfg
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 7 Feb 2012 10:56:26 +0000 (12:56 +0200)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 17 Feb 2012 18:58:19 +0000 (10:58 -0800)
This will allow to set the hw_params after we fetch the uCode.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-1000.c
drivers/net/wireless/iwlwifi/iwl-2000.c
drivers/net/wireless/iwlwifi/iwl-5000.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-shared.h
drivers/net/wireless/iwlwifi/iwl-ucode.c

index 91c4a72da8d761d90662709b48702653f752c35f..605ee3df1d82dffd1db92ffd9bfbb90a7bd80104 100644 (file)
@@ -128,8 +128,6 @@ static void iwl1000_hw_set_hw_params(struct iwl_priv *priv)
                        iwlagn_mod_params.num_of_queues;
 
        hw_params(priv).max_txq_num = cfg(priv)->base_params->num_of_queues;
-       hw_params(priv).max_data_size = IWLAGN_RTC_DATA_SIZE;
-       hw_params(priv).max_inst_size = IWLAGN_RTC_INST_SIZE;
 
        hw_params(priv).ht40_channel =  BIT(IEEE80211_BAND_2GHZ);
 
@@ -191,6 +189,8 @@ static struct iwl_ht_params iwl1000_ht_params = {
        .ucode_api_max = IWL1000_UCODE_API_MAX,                 \
        .ucode_api_ok = IWL1000_UCODE_API_OK,                   \
        .ucode_api_min = IWL1000_UCODE_API_MIN,                 \
+       .max_inst_size = IWLAGN_RTC_INST_SIZE,                  \
+       .max_data_size = IWLAGN_RTC_DATA_SIZE,                  \
        .eeprom_ver = EEPROM_1000_EEPROM_VERSION,               \
        .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION,       \
        .lib = &iwl1000_lib,                                    \
@@ -213,6 +213,8 @@ struct iwl_cfg iwl1000_bg_cfg = {
        .ucode_api_max = IWL100_UCODE_API_MAX,                  \
        .ucode_api_ok = IWL100_UCODE_API_OK,                    \
        .ucode_api_min = IWL100_UCODE_API_MIN,                  \
+       .max_inst_size = IWLAGN_RTC_INST_SIZE,                  \
+       .max_data_size = IWLAGN_RTC_DATA_SIZE,                  \
        .eeprom_ver = EEPROM_1000_EEPROM_VERSION,               \
        .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION,       \
        .lib = &iwl1000_lib,                                    \
index 75f0e5088662f7902a1ab8dcc11754259e9897c9..e6e8c79a80d8e731f7bc624b695dafeb8e1f3967 100644 (file)
@@ -124,8 +124,6 @@ static void iwl2000_hw_set_hw_params(struct iwl_priv *priv)
                        iwlagn_mod_params.num_of_queues;
 
        hw_params(priv).max_txq_num = cfg(priv)->base_params->num_of_queues;
-       hw_params(priv).max_data_size = IWL60_RTC_DATA_SIZE;
-       hw_params(priv).max_inst_size = IWL60_RTC_INST_SIZE;
 
        hw_params(priv).ht40_channel =  BIT(IEEE80211_BAND_2GHZ);
 
@@ -240,6 +238,8 @@ static struct iwl_bt_params iwl2030_bt_params = {
        .ucode_api_max = IWL2000_UCODE_API_MAX,                 \
        .ucode_api_ok = IWL2000_UCODE_API_OK,                   \
        .ucode_api_min = IWL2000_UCODE_API_MIN,                 \
+       .max_inst_size = IWL60_RTC_INST_SIZE,                   \
+       .max_data_size = IWL60_RTC_DATA_SIZE,                   \
        .eeprom_ver = EEPROM_2000_EEPROM_VERSION,               \
        .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,       \
        .lib = &iwl2000_lib,                                    \
@@ -266,6 +266,8 @@ struct iwl_cfg iwl2000_2bgn_d_cfg = {
        .ucode_api_max = IWL2030_UCODE_API_MAX,                 \
        .ucode_api_ok = IWL2030_UCODE_API_OK,                   \
        .ucode_api_min = IWL2030_UCODE_API_MIN,                 \
+       .max_inst_size = IWL60_RTC_INST_SIZE,                   \
+       .max_data_size = IWL60_RTC_DATA_SIZE,                   \
        .eeprom_ver = EEPROM_2000_EEPROM_VERSION,               \
        .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,       \
        .lib = &iwl2030_lib,                                    \
@@ -288,6 +290,8 @@ struct iwl_cfg iwl2030_2bgn_cfg = {
        .ucode_api_max = IWL105_UCODE_API_MAX,                  \
        .ucode_api_ok = IWL105_UCODE_API_OK,                    \
        .ucode_api_min = IWL105_UCODE_API_MIN,                  \
+       .max_inst_size = IWL60_RTC_INST_SIZE,                   \
+       .max_data_size = IWL60_RTC_DATA_SIZE,                   \
        .eeprom_ver = EEPROM_2000_EEPROM_VERSION,               \
        .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,       \
        .lib = &iwl2000_lib,                                    \
@@ -316,6 +320,8 @@ struct iwl_cfg iwl105_bgn_d_cfg = {
        .ucode_api_max = IWL135_UCODE_API_MAX,                  \
        .ucode_api_ok = IWL135_UCODE_API_OK,                    \
        .ucode_api_min = IWL135_UCODE_API_MIN,                  \
+       .max_inst_size = IWL60_RTC_INST_SIZE,                   \
+       .max_data_size = IWL60_RTC_DATA_SIZE,                   \
        .eeprom_ver = EEPROM_2000_EEPROM_VERSION,               \
        .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,       \
        .lib = &iwl2030_lib,                                    \
index 458e6778c72f9e79bd4f108760b7865354758ced..1527dec7a26706d714f46619b44449c796ee0e59 100644 (file)
@@ -170,8 +170,6 @@ static void iwl5000_hw_set_hw_params(struct iwl_priv *priv)
                        iwlagn_mod_params.num_of_queues;
 
        hw_params(priv).max_txq_num = cfg(priv)->base_params->num_of_queues;
-       hw_params(priv).max_data_size = IWLAGN_RTC_DATA_SIZE;
-       hw_params(priv).max_inst_size = IWLAGN_RTC_INST_SIZE;
 
        hw_params(priv).ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
                                        BIT(IEEE80211_BAND_5GHZ);
@@ -195,8 +193,6 @@ static void iwl5150_hw_set_hw_params(struct iwl_priv *priv)
                        iwlagn_mod_params.num_of_queues;
 
        hw_params(priv).max_txq_num = cfg(priv)->base_params->num_of_queues;
-       hw_params(priv).max_data_size = IWLAGN_RTC_DATA_SIZE;
-       hw_params(priv).max_inst_size = IWLAGN_RTC_INST_SIZE;
 
        hw_params(priv).ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
                                        BIT(IEEE80211_BAND_5GHZ);
@@ -352,6 +348,8 @@ static struct iwl_ht_params iwl5000_ht_params = {
        .fw_name_pre = IWL5000_FW_PRE,                          \
        .ucode_api_max = IWL5000_UCODE_API_MAX,                 \
        .ucode_api_min = IWL5000_UCODE_API_MIN,                 \
+       .max_inst_size = IWLAGN_RTC_INST_SIZE,                  \
+       .max_data_size = IWLAGN_RTC_DATA_SIZE,                  \
        .eeprom_ver = EEPROM_5000_EEPROM_VERSION,               \
        .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,       \
        .lib = &iwl5000_lib,                                    \
@@ -395,6 +393,8 @@ struct iwl_cfg iwl5350_agn_cfg = {
        .fw_name_pre = IWL5000_FW_PRE,
        .ucode_api_max = IWL5000_UCODE_API_MAX,
        .ucode_api_min = IWL5000_UCODE_API_MIN,
+       .max_inst_size = IWLAGN_RTC_INST_SIZE,
+       .max_data_size = IWLAGN_RTC_DATA_SIZE,
        .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
        .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
        .lib = &iwl5000_lib,
@@ -408,6 +408,8 @@ struct iwl_cfg iwl5350_agn_cfg = {
        .fw_name_pre = IWL5150_FW_PRE,                          \
        .ucode_api_max = IWL5150_UCODE_API_MAX,                 \
        .ucode_api_min = IWL5150_UCODE_API_MIN,                 \
+       .max_inst_size = IWLAGN_RTC_INST_SIZE,                  \
+       .max_data_size = IWLAGN_RTC_DATA_SIZE,                  \
        .eeprom_ver = EEPROM_5050_EEPROM_VERSION,               \
        .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,       \
        .lib = &iwl5150_lib,                                    \
index 19e41037f61e6ace731d24c1ec690b6ce5c5baa0..1e6fbf4fcb46cbdc865d486a7fb62a5a113efe6e 100644 (file)
@@ -145,8 +145,6 @@ static void iwl6000_hw_set_hw_params(struct iwl_priv *priv)
                        iwlagn_mod_params.num_of_queues;
 
        hw_params(priv).max_txq_num = cfg(priv)->base_params->num_of_queues;
-       hw_params(priv).max_data_size = IWL60_RTC_DATA_SIZE;
-       hw_params(priv).max_inst_size = IWL60_RTC_INST_SIZE;
 
        hw_params(priv).ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
                                        BIT(IEEE80211_BAND_5GHZ);
@@ -348,6 +346,8 @@ static struct iwl_bt_params iwl6000_bt_params = {
        .ucode_api_max = IWL6000G2_UCODE_API_MAX,               \
        .ucode_api_ok = IWL6000G2_UCODE_API_OK,                 \
        .ucode_api_min = IWL6000G2_UCODE_API_MIN,               \
+       .max_inst_size = IWL60_RTC_INST_SIZE,                   \
+       .max_data_size = IWL60_RTC_DATA_SIZE,                   \
        .eeprom_ver = EEPROM_6005_EEPROM_VERSION,               \
        .eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION,       \
        .lib = &iwl6000_lib,                                    \
@@ -388,6 +388,8 @@ struct iwl_cfg iwl6005_2agn_d_cfg = {
        .ucode_api_max = IWL6000G2_UCODE_API_MAX,               \
        .ucode_api_ok = IWL6000G2_UCODE_API_OK,                 \
        .ucode_api_min = IWL6000G2_UCODE_API_MIN,               \
+       .max_inst_size = IWL60_RTC_INST_SIZE,                   \
+       .max_data_size = IWL60_RTC_DATA_SIZE,                   \
        .eeprom_ver = EEPROM_6030_EEPROM_VERSION,               \
        .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION,       \
        .lib = &iwl6030_lib,                                    \
@@ -457,6 +459,8 @@ struct iwl_cfg iwl130_bg_cfg = {
        .ucode_api_max = IWL6000_UCODE_API_MAX,                 \
        .ucode_api_ok = IWL6000_UCODE_API_OK,                   \
        .ucode_api_min = IWL6000_UCODE_API_MIN,                 \
+       .max_inst_size = IWL60_RTC_INST_SIZE,                   \
+       .max_data_size = IWL60_RTC_DATA_SIZE,                   \
        .valid_tx_ant = ANT_BC,         /* .cfg overwrite */    \
        .valid_rx_ant = ANT_BC,         /* .cfg overwrite */    \
        .eeprom_ver = EEPROM_6000_EEPROM_VERSION,               \
@@ -486,6 +490,8 @@ struct iwl_cfg iwl6000i_2bg_cfg = {
        .fw_name_pre = IWL6050_FW_PRE,                          \
        .ucode_api_max = IWL6050_UCODE_API_MAX,                 \
        .ucode_api_min = IWL6050_UCODE_API_MIN,                 \
+       .max_inst_size = IWL60_RTC_INST_SIZE,                   \
+       .max_data_size = IWL60_RTC_DATA_SIZE,                   \
        .valid_tx_ant = ANT_AB,         /* .cfg overwrite */    \
        .valid_rx_ant = ANT_AB,         /* .cfg overwrite */    \
        .lib = &iwl6000_lib,                                    \
@@ -511,6 +517,8 @@ struct iwl_cfg iwl6050_2abg_cfg = {
        .fw_name_pre = IWL6050_FW_PRE,                          \
        .ucode_api_max = IWL6050_UCODE_API_MAX,                 \
        .ucode_api_min = IWL6050_UCODE_API_MIN,                 \
+       .max_inst_size = IWL60_RTC_INST_SIZE,                   \
+       .max_data_size = IWL60_RTC_DATA_SIZE,                   \
        .lib = &iwl6000_lib,                                    \
        .additional_nic_config = iwl6150_additional_nic_config, \
        .eeprom_ver = EEPROM_6150_EEPROM_VERSION,               \
@@ -536,6 +544,8 @@ struct iwl_cfg iwl6000_3agn_cfg = {
        .ucode_api_max = IWL6000_UCODE_API_MAX,
        .ucode_api_ok = IWL6000_UCODE_API_OK,
        .ucode_api_min = IWL6000_UCODE_API_MIN,
+       .max_inst_size = IWL60_RTC_INST_SIZE,
+       .max_data_size = IWL60_RTC_DATA_SIZE,
        .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
        .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
        .lib = &iwl6000_lib,
index 8c6fc6e207684582e0cc1e3bb8292707e52a8688..f810b41db9dfba0a27cdca623589ec83f165fc37 100644 (file)
@@ -173,8 +173,6 @@ struct iwl_mod_params {
  * @ht40_channel: is 40MHz width possible: BIT(IEEE80211_BAND_XXX)
  * @sku: sku read from EEPROM
  * @rx_page_order: Rx buffer page order
- * @max_inst_size: for ucode use
- * @max_data_size: for ucode use
  * @ct_kill_threshold: temperature threshold - in hw dependent unit
  * @ct_kill_exit_threshold: when to reeable the device - in hw dependent unit
  *     relevant for 1000, 6000 and up
@@ -192,8 +190,6 @@ struct iwl_hw_params {
        bool shadow_reg_enable;
        u16 sku;
        u32 rx_page_order;
-       u32 max_inst_size;
-       u32 max_data_size;
        u32 ct_kill_threshold;
        u32 ct_kill_exit_threshold;
        unsigned int wd_timeout;
@@ -283,6 +279,8 @@ enum iwl_led_mode {
  * @ucode_api_ok: oldest version of the uCode API that is OK to load
  *     without a warning, for use in transitions
  * @ucode_api_min: Lowest version of uCode API supported by driver.
+ * @max_inst_size: The maximal length of the fw inst section
+ * @max_data_size: The maximal length of the fw data section
  * @valid_tx_ant: valid transmit antenna
  * @valid_rx_ant: valid receive antenna
  * @sku: sku information from EEPROM
@@ -320,6 +318,8 @@ struct iwl_cfg {
        const unsigned int ucode_api_max;
        const unsigned int ucode_api_ok;
        const unsigned int ucode_api_min;
+       const u32 max_data_size;
+       const u32 max_inst_size;
        u8   valid_tx_ant;
        u8   valid_rx_ant;
        u16  sku;
index 9e21fc15c5f83fa1b5a886ec8cb727cbb6060e0c..61c6c0568c1101d1e69dbfd6717cb80d090b0db9 100644 (file)
@@ -1135,25 +1135,25 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
                       pieces.init_data_size);
 
        /* Verify that uCode images will fit in card's SRAM */
-       if (pieces.inst_size > hw_params(nic).max_inst_size) {
+       if (pieces.inst_size > cfg->max_inst_size) {
                IWL_ERR(nic, "uCode instr len %Zd too large to fit in\n",
                        pieces.inst_size);
                goto try_again;
        }
 
-       if (pieces.data_size > hw_params(nic).max_data_size) {
+       if (pieces.data_size > cfg->max_data_size) {
                IWL_ERR(nic, "uCode data len %Zd too large to fit in\n",
                        pieces.data_size);
                goto try_again;
        }
 
-       if (pieces.init_size > hw_params(nic).max_inst_size) {
+       if (pieces.init_size > cfg->max_inst_size) {
                IWL_ERR(nic, "uCode init instr len %Zd too large to fit in\n",
                        pieces.init_size);
                goto try_again;
        }
 
-       if (pieces.init_data_size > hw_params(nic).max_data_size) {
+       if (pieces.init_data_size > cfg->max_data_size) {
                IWL_ERR(nic, "uCode init data len %Zd too large to fit in\n",
                        pieces.init_data_size);
                goto try_again;