Commit Graph

467 Commits

Author SHA1 Message Date
Andriy Voskoboinyk
bdc7291ec9 net80211: convert all ieee80211_input_mimo*() consumers
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
2016-10-12 20:50:13 +00:00
Adrian Chadd
e97796e2b6 [net80211] extend the ieee80211_rx_stats struct to include more information.
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.)
2016-10-08 01:12:29 +00:00
Andriy Voskoboinyk
f6930bec33 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
2016-10-02 20:35:55 +00:00
Andriy Voskoboinyk
fbc9d202d8 rsu: do not restart calibration task when going out of RUN state.
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
2016-09-25 19:13:07 +00:00
Andriy Voskoboinyk
887a63246c 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
2016-09-20 18:53:42 +00:00
Andriy Voskoboinyk
d204cea9f8 rum: fix possible panic on device detach (similar to r302034).
Tested with WUSB54GC, STA/AP modes.
2016-09-07 16:19:20 +00:00
Andriy Voskoboinyk
4c90f11b3c rum: use mgmt frame rate for EAPOL frames. 2016-09-07 12:07:02 +00:00
Andriy Voskoboinyk
93ae47478c rum: use m_get2() in Rx path. 2016-09-06 12:00:16 +00:00
Andriy Voskoboinyk
c84bb70268 rum: fix frame length checks in Rx path.
Split usbd_xfer_status() check:
- Check xfer length: must be longer, than Rx descriptor size.
- Check frame size: must be shorter than xfer length.
- Discard too short frames.

Tested with WUSB54GC, STA/MONITOR modes.
2016-09-06 06:40:59 +00:00
Andriy Voskoboinyk
c57ee45ba9 rum: do not restart device when protmode / rtsthreshold is changed. 2016-09-05 19:42:35 +00:00
Adrian Chadd
cdf039af74 [run] fix TSF locking in RX radiotap.
Submitted by:	Imre Vadasz <imre@vdsz.com>
2016-06-04 07:18:39 +00:00
Andriy Voskoboinyk
6fc44742fd urtw: fix unused variable assignments.
Append CWmax and retry limitation to tp->maxretry instead of rewriting it
(will restore pre-r198194 behavior).

Noticed by:	pfg, hps

Reported by:	Coverity
CID:		1304937, 1304920
2016-06-02 12:01:58 +00:00
Andriy Voskoboinyk
a7c31fe1e9 urtwn, rtwn, rsu: switch to ieee80211_add_channel_list_2ghz().
- Use device's channel list instead of default one (from
ieee80211_init_channels()); adds 12 - 14 2GHz channels.
- Add ic_getradiocaps() method.
2016-05-26 16:39:11 +00:00
Andriy Voskoboinyk
2a06b6b33f urtw: switch to ieee80211_add_channel_list_2ghz().
- Use device's channel list instead of default one (from
ieee80211_init_channels()).
- Add ic_getradiocaps() method.
2016-05-26 16:15:10 +00:00
Andriy Voskoboinyk
5a62dab132 zyd: switch to ieee80211_add_channel_list_*()
- Use device's channel list instead of default one (adds 12, 13 and 14
2GHz channels).
- Add ic_getradiocaps() method.

Differential Revision:	https://reviews.freebsd.org/D6171
2016-05-26 15:56:27 +00:00
Andriy Voskoboinyk
83829b483d ural: switch to ieee80211_add_channel_list_*()
- Use device's channel list instead of default one (+ 12, 13 and 14
2GHz channels).
- Add ic_getradiocaps() method.

Differential Revision:	https://reviews.freebsd.org/D6170
2016-05-26 15:12:54 +00:00
Andriy Voskoboinyk
99bb30a9e0 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
2016-05-26 15:05:37 +00:00
Pedro F. Giffuni
25cd047538 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
2016-05-06 15:09:21 +00:00
Pedro F. Giffuni
207332450e dev/usb: minor spelling fixes in comments.
No functional change.

