Commit Graph

1309189 Commits

Author SHA1 Message Date
Johannes Berg
8dc6d81c6b debugfs: add small file operations for most files
As struct file_operations is really big, but (most) debugfs
files only use simple_open, read, write and perhaps seek, and
don't need anything else, this wastes a lot of space for NULL
pointers.

Add a struct debugfs_short_fops and some bookkeeping code in
debugfs so that users can use that with debugfs_create_file()
using _Generic to figure out which function to use.

Converting mac80211 to use it where possible saves quite a
bit of space:

1010127  205064    1220 1216411  128f9b net/mac80211/mac80211.ko (before)
 981199  205064    1220 1187483  121e9b net/mac80211/mac80211.ko (after)
-------
 -28928 = ~28KiB

With a marginal space cost in debugfs:

   8701	    550	     16	   9267	   2433	fs/debugfs/inode.o (before)
  25233	    325	     32	  25590	   63f6	fs/debugfs/file.o  (before)
   8914	    558	     16	   9488	   2510	fs/debugfs/inode.o (after)
  25380	    325	     32	  25737	   6489	fs/debugfs/file.o  (after)
---------------
   +360      +8

(All on x86-64)

A simple spatch suggests there are more than 300 instances,
not even counting the ones hidden in macros like in mac80211,
that could be trivially converted, for additional savings of
about 240 bytes for each.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20241022151838.26f9925fb959.Ia80b55e934bbfc45ce0df42a3233d34b35508046@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:47:01 +02:00
Johannes Berg
b457d87138 wifi: mac80211: remove misleading j_0 construction parts
The GCM algorithm implementation in the kernel assumes that
a 12-byte IV is passed, not the actual J_0 from the GCM spec.
Don't rename, that'd be messy, but also don't fill the bytes
beyond the IV that aren't used, since otherwise it looks as
though j_0[12] is used uninitialized.

Link: https://patch.msgid.link/20241021151414.798ceb7a5896.Ic57751edad228d56865ecf7433fef469e5e0a4aa@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:46:58 +02:00
Johannes Berg
6ee0270943 wifi: mac80211_hwsim: use hrtimer_active()
Instead of hrtimer_is_queued(), use hrtimer_active() since
it might be running concurrently, and then it's not queued
at that point in time, as suggested by Thomas Gleixner in
https://lore.kernel.org/87plqn5psu.ffs@tglx, I just never
got to this for ages.

I think the concurrency is otherwise fine since we'll get
to cancel if we're actually removing things, and otherwise
we just send a beacon at slightly the wrong time or so.

