linux-2.6-block.git
5 months agowifi: mwl8k: Avoid -Wflex-array-member-not-at-end warnings
Gustavo A. R. Silva [Mon, 25 Mar 2024 03:12:05 +0000 (21:12 -0600)]
wifi: mwl8k: Avoid -Wflex-array-member-not-at-end warnings

-Wflex-array-member-not-at-end is coming in GCC-14, and we are getting
ready to enable it globally.

There is currently an object (`header`), at the beginning of multiple
structures, that contains a flexible structure (`struct mwl8k_cmd_pkt`),
for example:

struct mwl8k_cmd_get_hw_spec_sta {
        struct mwl8k_cmd_pkt header;

...

__le32 num_tx_desc_per_queue;
        __le32 total_rxd;
} __packed;

So, in order to avoid ending up with flexible-array members in the
middle of multiple other structs, we use the `__struct_group()` helper
to separate the flexible array from the rest of the members in the
flexible structure:

struct mwl8k_cmd_pkt {
        __struct_group(mwl8k_cmd_pkt_hdr, hdr, __packed,

... the rest of the members

        );
        char payload[];
} __packed;

With the change described above, we now declare objects of the type of
the tagged struct, in this case `struct mwl8k_cmd_pkt_hdr`, without
embedding flexible arrays in the middle of another struct:

struct mwl8k_cmd_get_hw_spec_sta {
        struct mwl8k_cmd_pkt_hdr header;

        ...

        __le32 num_tx_desc_per_queue;
        __le32 total_rxd;
} __packed;

Also, update the type of a couple of variables and function parameters
from `struct mwl8k_cmd_pkt` to `struct mwl8k_cmd_pkt_hdr`.

So, with these changes, fix 33 of the following warnings[1]:
drivers/net/wireless/marvell/mwl8k.c:2353:30: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Link: https://gist.github.com/GustavoARSilva/7a841a92c0f24e5efdb30ce02b601eb8
Link: https://github.com/KSPP/linux/issues/202
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/ZgDrhe5pbV/WvDiZ@neat
5 months agowifi: ti: Avoid a hundred -Wflex-array-member-not-at-end warnings
Gustavo A. R. Silva [Mon, 25 Mar 2024 02:09:04 +0000 (20:09 -0600)]
wifi: ti: Avoid a hundred -Wflex-array-member-not-at-end warnings

-Wflex-array-member-not-at-end is coming in GCC-14, and we are getting
ready to enable it globally.

Remove unused flexible-array members in multiple structures, and fix
a hundred -Wflex-array-member-not-at-end warnings[1] in
drivers/wireless/ti/

Link: https://gist.github.com/GustavoARSilva/fbf63c114d01319bbd19baf95b4d704b
Link: https://github.com/KSPP/linux/issues/202
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/ZgDcwIgxkhs6ZVdY@neat
5 months agowifi: iwlwifi: mvm: fix check in iwl_mvm_sta_fw_id_mask
Johannes Berg [Mon, 25 Mar 2024 17:08:51 +0000 (18:08 +0100)]
wifi: iwlwifi: mvm: fix check in iwl_mvm_sta_fw_id_mask

In the previous commit, I renamed the variable to differentiate
mac80211/mvm link STA, but forgot to adjust the check. The one
from mac80211 is already non-NULL anyway, but the mvm one can
be NULL when the mac80211 isn't during link switch conditions.
Fix the check.

Fixes: 2783ab506eaa ("wifi: iwlwifi: mvm: select STA mask only for active links")
Reviewed-by: Daniel Gabay <daniel.gabay@intel.com>
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240325180850.e95b442bafe9.I8c0119fce7b00cb4f65782930d2c167ed5dd0a6e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agonet: rfkill: gpio: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 6 Mar 2024 18:35:38 +0000 (19:35 +0100)]
net: rfkill: gpio: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://msgid.link/20240306183538.88777-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: use kvcalloc() for codel vars
Johannes Berg [Mon, 25 Mar 2024 14:05:03 +0000 (15:05 +0100)]
wifi: mac80211: use kvcalloc() for codel vars

This is a big array, but it's only used by software and
need not be contiguous in memory. Use kvcalloc() since
it's so big (order 5 allocation).

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240325150509.9195643699e4.I1b94b17abc809491080d6312f31ce6b5decdd446@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: reconfigure TLC during HW restart
Johannes Berg [Wed, 20 Mar 2024 21:26:38 +0000 (23:26 +0200)]
wifi: iwlwifi: reconfigure TLC during HW restart

Since the HW restart flow with multi-link is very similar to
the initial association, we do need to reconfigure TLC there.
Remove the check that prevented that.

Fixes: d2d0468f60cd ("wifi: iwlwifi: mvm: configure TLC on link activation")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.a00adcfe381a.Ic798beccbb7b7d852dc976d539205353588853b0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: don't change BA sessions during restart
Johannes Berg [Wed, 20 Mar 2024 21:26:37 +0000 (23:26 +0200)]
wifi: iwlwifi: mvm: don't change BA sessions during restart

During restart, we haven't added BA sessions, so we also cannot
change them to switch between links when that happens in restart.
Short-circuit the appropriate function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.70ba08540db0.Ic604d384e660c755308a49a79d3f7e78bc27597c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: select STA mask only for active links
Johannes Berg [Wed, 20 Mar 2024 21:26:36 +0000 (23:26 +0200)]
wifi: iwlwifi: mvm: select STA mask only for active links

During reconfig, we might send keys, but those should be only
sent to already active link stations. Iterate only active ones
to fix that issue.

Fixes: aea99650f731 ("wifi: iwlwifi: mvm: set STA mask for keys in MLO")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.c6818d1c6033.I6357f05c55ef111002ddc169287eb356ca0c1b21@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: set wider BW OFDMA ignore correctly
Johannes Berg [Wed, 20 Mar 2024 21:26:35 +0000 (23:26 +0200)]
wifi: iwlwifi: mvm: set wider BW OFDMA ignore correctly

Clearly, I put this flag into the wrong place: devices using the
code in mac80211.c only do not support EHT, so this isn't even
relevant. Fix this by moving the code to the right function.

Fixes: 32a5690e9acb ("wifi: iwlwifi: mvm: support wider-bandwidth OFDMA")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.0d5fb0e971e4.I3b67c5e0ddcbe6e58143ec0bc4e40dd6dba4f863@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: Add support for LARI_CONFIG_CHANGE_CMD cmd v9
Anjaneyulu [Wed, 20 Mar 2024 21:26:34 +0000 (23:26 +0200)]
wifi: iwlwifi: Add support for LARI_CONFIG_CHANGE_CMD cmd v9

There is a requirement from OEMs to support new bits in DSM function 7,
which will indicate enablement of 5.9 GHz in Canada.
Add support for this by reading those bits from BIOS and sending it to the
FW. mask unii4 allow bitmap based on LARI_CONFIG_CHANGE_CMD version

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.5c31ccd73119.I0363992efc3607368648d34a7918b2534150a3ca@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: Declare HE/EHT capabilities support for P2P interfaces
Ilan Peer [Wed, 20 Mar 2024 21:26:33 +0000 (23:26 +0200)]
wifi: iwlwifi: mvm: Declare HE/EHT capabilities support for P2P interfaces

