iwm(4): use correct channel list source for Intel 3168

Intel 3168 uses another EEPROM section to store channel flags;
port missing bits from iwlwifi to make it work.

PR:		230750, 236235
Tested by:	Bert JW Regeer <xistence@0x58.com>
MFC after:	3 days
This commit is contained in:
Andriy Voskoboinyk 2019-03-11 08:30:29 +00:00
parent 6daa4a4079
commit 589526906c
4 changed files with 22 additions and 3 deletions

View File

@ -2211,7 +2211,8 @@ iwm_parse_nvm_data(struct iwm_softc *sc,
}
if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) {
memcpy(data->nvm_ch_flags, &nvm_sw[IWM_NVM_CHANNELS],
memcpy(data->nvm_ch_flags, sc->cfg->nvm_type == IWM_NVM_SDP ?
&regulatory[0] : &nvm_sw[IWM_NVM_CHANNELS],
IWM_NUM_CHANNELS * sizeof(uint16_t));
} else {
memcpy(data->nvm_ch_flags, &regulatory[IWM_NVM_CHANNELS_8000],
@ -2271,8 +2272,9 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iwm_nvm_section *sections)
sw = (const uint16_t *)sections[IWM_NVM_SECTION_TYPE_SW].data;
calib = (const uint16_t *)
sections[IWM_NVM_SECTION_TYPE_CALIBRATION].data;
regulatory = (const uint16_t *)
sections[IWM_NVM_SECTION_TYPE_REGULATORY].data;
regulatory = sc->cfg->nvm_type == IWM_NVM_SDP ?
(const uint16_t *)sections[IWM_NVM_SECTION_TYPE_REGULATORY_SDP].data :
(const uint16_t *)sections[IWM_NVM_SECTION_TYPE_REGULATORY].data;
mac_override = (const uint16_t *)
sections[IWM_NVM_SECTION_TYPE_MAC_OVERRIDE].data;
phy_sku = (const uint16_t *)sections[IWM_NVM_SECTION_TYPE_PHY_SKU].data;

View File

@ -119,6 +119,7 @@ const struct iwm_cfg iwm3168_cfg = {
.fw_name = IWM3168_FW,
IWM_DEVICE_7000_COMMON,
.host_interrupt_operation_mode = 0,
.nvm_type = IWM_NVM_SDP,
};
const struct iwm_cfg iwm7265_cfg = {

View File

@ -104,6 +104,19 @@ static inline uint8_t num_of_ant(uint8_t mask)
#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) /* 32 KB */
#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_9000 IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000
/**
* enum iwl_nvm_type - nvm formats
* @IWM_NVM: the regular format
* @IWM_NVM_EXT: extended NVM format
* @IWM_NVM_SDP: NVM format used by 3168 series
*/
enum iwm_nvm_type {
IWM_NVM,
IWM_NVM_EXT,
IWM_NVM_SDP,
};
/**
* struct iwm_cfg
* @name: Official name of the device
@ -113,6 +126,7 @@ static inline uint8_t num_of_ant(uint8_t mask)
* @nvm_hw_section_num: the ID of the HW NVM section
* @apmg_wake_up_wa: should the MAC access REQ be asserted when a command
* is in flight. This is due to a HW bug in 7260, 3160 and 7265.
* @nvm_type: see &enum iwl_nvm_type
*/
struct iwm_cfg {
const char *name;
@ -122,6 +136,7 @@ struct iwm_cfg {
int host_interrupt_operation_mode;
uint8_t nvm_hw_section_num;
int apmg_wake_up_wa;
enum iwm_nvm_type nvm_type;
};
/*

View File

@ -2032,6 +2032,7 @@ enum {
IWM_NVM_SECTION_TYPE_REGULATORY = 3,
IWM_NVM_SECTION_TYPE_CALIBRATION = 4,
IWM_NVM_SECTION_TYPE_PRODUCTION = 5,
IWM_NVM_SECTION_TYPE_REGULATORY_SDP = 8,
IWM_NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
IWM_NVM_SECTION_TYPE_PHY_SKU = 12,
IWM_NVM_MAX_NUM_SECTIONS = 13,