History log of /freebsd-current/sys/dev/usb/wlan/if_runvar.h
Revision Date Author Comments
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# e649b526 03-Jun-2020 Adrian Chadd <adrian@FreeBSD.org>

[run] Fix up tx/rx frame size.

This specifically fixes that TX frames are large enough now to hold a 3900 odd
byte AMSDU (the little ones); me flipping it on earlier messed up transmit!

Tested:

* if_run, STA mode, TX/RX TCP/UDP iperf. TCP is now back to normal and
correctly does ~ 3200 byte AMSDU/fast frames (2x1600ish byte MSDUs).


# f520d761 29-May-2020 Adrian Chadd <adrian@FreeBSD.org>

[run] Add initial 802.11n support.

* Enable self-generated 11n frames
* add MCS rates for 1-stream and 2-stream rates; will do 3-stream
once the rest of this tests out OK with other people.
* Hard-code 1 stream for now
* Add A-MPDU RX mbuf tagging
* RTS/CTS if doing RTSCTS in HT protmode as well as legacy; they're
separate configuration flags
* Update the amrr rate index stuff - walk the rates array like others
to find the right one - this now works for MCS and CCK/OFDM rates
* Add support for atheros fast frames/AMSDU support as we can generate
those in net80211.

TODO:

* HT40 isn't enabled yet
* No A-MPDU support just yet; that requires some more firmware research
and maybe porting some ath(4) A-MPDU support/tracking into net80211
* Short preamble flags aren't set yet for MCS; need to check the linux
driver and see what's going on there
* Add 3x3 rates and set tx/rx stream configuration appropriately
* More 5GHz testing; I have a 3x3 dual band USB NIC coming soon that'll
let me test this.
* Figure out why the RX path isn't performing as fast as it could -
there's only a single buffer loaded at a time for the receive path
in the USB bulk handler and this may not be super useful.

Tested:

* RT5390 usb, 1x1, RF5370 (2GHz radio), STA mode - A-MSDU TX, A-MPDU RX

Submitted by: Ashish Gupta <ashishgu@andrew.cmu.edu>
Differential Revision: https://reviews.freebsd.org/D22840


# 786ac703 10-Mar-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

Fix ieee80211_radiotap(9) usage in wireless drivers:

- Alignment issues:
* Add missing __packed attributes + padding across all drivers; in
most places there was an assumption that padding will be always
minimally suitable; in few places - e.g., in urtw(4) / rtwn(4) -
padding was just missing.
* Add __aligned(8) attribute for all Rx radiotap headers since they can
contain 64-bit TSF timestamp; it cannot appear in Tx radiotap headers, so
just drop the attribute here. Refresh ieee80211_radiotap(9) man page
accordingly.

- Since net80211 automatically updates channel frequency / flags in
ieee80211_radiotap_chan_change() drop duplicate setup for these fields
in drivers.

Tested with Netgear WG111 v3 (urtw(4)), STA mode.

MFC after: 2 weeks


# f6930bec 02-Oct-2016 Andriy Voskoboinyk <avos@FreeBSD.org>

net80211: ieee80211_ratectl*: switch to reusable KPI

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


# 887a6324 20-Sep-2016 Andriy Voskoboinyk <avos@FreeBSD.org>

net80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.

This field may be used for received frames only.

Differential Revision: https://reviews.freebsd.org/D3826
Differential Revision: https://reviews.freebsd.org/D3827


# ae132f11 03-Mar-2016 Andriy Voskoboinyk <avos@FreeBSD.org>

zyd, run, ural: do not corrupt MAC address

Do not use ic_macaddr as a storage for current BSSID;
it may be reused in vap creation procedure;
similar to r288619.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5513


# 4f4a7a03 11-Oct-2015 Adrian Chadd <adrian@FreeBSD.org>

net80211 drivers: eliminate any references to sc_rxtap_len/sc_txtap_len (never used here)

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3776


# 99feb202 03-Oct-2015 Adrian Chadd <adrian@FreeBSD.org>

run(4): Add initial support for IBSS merge.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3592


# 0cf00015 22-Sep-2015 Adrian Chadd <adrian@FreeBSD.org>