Declare HE/EHT capabilities support also for P2P client and P2P GO
interface types.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.37fdea8e55a3.If074bdc6c6cd55b76c3421417a987d21ab6bb041@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: Remove outdated comment
Miri Korenblit [Wed, 20 Mar 2024 21:26:31 +0000 (23:26 +0200)]
wifi: iwlwifi: mvm: Remove outdated comment

This comment was added when iwl_mvm_alloc_sta_after_restart configured
the FW with an internal station, but then it was changed by
164a52d45e4a ("wifi: iwlwifi: mvm: send full STA during HW restart")
to configure the full sta, So there is no reason to "wait for mac80211 to
add the STA" as this is exacly where it happens.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://msgid.link/20240320232419.d656c2385b06.Icccd0640eb9f1ad72ff74792086435dfc0bee6eb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: add support for BZ_W
Emmanuel Grumbach [Wed, 20 Mar 2024 21:26:30 +0000 (23:26 +0200)]
wifi: iwlwifi: add support for BZ_W

BZ_W is another member of the BZ family.
Just like BZ_U, we also need to override the STEP.
While at it, add a few missing CNVi Chip ID values.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.40c315d51b22.I6b2b2083f8d5b4ec4119aa5b51c21b8428d96060@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: Print a specific device name.
Daniel Amosi [Wed, 20 Mar 2024 21:26:29 +0000 (23:26 +0200)]
wifi: iwlwifi: Print a specific device name.

For FM and GL, the name printed on the logs was "TBD".
Change that to print the accurate name.

Signed-off-by: Daniel Amosi <amosi.daniel@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.6fc9ad1396ca.I207626ce5e2ada170a7c01dccf5226110d09f135@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: remove wrong CRF_IDs
Emmanuel Grumbach [Wed, 20 Mar 2024 21:26:28 +0000 (23:26 +0200)]
wifi: iwlwifi: remove wrong CRF_IDs

Those CRF_IDs never existed and were a mistake. Those values are
CNVI_IDs.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.b7bea022622b.Ia6ffa981397dc11bd1acb7e190c275155857823d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: remove devices that never came out
Emmanuel Grumbach [Wed, 20 Mar 2024 21:26:27 +0000 (23:26 +0200)]
wifi: iwlwifi: remove devices that never came out

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.b3715c0d4bdd.I1337ed9c3edbec4ea9ff7e8a8b02410d5e69bf74@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: mark EMLSR disabled in cleanup iterator
Benjamin Berg [Wed, 20 Mar 2024 21:26:26 +0000 (23:26 +0200)]
wifi: iwlwifi: mvm: mark EMLSR disabled in cleanup iterator

During HW restart only one link will be active initially and other links
are only activated again later on. With only a single link EMLSR cannot
be enabled and having it marked enabled confuses the internal state.

Mark EMLSR as disabled in the cleanup iterator, it can be reenabled
later one once this is possible.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.71eb622d6ce3.Ic4d50695b9bb332190dc712473096083aa96074b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: fix active link counting during recovery
Benjamin Berg [Wed, 20 Mar 2024 21:26:25 +0000 (23:26 +0200)]
wifi: iwlwifi: mvm: fix active link counting during recovery

During recovery, the chanctx_conf in mac80211 is still non-NULL even
though the channel context has not yet been assigned again. In that
case, the real count is actually lower.

Switch to instead count the phy_ctx assignment and ensure that the
assignment is cleared at the start of recovery.

Fixes: 12bacfc2c065 ("wifi: iwlwifi: handle eSR transitions")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.55f37339e7d1.I57006568a90ffb7a1232def1b2f3264dea711ba6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: assign link STA ID lookups during restart
Benjamin Berg [Wed, 20 Mar 2024 21:26:24 +0000 (23:26 +0200)]
wifi: iwlwifi: mvm: assign link STA ID lookups during restart

When restarting the HW, mac80211 first adds the STA back with only one
link enabled. This means that iwl_mvm_alloc_sta_after_restart will not
see the other links and will not do the assignment.

As such, do the assignment when mac80211 is activating the link for the
station.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.4a3273e5c6be.I7cb6cf096ab135f4b489f2806b116563624aa5ee@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: reactivate multi-link later in restart
Johannes Berg [Wed, 20 Mar 2024 07:14:05 +0000 (09:14 +0200)]
wifi: mac80211: reactivate multi-link later in restart

In case of restart, we currently reactivate multi-link on
interfaces before reconfiguring keys etc. which means the
drivers need to handle this case differently. Enable more
links later to allow them to handle it the same way.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320091155.d0f18a56335d.Ib3338d93872a4a568f38db0d02546534d3eff810@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: improve drop for action frame return
Johannes Berg [Wed, 20 Mar 2024 07:14:04 +0000 (09:14 +0200)]
wifi: mac80211: improve drop for action frame return

If we use a drop we not only save the extra call to
dev_kfree_skb(), but also have a better reason in
tracing, so do that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320091155.34daf0a89eb4.I60e0639511f9de64e40e6105b640adf90f8f57f7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: don't ask driver about no-op link changes
Johannes Berg [Wed, 20 Mar 2024 07:14:03 +0000 (09:14 +0200)]
wifi: mac80211: don't ask driver about no-op link changes

If the links won't actually change, nothing will happen.
This was previously done in the inner function (twice in
some cases), but we shouldn't bother the driver with it.
Clean that up.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320091155.a8190a312a27.If4e6f5ce8228eda7afac0fc8c17dd731c5da9ed9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: don't select link ID if not provided in scan request
Ayala Beker [Wed, 20 Mar 2024 07:14:02 +0000 (09:14 +0200)]
wifi: mac80211: don't select link ID if not provided in scan request

If scan request doesn't include a link ID to be used for TSF
reporting, don't select it as it might become inactive before
scan is actually started by the driver.
Instead, let the driver select one of the active links.

Fixes: cbde0b49f276 ("wifi: mac80211: Extend support for scanning while MLO connected")
Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320091155.a6b643a15755.Ic28ed9a611432387b7f85e9ca9a97a4ce34a6e0f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211_hwsim: Declare HE/EHT capabilities support for P2P interfaces
Ilan Peer [Wed, 20 Mar 2024 07:14:01 +0000 (09:14 +0200)]
wifi: mac80211_hwsim: Declare HE/EHT capabilities support for P2P interfaces

Declare HE/EHT capabilities support also for P2P client and P2P GO
interface types.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320091155.73ae309d27c2.I31ef6af2f1ebf54281858e2f63afcb10b61985fe@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: clarify IEEE80211_STATUS_SUBDATA_MASK
Johannes Berg [Wed, 20 Mar 2024 07:14:00 +0000 (09:14 +0200)]
wifi: mac80211: clarify IEEE80211_STATUS_SUBDATA_MASK

We have 13 bits for the status_data, so restricting
type to 4 and subdata to 8 bits is confusing, even if
we don't need more bits now. Change subdata mask to
be 9 bits instead, just to make things match up.