Reviewed by:	hselasky
2016-05-02 17:44:03 +00:00
Andriy Voskoboinyk
7b45c9dfe1 rum: switch to ieee80211_add_channel_list_*()
- Use device's channel list instead of default one
(from ieee80211_init_channels()).
- Add ic_getradiocaps() method.

Added channels:
2GHz band: 12, 13 and 14.
5Ghz band: 34, 38, 42, 46 and 165.

Tested with WUSB54GC, STA / MONITOR modes.

Differential Revision:	https://reviews.freebsd.org/D6125
2016-05-01 18:53:12 +00:00
Andriy Voskoboinyk
a061fea6ee net80211 + drivers: hide size of 'bands' array behind a macro.
Auto-replace 'howmany(IEEE80211_MODE_MAX, 8)' with 'IEEE80211_MODE_BYTES'.
No functional changes.
2016-04-29 22:14:11 +00:00
Pedro F. Giffuni
057b4402bf sys/dev: extend use of the howmany() macro when available.
We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.
2016-04-26 15:03:15 +00:00
Adrian Chadd
b60322c9b4 [rsu] We don't do A-MPDU transmit right now, so don't bother registering
for it.
2016-04-06 00:41:06 +00:00
Andriy Voskoboinyk
349156a945 rum: add legacy power saving support (STA mode).
Tested with WUSB54GC, STA mode + WRT54GC / RTL8188EU in HOSTAP mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5546
2016-03-21 22:29:24 +00:00
Andriy Voskoboinyk
96e29c261d rum: simplify error handling in rum_newstate().
Tested with WUSB54GC, STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5544
2016-03-21 22:14:48 +00:00
Andriy Voskoboinyk
3770442708 rum: do not try to restore bssid/TSF synchronization when device
is not associated.

Tested with WUSB54GC, STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5543
2016-03-21 21:33:30 +00:00
Andriy Voskoboinyk
fd7dae9c98 rum: separate some microcontroller vendor-specific requests into
rum_do_mcu_request()

This change should be no-op.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5542
2016-03-21 21:02:57 +00:00
Adrian Chadd
0c91dc1d08 [urtwn] migrate urtwn out into sys/dev/urtwn/ .
There's some upcoming work to add new chipset support here and I'd
like to only add 802.11n support to one driver, instead of both
urtwn and rtwn.

There's also missing support for things like 802.11n, some powersave
work, bluetooth integration/coexistence, etc, and also newer parts
(like 8192EU, maybe some 11ac parts, not sure yet.)

So, this is hopefully the first step in a longer set of steps to unify
rtwn/urtwn and extend it with more interesting chipset and functionality
support.

Reviewed by:	kevlo
2016-03-20 03:54:57 +00:00
Andriy Voskoboinyk
ae132f1122 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
2016-03-03 20:06:16 +00:00
Andriy Voskoboinyk
067a92f8f4 urtwn: do not filter beacon frames in HOSTAP mode while scanning
urtwn_set_rx_bssid_all() will allow to receive beacons only
when they are not denied by filter.

Revealed by D5474.

Tested with RTL8188CUS, HOSTAP mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5477
2016-02-29 00:05:37 +00:00
Kevin Lo
c9b6e63dd3 Add device ID for 'AboCom 802.11n' usb.
PR:	207412
Submitted by:	Philippe Michaud-Boudreault <pitwuu at gmail dot com>
2016-02-23 01:56:58 +00:00
Andriy Voskoboinyk
6e2ab41693 urtwn: shutdown the device properly
- R92C path: NetBSD (mostly)
- R88E path: TP-Link driver

Tested with RTL8188EU and RTL8188CUS.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5198
2016-02-22 01:15:02 +00:00
Andriy Voskoboinyk
7873b2abd6 urtwn: add an option to compile the driver without firmware specific code
- Add URTWN_WITHOUT_UCODE option (will disable any firmware specific code
when set).
- Do not exclude the driver from build when MK_SOURCELESS_UCODE is set
(URTWN_WITHOUT_UCODE will be enforced unconditionally).
- Do not abort initialization when firmware cannot be loaded;
behave like the URTWN_WITHOUT_UCODE option was set.
- Drop some unused variables from urtwn_softc structure.

