1.\"- 2.\" Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3.\" All rights reserved. 4.\"" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer, 10.\" without modification. 11.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer 12.\" similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any 13.\" redistribution must be conditioned upon including a substantially 14.\" similar Disclaimer requirement for further binary redistribution. 15.\" 16.\" NO WARRANTY 17.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19.\" LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY 20.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 21.\" THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, 22.\" OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27.\" THE POSSIBILITY OF SUCH DAMAGES. 28.\" 29.\" $FreeBSD$ 30.\"/ 31.Dd August 7, 2023 32.Dt ATH 4 33.Os 34.Sh NAME 35.Nm ath 36.Nd "Atheros IEEE 802.11 wireless network driver" 37.Sh SYNOPSIS 38To compile this driver into the kernel, 39place the following lines in your 40kernel configuration file: 41.Bd -ragged -offset indent 42.Cd "device ath" 43.Cd "device ath_hal" 44.Cd "device ath_rate_sample" 45.Cd "device wlan" 46.Ed 47.Pp 48Alternatively, to load the driver as a 49module at boot time, place the following line in 50.Xr loader.conf 5 : 51.Bd -literal -offset indent 52if_ath_load="YES" 53.Ed 54.Sh DESCRIPTION 55The 56.Nm 57driver provides support for wireless network adapters based on 58the Atheros AR5210, AR5211, AR5212, AR5416 and AR9300 programming APIs. 59These APIs are used by a wide variety of chips; most all chips with 60a PCI, PCIe and/or CardBus interface are supported. 61.Pp 62Supported features include 802.11 and 802.3 frames, power management, BSS, 63IBSS, MBSS, WDS/DWDS TDMA, and host-based access point operation modes. 64All host/device interaction is via DMA. 65.Pp 66The 67.Nm 68driver encapsulates all IP and ARP traffic as 802.11 frames, however 69it can receive either 802.11 or 802.3 frames. 70Transmit speed and operating mode is selectable 71and depends on the specific chipset. 72AR5210-based devices support 802.11a operation with transmit speeds 73of 6 Mbps, 9 Mbps, 12 Mbps, 18 Mbps, 24 Mbps, 36 Mbps, 48 Mbps, and 54 Mbps. 74AR5211-based devices support 802.11a and 802.11b operation with transmit 75speeds as above for 802.11a operation and 761Mbps, 2Mbps, 5.5 Mbps and 11Mbps for 802.11b operation. 77AR5212-based devices support 802.11a, 802.11b, and 802.11g operation 78with transmit speeds appropriate to each. 79AR5416 and later class devices are capable of 802.11n operation. 80Most chips also support an Atheros Turbo Mode (TM) that operates in 81the 5GHz frequency range with 2x the transmit speeds. 82Some chips also support Turbo mode in the 2.4GHz range with 802.11g 83though this support is not presently available due to regulatory requirements. 84(Note that Turbo modes are, however, 85only interoperable with other Atheros-based devices.) 86AR5212-based and AR5416-based devices also support half- (10MHz) and quarter-width (5MHz) channels. 87The actual transmit speed used is dependent on signal quality and the 88.Dq "rate control" 89algorithm employed by the driver. 90All chips support WEP encryption. 91AR5212, AR5416 and later parts have hardware support for the 92AES-CCM, TKIP, and Michael cryptographic 93operations required for WPA. 94To enable encryption, use 95.Xr ifconfig 8 96as shown below. 97.Pp 98The driver supports 99.Cm station , 100.Cm adhoc , 101.Cm adhoc-demo , 102.Cm hostap , 103.Cm mesh , 104.Cm wds , 105and 106.Cm monitor 107mode operation. 108Multiple 109.Cm hostap 110virtual interfaces may be configured for simultaneous 111use on cards that use a 5212 or later part. 112When multiple interfaces are configured each may have a separate 113mac address that is formed by setting the U/L bits in the mac 114address assigned to the underlying device. 115Any number of 116.Cm wds 117virtual interfaces may be configured together with 118.Cm hostap 119interfaces. 120Multiple 121.Cm station 122interfaces may be operated together with 123.Cm hostap 124interfaces to construct a wireless repeater device. 125The driver also support 126.Cm tdma 127operation when compiled with 128.Cd "options IEEE80211_SUPPORT_TDMA" 129(which also enables the required 802.11 support). 130For more information on configuring this device, see 131.Xr ifconfig 8 . 132.Pp 133Devices supported by the 134.Nm 135driver come in Cardbus, ExpressCard, Mini-PCI and Mini-PCIe packages. 136Wireless cards in Cardbus and ExpressCard slots may be inserted and 137ejected on the fly. 138.Sh HARDWARE 139The 140.Nm 141driver supports all Atheros Cardbus, ExpressCard, PCI and PCIe cards, 142except those that are based on the AR5005VL chipset. 143.Sh EXAMPLES 144Join a specific BSS network with WEP encryption: 145.Bd -literal -offset indent 146ifconfig wlan0 create wlandev ath0 147ifconfig wlan0 inet 192.168.0.20 netmask 0xffffff00 ssid my_net \e 148 wepmode on wepkey 0x8736639624 149.Ed 150.Pp 151Join/create an 802.11b IBSS network with network name 152.Dq Li my_net : 153.Bd -literal -offset indent 154ifconfig wlan0 create wlandev ath0 wlanmode adhoc 155ifconfig wlan0 inet 192.168.0.22 netmask 0xffffff00 ssid my_net \e 156 mode 11b 157.Ed 158.Pp 159Create an 802.11g host-based access point: 160.Bd -literal -offset indent 161ifconfig wlan0 create wlandev ath0 wlanmode hostap 162ifconfig wlan0 inet 192.168.0.10 netmask 0xffffff00 ssid my_ap \e 163 mode 11g 164.Ed 165.Pp 166Create an 802.11a mesh station: 167.Bd -literal -offset indent 168ifconfig wlan0 create wlandev ath0 wlanmode mesh 169ifconfig wlan0 meshid my_mesh mode 11a inet 192.168.0.10/24 170.Ed 171.Pp 172Create two virtual 802.11a host-based access points, one with 173WEP enabled and one with no security, and bridge them to 174the fxp0 (wired) device: 175.Bd -literal -offset indent 176ifconfig wlan0 create wlandev ath0 wlanmode hostap \e 177 ssid paying-customers wepmode on wepkey 0x1234567890 \e 178 mode 11a up 179ifconfig wlan1 create wlandev ath0 wlanmode hostap bssid \e 180 ssid freeloaders up 181ifconfig bridge0 create addm wlan0 addm wlan1 addm fxp0 up 182.Ed 183.Pp 184Create a master node in a two slot TDMA BSS configured to use 1852.5 millisecond slots. 186.Bd -literal -offset indent 187ifconfig wlan0 create wlandev ath0 wlanmode tdma \e 188 ssid tdma-test tmdaslot 0 tdmaslotlen 2500 \e 189 channel 36 up 190.Ed 191.Sh DIAGNOSTICS 192.Bl -diag 193.It "ath%d: unable to attach hardware; HAL status %u" 194The Atheros Hardware Access Layer was unable to configure the hardware 195as requested. 196The status code is explained in the HAL include file 197.Pa sys/dev/ath/ath_hal/ah.h . 198.It "ath%d: failed to allocate descriptors: %d" 199The driver was unable to allocate contiguous memory for the transmit 200and receive descriptors. 201This usually indicates system memory is scarce and/or fragmented. 202.It "ath%d: unable to setup a data xmit queue!" 203The request to the HAL to set up the transmit queue for normal 204data frames failed. 205This should not happen. 206.It "ath%d: unable to setup a beacon xmit queue!" 207The request to the HAL to set up the transmit queue for 802.11 beacon frames 208failed. 209This should not happen. 210.It "ath%d: 802.11 address: %s" 211The MAC address programmed in the EEPROM is displayed. 212.It "ath%d: hardware error; resetting" 213An unrecoverable error in the hardware occurred. 214Errors of this sort include unrecoverable DMA errors. 215The driver will reset the hardware and continue. 216.It "ath%d: rx FIFO overrun; resetting" 217The receive FIFO in the hardware overflowed before the data could be 218transferred to the host. 219This typically occurs because the hardware ran short of receive 220descriptors and had no place to transfer received data. 221The driver will reset the hardware and continue. 222.It "ath%d: unable to reset hardware; hal status %u" 223The Atheros Hardware Access Layer was unable to reset the hardware 224as requested. 225The status code is explained in the HAL include file 226.Pa sys/dev/ath/ath_hal/ah.h . 227This should not happen. 228.It "ath%d: unable to start recv logic" 229The driver was unable to restart frame reception. 230This should not happen. 231.It "ath%d: device timeout" 232A frame dispatched to the hardware for transmission did not complete in time. 233The driver will reset the hardware and continue. 234This should not happen. 235.It "ath%d: bogus xmit rate 0x%x" 236An invalid transmit rate was specified for an outgoing frame. 237The frame is discarded. 238This should not happen. 239.It "ath%d: ath_chan_set: unable to reset channel %u (%u MHz)" 240The Atheros Hardware Access Layer was unable to reset the hardware 241when switching channels during scanning. 242This should not happen. 243.It "ath%d: failed to enable memory mapping" 244The driver was unable to enable memory-mapped I/O to the PCI device registers. 245This should not happen. 246.It "ath%d: failed to enable bus mastering" 247The driver was unable to enable the device as a PCI bus master for doing DMA. 248This should not happen. 249.It "ath%d: cannot map register space" 250The driver was unable to map the device registers into the host address space. 251This should not happen. 252.It "ath%d: could not map interrupt" 253The driver was unable to allocate an IRQ for the device interrupt. 254This should not happen. 255.It "ath%d: could not establish interrupt" 256The driver was unable to install the device interrupt handler. 257This should not happen. 258.El 259.Sh SEE ALSO 260.Xr ath_hal 4 , 261.Xr cardbus 4 , 262.Xr intro 4 , 263.Xr pcic 4 , 264.Xr wlan 4 , 265.Xr wlan_ccmp 4 , 266.Xr wlan_tkip 4 , 267.Xr wlan_wep 4 , 268.Xr wlan_xauth 4 , 269.Xr hostapd 8 , 270.Xr ifconfig 8 , 271.Xr wpa_supplicant 8 272.Sh HISTORY 273The 274.Nm 275device driver first appeared in 276.Fx 5.2 . 277.Sh CAVEATS 278Revision A1 of the D-LINK DWL-G520 and DWL-G650 are based on an 279Intersil PrismGT chip and are not supported by this driver. 280.Sh BUGS 281The driver does supports optional station mode power-save operation. 282.Pp 283The AR5210 can only do WEP in hardware; consequently hardware assisted WEP 284is disabled in order to allow software implementations of TKIP and CCMP to 285function. 286Hardware WEP can be re-enabled by modifying the driver. 287