If we actually need more types or more subdata bits
we can later also reshuffle the bits between these,
but we should probably keep them at 13 bits together.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320091155.28ac7b665039.I1abbb13e90f016cab552492e05f5cb5b52de6463@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: don't enter idle during link switch
Johannes Berg [Wed, 20 Mar 2024 07:13:59 +0000 (09:13 +0200)]
wifi: mac80211: don't enter idle during link switch

When doing link switch with a disjoint set of links before
and after the switch, we end up removing all channel contexts,
adding new ones later. This looks like 'idle' to the code now,
and we enter idle which also includes flushing queues. But we
can't actually flush since we don't have a link active (bound
to a channel context), and entering idle just to leave it again
is also wrong.

Fix this by passing through an indication that we shouldn't do
any idle checks in this case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320091155.170328bac555.If4a522a9dd3133b91983854b909a4de13aa635da@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: allocate STA links only for active links
Johannes Berg [Tue, 19 Mar 2024 08:10:27 +0000 (10:10 +0200)]
wifi: iwlwifi: mvm: allocate STA links only for active links

For the mvm driver, data structures match what's in the firmware,
we allocate FW IDs for them already etc. During link switch we
already allocate/free the STA links appropriately, but initially
we'd allocate them always. Fix this to allocate memory, a STA ID,
etc. only for active links.

Fixes: 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.f2093ff73465.Ie891e1cc9c9df09ae22be6aad5c143e376f40f0e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: enable monitor on passive/inactive channels
Johannes Berg [Tue, 19 Mar 2024 08:10:26 +0000 (10:10 +0200)]
wifi: iwlwifi: enable monitor on passive/inactive channels

If firmware supports pure passive monitor on passive/inactive
channels, enable that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.7c62f421f03e.I9969d3a46fed48e67fa28a7d00080b0dd314dabd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: Do not warn on invalid link on scan complete
Ilan Peer [Tue, 19 Mar 2024 08:10:25 +0000 (10:10 +0200)]
wifi: iwlwifi: mvm: Do not warn on invalid link on scan complete

As it is possible that by the time the scan is completed the link was
already removed.

Fixes: 3a5a5cb06700 ("wifi: iwlwifi: mvm: Correctly report TSF data in scan complete")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.619d3574a757.I0523e92547f0288c8b0119b1fdc5e967a5a8956e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: remove 6 GHz NVM override
Johannes Berg [Tue, 19 Mar 2024 08:10:24 +0000 (10:10 +0200)]
wifi: iwlwifi: remove 6 GHz NVM override

We shouldn't override the flags to zero here for 6 GHz
capable devices any more, but since LAR will be there,
this also shouldn't make a difference now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.73bff65d5597.I1ae23a509fad252c0237e74defba6cb74b6ca188@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: don't support puncturing in 5 GHz
Johannes Berg [Tue, 19 Mar 2024 08:10:23 +0000 (10:10 +0200)]
wifi: iwlwifi: mvm: don't support puncturing in 5 GHz

This is simply not supported, so set the flag for it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.f61448c4a43a.Ib740b341af0ca6c3e06cc9a0b04447a6635df7a8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: fw: add clarifying comments about iwl_fwrt_dump_data
Johannes Berg [Tue, 19 Mar 2024 08:10:21 +0000 (10:10 +0200)]
wifi: iwlwifi: fw: add clarifying comments about iwl_fwrt_dump_data

iwl_fw_dbg_collect_sync() unconditionally accesses 'trig' at
the beginning of the function, even though the data has an
inner union and 'trig' isn't necessarily always used, it can
be 'desc' instead. Add comments clarifying why this is OK,
that 'trig'/'desc' must be first in the struct and how in it
the use of the union's sub-structs is differentiated.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.49c3a39737cc.I91c588e0d66b49f0ee9103e8d4a0e501c2fd36d6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: always apply 6 GHz probe limitations
Benjamin Berg [Tue, 19 Mar 2024 08:10:19 +0000 (10:10 +0200)]
wifi: iwlwifi: mvm: always apply 6 GHz probe limitations

When scanning on 6 GHz we allocate a set of short-SSIDs and BSSIDs to
probe. However, when we need to do an active scan because of a hidden
SSID, then we could add too many entries for probing causing an
assertion in the firmware input validation.

Reshuffle the code a bit to first calculate the maximum number of
short-SSIDs and BSSIDs that are permitted for the channel. Then ensure
that we do not set more than the permitted number of bits in the
bitmasks and turn on force_passive when we have surpassed the limit.

While at it, also change the logic so that allow_passive is always
disabled in case a hidden SSID is included. Previously, we might not
have done so if we added the short-SSID based on the number of BSSIDs
already in the request.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.e0b114b68d1d.Ib86afccdb955f0d221ef5d7b8afdc1d67c3542ef@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: support iwl_dev_tx_power_cmd_v8
Emmanuel Grumbach [Tue, 19 Mar 2024 08:10:18 +0000 (10:10 +0200)]
wifi: iwlwifi: mvm: support iwl_dev_tx_power_cmd_v8

This just adds a __le32 that we (currently) don't use.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.29ff7a88ddac.I39cf2ff1d1ddf0fa62722538698dc7f21aaaf39e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: add a kunit test for PCI table duplicates
Johannes Berg [Tue, 19 Mar 2024 08:10:16 +0000 (10:10 +0200)]
wifi: iwlwifi: add a kunit test for PCI table duplicates

We shouldn't have entries in the table that match the same
device; it's possible to have a specific entry followed by
a less specific entry (i.e. NNNN followed by ANY), but not
entries that are dead, where an earlier entry matches the
same as a later one.

Add a test similar to the existing devinfo test to catch
this situation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.826b859abd62.I8140d7e9ae52ac50c6830818f8f95ccd0d94b3d3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: add debugfs for forcing unprotected ranging request
Avraham Stern [Tue, 19 Mar 2024 08:10:15 +0000 (10:10 +0200)]
wifi: iwlwifi: mvm: add debugfs for forcing unprotected ranging request

Add an option to force sending unprotected ranging request even if the
station is associated to the responder or a PASN keys are configured.
This is used for testing.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.8523150148ec.I7ab6c547513717e69ec385f72a8f43ea00bd9e0a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: Add debugfs entry for triggering internal MLO scan
Ilan Peer [Tue, 19 Mar 2024 08:10:14 +0000 (10:10 +0200)]
wifi: iwlwifi: mvm: Add debugfs entry for triggering internal MLO scan

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.3dd3e8c42c27.I9434dc641b837601c72f10684fbfad2c0fb31a99@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: Introduce internal MLO passive scan
Ilan Peer [Tue, 19 Mar 2024 08:10:13 +0000 (10:10 +0200)]
wifi: iwlwifi: mvm: Introduce internal MLO passive scan

Add a new scan type that can be used for internal MLO purposes, i.e.,
in case updated BSS information is required. Currently only passive
scanning is supported.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.5ce3e756cf8f.I4a41065f6b3a6ec6c6e44e83bc97c277ff7c599e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: add support for tearing down negotiated TTLM
Ayala Beker [Mon, 18 Mar 2024 16:53:31 +0000 (18:53 +0200)]
wifi: mac80211: add support for tearing down negotiated TTLM

