platform/kernel/linux-rpi.git
13 months agowifi: mac80211: implement proper AP MLD HW restart
Johannes Berg [Thu, 4 May 2023 13:45:11 +0000 (16:45 +0300)]
wifi: mac80211: implement proper AP MLD HW restart

Previously, I didn't implement restarting here at all if the
interface is an MLD, so it only worked for non-MLO. Add the
needed code to restart an AP MLD correctly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230504134511.828474-12-gregory.greenman@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: fetch and store the EML capability information
Emmanuel Grumbach [Thu, 4 May 2023 13:45:10 +0000 (16:45 +0300)]
wifi: mac80211: fetch and store the EML capability information

We need to teach the low level driver about the EML capability which
includes information for EMLSR / EMLMR operation.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230504134511.828474-11-gregory.greenman@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: skip EHT BSS membership selector
Johannes Berg [Thu, 4 May 2023 13:45:08 +0000 (16:45 +0300)]
wifi: mac80211: skip EHT BSS membership selector

Skip the EHT BSS membership selector for getting rates.
While at it, add the definitions for GLK and EPS, and
sort the list.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230504134511.828474-9-gregory.greenman@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211_hwsim: avoid warning with MLO PS stations
Johannes Berg [Thu, 4 May 2023 13:45:07 +0000 (16:45 +0300)]
wifi: mac80211_hwsim: avoid warning with MLO PS stations

If the station disables all links it's in powersave and
we shouldn't transmit anything to it, but we don't handle
that correctly yet. For now, just avoid the warning, once
we really add support for this case we can revert to the
old warning.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230504134511.828474-8-gregory.greenman@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: remove element scratch_len
Johannes Berg [Tue, 6 Jun 2023 12:13:20 +0000 (14:13 +0200)]
wifi: mac80211: remove element scratch_len

This isn't used, and there isn't really a good way it
could be used, so just remove that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: HW restart for MLO
Johannes Berg [Thu, 4 May 2023 13:45:05 +0000 (16:45 +0300)]
wifi: mac80211: HW restart for MLO

Implement proper reconfiguration for interfaces that are
doing MLO, in order to be able to recover from HW restart
correctly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230504134511.828474-6-gregory.greenman@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: pnvm: handle memory descriptor tlv
Gregory Greenman [Tue, 6 Jun 2023 07:43:10 +0000 (10:43 +0300)]
wifi: iwlwifi: pnvm: handle memory descriptor tlv

When PNVM is obtained from UEFI, there's an additional memory
descriptor TLV that has to be handled. It is the same TLV that
holds data in the reduced power tables. Also, in this TLV, the
actual data is located after address and size, so add the
corresponding offset.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.8c5f5ee8e30b.Id1893c9dec140b5ba4abe8a121c2e1a1d121d2d7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: fw: don't use constant size with efi.get_variable
Gregory Greenman [Tue, 6 Jun 2023 07:43:09 +0000 (10:43 +0300)]
wifi: iwlwifi: fw: don't use constant size with efi.get_variable

Use efi.get_variable() with NULL pointer for data in order to
obtain entry size and then call it again with the correct size
to get the entry itself.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.ef95a8055a50.Iae5389baaf0a9a3c89469f7502275ee119d378b6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: fw: clean up PNVM loading code
Johannes Berg [Tue, 6 Jun 2023 07:43:08 +0000 (10:43 +0300)]
wifi: iwlwifi: fw: clean up PNVM loading code

This code is a bit of a maze of gotos etc. Clean up the
code a bit to make the intent clearer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.51fb5ee63f21.I20f270b2d47612e84643dc235c2940b8d9ed9930@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Separate reading and parsing of reduce power table
Alon Giladi [Tue, 6 Jun 2023 07:43:07 +0000 (10:43 +0300)]
wifi: iwlwifi: Separate reading and parsing of reduce power table

It enables to better handle error cases. Also save the image till the
end of the loading and only then free it.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.71e3b3e0e794.Ifbe69ad99a7e805eb70e09280365821eb146b1c9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Enable loading of reduce-power tables into several segments
Alon Giladi [Tue, 6 Jun 2023 07:43:06 +0000 (10:43 +0300)]
wifi: iwlwifi: Enable loading of reduce-power tables into several segments

Replace the field reduce_power_dram with a struct that holds data about
the reduced-power tables drams regions. Generalize load_payloads_segments()
to work for both pnvm tables and reduction power tables.
Make required adjustments in the data structures.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.6fe66958f049.I85d80682229fc02fe354462cc9da40937558f30c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Use iwl_pnvm_image in reduce power tables flow
Alon Giladi [Tue, 6 Jun 2023 07:43:05 +0000 (10:43 +0300)]
wifi: iwlwifi: Use iwl_pnvm_image in reduce power tables flow

Generalize the parsing, loading, and setting of the power-reduce
tables, in order to support allocation of several DRAM payloads
in the future.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.564f1eead99b.Iaba653b21dc09aafc72b9bbb3928abddce0db50a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Separate loading and setting of power reduce tables
Alon Giladi [Tue, 6 Jun 2023 07:43:04 +0000 (10:43 +0300)]
wifi: iwlwifi: Separate loading and setting of power reduce tables

Take the part that copies the tables into DRAM, out of the method
that sets the prph_scratch to make the code cleaner. Each of the
operations will get more complex in the future when it will also
support larger power-reduce tables images.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.7695684dc848.I13626cd318e5d68efec9618b2045f52788bff114@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Implement loading and setting of fragmented pnvm image
Alon Giladi [Tue, 6 Jun 2023 07:43:03 +0000 (10:43 +0300)]
wifi: iwlwifi: Implement loading and setting of fragmented pnvm image

Save the pnvm payloads in several DRAM segments (not only in one as
used to). In addition, allocate a FW structure in DRAM that holds the
segments' addresses and forward its address to the FW. It's done when
FW has the capability to handle pnvm images this way (helps to process
large pnvm images).

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.dbdad8995ce1.I986213527982637042532de3851a1bd8a11be87a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Add support for fragmented pnvm images
Alon Giladi [Tue, 6 Jun 2023 07:43:02 +0000 (10:43 +0300)]
wifi: iwlwifi: Add support for fragmented pnvm images

Add support for fragmented pnvm images, depending on the FW capability.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.c49bfaf435a9.I0278312e7c3355b224cd870d4f8cf6578d12f03e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Allow trans_pcie track more than 1 pnvm DRAM region
Alon Giladi [Tue, 6 Jun 2023 07:43:01 +0000 (10:43 +0300)]
wifi: iwlwifi: Allow trans_pcie track more than 1 pnvm DRAM region