Reported-by: syzbot+41e4341f493f1155aa3d@syzkaller.appspotmail.com
Link: https://patch.msgid.link/20241011145230.5a4d38d4ff9b.Iac0ec316a0c9a7b2619abe52ddc8e04c25d8c7e1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:46:53 +02:00
Michael-CY Lee
2d63e6530e wifi: mac80211: refactor BW limitation check for CSA parsing
Refactor the BW limitation check to a more general format when
parsing CSA. Also, the original BW check did not account for BW
less than 160 MHz.

Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Link: https://patch.msgid.link/20241009121812.2419-1-michael-cy.lee@mediatek.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:46:48 +02:00
Felix Fietkau
f92e0cf19a wifi: mac80211: filter on monitor interfaces based on configured channel
When a monitor interface has an assigned channel (only happens with the
NO_VIRTUAL_MONITOR feature), only pass packets received on that channel.
This is useful for monitoring on multiple channels at the same time using
multiple monitor interfaces.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/1bbe55107ba0f2e62ea90f305faeb7ba9247ef29.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:46:34 +02:00
Felix Fietkau
342afe693e wifi: mac80211: refactor ieee80211_rx_monitor
Rework the monitor mode interface iteration to get rid of the last_monitor
condition. Preparation for further filtering received monitor packets.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/d57d82f109643894325beb9db6da8f001fc533eb.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:46:26 +02:00
Felix Fietkau
754905ce1a wifi: mac80211: add support for the monitor SKIP_TX flag
Do not pass locally sent packets to monitor interfaces with this flag set.
Skip processing tx packets on the status call entirely if no monitor
interfaces without this flag are present.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/c327bb57ef8dadaa6a0e8e4dc2f5f99ae8123e6c.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:46:13 +02:00
Felix Fietkau
a77e527b47 wifi: cfg80211: add monitor SKIP_TX flag
This can be used to indicate that the user is not interested in receiving
locally sent packets on the monitor interface.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/f0c20f832eadd36c71fba9a2a16ba57d78389b6c.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:46:06 +02:00
Felix Fietkau
9d40f7e327 wifi: mac80211: add flag to opt out of virtual monitor support
This is useful for multi-radio devices that are capable of monitoring on
multiple channels simultanenously. When this flag is set, each monitor
interface is passed to the driver individually and can have a configured
channel.
The vif mac address for non-active monitor interfaces is cleared, in order
to allow the driver to tell them apart from active ones.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/3c55505ee0cf0a5f141fbcb30d1e8be8d9f40373.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:45:43 +02:00
Felix Fietkau
9c4f830927 wifi: cfg80211: pass net_device to .set_monitor_channel
Preparation for allowing multiple monitor interfaces with different channels
on a multi-radio wiphy.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/35fa652dbfebf93343f8b9a08fdef0467a2a02dc.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:45:35 +02:00
Felix Fietkau
006a97ceb6 wifi: mac80211: remove status->ampdu_delimiter_crc
This was never used by any driver, so remove it to free up some space.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/e6fee6eed49b105261830db1c74f13841fb9616c.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:45:19 +02:00
Felix Fietkau
ebda716ea4 wifi: cfg80211: report per wiphy radio antenna mask
With multi-radio devices, each radio typically gets a fixed set of antennas.
In order to be able to disable specific antennas for some radios, user space
needs to know which antenna mask bits are assigned to which radio.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/e0a26afa2c88eaa188ec96ec6d17ecac4e827641.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:45:03 +02:00
Felix Fietkau
7b68f63d5c wifi: mac80211: use vif radio mask to limit creating chanctx
Reject frequencies not supported by any radio that the vif is allowed to use.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/95ea1f6fc5bd1614a0c7952b6c67726e3fd635fb.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:44:55 +02:00
Felix Fietkau
32ee616a7f wifi: mac80211: use vif radio mask to limit ibss scan frequencies
Reject frequencies not supported by any radio that the vif is allowed to
use.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/9d5c0b6b00a7ecef6a0ac6de765c0af00c8bb0e1.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:44:44 +02:00
Felix Fietkau
3607798ad9 wifi: cfg80211: add option for vif allowed radios
This allows users to prevent a vif from affecting radios other than the
configured ones. This can be useful in cases where e.g. an AP is running
on one radio, and triggering a scan on another radio should not disturb it.

Changing the allowed radios list for a vif is supported, but only while
it is down.

While it is possible to achieve the same by always explicitly specifying
a frequency list for scan requests and ensuring that the wrong channel/band
is never accidentally set on an unrelated interface, this change makes
multi-radio wiphy setups a lot easier to deal with for CLI users.

By itself, this patch only enforces the radio mask for scanning requests
and remain-on-channel. Follow-up changes build on this to limit configured
frequencies.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/eefcb218780f71a1549875d149f1196486762756.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:44:10 +02:00
Johannes Berg
a834cd0c45 wifi: iwlwifi: allow IWL_FW_CHECK() with just a string
We require a message, but the macros shouldn't require a
formatted message, a constant one can be fine. Change the
macros to support that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.96e8554cb7a2.I0e06d8fd49f86bd4e9e216fc2265c43d7e78a095@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:44:07 +02:00
Miri Korenblit
ab1eab7657 wifi: iwlwifi: mvm: remove redundant check
iwl_mvm_sta_from_mac80211 can't return NULL.
Remove the check.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.5d6bab61c75e.I2cfa1669d4534bce9e9cfdace45f797005b71b9b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:44:04 +02:00
Yedidya Benshimol
43e0b2ada5 wifi: iwlwifi: fw: add an error table status getter
Add a function for getting the error status and error
code for given error table.
Remove a static function of same purpose from mvm/d3.c

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.610a38614ce6.Iab5f795bc30ce5d08550cff1772fe051527bcb95@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:44:03 +02:00
Benjamin Berg
02ea0fb981 wifi: iwlwifi: do not warn about a flush with an empty TX queue
When resuming it can happen that the TX queue is flushed even though it
is entirely empty. This is completely fine and should not be causing an
error level log message.