In order to activate a link that is currently inactive due to
a negotiated TTLM request, need to first tear down the negotiated
TTLM request.
Add support for sending TTLM teardown request and update the links
state accordingly.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.d480cbf46fcf.Idedad472469d2c27dd2a088cf80a13a1e1cf9b78@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: cfg80211: ignore non-TX BSSs in per-STA profile
Benjamin Berg [Mon, 18 Mar 2024 16:53:29 +0000 (18:53 +0200)]
wifi: cfg80211: ignore non-TX BSSs in per-STA profile

If a non-TX BSS is included in a per-STA profile, then we cannot set
transmitted_bss for it. Even worse, if we do things properly we should
be configuring both bssid_index and max_bssid_indicator correctly. We do
not actually have both pieces of information (and, some APs currently
do not include either).

So, ignore any per-STA profile where the RNR says that the BSS is not
transmitted. Also fix transmitted_bss to never be set for per-STA
profiles.

This fixes issues where mac80211 was setting the reference BSSID to an
incorrect value.

Fixes: 2481b5da9c6b ("wifi: cfg80211: handle BSS data contained in ML probe responses")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.6a0babed655a.Iad447fea417c63f683da793556b97c31d07a4aab@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: cfg80211: check BSSID Index against MaxBSSID
Benjamin Berg [Mon, 18 Mar 2024 16:53:28 +0000 (18:53 +0200)]
wifi: cfg80211: check BSSID Index against MaxBSSID

Add a verification that the BSSID Index does not exceed the maximum
number of BSSIDs in the Multiple-BSSID set.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.a7574d415adc.I02f40c2920a9f602898190679cc27d0c8ee2c67d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: improve association error reporting slightly
Benjamin Berg [Mon, 18 Mar 2024 16:53:27 +0000 (18:53 +0200)]
wifi: mac80211: improve association error reporting slightly

There is no reason to check the request flags for each of the links, so
pull that out of the loop. Also, within the loop we can set the per-link
error everywhere.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.695faa9be279.I71b11a8d66a9cae4c27e242a47d1d92922609b03@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: add flag to disallow puncturing in 5 GHz
Johannes Berg [Mon, 18 Mar 2024 16:53:25 +0000 (18:53 +0200)]
wifi: mac80211: add flag to disallow puncturing in 5 GHz

Some devices may not be capable of handling puncturing in 5 GHz
only (vs. the current flag that just removes puncturing support
completely). Add a flag to support such devices: check and then
downgrade the channel width if needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.49759510da7d.I12c5a61f0be512e0c4e574c2f794ef4b37ecaf6b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: cfg80211: handle indoor AFC/LPI AP in probe response and beacon
Anjaneyulu [Mon, 18 Mar 2024 16:53:24 +0000 (18:53 +0200)]
wifi: cfg80211: handle indoor AFC/LPI AP in probe response and beacon

Mark Indoor LPI and Indoor AFC power types as valid based on channel flags.
While on it, added default case.

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.091cfaaa5f45.I23cfa1104a16fd4eb9751b3d0d7b158db4ff3ecd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: handle indoor AFC/LPI AP on assoc success
Anjaneyulu [Mon, 18 Mar 2024 16:53:23 +0000 (18:53 +0200)]
wifi: mac80211: handle indoor AFC/LPI AP on assoc success

Update power_type in bss_conf based on Indoor AFC and LPI power types
received in HE 6 GHz operation element on assoc success.

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.89c25dae34ff.Ifd8b2983f400623ac03dc032fc9a20025c9ca365@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: fix BSS_CHANGED_MLD_TTLM description
Ayala Beker [Mon, 18 Mar 2024 16:53:21 +0000 (18:53 +0200)]
wifi: mac80211: fix BSS_CHANGED_MLD_TTLM description

BSS_CHANGED_MLD_TTLM purpose is to let the driver know that
negotiated TTLM was updated and as a result MLD suspended links
status was change.
Fix the description to better reflect it.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.52b893a70758.I2dcb322b389441f33605fb952450cc2724eb9efd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: clarify the dormant/suspended links docs
Johannes Berg [Mon, 18 Mar 2024 16:53:20 +0000 (18:53 +0200)]
wifi: mac80211: clarify the dormant/suspended links docs

Since I keep getting confused about this and asking about it,
update the documentation.

In the future, especially when we add more reasons for a link
to be disabled, we should add a per-link 'disable state' bitmap
instead of maintaining all these bitmaps with subset logic, to
indicate each of the different states separately.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.a5b24595b1a2.I92dd7d177b25df189b842d3bcddb1f2b13b1de13@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211_hwsim: move skip_beacons to be per link
Johannes Berg [Mon, 18 Mar 2024 16:53:19 +0000 (18:53 +0200)]
wifi: mac80211_hwsim: move skip_beacons to be per link

Initially, we were only using this for non-MLO, but it could
also be useful for MLO, and if we move it to per-link and the
vif isn't an MLD, it'll be put in the same place (by mac80211)
anyway. Move it to be per link.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.8b6691bd70eb.If8a28b893d277254906601065e4aaefa704b6fcb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: ieee80211: fix ieee80211_mle_basic_sta_prof_size_ok()
Johannes Berg [Mon, 18 Mar 2024 16:53:18 +0000 (18:53 +0200)]
wifi: ieee80211: fix ieee80211_mle_basic_sta_prof_size_ok()

If there was a possibility of an MLE basic STA profile without
subelements, we might reject it because we account for the one
octet for sta_info_len twice (it's part of itself, and in the
fixed portion). Like in ieee80211_mle_reconf_sta_prof_size_ok,
subtract 1 to adjust that.

When reading the elements we did take this into account, and
since there are always elements, this never really mattered.

Fixes: 7b6f08771bf6 ("wifi: ieee80211: Support validating ML station profile length")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.00bb0b20ed60.I8c41dd6fc14c4b187ab901dea15ade73c79fb98c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: ieee80211: check for NULL in ieee80211_mle_size_ok()
Johannes Berg [Mon, 18 Mar 2024 16:53:17 +0000 (18:53 +0200)]
wifi: ieee80211: check for NULL in ieee80211_mle_size_ok()

For simplicity, we may want to pass a NULL element, and
while we should then pass also a zero length, just be a
bit more careful here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.4d983653cb8d.Ic3ea99b60c61ac2f7d38cb9fd202a03c97a05601@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211_hwsim: set link ID information during Rx
Aditya Kumar Singh [Wed, 13 Mar 2024 14:54:02 +0000 (20:24 +0530)]
wifi: mac80211_hwsim: set link ID information during Rx

Currently link ID information is not passed to mac80211 via Rx status by
mac80211_hwsim. This leads to packet getting dropped in function
__ieee80211_rx_handle_packet since it expects the link ID if packet is
intended for a MLO station and the station is not directly passed via
pubsta function argument.

Add changes to pass the link ID information in Rx status.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://msgid.link/20240313145402.456514-1-quic_adisi@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: nl80211: cleanup nl80211.h kernel-doc
Jeff Johnson [Tue, 19 Mar 2024 18:26:25 +0000 (11:26 -0700)]
wifi: nl80211: cleanup nl80211.h kernel-doc

