Commit dae66d0d authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Wey-Yi Guy
Browse files

iwlwifi: SRAM size moves from hw_params to cfg



This will allow to set the hw_params after we fetch the uCode.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 4a986777
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -128,8 +128,6 @@ static void iwl1000_hw_set_hw_params(struct iwl_priv *priv)
			iwlagn_mod_params.num_of_queues;
			iwlagn_mod_params.num_of_queues;


	hw_params(priv).max_txq_num = cfg(priv)->base_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);
	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_max = IWL1000_UCODE_API_MAX,			\
	.ucode_api_ok = IWL1000_UCODE_API_OK,			\
	.ucode_api_ok = IWL1000_UCODE_API_OK,			\
	.ucode_api_min = IWL1000_UCODE_API_MIN,			\
	.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_ver = EEPROM_1000_EEPROM_VERSION,		\
	.eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION,	\
	.eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION,	\
	.lib = &iwl1000_lib,					\
	.lib = &iwl1000_lib,					\
@@ -213,6 +213,8 @@ struct iwl_cfg iwl1000_bg_cfg = {
	.ucode_api_max = IWL100_UCODE_API_MAX,			\
	.ucode_api_max = IWL100_UCODE_API_MAX,			\
	.ucode_api_ok = IWL100_UCODE_API_OK,			\
	.ucode_api_ok = IWL100_UCODE_API_OK,			\
	.ucode_api_min = IWL100_UCODE_API_MIN,			\
	.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_ver = EEPROM_1000_EEPROM_VERSION,		\
	.eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION,	\
	.eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION,	\
	.lib = &iwl1000_lib,					\
	.lib = &iwl1000_lib,					\
+8 −2
Original line number Original line Diff line number Diff line
@@ -124,8 +124,6 @@ static void iwl2000_hw_set_hw_params(struct iwl_priv *priv)
			iwlagn_mod_params.num_of_queues;
			iwlagn_mod_params.num_of_queues;


	hw_params(priv).max_txq_num = cfg(priv)->base_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);
	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_max = IWL2000_UCODE_API_MAX,			\
	.ucode_api_ok = IWL2000_UCODE_API_OK,			\
	.ucode_api_ok = IWL2000_UCODE_API_OK,			\
	.ucode_api_min = IWL2000_UCODE_API_MIN,			\
	.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_ver = EEPROM_2000_EEPROM_VERSION,		\
	.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,	\
	.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,	\
	.lib = &iwl2000_lib,					\
	.lib = &iwl2000_lib,					\
