Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8cbb46f authored by Golan Ben Ami's avatar Golan Ben Ami Committed by Luca Coelho
Browse files

iwlwifi: allow different csr flags for different device families



Different device families may have different flag values
for passing a message to the fw (i.e. SW_RESET).
In order to keep the code readable, and avoid conditioning
upon the family, store a value for each flag, which indicates
the bit that needs to be enabled.

Signed-off-by: default avatarGolan Ben Ami <golan.ben.ami@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 0ddcf3e7
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
/******************************************************************************
 *
 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2018 Intel Corporation
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
@@ -27,7 +28,6 @@
#include <linux/module.h>
#include <linux/stringify.h>
#include "iwl-config.h"
#include "iwl-csr.h"
#include "iwl-agn-hw.h"

/* Highest firmware API version supported */
@@ -91,7 +91,8 @@ static const struct iwl_eeprom_params iwl1000_eeprom_params = {
	.base_params = &iwl1000_base_params,			\
	.eeprom_params = &iwl1000_eeprom_params,		\
	.led_mode = IWL_LED_BLINK,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl1000_bgn_cfg = {
	.name = "Intel(R) Centrino(R) Wireless-N 1000 BGN",
@@ -117,7 +118,8 @@ const struct iwl_cfg iwl1000_bg_cfg = {
	.eeprom_params = &iwl1000_eeprom_params,		\
	.led_mode = IWL_LED_RF_STATE,				\
	.rx_with_siso_diversity = true,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl100_bgn_cfg = {
	.name = "Intel(R) Centrino(R) Wireless-N 100 BGN",
+9 −4
Original line number Diff line number Diff line
/******************************************************************************
 *
 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2018 Intel Corporation
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
@@ -115,7 +116,8 @@ static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
	.base_params = &iwl2000_base_params,			\
	.eeprom_params = &iwl20x0_eeprom_params,		\
	.led_mode = IWL_LED_RF_STATE,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1


const struct iwl_cfg iwl2000_2bgn_cfg = {
@@ -142,7 +144,8 @@ const struct iwl_cfg iwl2000_2bgn_d_cfg = {
	.base_params = &iwl2030_base_params,			\
	.eeprom_params = &iwl20x0_eeprom_params,		\
	.led_mode = IWL_LED_RF_STATE,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl2030_2bgn_cfg = {
	.name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
@@ -163,7 +166,8 @@ const struct iwl_cfg iwl2030_2bgn_cfg = {
	.eeprom_params = &iwl20x0_eeprom_params,		\
	.led_mode = IWL_LED_RF_STATE,				\
	.rx_with_siso_diversity = true,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl105_bgn_cfg = {
	.name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
@@ -190,7 +194,8 @@ const struct iwl_cfg iwl105_bgn_d_cfg = {
	.eeprom_params = &iwl20x0_eeprom_params,		\
	.led_mode = IWL_LED_RF_STATE,				\
	.rx_with_siso_diversity = true,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl135_bgn_cfg = {
	.name = "Intel(R) Centrino(R) Wireless-N 135 BGN",
+7 −0
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ const struct iwl_cfg iwl22000_2ac_cfg_hr = {
	.name = "Intel(R) Dual Band Wireless AC 22000",
	.fw_name_pre = IWL_22000_HR_FW_PRE,
	IWL_DEVICE_22000,
	.csr = &iwl_csr_v1,
	.ht_params = &iwl_22000_ht_params,
	.nvm_ver = IWL_22000_NVM_VERSION,
	.nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
@@ -153,6 +154,7 @@ const struct iwl_cfg iwl22000_2ac_cfg_hr_cdb = {
	.name = "Intel(R) Dual Band Wireless AC 22000",
	.fw_name_pre = IWL_22000_HR_CDB_FW_PRE,
	IWL_DEVICE_22000,
	.csr = &iwl_csr_v1,
	.ht_params = &iwl_22000_ht_params,
	.nvm_ver = IWL_22000_NVM_VERSION,
	.nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
@@ -164,6 +166,7 @@ const struct iwl_cfg iwl22000_2ac_cfg_jf = {
	.name = "Intel(R) Dual Band Wireless AC 22000",
	.fw_name_pre = IWL_22000_JF_FW_PRE,
	IWL_DEVICE_22000,
	.csr = &iwl_csr_v1,
	.ht_params = &iwl_22000_ht_params,
	.nvm_ver = IWL_22000_NVM_VERSION,
	.nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
@@ -174,6 +177,7 @@ const struct iwl_cfg iwl22000_2ax_cfg_hr = {
	.name = "Intel(R) Dual Band Wireless AX 22000",
	.fw_name_pre = IWL_22000_HR_FW_PRE,
	IWL_DEVICE_22000,
	.csr = &iwl_csr_v1,
	.ht_params = &iwl_22000_ht_params,
	.nvm_ver = IWL_22000_NVM_VERSION,
	.nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
@@ -184,6 +188,7 @@ const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_f0 = {
	.name = "Intel(R) Dual Band Wireless AX 22000",
	.fw_name_pre = IWL_22000_HR_F0_FW_PRE,
	IWL_DEVICE_22000,
	.csr = &iwl_csr_v1,
	.ht_params = &iwl_22000_ht_params,
	.nvm_ver = IWL_22000_NVM_VERSION,
	.nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
@@ -194,6 +199,7 @@ const struct iwl_cfg iwl22000_2ax_cfg_qnj_jf_b0 = {
	.name = "Intel(R) Dual Band Wireless AX 22000",
	.fw_name_pre = IWL_22000_JF_B0_FW_PRE,
	IWL_DEVICE_22000,
	.csr = &iwl_csr_v1,
	.ht_params = &iwl_22000_ht_params,
	.nvm_ver = IWL_22000_NVM_VERSION,
	.nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
@@ -204,6 +210,7 @@ const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0 = {
	.name = "Intel(R) Dual Band Wireless AX 22000",
	.fw_name_pre = IWL_22000_HR_A0_FW_PRE,
	IWL_DEVICE_22000,
	.csr = &iwl_csr_v1,
	.ht_params = &iwl_22000_ht_params,
	.nvm_ver = IWL_22000_NVM_VERSION,
	.nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
+5 −3
Original line number Diff line number Diff line
/******************************************************************************
 *
 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2018 Intel Corporation
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
@@ -28,7 +29,6 @@
#include <linux/stringify.h>
#include "iwl-config.h"
#include "iwl-agn-hw.h"
#include "iwl-csr.h"

/* Highest firmware API version supported */
#define IWL5000_UCODE_API_MAX 5
@@ -89,7 +89,8 @@ static const struct iwl_eeprom_params iwl5000_eeprom_params = {
	.base_params = &iwl5000_base_params,			\
	.eeprom_params = &iwl5000_eeprom_params,		\
	.led_mode = IWL_LED_BLINK,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl5300_agn_cfg = {
	.name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
@@ -153,7 +154,8 @@ const struct iwl_cfg iwl5350_agn_cfg = {
	.eeprom_params = &iwl5000_eeprom_params,		\
	.led_mode = IWL_LED_BLINK,				\
	.internal_wimax_coex = true,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl5150_agn_cfg = {
	.name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
+13 −6
Original line number Diff line number Diff line
/******************************************************************************
 *
 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2018 Intel Corporation
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
@@ -135,7 +136,8 @@ static const struct iwl_eeprom_params iwl6000_eeprom_params = {
	.base_params = &iwl6000_g2_base_params,			\
	.eeprom_params = &iwl6000_eeprom_params,		\
	.led_mode = IWL_LED_RF_STATE,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl6005_2agn_cfg = {
	.name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
@@ -189,7 +191,8 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
	.base_params = &iwl6000_g2_base_params,			\
	.eeprom_params = &iwl6000_eeprom_params,		\
	.led_mode = IWL_LED_RF_STATE,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl6030_2agn_cfg = {
	.name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
@@ -225,7 +228,8 @@ const struct iwl_cfg iwl6030_2bg_cfg = {
	.base_params = &iwl6000_g2_base_params,			\
	.eeprom_params = &iwl6000_eeprom_params,		\
	.led_mode = IWL_LED_RF_STATE,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl6035_2agn_cfg = {
	.name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
@@ -280,7 +284,8 @@ const struct iwl_cfg iwl130_bg_cfg = {
	.base_params = &iwl6000_base_params,			\
	.eeprom_params = &iwl6000_eeprom_params,		\
	.led_mode = IWL_LED_BLINK,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl6000i_2agn_cfg = {
	.name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
@@ -313,7 +318,8 @@ const struct iwl_cfg iwl6000i_2bg_cfg = {
	.eeprom_params = &iwl6000_eeprom_params,		\
	.led_mode = IWL_LED_BLINK,				\
	.internal_wimax_coex = true,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl6050_2agn_cfg = {
	.name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
@@ -339,7 +345,8 @@ const struct iwl_cfg iwl6050_2abg_cfg = {
	.eeprom_params = &iwl6000_eeprom_params,		\
	.led_mode = IWL_LED_BLINK,				\
	.internal_wimax_coex = true,				\
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
	.csr = &iwl_csr_v1

const struct iwl_cfg iwl6150_bgn_cfg = {
	.name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
Loading