Fix all of the kernel-doc issues in nl80211.h.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://msgid.link/20240319-kdoc-nl80211-v1-3-549e09d52866@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: nl80211: fix nl80211 uapi comment style issues
Jeff Johnson [Tue, 19 Mar 2024 18:26:24 +0000 (11:26 -0700)]
wifi: nl80211: fix nl80211 uapi comment style issues

Currently kernel-doc raises "warning: bad line:" for several comments
that have invalid multi-line comment style; they are missing the
leading '*'. And checkpatch.pl raises "WARNING: please, no space
before tabs" for a large number of comments which have space then tab
after the leading '*'.

Fix those issues.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://msgid.link/20240319-kdoc-nl80211-v1-2-549e09d52866@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: nl80211: rename enum plink_actions
Jeff Johnson [Tue, 19 Mar 2024 18:26:23 +0000 (11:26 -0700)]
wifi: nl80211: rename enum plink_actions

kernel-doc flagged the following issue:
include/uapi/linux/nl80211.h:6081: warning: expecting prototype for enum nl80211_plink_action. Prototype was for enum plink_actions instead

This is because the documentation doesn't match the code. Normally the
correct fix for such an issue is to modify the documentation to match
the code. However, in this case, since the actual name plink_actions
is not referenced by any code, rename it to nl80211_plink_action to
give it a proper prefix and match the documentation.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://msgid.link/20240319-kdoc-nl80211-v1-1-549e09d52866@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: spectmgmt: simplify 6 GHz HE/EHT handling
Johannes Berg [Tue, 12 Mar 2024 10:20:48 +0000 (11:20 +0100)]
wifi: mac80211: spectmgmt: simplify 6 GHz HE/EHT handling

Clean up the code here a bit to have only a single call
to ieee80211_chandef_he_6ghz_oper() by using a local
pointer variable for the difference.

Link: https://msgid.link/20240312112048.94c421d767f9.Ia7ca2f315b392c74d39b44fa9eb872a2e62e75c1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: supplement parsing of puncturing bitmap
Kang Yang [Tue, 12 Mar 2024 04:59:46 +0000 (12:59 +0800)]
wifi: mac80211: supplement parsing of puncturing bitmap

Current mac80211 won't parsing puncturing bitmap when process EHT
Operation element in 6 GHz band or Bandwidth Indication element. This
leads to puncturing bitmap cannot be updated in related situations, such
as connecting to an EHT AP in 6 GHz band.

So supplement parsing of puncturing bitmap for these elements.

Signed-off-by: Kang Yang <quic_kangyang@quicinc.com>
Link: https://msgid.link/20240312045947.576231-2-quic_kangyang@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: pcie: remove duplicate PCI IDs entry
Johannes Berg [Mon, 11 Mar 2024 06:28:15 +0000 (08:28 +0200)]
wifi: iwlwifi: pcie: remove duplicate PCI IDs entry

There's a duplicate entry for 0x51f1, which shouldn't be present,
though the first entry will correctly be taken. Remove the second
one.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240311081938.3e995954d519.I0d028993e17e26b63c0ee89d7b1714ec88f2a158@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: Refactor scan start
Ilan Peer [Mon, 11 Mar 2024 06:28:12 +0000 (08:28 +0200)]
wifi: iwlwifi: mvm: Refactor scan start

To support staring internal scan, refactor the scan code such
that the body iwl_mvm_reg_scan_start() is now moved to a local
function that can be used by other flows as well.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240311081938.e7833d4cfc53.I43c1c533c2a5243229002fde6360d423946c54fa@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: advertise IEEE80211_HW_HANDLES_QUIET_CSA
Johannes Berg [Mon, 11 Mar 2024 06:28:11 +0000 (08:28 +0200)]
wifi: iwlwifi: mvm: advertise IEEE80211_HW_HANDLES_QUIET_CSA

The firmware has handled quiet in CSA for a long time now, but
it didn't really matter much. However, now with quiet CSA on a
perhaps secondary link, we don't want mac80211 to stop queues,
we can continue using a link that's not requiring quiet. Set
the feature flag for MLO-capable devices indicating that we'll
handle the quiet entirely in the driver/device.

However, the firmware doesn't handle quiet in AP mode since we
don't really expect to really be needing that (without radar
detection), but - even for testing - make that work properly
by simply not pulling from TXQs in this scenario.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240311081938.fa75403b5eaa.Ie3ff02215f810fcfefd6a22c481567f94f61c0c6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: fix flushing during quiet CSA
Johannes Berg [Mon, 11 Mar 2024 06:28:10 +0000 (08:28 +0200)]
wifi: iwlwifi: mvm: fix flushing during quiet CSA

If, for any reason, we're going to attempt to flush the queues
while quiet CSA is happening, this cannot succeed. This could
be the case if for example mac80211 were to flush after TXing
e.g. a deauth frame due to disconnecting during the CSA.

In this case, drop the frames instead, the firmware won't let
us do any transmissions and may also become unhappy if we're
not going to disconnect quickly enough.

Currently this doesn't happen as mac80211 stops queues, but
we'll want to let mac80211 know not to stop queues for proper
multi-link support during CSA, so we need to handle this case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240311081938.d5d629f32ea8.I86d9b849d92273542bfc2d9c671b66179e7ebb72@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: support wowlan notif version 4
Shaul Triebitz [Mon, 11 Mar 2024 06:28:09 +0000 (08:28 +0200)]
wifi: iwlwifi: mvm: support wowlan notif version 4

In version 4, in case of MLO GTK rekey during D3,
the firmware sends all the new keys, including
the keys on the non-active links.

Update also the non active link keys.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240311081938.6524de988ed3.Id065ddd2f4a71b0243c33ae0c5476ac41bfe2dc2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: skip keys of other links
Shaul Triebitz [Mon, 11 Mar 2024 06:28:08 +0000 (08:28 +0200)]
wifi: iwlwifi: mvm: skip keys of other links

When waking up from wowlan, we iterate over the current
keys and remove those that were rekeyed.
With MLO, there might be keys of other links which should
not be removed.
Skip MLO keys on other links (other than the wowlan
active link).

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240311081938.fdf527b50d61.I605a971d2d68107769dd363b896b471998259e64@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: stop assuming sta id 0 in d3
Shaul Triebitz [Mon, 11 Mar 2024 06:28:07 +0000 (08:28 +0200)]
wifi: iwlwifi: mvm: stop assuming sta id 0 in d3

In MLO, the station id in d3 can be other than 0.
Do not assume the station id is 0 when waking
up from d3.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240311081938.6379619f2987.I83de9d868224df76eee8df8dbcf352636535821a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: fix the sta id in offload
Shaul Triebitz [Mon, 11 Mar 2024 06:28:06 +0000 (08:28 +0200)]
wifi: iwlwifi: mvm: fix the sta id in offload