Return early from reclaim in that case.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.7c152d0820be.I3ae39a9a470f47bfe4405f2e5c30327e157eb55f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:58 +02:00
Miri Korenblit
b6ed795539 wifi: iwlwifi: mvm: remove IWL_MVM_HW_CSUM_DISABLE
This is always set to 0.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.e1b6ab87c969.Ic623ab87cb2a22285cdbed99325fdfcfe439c7d4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:56 +02:00
Miri Korenblit
f2e05b5d97 wifi: iwlwifi: mvm: remove unneeded check
When checking if extra LTF should be disabled, we don't need to check the
the HW revision.
sband_eht_cap will be NULL if eht_capa::has_eht is false,
and that will be the case for the HWs that don't support EHT.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.78b0adbb7b50.I630a64f06ca86baecde6a2a238733b7df3cf70e4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:52 +02:00
Daniel Gabay
e5c6c41522 wifi: iwlwifi: mvm: Remove redundant rcu_read_lock() in reorder buffer
iwl_mvm_reorder() is already called within a rcu-read section.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.8f229e1b08b7.I31a371f635d84db300ad16ce6170cc07a8b154fb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:50 +02:00
Daniel Gabay
f6db1fd49f wifi: iwlwifi: mvm: Remove unused last_amsdu from reorder buffer
The last_amsdu field is not used and appears to be a leftover
from a previous implementation, remove it.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.13ba0eeae0fd.I94985512596e5996f5ab199451ce851c59a5a72a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:49 +02:00
Miri Korenblit
1bf5964efe wifi: iwlwifi: bump FW API to 94 for BZ/SC devices
Start supporting API version 94 for those devices.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.7ddabbd42131.Ib8bd35521a317c14b3a2a2e5983cf5bca5e8718b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:46 +02:00
Johannes Berg
fac20611c2 wifi: iwlwifi: fw: api: update link context API version
The flags_mask field is becoming reserved, and a new bandwidth
request is being added for RX OMI purposes. Support the new API
version as preparation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.437c6573df3c.I03612cb6cf47b12038c1db11b95a554cdea714e9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:45 +02:00
Benjamin Berg
b958cb0b0a wifi: iwlwifi: mvm: log information about HW restart completion
It can happen that more errors occur after a firmware assertion. In that
case, having another log message after the restart has completed makes
it easier to see which errors where still part of the restart flow.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.d205dd88fb9d.Ic43a1b399f59d2ab1018ff2f9e6e3a0324692660@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:44 +02:00
Emmanuel Grumbach
108e80db1f wifi: iwlwifi: mvm: prepare the tx_power handling to be per-link
We still need the firmware to align

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.317f44628eb9.I3f6a735181c6c20e805b61e4f9d2056b7f90d7ea@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:42 +02:00
Emmanuel Grumbach
7953a1f57a wifi: iwlwifi: mvm: exit EMLSR earlier if bss_param_ch_cnt is updated
If we lose beacons and bss_param_ch_cnt gets updated on the other link,
we need to exit EMLSR earlier.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.9c5ad120b937.Ibdde0b3770d0821e802009d4684b617220dd6e1a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:41 +02:00
Ilan Peer
447c55e235 wifi: iwlwifi: mvm: Add support for prep_add_interface() callback
Implement the prep_add_interface() callback, so that in case
EMLSR is active and an AP or a P2P interface is do to be added,
EMLSR would be blocked.

Add a delayed work, so that in case that the interface was not
eventually added, EMLSR would be unblocked after 5 seconds.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241008072037.3baf282d0a01.Ife0a929455cb13a95ab197ca765d8db777ff9d89@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:39 +02:00
Johannes Berg
751e7489c1 wifi: mac80211: expose ieee80211_chan_width_to_rx_bw() to drivers
Drivers might need to also do this calculation, no point in
them duplicating the code. Since it's so simple, just make
it an inline.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.af003cb4a088.I8b5d29504b726caae24af6013c65b3daebe842a2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:38 +02:00
Johannes Berg
b23af47921 wifi: mac80211: chan: calculate min_def also for client mode
In order to deal with (temporary) bandwidth reductions to/from
the AP such as the upcoming RX OMI changes, modify the min_def
calculation to also not take the chanreq width into account in
client mode. This normally changes nothing as the AP bandwidth
will be the same as the channel request's width. In the RX OMI
changes, however, the code will reduce the bandwidth for only
the AP STA, since the OMI is only to that, and TDLS STAs are
unaffected. Using the min_def for this case simplifies RX OMI
a lot.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.95a39c4f6f45.I2e7517fb1a7221dc6f60b0c752e4882042b4265d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:35 +02:00
Miri Korenblit
41eba07636 wifi: mac80211: add an option to fake ieee80211_connection_loss
This allows faking this function in KUnit tests.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.3b42e7547c65.I3bcbd51bec9ccfc7c08739450ec778722549c007@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:33 +02:00
Miri Korenblit
cf00792797 wifi: mac80211: parse A-MSDU len from EHT capabilities
On 2.4 GHz there's no VHT, so EHT defines its own bits for
the maximum MPDU length. Parse and store them in the link_sta.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.e05da59c419a.I0b1c047639160d9a96f48ab013c18ea33f5473b0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:29 +02:00
Johannes Berg
88b67e91e2 wifi: mac80211: call rate_control_rate_update() for link STA
In order to update the right link information, call the update
rate_control_rate_update() with the right link_sta, and then
pass that through to the driver's sta_rc_update() method. The
software rate control still doesn't support it, but that'll be
skipped by not having a rate control ref.

