History log of /freebsd-current/sys/dev/usb/wlan/if_run.c
Revision Date Author Comments
# 39b70279 03-Nov-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

Revert "Widen EPOCH(9) usage in USB WLAN drivers."

This reverts commit 21c4082de9e2cf9a0fd81a9a981ab06022956847.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 935b194d 07-Feb-2023 Justin Hibbits <jhibbits@FreeBSD.org>

Mechanically convert usb ethernet drivers to DrvAPI

Reviewed by: zlei
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37812


# bc9372d7 06-May-2022 John Baldwin <jhb@FreeBSD.org>

usb: Remove unused devclass arguments to DRIVER_MODULE.


# 8746bc91 23-May-2021 Dmitry Chagin <dchagin@FreeBSD.org>

run(4): add support for DLINK DWA-130 rev F1 wireless adaptor.

PR: 256092
Submitted by: Francois Briere <purplefiasco at gmail.com>
MFC After: 2 weeks


# d6fd321e 22-May-2021 Dmitry Chagin <dchagin@FreeBSD.org>

run(4): add support for ASUS USB-N14 wireless adaptor.

PR: 255759
Submitted by: john.lmurdoch at gmail.com
MFC After: 1 week


# c6167b4b 07-Sep-2020 Bjoern A. Zeeb <bz@FreeBSD.org>

WiFi: fix ieee80211_media_change() callers

In r178354 with the introduction of multi-bss ("vap") support factoring
out started and with r193340 ieee80211_media_change() no longer returned
ENETRESET but only 0 or error.
As ieee80211(9) tells the ieee80211_media_change() function should not
be called directly but is registered with ieee80211_vap_attach() instead.

Some drivers have not been fully converted. After fixing the return
checking some of these functions were simply wrappers between
ieee80211_vap_attach() and ieee80211_media_change(), so remove the extra
function, where possible as well.

PR: 248955
Submitted by: Tong Zhang (ztong0001 gmail.com) (original)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation


# 9dd3156e 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

usb: clean up empty lines in .c and .h files


# 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).


# 6bc40d8d 02-Jun-2020 Adrian Chadd <adrian@FreeBSD.org>

[run] note that PHY_HT is for mixed mode.

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


# bb7234be 02-Jun-2020 Adrian Chadd <adrian@FreeBSD.org>

[run] Set the number of HT chains.

* Set the tx/rx chains based on the existing MIMO eeprom reads
* Add 3-chain rates

Tested:

* MAC/BBP RT5390 (rev 0x0502), RF RT5370 (MIMO 1T1R), 2g/5g STA
* MAC/BBP RT3593 (rev 0x0402), RF RT3053 (MIMO 3T3R), 2g/5g STA


# 8b05d37a 02-Jun-2020 Adrian Chadd <adrian@FreeBSD.org>

[run] Add 11NA flags for 5G NICs that support HT.

Now that I'm a proud owner of an ASUS USB-N66, I can test 2G/5G and
3-stream configurations.

For now, just flip on 5G HT rates. I've tested this in both
5G HT20 and 5G 11a modes. It's still one stream for now until
we verify that the number of streams reported (ie the MIMO below)
is actually the number of 11n streams, NOT the number of antennas.
(They don't have to match! You can have more antennas than MIMO
streams!)

Tested:

* run0: MAC/BBP RT3593 (rev 0x0402), RF RT3053 (MIMO 3T3R)


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

[run] Don't add 11ng channels (2GHz) for RF2020

Don't also add the 11ng channels if we're not in 11n mode or net80211 will
get super weird.


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

[run] Set ampdu rxmax same as linux; RF2020 isn't an 11n NIC

This is from the linux driver:

* set the ampdu rx max to 32k for 1 stream devics like mine, and
64k for larger ones
* Don't enable 11n bits for RF2020


# 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


# f8d2b1f3 15-Feb-2020 Pawel Biernacki <kaktus@FreeBSD.org>

Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked). Use it in
preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Reviewed by: hselasky, kib
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D23632


# 21c4082d 30-Jan-2020 Hans Petter Selasky <hselasky@FreeBSD.org>