Tested with RTL8188EU and RTL8188CUS in HOSTAP and STA modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4849
2016-02-22 00:48:53 +00:00
Hans Petter Selasky
d5fb67a401 Restore maximum number of host keys to 64.
Discussed with:	adrian @ and avos @
2016-02-14 16:18:39 +00:00
Hans Petter Selasky
fe3e452399 Reduce the number of supported WLAN keys in the rum driver, else we
risk bit shifting overflows. Found by D5245 / PVS.

MFC after:	1 week
2016-02-14 07:16:36 +00:00
Gleb Smirnoff
8ec07310fa These files were getting sys/malloc.h and vm/uma.h with header pollution
via sys/mbuf.h
2016-02-01 17:41:21 +00:00
Andriy Voskoboinyk
218592ceed urtwn: add temperature calibration
Redo LC calibration if temperature changed significantly since last
calibration.

Tested with RTL8188EU/RTL8188CUS in STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Obtained from:	NetBSD (mostly)
Differential Revision:	https://reviews.freebsd.org/D4966
2016-01-20 23:55:39 +00:00
Andriy Voskoboinyk
01ff64089c urtwn: rework debug handling
- Use bitmap for debug output selection.
- Add few new messages (one for URTWN_DEBUG_BEACON
and another one for URTWN_DEBUG_INTR).
- Replace an undocumented URTWN_DEBUG definition with USB_DEBUG.

Tested with RTL8188EU / RTL8188CUS in IBSS / HOSTAP modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4959
2016-01-20 23:27:02 +00:00
Andriy Voskoboinyk
783c605101 urtwn: use ic_updateslot method to handle slot time change
(by default it was set to 9us).

Tested with RTL8188EU / RTL8188CUS in STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4535
2016-01-20 23:01:33 +00:00
Andriy Voskoboinyk
8a1d6d278d urtwn: add ROM structure for RTL8188EU
- Add the structure with already known fields offsets
  (some of them were taken from this driver,
  some (channel_plan, rf_* fields) - from TP-LINK official driver)
- Fix a typo / dehardcode a constant in RTL8192C ROM structure.

Tested with RTL8188EU, STA mode

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4274
2016-01-17 00:52:21 +00:00
Andriy Voskoboinyk
0046e1868f 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
2016-01-07 18:41:03 +00:00
Andriy Voskoboinyk
60e9dd4e56 urtwn: add bits for R92C_HWSEQ_CTRL and R92C_TXPAUSE registers
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4770
2016-01-04 21:16:49 +00:00
Andriy Voskoboinyk
64febdf2e2 urtwn: fix off-by-one error.
Reported by:	adrian
2015-12-15 17:59:13 +00:00
Andriy Voskoboinyk
31b80e9a5e urtwn: add raw Tx path.
Tested with RTL8188EU and RTL8188CUS in STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4523
2015-12-14 20:39:38 +00:00
Andriy Voskoboinyk
e77cd6fd9e urtwn: fix frame processing in the Rx path.
Currently, in case when npkts >= 2, RSSI and Rx radiotap fields
will be overridden by the next packet. As a result, every packet
from this chain will use the same RSSI / radiotap data.

After this change, RSSI and radiotap structure will be filled
for every frame right before ieee80211_input() call.

Tested with RTL8188EU / RTL8188CUS, STA and MONITOR modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4487
2015-12-14 13:05:16 +00:00
Andriy Voskoboinyk
352761d514 urtwn: add TSF field into RX radiotap header.
Tested with RTL8188EU, MONITOR/STA modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3831
2015-12-14 12:36:10 +00:00
Andriy Voskoboinyk
ce036b5148 wpi, rum and urtwn: update copyright headers
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4489
2015-12-13 22:08:27 +00:00
Andriy Voskoboinyk
2744e0b2ab urtwn: add support for hardware encryption (WEP, TKIP and CCMP)
Tested with:
- RTL8188EU;
- RTL8188CUS;

