Tom Rix
8ce437dd5b
wifi: iwlwifi: fw: move memset before early return
...
Clang static analysis reports this representative issue
dbg.c:1455:6: warning: Branch condition evaluates to
a garbage value
if (!rxf_data.size)
^~~~~~~~~~~~~~
This check depends on iwl_ini_get_rxf_data() to clear
rxf_data but the function can return early without
doing the clear. So move the memset before the early
return.
Fixes: cc9b6012d3 ("iwlwifi: yoyo: use hweight_long instead of bit manipulating")
Signed-off-by: Tom Rix <trix@redhat.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230414130637.872a7175f1ff.I33802a77a91998276992b088fbe25f61c87c33ac@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:15:26 +02:00
Tom Rix
11e94d2bcd
wifi: iwlwifi: mvm: initialize seq variable
...
Clang static analysis reports this issue
d3.c:567:22: warning: The left operand of '>' is
a garbage value
if (seq.tkip.iv32 > cur_rx_iv32)
~~~~~~~~~~~~~ ^
seq is never initialized. Call ieee80211_get_key_rx_seq() to
initialize seq.
Fixes: 0419e5e672 ("iwlwifi: mvm: d3: separate TKIP data from key iteration")
Signed-off-by: Tom Rix <trix@redhat.com >
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230414130637.6dd372f84f93.If1f708c90e6424a935b4eba3917dfb7582e0dd0a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:15:26 +02:00
Colin Ian King
5f10705eea
wifi: iwlwifi: mvm: Fix spelling mistake "Gerenal" -> "General"
...
There is a spelling mistake in a IWL_DEBUG_SCAN debug message. Fix it.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230414130637.eac55cbef8f1.I15cc5d3f1489759bf915bfb3cbbb72b67b18f8b6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:15:26 +02:00
Colin Ian King
41c1b0b5aa
wifi: iwlwifi: Fix spelling mistake "upto" -> "up to"
...
There is a spelling mistake in a IWL_ERR error message. Fix it.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230414130637.a00965734d02.I760cb43829b3d7a0f567f0958059f2fae0aa8a93@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:15:26 +02:00
Miri Korenblit
7a41d58936
wifi: iwlwifi: mvm: enable new MLD FW API
...
Enable the new FW API with MLD based on FW TLV.
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/20230414130637.5dc66b08539e.I1c65024c879346b0349e1e431d36ec2b5fd85dd7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:15:26 +02:00
Mukesh Sisodiya
c30a2a6478
wifi: iwlwifi: add a new PCI device ID for BZ device
...
Add support for a new PCI device ID 0x272b once registering with PCIe.
Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230414130637.56342664110d.I5aa6f2858fdcf69fdea4f1a873115a48bd43764e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:15:26 +02:00
Mukesh Sisodiya
729040295f
wifi: iwlwifi: Add RF Step Type for BZ device
...
Add RF step id handling and handle for BZ device.
Read CNV Aux register and uses for no OTP case.
Add missing rf support for Bz/Bnj device and correct/add
the mapping for rf-type if OTP not present.
Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230414130637.8f2e2fff7bbc.Iee5554178bc5f134dcc28591db0968e619afbdca@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:15:26 +02:00
Ayala Beker
20f8cb7dcb
wifi: iwlwifi: mvm: scan legacy bands and UHB channels with same antenna
...
In case of UHB scan that follows a scan on legacy bands,
consider both scan commands as part of the same scan cycle,
and thus configure them to use the same antenna configuration.
Signed-off-by: Ayala Beker <ayala.beker@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.fd582c423ad8.I35239f94cb3ee1642d16936199c336a07ec2df8f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:51 +02:00
Daniel Gabay
ba30415118
wifi: iwlwifi: yoyo: Fix possible division by zero
...
Don't allow buffer allocation TLV with zero req_size since it
leads later to division by zero in iwl_dbg_tlv_alloc_fragments().
Also, NPK/SRAM locations are allowed to have zero buffer req_size,
don't discard them.
Fixes: a9248de424 ("iwlwifi: dbg_ini: add TLV allocation new API support")
Signed-off-by: Daniel Gabay <daniel.gabay@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.5d6688ed74d8.I5c2f3a882b50698b708d54f4524dc5bdf11e3d32@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:51 +02:00
Daniel Gabay
11195ab0d6
wifi: iwlwifi: yoyo: skip dump correctly on hw error
...
When NIC is in a bad state, reading data will return 28 bits as
0xa5a5a5a and the lowest 4 bits are not fixed value.
Mask these bits in a few places to skip the dump correctly.
Fixes: 89639e06d0 ("iwlwifi: yoyo: support for new DBGI_SRAM region")
Signed-off-by: Daniel Gabay <daniel.gabay@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.df6c0663179d.I36d8487b2419c6fefa65e5514855d94327c3b1eb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:51 +02:00
Daniel Gabay
b655b9a9f8
wifi: iwlwifi: pcie: fix possible NULL pointer dereference
...
It is possible that iwl_pci_probe() will fail and free the trans,
then afterwards iwl_pci_remove() will be called and crash by trying
to access trans which is already freed, fix it.
iwlwifi 0000:01:00.0: Detected crf-id 0xa5a5a5a2, cnv-id 0xa5a5a5a2
wfpm id 0xa5a5a5a2
iwlwifi 0000:01:00.0: Can't find a correct rfid for crf id 0x5a2
...
BUG: kernel NULL pointer dereference, address: 0000000000000028
...
RIP: 0010:iwl_pci_remove+0x12/0x30 [iwlwifi]
pci_device_remove+0x3e/0xb0
device_release_driver_internal+0x103/0x1f0
driver_detach+0x4c/0x90
bus_remove_driver+0x5c/0xd0
driver_unregister+0x31/0x50
pci_unregister_driver+0x40/0x90
iwl_pci_unregister_driver+0x15/0x20 [iwlwifi]
__exit_compat+0x9/0x98 [iwlwifi]
__x64_sys_delete_module+0x147/0x260
Signed-off-by: Daniel Gabay <daniel.gabay@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.082f6e21341b.I0db21d7fa9a828d571ca886713bd0b5d0b6e1e5c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:51 +02:00
Mukesh Sisodiya
74aae25013
wifi: iwlwifi: Fix the duplicate dump name
...
Driver is using the dump name generated first time in all
generated dump in case of NMI.
The validity of dump name should be with each dump created
and need to reset after each use.
Fixes: 834f920ef3 ("wifi: iwlwifi: yoyo: Add driver defined dump file name")
Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.6c987f820557.I924f2eae1eef2fe82c7a23be566551653d46f729@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:50 +02:00
Johannes Berg
70582b8263
wifi: iwlwifi: pcie: work around ROM bug on AX210 integrated
...
On 22000 and AX210 devices, there's a ROM bug that causes it to
set invalid LTR settings. On 22000 and AX210 non-integrated we
can fix up these settings from the driver (as done in the code
here), but on AX210 integrated these registers are not available
to the driver.
Attempt to work around the issue by spinning while the IML is
being loaded, the IML will then reprogram the LTR values itself
after it's loaded, so only the brief IML load (which the ROM is
doing) is affected.
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.aaa0a4339984.If08da23e960b6236f8c05c06fc8b26041ac89f1e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:50 +02:00
Johannes Berg
d48304326e
wifi: iwlwifi: mvm: add DSM_FUNC_ENABLE_6E value to debugfs
...
In order to simplify checking that this value was set up
correctly, add it to debugfs.
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.c9a787710e1e.If509b2e510e22d62f3eefb2c54ff1645e331dc23@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:50 +02:00
Miri Korenblit
fb40cd9d91
wifi: iwlwifi: mvm: cleanup beacon_inject_active during hw restart
...
beacon_inject_active turns true and false via debugfs when we inject a
beacon. During the time of the beacon injection we can't configure the
FW with a beacon cmd. If we have a hw restart during the beacon injection
then in the recovery flow we will not be able to configure the beacon
cmd to the FW. Fix this by cleaning up this variable after an hw restart.
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/20230413213309.b021bce5e162.Ia5a0a0b5d8734f63077ceaac936176a345f8d3d1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:50 +02:00
Haim Dreyfuss
905d50ddbc
wifi: iwlwifi: mvm: support wowlan info notification version 2
...
As part of version 2 we don't need to have wake_packet_bufsize
and wake_packet_length. The first one is already calculated by the driver,
the latter is sent as part of the wake packet notification.
Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.3b53213b10d4.Ibf2f15aca614def2d262dd267d1aad65931b58f1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:50 +02:00
Avraham Stern
26c680b731
wifi: iwlwifi: mvm: make HLTK configuration for PASN station optional
...
When secure LTF is not used, the HLTK is not derived during the PASN
authentication. Make the HLTK optional when adding a PASN 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/20230413213309.a57f7f3b59bd.Ifa88afb51a2516156153ac321d81556e295036c2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:50 +02:00
Johannes Berg
784d4a4258
wifi: iwlwifi: mvm: request limiting to 8 MSDUs per A-MSDU
...
Due to hardware limitations when splitting up A-MSDUs, it
cannot handle an arbitrary number of MSDUs per A-MSDU. Set
the bits to ask transmitters to send only 8 MSDUs in one
A-MSDU.
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.e6c518f2724f.I15c13d13b38289edbcd64f67d57cf18f6026457a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:50 +02:00
Avraham Stern
72c20e6096
wifi: iwlwifi: mvm: fix shift-out-of-bounds
...
The aux queue is initialized to IWL_MVM_INVALID_QUEUE. This is
later used for a bitmask of the queue, which results in a
shift-out-of-bounds. Fix it.
Fixes: b85f7ebb24 ("wifi: iwlwifi: mvm: avoid UB shift of snif_queue")
Signed-off-by: Avraham Stern <avraham.stern@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.c41a33c32898.Idc15f9eed005345a4137c28ef62efd80a405fad0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:50 +02:00
Alon Giladi
1843676ad0
wifi: iwlwifi: acpi: support modules with high antenna gain
...
Starting from version 4 of ANT_GAIN_CMD verification of ppag table
values is done by the FW. Driver has to send the complete table as
it appears in the BIOS. Make this change.
Signed-off-by: Alon Giladi <alon.giladi@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.a965365e2336.I1081f00ae309d9225d0529fa2da6ba7e34a8bd4f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:50 +02:00
Ayala Beker
8e5a26360c
wifi: iwlwifi: mvm: don't drop unencrypted MCAST frames
...
MCAST frames are filtered out by the driver if we are not
authorized yet.
Fix it to filter out only protected frames.
Fixes: 147eb05f24 ("iwlwifi: mvm: always tell the firmware to accept MCAST frames in BSS")
Signed-off-by: Ayala Beker <ayala.beker@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.9cedcc27db60.I8fb7057981392660da482dd215e85c15946d3f4b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:49 +02:00
Mukesh Sisodiya
5e31b3df86
wifi: iwlwifi: dbg: print pc register data once fw dump occurred
...
Add debug print for different FW program counter details of
different CPU. Program counter pc details will be read from
TLV during init.
Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413213309.862790d336a9.I34e2ea05a79e8b2552f7f221bacf3af0166cb9c0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-14 13:14:49 +02:00
Johannes Berg
d00800a289
wifi: mac80211: add flush_sta method
...
Some drivers like iwlwifi might have per-STA queues, so we
may want to flush/drop just those queues rather than all
when removing a station. Add a separate method for that.
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:32:31 +02:00
Johannes Berg
0b75a1b1e4
wifi: mac80211: flush queues on STA removal
...
When we remove a station, we first make it unreachable,
then we (must) remove its keys, and then remove the
station itself. Depending on the hardware design, if
we have hardware crypto at all, frames still sitting
on hardware queues may then be transmitted without a
valid key, possibly unencrypted or with a fixed key.
Fix this by flushing the queues when removing stations
so this cannot happen.
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:32:22 +02:00
Johannes Berg
2c9abe653b
wifi: ieee80211: correctly mark FTM frames non-bufferable
...
The checks of whether or not a frame is bufferable were not
taking into account that some action frames aren't, such as
FTM. Check this, which requires some changes to the function
ieee80211_is_bufferable_mmpdu() since we need the whole skb
for the checks now.
Reviewed-by: Ilan Peer <ilan.peer@intel.com >
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:32:02 +02:00
Johannes Berg
4fdeb84713
wifi: ieee80211: clean up public action codes
...
WLAN_PUBLIC_ACTION_FTM_RESPONSE is duplicated with
WLAN_PUB_ACTION_FTM, but that might better be called
WLAN_PUB_ACTION_FTM_RESPONSE; clean up here.
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:31:56 +02:00
Avraham Stern
217f3c52f0
wifi: iwlwifi: mvm: don't set CHECKSUM_COMPLETE for unsupported protocols
...
On Bz devices, CHECKSUM_COMPLETE was set for unsupported protocols
which results in a warning. Fix it.
Fixes: b6f5b647f6 ("iwlwifi: mvm: handle RX checksum on Bz devices")
Signed-off-by: Avraham Stern <avraham.stern@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413102635.a2a35286f0ca.I50daa9445a6465514c44f5096c32adef64beba5f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:30:00 +02:00
Avraham Stern
277f56a141
wifi: iwlwifi: trans: don't trigger d3 interrupt twice
...
When the IPC registers are used for sleep control, setting
the IPC sleep bit already triggers an interrupt to the fw, so
there is no need to also set the doorbell. Setting also the
doorbell triggers the sleep interrupt twice which lead to
an assert.
Fixes: af08571d39 ("iwlwifi: pcie: support Bz suspend/resume trigger")
Signed-off-by: Avraham Stern <avraham.stern@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413102635.b5f2f6e44d38.I4cb5b6ad4914db47a714e731c4c8b4db679cabce@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:30:00 +02:00
Mukesh Sisodiya
5caa82529e
wifi: iwlwifi: Update configurations for Bnj-a0 and specific rf devices
...
Correction in config data is done for loading the ucode.
Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413102635.879b654c8d83.I7dbea9f411a0b6f47908c4ad6321c7e55cbeb636@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:30:00 +02:00
Mukesh Sisodiya
d2ccc5c152
wifi: iwlwifi: Update init sequence if tx diversity supported
...
PHY configuration command need to be sent to FW if the tx diversity
with SISO is supported.
This need to be sent to get the init notification from FW.
Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413102635.c2121c8694a7.Ibee3dd8765ef4b7504660fa228a7c7eff78920af@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:30:00 +02:00
Mukesh Sisodiya
e305a408c5
wifi: iwlwifi: mvm: move function sequence
...
Need to move a function definition and actual changes
will be done in following commit.
Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413102635.00a6c203712f.I7c099e5c1954f1daa5a5039b98149b6f081e46ae@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:30:00 +02:00
Daniel Gabay
cb75abcebc
wifi: iwlwifi: nvm: Update HE capabilities on 6GHz band for EHT device
...
Max A-MPDU length exponent shall be set to 2 for EHT capable
device on 6GHz band in order to support 4MB aggregation.
Update HE MAC capabilities accordingly for station and softap
interfaces.
This change requires to add another ieee80211_sband_iftype_data for
uhb since high/uhb are no longer the same.
Signed-off-by: Daniel Gabay <daniel.gabay@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413102635.1eee32cfd199.I9c5ff3a6956d509137deca620814935149516fbc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:30:00 +02:00
Johannes Berg
a0c8ab93eb
wifi: iwlwifi: mvm: refactor TX csum mode check
...
There are two modes now, and we have two places checking
that must be in sync. Refactor the logic into a new small
helper function.
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413102635.ef6246f4b73b.I44820ec095634dd0bba3007465cf25e4ce1c77c6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:30:00 +02:00
Johannes Berg
d34d11aea2
wifi: iwlwifi: mvm: fix A-MSDU checks
...
Since Gl A-step devices use the old checksum hardware,
we shouldn't use the Bz code to check for A-MSDU
combining ability; fix that.
Fixes: ec18e7d4d2 ("wifi: iwlwifi: mvm: use old checksum for Bz A-step")
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413102635.8c445b943fee.Ibf772102ca712f59e2ee0cdd4c344011fcf445aa@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:29:59 +02:00
Golan Ben Ami
72429d68a0
wifi: iwlwifi: mvm: enable bz hw checksum from c step
...
B step doesn't support full checksum yet, move to c step.
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/20230413102635.697a9d74e84d.I6724874112692a04e29287cac9dad7140532557f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:29:59 +02:00
Avraham Stern
4e17e15605
wifi: iwlwifi: mvm: use OFDM rate if IEEE80211_TX_CTL_NO_CCK_RATE is set
...
IEEE80211_TX_CTL_NO_CCK_RATE indicates that CCK rates should not be
used, but is ignored by the driver. Fix it.
Signed-off-by: Avraham Stern <avraham.stern@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413102635.a322d18b5eb1.Icc46027a03f90feffb6fab49a5d82e54829d3dd9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:29:59 +02:00
Johannes Berg
925c6a40e3
wifi: iwlwifi: mvm: convert TID to FW value on queue remove
...
On queue remove, we should convert the TID value to the
firmware value (8 -> 15) just like we do on queue add.
Otherwise, the firmware will not be able to find the
correct queue to remove.
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413102635.6651077eaec3.Ia6868c8fc1a92063609bb057b6a618726712d0bb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:29:59 +02:00
Mukesh Sisodiya
0aa27be59e
wifi: iwlwifi: Update configuration for SO,SOF MAC and HR RF
...
update the device configuration for HR1 device for SO and SOF device.
QuZ device configuration is corrected to support specific CRF.
Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413102635.86f08520323f.Ieccb50de47f877b85732000a0d67b645eeeb0c2a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:29:59 +02:00
Miri Korenblit
413be839bf
wifi: iwlwifi: add a validity check of queue_id in iwl_txq_reclaim
...
This function receives the queue id to reclaim packets from. Currently
we're passing to it the queue id we received from the FW in the flush
response. We don't do any check of this value and it might be invalid.
In such case we will refer to a pointer to a queue which might be NULL.
Fix this by adding a validity check of the queue id before using it.
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/20230413102635.a9c3fd32bce7.I5fbdcf3b1b80eb96a907116c166f19dc0aae7cb8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:29:59 +02:00
Johannes Berg
0cc6fb8a0c
wifi: iwlwifi: nvm-parse: enable 160/320 MHz for AP mode
...
Initially, 160/320 MHz in AP mode were not supported.
After testing, enable the wider bandwidths in AP mode
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/20230413102635.ed04de3a2833.Ie3991179dfaf24880b96a0904a625dbf6b8fd579@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:29:58 +02:00
Johannes Berg
634c7b1bd0
wifi: iwlwifi: debug: fix crash in __iwl_err()
...
In __iwl_err(), if we rate-limit the message away, then
vaf.va is still NULL-initialized by the time we get to
the tracing code, which then crashes. When it doesn't
get rate-limited out, it's still wrong to reuse the old
args2 that was already printed, which is why we bother
making a copy in the first place.
Assign vaf.va properly to fix this.
Fixes: e5f1cc98cc ("iwlwifi: allow rate-limited error messages")
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com >
Link: https://lore.kernel.org/r/20230413102635.e27134c6bcd4.Ib3894cd2ba7a5ad5e75912a7634f146ceaa569e2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
2023-04-13 16:29:58 +02:00
Martin Blumenstingl
b2a777d684
wifi: rtw88: Add support for the SDIO based RTL8821CS chipset
...
Wire up RTL8821CS chipset support using the new rtw88 SDIO HCI code as
well as the existing RTL8821C chipset code.
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com >
Tested-by: Chris Morgan <macromorgan@hotmail.com >
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com >
Signed-off-by: Kalle Valo <kvalo@kernel.org >
Link: https://lore.kernel.org/r/20230405200729.632435-10-martin.blumenstingl@googlemail.com
2023-04-12 15:51:10 +03:00
Martin Blumenstingl
6fdacb78f7
wifi: rtw88: Add support for the SDIO based RTL8822CS chipset
...
Wire up RTL8822CS chipset support using the new rtw88 SDIO HCI code as
well as the existing RTL8822C 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/20230405200729.632435-9-martin.blumenstingl@googlemail.com
2023-04-12 15:51:10 +03:00
Jernej Skrabec
095e62dd74
wifi: rtw88: Add support for the SDIO based RTL8822BS chipset
...
Wire up RTL8822BS chipset support using the new rtw88 SDIO HCI code as
well as the existing RTL8822B chipset code.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com >
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/20230405200729.632435-8-martin.blumenstingl@googlemail.com
2023-04-12 15:51:09 +03:00
Martin Blumenstingl
7d6d2dd326
mmc: sdio: add Realtek SDIO vendor ID and various wifi device IDs
...
Add the SDIO vendor ID for Realtek and some device IDs extracted from
their GPL vendor driver. This will be useful in the future when the
rtw88 driver gains support for these chips.
Acked-by: Ulf Hansson <ulf.hansson@linaro.org >
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com >
Reviewed-by: Pali Rohár <pali@kernel.org >
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com >
Signed-off-by: Kalle Valo <kvalo@kernel.org >
Link: https://lore.kernel.org/r/20230405200729.632435-7-martin.blumenstingl@googlemail.com
2023-04-12 15:51:09 +03:00
Martin Blumenstingl
02461d9368
wifi: rtw88: main: Reserve 8 bytes of extra TX headroom for SDIO cards
...
For SDIO host controllers with DMA support the TX buffer physical memory
address need to be aligned at an 8-byte boundary. Reserve 8 bytes of
extra TX headroom so we can align the data without re-allocating the
transmit buffer.
While here, also remove the TODO comment regarding extra headroom for
USB and SDIO. For SDIO the extra headroom is now handled and for USB it
was not needed so far.
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/20230405200729.632435-6-martin.blumenstingl@googlemail.com
2023-04-12 15:51:09 +03:00
Martin Blumenstingl
a5d25f9ff9
wifi: rtw88: main: Add the {cpwm,rpwm}_addr for SDIO based chipsets
...
Initialize the rpwm_addr and cpwm_addr for power-saving support on SDIO
based chipsets.
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/20230405200729.632435-5-martin.blumenstingl@googlemail.com
2023-04-12 15:51:08 +03:00
Martin Blumenstingl
b722e5b130
wifi: rtw88: mac: Support SDIO specific bits in the power on sequence
...
Add the code specific to SDIO HCI in the MAC power on sequence. This is
based on the RTL8822BS and RTL8822CS vendor drivers.
Co-developed-by: Jernej Skrabec <jernej.skrabec@gmail.com >
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com >
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/20230405200729.632435-4-martin.blumenstingl@googlemail.com
2023-04-12 15:51:08 +03:00
Martin Blumenstingl
65371a3f14
wifi: rtw88: sdio: Add HCI implementation for SDIO based chipsets
...
Add a sub-driver for SDIO based chipsets which implements the following
functionality:
- register accessors for 8, 16 and 32 bits for all states of the card
(including usage of 4x 8 bit access for one 32 bit buffer if the card
is not fully powered on yet - or if it's fully powered on then 1x 32
bit access is used)
- checking whether there's space in the TX FIFO queue to transmit data
- transfers from the host to the device for actual network traffic,
reserved pages (for firmware download) and H2C (host-to-card)
transfers
- receiving data from the device
- deep power saving state
The transmit path is optimized so DMA-capable SDIO host controllers can
directly use the buffers provided because the buffer's physical
addresses are 8 byte aligned.
The receive path is prepared to support RX aggregation where the
chipset combines multiple MAC frames into one bigger buffer to reduce
SDIO transfer overhead.
Co-developed-by: Jernej Skrabec <jernej.skrabec@gmail.com >
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com >
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org >
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com >
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Kalle Valo <kvalo@kernel.org >
Link: https://lore.kernel.org/r/20230405200729.632435-3-martin.blumenstingl@googlemail.com
2023-04-12 15:51:08 +03:00
Martin Blumenstingl
6a92566088
wifi: rtw88: Clear RTW_FLAG_POWERON early in rtw_mac_power_switch()
...
The SDIO HCI implementation needs to know when the MAC is powered on.
This is needed because 32-bit register access has to be split into 4x
8-bit register access when the MAC is not fully powered on or while
powering off. When the MAC is powered on 32-bit register access can be
used to reduce the number of transfers but splitting into 4x 8-bit
register access still works in that case.
During the power on sequence is how RTW_FLAG_POWERON is only set when
the power on sequence has completed successfully. During power off
however RTW_FLAG_POWERON is set. This means that the upcoming SDIO HCI
implementation does not know that it has to use 4x 8-bit register
accessors. Clear the RTW_FLAG_POWERON flag early when powering off the
MAC so the whole power off sequence is processed with RTW_FLAG_POWERON
unset. This will make it possible to use the RTW_FLAG_POWERON flag in
the upcoming SDIO HCI implementation.
Note that a failure in rtw_pwr_seq_parser() while applying
chip->pwr_off_seq can theoretically result in the RTW_FLAG_POWERON
flag being cleared while the chip is still powered on. However,
depending on when the failure occurs in the power off sequence the
chip may be on or off. Even the original approach of clearing
RTW_FLAG_POWERON only when the power off sequence has been applied
successfully could end up in some corner case where the chip is
powered off but RTW_FLAG_POWERON was not cleared.
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/20230405200729.632435-2-martin.blumenstingl@googlemail.com
2023-04-12 15:51:08 +03:00