net80211: include one copy of struct ieee80211_beacon_offsets into ieee80211vap

Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3658


# ef9c0768 08-Sep-2015 Kevin Lo <kevlo@FreeBSD.org>

Add TSF field into TX/RX radiotap headers

Tested on RT5370, sta mode.
Submitted by: Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision: https://reviews.freebsd.org/D3590


# de7eb46e 08-Sep-2015 Kevin Lo <kevlo@FreeBSD.org>

- Remove empty key_update_* functions.
- Hide "struct ieee80211_node *" -> "struct run_node *" casting behind
RUN_NODE() macro.
- Simplify IEEE80211_HAS_ADDR4 macro definition
- Fix a comment (desn't -> doesn't)

Submitted by: Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision: https://reviews.freebsd.org/D3588


# 7a79cebf 27-Aug-2015 Gleb Smirnoff <glebius@FreeBSD.org>

Replay r286410. Change KPI of how device drivers that provide wireless
connectivity interact with the net80211 stack.

Historical background: originally wireless devices created an interface,
just like Ethernet devices do. Name of an interface matched the name of
the driver that created. Later, wlan(4) layer was introduced, and the
wlanX interfaces become the actual interface, leaving original ones as
"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer
and a driver became a mix of methods that pass a pointer to struct ifnet
as identifier and methods that pass pointer to struct ieee80211com. From
user point of view, the parent interface just hangs on in the ifconfig
list, and user can't do anything useful with it.

Now, the struct ifnet goes away. The struct ieee80211com is the only
KPI between a device driver and net80211. Details:

- The struct ieee80211com is embedded into drivers softc.
- Packets are sent via new ic_transmit method, which is very much like
the previous if_transmit.
- Bringing parent up/down is done via new ic_parent method, which notifies
driver about any changes: number of wlan(4) interfaces, number of them
in promisc or allmulti state.
- Device specific ioctls (if any) are received on new ic_ioctl method.
- Packets/errors accounting are done by the stack. In certain cases, when
driver experiences errors and can not attribute them to any specific
interface, driver updates ic_oerrors or ic_ierrors counters.

Details on interface configuration with new world order:
- A sequence of commands needed to bring up wireless DOESN"T change.
- /etc/rc.conf parameters DON'T change.
- List of devices that can be used to create wlan(4) interfaces is
now provided by net.wlan.devices sysctl.

Most drivers in this change were converted by me, except of wpi(4),
that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing
changes to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann,
Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in
testing.

Reviewed by: adrian
Sponsored by: Netflix
Sponsored by: Nginx, Inc.


# ba2c1fbc 07-Aug-2015 Adrian Chadd <adrian@FreeBSD.org>

Revert the wifi ifnet changes until things are more baked and tested.

* 286410
* 286413
* 286416

The initial commit broke a variety of debug and features that aren't
in the GENERIC kernels but are enabled in other platforms.


# 79d2c5e8 07-Aug-2015 Gleb Smirnoff <glebius@FreeBSD.org>

Change KPI of how device drivers that provide wireless connectivity interact
with the net80211 stack.

Historical background: originally wireless devices created an interface,
just like Ethernet devices do. Name of an interface matched the name of
the driver that created. Later, wlan(4) layer was introduced, and the
wlanX interfaces become the actual interface, leaving original ones as
"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer
and a driver became a mix of methods that pass a pointer to struct ifnet
as identifier and methods that pass pointer to struct ieee80211com. From
user point of view, the parent interface just hangs on in the ifconfig
list, and user can't do anything useful with it.

Now, the struct ifnet goes away. The struct ieee80211com is the only
KPI between a device driver and net80211. Details:

- The struct ieee80211com is embedded into drivers softc.
- Packets are sent via new ic_transmit method, which is very much like
the previous if_transmit.
- Bringing parent up/down is done via new ic_parent method, which notifies
driver about any changes: number of wlan(4) interfaces, number of them
in promisc or allmulti state.
- Device specific ioctls (if any) are received on new ic_ioctl method.
- Packets/errors accounting are done by the stack. In certain cases, when
driver experiences errors and can not attribute them to any specific
interface, driver updates ic_oerrors or ic_ierrors counters.