With MLO, the station id in wowlan can be other than 0.
Set the correct station in the protocol offload command.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240311081938.ace4f793872d.Id984110576a72acc84493217ca95564c3cd362bd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: Move beacon filtering to be per link
Ilan Peer [Mon, 11 Mar 2024 06:28:04 +0000 (08:28 +0200)]
wifi: iwlwifi: mvm: Move beacon filtering to be per link

As the FW statistics are per link context and not per MAC context.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240311081938.47bdecc68e73.Icc0eaebb35d119f8c538c068fbc8f874aac194c3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: fix firmware API kernel doc
Shaul Triebitz [Mon, 11 Mar 2024 06:28:03 +0000 (08:28 +0200)]
wifi: iwlwifi: fix firmware API kernel doc

Fix the comment of the associated struct of the
wowlan info notification.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240311081938.2ea25f49489b.I83fa1cdc39f74ad2aacf75c2c14412eeaf93e787@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: qtnfmac: allocate dummy net_device dynamically
Breno Leitao [Tue, 19 Mar 2024 17:26:19 +0000 (10:26 -0700)]
wifi: qtnfmac: allocate dummy net_device dynamically

Embedding net_device into structures prohibits the usage of flexible
arrays in the net_device structure. For more details, see the discussion
at [1].

Un-embed the net_device from struct qtnf_bus by converting it
into a pointer. Then use the leverage alloc_netdev() to allocate the
net_device object at qtnf_pcie_probe(). The free of the device occurs at
qtnf_pcie_remove().

[1] https://lore.kernel.org/all/20240229225910.79e224cf@kernel.org/

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240319172634.894327-1-leitao@debian.org
6 months agowifi: mt76: mt7915: workaround too long expansion sparse warnings
Lorenzo Bianconi [Tue, 19 Mar 2024 15:12:47 +0000 (16:12 +0100)]
wifi: mt76: mt7915: workaround too long expansion sparse warnings

Fix the following sparse warnings:

drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c:1133:29: error: too long token expansion
drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c:1133:29: error: too long token expansion
drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c:1133:29: error: too long token expansion
drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c:1133:29: error: too long token expansion

No functional changes, compile tested only.

