Commit Graph

11 Commits

Author SHA1 Message Date
Andriy Voskoboinyk
af524a9f4b urtwn: add support for hardware multicast filter setup.
Tested with RTL8188EU and RTL8188CUS.
2016-05-16 19:10:59 +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
Andriy Voskoboinyk
0c8ed1fb02 urtwn: optimize rate lookup in the urtwn_ra_init()
Replace loop with switch statement (rate2ridx())
(should be noop).

Tested with RTL8188EU / RTL8188CUS, STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D4848 (rebased)
2016-04-21 20:34:38 +00:00
Andriy Voskoboinyk
31021a2b4e net80211: replace internal LE_READ_*/LE_WRITE_* macro with system
le*dec / le*enc functions.

Replace net80211 specific macros with system-wide bytestream
encoding/decoding functions:
- LE_READ_2 ->  le16dec
- LE_READ_4 ->  le32dec
- LE_WRITE_2 -> le16enc
- LE_WRITE_4 -> le32enc

+ drop ieee80211_input.h include, where it was included for these
operations only.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D6030
2016-04-20 18:29:30 +00:00
Adrian Chadd
a1a5d6cf5f [urtwn] default to announcing RX 64K aggregates. 2016-04-18 00:28:25 +00:00
Adrian Chadd
0937924af2 [urtwn] set the A-MPDU density to 16.
Obtained from:	Linux rtlwifi/rtl8xxxu
2016-04-17 02:39:58 +00:00
Adrian Chadd
830f064f5c [urtwn] use/track the last good RSSI for a given node, rather than no RSSI.
Now that we're decap'ing A-MPDU frame, the firmware is only giving us
PHY status information for the whole PPDU, rather than duplicatig it
per frame.

So, we fake it by maintaining the RSSI that we saw in the node struct
and reuse it.

This prevents us from getting some pretty garbage looking default RSSI
values, which shows up as RSSI values of like "3" or "4" when doing
active traffic.

Tested:

* RTL8188EU, STA mode
2016-04-13 05:19:16 +00:00
Adrian Chadd
c383e5c8ac [urtwn] disable doing AMPDU TX.
We don't do AMPDU TX for now, so don't bother setting this.
2016-04-06 00:52:30 +00:00
Adrian Chadd
f7125f1806 [urtwn] first cut of getting the fast-frames / amsdu support in shape.
The urtwn hardware transmits FF/A-MSDU just fine - it takes an 802.11
frame and will dutifully send the thing.

So:

* bump RX queue up from 1. Why's it 1? That's really silly.
* Add the "software A-MSDU" encap capability bit.
* bump the TX buffer size up so we can at least send A-MSDU frames.
* track active frames submitted to the NIC - we can't make assumptions
  about how many are in flight in the NIC though.  For 88E parts we
  could use per-packet TX indication, but for R92 parts we can't.
  So, just fake it somewhat.
* Kick the transmit queue when we finish reception; try to avoid stalls.
* Kick the FF queue a little more regularly.

A-MSDU TX won't happen until the net80211 side is done, but atheros
fast-frames support should now work.

Tested:

* urtwn0: MAC/BB RTL8188EU, RF 6052 1T1R ; A-MSDU transmit.
2016-04-05 22:14:21 +00:00
Adrian Chadd
cf9be7c92a [urtwn] welcome basic 11n support to urtwn.
This is a pretty good reference for teaching an almost-11n-capable
driver about 11n.

It enables HT20 operation, A-MPDU/A-MSDU RX, but no aggregate support
for transmit.  That'll come later.  This means that receive throughput
should be higher, but transmit throughput won't have changed much.

* Disable bgscan - for now, bgscan will interfere with AMPDU TX/RX,
  so until we correctly handle it in software driven scans, disable.
* Add null 11n methods for channel width / ampdu_enable.
  the firmware can apparently handle ampdu tx (and hopefully block-ack
  handling and retransmission) so I'll go review the linux code and
  figure it out.
* Set the number of tx/rx streams.  I /hope/ that nchains == nstreams
  here.
* Add 11n channels in the call to ieee80211_init_channels().
* Don't enable HT40 for now - I'll have to verify the channel set command
  and tidy it up a bit first.
* Teach the RX path about M_AMPDU for 11n nodes.  Kinda wonder why
  we aren't just doing this in net80211 already, this is the fourth
  driver I've had to do this to.
* Teach rate2ridx() about MCS rates and what hardware rates to use.
* Teach the urtwn_tx_data() routine about MCS/11ng transmission.
  It doesn't know about short-gi and 40MHz modes yet; that'll come
  later.
* For 8192CU firmware, teach the rate table code about MCS rates.
* Ensure that the fixed rate transmit sets the right transmit flag
  so the firmware obeys the driver transmit path.
* Set the default transmit rate to MCS4 if no rate control is available.
* Add HT protection (RTS-CTS exchange) support.

* Add appropriate XXX TODO entries.

TODO:

* 40MHz, short-gi, etc - channel tuning, TX, RX;
* teach urtwn_tx_raw() about (more) 11n stuff;
* A-MPDU TX would be nice!

Thanks to Andriy (avos@) for reviewing the code and testing it on IRC.

Tested:

* RTL8188EU - STA (me)
* RTL8192CU - STA (me)
* RTL8188EU - hostap (avos)
* RTL8192CU - STA (avos)

Reviewed by:	avos
2016-03-22 01:09:15 +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