freebsd-skq/sys/dev/ath
Adrian Chadd c79f192c09 Begin plumbing ieee80211_rx_stats through the receive path.
Smart NICs with firmware (eg wpi, iwn, the new atheros parts, the intel 7260
series, etc) support doing a lot of things in firmware.  This includes but
isn't limited to things like scanning, sending probe requests and receiving
probe responses.  However, net80211 doesn't know about any of this - it still
drives the whole scan/probe infrastructure itself.

In order to move towards suppoting smart NICs, the receive path needs to
know about the channel/details for each received packet.  In at least
the iwn and 7260 firmware (and I believe wpi, but I haven't tried it yet)
it will do the scanning, power-save and off-channel buffering for you -
all you need to do is handle receiving beacons and probe responses on
channels that aren't what you're currently on.  However the whole receive
path is peppered with ic->ic_curchan and manual scan/powersave handling.
The beacon parsing code also checks ic->ic_curchan to determine if the
received beacon is on the correct channel or not.[1]

So:

* add freq/ieee values to ieee80211_rx_stats;
* change ieee80211_parse_beacon() to accept the 'current' channel
  as an argument;
* modify the iv_input() and iv_recv_mgmt() methods to include the rx_stats;
* add a new method - ieee80211_lookup_channel_rxstats() - that looks up
  a channel based on the contents of ieee80211_rx_stats;
* if it exists, use it in the mgmt path to switch the current channel
  (which still defaults to ic->ic_curchan) over to something determined
  by rx_stats.

This is enough to kick-start scan offload support in the Intel 7260
driver that Rui/I are working on.  It also is a good start for scan
offload support for a handful of existing NICs (wpi, iwn, some USB
parts) and it'll very likely dramatically improve stability/performance
there.  It's not the whole thing - notably, we don't need to do powersave,
we should not scan all channels, and we should leave probe request sending
to the firmware and not do it ourselves.  But, this allows for continued
development on the above features whilst actually having a somewhat
working NIC.

TODO:

* Finish tidying up how the net80211 input path works.
  Right now ieee80211_input / ieee80211_input_all act as the top-level
  that everything feeds into; it should change so the MIMO input routines
  are those and the legacy routines are phased out.

* The band selection should be done by the driver, not by the net80211
  layer.

* ieee80211_lookup_channel_rxstats() only determines 11b or 11g channels
  for now - this is enough for scanning, but not 100% true in all cases.
  If we ever need to handle off-channel scan support for things like
  static-40MHz or static-80MHz, or turbo-G, or half/quarter rates,
  then we should extend this.

[1] This is a side effect of frequency-hopping and CCK modes - you
    can receive beacons when you think you're on a different channel.
    In particular, CCK (which is used by the low 11b rates, eg beacons!)
    is decodable from adjacent channels - just at a low SNR.
    FH is a side effect of having the hardware/firmware do the frequency
    hopping - it may pick up beacons transmitted from other FH networks
    that are in a different phase of hopping frequencies.
2015-05-25 16:37:41 +00:00
..
ath_dfs/null The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
ath_hal Return the correct HAL data type for HAL_DIAG_ANI_STATS. 2015-04-06 01:12:53 +00:00
ath_rate Cast everything to something longer than 32 bits so the sample mask 2015-01-28 04:44:42 +00:00
ah_osdep.c Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
ah_osdep.h
if_ath_ahb.c Lay some groundwork for having this stuff hang off of AHB rather than 2015-03-02 02:14:44 +00:00
if_ath_alq.c Support sending ATH_ALQ messages with no payload. 2013-05-13 21:17:27 +00:00
if_ath_alq.h Add ALQ beacon debugging. 2013-05-13 21:18:00 +00:00
if_ath_beacon.c Shut down RX before TX - in theory, this should make the chip less likely 2014-08-23 18:55:51 +00:00
if_ath_beacon.h Bring over some initial power save management support, reset path 2014-04-30 02:19:41 +00:00
if_ath_btcoex.c Until there's a full MCI implementation - just implement a placeholder 2015-01-17 00:02:18 +00:00
if_ath_btcoex.h Bring over the initial static bluetooth coexistence configuration 2013-06-07 09:02:02 +00:00
if_ath_debug.c Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
if_ath_debug.h Bring over some initial power save management support, reset path 2014-04-30 02:19:41 +00:00
if_ath_keycache.c Bring over some initial power save management support, reset path 2014-04-30 02:19:41 +00:00
if_ath_keycache.h
if_ath_led.c Bring over some initial power save management support, reset path 2014-04-30 02:19:41 +00:00
if_ath_led.h
if_ath_lna_div.c Add initial support for the AR9485 CUS198 / CUS230 variants. 2014-09-30 03:19:29 +00:00
if_ath_lna_div.h Initial AR9485/AR933x 1x1 LNA diversity work. 2013-06-14 03:42:10 +00:00
if_ath_misc.h Add tracking for self-generated frames when the VAP is in sleep state. 2014-05-02 00:48:09 +00:00
if_ath_pci_devlist.h Add a missing file from the last commit. 2014-09-30 05:50:34 +00:00
if_ath_pci.c Move the lock destruction/creation to earlier in the process - if 2015-02-14 18:14:45 +00:00
if_ath_rx_edma.c Fix up the EDMA RX setup path to correctly initialise and reset the RX FIFO. 2014-09-20 01:22:17 +00:00
if_ath_rx_edma.h
if_ath_rx.c Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
if_ath_rx.h Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
if_ath_spectral.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
if_ath_spectral.h
if_ath_sysctl.c Bump the valid GPIO range for rfkill up from 8 to 16. 2014-12-23 18:48:45 +00:00
if_ath_sysctl.h
if_ath_tdma.c Add casts to have it compile on amd64 without complaining about 2014-05-07 19:07:45 +00:00
if_ath_tdma.h
if_ath_tsf.h
if_ath_tx_edma.c Quieten the RX/TX descriptor and FIFO setup debugging. 2014-05-05 08:00:50 +00:00
if_ath_tx_edma.h
if_ath_tx_ht.c Implement my first cut at "correct" node power-save and 2013-05-15 18:33:05 +00:00
if_ath_tx_ht.h Implement my first cut at "correct" node power-save and 2013-05-15 18:33:05 +00:00
if_ath_tx.c Mechanically convert to if_inc_counter(). 2014-09-18 20:47:39 +00:00
if_ath_tx.h Implement a separate hardware queue threshold for aggregate and non-aggr 2013-05-21 18:13:57 +00:00
if_ath.c Make net80211 drivers supply their device name to the net80211 layer, so 2015-05-25 13:51:13 +00:00
if_athdfs.h
if_athioctl.h Implement my first cut at "correct" node power-save and 2013-05-15 18:33:05 +00:00
if_athrate.h Update the rate series setup code to use the decisions already made in 2013-04-17 07:21:30 +00:00
if_athvar.h Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00