LinuxKPI: 802.11/skb: add extra information for skb alloc failures
rtw88 seems to have an skb leak still.
Add a WARN_ONCE to __skb_queue_purge() just to make sure there is no
glitch due to missing locking.
Also add a rolling error reporting for skb allocation failures in
LinuxKPI to gather some more information if possible about queue
states.
This is a corrected version of what was initially part of D48474.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
LinuxKPI: 802.11: ieee80211_vif_usable_links()
ieee80211_vif_usable_links() shows up in TODO() tracking.
Turns out the return (1) is likely wrong and should be 0 given we do
not support MLD yet. For now return the valid_links bitmap and leave
an IMPROVE as likely not all of the valid ones will be useable.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
LinuxKPI; 802.11: start implementing cfg80211_calculate_bitrate()
For now we only return the legacy rate and have two TODOs for HT and
VHT which still need to be implemented as needed.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
LinuxKPI: 802.11: make struct ieee80211_tx_info a bit more packed
Given I was looking at the struct make it more packed at the beginning
at least. In fact it did not shrink but the tx_time_est got expanded.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
LinuxKPI: 802.11: fill in a lot more RX status fields
Convert a lot more LinuxKPI rx_status fields to net80211 rx_stats
bits for as much as we can see fit. Factor the entire logic out
into its own function as it got quite long.
Now only net80211 needs to start using more of these values and
report them.
Also fix some related fields and struct definitions in LinuxKPI.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
pctrie: Fix size of printed value in KASSERT
The value 'index' in a pctrie iterator cannot be written
with "%lx" on a 32-bit machine. Use '%jx' after a uintmax_t cast instead.
Reported by: bz
Fixes: bba883df5e88d0fb1133b23c05db5501dd321ad8
net80211: crypto: ccmp: fix more hardware offload bits
Add the missing IEEE80211_RX_F_DECRYPTED and IEEE80211_RX_F_MMIC_STRIP
(really just MIC_STRIP) checks to make hwaccel offload work.
This makes rtw8x drivers pass RX packets again at least with LinuxKPI
if HW_CRYPTO support is enabled.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D49030
net80211/crypto: LinuxKPI/802.11: introduce IEEE80211_RX_F_PN_VALIDATED
There are cases when we see "rx seq# violation (CCMP)".
Historically these were AHDEMO/IBBS cases (IEEE80211_KEY_NOREPLAY,
see 5d766a09daab2).
With iwlwifi(4) doing RSS for newer chipsets and us not having any idea
about multiple rx-queues (passed all the way through) leads to the same
problem. An easy way to trigger this is doing an IPv6 all-nodes echo
request. With a sufficient amount of nodes answering the answers will
be hashed to different queues and re-ordering will likely take place
as queues get released individually.
However crypto validation is already done in fw/driver for these cases
and we need to carry the state forward. Add IEEE80211_RX_F_PN_VALIDATED
to indicate that the checks were done passing the information from driver
through LinuxKPI to net80211.
LinuxKPI enforces that a frame was indeed decrypted; otherwise the flag
would be invalid.
[8 lines not shown]
pctrie: iter_remove check from panic to KASSERT
pctrie_iter_remove checks to see if the thing the iterator points to
is actually there, and panics if it is not. This panic would likely
indicate the same iterator had been used for removal twice, without
advancing the iterator in-between. This test takes a bit of time, and
as it indicates a programmer error rather than some external
condition, it is better handled as a KASSERT. This means with KASSERTs
disabled, a wee bit of time is saved.
Reviewed by: alc, markj
Differential Revision: https://reviews.freebsd.org/D49015
sdhci: Fixes for sdhci_fdt_rockchip.c
This change fixes a couple of issues in the Rockchip SDHCI driver:
- Fix a panic caused by sdhci_fdt_rockchip_attach not populating the
softc's dev variable before initializing clocks
- Fix a bug where sdhci_fdt_rockchip_set_clock fails to call
sdhci_fdt_set_clock
Fixes: e17e33f997d6
Reported by: Alonso Cárdenas Márquez (acardenas at bsd-peru.org)
igc: Remove unused register IGC_RXD_SPC_VLAN_MASK
We don't use legacy receive descriptors and masking out the vlan ID
isn't necessary since the tag is in the standard format, so remove it.
(cherry picked from commit 124b7722aad7d4cf12d96c030659aef78175aa9c)
igc: Remove unused register IGC_RXD_SPC_VLAN_MASK
We don't use legacy receive descriptors and masking out the vlan ID
isn't necessary since the tag is in the standard format, so remove it.
(cherry picked from commit 124b7722aad7d4cf12d96c030659aef78175aa9c)
LinuxKPI: 802.11: implement various VHT helper functions
Implement ieee80211_rate_set_vht(), ieee80211_rate_get_vht_{mcs,nss}(),
and ieee80211_get_vht_max_nss().
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
LinuxKPI: 802.11: adjust the hw_scan channel list
Until net80211 will grow proper scan offload with the various options
needed and will allow switching the scan engine try to improve the
situation if we are doing a hw_scan and the device supports
SINGLE_SCAN_ON_ALL_BANDS. In that case create the channel list from
our device information of supported channels rather than from the
net80211 scan list. Filter out currently unsupported bands.
While the general "scan EBUSY" problem remains at least in my local
testing I am seeing a lot more 2 and 5 GHz band results rather than
being stuck on a single band (as was also often the case with iwm for
me in the past).
Tested by: rene (previous version)
MFC after: 3 days
ar40xx: fix to compile/run under the new ifnet rules
Locally tested:
* IPQ4018, Asus router, w/ ethernet driver
Differential Revision: https://reviews.freebsd.org/D49025
Reviewed by: imp, zlei
vm_object: drop pointless assignment
An assignment in collapse_scan() has become useless because, on every
path, another assignment to that variable overrides it before that
variable is read. Another assignment can be avoided sometimes, so
move it down in the loop to where it's really necessary.
Reviewed by: alc, markj
Differential Revision: https://reviews.freebsd.org/D49017
net80211: use IEEE80211_KEY_UNDEFINED() insetad of checking they keyix
For ieee80211_node_delucastkey() rather than checking the keyix to be
IEEE80211_KEYIX_NONE use the IEEE80211_KEY_UNDEFINED() macro (which
chekes the wk_cipher to be 'none').
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D48980
net80211: crypto: enhance comment about IEEE80211_RX_F_MMIC_STRIP
net80211 crypto currently re-uses the M[ichael]MIC flag for MIC as well
at least in CCMP. This is a bit confusing so at least try to improve
the comment that it becomes more obvious.
In the long-term we may want to just add a MIC flag as well?
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D48978
net80211: rename \4 in IEEE80211_VHTCAP_BITS for clarity
Bits 2 and 3 (\3 and \4 of the %b flag mask) are the 'Supported Channel
Width Set' indicating VHT160 (B2) or VHT160 and VHT80P80 (B3) support.
Though longer rename \4 from CHAN80P80 to CHAN160+80P80 to not confuse
the reader that VHT160 might not be supported.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D48977
net80211/ifconfig: swap IEEE80211_FVHT_USEVHT160 and 80P80
ieee80211_setupcurchan() compares the flags in a greater than manner.
In this case VHT160 should be > VHT80P80 as it is preferable.
Swap the two flags and add a comment to note this.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D48976
net80211 / LinuxKPI 802.11: add 802.11-2016 VHT Extended NSS BW defines
Add the mask and shift for the VHT Extended NSS BW Support field.
Document them in net80211 and further related bitmasks in LinuxKPI.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D48975
flash: add w25n (nand flash) support
This adds read only support for the W25N series of flash parts.
Specifically starting with the W25N01GV, a 128MiB SPI NAND flash.
This doesn't currently support writing or erasing, as this requires
a NAND flash layer that we don't currently have. There are also
plenty of other commands that aren't currently supported - notably
maintaining the on-chip flash translation layer, flash wear statistics,
etc.
But read support is fine enough for now; it at least allows for
reading the boot / config / calibration flash on my ASUS IPQ4018 based
router.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D48979