freebsd-nq/sys/net80211
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
..
_ieee80211.h
ieee80211_acl.c
ieee80211_action.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
ieee80211_action.h
ieee80211_adhoc.c Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211_adhoc.h
ieee80211_ageq.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
ieee80211_ageq.h
ieee80211_alq.c - Provide necessary includes, that before came via if.h pollution. 2013-10-28 22:26:03 +00:00
ieee80211_alq.h
ieee80211_amrr.c After much toying around with this AMRR initial rate stuff, 2014-08-20 09:10:03 +00:00
ieee80211_amrr.h
ieee80211_crypto_ccmp.c
ieee80211_crypto_none.c
ieee80211_crypto_tkip.c
ieee80211_crypto_wep.c
ieee80211_crypto.c
ieee80211_crypto.h
ieee80211_ddb.c Use name from ieee80211com instead of parent ifnet, in debugging printfs. 2015-05-25 14:30:44 +00:00
ieee80211_dfs.c Use name from ieee80211com instead of parent ifnet, in debugging printfs. 2015-05-25 14:30:44 +00:00
ieee80211_dfs.h
ieee80211_freebsd.c Use name from ieee80211com instead of parent ifnet, in debugging printfs. 2015-05-25 14:30:44 +00:00
ieee80211_freebsd.h Fix string concatenation - "wlan_##name" -> "wlan_" #name 2015-05-04 00:47:22 +00:00
ieee80211_hostap.c Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211_hostap.h
ieee80211_ht.c Use name from ieee80211com instead of parent ifnet, in debugging printfs. 2015-05-25 14:30:44 +00:00
ieee80211_ht.h
ieee80211_hwmp.c CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
ieee80211_input.c Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211_input.h Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211_ioctl.c Use logical rather than bitwise OR in if() expression. 2014-04-26 23:22:49 +00:00
ieee80211_ioctl.h
ieee80211_mesh.c Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211_mesh.h
ieee80211_monitor.c Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211_monitor.h
ieee80211_node.c Use name from ieee80211com instead of parent ifnet, in debugging printfs. 2015-05-25 14:30:44 +00:00
ieee80211_node.h
ieee80211_output.c Properly update TX statistics for wlan(4). 2015-05-23 09:49:40 +00:00
ieee80211_phy.c Provide includes that are needed in these files, and before were read 2013-10-26 18:18:50 +00:00
ieee80211_phy.h
ieee80211_power.c Update ieee80211_sta_tim_notify() to do double duty - handle STA sleep 2014-12-21 04:58:45 +00:00
ieee80211_power.h Begin fleshing out support for net80211 provided (legacy) sleep management. 2014-04-24 01:39:53 +00:00
ieee80211_proto.c Use name from ieee80211com instead of parent ifnet, in debugging printfs. 2015-05-25 14:30:44 +00:00
ieee80211_proto.h Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211_radiotap.c Remove unused include. 2015-05-25 14:54:10 +00:00
ieee80211_radiotap.h
ieee80211_ratectl_none.c Provide includes that are needed in these files, and before were read 2013-10-26 18:18:50 +00:00
ieee80211_ratectl.c Provide includes that are needed in these files, and before were read 2013-10-26 18:18:50 +00:00
ieee80211_ratectl.h Switch around the order of static inline to be in line with how it's 2015-01-11 18:43:45 +00:00
ieee80211_regdomain.c Use name from ieee80211com instead of parent ifnet, in debugging printfs. 2015-05-25 14:30:44 +00:00
ieee80211_regdomain.h
ieee80211_rssadapt.c Include necessary headers that now are available due to pollution 2013-10-28 07:29:16 +00:00
ieee80211_rssadapt.h
ieee80211_scan_sta.c Prepare for supporting driver-overridden curchan when submitting scan 2015-05-10 22:07:53 +00:00
ieee80211_scan_sw.c Prepare for supporting driver-overridden curchan when submitting scan 2015-05-10 22:07:53 +00:00
ieee80211_scan_sw.h Prepare for supporting driver-overridden curchan when submitting scan 2015-05-10 22:07:53 +00:00
ieee80211_scan.c Prepare for supporting driver-overridden curchan when submitting scan 2015-05-10 22:07:53 +00:00
ieee80211_scan.h Prepare for supporting driver-overridden curchan when submitting scan 2015-05-10 22:07:53 +00:00
ieee80211_sta.c Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211_sta.h
ieee80211_superg.c Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
ieee80211_superg.h
ieee80211_tdma.c Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211_tdma.h Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211_var.h Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211_wds.c Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211_wds.h
ieee80211_xauth.c
ieee80211.c Begin plumbing ieee80211_rx_stats through the receive path. 2015-05-25 16:37:41 +00:00
ieee80211.h Do not check sequence number for QoS Null frames; set it for generated QoS Null 2015-05-12 16:55:50 +00:00