Implement ieee80211_is_data_present() and a subset of
ieee80211_is_bufferable_mmpdu() which hopefully is good enough in
the compat code for now.
This is partly in preparation for some TXQ changes coming up soon.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
In ieee80211_beacon_loss() call into net80211::ieee80211_beacon_miss()
rather than manually bouncing our state. That should give us the
ability to send a probereq and see if the AP is till there rather than
right away going to scan.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
To avoid annoyng messages from glibc-2.35 test suite add the simple
implementation of rseq syscall which is do nothing for now.
I plan to implement it if and when the API stabilizes.
MFC after: 2 weeks
Disable preemption in seqlock write sections when using the _irqsave
variant. This ensures that a writer can't be preempted and subsequently
starved by a reader running in a callout handler on the same CPU.
This fixes occasional display hangs seen when using the i915 driver.
Tested by: emaste, wulf
Reviewed by: wulf, hselasky
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35021
In ieee80211_sn_sub() we need to shift the mask before applying it.
This fixes the logic from 978f25e840.
Reported by: J.R. Oldroyd (fbsd opal.com)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Created a couple of helpers to send signals to the specific thread or to
the whole process. Use helpers in the corresponding syscalls.
This fixes the confusion where a signal destined for a whole process
was sent to a specific thread and vice versa.
There is an exclusion for the linux_kill() syscall that takes a pid
argument and should send a signal to the whole process, but I know
at least one example where kill() takes tid.
MFC after: 2 weeks
__diagused only squelches warnings for variables used under
INVARIANTS, it does not apply to custom debug knobs like
LINUXKPI_DEBUG_80211. Use __unused instead.
Initially we were using the IEs from ieee80211_probereq_ie() of net80211
and put them into the common_ies field. Start by manually building the
per-band and common IE parts as drivers put them back together.
This also involves allocating the req.ie as one buffer for all IEs over
all bands and setting req.ie_len correctly based on how many bytes we
put in.
Manually building per-band scan IEs we still use the net80211 routines
to add IEs to the buffer (mostly).
This is needed by Realtek drivers but will equally used by others.
Realtek would simply panic due to skbs being allocated with the wrong
length.
Longer-term this will help us, e.g., when not supporting VHT on 2Ghz
and we would have to do this anyway.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Use an sx lock to protect the list of vifs. We could use the
linux mutex compat for this but our current implementation may
re-acquire the lock recursively so allow this. The change is
mainly motivated by the fact that some callers may sleep in the
interator function called. Recursiveness is needed because we
see find_sta_by_ifaddr() being called from an iterator function
from iterate_interfaces().
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Start adding rate control feedback in ieee80211_tx_status() in order
for net80211 to be able to report something back (which may not
yet be the view of the firmware). iwlwifi is reporting back an MSC 0
even with HT disabled (to be investigated) so we cannot (yet) use
the firmware/driver rate feedback directly.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Implement skb_copy() with omissions of fragments and possibly other fields
for now. Should we hit frags at any point a log message will let us know.
For the few cases we need this currently this is enough.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
While it is currently unclear if we will have to defer work in
dev_kfree_skb_irq() to call dev_kfree_skb().
We only have one caller which seems to be fine on FreeBSD by calling
it directly for now.
While here shortcut skb_put()/skb_put_data() saving us work if there
are no adjustments to do.
Also adjust the logging in skb_is_gso() to avoid getting spammed by it.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
This file holds a UUID that is invariant for every boot. In our case, it is
invariant per mount.
PR: 262369
Reported by: sodynet1@gmail.com
Approved by: dchagin@
Differential Revision: https://reviews.freebsd.org/D34860
Add a dummy implementation for ieee80211_beacon_get_tim().
Add the implementation for ieee80211_sn_sub().
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Add ALIGN_DOWN as rounddown2() along ALIGN() which is implemented as
roundup2().
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: manu, hselasky (now with less ())
Differential Revision: https://reviews.freebsd.org/D34844
60970a328e did one half of the job
of making rssi relative to nf and numbers for radiotap were fine.
net80211 internally works with .5 dBm units thus we need to apply a
* 2 to the value we pass in to c_rssi; leave a comment explaining.
Note: it is only ifconfig in user space which re-adjust it for printing
or contrib/wpa for calculations. Other applications getting values
from kernel also have to apply the maths.
In collaboration with: J.R. Oldroyd (fbsd opal.com)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
dev_alloc_skb() comapred to alloc_skb() reserves some headroom
at the beginning of the skb which is used by drivers.
Split the code for the two cases and reserve NET_SKB_PAD space,
which should at least be 32 octets.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Move io_mapping_create_wc to .c because it encodes the size of struct
io_mapping so we move this from the client module to the linuxkpi
module.
Sponsored by: Netflix
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D34776
lkpi_pcim_iomap_devres_find encodes the size of struct pcim_iomap_devres
in the code, so move from .h to .c to move from client driver to
linuxkpi module.
Sponsored by: Netflix
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D34775
pci_alloc_irq_vectors encodes the size of struct msix_entry
into its code. Move from .h to .c to move this knowledge from
client modules to linuxkpi module.
Sponsored by: Netflix
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D34774
Both pci_request_region and _lkpi_pci_iomap encode the size of struct
pci_mmio_region into their code. Move from .h to .c files to move that
knowledge from the client drivers into the linuxkpi module.
Sponsored by: Netflix
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D34773
lkpi_pci_devres_get_alloc encodes the struct pci_devres into its
code. Move from .h file to .c file to move this knowledge into linuxkpi
module.
Sponsored by: Netflix
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D34772
Move cdev_alloc into linux_compat.c since it encodes the size of struct
linux_cdev into the client modules otherwise.
Sponsored by: Netflix
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D34771
class_create encodes the size of struct class into the generated
code. Move from .h file to .c file to move this knowledge from the
client modules that call this into the linuxkpi module.
Sponsored by: Netflix
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D34769
device_create_groups_vargs encodes the size of struct device. Move
definition from .h to .c to move this size into the linuxkpi module
rather than encoding it in all client driver modules.
Sponsored by: Netflix
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D34768
kobject_create knows the size of struct kobject. Move it to
linux_compat.c so this knowledge is confined to the loadable module and
not the clients.
Sponsored by: Netflix
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D34767
LinuxKPI is asking for single-segment mappings. Some (wireless) drivers
are using this to map multi-pages and our busdma framework is not very
friendly to that as single-segments [D31823]. Add a counter so we can
track when this happens to gather more information.
Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34715
As in 4a22cd6c4e nf and rss should be
signed and not unsigned. Change the types in the header and while
here change a magic number to a define as done elsewhere (value does
not change).
When calculating c_rssi we need to make it relative so subtract nf.
And while here improve the debug output.
This will hopefully fix ifconfig wlanN list scan S:N output which
tools use to chose a BSSID and help net80211 internal calculations.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days