1*490c53e9SAdrian Chadd# net80211 2*490c53e9SAdrian Chadd 3*490c53e9SAdrian ChaddThis is the 802.11 wireless stack for FreeBSD. 4*490c53e9SAdrian Chadd 5*490c53e9SAdrian Chadd## Introduction 6*490c53e9SAdrian Chadd 7*490c53e9SAdrian ChaddThe net80211 subsystem implements the 802.11 protocol and support infrastructure. 8*490c53e9SAdrian ChaddIt supports a variety of device types, 802.11 protocols, operating modes and 9*490c53e9SAdrian Chaddsecurity extensions. 10*490c53e9SAdrian Chadd 11*490c53e9SAdrian Chaddnet80211 handles the 802.11 state machine, interface management, node management, 12*490c53e9SAdrian Chaddvirtual interfaces, packet encapsulation and de-encapsulation and basic 13*490c53e9SAdrian Chaddsecurity key management. 14*490c53e9SAdrian Chadd 15*490c53e9SAdrian ChaddThe userland ioctl() API provides control mechanisms for the above and is how 16*490c53e9SAdrian Chaddmanagement tooling (ifconfig, libifconfig) and management services (hostapd, 17*490c53e9SAdrian Chaddwpa_supplicant) interfaces with the net80211 stack. 18*490c53e9SAdrian Chadd 19*490c53e9SAdrian ChaddThe security state machine and key management (802.1x, WPA, etc) are handled 20*490c53e9SAdrian Chaddby management services. 21*490c53e9SAdrian Chadd 22*490c53e9SAdrian ChaddDrivers can implement as much or as little of the 802.11 infrastructure as 23*490c53e9SAdrian Chaddneeded. net80211 support drivers from full-offload (ie, supplying ethernet 24*490c53e9SAdrian Chaddencapsulated/de-encapsulated frames with management control via driver 25*490c53e9SAdrian Chaddmethods) down to fully software controlled devices (ie, the hardware 26*490c53e9SAdrian Chaddis minimal and all 802.11 packet handling, state machine, reordering, security, 27*490c53e9SAdrian Chaddetc is handled by net80211.) 28*490c53e9SAdrian Chadd 29*490c53e9SAdrian Chadd## Overview 30*490c53e9SAdrian Chadd 31*490c53e9SAdrian Chaddnet80211 consists of a few top level design modules: 32*490c53e9SAdrian Chadd 33*490c53e9SAdrian Chadd * The 802.11 device representation and functions (ieee80211com), used 34*490c53e9SAdrian Chadd in conjunction with an 802.11 device driver to represent the physical device. 35*490c53e9SAdrian Chadd 36*490c53e9SAdrian Chadd * The 802.11 virtual interface representation and functions (ieee80211vap), 37*490c53e9SAdrian Chadd used to represent instances of virtual interfaces. 38*490c53e9SAdrian Chadd 39*490c53e9SAdrian Chadd * A representation of 802.11 stations/nodes (ieee80211_node), which 40*490c53e9SAdrian Chadd keep the state of each 802.11 station/node that the stack knows about. 41*490c53e9SAdrian Chadd 42*490c53e9SAdrian Chadd * Encryption handling (ieee80211_crypto), handling 802.11 frame encryption, 43*490c53e9SAdrian Chadd decryption and session/state tracking. 44*490c53e9SAdrian Chadd 45*490c53e9SAdrian Chadd * Regulatory domain (ieee80211_regdomain), which implements the 802.11 46*490c53e9SAdrian Chadd regulatory domains, allowed frequencies, operating modes and transmit power. 47*490c53e9SAdrian Chadd 48*490c53e9SAdrian Chadd * Radar detection (ieee80211_dfs.c), tracking the state of radar detection and 49*490c53e9SAdrian Chadd interoperability in the 5GHz frequency range. 50*490c53e9SAdrian Chadd 51*490c53e9SAdrian Chadd * Transmit rate control (ieee80211_ratectl.c) implements software and 52*490c53e9SAdrian Chadd firmware based rate control for devices that don't implement full rate control 53*490c53e9SAdrian Chadd offload. 54*490c53e9SAdrian Chadd 55*490c53e9SAdrian Chadd * Power save support (ieee82011_power.c) implements various power saving 56*490c53e9SAdrian Chadd mode features and support for devices which do not fully implement offloaded 57*490c53e9SAdrian Chadd power management. 58*490c53e9SAdrian Chadd 59*490c53e9SAdrian Chadd * Operating system specific interfaces (ieee80211_freebsd.c) which implement 60*490c53e9SAdrian Chadd the bulk of the operating system specific glue (logging, memory allocation, 61*490c53e9SAdrian Chadd network interfaces, etc.) 62*490c53e9SAdrian Chadd 63*490c53e9SAdrian Chadd * The configuration interface (ieee80211_ioctl.c) which implements the ioctl 64*490c53e9SAdrian Chadd API used by userland to configure and monitor the state of the 802.11 stack 65*490c53e9SAdrian Chadd and devices. 66*490c53e9SAdrian Chadd 67*490c53e9SAdrian ChaddIn addition, each operating mode (adhoc, station, AP, WDS, mesh) have their own 68*490c53e9SAdrian Chaddmodules that implement the state machines and functionality required for 802.11. 69*490c53e9SAdrian Chadd 70*490c53e9SAdrian Chadd## Portability 71*490c53e9SAdrian Chadd 72*490c53e9SAdrian ChaddAlthough net80211 attempts to keep most OS specific components in a single file 73*490c53e9SAdrian Chadd(ieee80211_freebsd.c), it is not currently perfect. 74*490c53e9SAdrian Chadd 75*490c53e9SAdrian ChaddNotably: 76*490c53e9SAdrian Chadd 77*490c53e9SAdrian Chadd * There are still plenty of FreeBSD-isms located throughout the source code, 78*490c53e9SAdrian Chadd including BSD specific includes, network APIs, etc. 79*490c53e9SAdrian Chadd 80*490c53e9SAdrian Chadd * The interface and networking model is still very BSD, including using the 81*490c53e9SAdrian Chadd system implementation of mbufs. 82*490c53e9SAdrian Chadd 83*490c53e9SAdrian ChaddWhen developing for net80211 please keep in mind that other operating systems 84*490c53e9SAdrian Chadd(such as DragonflyBSD) and third parties do leverage this codebase. 85*490c53e9SAdrian ChaddTry to keep all FreeBSD specific components in ieee80211_freebsd.[ch]. 86*490c53e9SAdrian Chadd 87*490c53e9SAdrian Chadd## Protocol Overview 88*490c53e9SAdrian Chadd 89*490c53e9SAdrian ChaddA basic protocol overview is available at (@ref md_net80211_PROTOCOL). 90*490c53e9SAdrian Chadd 91*490c53e9SAdrian ChaddThe most comprehensive overview is the 802.11 protocol document itself, 92*490c53e9SAdrian Chaddbut it is very large and implementations do not always correspond 1:1 93*490c53e9SAdrian Chaddwith the protocol definitions. 94*490c53e9SAdrian Chadd 95*490c53e9SAdrian Chadd## Functional Overview 96*490c53e9SAdrian Chadd 97*490c53e9SAdrian Chadd(TODO) 98*490c53e9SAdrian Chadd 99*490c53e9SAdrian Chadd * Module layout 100*490c53e9SAdrian Chadd * Logging 101*490c53e9SAdrian Chadd * Debugging - (@ref md_net80211_DEBUG) 102*490c53e9SAdrian Chadd * Top-level device layout (ieee80211com) 103*490c53e9SAdrian Chadd * Data / Control Path Overview (@ref md_net80211_DATAPATH_TRANSMIT), (@ref md_net80211_DATAPATH_RECEIVE) 104*490c53e9SAdrian Chadd * Deferred work 105*490c53e9SAdrian Chadd * Regulatory 106*490c53e9SAdrian Chadd * Virtual interfaces 107*490c53e9SAdrian Chadd * Operating Modes 108*490c53e9SAdrian Chadd * Nodes 109*490c53e9SAdrian Chadd * Node tables, node table iteration 110*490c53e9SAdrian Chadd * Device and VAP states 111*490c53e9SAdrian Chadd * Node states 112*490c53e9SAdrian Chadd * Operating modes 113*490c53e9SAdrian Chadd * Cipher management 114*490c53e9SAdrian Chadd * Radar detection 115*490c53e9SAdrian Chadd * ioctl interface 116*490c53e9SAdrian Chadd * ACL support 117*490c53e9SAdrian Chadd * Scanning, Scan Modules 118*490c53e9SAdrian Chadd * Power Management 119*490c53e9SAdrian Chadd * Transmit Path 120*490c53e9SAdrian Chadd * Receive Path 121*490c53e9SAdrian Chadd * A-MSDU Fast Frames 122*490c53e9SAdrian Chadd * A-MPDU 123*490c53e9SAdrian Chadd * Radiotap 124*490c53e9SAdrian Chadd * Monitor Mode 125*490c53e9SAdrian Chadd 126*490c53e9SAdrian Chadd## Driver Overview 127*490c53e9SAdrian Chadd 128*490c53e9SAdrian Chadd(TODO) 129*490c53e9SAdrian Chadd 130*490c53e9SAdrian Chadd * Introduction 131*490c53e9SAdrian Chadd * Driver Structure 132*490c53e9SAdrian Chadd * Setup and Attach 133*490c53e9SAdrian Chadd * Virtual Interfaces 134*490c53e9SAdrian Chadd * Control Path 135*490c53e9SAdrian Chadd * Data Path 136*490c53e9SAdrian Chadd * VAP state 137*490c53e9SAdrian Chadd * Device State 138*490c53e9SAdrian Chadd * Suspend and Resume 139*490c53e9SAdrian Chadd 140