Since it now operates on a link sta, rename the driver method.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.5851b6b5fd41.Ibdf50d96afa4b761dd9b9dfd54a1147e77a75329@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:27 +02:00
Johannes Berg
f828deb70c wifi: mac80211: allow rate_control_rate_init() for links
Andrei previously fixed an issue in the client where the NSS
for links other than the primary/assoc/deflink isn't set. The
same issue appears to exist on the AP side, because there's
only a call to rate_control_rate_init() for the deflink, and
not any other links.

Rework the code a bit to do rate_control_rate_init() for links,
even if it really doesn't work with software rate control yet,
it does other things as well.

Also add rate_control_rate_init_all_links() to actually do it
properly when moving to ASSOC state in cfg80211.

Change the explicit call to ieee80211_sta_init_nss() to instead
be rate_control_rate_init() now in the client code, but also
add a call to rate_control_rate_init() when a link is added in
AP mode and the STA is already associated.

This should fix the NSS initialization issue, and perhaps pave
the way for actual software rate scaling a bit, in case anyone
cares in the future, but that of course needs a lot more than
just the init call.

We still need to fix the rate control _update_ as well, and the
sta_rc_update() driver method especially, but that will be in a
different patch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.c693274a908f.I0376da02e9f5a30eaa1b5d0d01371ff09506d453@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:23 +02:00
Emmanuel Grumbach
c4382d5ca1 wifi: mac80211: update the right link for tx power
Stop looking at deflink and start using the actual link.
Initialize the power settings upon link init.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.2685dab8e1ab.I1d82cbdb2dda020aee4a225bd9a134f7d82dd810@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:22 +02:00
Emmanuel Grumbach
0b7392ee3b wifi: mac80211: __ieee80211_recalc_txpower receives a link
Handle the tx power per-link. Don't change the behavior for now. Just
change the signature of the function.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.3c9cd0731f5b.I6ebfd9d5084f3602b55c55e2669881fd92471c2f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:20 +02:00
Emmanuel Grumbach
9925aa855d wifi: mac80211: ieee80211_recalc_txpower receives a link
Handle the tx power per-link. Don't change the behavior for now. Just
change the signature of the function.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.705bbf953d0a.I8a429dede07bab5801f4c730a6abff7ce23b22d3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:18 +02:00
Emmanuel Grumbach
eea3323c43 wifi: mac80211: remove unneeded parameters
ieee80211_find_80211h_pwr_constr and ieee80211_find_cisco_dtpc don't
need the pointer to struct ieee80211_sub_if_data *sdata. Remove it and
it'll be one step closer to handle the power constraints per-link.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.3ea505cd74e7.Id416127544afd80e4fe7b275b612aef511fc64ed@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:15 +02:00
Emmanuel Grumbach
e21dd758cf wifi: mac80211: make bss_param_ch_cnt available for the low level driver
Drivers may need to track this. Make it available for them, and maintain
the value when beacons are received.
When link X receives a beacon, iterate the RNR elements and update all
the links with their respective data.
Track the link id that updated the data so that each link can know
whether the update came from its own beacon or from another link.
In case, the update came from the link's own beacon, always update the
updater link id.
The purpose is to let the low level driver know if a link is losing its
beacons. If link X is losing its beacons, it can still track the
bss_param_ch_cnt and know where the update came from.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.e2d8d1a722ad.I04b883daba2cd48e5730659eb62ca1614c899cbb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:12 +02:00
Miri Korenblit
9c5f2c7eeb wifi: mac80211: rename IEEE80211_CHANCTX_CHANGE_MIN_WIDTH
The name is misleading, this actually indicates that
ieee80211_chanctx_conf::min_def was updated.
Rename it to IEEE80211_CHANCTX_CHANGE_MIN_DEF.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.726b5f12ae0c.I3bd9e594c9d2735183ec049a4c7224bd0a9599c9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:08 +02:00
Johannes Berg
62262dd00c wifi: cfg80211: disallow SMPS in AP mode
In practice, userspace hasn't been able to set this for many
years, and mac80211 has already rejected it (which is now no
longer needed), so reject SMPS mode (other than "OFF" to be
a bit more compatible) in AP mode. Also remove the parameter
from the AP settings struct.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.fe1fc46484cf.I8676fb52b818a4bedeb9c25b901e1396277ffc0b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:43:03 +02:00
Ilan Peer
074a8b54da wifi: mac80211: Add support to indicate that a new interface is to be added
Add support to indicate to the driver that an interface is about to be
added so that the driver could prepare its resources early if it needs
so.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.e0e8563e1c30.Ifccc96a46a347eb15752caefc9f4eff31f75ed47@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-23 16:42:56 +02:00
Kalle Valo
1f3de77752 rtw-next patches for v6.13
No big change at this point. Regular development and fixes are listed:
 
 rtl8xxxu:
  - correct beaconing for the case of STA + AP
 
 rtw88:
  - consolidate parser of RX descriptor as preparation to support coming
    chips
 
 rtw89:
  - update BT-coexistence to improve user experience for RTL8852BE and
    RTL8852BE-VT
  - correct RTL8922AE RF calibration timeout time and print out firmware
    log
  - set proper PCI EQ value for RTL8852CE and RTL8922AE
  - adjust to support MLO continuously
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEuyEnvMdOsBl1WjpdjlvZYmhshd8FAmcHKC4ACgkQjlvZYmhs
 hd9p4hAArKllxcVcSpX0mOXFMhbFJV3dpsJZ9VZQ3u2FsBq88zLdX0manRsepEbQ
 78DlgHaNzE3CflyAFp6xOf8XAucdJndksluVZapnWvRGVJHzFent/MgfLgQyRQWK
 iY4hAUtwnwrlvc3oKM5L0ZKAn8BinPf9VkdXu5xY3MnlphWqNwfl4wMs8Qqgj/8/
 F+7+TFL1hjecMMzY+0fnXo1WyoEfK6yUoLwgo19WaikV3tVe4MWF9Hghhoat94C8
 YOcjOF2xIkKCdKdzQuZz1julSX1ga9nKNPKpobiSGoHG8Clo0BPUMCf7mA4uGyj5
 nUxqUqfYpfcDXhCGWyemd07H09CQ85fxW/Q3SkdyB/Fx8c+/V1flUqCA+1hUJX7/
 p6vll1udFMpUgR3RF0IYOesmVmV7m2Qg7SKZjOf05YdD3+biAOXrrMgDBLhuYdZz
 aOLIQIeblD0JtNL1wgQmSWscXjWmiSbEROqxIy9vq0vEhYG+1rURz8sv+zRp03oB
 9lEkAj+dPN1mObph8pdqcW7TSkihGglhTd0g8KiID1OEMPgUErf5U5U+dJUCSZPt
 8Hu2wI6t5K6x8BkbbXVPZLJo+HfhNOv3x9xHuOtO48q0CY93SK7PGZXNqOjA2c+7
 Z4L4COSeAsDauL3eBrC54AmMfarOF9OwY/mPrXHlGJSw0NtdTuI=
 =qbTP
 -----END PGP SIGNATURE-----