Details on interface configuration with new world order:
- A sequence of commands needed to bring up wireless DOESN"T change.
- /etc/rc.conf parameters DON'T change.
- List of devices that can be used to create wlan(4) interfaces is
now provided by net.wlan.devices sysctl.

Most drivers in this change were converted by me, except of wpi(4),
that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing
changes to at least 8 drivers. Thanks to Olivier Cochard, gjb@, mmoll@,
op@ and lev@, who also participated in testing. Details here:

https://wiki.freebsd.org/projects/ifnet/net80211

Still, drivers: ndis, wtap, mwl, ipw, bwn, wi, upgt, uath were not
tested. Changes to mwl, ipw, bwn, wi, upgt are trivial and chances
of problems are low. The wtap wasn't compilable even before this change.
But the ndis driver is complex, and it is likely to be broken with this
commit. Help with testing and debugging it is appreciated.

Differential Revision: D2655, D2740
Sponsored by: Nginx, Inc.
Sponsored by: Netflix


# 5c5e99d2 24-Feb-2014 Kevin Lo <kevlo@FreeBSD.org>

Add a flag to run's device list which uses a standard scsi eject.
The flag indicates that the mcu doesn't need to load firmware.

Tested by: Alex Deiter <alex dot deiter at gmail.com>, myself
Tested on: ASUS USB-N66


# 2719d9c9 23-Jan-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Revert r261014. Let Kevin fix it.

MFC after: 1 week


# 2e74d8c8 22-Jan-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

- Fix some non-portable code with regard to endianness. Don't use memmove().
- Fix a range check for maximum transmit length.
- Fix read from missing field when transmitting data.

MFC after: 2 weeks


# 7a7e01ca 02-Jan-2014 Kevin Lo <kevlo@FreeBSD.org>

Add support for the MediaTek/Ralink RT3593 chipset.
Committed over the ZyXEL NWD2705 on amd64 with WPA.


# fd8fcee5 18-Dec-2013 Kevin Lo <kevlo@FreeBSD.org>

Fix style: add tab after #define.


# 242dbae3 06-Dec-2013 Kevin Lo <kevlo@FreeBSD.org>

Add support for the MediaTek/Ralink RT5572 chipset.
Committed over the TP-LINK TL-WDN3200 (RT5572) on amd64 with WPA.

While here, add my copyright.


# 40588688 02-Dec-2013 Kevin Lo <kevlo@FreeBSD.org>

The RUN_MAX_TXSZ constat is defined as Tx desc + Tx wireless info + MCLBYTES +
max padding. We were lucky in that run(4) working fine since both
rt2860_rxwi and rt2860_txwi structure sizes are the same.


# 64891211 11-Nov-2013 Kevin Lo <kevlo@FreeBSD.org>

Add support for the MediaTek/Ralink RT5370/RT5372 chipset.

Tested with the TP-Link TL-WN727N (RT5370) and the D-Link DWA-140 (RT5372)
on i386/amd64/arm with WPA.


# e8353a7a 28-Jul-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix alignment of USB WLAN radiotap headers. This makes USB WLAN adapters
work on ARM, MIPS and similar platforms, where alignment matters.

MFC after: 1 week
Reported by: XiaoQI Ge <ghw@7axu.com>


# 645e4d17 10-Feb-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

- Streamline detach logic in wlan drivers, so that
freed memory cannot be used during detach.
- Remove all panic() calls from the urtw driver because
panic() is not appropriate here.
- Remove redundant checks for device detached in
device detach callbacks.
- Use DEVMETHOD_END to mark end of device methods.

MFC after: 2 weeks


# f417369b 14-Feb-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

* Fix page fault caused by referring freed node.

While updating Tx stats, already freed node could be referred and cause
page fault. To avoid such panic, spool Tx stats in driver's softc. Then,
on every ratectl interval, grab node though ieee80211_iterate_nodes() and
update ratectl stats.

* Simplify some code in run_iter_func().

* Fix typo

* Use memset instead of bzero (hselasky @)

PR: kern/153938
Submitted by: PseudoCylon <moonlightakkiy@yahoo.ca>
Approved by: thompsa (mentor)


# e7d14e9b 09-Feb-2011 Bernhard Schmidt <bschmidt@FreeBSD.org>