Widen EPOCH(9) usage in USB WLAN drivers.

This patch should unbreak the USB WLAN drivers after r357004.

Pointy hat: glebius@
Sponsored by: Mellanox Technologies


# e2e050c8 19-May-2019 Conrad Meyer <cem@FreeBSD.org>

Extract eventfilter declarations to sys/_eventfilter.h

This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"
in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header
pollution substantially.

EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c
files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).

As a side effect of reduced header pollution, many .c files and headers no
longer contain needed definitions. The remainder of the patch addresses
adding appropriate includes to fix those files.

LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by
sys/mutex.h since r326106 (but silently protected by header pollution prior
to this change).

No functional change (intended). Of course, any out of tree modules that
relied on header pollution for sys/eventhandler.h, sys/lock.h, or
sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped.


# 1ea35ead 31-Mar-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

run(4): properly set F_DATAPAD radiotap flag if frame has padding between
frame header and data.

This will fix 'Mysterious OLPC stuff' for received frames and wrong
CCMP / TKIP / data decoding for transmitted frames in net/wireshark
dissector.

While here, drop unneeded comment - net80211 handles padding requirements
for Tx & Rx without driver adjustment.

Tested with D-Link DWA-140 rev B3, STA mode.

MFC after: 1 week


# e4c17012 31-Mar-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

run(4): do not clear PROTECTED bit if frame was not decrypted by NIC.

Tested with D-Link DWA-140 rev B3, STA / MONITOR modes.

MFC after: 1 week


# ae6f61b1 25-Mar-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

run(4): merge some common TSF-related code into run_disable_tsf()

No functional change intended.

MFC after: 5 days


# 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


# f3f08e16 10-Feb-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

net80211(4): hide casts for 'i_seq' field offset calculation inside
ieee80211_getqos() and reuse it in various places.

Checked with RTL8188EE, HOSTAP mode + RTL8188CUS, STA mode.

MFC after: 2 weeks


# 6ecec381 02-Feb-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

run(4): fix allocated memory type for ieee80211_node(4).

PR: 177366
MFC after: 3 days


# 94360757 02-Feb-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

run(4): revert previous commit; there were no compiler warning
(at least, from clang(1)).


# bce0fd80 02-Feb-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

run(4): fix allocated memory type and -Wincompatible-pointer-types
compiler warning.

PR: 177366
MFC after: 3 days


# 635588c2 28-Jan-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

Drop some unneeded includes from wireless USB drivers.

MFC after: 1 week


# b84b3638 26-Jan-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

Remove 2GHz channel list copies from wireless drivers.

Wrap ieee80211_add_channel_list_2ghz into another function
which supplies default (1-14) channel list to it and drop
its copies from drivers.

Checked with RTL8188EE, country US / JP / KR / UA.

MFC after: 2 weeks


# fb10d4ee 20-Jan-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

run(4): add more length checks in Rx path.

- Discard frames that are bigger than MCLBYTES (to prevent buffer overrun).
- Check buffer length before accessing its contents.
- Fix len <-> dmalen check - the last includes Rx Wireless information
structure size.
- Fix out-of-bounds read during Rx node search for ACK / CTS frames
(monitor mode only).

While here:
- Mark few suspicious places with comments.
- Move common cleanup to the function end.

MFC after: 1 week


# 76cffa7a 21-Jul-2018 Gavin Atkinson <gavin@FreeBSD.org>

run(4): Support the D-Link DWA-125 rev A3

Submitted by: Ali Mashtizadeh
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D16029


# 2c6d9edb 10-Jul-2018 Ben Widawsky <bwidawsk@FreeBSD.org>

run(4): Add a new USB device ID.

Summary:
Add the device id of the Panda Wireless PAU06 which seems to be
the already-supported combination of RT5392 MAC and RF RT5372
radio.

Reviewed By: allanjude, eadler, jhb
Approved By: jhb
Differential Revision: https://reviews.freebsd.org/D16211


# 63a55eab 10-Mar-2018 Andriy Voskoboinyk <avos@FreeBSD.org>