Merge tag 'rtw-next-2024-10-10' of https://github.com/pkshih/rtw

rtw-next patches for v6.13

No big change at this point. Regular development and fixes are listed:

rtl8xxxu:
 - correct beaconing for the case of STA + AP

rtw88:
 - consolidate parser of RX descriptor as preparation to support coming
   chips

rtw89:
 - update BT-coexistence to improve user experience for RTL8852BE and
   RTL8852BE-VT
 - correct RTL8922AE RF calibration timeout time and print out firmware
   log
 - set proper PCI EQ value for RTL8852CE and RTL8922AE
 - adjust to support MLO continuously
2024-10-17 20:21:22 +03:00
Dr. David Alan Gilbert
b2d23b83d8 wifi: cw1200: Remove unused cw1200_queue_requeue_all()
cw1200_queue_requeue_all() has been unused since it was added in 2013 by commit
a910e4a94f ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20241012203852.229151-1-linux@treblig.org
2024-10-17 19:50:41 +03:00
Alper Nebi Yasak
d241a139c2 wifi: mwifiex: Fix memcpy() field-spanning write warning in mwifiex_config_scan()
Replace one-element array with a flexible-array member in `struct
mwifiex_ie_types_wildcard_ssid_params` to fix the following warning
on a MT8173 Chromebook (mt8173-elm-hana):