Fixes: e3296759f347 ("wifi: mt76: mt7915: enable per bandwidth power limit support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/5457b92e41909dd75ab3db7a0e9ec372b917a386.1710858172.git.lorenzo@kernel.org
6 months agowifi: ti: Convert sprintf/snprintf to sysfs_emit
Li Zhijian [Fri, 15 Mar 2024 05:52:11 +0000 (13:52 +0800)]
wifi: ti: Convert sprintf/snprintf to sysfs_emit

Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

sprintf() will be converted as weel if they have.

Generally, this patch is generated by
make coccicheck M=<path/to/file> MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

CC: Kalle Valo <kvalo@kernel.org>
CC: linux-wireless@vger.kernel.org
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240315055211.1347548-3-lizhijian@fujitsu.com
6 months agowifi: b43: Convert sprintf/snprintf to sysfs_emit
Li Zhijian [Fri, 15 Mar 2024 05:52:10 +0000 (13:52 +0800)]
wifi: b43: Convert sprintf/snprintf to sysfs_emit

Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

sprintf() will be converted as weel if they have.

Generally, this patch is generated by
make coccicheck M=<path/to/file> MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

CC: Larry Finger <Larry.Finger@lwfinger.net>
CC: Kalle Valo <kvalo@kernel.org>
CC: linux-wireless@vger.kernel.org
CC: b43-dev@lists.infradead.org
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240315055211.1347548-2-lizhijian@fujitsu.com
6 months agowifi: mwifiex: Add missing MODULE_FIRMWARE() for SD8801
Víctor Gonzalo [Wed, 13 Mar 2024 18:31:56 +0000 (20:31 +0200)]
wifi: mwifiex: Add missing MODULE_FIRMWARE() for SD8801

The module metadata for the firmware file mrvl/sd8801_uapsta.bin
is missing.

Signed-off-by: Víctor Gonzalo <victor.gonzalo@anddroptable.net>
Acked-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240313183156.2234301-1-victor.gonzalo@anddroptable.net
6 months agowifi: rtw88: SDIO device driver for RTL8723CS
Fiona Klute [Mon, 11 Mar 2024 10:37:13 +0000 (11:37 +0100)]
wifi: rtw88: SDIO device driver for RTL8723CS

This driver uses the new rtw8703b chip driver code.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For SDIO
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240311103735.615541-10-fiona.klute@gmx.de
6 months agowifi: rtw88: Reset 8703b firmware before download
Fiona Klute [Mon, 11 Mar 2024 10:37:12 +0000 (11:37 +0100)]
wifi: rtw88: Reset 8703b firmware before download

Sometimes 8703b firmware is still active from previous use when the
driver needs to download the firmware during MAC activation. Reset it
in that case.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240311103735.615541-9-fiona.klute@gmx.de
6 months agowifi: rtw88: Add rtw8703b_tables.c
Fiona Klute [Mon, 11 Mar 2024 10:37:11 +0000 (11:37 +0100)]
wifi: rtw88: Add rtw8703b_tables.c

Initialization tables for rtw8703b: Initial register values and TX
power limits.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240311103735.615541-8-fiona.klute@gmx.de
6 months agowifi: rtw88: Add rtw8703b_tables.h
Fiona Klute [Mon, 11 Mar 2024 10:37:10 +0000 (11:37 +0100)]
wifi: rtw88: Add rtw8703b_tables.h

Initialization table definitions for rtw8703b.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240311103735.615541-7-fiona.klute@gmx.de
6 months agowifi: rtw88: Add rtw8703b.c
Fiona Klute [Mon, 11 Mar 2024 10:37:09 +0000 (11:37 +0100)]
wifi: rtw88: Add rtw8703b.c

This is the main source for the new rtw88_8703b chip driver.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240311103735.615541-6-fiona.klute@gmx.de
6 months agowifi: rtw88: Add rtw8703b.h
Fiona Klute [Mon, 11 Mar 2024 10:37:08 +0000 (11:37 +0100)]
wifi: rtw88: Add rtw8703b.h

This is the main header for the new rtw88_8703b chip driver.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240311103735.615541-5-fiona.klute@gmx.de
6 months agowifi: rtw88: Add definitions for 8703b chip
Fiona Klute [Mon, 11 Mar 2024 10:37:07 +0000 (11:37 +0100)]
wifi: rtw88: Add definitions for 8703b chip

default_cck_index is used in power track, the rx_cck_agc_report_type
for RX PHY status. GET_RX_DESC_BW is an RX descriptor field not used
by the other chip drivers.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240311103735.615541-4-fiona.klute@gmx.de
6 months agowifi: rtw88: Debug output for rtw8723x EFUSE
Fiona Klute [Mon, 11 Mar 2024 10:37:06 +0000 (11:37 +0100)]
wifi: rtw88: Debug output for rtw8723x EFUSE

Some 8703b chips contain invalid EFUSE data, getting detailed
information is critical when analyzing issues caused by that.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240311103735.615541-3-fiona.klute@gmx.de
6 months agowifi: rtw88: Shared module for rtw8723x devices
Fiona Klute [Mon, 11 Mar 2024 10:37:05 +0000 (11:37 +0100)]
wifi: rtw88: Shared module for rtw8723x devices

The already supported 8723d chip is very similar to 8703b/8723cs,
split code that can be shared into a new module. The spec definition
tables are combined into a struct so we only need one EXPORT_SYMBOL
for them all.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240311103735.615541-2-fiona.klute@gmx.de
6 months agowifi: rtw89: 8922a: add 8922ae to Makefile and Kconfig
Ping-Ke Shih [Tue, 12 Mar 2024 01:37:21 +0000 (09:37 +0800)]
wifi: rtw89: 8922a: add 8922ae to Makefile and Kconfig

Add 8922AE to Makefile and Kconfig. Currently, it can support STA, AP and
monitor modes with good performance. Implemented initial BT-coexistence
function only, and will to fine tune this component.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240312013721.17452-7-pkshih@realtek.com
6 months agowifi: rtw89: 8922a: update chip parameter for coex
Ching-Te Ku [Tue, 12 Mar 2024 01:37:20 +0000 (09:37 +0800)]
wifi: rtw89: 8922a: update chip parameter for coex

Implement the chip operation function for 8922a, it related to TX power,
RX gain, antenna position, packet priority and so on. Also assign
coexistence priority table for hardware PTA using. Add settings to avoid
uncertainties propagation when Wi-Fi Rx due to RF gain mismatch.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240312013721.17452-6-pkshih@realtek.com
6 months agowifi: rtw89: coex: Add TDMA slot parameter setting version 7
Ching-Te Ku [Tue, 12 Mar 2024 01:37:19 +0000 (09:37 +0800)]
wifi: rtw89: coex: Add TDMA slot parameter setting version 7

In order to packet up the slots information, the TLV header has updated.
TDMA slot parameters also use the TLV header to packet up to H2C, so
upgrade to version 7.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240312013721.17452-5-pkshih@realtek.com
6 months agowifi: rtw89: coex: Add TDMA version 7
Ching-Te Ku [Tue, 12 Mar 2024 01:37:18 +0000 (09:37 +0800)]
wifi: rtw89: coex: Add TDMA version 7

In order to packet up the slots information, the TLV header has updated.
TDMA also use the TLV header to packet up to H2C, so upgrade to version 7.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240312013721.17452-4-pkshih@realtek.com
6 months agowifi: rtw89: coex: Add antenna setting function for RTL8922A
Ching-Te Ku [Tue, 12 Mar 2024 01:37:17 +0000 (09:37 +0800)]
wifi: rtw89: coex: Add antenna setting function for RTL8922A

Because there is new hardware structure and Wi-Fi 7 protocol,
the antenna settings need to concern more complex for Wi-Fi 7
using. The antenna setting included grant control signal, they
decide which MAC/Port or Bluetooth can do traffic.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240312013721.17452-3-pkshih@realtek.com
6 months agowifi: rtw89: coex: Add WiFi role info format version 8
Ching-Te Ku [Tue, 12 Mar 2024 01:37:16 +0000 (09:37 +0800)]
wifi: rtw89: coex: Add WiFi role info format version 8

In order to control the hardware band and related protocol control,
add version 8 format and related logic to control the mechanism.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240312013721.17452-2-pkshih@realtek.com
6 months agossb: use "break" on default case to prevent warning
Randy Dunlap [Wed, 13 Mar 2024 00:13:03 +0000 (17:13 -0700)]
ssb: use "break" on default case to prevent warning

Having an empty default: case in a switch statement causes a warning
(when using Clang; I don't see the warning when using gcc),
so add a "break;" to the default case to prevent the warning:

drivers/ssb/main.c:1149:2: warning: label at end of compound statement is a C2x extension [-Wc2x-extensions]

Fixes: e27b02e23a70 ("ssb: drop use of non-existing CONFIG_SSB_DEBUG symbol")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202403130717.TWm17FiD-lkp@intel.com/
Cc: Michael Büsch <m@bues.ch>
Cc: linux-wireless@vger.kernel.org
Cc: Kalle Valo <kvalo@kernel.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: llvm@lists.linux.dev
Acked-by: Michael Büsch <m@bues.ch>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240313001305.18820-1-rdunlap@infradead.org
6 months agossb: drop use of non-existing CONFIG_SSB_DEBUG symbol
Randy Dunlap [Sat, 9 Mar 2024 22:45:38 +0000 (14:45 -0800)]
ssb: drop use of non-existing CONFIG_SSB_DEBUG symbol

CONFIG_SSB_DEBUG is used in one header file and nowhere else, so
remove it and the now-empty inline function that contained it. Also
remove the call to the empty inline function. The empty "default:"
case is kept to prevent 2 compiler warnings:

  drivers/ssb/main.c:1133:9: warning: enumeration value 'SSB_BUSTYPE_PCMCIA' not handled in switch [-Wswitch]
  drivers/ssb/main.c:1133:9: warning: enumeration value 'SSB_BUSTYPE_SDIO' not handled in switch [-Wswitch]

Reported-by: Ying Sun <sunying@isrc.iscas.ac.cn>
Link: https://lore.kernel.org/lkml/4e8525fe.607e2.18a8ddfdce8.Coremail.sunying@isrc.iscas.ac.cn/
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Michael Büsch <m@bues.ch>
Cc: linux-wireless@vger.kernel.org
Cc: Kalle Valo <kvalo@kernel.org>
Acked-by: Michael Büsch <m@bues.ch>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240309224540.22682-1-rdunlap@infradead.org
6 months agodt-bindings: net: wireless: brcm,bcm4329-fmac: Add CYW43439 DT binding
Marek Vasut [Sat, 9 Mar 2024 03:13:17 +0000 (04:13 +0100)]
dt-bindings: net: wireless: brcm,bcm4329-fmac: Add CYW43439 DT binding

CYW43439 is a Wi-Fi + Bluetooth combo device from Infineon. The
WiFi part is capable of 802.11 b/g/n. This chip is present e.g.
on muRata 1YN module. Extend the binding with its DT compatible.

Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240309031355.269835-1-marex@denx.de
6 months agobcma: convert to platform remove callback returning void
Uwe Kleine-König [Fri, 8 Mar 2024 08:51:03 +0000 (09:51 +0100)]
bcma: convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/a92e4b2f7aace64a1e3a91af7974a6982700a18f.1709886922.git.u.kleine-koenig@pengutronix.de
6 months agowifi: brcmfmac: pcie: handle randbuf allocation failure
Duoming Zhou [Wed, 6 Mar 2024 14:04:37 +0000 (22:04 +0800)]
wifi: brcmfmac: pcie: handle randbuf allocation failure

The kzalloc() in brcmf_pcie_download_fw_nvram() will return null
if the physical memory has run out. As a result, if we use
get_random_bytes() to generate random bytes in the randbuf, the
null pointer dereference bug will happen.

In order to prevent allocation failure, this patch adds a separate
function using buffer on kernel stack to generate random bytes in
the randbuf, which could prevent the kernel stack from overflow.

Fixes: 91918ce88d9f ("wifi: brcmfmac: pcie: Provide a buffer of random bytes to the device")
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240306140437.18177-1-duoming@zju.edu.cn
6 months agossb: Fix potential NULL pointer dereference in ssb_device_uevent()
Rand Deeb [Wed, 6 Mar 2024 12:30:28 +0000 (15:30 +0300)]
ssb: Fix potential NULL pointer dereference in ssb_device_uevent()

The ssb_device_uevent() function first attempts to convert the 'dev' pointer
to 'struct ssb_device *'. However, it mistakenly dereferences 'dev' before
performing the NULL check, potentially leading to a NULL pointer
dereference if 'dev' is NULL.

To fix this issue, move the NULL check before dereferencing the 'dev' pointer,
ensuring that the pointer is valid before attempting to use it.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Rand Deeb <rand.sec96@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240306123028.164155-1-rand.sec96@gmail.com
6 months agowifi: rtw89: Correct EHT TX rate on 20MHz connection
Dian-Syuan Yang [Tue, 5 Mar 2024 00:45:02 +0000 (08:45 +0800)]
wifi: rtw89: Correct EHT TX rate on 20MHz connection

We used EHT capability of 20MHz-only as rate mask to RA (rate adaptive)
H2C command when connecting with AP set EHT 20MHz. It would get the
wrong rate mask and the MCS rate can only reach MCS11.

According to the description of 802.11be spec, if all supported channel
bandwidth field of HE PHY capabilities are zero, then the EHT capability
of 20MHz-only is valid. As a result, we adjust the code to set correct
rate mask based on HE PHY bandwidth capability.

Signed-off-by: Dian-Syuan Yang <dian_syuan0116@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240305004502.6655-1-pkshih@realtek.com
6 months agoMerge branch 'qmc-hdlc'
David S. Miller [Mon, 11 Mar 2024 09:36:11 +0000 (09:36 +0000)]
Merge branch 'qmc-hdlc'

Herve Codina says:

====================
Add support for QMC HDLC

This series introduces the QMC HDLC support.

Patches were previously sent as part of a full feature series and were
previously reviewed in that context:
"Add support for QMC HDLC, framer infrastructure and PEF2256 framer" [1]

In order to ease the merge, the full feature series has been split and
needed parts were merged in v6.8-rc1:
 - "Prepare the PowerQUICC QMC and TSA for the HDLC QMC driver" [2]
 - "Add support for framer infrastructure and PEF2256 framer" [3]

This series contains patches related to the QMC HDLC part (QMC HDLC
driver):
 - Introduce the QMC HDLC driver (patches 1 and 2)
 - Add timeslots change support in QMC HDLC (patch 3)
 - Add framer support as a framer consumer in QMC HDLC (patch 4)

Compare to the original full feature series, a modification was done on
patch 3 in order to use a coherent prefix in the commit title.

I kept the patches unsquashed as they were previously sent and reviewed.
Of course, I can squash them if needed.

Compared to the previous iteration:
  https://lore.kernel.org/linux-kernel/20240306080726.167338-1-herve.codina@bootlin.com/
this v7 series mainly:
- Rename a variable.
- Fix reverse xmas tree declarations.
- Add 'Acked-by' tag.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 months agonet: wan: fsl_qmc_hdlc: Add framer support
Herve Codina [Thu, 7 Mar 2024 11:39:08 +0000 (12:39 +0100)]
net: wan: fsl_qmc_hdlc: Add framer support

Add framer support in the fsl_qmc_hdlc driver in order to be able to
signal carrier changes to the network stack based on the framer status
Also use this framer to provide information related to the E1/T1 line
interface on IF_GET_IFACE and configure the line interface according to
IF_IFACE_{E1,T1} information.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 months agonet: wan: fsl_qmc_hdlc: Add runtime timeslots changes support
Herve Codina [Thu, 7 Mar 2024 11:39:07 +0000 (12:39 +0100)]
net: wan: fsl_qmc_hdlc: Add runtime timeslots changes support

QMC channels support runtime timeslots changes but nothing is done at
the QMC HDLC driver to handle these changes.

Use existing IFACE ioctl in order to configure the timeslots to use.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 months agolib/bitmap: Introduce bitmap_scatter() and bitmap_gather() helpers
Andy Shevchenko [Thu, 7 Mar 2024 11:39:06 +0000 (12:39 +0100)]
lib/bitmap: Introduce bitmap_scatter() and bitmap_gather() helpers

These helpers scatters or gathers a bitmap with the help of the mask
position bits parameter.

bitmap_scatter() does the following:
  src:  0000000001011010
                  ||||||
           +------+|||||
           |  +----+||||
           |  |+----+|||
           |  ||   +-+||
           |  ||   |  ||
  mask: ...v..vv...v..vv
        ...0..11...0..10
  dst:  0000001100000010

and bitmap_gather() performs this one:
   mask: ...v..vv...v..vv
   src:  0000001100000010
            ^  ^^   ^   0
            |  ||   |  10
            |  ||   > 010
            |  |+--> 1010
            |  +--> 11010
            +----> 011010
   dst:  0000000000011010

bitmap_gather() can the seen as the reverse bitmap_scatter() operation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/lkml/20230926052007.3917389-3-andriy.shevchenko@linux.intel.com/
Co-developed-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 months agoMAINTAINERS: Add the Freescale QMC HDLC driver entry
Herve Codina [Thu, 7 Mar 2024 11:39:05 +0000 (12:39 +0100)]
MAINTAINERS: Add the Freescale QMC HDLC driver entry

After contributing the driver, add myself as the maintainer for the
Freescale QMC HDLC driver.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 months agonet: wan: Add support for QMC HDLC
Herve Codina [Thu, 7 Mar 2024 11:39:04 +0000 (12:39 +0100)]
net: wan: Add support for QMC HDLC

The QMC HDLC driver provides support for HDLC using the QMC (QUICC
Multichannel Controller) to transfer the HDLC data.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 months agoMerge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next...
David S. Miller [Mon, 11 Mar 2024 09:33:01 +0000 (09:33 +0000)]
Merge branch '100GbE' of git://git./linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
ethtool: ice: Support for RSS settings to GTP

Takeru Hayasaka enables RSS functionality for GTP packets on ice driver
with ethtool.

A user can include TEID and make RSS work for GTP-U over IPv4 by doing the
following:`ethtool -N ens3 rx-flow-hash gtpu4 sde`

In addition to gtpu(4|6), we now support gtpc(4|6),gtpc(4|6)t,gtpu(4|6)e,
gtpu(4|6)u, and gtpu(4|6)d.

gtpc(4|6): Used for GTP-C in IPv4 and IPv6, where the GTP header format does
not include a TEID.
gtpc(4|6)t: Used for GTP-C in IPv4 and IPv6, with a GTP header format that
includes a TEID.
gtpu(4|6): Used for GTP-U in both IPv4 and IPv6 scenarios.
gtpu(4|6)e: Used for GTP-U with extended headers in both IPv4 and IPv6.
gtpu(4|6)u: Used when the PSC (PDU session container) in the GTP-U extended
header includes Uplink, applicable to both IPv4 and IPv6.
gtpu(4|6)d: Used when the PSC in the GTP-U extended header includes Downlink,
for both IPv4 and IPv6.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>