@@ -266,6 +266,8 @@ struct iwl_cfg iwl2000_2bgn_d_cfg = {
	.ucode_api_max = IWL2030_UCODE_API_MAX,			\
	.ucode_api_max = IWL2030_UCODE_API_MAX,			\
	.ucode_api_ok = IWL2030_UCODE_API_OK,			\
	.ucode_api_ok = IWL2030_UCODE_API_OK,			\
	.ucode_api_min = IWL2030_UCODE_API_MIN,			\
	.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_ver = EEPROM_2000_EEPROM_VERSION,		\
	.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,	\
	.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,	\
	.lib = &iwl2030_lib,					\
	.lib = &iwl2030_lib,					\
@@ -288,6 +290,8 @@ struct iwl_cfg iwl2030_2bgn_cfg = {
	.ucode_api_max = IWL105_UCODE_API_MAX,			\
	.ucode_api_max = IWL105_UCODE_API_MAX,			\
	.ucode_api_ok = IWL105_UCODE_API_OK,			\
	.ucode_api_ok = IWL105_UCODE_API_OK,			\
	.ucode_api_min = IWL105_UCODE_API_MIN,			\
	.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_ver = EEPROM_2000_EEPROM_VERSION,		\
	.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,	\
	.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,	\
	.lib = &iwl2000_lib,					\
	.lib = &iwl2000_lib,					\
@@ -316,6 +320,8 @@ struct iwl_cfg iwl105_bgn_d_cfg = {
	.ucode_api_max = IWL135_UCODE_API_MAX,			\
	.ucode_api_max = IWL135_UCODE_API_MAX,			\
	.ucode_api_ok = IWL135_UCODE_API_OK,			\
	.ucode_api_ok = IWL135_UCODE_API_OK,			\
	.ucode_api_min = IWL135_UCODE_API_MIN,			\
	.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_ver = EEPROM_2000_EEPROM_VERSION,		\
	.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,	\
	.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,	\
	.lib = &iwl2030_lib,					\
	.lib = &iwl2030_lib,					\
+6 −4
Original line number Original line Diff line number Diff line
@@ -170,8 +170,6 @@ static void iwl5000_hw_set_hw_params(struct iwl_priv *priv)
			iwlagn_mod_params.num_of_queues;
			iwlagn_mod_params.num_of_queues;


	hw_params(priv).max_txq_num = cfg(priv)->base_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) |
	hw_params(priv).ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
					BIT(IEEE80211_BAND_5GHZ);
					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;
			iwlagn_mod_params.num_of_queues;


	hw_params(priv).max_txq_num = cfg(priv)->base_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) |
	hw_params(priv).ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
					BIT(IEEE80211_BAND_5GHZ);
					BIT(IEEE80211_BAND_5GHZ);
@@ -352,6 +348,8 @@ static struct iwl_ht_params iwl5000_ht_params = {
	.fw_name_pre = IWL5000_FW_PRE,				\
	.fw_name_pre = IWL5000_FW_PRE,				\
	.ucode_api_max = IWL5000_UCODE_API_MAX,			\
	.ucode_api_max = IWL5000_UCODE_API_MAX,			\
	.ucode_api_min = IWL5000_UCODE_API_MIN,			\
	.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_ver = EEPROM_5000_EEPROM_VERSION,		\
	.eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,	\
	.eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,	\
	.lib = &iwl5000_lib,					\
	.lib = &iwl5000_lib,					\
@@ -395,6 +393,8 @@ struct iwl_cfg iwl5350_agn_cfg = {
	.fw_name_pre = IWL5000_FW_PRE,
	.fw_name_pre = IWL5000_FW_PRE,
	.ucode_api_max = IWL5000_UCODE_API_MAX,
	.ucode_api_max = IWL5000_UCODE_API_MAX,
	.ucode_api_min = IWL5000_UCODE_API_MIN,
	.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_ver = EEPROM_5050_EEPROM_VERSION,
	.eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
	.eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
	.lib = &iwl5000_lib,
	.lib = &iwl5000_lib,
@@ -408,6 +408,8 @@ struct iwl_cfg iwl5350_agn_cfg = {
	.fw_name_pre = IWL5150_FW_PRE,				\
	.fw_name_pre = IWL5150_FW_PRE,				\
	.ucode_api_max = IWL5150_UCODE_API_MAX,			\
	.ucode_api_max = IWL5150_UCODE_API_MAX,			\
	.ucode_api_min = IWL5150_UCODE_API_MIN,			\
	.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_ver = EEPROM_5050_EEPROM_VERSION,		\
	.eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,	\
	.eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,	\
	.lib = &iwl5150_lib,					\
	.lib = &iwl5150_lib,					\
+12 −2
Original line number Original line Diff line number Diff line
@@ -145,8 +145,6 @@ static void iwl6000_hw_set_hw_params(struct iwl_priv *priv)
			iwlagn_mod_params.num_of_queues;
			iwlagn_mod_params.num_of_queues;


	hw_params(priv).max_txq_num = cfg(priv)->base_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) |
	hw_params(priv).ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
					BIT(IEEE80211_BAND_5GHZ);
					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_max = IWL6000G2_UCODE_API_MAX,		\
	.ucode_api_ok = IWL6000G2_UCODE_API_OK,			\
	.ucode_api_ok = IWL6000G2_UCODE_API_OK,			\
	.ucode_api_min = IWL6000G2_UCODE_API_MIN,		\
	.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_ver = EEPROM_6005_EEPROM_VERSION,		\
	.eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION,	\
	.eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION,	\
	.lib = &iwl6000_lib,					\
	.lib = &iwl6000_lib,					\
@@ -388,6 +388,8 @@ struct iwl_cfg iwl6005_2agn_d_cfg = {
	.ucode_api_max = IWL6000G2_UCODE_API_MAX,		\
	.ucode_api_max = IWL6000G2_UCODE_API_MAX,		\
	.ucode_api_ok = IWL6000G2_UCODE_API_OK,			\
	.ucode_api_ok = IWL6000G2_UCODE_API_OK,			\
	.ucode_api_min = IWL6000G2_UCODE_API_MIN,		\
	.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_ver = EEPROM_6030_EEPROM_VERSION,		\
	.eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION,	\
	.eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION,	\
	.lib = &iwl6030_lib,					\
	.lib = &iwl6030_lib,					\
@@ -457,6 +459,8 @@ struct iwl_cfg iwl130_bg_cfg = {
	.ucode_api_max = IWL6000_UCODE_API_MAX,			\
	.ucode_api_max = IWL6000_UCODE_API_MAX,			\
	.ucode_api_ok = IWL6000_UCODE_API_OK,			\
	.ucode_api_ok = IWL6000_UCODE_API_OK,			\
	.ucode_api_min = IWL6000_UCODE_API_MIN,			\
	.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_tx_ant = ANT_BC,		/* .cfg overwrite */	\
	.valid_rx_ant = ANT_BC,		/* .cfg overwrite */	\
	.valid_rx_ant = ANT_BC,		/* .cfg overwrite */	\
	.eeprom_ver = EEPROM_6000_EEPROM_VERSION,		\
	.eeprom_ver = EEPROM_6000_EEPROM_VERSION,		\
@@ -486,6 +490,8 @@ struct iwl_cfg iwl6000i_2bg_cfg = {
	.fw_name_pre = IWL6050_FW_PRE,				\
	.fw_name_pre = IWL6050_FW_PRE,				\
	.ucode_api_max = IWL6050_UCODE_API_MAX,			\
	.ucode_api_max = IWL6050_UCODE_API_MAX,			\
	.ucode_api_min = IWL6050_UCODE_API_MIN,			\
	.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_tx_ant = ANT_AB,		/* .cfg overwrite */	\
	.valid_rx_ant = ANT_AB,		/* .cfg overwrite */	\
	.valid_rx_ant = ANT_AB,		/* .cfg overwrite */	\
	.lib = &iwl6000_lib,					\
	.lib = &iwl6000_lib,					\
@@ -511,6 +517,8 @@ struct iwl_cfg iwl6050_2abg_cfg = {
	.fw_name_pre = IWL6050_FW_PRE,				\
	.fw_name_pre = IWL6050_FW_PRE,				\
	.ucode_api_max = IWL6050_UCODE_API_MAX,			\
	.ucode_api_max = IWL6050_UCODE_API_MAX,			\
	.ucode_api_min = IWL6050_UCODE_API_MIN,			\
	.ucode_api_min = IWL6050_UCODE_API_MIN,			\
	.max_inst_size = IWL60_RTC_INST_SIZE,			\
	.max_data_size = IWL60_RTC_DATA_SIZE,			\
	.lib = &iwl6000_lib,					\
	.lib = &iwl6000_lib,					\
	.additional_nic_config = iwl6150_additional_nic_config,	\
	.additional_nic_config = iwl6150_additional_nic_config,	\
	.eeprom_ver = EEPROM_6150_EEPROM_VERSION,		\
	.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_max = IWL6000_UCODE_API_MAX,
	.ucode_api_ok = IWL6000_UCODE_API_OK,
	.ucode_api_ok = IWL6000_UCODE_API_OK,
	.ucode_api_min = IWL6000_UCODE_API_MIN,
	.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_ver = EEPROM_6000_EEPROM_VERSION,
	.eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
	.eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
	.lib = &iwl6000_lib,
	.lib = &iwl6000_lib,
+4 −4
Original line number Original line Diff line number Diff line
@@ -173,8 +173,6 @@ struct iwl_mod_params {
 * @ht40_channel: is 40MHz width possible: BIT(IEEE80211_BAND_XXX)
 * @ht40_channel: is 40MHz width possible: BIT(IEEE80211_BAND_XXX)
 * @sku: sku read from EEPROM
 * @sku: sku read from EEPROM
 * @rx_page_order: Rx buffer page order
 * @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_threshold: temperature threshold - in hw dependent unit
 * @ct_kill_exit_threshold: when to reeable the device - in hw dependent unit
 * @ct_kill_exit_threshold: when to reeable the device - in hw dependent unit
 *	relevant for 1000, 6000 and up
 *	relevant for 1000, 6000 and up
@@ -192,8 +190,6 @@ struct iwl_hw_params {
	bool shadow_reg_enable;
	bool shadow_reg_enable;
	u16 sku;
	u16 sku;
	u32 rx_page_order;
	u32 rx_page_order;
	u32 max_inst_size;
	u32 max_data_size;
	u32 ct_kill_threshold;
	u32 ct_kill_threshold;
	u32 ct_kill_exit_threshold;
	u32 ct_kill_exit_threshold;
	unsigned int wd_timeout;
	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
 * @ucode_api_ok: oldest version of the uCode API that is OK to load
 *	without a warning, for use in transitions
 *	without a warning, for use in transitions
 * @ucode_api_min: Lowest version of uCode API supported by driver.
 * @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_tx_ant: valid transmit antenna
 * @valid_rx_ant: valid receive antenna
 * @valid_rx_ant: valid receive antenna
 * @sku: sku information from EEPROM
 * @sku: sku information from EEPROM
@@ -320,6 +318,8 @@ struct iwl_cfg {
	const unsigned int ucode_api_max;
	const unsigned int ucode_api_max;
	const unsigned int ucode_api_ok;
	const unsigned int ucode_api_ok;
	const unsigned int ucode_api_min;
	const unsigned int ucode_api_min;
	const u32 max_data_size;
	const u32 max_inst_size;
	u8   valid_tx_ant;
	u8   valid_tx_ant;
	u8   valid_rx_ant;
	u8   valid_rx_ant;
	u16  sku;
	u16  sku;
Loading