Change the field pnvm_dram to an array that describes many regions
and add a counter to the number of pnvm regions that were allocated
in DRAM.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.bb206d71bf45.I627640701757bb2f234f8e18a3afbd6af1206658@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Take loading and setting of pnvm image out of parsing part
Alon Giladi [Tue, 6 Jun 2023 07:43:00 +0000 (10:43 +0300)]
wifi: iwlwifi: Take loading and setting of pnvm image out of parsing part

Change iwl_pnvm_parse so it will only save the information into the
iwl_pnvm_image struct. This enables to use the parsing code for the
power reduce tables in the future.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.504b42fc1611.I4ddf6ad76d922d118fcbcc4f0e9ec003753d0b75@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Separate loading and setting of pnvm image into two functions
Alon Giladi [Tue, 6 Jun 2023 07:42:59 +0000 (10:42 +0300)]
wifi: iwlwifi: Separate loading and setting of pnvm image into two functions

Take the part that is copying the pnvm image into DRAM, out of the
the method that sets the prph_scratch. Makes the code cleaner since
those 2 operations don't always happen together (loading should happen
only once while setting can happen more than once).
In addition, each operation will get more complex in the future when
it will support also larger pnvm images.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.4c0728239fd6.Ibc30a9fbdb6123dadbe2dbb89318dbd5ec01080a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Generalize the parsing of the pnvm image
Alon Giladi [Tue, 6 Jun 2023 07:42:58 +0000 (10:42 +0300)]
wifi: iwlwifi: Generalize the parsing of the pnvm image