[  356.775250] ------------[ cut here ]------------
[  356.784543] memcpy: detected field-spanning write (size 6) of single field "wildcard_ssid_tlv->ssid" at drivers/net/wireless/marvell/mwifiex/scan.c:904 (size 1)
[  356.813403] WARNING: CPU: 3 PID: 742 at drivers/net/wireless/marvell/mwifiex/scan.c:904 mwifiex_scan_networks+0x4fc/0xf28 [mwifiex]

The "(size 6)" above is exactly the length of the SSID of the network
this device was connected to. The source of the warning looks like:

    ssid_len = user_scan_in->ssid_list[i].ssid_len;
    [...]
    memcpy(wildcard_ssid_tlv->ssid,
           user_scan_in->ssid_list[i].ssid, ssid_len);

There is a #define WILDCARD_SSID_TLV_MAX_SIZE that uses sizeof() on this
struct, but it already didn't account for the size of the one-element
array, so it doesn't need to be changed.

Fixes: 5e6e3a92b9 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Acked-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20241007222301.24154-1-alpernebiyasak@gmail.com
2024-10-17 19:50:17 +03:00
Bartosz Golaszewski
7cc7267a01 wifi: brcmfmac: of: use devm_clk_get_optional_enabled_with_rate()
Fold the separate clk_set_rate() call into the clock getter.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20241007131639.98358-1-brgl@bgdev.pl
2024-10-17 19:49:59 +03:00
Dr. David Alan Gilbert
13d21a2896 wifi: brcmsmac: Remove unused brcms_debugfs_get_devdir()
brcms_debugfs_get_devdir() has been unused since it was added by commit
8e21df2389 ("brcmsmac: hardware info in debugfs")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20241004004259.470853-1-linux@treblig.org
2024-10-17 19:49:37 +03:00
Dr. David Alan Gilbert
e2e2511347 wifi: brcmfmac: Remove unused brcmf_cfg80211_get_iftype()
brcmf_cfg80211_get_iftype() has been unused since 2013's commit
5cd51c2bad ("brcmfmac: Find correct MAC descriptor in case of TDLS.")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20241004004252.470836-1-linux@treblig.org
2024-10-17 19:49:11 +03:00
Marek Vasut
29dd3e48b9 wifi: wilc1000: Set MAC after operation mode
It seems it is necessary to set WILC MAC address after operation mode,
otherwise the MAC address of the WILC MAC is reset back to what is in
nvmem. This causes a failure to associate with AP after the WILC MAC
address was overridden by userspace.

Test case:
"
ap$ cat << EOF > hostap.conf
interface=wlan0
ssid=ssid
hw_mode=g
channel=6
wpa=2
wpa_passphrase=pass
wpa_key_mgmt=WPA-PSK
EOF
ap$ hostapd -d hostap.conf
ap$ ifconfig wlan0 10.0.0.1
"

"
sta$ ifconfig wlan0 hw ether 00:11:22:33:44:55
sta$ wpa_supplicant -i wlan0 -c <(wpa_passphrase ssid pass)
sta$ ifconfig wlan0 10.0.0.2
sta$ ping 10.0.0.1 # fails without this patch
"

AP still indicates SA with original MAC address from nvmem without this patch:
"
nl80211: RX frame da=ff:ff:ff:ff:ff:ff sa=60:01:23:45:67:89 bssid=ff:ff:ff:ff:ff:ff ...
                                          ^^^^^^^^^^^^^^^^^
"

Fixes: 83d9b54ee5 ("wifi: wilc1000: read MAC address from fuse at probe")
Tested-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20241003132504.52233-1-marex@denx.de
2024-10-17 19:48:55 +03:00