usb/wlan/*: properly include "opt_wlan.h" into all drivers

Without it driver cannot be loaded when wlan(4) module is built with
'options IEEE80211_DEBUG_REFCNT'.


# 2e0d0572 10-Mar-2018 Andriy Voskoboinyk <avos@FreeBSD.org>

run(4): drop few unused variables.

Found by: Clang static analyzer


# d1b67106 09-Mar-2018 Andriy Voskoboinyk <avos@FreeBSD.org>

net80211: wrap protection frame allocation into ieee80211_alloc_prot()

Move copy-pasted code for RTS/CTS frame allocation into net80211.
While here, add stat / debug message for allocation failures
(copied from run(4)) + return error here in bwn(4).

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D14628


# 9fbe631a 01-Jan-2018 Adrian Chadd <adrian@FreeBSD.org>

[net80211] convert all of the WME use over to a temporary copy of WME info.

This removes the direct WME info access in the ieee80211com struct and instead
provides a method of fetching the data. Right now it's a no-op but eventually
it'll turn into a per-VAP method for drivers that support it (eg iwn, iwm,
upcoming ath10k work) as things like p2p support require this kind of behaviour.

Tested:

* ath(4), STA and AP mode

TODO:

* yes, this is slightly stack size-y, but it is an important first step
to get drivers migrated over to a sensible WME API. A lot of per-phy things
need to be converted to per-VAP before P2P, 11ac firmware, etc stuff shows up.


# f6313575 26-Feb-2017 Andriy Voskoboinyk <avos@FreeBSD.org>

net80211 drivers: fix rate setup for EAPOL frames, obtain Tx parameters
directly from the node.

- Use ni_txparms directly instead of calculating them manually every time
- Move M_EAPOL flag check upper; otherwise it may be skipped due to
'ucastrate' / 'mcastrate' check
- Use 'mgtrate' for control frames too (see ifconfig(8), mgtrate parameter)
- Add few more M_EAPOL checks where it was missing (zyd(4), ural(4),
urtw(4))
- Few unrelated cleanups

Tested with:
- Intel 6205 (iwn(4)), STA mode;
- WUSB54GC (rum(4)), HOSTAP mode + RTL8188EU (rtwn(4)), STA mode.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D9811


# 3656b961 30-Dec-2016 Gavin Atkinson <gavin@FreeBSD.org>

Fix bit value for a debug flag definition.

Pointy hat to: gavin


# 109005cc 07-Dec-2016 Gavin Atkinson <gavin@FreeBSD.org>

Switch if_run.c to use a bitmap for debug levels rather than arbitrary
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


# 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


# cdf039af 04-Jun-2016 Adrian Chadd <adrian@FreeBSD.org>

[run] fix TSF locking in RX radiotap.

Submitted by: Imre Vadasz <imre@vdsz.com>


# 99bb30a9 26-May-2016 Andriy Voskoboinyk <avos@FreeBSD.org>

run: switch to ieee80211_add_channel_list_*()

- Use device's channel list instead of default one (from
ieee80211_init_channels()).
- Add ic_getradiocaps() method.

Differential Revision: https://reviews.freebsd.org/D6144


# 25cd0475 06-May-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

dev/usb: unsigned some loop indexes.

Although usually small, values produced by nitems() are unsigned.
By unsigning the corresponding indexes we avoid signed vs unsigned
comparisons. This may have some effect on performance, although given the
small sizes the effect will not be perceivable, and it makes the code
clearer.

Respect the style of the changed files: one uses u_int while the other
uses "unsigned int".

Reviewed by: hselasky


# 20733245 02-May-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

dev/usb: minor spelling fixes in comments.

No functional change.

Reviewed by: hselasky


# a061fea6 29-Apr-2016 Andriy Voskoboinyk <avos@FreeBSD.org>

net80211 + drivers: hide size of 'bands' array behind a macro.

Auto-replace 'howmany(IEEE80211_MODE_MAX, 8)' with 'IEEE80211_MODE_BYTES'.
No functional changes.


# 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


# 0046e186 07-Jan-2016 Andriy Voskoboinyk <avos@FreeBSD.org>

net80211 drivers: fix ieee80211_init_channels() usage

Fix out-of-bounds read (all) / write (11n capable) for drivers
that are using ieee80211_init_channels() to initialize channel list.

Tested with:
* RTL8188EU, STA mode.
* RTL8188CUS, STA mode.
* WUSB54GC, HOSTAP mode.

Approved by: adrian (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D4818


# bdfff33f 13-Dec-2015 Andriy Voskoboinyk <avos@FreeBSD.org>

net80211: remove hardcoded slot time durations from drivers

- Add IEEE80211_GET_SLOTTIME(ic) macro.
- Use predefined macroses to set slot time.

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


# f809f280 10-Dec-2015 Warner Losh <imp@FreeBSD.org>

Create a USB_PNP_INFO and use it to export the existing PNP
tables. Some drivers needed some slight re-arrangement of declarations
to accommodate this. Change the USB pnp tables slightly to allow
better compatibility with the system by moving linux driver info from
start of each entry to the end. All other PNP tables in the system
have the per-device flags and such at the end of the elements rather
that at the beginning.

Differential Review: https://reviews.freebsd.org/D3458


# a14954c5 05-Nov-2015 Andriy Voskoboinyk <avos@FreeBSD.org>

net80211: WME callback cleanup in various drivers

Since r288350, ic_wme_task() is called via ieee80211_runtask(),
so, any additional deferring from the driver side is not needed.

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


# db70df04 23-Oct-2015 Andriy Voskoboinyk <avos@FreeBSD.org>

run(4): convert to ieee80211_tx_complete()

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


# cc522320 21-Oct-2015 Andriy Voskoboinyk <avos@FreeBSD.org>

Initialize radiotap header fields before calling ieee80211_radiotap_rx()

Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D3951


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

net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ieee80211_raw_output().

This doesn't free the mbuf upon error; the driver ic_raw_xmit method is still
doing that.

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


# 0840f948 07-Oct-2015 Gavin Atkinson <gavin@FreeBSD.org>

Recognise the Netgear WNDA4100 (N900) 3x3 device in run(4).


# 24c838f0 04-Oct-2015 Kevin Lo <kevlo@FreeBSD.org>

Fix max TX power settings for RT5390/RT5392.
While here remove wrong definition of RT2860_USB_PHY_MAN_RST.


# 2e83cb98 03-Oct-2015 Adrian Chadd <adrian@FreeBSD.org>

Fix run(4) mbuf queue flushing / freeing.

Ensure things are freed during interface stop, or start may end up never
being able to transmit a full queue.


# 5f28dd73 03-Oct-2015 Adrian Chadd <adrian@FreeBSD.org>

Fix to compile using gcc-4.2 (eg mips, sparc64.)


# 13072f8d 03-Oct-2015 Adrian Chadd <adrian@FreeBSD.org>

run(4): fix WME support (untested).

Now run(4) fetches parameters from ic->ic_wme.wme_params array, which is never initialized
(and can be safely removed). This patch replaces &ic->ic_wme.wme_params with
&ic->ic_wme.wme_chanParams.cap_wmeParams (contains parameters for local station;
used by other drivers with WME support).

Tested:

* me: STA: run0: MAC/BBP RT5390 (rev 0x0502), RF RT5370 (MIMO 1T1R), address 38:83:45:11:78:ae


# 210ab3c2 03-Oct-2015 Adrian Chadd <adrian@FreeBSD.org>

net80211: drop ieee80211_beacon_offsets parameter from ieee80211_beacon_alloc() and ieee80211_beacon_update()

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


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

net80211: drop redundant 3rd parameter from iv_key_set().

The MAC can be fetched from the key struct.

I added the ndis updates to make it compile.

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


# 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


# 4bae8310 16-Sep-2015 Kevin Lo <kevlo@FreeBSD.org>

Fix a debug message which didn't quite get it right about eeprom version.


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

Enable TSF timer in monitor mode.

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


# 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


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

Fix comparison in run_key_set_cb().

Tested on RT5370, sta mode.

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


# 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.


# d3fdd08c 19-Aug-2015 Adrian Chadd <adrian@FreeBSD.org>

Further conversions from ifp->if_softc -> ic_softc.


# 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


# 272f6ade 25-May-2015 Gleb Smirnoff <glebius@FreeBSD.org>

Change three methods in struct ieee80211com, namely ic_updateslot,
ic_update_mcast and ic_update_promisc, to pass pointer to the ieee80211com,
not to the ifnet.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.


# 59686fe9 25-May-2015 Gleb Smirnoff <glebius@FreeBSD.org>

Set ic_softc in all 802.11 drivers. Not required right now, but will be
used quite soon.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.


# c8550c02 25-May-2015 Gleb Smirnoff <glebius@FreeBSD.org>

Make net80211 drivers supply their device name to the net80211 layer, so
that the latter doesn't need to go through struct ifnet to get their name.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.


# 8aa853d5 19-Apr-2015 Kevin Lo <kevlo@FreeBSD.org>

Add new USB ID.

PR: 199522


# ece4b0bd 05-Jan-2015 Hans Petter Selasky <hselasky@FreeBSD.org>

Make a bunch of USB debug SYSCTLs tunable, so that their value(s) can
be set before the USB device(s) are probed.


# b1c5d8f7 21-Oct-2014 Kevin Lo <kevlo@FreeBSD.org>

Fix the kernel panic in hostap mode.
rvp->beacon_mbuf was NULL in run_update_beacon().

PR: 189405
Submitted by: Gabor Simon <gabor.simon75 at gmail.com>
MFC after: 3 days


# a001989d 19-Sep-2014 Gleb Smirnoff <glebius@FreeBSD.org>

Mechanically convert to if_inc_counter().


# 15cb19cd 25-Aug-2014 Kevin Lo <kevlo@FreeBSD.org>

Fix typo: s/mac_rev/mac_ver/

Submitted by: Stefan Sperling <stsp at openbsd dot org>


# 51a25d34 19-Aug-2014 Kevin Lo <kevlo@FreeBSD.org>

If eapol packets are sent at the lowest rate, key negotiation will
become more reliable.

Submitted by: Akinori Furukoshi <moonlightakkiy at yahoo dot ca>


# a080f715 04-Jun-2014 Kevin Lo <kevlo@FreeBSD.org>

Remove D-Link DWA140 rev D1 by accident.

Pointed out by Anders Larsson in private email.


# 4ebc1ddf 01-Apr-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Add new USB ID.

Submitted by: Tuomo Latto <djv+fbpr@iki.fi>
PR: usb/188046
MFC after: 1 week


# 44bf877e 05-Mar-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

- Temporary fix for race in RUN driver which can
cause freed memory to be accessed.
- Properly lock callout_reset()'s.

MFC after: 1 week


# 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


# 198fc7c3 31-Jan-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix a range check for maximum transmit length. The existing code was
off by 4 bytes in one case.

Approved by: kevlo @
MFC after: 2 weeks


# 51fcfa26 24-Jan-2014 Kevin Lo <kevlo@FreeBSD.org>

Fix comment.


# 56ae0785 24-Jan-2014 Kevin Lo <kevlo@FreeBSD.org>

Get rid of memmove(). It's not portable.

Tested on RT3071, RT3573, RT3570, RT3572, and RT5572.

Reviewed by: hselasky


# 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


# 030dda5d 11-Jan-2014 Kevin Lo <kevlo@FreeBSD.org>

Fix a logic error when checking if Tx power entries are greater than 31.


# 5945b5f5 08-Jan-2014 Kevin Lo <kevlo@FreeBSD.org>

Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.

The origin of WEP comes from IEEE Std 802.11-1997 where it defines
whether the frame body of MAC frame has been encrypted using WEP
algorithm or not.
IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicates
whether the frame is protected by a cryptographic encapsulation
algorithm.

Reviewed by: adrian, rpaulo


# 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.


# 959af347 27-Dec-2013 Kevin Lo <kevlo@FreeBSD.org>

Add D-Link DWA-140 rev D1, another RT5372/run(4).
From Anton Mazunin.


# 7dc4b90e 24-Dec-2013 Kevin Lo <kevlo@FreeBSD.org>

Some devices have a dual mode such as Tenda W326U and ZyXEL NWD2705,
add the product id and use a standard scsi eject.

Tested on the ZyXEL NWD2705 wlan dongle.


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

Use 'val' instead of 'val & 0xff' since the last argument of run_bbp_write()
is uint8_t.

Spotted by: yongari


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

Fix style: add tab after #define.


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

Fix typo in comment.


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

Add support to IQ calibration.


# daab849b 06-Dec-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix compilation when the "USB_DEBUG" option is set.


# 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.


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

Replace the magic numbers with something more readable.


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

Cosmetic changes.


# 1d66c7a9 06-Dec-2013 Kevin Lo <kevlo@FreeBSD.org>

Remove daft KASSERT.


# 0aff597a 03-Dec-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix what looks like a typo after r258732.


# 8cfe5440 03-Dec-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix external compiler warning(s). Avoid pointer dereferencing.


# 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.


# 5b751464 29-Nov-2013 Kevin Lo <kevlo@FreeBSD.org>

Change run_rt2870_rf_write() prototype (no functional change)


# 5f7e329c 28-Nov-2013 Kevin Lo <kevlo@FreeBSD.org>

On the RT2870, rf registers are now 64-bit, not 32-bit after r257955.
Committed over a Buffalo WLI-UC-AG300N (RT2870).


# 361f264b 26-Nov-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Style changes.


# beb13f04 26-Nov-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Add missing static keyword.

MFC after: 2 weeks


# 28dfd841 12-Nov-2013 Kevin Lo <kevlo@FreeBSD.org>

- Use bit twiddling macro to set IEEE80211_MODE_11A
- On the RT3572 chipset, there's no need to configure BBP register 86


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

Remove r257748 by accident.


# 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.


# 415fd8a3 06-Nov-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Implement a working write region function to speed up loading of the
firmware. You can test this change by switching the "#if 1" statement
right above in the patched code to "#if 0" !

MFC after: 1 week


# bb2f69e8 05-Nov-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Check for "ieee80211_vap_setup()" failure in all USB WLAN drivers.

MFC after: 1 week


# ae7d66f2 05-Nov-2013 Kevin Lo <kevlo@FreeBSD.org>

Reading the RT2860_ASIC_VER_ID register is not needed and returns
completely bogus value.


# 2764a278 05-Nov-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Protect the "ratectl_ch" callout in the "run" driver by the "run"
softc's "sc->sc_mtx" mutex. Currently the callout was marked
multi-processor safe, which is fine, but it is better to
start/stop/reset callouts while holding the "run" drivers own
mutex. While at it add a missing "ULL" at end of the 64-bit unsigned
integer constant.

MFC after: 1 week


# 645826be 31-Oct-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix a potential memory leak.

MFC after: 1 week


# 35a24898 31-Oct-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix some types. Compilation for external target complains that "u_int"
is not idential to "uint32_t" when defining set channel prototype
functions. The WLAN channel range should be from 0 to 65535
inclusivly, and u_int should be fine for this purpose.


# c513ecfd 30-Oct-2013 Kevin Lo <kevlo@FreeBSD.org>

Enable DC filter in RT3071 Version E.


# 76039bc8 26-Oct-2013 Gleb Smirnoff <glebius@FreeBSD.org>

The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare
to this event, adding if_var.h to files that do need it. Also, include
all includes that now are included due to implicit pollution via if_var.h

Sponsored by: Netflix
Sponsored by: Nginx, Inc.


# d4d0412b 23-Oct-2013 Kevin Lo <kevlo@FreeBSD.org>

Fix the RT2860_TX_SW_CFG2 init value on older revisions of RT3070 chip.


# d48971d0 18-Oct-2013 Kevin Lo <kevlo@FreeBSD.org>

Correct tx mixer gain value for RT3070 and RT3071.

Correctly value in EEPROM/EFUSE is one or more for RT3070 and
two or more for other RT3071 chips.


# 6bf8d884 18-Oct-2013 Kevin Lo <kevlo@FreeBSD.org>

Since the DAC issue has been fixed in RT3070(F), the voltage raising fix
is no longer needed.


# 5d534170 18-Oct-2013 Kevin Lo <kevlo@FreeBSD.org>

Fix lower bits of RF_R3 for RT3370 and newer. This change doesn't affect
older chipsets.


# 57733723 15-Oct-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Add new USB ID.

PR: usb/182936
Submitted by: Keith White <kwhite@site.uottawa.ca>
MFC after: 1 week


# c7e4729d 05-Sep-2013 Ruslan Bukin <br@FreeBSD.org>

Add support for DLINK DWA-127 Wireless Adapter

Approved by: cognet (mentor)


# bd247e9d 18-Mar-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Add new USB ID.

PR: usb/177013
MFC after: 1 week


# 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


# d021dd19 04-Jan-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix for "run0: wcid=xx out of range" error message.

MFC after: 1 week
PR: usb/174963
Submitted by: PseudoCylon <moonlightakkiy@yahoo.ca>


# c6499ecc 04-Dec-2012 Gleb Smirnoff <glebius@FreeBSD.org>

Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.


# 419ce5a6 17-Aug-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Add new USB device ID.

PR: usb/170688
MFC after: 1 week


# be503393 09-Jul-2012 Hiroki Sato <hrs@FreeBSD.org>

- Add support of the following USB devices to run(4):

* Logitec LAN-W150N/U2
* Buffalo WLI-UC-GNM2

- Add device id of Planex GW-USValue-EZ.


# bb571462 02-Jun-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Add appropriate checks for ic_bsschan being set to IEEE80211_CHAN_ANYC in
some of the USB WLAN drivers. This fixes a panic when using monitor mode.

MFC after: 1 week
Submitted by: PseudoCylon


# 6d917491 02-Apr-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix compiler warnings, mostly signed issues,
when USB modules are compiled with WARNS=9.

MFC after: 1 weeks


# f9d03266 21-Mar-2012 Bernhard Schmidt <bschmidt@FreeBSD.org>

Load the firmware during init not attach, as a root filesystem might
not yet be available. While here, also print the firmware version.

Submitted by: PseudoCylon
MFC after: 3 days


# 6f0e06a1 19-Jan-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Add support for new USB device.

PR: usb/164275
MFC after: 3 days


# fcd9500f 17-Dec-2011 Bernhard Schmidt <bschmidt@FreeBSD.org>

Fix some net80211 enum nits:
- ic_vap_create() uses an ieee80211_opmode argument
- ieee80211_rate2media() takes an ieee80211_phymode argument
- ieee80211_plcp2rate() takes an ieee80211_phytype argument
- cast to enum ieee80211_protmode and ieee80211_roamingmode to silence
compiler warnings

Submitted by: arundel@


# 58a1ff3b 14-Dec-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Improve fix for random USB transfer time out.

Suggested by: YougHyeon
MFC after: 3 days


# 663e39b0 14-Dec-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix for random USB transfer time out.

Submitted by: PseudoCylon
MFC after: 3 days


# 2634f5d7 21-Nov-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Add new USB IDs to RUN driver.

PR: usb/162712
MFC after: 1 week


# 6472ac3d 07-Nov-2011 Ed Schouten <ed@FreeBSD.org>

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.


# c8eeb971 19-Oct-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Add new USB IDs to RUN driver. Update usb.conf.

PR: usb/161798
MFC after: 3 days


# f1a16106 23-Jun-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

- Move all USB device ID arrays into so-called sections,
sorted according to the mode which they support:
host, device or dual mode
- Add generic tool to extract these data:
tools/bus_autoconf

Discussed with: imp
Suggested by: Robert Millan <rmh@debian.org>
PR: misc/157903
MFC after: 14 days


# 329f91ff 31-Mar-2011 Kevin Lo <kevlo@FreeBSD.org>

- Minor style(9) cleanup
- Make functions static


# f1168f99 04-Mar-2011 Daichi GOTO <daichi@FreeBSD.org>

Add the Buffalo (Melco Inc.) WLI-UC-G301N

PR: usb/155229
Submitted by: Yoshiaki UCHIKAWA
MFC after: 1 week


# 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


# bd56e71b 17-Jan-2011 Bernhard Schmidt <bschmidt@FreeBSD.org>

Pull ieee80211_ratectl_node_init() calls from drivers into net80211.
This fixes hostap mode for at least ral(4) and run(4), because there is
no sufficient call into drivers which could be used initialize the node
related ratectl variables.

MFC after: 3 days


# a7c6aabd 06-Nov-2010 Bernhard Schmidt <bschmidt@FreeBSD.org>

Instead of using the AMRR ratectl algo as default for drivers which have
the IEEE80211_C_RATECTL flag set, default to NONE for all drivers. Only if
a driver calls ieee80211_ratectl_init() check if the NONE algo is still
selected and try to use AMRR in that case. Drivers are still free to use
any other algo by calling ieee80211_ratectl_set() prior to the
ieee80211_ratectl_init() call.

After this change it is now safe to assume that a ratectl algo is always
available and selected, which renders the IEEE80211_C_RATECTL flag pretty
much useless. Therefore revert r211314 and 211546.

Reviewed by: rpaulo
MFC after: 2 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.


# 8d8bdb01 01-Sep-2010 Andrew Thompson <thompsa@FreeBSD.org>

We need to grab a node reference count to vap->iv_bss before using it as it is
possible for the node to be replaced and freed at any time by
ieee80211_sta_join1().


# 910cb8fe 01-Sep-2010 Andrew Thompson <thompsa@FreeBSD.org>

Add missing MODULE_VERSION() definitions, this resolves problems around
duplicate module loads.

PR: usb/125736
Submitted by: danger, mm
Reviewed by: hselasky


# ad8e331b 14-Aug-2010 Bernhard Schmidt <bschmidt@FreeBSD.org>

Introduce IEEE80211_C_RATECTL, drivers which use the ratectl framework
should set this capability.

MFC after: 2 weeks


# 6bce5ae1 11-Jul-2010 Andrew Thompson <thompsa@FreeBSD.org>

Use more compact deviceid table.

Submitted by: Akinori Furukoshi


# 75c76159 11-Jul-2010 Andrew Thompson <thompsa@FreeBSD.org>

Update for style(9).

Submitted by: Akinori Furukoshi (author)


# 0f817de7 14-Jun-2010 Jung-uk Kim <jkim@FreeBSD.org>

Fix typos that broke duration calculations on protection frames. A similar
fix was done for ral(4) long ago and it must be copy-and-paste bugs.

Found by: clang


# 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.


# e50d35e6 03-May-2010 Maxim Sobolev <sobomax@FreeBSD.org>

Add new tunable 'net.link.ifqmaxlen' to set default send interface
queue length. The default value for this parameter is 50, which is
quite low for many of today's uses and the only way to modify this
parameter right now is to edit if_var.h file. Also add read-only
sysctl with the same name, so that it's possible to retrieve the
current value.

MFC after: 1 month


# ad658060 29-Apr-2010 Andrew Thompson <thompsa@FreeBSD.org>

MFC r207077

Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had
the illusion of a tunable setting but was always turned on regardless.


# b850ecc1 22-Apr-2010 Andrew Thompson <thompsa@FreeBSD.org>

Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had
the illusion of a tunable setting but was always turned on regardless.

MFC after: 1 week


# ddc70732 09-Apr-2010 Rui Paulo <rpaulo@FreeBSD.org>

Remove previously added if 0's.

MFC after: 1 month


# 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


# 7e2c44f0 06-Apr-2010 Andrew Thompson <thompsa@FreeBSD.org>

MFC r203138

Use device_printf rather than printf + device_get_nameunit.


# 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


# 97ccc890 28-Jan-2010 Andrew Thompson <thompsa@FreeBSD.org>

Use device_printf rather than printf + device_get_nameunit.


# 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.