summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2024-05-23wifi: iwlwifi: mvm: don't skip link selectionMiri Korenblit1-0/+7
If we exit EMLSR due to a IWL_MVM_ESR_EXIT*, a MLO scan followed by a link selection is scheduled with a delay of 30 seconds. If during that 30 seconds EMLSR was blocked and unblocked (IWL_MVM_ESR_BLOCKED*), we would still want to get the needed data from the MLO scan and select link accordingly, and not return immediately to EMLSR. Fixes: 2f33561ea8f9 ("wifi: iwlwifi: mvm: trigger link selection after exiting EMLSR") Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Link: https://msgid.link/20240512152312.caab27a8dd8f.I63f67e213d5e05416f71513a8d914917d59aa44f@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: add mvm-specific guardJohannes Berg7-295/+136
Add and use an mvm-specific guard for the mvm mutex. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512152312.7391425b3af2.I1b109f56753dd3f35602dd2c5cf6e1e35aee313d@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: simplify TX tracingJohannes Berg2-3/+3
There's no need to calculate again whether data should be included or be handled externally, just check if any space for it was already reserved. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512152312.a3d3b4796460.I85bd3029baee24ebf0be04db7d6bf01834090869@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: tracing: fix condition to allocate buf1Johannes Berg1-3/+3
There's no need to allocate buf1 if we're not going to write anything to it, and the condition for writing is (correctly) "hdr_len > 0 && !iwl_trace_data()". Also allocate the event space only under the same condition. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512152312.a11e6490d053.Ie090beea70d2f271bb22c9b0e287dbd342fb2a96@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: leave a print in the logs when we call fw_nmi()Emmanuel Grumbach1-0/+2
When we crash the firmware, we need to know why we decided to do so. Almost all the callsites of iwl_force_nmi() print something in the logs that explain why the driver decided to crash the firmware. Debugfs doesn't print anything and it is then hard to understand why the firmware has crashed. Add a simple print in the debugfs hook to ease the debug. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512075822.e2558de222dc.Idd81777c47264e6f557b086625895c1dc2f667f3@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: disable dynamic EMLSR when AUTO_EML is falseMiri Korenblit1-0/+9
When AUTO_EML is set to false, this change ignores the exit criteria, for testing purposes. Currently, if AUTO_EML is disabled, the driver will not select a link or enter EMLSR, but will still exit if one of the criteria is not fulfilled. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Link: https://msgid.link/20240512072733.10a0b5da6ec2.I46fd578a3ef6cdbf14fdc4dfa97b4be008fe68e3@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: use vif P2P type helperBenjamin Berg1-2/+2
Use ieee80211_vif_type_p2p instead of checking for IFTYPE_AP in combination with vif->p2p. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512072733.15a00a812c1b.I5ffee795d960c9beda46a934f5b4c70acde112f9@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: don't track used links separatelyJohannes Berg3-20/+5
We track which link is using which FW link ID, so there really isn't a need to separately track which link IDs are in use. Remove that code and check the table when looking for a new link ID to use. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512072733.1a67d8af815f.Ie642c12dce3ab55c688abd9a25918569e83e558a@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: always print the firmware version in hexEmmanuel Grumbach1-10/+4
All our firmware versions should now be printed in hex. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512072733.cae4c562b2c3.I5043383bd0e81f872c55046afd2c6560f482c8e0@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: fw: avoid bad FW config on RXQ DMA failureJohannes Berg1-2/+5
In practice, iwl_trans_get_rxq_dma_data() will not fail, it only can do that if called with the wrong arguments. But it does have an error value and doesn't initialize the argument when it fails, so don't use the value then. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512072733.faf3a1b87589.I77c950173cb914676fbd28483e5ef420bb9f1bc9@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: fw: api: Add new timepoint for scan failureMukesh Sisodiya1-0/+7
Add new time point to get the details of scan failure While on it added other missing enum to match with FW. Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com> Reviewed-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512072733.6781e76990c4.Iadfb3f6dd63a98fc35019772266b5ebddc5b5270@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mei: unify iwl_mei_set_power_limit() prototypeJohannes Berg1-2/+2
The two versions of iwl_mei_set_power_limit() are a bit different, and while really the const isn't all that necessary on the inline, it's still better to have it be the same. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512072733.854427753c92.I557716085cb1f6a35d1f97640388fa421f42a56a@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: mark bad no-data RX as having bad PLCPJohannes Berg1-3/+6
Just like with any other frame, mac80211 will do sanity checks on no-data RX (representing e.g. sounding PPDUs), and if e.g. the NSS is wrong, it will warn. This isn't a good idea if we already know the frame wasn't received well, e.g. has bad PLCP. Unless the firmware reports "no error", set the bad PLCP flag to skip checks in mac80211. Also, since we're now extracting two different values from the info field, use le32_get_bits() for both. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512072733.e6adcb9a6ece.Ic14c2e8ed5e80d48af78b2f04e9f08beeb62d68e@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: bump FW API to 91 for BZ/SC devicesMiri Korenblit2-2/+2
Start supporting API version 91 for new devices. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512072733.27c00099e8b7.I99b4f24bba073414dd04a6e04a359c7fbba52990@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: add a of print of a few commandsMiri Korenblit1-0/+25
This is needed for debugging. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512072733.65fc46e2ffbc.I19d4ef2cc06bfee7d9644a376d39399f0f6eaa15@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: Use the SMPS cfg of the correct linkMiri Korenblit1-1/+1
The exiting code is checking the SMPS mode of deflink. Use the SMPS mode of the link_sta function parameter. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512072733.f3e2834e78f5.Ie24b431a6ad0dbf977afbbd4d2116bfe2426a0d5@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: don't always set antenna in beacon template cmdMiri Korenblit1-4/+5
This needs to be set only if the FW is not capable of selecting an antenna on its own. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240512072733.73d790911268.I158dc1dbc9c2e199c69d8213e5496d2de72da28b@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: remove redundant reading from NVM fileChaya Rachel Ivgi1-7/+1
The driver reads xtal_calib from NVM file, but actually never uses it. This is only used in dvm driver. Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240510170500.c4d1a4571049.I7d7b73dccb793e220f023e0d049b082b043ca95e@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: remove fw_running opShahar S Matityahu3-9/+1
fw_running assumes that memory can be retrieved only after alive. This assumption is no longer true as we support dump before alive. To avoid invalid access to the NIC, check that STATUS_DEVICE_ENABLED bit in trans status is set before dumping instead of the prior check. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240510170500.ca07138cedeb.I090e31d3eaeb4ba19f5f84aba997ccd36927e9ac@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: Don't set NO_HT40+/- flags on 6 GHz bandAndrei Otcheretianski1-1/+5
These flags are not needed on 6 GHz channels, and anyway they were set incorrectly. This in turn resulted in alternating channel flags, preventing reg domain rules to be merged together, so cfg80211 couldn't even send them to the user space, as the regulatory domain was too large. Fix it. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240510170500.b0d51b2229f8.I092e21cde43320ffc2eff17f5748ff9c87c87fcf@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: call ieee80211_sta_recalc_aggregates on A-MSDU size updateMiri Korenblit1-0/+3
The driver needs to call this function when the A-MSDU size changes. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240510170500.632ee6612a79.Ice3a536a4cbfe60d0edfa231fcb79ee7ab9495dd@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: set A-MSDU size on the correct linkMiri Korenblit1-1/+1
The existing code sets the max A-MSDU size to the deflink, set it on the given link instead. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240510170500.4de5c1a031ca.I063bc1508e5068b32e321b0f268bc51dba0c0747@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: define link_sta in the relevant scopeMiri Korenblit1-1/+2
The link_sta pointer is now only used inside this if, so define it inside its scope. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240510170500.e0a1dd285d9a.Id5ff16fb98af0c5f533aed6b5ec3cc856401e488@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: debugfs: add entry for setting maximum TXOP timeAvraham Stern3-0/+44
Add an entry for setting the maximum TXOP time in microseconds. The configured value can be read from the same entry. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Reviewed-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240510170500.b8d17a9c1731.I57c33574a61edd68bd0ec1aa7009f31111fd7efe@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: allow UAPSD when in SCMAvraham Stern1-4/+12
Allow UAPSD when P2P and BSS interfaces share the same channel. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240510170500.1ec19d432497.Id6de5337c878fa70e85bfcf6f4e0e34ce60756fb@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: mvm: simplify the uAPSD coexistence limitation codeEmmanuel Grumbach1-28/+27
uAPSD can't be enabled on BSS or P2P Client if there is another active interface (e.g. associated client). Allow the code that apply those limitations to run on BSS as well. Also forbid uAPSD if we have an IBSS or NAN interface in the system. Since we are now forbidding uAPSD in any concurrency scenario, we don't need to check the number of PHY contexts. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240510170500.4ac26534adf7.Ib892020177e86603b2be3a105f8717b9a15951d3@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: iwlwifi: dvm: clean up rs_get_rate() logicJohannes Berg1-13/+8
The logic here is rather convoluted - we cannot get here with lq_sta being NULL as mac80211 will (no longer) call us like that, and since I removed the rate_control_send_low() call in this function there's no longer any point in setting priv_sta to NULL either. So the only thing that remains to check is if we have actually initialized our lq_sta->drv pointer, and exit if we didn't in which case we'll use the data mac80211 already set up for the low rate usage. Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> Link: https://msgid.link/20240510170500.a4cdb41825eb.Id202bcc967c32829f70ab1412f8893b6eb7f78e2@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: mac80211: pass parsed TPE data to driversJohannes Berg1-109/+34
Instead of passing the full TPE elements, in all their glory and mixed up data formats for HE backward compatibility, parse them fully into the right values, and pass that to the drivers. Also introduce proper validation already in mac80211, so that drivers don't need to do it, and parse the EHT portions. The code now passes the values in the right order according to the channel used by an interface, which could also be a subset of the data advertised by the AP, if we couldn't connect with the full bandwidth (for whatever reason.) Also add kunit tests for the more complicated bits of it. Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com> Acked-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240506214536.2aa839969b60.I265b28209e0b29772b2f125f7f83de44a4da877b@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: ath11k: fix TPE power levelsJohannes Berg1-1/+2
The chanctx can be shared, but it seems like the TPE values for this vif should only reflect the channel that the vif uses, which is captured in bss_conf->chanreq.oper rather than the chanctx. Use that when calculating defaults, a similar issue is where the data from the AP is processed, but I'm moving that to mac80211. Acked-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240506214536.d99fcf5856b9.I359bb401ea74bf82dc981a86a7ca3fa44d169d2e@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-23wifi: ieee80211/ath11k: remove IEEE80211_MAX_NUM_PWR_LEVELJohannes Berg2-4/+7
The define IEEE80211_MAX_NUM_PWR_LEVEL doesn't make much sense. Yes, that table has a maximum value of 8, and the table will actually remain that way, but EHT introduced a way to encode more levels for 320 MHz channels. Remove IEEE80211_MAX_NUM_PWR_LEVEL and, for ath11k being the only user, add ATH11K_NUM_PWR_LEVELS, where it makes sense since it cannot support 320 MHz channels. Acked-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240506214536.9818e5471055.Icece7e47e963d6b68e0d97ba13c102b37fbaa689@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-20wifi: rt2x00: remove unused delayed work data from link descriptionDmitry Antipov1-10/+0
Remove unused 'agc_work' and 'vco_work' members of 'struct link'. This follows commit d96324703ffa ("rt2x00: merge agc and vco works with link tuner") where AGC and VCO calibration code was completely redesigned. Compile tested only. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240515152824.143537-1-dmantipov@yandex.ru
2024-05-17wifi: mwifiex: Fix interface type changeRafael Beims1-0/+2
When changing the interface type we also need to update the bss_num, the driver private data is searched based on a unique (bss_type, bss_num) tuple, therefore every time bss_type changes, bss_num must also change. This fixes for example an issue in which, after the mode changed, a wireless scan on the changed interface would not finish, leading to repeated -EBUSY messages to userspace when other scan requests were sent. Fixes: c606008b7062 ("mwifiex: Properly initialize private structure on interface type changes") Cc: stable@vger.kernel.org Signed-off-by: Rafael Beims <rafael.beims@toradex.com> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240510110458.15475-1-francesco@dolcini.it
2024-05-17wifi: wilc1000: read MAC address from fuse at probeAjay Singh3-16/+42
The default netdev interface exposed by WILC1000 is registered at probe, but the chip mac address is not known until ndo_open, which will load and start chip firmware and then retrieve stored MAC address from it. As a consequence, the interface has uninitialized value (00:00:00:00:00) until a user brings up the interface. Fix MAC address at probe by setting the following steps: - at probe, read MAC address directly from fuse - whenever a new netdevice is created, apply saved mac address (which can be a user-provided address, or the eFuse Mac address if no address has been passed by user) - whenever an interface is brought up for the first time (and so the firmware is loaded and started), enforce netdevice mac address to the chip (in case user has changed it) Reported-by: Heiko Thiery <heiko.thiery@gmail.com> Closes: https://lore.kernel.org/netdev/CAEyMn7aV-B4OEhHR4Ad0LM3sKCz1-nDqSb9uZNmRWR-hMZ=z+A@mail.gmail.com/T/ Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Co-developed-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Tested-by: Heiko Thiery <heiko.thiery@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240514-mac_addr_at_probe-v2-6-afef09f1cd10@bootlin.com
2024-05-17wifi: wilc1000: make sdio deinit function really deinit the sdio cardAlexis Lothoré1-0/+45
In order to be able to read raw registers (eg the nv mac address) in wilc1000 during probe before the firmware is loaded and running, we need to run the basic sdio functions initialization, but then we also need to properly deinitialize those right after, to preserve the current driver behavior (keeping the chip idle/unconfigured until the corresponding interface is brought up). Calling wilc_sdio_deinit in its current form is not enough because it merely resets an internal flag. Implement a deinit sequence which symmetrically reset all steps performed in wilc_sdio_init (only for parts activating/deactivating features, for the sake of simplicity, let's ignore blocks size configuration reset) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240514-mac_addr_at_probe-v2-5-afef09f1cd10@bootlin.com
2024-05-17wifi: wilc1000: add function to read mac address from eFuseAlexis Lothoré4-0/+65
wilc driver currently reads and sets mac address by firmware calls. It means that we can not access mac address if no interface has been brought up (so firmware is up and running). Another way to get mac address is to read it directly from eFUSE. Add a function helper to read the mac address written in eFuse, without firmware assistance Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240514-mac_addr_at_probe-v2-4-afef09f1cd10@bootlin.com
2024-05-17wifi: wilc1000: set wilc_set_mac_address parameter as constAlexis Lothoré3-4/+4
Any attempt to provide a const mac address to wilc_set_mac_address results in the following warning: warning: passing argument 2 of 'wilc_set_mac_address' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] [...] drivers/net/wireless/microchip/wilc1000/hif.h:170:52: note: expected 'u8 *' {aka 'unsigned char *'} but argument is of type 'const unsigned char *'a int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); Instead of using an explicit cast each time we need provide a MAC address, set the function parameter as const Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240514-mac_addr_at_probe-v2-3-afef09f1cd10@bootlin.com
2024-05-17wifi: wilc1000: register net device only after bus being fully initializedAlexis Lothoré4-14/+22
SDIO/SPI probes functions automatically add a default wlan interface on top of registered wiphy, through wilc_cfg80211_init which in turn calls wilc_netdev_ifc_init. However, bus is still not fully initialized when we register corresponding net device (for example we still miss some private driver data pointers), which for example makes it impossible to retrieve MAC address from chip (which is supposed to be set on net device before its registration) before registering net device. More generally, net device registration should not be done until driver has fully initialized everything and is ready to handle any operation on the net device. Prevent net device from being registered so early by doing it at the end of probe functions. Apply this logic to both sdio and spi buses. Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240514-mac_addr_at_probe-v2-2-afef09f1cd10@bootlin.com
2024-05-17wifi: wilc1000: set net device registration as last step during interface ↵Alexis Lothoré1-15/+16
creation net device registration is currently done in wilc_netdev_ifc_init but other initialization operations are still done after this registration. Since net device is assumed to be usable right after registration, it should be the very last step of initialization. Move netdev registration at the very end of wilc_netdev_ifc_init to let this function completely initialize netdevice before registering it. Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240514-mac_addr_at_probe-v2-1-afef09f1cd10@bootlin.com
2024-05-14wifi: brcmsmac: LCN PHY code is used for BCM4313 2G-only deviceSamasth Norway Ananda1-9/+9
The band_idx variable in the function wlc_lcnphy_tx_iqlo_cal() will never be set to 1 as BCM4313 is the only device for which the LCN PHY code is used. This is a 2G-only device. Fixes: 5b435de0d786 ("net: wireless: add brcm80211 drivers") Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240509231037.2014109-1-samasth.norway.ananda@oracle.com
2024-05-14wifi: iwlegacy: do not skip frames with bad FCSAndrii Batyiev2-2/+2
Monitor/sniffer mode benefits from all types of frames, even if FCS check fails. But we must mark frames as such. Tested on iwl3945 only. Signed-off-by: Andrii Batyiev <batyiev@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240509101140.32664-1-batyiev@gmail.com
2024-05-09Merge tag 'wireless-next-2024-05-08' of ↵Jakub Kicinski224-9612/+13258
git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Kalle Valo says: ==================== wireless-next patches for v6.10 The third, and most likely the last, "new features" pull request for v6.10 with changes both in stack and in drivers. In ath12k and rtw89 we disabled Wireless Extensions just like with iwlwifi earlier. Wi-Fi 7 devices will not support Wireless Extensions (WEXT) anymore so if someone is still using the legacy WEXT interface it's time to switch to nl80211 now! We merged wireless into wireless-next as we decided not to send a wireless pull request to v6.9 this late in the cycle. Also an immutable branch with MHI subsystem was merged to get ath11k and ath12k hibernation working. Major changes: mac80211/cfg80211 * handle color change per link mt76 * mt7921 LED control * mt7925 EHT radiotap support * mt7920e PCI support ath12k * debugfs support * dfs_simulate_radar debugfs file * disable Wireless Extensions * suspend and hibernation support * ACPI support * refactoring in preparation of multi-link support ath11k * support hibernation (required changes in qrtr and MHI subsystems) * ieee80211-freq-limit Device Tree property support ath10k * firmware-name Device Tree property support rtw89 * complete features of new WiFi 7 chip 8922AE including BT-coexistence and WoWLAN * use BIOS ACPI settings to set TX power and channels * disable Wireless Extensios on Wi-Fi 7 devices iwlwifi * block_esr debugfs file * support again firmware API 90 (was reverted earlier) * provide channel survey information for Automatic Channel Selection (ACS) * tag 'wireless-next-2024-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (214 commits) wifi: mwl8k: initialize cmd->addr[] properly wifi: iwlwifi: Ensure prph_mac dump includes all addresses wifi: iwlwifi: mvm: don't request statistics in restart wifi: iwlwifi: mvm: exit EMLSR if secondary link is not used wifi: iwlwifi: mvm: add beacon template version 14 wifi: iwlwifi: mvm: align UATS naming with firmware wifi: iwlwifi: Force SCU_ACTIVE for specific platforms wifi: iwlwifi: mvm: record and return channel survey information wifi: iwlwifi: mvm: add the firmware API for channel survey wifi: iwlwifi: mvm: Fix race in scan completion wifi: iwlwifi: mvm: Add a print for invalid link pair due to bandwidth wifi: iwlwifi: mvm: add a debugfs for reading EMLSR blocking reasons wifi: iwlwifi: mvm: Add active EMLSR blocking reasons prints wifi: iwlwifi: bump FW API to 90 for BZ/SC devices wifi: iwlwifi: mvm: fix primary link setting wifi: iwlwifi: mvm: use already determined cmd_id wifi: iwlwifi: mvm: don't reset link selection during restart wifi: iwlwifi: Print EMLSR states name wifi: iwlwifi: mvm: Block EMLSR when a p2p/softAP vif is active wifi: iwlwifi: mvm: fix typo in debug print ... ==================== Link: https://lore.kernel.org/r/20240508120726.85A10C113CC@smtp.kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-05-09netdevsim: add NAPI supportDavid Wei2-12/+205
Add NAPI support to netdevim, similar to veth. * Add a nsim_rq rx queue structure to hold a NAPI instance and a skb queue. * During xmit, store the skb in the peer skb queue and schedule NAPI. * During napi_poll(), drain the skb queue and pass up the stack. * Add assoc between rxq and NAPI instance using netif_queue_set_napi(). Signed-off-by: David Wei <dw@davidwei.uk> Link: https://lore.kernel.org/r/20240507163228.2066817-2-dw@davidwei.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-05-09net: annotate data-races around dev->if_portEric Dumazet7-10/+10
Various ndo_set_config() methods can change dev->if_port dev->if_port is going to be read locklessly from rtnl_fill_link_ifmap(). Add corresponding WRITE_ONCE() on writer sides. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20240507184144.1230469-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-05-08net: stmmac: dwmac-ipq806x: account for rgmii-txid/rxid/id phy-modeChristian Marangi1-0/+12
Currently the ipq806x dwmac driver is almost always used attached to the CPU port of a switch and phy-mode was always set to "rgmii" or "sgmii". Some device came up with a special configuration where the PHY is directly attached to the GMAC port and in those case phy-mode needs to be set to "rgmii-id" to make the PHY correctly work and receive packets. Since the driver supports only "rgmii" and "sgmii" mode, when "rgmii-id" (or variants) mode is set, the mode is rejected and probe fails. Add support also for these phy-modes to correctly setup PHYs that requires delay applied to tx/rx. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2024-05-08net: dsa: microchip: add support DSCP priority mappingOleksij Rempel3-15/+50
Microchip KSZ and LAN variants do not have per port DSCP priority configuration. Instead there is a global DSCP mapping table. This patch provides write access to this global DSCP map. In case entry is "deleted", we map corresponding DSCP entry to a best effort prio, which is expected to be the default priority for all untagged traffic. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2024-05-08net: dsa: microchip: let DCB code do PCP and DSCP policy configurationOleksij Rempel2-12/+0
802.1P (PCP) and DiffServ (DSCP) are handled now by DCB code. Let it do all needed initial configuration. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2024-05-08net: dsa: microchip: init predictable IPV to queue mapping for all non ↵Oleksij Rempel1-24/+33
KSZ8xxx variants Init priority to queue mapping in the way as it shown in IEEE 802.1Q mapping example. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2024-05-08net: dsa: microchip: enable ETS support for KSZ989X variantsOleksij Rempel2-12/+1
I tested ETS support on KSZ9893, so it should work other KSZ989X variants too, which was till not listed as support. With this change we now officially not support only ksz8 family of chips. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2024-05-08net: dsa: microchip: dcb: add special handling for KSZ88X3 familyOleksij Rempel4-3/+242
KSZ88X3 switches have different behavior on different ports: - It seems to be not possible to disable VLAN PCP classification on port 2. It means, as soon as mutliqueue support is enabled, frames with VLAN tag will get PCP prios. This behavior do not affect Port 1 - it is possible to disable PCP prios. - DSCP classification is not working on Port 2. Since there are still usable configuration combinations, I added some quirks to make sure user will get appropriate error message if not possible configuration is chosen. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2024-05-08net: dsa: microchip: add support for different DCB app configurationsOleksij Rempel6-2/+583
Add DCB support to configure app trust sources and default port priority. Following commands can be used for testing: dcb apptrust set dev lan1 order pcp dscp dcb app replace dev lan1 default-prio 3 Since it is not possible to configure DSCP-Prio mapping per port, this patch provide only ability to read switch global dscp-prio mapping and way to enable/disable app trust for DSCP. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>