I don't yet know which RX descriptor bits map to shortgi, long-gi,
short-preamble, long-preamble, STBC, LDPC, HT40, etc - so I can't
easily add those just yet.
There's apparently no per-frame RX RSSI information exposed so we
also just use the results from the previous calibration task.
This also tidies up how the per-mbuf RSSI is pushed into the frame -
now that it's attached to the mbuf via rx_stats, we don't have to
do any silly hijinx to get it out of the frame processing path.
Tested:
* RTL8712, 1x1 cut 3, STA mode
boot panics in conjunction with the recently added EARLY_AP_STARTUP feature.
The panics happen due to using kernel facilities like callouts too early.
Tested by: jhb @
MFC after: 1 week
- Do not ignore initialization errors; call ieee80211_stop()
when initialization failed.
- Use usb_pause_mtx() instead of DELAY() while waiting for firmware
loading; this fixes system freeze during firmware startup.
- Do not execute rsu_stop() when device is powered off; fixes
'unknown board type (rfconfig=0xff)' error when the device is
reattached.
Tested with Asus USB-N10.
- Replace all remaining DPRINTF(N)'s with RSU_DPRINTF.
- Add new RSU_DEBUG_USB flag to track error codes returned by
usbd_do_request_flags().
- Improve few messages.
- Add partial promiscuous mode support (no management frames;
they cannot be received by the firmware and net80211 at the same time).
- Add monitor mode support (all frames).
Tested with Asus, USB-N10.
This is required for USB Rx aggregation
(and fixes 'could not allocate RX mbuf' / few other failures).
While here, reduce the number of Rx buffers from 100 to 1 -
the driver never uses more than one Rx buffer.
Tested with Asus USB-N10.
values. This more closely matches other wifi drivers in the tree.
The bitmap levels have been based closely on other drivers (primarily
[u]rtwn(4)) in the hope that one day these can be unified into a shared
wifi-debug framework.
This is the first step of several pieces of work I'm planning on doing
with the run(4) driver. I may well adjust and refine some of the debug
bitmaps at a later date.
Reviewed by: adrian, avos
Differential Revision: https://reviews.freebsd.org/D8704
This change includes firmware commands for key setup +
some additional checking via CAMREAD / CAMWRITE registers.
Nothing (except rsu_delete_key() for pairwise keys) is deferred;
to ensure that things are done in order rsu_set_key() will wait
until key deletion task will be finished.
Tested with Asus USB-N10 (all ciphers).
Differences from initial (reviewed) patch:
- Pause AC queues before disassociation - since CMD_DISCONNECT clears
crypto state all pending frames must be processed / dropped before it.
- Check sc_running flag before trying to set static keys.
- Clear key index from bitmap even when firmware command fails
(it will be invalidated via CAMWRITE anyway).
Reviewed by: adrian, kevlo
Tested by: kevlo
Differential Revision: https://reviews.freebsd.org/D8706
- Append RCR_APP_PHYSTS bit after firmware loading - otherwise
firmware will reset the register and this modification will be lost.
(without it Rx PHY descriptor section will contain garbage).
- Check if R92S_RXDW0_PHYST bit is set (like it is done in rtwn(4)) -
even if infosz is non-zero the section may not contain anything useful.
- In case, if descriptor is absent (A-MPDU?) use last calibrated RSSI
(rtwn(4) uses RSSI from the previous (sub)frame; probably, this
approach should be used here too).
Tested with Asus USB-N10, STA mode.
- Fill in Rx radiotap header correctly (for every packet in a chain;
not once per chain).
- Fix rate / flags fields in Rx radiotap.
- Add debug messages for discarded frames.
- Pass received control (< sizeof(struct ieee80211_frame)) frames
to net80211 (if allowed by device filter; cannot happen yet).
Tested with Asus USB-N10.
Differential Revision: https://reviews.freebsd.org/D5723
- Set IEEE80211_FEXT_SCAN_OFFLOAD flag; firmware can send null data
frames when associated.
- Check IEEE80211_SCAN_ACTIVE scan flag instead of IEEE80211_F_ASCAN
ic flag; the last is never set since r170530.
- Eliminate software scan (net80211) <-> site_survey (driver) race:
* override ic_scan_curchan and ic_scan_mindwell pointers so net80211
will not try to finish scanning automatically;
* inform net80211 about current status via ieee80211_cancel_scan()
and ieee80211_scan_done();
* remove corresponding workaround from rsu_join_bss().
Now the driver can associate to an AP with hidden SSID.
Tested with Asus USB-N10.
The directly following m_defrag() call can wait, so there is no reason this
call can't as well.
Reported by: Coverity
CID: 1353551
Sponsored by: Dell EMC Isilon
- Use ums lock as evdev lock
- Do not cap axes values to sysmouse limits for evdev reports
- Do not map T-axis events to buttons for evdev reports
- Use shortcuts for event reporting
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after: 1 week
When detaching device trees parent devices must be detached prior to
detaching its children. This is because parent devices can have
pointers to the child devices in their softcs which are not
invalidated by device_delete_child(). This can cause use after free
issues and panic().
Device drivers implementing trees, must ensure its detach function
detaches or deletes all its children before returning.
While at it remove now redundant device_detach() calls before
device_delete_child() and device_delete_children(), mostly in
the USB controller drivers.
Tested by: Jan Henrik Sylvester <me@janh.de>
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D8070
MFC after: 2 weeks
to ieee80211_add_rx_params() + drop last (ieee80211_rx_stats) parameter
Note: there is an additional check for ieee80211_get_rx_params()
return value (which does not exist in the original diff).
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D8207
- If check for net,ethernet/usb,device compatible node fails, try to find
.../usb/hub/ethernet, where ... is bus path that can depend on actual HW.
net,ethernet/usb,device compatibity strings are FreeBSD custom invention
that is used only in RPi DTBs and since there is no other way to tie USB
device to FDT node we just do our best effort here to work with upstream
device tree
- Use -1 value to indicate invalid phandle_t, 0 is valid phandle value and
shouldn't be used as error signal
This should have been committed in r307093: resource allocation depends
on source of the device tree. upstream dts has extra interrupt that we can
ignore
There are a variety of more interesting RX statistics that we should
keep track of but we don't. This is a starting point for adding more
information.
Specifically:
* now the RX rate information and some of the packet status is
passed up;
* The 32 bit or 64 bit TSF is passed up;
* the PHY mode is passed up;
* the "I'm decap'ed AMSDU!" state is passed up;
* number of RX chains is bumped to 4.
This is all mostly a placeholder for getting the data into the RX status
before we pass it up to net80211 - unfortunately we don't yet enforce
that drivers provide it, nor do we pass the provided info back up the
stack so anyone can use the data.
We're going to need to use some of this data moving forward.
Notably, now that some hardware can do AMSDU decap for us (the intel iwm
driver can do it when we flip it on; the ath10k port I'm doing does
it for us) then we need to pass it up through the stack so the duplicate
RX sequence numbers and crypto/IV details don't cause the packet to
be dropped and/or counted against a replay counter.
It's also the beginning of being able to do more interesting node
accounting in net80211. Specifically, once drivers start populating
per-packet rate information, AMPDU information, timestamps, etc,
we can start providing histograms of rate-versus-RSSI, account
for receive time spent per node and other such interesting things.
(Note: I'm also hoping to include ranging and RTT information for
future chipset support; and it's likely going to include it in
this kind of fashion.)
Replace various void * / int argument combinations with common structures:
- ieee80211_ratectl_tx_status for *_tx_complete();
- ieee80211_ratectl_tx_stats for *_tx_update();
While here, improve amrr_tx_update() for a bit:
1. In case, if receiver is not known (typical for Ralink USB drivers),
refresh Tx rate for all nodes on the interface.
2. There was a misuse:
- otus(4) sends non-decreasing counters (as originally intended);
- but ural(4), rum(4) and run(4) are using 'read & clear' registers
to obtain statistics for some period of time (and those 'last period'
values are used as arguments for tx_update()). If arguments are not big
enough, they are just discarded after the next call.
Fix: move counting into *_tx_update()
(now otus(4) will zero out all node counters after every tx_update() call)
Tested with:
- Intel 3945BG (wpi(4)), STA mode.
- WUSB54GC (rum(4)), STA / HOSTAP mode.
- RTL8188EU (urtwn(4)), STA mode.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D8037
- Convert "options EVDEV" to "device evdev" and "device uinput", add
modules for both new devices. They are isolated subsystems and do not
require any compile-time changes to general kernel subsytems
- For hybrid drivers that have evdev as an optional way to deliver input
events add option EVDEV_SUPPORT. Update all existing hybrid drivers
to use it instead of EVDEV
- Remove no-op DECLARE_MODULE in evdev, it's not required, MODULE_VERSION
is enough
- Add evdev module dependency to uinput
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Prepare for making evdev a module. "Pure" evdev device drivers (like
touchscreen) and evdev itself can be built as a modules regardless of
"options EVDEV" in kernel config. So if people does not require evdev
functionality in hybrid drivers like ums and ukbd they can, for instance,
kldload evdev and utouchscreen to run FreeBSD in kiosk mode.
Clear 'sc_calibrating' flag and stop calibration task when interface
is not associated; this fixes possible panic after detach.
Reported and tested by: hselasky
Reviewed by: adrian
MFC after: 6 days
event generation is disabled by default in favour of sysmouse. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 2 should
be set to give priority to hw over sysmouse
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by: hans
Differential Revision: https://reviews.freebsd.org/D7863
event generation is disabled by default in favour of kbdmux. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 3 should
be set to give priority to hw over mux
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by: hans
Differential Revision: https://reviews.freebsd.org/D7957