Generalize iwl_pnvm_parse(). This saves us from copying each payload
twice (first in the parsing and later when copying it to the dram).
Moreover, its  more compatible for handling larger pnvm tables in
the future (in which payloads won't be concatenated).

The main changes are:

1. Take out the concatenating of the payloads from the parsing level
2. Start using iwl_pnvm_image structure that will hold pointers to
payloads that should be delivered to fw, their sizes and number.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.06c02f380b6f.I03a3030fca194aa0c4bc2ecd18531f8914e98cfd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: api: fix kernel-doc links
Johannes Berg [Thu, 1 Jun 2023 14:20:06 +0000 (17:20 +0300)]
wifi: iwlwifi: api: fix kernel-doc links

Some of the kernel-doc links are outdated due to other
changes, fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230601171633.85e2cf489893.Ie3889ea6f755b80c988543ccca56c67420c51b1f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: api: remove unused commands
Johannes Berg [Thu, 1 Jun 2023 14:20:05 +0000 (17:20 +0300)]
wifi: iwlwifi: api: remove unused commands

Some commands are no longer used and have broken kernel-doc links,
so just remove them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230601171633.3dad4ad9b53e.I018abd02d6925950b8748dfb7a59db87255fc670@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: api: use __le16 instead of u16
Johannes Berg [Thu, 1 Jun 2023 14:20:04 +0000 (17:20 +0300)]
wifi: iwlwifi: api: use __le16 instead of u16

Even for reserved values we shouldn't use u16, that's just
error prone. Fix this to __le16.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230601171633.29ebf70aa64e.I1263f6724e1c70ff5541f447b9744f143ee736a3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: api: link context action in kernel-doc
Johannes Berg [Thu, 1 Jun 2023 14:20:03 +0000 (17:20 +0300)]
wifi: iwlwifi: api: link context action in kernel-doc

This is clearer in kernel-doc than spelling out the prefix.
It also lets us generate better tracing data.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230601171633.e11ece794f60.I9874c7b0437071a2620d68ca5a16efed60da07a9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: tell firmware about per-STA MFP enablement
Johannes Berg [Thu, 1 Jun 2023 06:52:46 +0000 (09:52 +0300)]
wifi: iwlwifi: mvm: tell firmware about per-STA MFP enablement

Indicate to the firmware for each station whether or not MFP
is used with this station. Note that we indicate MFP for it
before authorized since we don't know yet, and that will make
the firmware not handle should-be-protected management frames
without being able to check them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230601095201.b1052f39af4c.I1b46b751d5808e65ea3d0e7b8b38209c5aecf042@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: send time sync only if needed
Johannes Berg [Wed, 31 May 2023 16:50:06 +0000 (19:50 +0300)]
wifi: iwlwifi: mvm: send time sync only if needed

If there's no peer configured then there's no point in sending
the command down to the firmware with an invalid peer address.

Fixes: cf85123a210f ("wifi: iwlwifi: mvm: support enabling and disabling HW timestamping")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531194630.0fb9f81f1852.Idcc41b67d1fbb421e5ed9bac2177b948b7b4d1c9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: remove warning for beacon filtering error
Johannes Berg [Wed, 31 May 2023 16:50:05 +0000 (19:50 +0300)]
wifi: iwlwifi: mvm: remove warning for beacon filtering error

This warning is sometimes happening if we force a FW error
while disconnecting, which is annoying but harmless.

However, it's also pointless to throw a warning here, since
the stack and driver state doesn't really help, so just
remove that so the driver will ignore the error if any.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531194630.29fe6990d372.I00ff5dc7bfb4025a609f380a0a3911d842b72449@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: remove dead code in iwl_dump_ini_imr_get_size()
Mukesh Sisodiya [Wed, 31 May 2023 16:50:04 +0000 (19:50 +0300)]
wifi: iwlwifi: remove dead code in iwl_dump_ini_imr_get_size()

Remove the check for the IMR debug data size which
leads to dead code.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531194630.58eec8d40729.Ifb7d64706eed45726db804f36e785283dff7adab@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Add Dell to ppag approved list
Alon Giladi [Wed, 31 May 2023 16:50:03 +0000 (19:50 +0300)]
wifi: iwlwifi: Add Dell to ppag approved list

Add 2 new entries for Dell in PPAG approved list.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531194630.a2696f0538ef.I324e4a0cc4696c27830a490b79c42dfeff8ba074@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: FTM initiator MLO support
Avraham Stern [Wed, 31 May 2023 16:50:01 +0000 (19:50 +0300)]
wifi: iwlwifi: mvm: FTM initiator MLO support

When checking if the initiator is associated to the responder,
iterate over all active links.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531194629.a0d86655e7d2.I8f140ca55094da1d73c387fc036394fb2c148c85@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: pcie: adjust Bz device timings
Johannes Berg [Wed, 31 May 2023 16:50:00 +0000 (19:50 +0300)]
wifi: iwlwifi: pcie: adjust Bz device timings

The 100ms shouldn't be needed, only 10ms. However after
reset we should have 10ms as well for these devices.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531194629.9a5627c1ff18.Ifcfbccd5458bd9ebd496aa834284fb0facfcaaef@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: offload BTM response during D3
Haim Dreyfuss [Wed, 31 May 2023 16:49:59 +0000 (19:49 +0300)]
wifi: iwlwifi: mvm: offload BTM response during D3

There are mainly two types of BTM (BSS Transition Management)
requests, recommendations and notifications. For the first type,
a response is needed otherwise, most probably the STA will be
disconnected.
Since we don't want to wake up the host on it, set the BTM to reject
offload flag (if the device supports it) and rely on the FW to take
care of it. The FW will reject the BTM request and in case the AP
sends DEAUTH the FW can wake up the host to let it decide on the
next steps.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531194629.d95ae6f2804c.I9457acc55bc23ce715c714b5088058f52540c224@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: do not log undefined DRAM buffers unnecessarily
Benjamin Berg [Wed, 31 May 2023 16:49:58 +0000 (19:49 +0300)]
wifi: iwlwifi: do not log undefined DRAM buffers unnecessarily

DRAM buffers that are not defined in the TLVs (or are unused in the
preset) would cause a log message. To avoid confusion, skip processing
buffers with an invalid (i.e. uninitialized) DRAM path.

This further reduces the noise of the message in cases where it is
unlikely to be helpful. Also update a related debug log string to better
describe what is happening.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531194629.ecae60cf2d7f.Ib44a94d4aeb55dbb2e52edea8b69a09bc0f722c3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: acpi: add other Google OEMs to the ppag approved list
Golan Ben Ami [Wed, 31 May 2023 16:49:57 +0000 (19:49 +0300)]
wifi: iwlwifi: acpi: add other Google OEMs to the ppag approved list

Add two new vendors to the PPAG approved vendor list
as Google OEMs.

Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531194629.b89a3f9e3ae0.Iab1e13285c58ef1fee2a8bad8429eda4547b0b74@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: clarify EHT RU allocation bits
Johannes Berg [Wed, 31 May 2023 16:49:56 +0000 (19:49 +0300)]
wifi: iwlwifi: mvm: clarify EHT RU allocation bits

Calling this IWL_RX_PHY_DATA1_EHT_B0 is just confusing,
it's the RU allocation bit 0. Also then align the name
for B1-B7 accordingly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531194629.824edb28c0eb.Ia9f74573e3ac771911b679558984f1bfb36de674@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: support injection rate control
Johannes Berg [Wed, 31 May 2023 16:49:55 +0000 (19:49 +0300)]
wifi: iwlwifi: mvm: support injection rate control

Supporting controlling the frame rate during injection,
HT/VHT are supported in addition to legacy rates.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531194629.85a662792649.I0847b47dec0dfb0290d7b15ebc6bc0a575eed7b5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Add vendors to TAS approved list
Alon Giladi [Wed, 31 May 2023 16:49:54 +0000 (19:49 +0300)]
wifi: iwlwifi: Add vendors to TAS approved list

Allows vendors to use the time average sar feature.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531194629.845c205e4def.Iab5c849617ed7e13304e4dfc7def668659439946@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: iwlmei: fix compilation error
Avraham Stern [Wed, 31 May 2023 08:50:33 +0000 (11:50 +0300)]
wifi: iwlwifi: iwlmei: fix compilation error

The feature is still disabled (depends on BROKEN), but
the code had a compilation error after one of the merges.
Fix that.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230531085033.216028-1-gregory.greenman@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: update response for mcc_update command
Abhishek Naik [Wed, 24 May 2023 17:42:11 +0000 (20:42 +0300)]
wifi: iwlwifi: update response for mcc_update command

Add support for the MCC update response version 8.
Versions 5-6 are already covered by the existing
flags conversion, and 7 isn't used.

The capabilities field in iwl_mcc_update_resp is 32 bits
wide now, and the flags moved, so some more changes are
needed.

While at it, convert the flags to bool (to avoid having
to deal with BIT(16) specially etc.) and use the
struct_size() macro for the memory allocation.

Signed-off-by: Abhishek Naik <abhishek.naik@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.fd9016f8f994.Ibddcb9fbfa74895f742c0ac20968720691c94853@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: support PPAG in China for older FW cmd version
Alon Giladi [Wed, 24 May 2023 17:42:10 +0000 (20:42 +0300)]
wifi: iwlwifi: support PPAG in China for older FW cmd version

Allows the China bit in the ppag flags to turn on also when
FW cmd version is 1 (if FW has the capability).

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.3cc19e799eeb.I9054b1d63fd7ae2b5f0e416825b4b1dc9f79cc80@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: remove useless code
Johannes Berg [Wed, 24 May 2023 17:42:09 +0000 (20:42 +0300)]
wifi: iwlwifi: mvm: remove useless code

Setting the station to -EBUSY was originally done under
this lock, and the comment still refers to it. But this
no longer happens because that was removed when DQA was
removed. Remove the leftover code as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.30048b1cd0fd.Ie2c2ff6fd7c6e3ebf5b736de350dc15515970792@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: disable RX STBC when a device doesn't support it
Gregory Greenman [Wed, 24 May 2023 17:42:08 +0000 (20:42 +0300)]
wifi: iwlwifi: disable RX STBC when a device doesn't support it

Some devices, like step A0 of GL FM device doesn't support RX STBC
for VHT/HE. Add a workaround to remove it from capabilities in
this case.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.65c3e09813e5.Iadfd8cdb0ea5a8088ae3daa555c780c423951894@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: fw: Add new ODM vendor to ppag approved list
Ariel Malamud [Wed, 24 May 2023 17:42:07 +0000 (20:42 +0300)]
wifi: iwlwifi: fw: Add new ODM vendor to ppag approved list

Add new oem/odm pair to ppag approved vendors list
when specified by platform.

Signed-off-by: Ariel Malamud <ariel.malamud@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.549a57a1cf11.I7392b1cd31f4f7ee60aafe2093f4e82b1d6fd3a7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: adjust csa notifications and commands to MLO
Gregory Greenman [Wed, 24 May 2023 17:42:06 +0000 (20:42 +0300)]
wifi: iwlwifi: mvm: adjust csa notifications and commands to MLO

In the following notifications and commands mac_id was replaced
with link_id:
* CANCEL_CHANNEL_SWITCH_CMD
* CHANNEL_SWITCH_START_NOTIF
* CHANNEL_SWITCH_ERROR_NOTIF

The logic around was not changed, so only adjust handling
mac/link id.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.6aa6e394f5fe.Ie9e78918511ca901f9f3966d774fa74a71a186e3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: update the FW apis for LINK and MAC commands
Emmanuel Grumbach [Wed, 24 May 2023 17:42:05 +0000 (20:42 +0300)]
wifi: iwlwifi: mvm: update the FW apis for LINK and MAC commands

The firmware added new fields to be able to pass the link_id as the AP
knows it and the esr_transition_timeout.
For now, pass only the link_id since we don't have access to the
esr_transition_timeout yet.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.bf80ce717458.Icd4174911227c00cd12783fe1f517ae8097809b9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: Make iwl_mvm_diversity_iter() MLO aware
Miri Korenblit [Wed, 24 May 2023 17:42:04 +0000 (20:42 +0300)]
wifi: iwlwifi: mvm: Make iwl_mvm_diversity_iter() MLO aware

This function is MLO related, so it should iterate over all the links,
and not only on deflink.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.56a9c709e987.I9716195ec288cce2c929338c254ee9add8cfcc1f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: don't silently ignore missing suspend or resume ops
Haim Dreyfuss [Wed, 24 May 2023 17:42:03 +0000 (20:42 +0300)]
wifi: iwlwifi: don't silently ignore missing suspend or resume ops

In case the driver doesn't implement suspend or resume operations
on the transport layer, notify the driver's upper layer.
Otherwise, we might access d3_status uninitialized.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.0c55e0ca92f1.I6870fe1683215e65d3d036f9b576b03b7b7257be@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: support PASN for MLO
Avraham Stern [Wed, 24 May 2023 17:42:02 +0000 (20:42 +0300)]
wifi: iwlwifi: mvm: support PASN for MLO

When adding a PASN station, the non MLD API was used. This results
in assert when operating as MLD. Fix it to use the MLD API when
operating as MLD. For now, the default link is used for the added
station.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.7c35dccc8a12.I7bc78cd16d7c750f42fdd60e07e839a860d279d2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: dissolve iwl_mvm_mac_add_interface_common()
Johannes Berg [Wed, 24 May 2023 17:42:01 +0000 (20:42 +0300)]
wifi: iwlwifi: mvm: dissolve iwl_mvm_mac_add_interface_common()

This wasn't really common anymore, so dissolve it, it has a
pretty strange calling convention that's confusing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.44320ab2e842.Ie1d6b9c28caca3b541ca383a4c0c8799b0e72fe0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: make internal callback structs const
Johannes Berg [Wed, 24 May 2023 17:42:00 +0000 (20:42 +0300)]
wifi: iwlwifi: mvm: make internal callback structs const

There's no need for these to be writable, so they can
be const (and static).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.c41eb6687868.I2dac1158e5723187bda1973aa49fde8a794621c8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: use link ID in missed beacon notification
Yedidya Benshimol [Wed, 24 May 2023 17:41:59 +0000 (20:41 +0300)]
wifi: iwlwifi: mvm: use link ID in missed beacon notification

This new version of missed beacon notification uses link_id
instead of mac_id. Also add an option to use link id for
retrieving vif.

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.17fe1cc632f1.Id1fabb532e2174712fe17d4ad86a2c8c64ae84da@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: cfg: freeze 22500 devices FW API
Golan Ben Ami [Wed, 24 May 2023 17:41:58 +0000 (20:41 +0300)]
wifi: iwlwifi: cfg: freeze 22500 devices FW API

FW version is now frozen for 22500 devices. Don't
allow newer versions in the driver.

Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.8a25ebf9134c.I3f1454498322ce28cb687d28c091c7ee092cefca@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: brcmutil: use helper function pktq_empty() instead of open code
Juhee Kang [Sat, 27 May 2023 11:49:54 +0000 (20:49 +0900)]
wifi: brcmutil: use helper function pktq_empty() instead of open code

pktq_empty was added in commit 5b435de0d786 ("net: wireless: add brcm80211
drivers") but it is currently not being utilized in some areas. This commit
replaces the open code with the pktq_empty() function.

Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230527114954.3281-2-claudiajkang@gmail.com
13 months agowifi: rtlwifi: use helper function rtl_get_hdr()
Juhee Kang [Sat, 27 May 2023 11:49:53 +0000 (20:49 +0900)]
wifi: rtlwifi: use helper function rtl_get_hdr()

Although rtl_get_hdr was added in commit 3dad618b7b92 ("rtlwifi: Change
wifi.h for rtl8192se and rtl8192de"), it is currently not being utilized
in some areas. This commit replaces the open code with the rtl_get_hdr()
function.

Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230527114954.3281-1-claudiajkang@gmail.com
13 months agowifi: rtw88: usb: silence log flooding error message
Sascha Hauer [Wed, 24 May 2023 10:39:34 +0000 (12:39 +0200)]
wifi: rtw88: usb: silence log flooding error message

When receiving more rx packets than the kernel can handle the driver
drops the packets and issues an error message. This is bad for two
reasons. The logs are flooded with myriads of messages, but then time
consumed for printing messages in that critical code path brings down
the device. After some time of excessive rx load the driver responds
with:

rtw_8822cu 1-1:1.2: failed to get tx report from firmware
rtw_8822cu 1-1:1.2: firmware failed to report density after scan
rtw_8822cu 1-1:1.2: firmware failed to report density after scan

The device stops working until being replugged.

Fix this by lowering the priority to debug level and also by
ratelimiting it.

Fixes: a82dfd33d1237 ("wifi: rtw88: Add common USB chip support")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230524103934.1019096-1-s.hauer@pengutronix.de
13 months agowifi: ray_cs: add sanity check on local->sram/rmem/amem
Dongliang Mu [Thu, 16 Mar 2023 13:32:36 +0000 (21:32 +0800)]
wifi: ray_cs: add sanity check on local->sram/rmem/amem

The ray_config uses ray_release as its unified error handling function.
However, it does not know if local->sram/rmem/amem succeeds or not.

Fix this by adding sanity check on local->sram/rmem/amem in the
ray_relase.

Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230316133236.556198-3-dzm91@hust.edu.cn
13 months agowifi: ray_cs: remove one redundant del_timer
Dongliang Mu [Thu, 16 Mar 2023 13:32:35 +0000 (21:32 +0800)]
wifi: ray_cs: remove one redundant del_timer

In ray_detach, it and its child function ray_release both call
del_timer(_sync) on the same timer.

Fix this by removing the del_timer_sync in the ray_detach, and revising
the del_timer to del_timer_sync.

Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230316133236.556198-2-dzm91@hust.edu.cn
13 months agowifi: ray_cs: Fix an error handling path in ray_probe()
Christophe JAILLET [Sat, 20 May 2023 08:13:22 +0000 (10:13 +0200)]
wifi: ray_cs: Fix an error handling path in ray_probe()

Should ray_config() fail, some resources need to be released as already
done in the remove function.

While at it, remove a useless and erroneous comment. The probe is
ray_probe(), not ray_attach().

Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/8c544d18084f8b37dd108e844f7e79e85ff708ff.1684570373.git.christophe.jaillet@wanadoo.fr
13 months agowifi: wl3501_cs: Fix an error handling path in wl3501_probe()
Christophe JAILLET [Sat, 20 May 2023 08:05:08 +0000 (10:05 +0200)]
wifi: wl3501_cs: Fix an error handling path in wl3501_probe()

Should wl3501_config() fail, some resources need to be released as already
done in the remove function.

Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/7cc9c9316489b7d69b36aeb0edd3123538500b41.1684569865.git.christophe.jaillet@wanadoo.fr
13 months agowifi: atmel: Fix an error handling path in atmel_probe()
Christophe JAILLET [Sat, 20 May 2023 07:53:14 +0000 (09:53 +0200)]
wifi: atmel: Fix an error handling path in atmel_probe()

Should atmel_config() fail, some resources need to be released as already
done in the remove function.

While at it, remove a useless and erroneous comment. The probe is
atmel_probe(), not atmel_attach().

Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/1e65f174607a83348034197fa7d603bab10ba4a9.1684569156.git.christophe.jaillet@wanadoo.fr
13 months agowifi: orinoco: Fix an error handling path in orinoco_cs_probe()
Christophe JAILLET [Sat, 20 May 2023 07:38:22 +0000 (09:38 +0200)]
wifi: orinoco: Fix an error handling path in orinoco_cs_probe()

Should orinoco_cs_config() fail, some resources need to be released as
already done in the remove function.

While at it, remove a useless and erroneous comment. The probe is
orinoco_cs_probe(), not orinoco_cs_attach().

Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/e24735ce4d82901d5f7ea08419eea53bfdde3d65.1684568286.git.christophe.jaillet@wanadoo.fr
13 months agowifi: orinoco: Fix an error handling path in spectrum_cs_probe()
Christophe JAILLET [Sat, 20 May 2023 07:29:46 +0000 (09:29 +0200)]
wifi: orinoco: Fix an error handling path in spectrum_cs_probe()

Should spectrum_cs_config() fail, some resources need to be released as
already done in the remove function.

While at it, remove a useless and erroneous comment. The probe is
spectrum_cs_probe(), not spectrum_cs_attach().

Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/c0bc0c21c58ca477fc5521607615bafbf2aef8eb.1684567733.git.christophe.jaillet@wanadoo.fr
13 months agowifi: rtw89: use flexible array member in rtw89_btc_btf_tlv
Arnd Bergmann [Tue, 23 May 2023 11:32:35 +0000 (13:32 +0200)]
wifi: rtw89: use flexible array member in rtw89_btc_btf_tlv

struct rtw89_btc_btf_tlv contains a one-byte member that is intended as a
flexible array:

In function 'fortify_memcpy_chk',
    inlined from '_append_tdma' at drivers/net/wireless/realtek/rtw89/coex.c:1579:3:
include/linux/fortify-string.h:583:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
  583 |                         __write_overflow_field(p_size_field, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Make this actually use a flexible array to let the compiler understand.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230523113241.2772811-1-arnd@kernel.org
13 months agowifi: rtw89: 8851b: rfk: Fix spelling mistake KIP_RESOTRE -> KIP_RESTORE
Colin Ian King [Mon, 22 May 2023 08:59:24 +0000 (09:59 +0100)]
wifi: rtw89: 8851b: rfk: Fix spelling mistake KIP_RESOTRE -> KIP_RESTORE

There is a spelling mistake in a literal string. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230522085924.913649-1-colin.i.king@gmail.com
13 months agowifi: rtw89: use struct to access register-based H2C/C2H
Ping-Ke Shih [Mon, 22 May 2023 12:25:13 +0000 (20:25 +0800)]
wifi: rtw89: use struct to access register-based H2C/C2H

The register-based H2C/C2H are used to exchange commands and events with
firmware. The exchange data is limited, but it is relatively simple,
because it can work before HCI initialization. To make these code clean,
use struct to access them. This patch doesn't change logic at all.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230522122513.13559-6-pkshih@realtek.com
13 months agowifi: rtw89: use struct and le32_get_bits() to access RX descriptor
Ping-Ke Shih [Mon, 22 May 2023 12:25:12 +0000 (20:25 +0800)]
wifi: rtw89: use struct and le32_get_bits() to access RX descriptor

RX descriptor is to provide basic and important information related to
packets, such as packet size, security, MAC ID and so on. Change to use
struct to access these fields, and not change logic at all.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230522122513.13559-5-pkshih@realtek.com
13 months agowifi: rtw89: use struct and le32_get_bits() to access received PHY status IEs
Ping-Ke Shih [Mon, 22 May 2023 12:25:11 +0000 (20:25 +0800)]
wifi: rtw89: use struct and le32_get_bits() to access received PHY status IEs

PHY status IEs generated by BB hardware is to provide more detail
information related to received packets, such as RSSI and bandwidth.

To avoid type casting, change buf type from u8* to void* as well.

This patch doesn't change logic at all.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230522122513.13559-4-pkshih@realtek.com
13 months agowifi: rtw89: use struct and le32_get_bits to access RX info
Ping-Ke Shih [Mon, 22 May 2023 12:25:10 +0000 (20:25 +0800)]
wifi: rtw89: use struct and le32_get_bits to access RX info

If received packet type is PPDU status, RX info provides information
attached by MAC hardware, and mention how long BB information attached.

This conversion patch doesn't change logic at all.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230522122513.13559-3-pkshih@realtek.com
13 months agowifi: rtw89: add chip_ops::query_rxdesc() and rxd_len as helpers to support newer...
Ping-Ke Shih [Mon, 22 May 2023 12:25:09 +0000 (20:25 +0800)]
wifi: rtw89: add chip_ops::query_rxdesc() and rxd_len as helpers to support newer chips

The next generation chips use different RX descriptor format, so add
a chip_ops to hook suitable handlers. Also, the length of RX descriptor is
different, so add a variable to store the length according to chip and
descriptor content dynamically. Then, the code can be more general.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230522122513.13559-2-pkshih@realtek.com
13 months agowifi: rtw89: 8851b: add 8851be to Makefile and Kconfig
Ping-Ke Shih [Fri, 19 May 2023 03:15:00 +0000 (11:15 +0800)]
wifi: rtw89: 8851b: add 8851be to Makefile and Kconfig

Since 8851BE is ready, so add 8851BE to Makefile and Kconfig. Currently,
it can support STA, AP and monitor modes with good performance.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230519031500.21087-8-pkshih@realtek.com
13 months agowifi: rtw89: add tx_wake notify for 8851B
Chin-Yen Lee [Fri, 19 May 2023 03:14:59 +0000 (11:14 +0800)]
wifi: rtw89: add tx_wake notify for 8851B

8851B has the same issue: management frames get stuck when WiFi
chip enters low PS mode, so we also add notify wake function to
trigger WiFi chip wake before forwarding management frames.

Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230519031500.21087-7-pkshih@realtek.com
13 months agowifi: rtw89: enlarge supported length of read_reg debugfs entry
Ping-Ke Shih [Fri, 19 May 2023 03:14:58 +0000 (11:14 +0800)]
wifi: rtw89: enlarge supported length of read_reg debugfs entry

The register ranges of upcoming chips are different from current, and even
existing chips have different ranges, so support longer length to dump
registers. Then, user space can decide the ranges according to chip.

Since arbitrary length (e.g. 7) would be a little complicated, so simply
make length a multiple of 16. The output looks like

18620000h : 8580801f 82828282 82828282 080800fd

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230519031500.21087-6-pkshih@realtek.com
13 months agowifi: rtw89: 8851b: add RF configurations
Ping-Ke Shih [Fri, 19 May 2023 03:14:57 +0000 (11:14 +0800)]
wifi: rtw89: 8851b: add RF configurations

RF configurations include RF calibrations and getting thermal value.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230519031500.21087-5-pkshih@realtek.com
13 months agowifi: rtw89: 8851b: add MAC configurations to chip_info
Ping-Ke Shih [Fri, 19 May 2023 03:14:56 +0000 (11:14 +0800)]
wifi: rtw89: 8851b: add MAC configurations to chip_info

These configurations include path control, TX grant, TX scheduler,
register-based H2C/C2H and so on.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230519031500.21087-4-pkshih@realtek.com
13 months agowifi: rtw89: 8851b: fill BB related capabilities to chip_info
Ping-Ke Shih [Fri, 19 May 2023 03:14:55 +0000 (11:14 +0800)]
wifi: rtw89: 8851b: fill BB related capabilities to chip_info

These capabilities include helpers of BT coexistence, RX PPDU status
parser, DIG (dynamic initial gain) and CFO (center frequency offset)
settings.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230519031500.21087-3-pkshih@realtek.com
13 months agowifi: rtw89: 8851b: add TX power related functions
Ping-Ke Shih [Fri, 19 May 2023 03:14:54 +0000 (11:14 +0800)]
wifi: rtw89: 8851b: add TX power related functions

Get TX power value from tables according to selected country and channel,
and set proper power to registers.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230519031500.21087-2-pkshih@realtek.com
13 months agowifi: rtw89: refine packet offload handling under SER
Zong-Zhe Yang [Tue, 16 May 2023 08:24:41 +0000 (16:24 +0800)]
wifi: rtw89: refine packet offload handling under SER

H2C of packet offload needs to wait FW ACK by C2H. But, it's possible
that packet offload happens during SER (system error recovery), e.g.
SER L2 which restarts HW. More, packet offload flow isn't deferrable.
So, the H2C wait may get `ret == 1` (unreachable).

However, the logic FW deals with packet offload is simple enough, just
clone content. It means that as long as the H2C is issued successfully,
the thing will succeed sooner or later. Therefore, after we add a debug
log when receiving ACK to packet offload, it would be acceptable that
during SER, packet offload don't really wait for ACK. And, if debugging,
we can still check its debug logs. Besides, we can expect that if we see
SER before receiving ACK to packet offload, those debug logs of the ACK
have a time difference.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230516082441.11154-4-pkshih@realtek.com
13 months agowifi: rtw89: tweak H2C TX waiting function for SER
Zong-Zhe Yang [Tue, 16 May 2023 08:24:40 +0000 (16:24 +0800)]
wifi: rtw89: tweak H2C TX waiting function for SER

Some specific H2C (host to chip command) needs waiting until FW ACK by
C2H (chip to host event). However, during SER (system error recovery),
most interrupts are disabled, so we can't receive C2H immediately. It
causes this kind of H2C TX waits will always time out during SER.

To save time spent by SER, we don't do these redundant waits. And, to
make a difference from -ETIMEDOUT in other cases, we make the function
return 1 for SER case. When some H2C callers really catch `ret == 1` at
runtime, they can determine whether it's reasonable or not, and consider
how to resolve their flow if needed.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230516082441.11154-3-pkshih@realtek.com
13 months agowifi: rtw89: ser: reset total_sta_assoc and tdls_peer when L2
Zong-Zhe Yang [Tue, 16 May 2023 08:24:39 +0000 (16:24 +0800)]
wifi: rtw89: ser: reset total_sta_assoc and tdls_peer when L2

The total_sta_assoc and the tdls_peer are used for statistics accodring
to stations' information. L2 (Level 2) SER (system error recovery) will
call ieee80211_restart_hw() which re-invokes sta_state ops. And then,
the total_sta_assoc and tdls_peer will be re-increased. In case wrong
statistics results, we reset them in SER L2 handling.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230516082441.11154-2-pkshih@realtek.com
13 months agowifi: rtw88: Add support for the SDIO based RTL8723DS chipset
Martin Blumenstingl [Mon, 22 May 2023 20:24:25 +0000 (22:24 +0200)]
wifi: rtw88: Add support for the SDIO based RTL8723DS chipset

Wire up RTL8723DS chipset support using the rtw88 SDIO HCI code as well
as the existing RTL8723D chipset code.

Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230522202425.1827005-5-martin.blumenstingl@googlemail.com
13 months agommc: sdio: Add/rename SDIO ID of the RTL8723DS SDIO wifi cards
Martin Blumenstingl [Mon, 22 May 2023 20:24:24 +0000 (22:24 +0200)]
mmc: sdio: Add/rename SDIO ID of the RTL8723DS SDIO wifi cards

RTL8723DS comes in two variant and each of them has their own SDIO ID:
- 0xd723 can connect two antennas. The WiFi part is still 1x1 so the
  second antenna can be dedicated to Bluetooth
- 0xd724 can only connect one antenna so it's shared between WiFi and
  Bluetooth

Add a new entry for the single antenna RTL8723DS (0xd724) which can be
found on the MangoPi MQ-Quad. Also rename the existing RTL8723DS entry
(0xd723) so it's name reflects that it's the variant with support for
two antennas.

Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230522202425.1827005-4-martin.blumenstingl@googlemail.com
13 months agowifi: rtw88: rtw8723d: Implement RTL8723DS (SDIO) efuse parsing
Martin Blumenstingl [Mon, 22 May 2023 20:24:23 +0000 (22:24 +0200)]
wifi: rtw88: rtw8723d: Implement RTL8723DS (SDIO) efuse parsing

The efuse of the SDIO RTL8723DS chip has only one known member: the mac
address is at offset 0x11a. Add a struct rtw8723ds_efuse describing this
and use it for copying the mac address when the SDIO bus is used.

Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230522202425.1827005-3-martin.blumenstingl@googlemail.com
13 months agowifi: rtw88: sdio: Check the HISR RX_REQUEST bit in rtw_sdio_rx_isr()
Martin Blumenstingl [Mon, 22 May 2023 20:24:22 +0000 (22:24 +0200)]
wifi: rtw88: sdio: Check the HISR RX_REQUEST bit in rtw_sdio_rx_isr()

rtw_sdio_rx_isr() is responsible for receiving data from the wifi chip
and is called from the SDIO interrupt handler when the interrupt status
register (HISR) has the RX_REQUEST bit set. After the first batch of
data has been processed by the driver the wifi chip may have more data
ready to be read, which is managed by a loop in rtw_sdio_rx_isr().

It turns out that there are cases where the RX buffer length (from the
REG_SDIO_RX0_REQ_LEN register) does not match the data we receive. The
following two cases were observed with a RTL8723DS card:
- RX length is smaller than the total packet length including overhead
  and actual data bytes (whose length is part of the buffer we read from
  the wifi chip and is stored in rtw_rx_pkt_stat.pkt_len). This can
  result in errors like:
    skbuff: skb_over_panic: text:ffff8000011924ac len:3341 put:3341
  (one case observed was: RX buffer length = 1536 bytes but
   rtw_rx_pkt_stat.pkt_len = 1546 bytes, this is not valid as it means
   we need to read beyond the end of the buffer)
- RX length looks valid but rtw_rx_pkt_stat.pkt_len is zero

Check if the RX_REQUEST is set in the HISR register for each iteration
inside rtw_sdio_rx_isr(). This mimics what the RTL8723DS vendor driver
does and makes the driver only read more data if the RX_REQUEST bit is
set (which seems to be a way for the card's hardware or firmware to
tell the host that data is ready to be processed).

For RTW_WCPU_11AC chips this check is not needed. The RTL8822BS vendor
driver for example states that this check is unnecessary (but still uses
it) and the RTL8822CS drops this check entirely.

Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230522202425.1827005-2-martin.blumenstingl@googlemail.com
13 months agowifi: add HAS_IOPORT dependencies
Niklas Schnelle [Mon, 22 May 2023 10:50:48 +0000 (12:50 +0200)]
wifi: add HAS_IOPORT dependencies

In a future patch HAS_IOPORT=n will result in inb()/outb() and friends
not being declared. We thus need to add HAS_IOPORT as dependency for
those drivers using them.

Co-developed-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@kernel.org>
Acked-by: Kalle Valo <kvalo@kernel.org>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230522105049.1467313-44-schnelle@linux.ibm.com
14 months agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Wed, 17 May 2023 14:59:59 +0000 (17:59 +0300)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git

ath.git patches for v6.5. Major changes:

ath11k

* Multiple Basic Service Set Identifier (MBSSID) and Enhanced MBSSID
  Advertisement (EMA) support in AP mode

14 months agowifi: ath11k: Send HT fixed rate in WMI peer fixed param
Maharaja Kennadyrajan [Tue, 9 May 2023 17:07:24 +0000 (20:07 +0300)]
wifi: ath11k: Send HT fixed rate in WMI peer fixed param

Due to the firmware behavior with HT fixed rate setting,
HT fixed rate MCS with NSS > 1 are treated as NSS = 1
HT rates in the firmware and enables the HT fixed rate of
NSS = 1.

This leads to HT fixed rate is always configured for NSS = 1
even though the user sets NSS = 2 or > 1 HT fixed MCS in the
set bitrate command.

Currently HT fixed MCS is sent via WMI peer assoc command.
Fix this issue, by sending the HT fixed rate MCS in WMI peer
fixed param instead of sending in peer assoc command.

Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1

Signed-off-by: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230504092033.3542456-3-quic_mkenna@quicinc.com
14 months agowifi: ath11k: Relocate the func ath11k_mac_bitrate_mask_num_ht_rates() and change...
Maharaja Kennadyrajan [Tue, 9 May 2023 17:07:23 +0000 (20:07 +0300)]
wifi: ath11k: Relocate the func ath11k_mac_bitrate_mask_num_ht_rates() and change hweight16 to hweight8

Relocate the function ath11k_mac_bitrate_mask_num_ht_rates() definition
to call this function from other functions which helps to avoid the
compilation error (function not defined).

ht_mcs[] is 1 byte array and it is enough to use hweight8() instead
of hweight16(). Hence, fixed the same.

Tested on: Compile tested only.

Signed-off-by: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230504092033.3542456-2-quic_mkenna@quicinc.com
14 months agowifi: ath12k: increase vdev setup timeout
Aishwarya R [Tue, 9 May 2023 17:07:23 +0000 (20:07 +0300)]
wifi: ath12k: increase vdev setup timeout

When vdev start/stop happens, response from firmware is received with delay
and hence there is a timeout before VDEV can be up/down.
Also, with maximum peers connected and when vdev stop occurs, firmware
will take time to clean up all the peers and vap queues.
In such cases as well, vdev start/stop response is sent by firmware with delay.

Increase the vdev setup timeout as recommended by firmware team.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-02903-QCAHKSWPL_SILICONZ-1

Signed-off-by: Aishwarya R <quic_aisr@quicinc.com>
Signed-off-by: Ramya Gnanasekar <quic_rgnanase@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230428091041.20033-1-quic_rgnanase@quicinc.com
14 months agowifi: rtw89: 8851b: rfk: add TSSI
Ping-Ke Shih [Sat, 13 May 2023 05:44:25 +0000 (13:44 +0800)]
wifi: rtw89: 8851b: rfk: add TSSI

TSSI is transmitter signal strength indication, which is a close-loop
hardware circuit to feedback actual transmitting power as a reference for
next transmission.

When we setup channel to connect an AP, it does full calibration. When
switching bands or channels, it needs to reset hardware status to prevent
use wrong feedback of previous transmission.

To do TX power compensation reflecting current temperature, it loads tables
of compensation values into registers according to channel and band group.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230513054425.9689-4-pkshih@realtek.com
14 months agowifi: rtw89: 8851b: rfk: add DPK
Ping-Ke Shih [Sat, 13 May 2023 05:44:24 +0000 (13:44 +0800)]
wifi: rtw89: 8851b: rfk: add DPK

DPK is short for digital pre-distortion calibration. It can adjusts digital
waveform according to PA linear characteristics dynamically to enhance
TX EVM.

Do this calibration when we are going to run on AP channel. To prevent
power offset out of boundary, it monitors thermal and set proper boundary
to register.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230513054425.9689-3-pkshih@realtek.com
14 months agowifi: rtw89: 8851b: rfk: add RX DCK
Ping-Ke Shih [Sat, 13 May 2023 05:44:23 +0000 (13:44 +0800)]
wifi: rtw89: 8851b: rfk: add RX DCK

RX DCK is receiver DC calibration. With this calibration, we have proper
DC offset to reflect correct received signal strength indicator. Do this
calibration when bringing up interface and going to run on AP channel.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230513054425.9689-2-pkshih@realtek.com
14 months agowifi: rtw89: 8851b: add to parse efuse content
Ping-Ke Shih [Fri, 12 May 2023 06:12:20 +0000 (14:12 +0800)]
wifi: rtw89: 8851b: add to parse efuse content

Parse efuse content to recognize MAC address, RFE type, XTAL offset and
so on. And, parse offset of PHY capability to retrieve TX power
calibration data.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230512061220.16544-7-pkshih@realtek.com
14 months agowifi: rtw89: 8851b: add set channel function
Ping-Ke Shih [Fri, 12 May 2023 06:12:19 +0000 (14:12 +0800)]
wifi: rtw89: 8851b: add set channel function

Set MAC/BB/RF registers according to channel we are going to set. In
additional, certain channels or bands need more deals, such as enable CCK
in 2 GHz band, spur elimination at certain frequencies.

The set channel helper is used to save/restore states before/after setting
channel, and does reset BB to prevent hardware getting stuck in abnormal
state during switching channel and receiving data.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230512061220.16544-6-pkshih@realtek.com
14 months agowifi: rtw89: 8851b: add basic power on function
Ping-Ke Shih [Fri, 12 May 2023 06:12:18 +0000 (14:12 +0800)]
wifi: rtw89: 8851b: add basic power on function

Add basic functions to power on chip and enable and access BB/RF, as
well as reset and hardware settings of BB.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230512061220.16544-5-pkshih@realtek.com
14 months agowifi: rtw89: 8851b: add BT coexistence support function
Ping-Ke Shih [Fri, 12 May 2023 06:12:17 +0000 (14:12 +0800)]
wifi: rtw89: 8851b: add BT coexistence support function

Add 8851B specific parameters of BT coexistence. Since 8851B has special
two antenna hardware module with antenna diversity, BT coexistence needs
to recognize this, so add some fields to store these information for
further use.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230512061220.16544-4-pkshih@realtek.com
14 months agowifi: rtw89: 8851b: configure GPIO according to RFE type
Ping-Ke Shih [Fri, 12 May 2023 06:12:16 +0000 (14:12 +0800)]
wifi: rtw89: 8851b: configure GPIO according to RFE type

Though 8851BE is a 1x1 chip, but it has two antenna hardware module that
needs additional configuration to help choose antenna we are going to use.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230512061220.16544-3-pkshih@realtek.com
14 months agowifi: rtw89: 8851b: add to read efuse version to recognize hardware version B
Ping-Ke Shih [Fri, 12 May 2023 06:12:15 +0000 (14:12 +0800)]
wifi: rtw89: 8851b: add to read efuse version to recognize hardware version B

8851B hardware version A and B use different firmware, but register version
code of these two are the same, so add this helper to read efuse version to
determine which version is installed.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230512061220.16544-2-pkshih@realtek.com
14 months agowifi: rtl8xxxu: Rename some registers
Bitterblue Smith [Sat, 13 May 2023 20:48:27 +0000 (23:48 +0300)]
wifi: rtl8xxxu: Rename some registers

Give proper names:

RF6052_REG_UNKNOWN_56 -> RF6052_REG_PAD_TXG
RF6052_REG_UNKNOWN_DF -> RF6052_REG_GAIN_CCA

And fix typos:

REG_OFDM0_AGCR_SSI_TABLE -> REG_OFDM0_AGC_RSSI_TABLE
REG_BB_ACCEESS_CTRL -> REG_BB_ACCESS_CTRL

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/40157253-76bd-8b23-06e0-3365139b5395@gmail.com
14 months agowifi: rtl8xxxu: Support new chip RTL8192FU
Bitterblue Smith [Sat, 13 May 2023 20:47:38 +0000 (23:47 +0300)]
wifi: rtl8xxxu: Support new chip RTL8192FU

This is a newer chip, similar to the RTL8710BU in that it uses the same
PHY status structs.

Features: 2.4 GHz, b/g/n mode, 2T2R, 300 Mbps.

It can allegedly have Bluetooth, but that's not implemented here.

This chip can have many RFE (RF front end) types, of which types 1
and 5 are the only ones tested. Many of the other types need different
initialisation tables. They can be added if someone wants them.

The vendor driver v5.8.6.2_35538.20191028_COEX20190910-0d02 from
https://github.com/BrightX/rtl8192fu was used as reference, with
additional device IDs taken from
https://github.com/kelebek333/rtl8192fu-dkms.

The vendor driver also claims to support devices with ID 0bda:a725,
but that is found in some bluetooth-only devices, so it's not supported
here.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/7dcf9fb9-1c97-ac28-5286-2236e287a18c@gmail.com
14 months agowifi: brcmfmac: wcc: Add debug messages
Matthias Brugger [Tue, 9 May 2023 10:04:20 +0000 (12:04 +0200)]
wifi: brcmfmac: wcc: Add debug messages

The message is attach and detach function are merly for debugging,
change them from pr_err to pr_debug.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230509100420.26094-1-matthias.bgg@kernel.org
14 months agonet: Remove low_thresh in ip defrag
Angus Chen [Fri, 12 May 2023 01:01:52 +0000 (09:01 +0800)]
net: Remove low_thresh in ip defrag

As low_thresh has no work in fragment reassembles,del it.
And Mark it deprecated in sysctl Document.

Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
Signed-off-by: David S. Miller <davem@davemloft.net>