Rework beacon handling re-enable run_updateslot().

Drivers which rely on net80211 to create the beacon need to call
ieee80211_beacon_update() on iv_update_beacon() calls. This is required
that certain bits, e.g. TIM, get updated. A call to ieee80211_beacon_alloc()
is not enough because it does not care about flags which can only change
during runtime. By design a beacon is supposed to be allocated only once
while moving into RUN state.

To handle all possible calls to iv_update_beacon() the run_updateslot()
function has been revived and run_updateprot() has been added.
run_updateslot() handles slot time changes and run_updateprot() changes
to protection, both can change while nodes associate/leave.

Submitted by: Alexander Zagrebin <alex at zagrebin.ru>,
PseudoCylon <moonlightakkiy atyahoo.ca>
MFC after: 3 weeks


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# beaa0537 13-Jun-2010 Andrew Thompson <thompsa@FreeBSD.org>

- Because hostapd calls iv_key_set() before if_init(), make sure key_set
callback function will be executed, and that the key won't be deleted during
the init process.
- txmic and rxmic are written into the chip the same place regardless of
opmode.
- Make the hardware generate 802.11 sequence numbers.

Submitted by: Akinori Furukoshi
Obtained from: git://gitorious.org/run/run.git


# 4e2a75d8 17-May-2010 Andrew Thompson <thompsa@FreeBSD.org>

MFC r208019

Sync run(4) driver from author's site.


# 85e7bb81 12-May-2010 Andrew Thompson <thompsa@FreeBSD.org>

Sync run(4) driver from author's site.

Submitted by: Akinori Furukoshi
Obtained from: git://gitorious.org/run/run.git


# 82878b11 11-May-2010 Rui Paulo <rpaulo@FreeBSD.org>

MFC r206367, r206358, r206370, r206371, r206372, r206398, r206415,
r206416, r206417, r206418, r206418:

net80211 ratectl framework.


# b6108616 07-Apr-2010 Rui Paulo <rpaulo@FreeBSD.org>

net80211 rate control framework (net80211 ratectl).

This framework allows drivers to abstract the rate control algorithm and
just feed the framework with the usable parameters. The rate control
framework will now deal with passing the parameters to the selected
algorithm. Right now we have AMRR (the default) and RSSADAPT but there's
no way to select one with ifconfig, yet.
The objective is to have more rate control algorithms in the net80211
stack so all drivers[0] can use it. Ideally, we'll have the well-known
sample rate control algorithm in the net80211 at some point so all
drivers can use it (not just ath).

[0] all drivers that do rate control in software, that is.

Reviewed by: bschmidt, thompsa, weyongo
MFC after: 1 months


# 1e426764 06-Apr-2010 Andrew Thompson <thompsa@FreeBSD.org>

MFC r205042

- Integrate latest driver code from OpenBSD
- Drain our tasks from the ieee80211 taskqueue
- Add more IDs

Submitted by: Akinori Furukoshi


# 13548b8b 06-Apr-2010 Andrew Thompson <thompsa@FreeBSD.org>

MFC r203137

Release the firmware after loading to the device.


# 0b2d5c29 06-Apr-2010 Andrew Thompson <thompsa@FreeBSD.org>

MFC r203134

Add run(4), a driver for Ralink RT2700U/RT2800U/RT3000U USB 802.11agn devices.

This driver was written for OpenBSD by Damien Bergamini and ported over by
Akinori Furukoshi.


# 3707a5e9 11-Mar-2010 Andrew Thompson <thompsa@FreeBSD.org>

- Integrate latest driver code from OpenBSD
- Drain our tasks from the ieee80211 taskqueue
- Add more IDs

Submitted by: Akinori Furukoshi


# 8b1d9a81 28-Jan-2010 Andrew Thompson <thompsa@FreeBSD.org>

Release the firmware after loading to the device.


# 069f1a80 28-Jan-2010 Andrew Thompson <thompsa@FreeBSD.org>

Add run(4), a driver for Ralink RT2700U/RT2800U/RT3000U USB 802.11agn devices.

This driver was written for OpenBSD by Damien Bergamini and ported over by
Akinori Furukoshi.