Modes:
- IBSS mode: TKIP, CCMP (WPA-None);
- STA / HOSTAP modes - WEP (static), TKIP, CCMP;

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Obtained from:	OpenBSD (mostly)
Differential Revision:	https://reviews.freebsd.org/D4448
2015-12-13 22:00:19 +00:00
Andriy Voskoboinyk
b3f5d50360 urtwn: add a command queue for sleepable tasks.
An implementation from rum(4) was used (it looks simpler for me).
Will be used for h/w encryption support.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4447
2015-12-13 21:50:38 +00:00
Andriy Voskoboinyk
be615269bb urtwn(4): setup channel frequency/flags for radiotap in urtwn_set_channel()
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3832
2015-12-13 21:43:54 +00:00
Andriy Voskoboinyk
371028a3b7 urtwn: add rate control support for RTL8188EU.
Tested with:
- RTL8188EU, STA and HOSTAP modes.
- RTL8188CUS, STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4402
2015-12-13 21:00:21 +00:00
Andriy Voskoboinyk
bdfff33ff6 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
2015-12-13 20:48:24 +00:00
Warner Losh
f809f280e0 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
2015-12-11 05:28:00 +00:00
Kevin Lo
c70294dc3a All 2-endpoints configs have high and normal pariority queues. 2015-12-10 07:45:58 +00:00
Andriy Voskoboinyk
907809bec0 urtwn: add WME support
Tested with:
 - RTL8188CUS, HOSTAP mode.
 - RTL8188EU, STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4020
2015-12-09 09:29:38 +00:00
Kevin Lo
eab02f464a - Fix Tx queues to USB endpoints mapping
- Merge urtwn_r92c_dma_init() and urtwn_r88e_dma_init() into one

Reviewed by:	adrian, avos
Differential Revision:	https://reviews.freebsd.org/D4381
2015-12-06 14:07:57 +00:00
Andriy Voskoboinyk
2e3c0e969e urtwn: fix some regressions after r290630
- Restore R92C_TXDW4_HWSEQ_EN bit - it is used by non-8188EU chips.
- Fix DRVRATE bit usage.

Tested with:
 - RTL8188EU, STA mode.
 - RTL8188CUS, STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4352
2015-12-05 15:08:01 +00:00
Andriy Voskoboinyk
a7d4c4c102 urtwn(4): add error handling for urtwn_write_X() functions.
- Call ieee80211_stop() when urtwn_init() fails
(i.e., stop vap explicitly)
- Return an error when urtwn_write_<smth>() fails.
- Handle errors from them in:
 * urtwn_fw_cmd();
 * urtwn_llt_write();
 * urtwn_efuse_*();
 * urtwn_*_power_on();
 * urtwn_*_dma_init();
 * urtwn_mac_init();
 * urtwn_init();

Tested with RTL8188EU, STA mode

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4291
2015-12-03 14:38:55 +00:00
Andriy Voskoboinyk
aacc26e329 urtwn(4): move duplicate code from urtwn_(r92c/r88e)_dma_init()
to urtwn_dma_init() (noop).

