diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index b87085244a72..b32f728ab7c8 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -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 ? + ®ulatory[0] : &nvm_sw[IWM_NVM_CHANNELS], IWM_NUM_CHANNELS * sizeof(uint16_t)); } else { memcpy(data->nvm_ch_flags, ®ulatory[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; diff --git a/sys/dev/iwm/if_iwm_7000.c b/sys/dev/iwm/if_iwm_7000.c index beb2a2e5a3bd..3da0cac2b429 100644 --- a/sys/dev/iwm/if_iwm_7000.c +++ b/sys/dev/iwm/if_iwm_7000.c @@ -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 = { diff --git a/sys/dev/iwm/if_iwm_config.h b/sys/dev/iwm/if_iwm_config.h index 4d8979739686..4768a16f5261 100644 --- a/sys/dev/iwm/if_iwm_config.h +++ b/sys/dev/iwm/if_iwm_config.h @@ -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; }; /* diff --git a/sys/dev/iwm/if_iwmreg.h b/sys/dev/iwm/if_iwmreg.h index c7afcb35ce1c..67f1bbff0f07 100644 --- a/sys/dev/iwm/if_iwmreg.h +++ b/sys/dev/iwm/if_iwmreg.h @@ -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,