summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
AgeCommit message (Collapse)Author
2020-04-21iwlwifi: mvm: Do not declare support for ACK Enabled AggregationIlan Peer
As this was not supposed to be enabled to begin with. Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/iwlwifi.20200417100405.53dbc3c6c36b.Idfe118546b92cc31548b2211472a5303c7de5909@changeid
2020-03-27iwlwifi: pass trans and NVM data to HE capability parsingJohannes Berg
We'll need this data in the future, pass the values. Change-Id: Iaeff50716e783f5c0bcea86ca1c93ada1560525e Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-01-27Merge tag 'wireless-drivers-next-2020-01-26' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for v5.6 Second set of patches for v5.6. Nothing special standing out, smaller new features and fixes allover. Major changes: ar5523 * add support for SMCWUSBT-G2 USB device iwlwifi * support new versions of the FTM FW APIs * support new version of the beacon template FW API * print some extra information when the driver is loaded rtw88 * support wowlan feature for 8822c * add support for WIPHY_WOWLAN_NET_DETECT brcmfmac * add initial support for monitor mode qtnfmac * add module parameter to enable DFS offloading in firmware * add support for STA HE rates * add support for TWT responder and spatial reuse ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-12-24iwlwifi: remove lar_disable module parameterLuca Coelho
This is an old parameter that was used supposed to be used only when LAR was still under development. It should not be used anymore, but, since it's available, end-users have been mangling with it unnecessarily. In some cases it can cause problems because when LAR is supported the driver and the firmware do not expect it to be disabled. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-12-23iwlwifi: remove CSR registers abstractionLuca Coelho
We needed this abstraction for some CSR registers for IWL_DEVICE_22560, but that has been removed, so we don't need the abstraction anymore. Remove it. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-12-23iwlwifi: Don't ignore the cap field upon mcc updateHaim Dreyfuss
When receiving a new MCC driver get all the data about the new country code and its regulatory information. Mistakenly, we ignored the cap field, which includes global regulatory information which should be applies to every channel. Fix it. Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-11-15iwlwifi: nvm: update iwl_uhb_nvm_channelsTova Mussai
Change the UHB channels to start from 1 to match the specs (11ax Draft 5.0). Signed-off-by: Tova Mussai <tova.mussai@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-25iwlwifi: nvm: create function to convert channel index to nl80211_bandTova Mussai
Create function to convert channel index to nl80211_band and use it. Signed-off-by: Tova Mussai <tova.mussai@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: always access the trans configuration via transLuca Coelho
Stop accessing the trans configuration via the iwl_cfg structure and always access it via the iwl_trans structure. This completes the requirements to disassociate the trans-specific configuration from the rest of the configuration. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: pass the iwl_trans instead of cfg to some functionsShaul Triebitz
A few functions were receiving the iwl_cfg struct directly, but we will also need other parts of the trans, so pass the trans (which includes the cfg) to them. Signed-off-by: Ido Yariv <idox.yariv@intel.com> Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: add a pointer to the trans_cfg directly in transLuca Coelho
Add a pointer to the iwl_trans structure and point it to the trans part of the cfg. This is the first step in disassociating the trans configuration from the rest of the configuration. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: separate elements from cfg that are needed by trans_allocLuca Coelho
In order to be able to select the cfg depending on the HW revision or on the RF ID, we need to set up the trans before selecting the cfg. To do so, move the elements from cfg that are needed by iwl_trans_alloc() to a separate struct at the top of the cfg, so it can be used by other cfg types as well, before selecting the rest of the configuration. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: allocate bigger nvm data in case of UHBTova Mussai
In case of Ultra-high-band (UHB), need to allocate nvm data structure in size of UHB channels array. Signed-off-by: Tova Mussai <tova.mussai@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: remove unused regdb_ptrs allocationHaim Dreyfuss
regdb_ptrs is not in used anymore, remove it. Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-29iwlwifi: Use correct channel_profile iniwl_get_nvmYueHaibing
commit 2785ce008e3b ("iwlwifi: support new NVM response API") seems forgot use correct channel_profile in iwl_get_nvm when call iwl_init_sbands(). Fixes: 2785ce008e3b ("iwlwifi: support new NVM response API") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-03iwlwifi: trust calling functionShaul Triebitz
When initializing or overriding HE band capabilities, no need to check the band validity. Trust the calling function to use a valid band. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: remove unnecessary goto out in iwl_parse_nvm_mcc_info()Luca Coelho
This goto out was unnecessary because the out label was immediately below it. Remove it. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: Use struct_size() in kzallocYueHaibing
Use struct_size() in kzalloc instead of the 'regd_to_copy' Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: support new NVM response APIShaul Triebitz
Support REGULATORY_NVM_GET_INFO_RSP_API_S_VER_4. This API adds the new 6-7GHz channels. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: add support for 6-7 GHz channelsShaul Triebitz
Add UHB (ultra high band) channels and use 16 bit variables to fit the new channels. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-22Merge tag 'wireless-drivers-next-for-davem-2019-02-22' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for 5.1 Most likely the last set of patches for 5.1. WPA3 support to ath10k and qtnfmac. FTM support to iwlwifi and ath10k. And of course other new features and bugfixes. wireless-drivers was merged due to dependency in mt76. Major changes: iwlwifi * HE radiotap * FTM (Fine Timing Measurement) initiator and responder implementation * bump supported firmware API to 46 * VHT extended NSS support * new PCI IDs for 9260 and 22000 series ath10k * change QMI interface to support the new (and backwards incompatible) interface from HL3.1 and used in recent HL2.0 branch firmware releases * support WPA3 with WCN3990 * support for mac80211 airtime fairness based on transmit rate estimation, the firmware needs to support WMI_SERVICE_PEER_STATS to enable this * report transmit airtime to mac80211 with firmwares having WMI_SERVICE_REPORT_AIRTIME feature, this to have more accurate airtime fairness based on real transmit time (instead of just estimated from transmit rate) * support Fine Timing Measurement (FTM) responder role * add dynamic VLAN support with firmware having WMI_SERVICE_PER_PACKET_SW_ENCRYPT * switch to use SPDX license identifiers ath * add new country codes for US brcmfmac * support monitor frames with the hardware/ucode header qtnfmac * enable WPA3 SAE and OWE support mt76 * beacon support for USB devices (mesh+ad-hoc only) rtlwifi * convert to use SPDX license identifiers libertas_tf * get the MAC address before registering the device ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-02-22Merge remote-tracking branch 'net-next/master' into mac80211-nextJohannes Berg
Merge net-next to resolve a conflict and to get the mac80211 rhashtable fixes so further patches can be applied on top. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-02-22mac80211: update HE IEs to D3.3Liad Kaufman
Update element names and new fields according to D3.3 of the HE spec. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-02-20iwlwifi: nvm-parse: advertise IEEE80211_VHT_EXT_NSS_BW_CAPABLE in VHTJohannes Berg
We support this, so we should advertise it. In fact, if we don't, mac80211 will do it for us (as we advertise SUPPORTS_VHT_EXT_NSS_BW to it), but that requires a memory reallocation which is wasteful: ieee80211 phy0: copying sband (band 1) due to VHT EXT NSS BW flag Set the flag here to avoid that. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-20iwlwifi: nvm-parse: use struct_size() in kzalloc()Gustavo A. R. Silva
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; void *entry[]; }; instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL); This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-14iwlwifi: do not fail on large amount of channelsShaul Triebitz
Until supporting UHB (ultra high band) channels for devices AX210, do not fail if number of channels reported by firmware is greater than NL80211_MAX_SUPP_REG_RULES. The Driver in that case will use only the non-UHB channels. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25iwlwifi: use kmemdup in iwl_parse_nvm_mcc_info()YueHaibing
Use kmemdup rather than duplicating its implementation in iwl_parse_nvm_mcc_info(). Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25iwlwifi: mvm: advertise support for TWT in the Extended Capability IEEmmanuel Grumbach
We want to advertise support for TWT in the Extended Capability IE. Since we don't want to set the bits for all the interface types, define an interface specific configuration. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-12-20iwlwifi: mvm: set TWT responder capability bit in 11AX SoftAP modeEmmanuel Grumbach
This is needed to test TWT requester on the client side. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-12-20iwlwifi: split HE capabilities between AP and STAShaul Triebitz
HE capabilities differ between AP and STA. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-10-06iwlwifi: nvm: get num of hw addresses from firmwareNaftali Goldstein
With NICs that don't read the NVM directly and instead rely on getting the relevant data from the firmware, the number of reserved MAC addresses was not added to the API. This caused the driver to assume there is only one address which results in all interfaces getting the same address. Update the API to fix this. While at it, fix-up the comments with firmware api names to actually match what we have in the firmware. Fixes: e9e1ba3dbf00 ("iwlwifi: mvm: support getting nvm data from firmware") Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-10-02Merge tag 'wireless-drivers-next-for-davem-2018-10-02' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for 4.20 First set of new features for 4.20. mt76 driver is going through major refactoring and that's why there are so many mt76 patches. iwlwifi is also under heavy development and smaller changes to other drivers. Also wireless-drivers was merged to fix a conflict between the two trees. Major changes: ath10k * limit available channels via DT ieee80211-freq-limit wil6210 * add 802.11r Fast Roaming support for AP and station modes * add support for channel 4 iwlwifi * new FW API handling * some improvements in the PCI recovery mechanism * enable a new scanning feature; * continued work on HE (mostly radiotap) * TKIP implementation in new devices * work continues for new 22560 hardware mt76 * add support for Alfa AWUS036ACM * lots of refactoring to make it easier to add new hardware support * prepare for adding mt76x0e (pci-e variant) support * add CONFIG_MT76x0E kconfig symbol brcmfmac * add support CYW89342 mini-PCIe device * add 4-way handshake offload detection for FT-802.1X * enable NL80211_EXT_FEATURE_CQM_RSSI_LIST * fix for proper support of 160MHz bandwidth rtl8xxxu * add rtl8188ctv support ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-09-05wireless: align to draft 11ax D3.0Shaul Triebitz
Align to new 11ax draft D3.0. Change/add new MAC and PHY capabilities and update drivers' 11ax capabilities and mac80211's debugfs accordingly. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-03Merge tag 'mac80211-for-davem-2018-09-03' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 Johannes Berg says: ==================== Here are quite a large number of fixes, notably: * various A-MSDU building fixes (currently only affects mt76) * syzkaller & spectre fixes in hwsim * TXQ vs. teardown fix that was causing crashes * embed WMM info in reg rule, bad code here had been causing crashes * one compilation issue with fix from Arnd (rfkill-gpio includes) * fixes for a race and bad data during/after channel switch * nl80211: a validation fix, attribute type & unit fixes along with other small fixes. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-08-31iwlwifi: remove all occurrences of the FSF address paragraphLuca Coelho
The Free Software Foundation address is superfluous and causes checkpatch to issue a warning when present. Remove all paragraphs with FSF's address to prevent that. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-08-28cfg80211: make wmm_rule part of the reg_rule structureStanislaw Gruszka
Make wmm_rule be part of the reg_rule structure. This simplifies the code a lot at the cost of having bigger memory usage. However in most cases we have only few reg_rule's and when we do have many like in iwlwifi we do not save memory as it allocates a separate wmm_rule for each channel anyway. This also fixes a bug reported in various places where somewhere the pointers were corrupted and we ended up doing a null-dereference. Fixes: 230ebaa189af ("cfg80211: read wmm rules from regulatory database") Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> [rephrase commit message slightly] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-07-26iwlwifi: pcie: support 2k rx buffersGolan Ben Ami
The smallest rb size supported today is 4k rx buffers. 22560 devices use 2k rxb's, so allow using 2k buffers. Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-07-26iwlwifi: add module parameter to disable 802.11axLuca Coelho
Add a module parameter to disable 802.11ax features in supported devices. This is useful for testing or if there are interoperability issues with some APs. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-07-26iwlwifi: add support for IEEE802.11axLuca Coelho
Add support for the HE in the iwlwifi driver conforming with P802.11ax_D2.0. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-05-30iwlwifi: mvm: remove division by size of sizeof(struct ieee80211_wmm_rule)Colin Ian King
The subtraction of two struct ieee80211_wmm_rule pointers leaves a result that is automatically scaled down by the size of the size of pointed-to type, hence the division by sizeof(struct ieee80211_wmm_rule) is bogus and should be removed. Detected by CoverityScan, CID#1467777 ("Extra sizeof expression") Fixes: 77e30e10ee28 ("iwlwifi: mvm: query regdb for wmm rule if needed") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-04-26iwlwifi: support new csr addresses for hw addressGolan Ben Ami
In future devices we use different csr addresses for hw addresses. Update csr addresses to support new and legacy devices. Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-04-26Merge git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.gitKalle Valo
To fix a conflict reported by Stephen Rothwell <sfr@canb.auug.org.au>: Today's linux-next merge of the wireless-drivers-next tree got a conflict in: drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c between commit: 77e30e10ee28 ("iwlwifi: mvm: query regdb for wmm rule if needed") from the wireless-drivers tree and commits: 9c4f7d512740 ("iwlwifi: move all NVM parsing code to the common files") 4c625c564ba2 ("iwlwifi: get rid of fw/nvm.c") from the wireless-drivers-next tree.
2018-04-20iwlwifi: get rid of fw/nvm.cShaul Triebitz
There's already an opmode common file for nvm iwl-nvm-parse.c Move the content of fw/nvm.c to iwl-nvm-parse.c and delete fw/nvm.c. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-04-20iwlwifi: remove upper case letters in sku_capa_band_*_enableLuca Coelho
The sku_capa_band_24GHz_enable and sku_capa_band_52GHz_enable symbols cause checkpatch to complain whenever we use them. To prevent this, convert them to all lower case. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-04-20iwlwifi: use flags to denote modifiers for the channel mapsLuca Coelho
Instead of having a boolean for each modifier we need to handle in the channel maps, create a bitmask with flags that denote each modification. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-04-20iwlwifi: move all NVM parsing code to the common filesShaul Triebitz
Move all the NVM file handling code to iwl-nvm-parse.c where all this stuff belongs. This cleans up the MVM specific code and allows easier reuse by other opmodes if needed. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-04-09iwlwifi: mvm: query regdb for wmm rule if neededHaim Dreyfuss
Since our device is regulatory self managed it maintains its regulatory rules by its own. However the wmm_rules values can't be set by the device itself but only the indication about the need to set it. In case the device set wmm indication, proactively query the regulatory data base to get these values Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-16Merge git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.gitKalle Valo
Mark Brown reported that there are conflicts in iwlwifi between the two trees so fix those now.
2017-10-06iwlwifi: acpi: move function to get mcc into acpi codeLuca Coelho
The iwl_get_bios_mcc() function was in the iwl-nvm-parse.c file, but it has nothing to do with the NVM. Move it to fw/acpi.c and rename it to iwl_acpi_get_mcc(). Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06iwlwifi: acpi: make iwl_get_bios_mcc() use the common acpi functionsLuca Coelho
The way iwl_get_bios_mcc() gets the WiFi package and checks for its integrity is almost identical to the new iwl_acpi_get_wifi_pkg() function. Instead of having duplicate code, convert it to use the common code. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>