Reviewed by:	kevlo
Approved by:	adrian (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D4271
2015-12-03 14:17:28 +00:00
Andriy Voskoboinyk
974d2101ba urtwn(4): rework ROM reading.
- Add error handling for urtwn_(r88e_)read_rom() and
urtwn_efuse_*() functions.
- Remove code duplication between urtwn_efuse_read() and
urtwn_r88e_read_rom().
- Merge r88e_rom and (r92c_)rom structures
(only one of them can be used at the same time).
- Other minor fixes / improvements.

Tested with RTL8188EU, STA mode
(URTWN_DEBUG + USB_DEBUG, hw.usb.urtwn.debug=3, no visual differences).

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4253
2015-11-24 19:20:45 +00:00
Andriy Voskoboinyk
a2ff3c9268 urtwn(4): add IBSS mode support
Tested with RTL8188EU, IBSS and STA modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4038
2015-11-10 12:52:26 +00:00
Andriy Voskoboinyk
98b83dc236 urtwn(4): fix the build.
Add some missing bits from D4020.
2015-11-10 00:42:32 +00:00
Andriy Voskoboinyk
337bcd0ac2 urtwn(4): add HOSTAP mode support.
Tested with RTL8188EU, HOSTAP and STA modes

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4034
2015-11-10 00:12:00 +00:00
Andriy Voskoboinyk
3aedf2e3b6 urtwn(4): refactor and fix TX path.
- Split urtwn_tx_start() into urtwn_tx_data() and urtwn_tx_start()
  (the last will be used for beacon updates / raw xmit path).
- Remove unneeded code from _urtwn_getbuf().
- Use CCK11 for data frames in 11b mode.
- Send EAPOL frames at 1 Mbps.
- Reduce code duplication in urtwn_tx_data().
- Fix sequence numbering.
- Add IEEE80211_RADIOTAP_F_WEP flag for encrypted frames.
- Check URTWN_RUNNING flag under lock.

Tested with RTL8188EU, STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4017
2015-11-09 23:46:13 +00:00
Andriy Voskoboinyk
55dbdc2140 urtwn(4): improve RX filter.
- Filter out unneeded frames in STA mode.
- Implement ic_promisc() call.

Tested with RTL8188EU, STA and MONITOR modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3999
2015-11-08 23:21:54 +00:00
Andriy Voskoboinyk
160caba341 urtwn(4): simplify urtwn_tsf_sync_enable().
- Drop TSF initialization; device can discover it without our help.
- Do not touch R92C_BCN_CTRL_EN_BCN bit in STA mode.
- Add 'static' keyword for function definition.

Tested with RTL8188EU, STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3801
2015-11-06 11:29:24 +00:00
Andriy Voskoboinyk
a14954c5d6 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
2015-11-05 17:58:18 +00:00
Hans Petter Selasky
94bceb529a Revert r290327. The compiler warnings seems to be specific to clang v3.5 only. 2015-11-03 09:38:39 +00:00
Hans Petter Selasky
b4f0cda47b Fix some clang compile warnings.
MFC after:	1 week
2015-11-03 08:52:06 +00:00
Andriy Voskoboinyk
240dd2906d urtwn(4): fix scanning from AUTH state
Tested with RTL8188EU, STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3968
2015-10-27 14:21:24 +00:00
Andriy Voskoboinyk
9acc0e6bea urtwn(4): do not filter out control frames in the RX path
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3811
2015-10-26 21:03:20 +00:00
Andriy Voskoboinyk
a0226b9f2d urtwn(4): fix mbuf leak in the TX path
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3988
2015-10-24 19:59:15 +00:00
Andriy Voskoboinyk
db70df04c4 run(4): convert to ieee80211_tx_complete()
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3992
2015-10-23 17:35:03 +00:00
Hans Petter Selasky
74a24bbee6 Fix kernel build by restoring a temporary variable which was not yet
ripe for removal.
2015-10-23 11:00:35 +00:00
Andriy Voskoboinyk
74ee6e03d0 urtwn(4): add DBM_ANTNOISE radiotap field
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3839
2015-10-23 08:44:40 +00:00
Andriy Voskoboinyk
e97705d4b7 - Split one 4-byte R92C_CR register into 2-byte R92C_CR and 1-byte R92C_MSR
registers (they are used for different purposes).
- Wrap R92C_MSR modifications into urtwn_set_mode().

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3838
2015-10-23 08:26:26 +00:00
Andriy Voskoboinyk
1b65f30ffa urtwn(4): fix the RSSI calculation for RTL8188EU.
This change also reverts r252405 (causes integer underflow).

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3820
2015-10-23 07:42:56 +00:00
Andriy Voskoboinyk
5a5461d8e0 urtwn(4): replace hardcoded rate indices with their names
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3967
2015-10-22 15:42:53 +00:00
Andriy Voskoboinyk
cc52232057 Initialize radiotap header fields before calling ieee80211_radiotap_rx()
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3951
2015-10-22 12:15:40 +00:00
Kevin Lo
dc82802918 Accept any correct frames from any source when MONITOR mode is used.
Submitted by:	Andriy Voskoboinyk <s3erios at gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3812
2015-10-12 08:17:21 +00:00
Adrian Chadd
4f4a7a03ce 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
2015-10-12 05:21:51 +00:00
Adrian Chadd
c0658ced70 urtwn(4): split *reg and *var parts (no functional change).
Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3775
2015-10-12 05:14:49 +00:00
Adrian Chadd
d957a93abe 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
2015-10-12 04:55:20 +00:00
Adrian Chadd
d07be335a0 net80211: separate mbuf cleanup from ieee80211_fragment()
* Create ieee80211_free_mbuf() which frees a list of mbufs.
* Use it in the fragment transmit path and ath / uath transmit paths.
* Call it in xmit_pkt() if the transmission fails; otherwise fragments
  may be leaked.

This should be a big no-op.

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3769
2015-10-12 03:27:08 +00:00
Kevin Lo
f4ea007a07 Sort function prototypes and add missing 'static' keywords.
Submitted by:	Andriy Voskoboinyk <s3erios at gmail dot com>
Differential Revision:	https://reviews.freebsd.org/D3847
2015-10-09 14:31:32 +00:00
Gavin Atkinson
0840f9483d Recognise the Netgear WNDA4100 (N900) 3x3 device in run(4). 2015-10-08 12:55:21 +00:00
Kevin Lo
78f32e980c Replace M_NOWAIT with M_WAITOK for consistency with other wireless drivers. 2015-10-04 13:40:22 +00:00
Kevin Lo
24c838f059 Fix max TX power settings for RT5390/RT5392.
While here remove wrong definition of RT2860_USB_PHY_MAN_RST.
2015-10-04 13:39:00 +00:00
Adrian Chadd
2e83cb98f6 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.
2015-10-04 05:22:17 +00:00
Adrian Chadd
327459808e Random zyd(4) fixes to bring TX handling in line with rsu, etc
* don't free buffers in the TX routine, only in transmit/raw_xmit
* free nodes + references
* .. and free those nodes/references /before/ net80211 detach

Tested:

* STA mode: zyd0: HMAC ZD1211B, FW 47.25, RF AL2230 S0, PA0 LED 0 BE0 NP1 Gain1 F0
2015-10-04 04:44:06 +00:00
Adrian Chadd
7682e59709 Fix to make compile on gcc-4.2.1 (eg mips, sparc64.) 2015-10-04 04:29:44 +00:00
Adrian Chadd
5f28dd731d Fix to compile using gcc-4.2 (eg mips, sparc64.) 2015-10-04 04:25:56 +00:00
Adrian Chadd
1354b52cfc rum(4): add WME support.
Tested:

* WUSB54GC, HOSTAP and STA modes.
* Me: rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3700
2015-10-03 22:35:37 +00:00
Adrian Chadd
13072f8d84 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
2015-10-03 22:33:45 +00:00
Adrian Chadd
f4ac78a284 rum(4): fix stats interpretation in rum_ratectl_task()
Testing:

* WUSB54GC, STA mode

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3690
2015-10-03 22:26:59 +00:00
Adrian Chadd
342ced03e2 rum(4): set short/long retry limits
Now device will use retry limit, which is set via 'ifconfig <interface>
maxretry <number>'.

Tested:

* Tested on WUSB54GC, STA mode.

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3689
2015-10-03 22:22:26 +00:00
Adrian Chadd
c42e124eca rum(4): fix sequence number generation.
* drop erroneous RT2573_TX_MORE_FRAG flag;
* provide RT2573_TX_HWSEQ where needed.

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3672
2015-10-03 22:15:59 +00:00
Adrian Chadd
210ab3c258 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
2015-10-03 22:12:25 +00:00
Adrian Chadd
bc813c40bf 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
2015-10-03 21:48:27 +00:00
Adrian Chadd
ed5711a11b rum(4): drop unused 'node id' parameter.
Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3655
2015-10-03 20:53:10 +00:00