1cf8faa80SSam Leffler.\"- 26fd63a5dSSam Leffler.\" Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3cf8faa80SSam Leffler.\" All rights reserved. 4cf8faa80SSam Leffler.\"" 5cf8faa80SSam Leffler.\" Redistribution and use in source and binary forms, with or without 6cf8faa80SSam Leffler.\" modification, are permitted provided that the following conditions 7cf8faa80SSam Leffler.\" are met: 8cf8faa80SSam Leffler.\" 1. Redistributions of source code must retain the above copyright 9cf8faa80SSam Leffler.\" notice, this list of conditions and the following disclaimer, 10cf8faa80SSam Leffler.\" without modification. 11cf8faa80SSam Leffler.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer 12cf8faa80SSam Leffler.\" similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any 13cf8faa80SSam Leffler.\" redistribution must be conditioned upon including a substantially 14cf8faa80SSam Leffler.\" similar Disclaimer requirement for further binary redistribution. 15cf8faa80SSam Leffler.\" 16cf8faa80SSam Leffler.\" NO WARRANTY 17cf8faa80SSam Leffler.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18cf8faa80SSam Leffler.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19cf8faa80SSam Leffler.\" LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY 20cf8faa80SSam Leffler.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 21cf8faa80SSam Leffler.\" THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, 22cf8faa80SSam Leffler.\" OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23cf8faa80SSam Leffler.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24cf8faa80SSam Leffler.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25cf8faa80SSam Leffler.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26cf8faa80SSam Leffler.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27cf8faa80SSam Leffler.\" THE POSSIBILITY OF SUCH DAMAGES. 28cf8faa80SSam Leffler.\" 29cf8faa80SSam Leffler.\" $FreeBSD$ 30cf8faa80SSam Leffler.\"/ 318348113cSChristian Brueffer.Dd August 28, 2011 32cf8faa80SSam Leffler.Dt ATH 4 33cf8faa80SSam Leffler.Os 34cf8faa80SSam Leffler.Sh NAME 35cf8faa80SSam Leffler.Nm ath 363c9bf41dSChristian Brueffer.Nd "Atheros IEEE 802.11 wireless network driver" 37cf8faa80SSam Leffler.Sh SYNOPSIS 3816d78bb8STom RhodesTo compile this driver into the kernel, 3916d78bb8STom Rhodesplace the following lines in your 4090296834STom Rhodeskernel configuration file: 4186e3186eSTom Rhodes.Bd -ragged -offset indent 42cf8faa80SSam Leffler.Cd "device ath" 43e849bb3eSAdrian Chadd.Cd "device ath_pci" 4410626faeSHiten Pandya.Cd "device ath_hal" 456fd63a5dSSam Leffler.Cd "options AH_SUPPORT_AR5416" 46aa2fce50SSam Leffler.Cd "device ath_rate_sample" 4710626faeSHiten Pandya.Cd "device wlan" 4886e3186eSTom Rhodes.Ed 4986e3186eSTom Rhodes.Pp 5016d78bb8STom RhodesAlternatively, to load the driver as a 5116d78bb8STom Rhodesmodule at boot time, place the following line in 5286e3186eSTom Rhodes.Xr loader.conf 5 : 5386e3186eSTom Rhodes.Bd -literal -offset indent 5486e3186eSTom Rhodesif_ath_load="YES" 55e849bb3eSAdrian Chaddif_ath_pci_load="YES" 5686e3186eSTom Rhodes.Ed 57cf8faa80SSam Leffler.Sh DESCRIPTION 58cf8faa80SSam LefflerThe 59cf8faa80SSam Leffler.Nm 60cf8faa80SSam Lefflerdriver provides support for wireless network adapters based on 616fd63a5dSSam Lefflerthe Atheros AR5210, AR5211, AR5212, and AR5416 programming APIs. 62b032f27cSSam LefflerThese APIs are used by a wide variety of chips; most all chips with 63aa2fce50SSam Lefflera PCI and/or CardBus interface are supported. 64cf8faa80SSam Leffler.Pp 65cf8faa80SSam LefflerSupported features include 802.11 and 802.3 frames, power management, BSS, 6659aa14a9SRui PauloIBSS, MBSS, TDMA, and host-based access point operation modes. 67cf8faa80SSam LefflerAll host/device interaction is via DMA. 68cf8faa80SSam Leffler.Pp 69e849bb3eSAdrian ChaddPlease note that from FreeBSD-9.0, the 70e849bb3eSAdrian Chadd.Nm 71e849bb3eSAdrian Chadddriver does not include the PCI/PCIe bus glue. 72e849bb3eSAdrian ChaddThe same driver supports multiple underlying bus types, including PCI/PCIe, 73e849bb3eSAdrian Chaddbut also embedded (AHB) and USB in the future. 74e849bb3eSAdrian Chadd.Pp 75e849bb3eSAdrian ChaddTo enable use for PCI/PCIe systems, see the 76e849bb3eSAdrian Chadd.Xr ath_pci 4 77e849bb3eSAdrian Chadddriver. 78e849bb3eSAdrian ChaddFor embedded systems which use the AHB to connect the wireless MAC, see the 79e849bb3eSAdrian Chadd.Xr ath_ahb 4 80e849bb3eSAdrian Chadddriver. 81e849bb3eSAdrian Chadd.Pp 82cf8faa80SSam LefflerThe 83cf8faa80SSam Leffler.Nm 84cf8faa80SSam Lefflerdriver encapsulates all IP and ARP traffic as 802.11 frames, however 85cf8faa80SSam Lefflerit can receive either 802.11 or 802.3 frames. 86cf8faa80SSam LefflerTransmit speed and operating mode is selectable 8791d89945SChristian Bruefferand depends on the specific chipset. 8859ddccc6SChristian BruefferAR5210-based devices support 802.11a operation with transmit speeds 89cf8faa80SSam Lefflerof 6 Mbps, 9 Mbps, 12 Mbps, 18 Mbps, 24 Mbps, 36 Mbps, 48 Mbps, and 54 Mbps. 90cf8faa80SSam LefflerAR5211-based devices support 802.11a and 802.11b operation with transmit 91cf8faa80SSam Lefflerspeeds as above for 802.11a operation and 92cf8faa80SSam Leffler1Mbps, 2Mbps, 5.5 Mbps and 11Mbps for 802.11b operation. 93cf8faa80SSam LefflerAR5212-based devices support 802.11a, 802.11b, and 802.11g operation 94cf8faa80SSam Lefflerwith transmit speeds appropriate to each. 956fd63a5dSSam LefflerAR5416-class devices are capable of 802.11n operation 966fd63a5dSSam Lefflerbut are supported only in legacy modes (802.11a, 11b, 11g). 97aa2fce50SSam LefflerMost chips also support an Atheros Turbo Mode (TM) that operates in 981748d1e5SGavin Atkinsonthe 5GHz frequency range with 2x the transmit speeds. 991748d1e5SGavin AtkinsonSome chips also support Turbo mode in the 2.4GHz range with 802.11g 100aa2fce50SSam Lefflerthough this support is not presently available due to regulatory requirements. 101aa2fce50SSam Leffler(Note that Turbo modes are, however, 102aa2fce50SSam Leffleronly interoperable with other Atheros-based devices.) 1036fd63a5dSSam LefflerAR5212-based devices also support half- (10MHz) and quarter-width (5MHz) channels. 104cf8faa80SSam LefflerThe actual transmit speed used is dependent on signal quality and the 105702d4fc4SRuslan Ermilov.Dq "rate control" 106702d4fc4SRuslan Ermilovalgorithm employed by the driver. 107cf8faa80SSam LefflerAll chips support WEP encryption. 1086fd63a5dSSam LefflerAR5212 and AR5416 parts have hardware support for the 1096fd63a5dSSam LefflerAES-CCM, TKIP, and Michael cryptographic 110014be7fbSSam Leffleroperations required for WPA. 111cf8faa80SSam LefflerTo enable encryption, use 112cf8faa80SSam Leffler.Xr ifconfig 8 113cf8faa80SSam Leffleras shown below. 114cf8faa80SSam Leffler.Pp 115b032f27cSSam LefflerThe driver supports 116b032f27cSSam Leffler.Cm station , 117b032f27cSSam Leffler.Cm adhoc , 118b032f27cSSam Leffler.Cm adhoc-demo , 119b032f27cSSam Leffler.Cm hostap , 12059aa14a9SRui Paulo.Cm mesh , 121b032f27cSSam Leffler.Cm wds , 122b032f27cSSam Lefflerand 123b032f27cSSam Leffler.Cm monitor 124b032f27cSSam Lefflermode operation. 125b032f27cSSam LefflerMultiple 126b032f27cSSam Leffler.Cm hostap 127b032f27cSSam Lefflervirtual interfaces may be configured for simultaneous 128b032f27cSSam Leffleruse on cards that use a 5212 part. 129b032f27cSSam LefflerWhen multiple interfaces are configured each may have a separate 130b032f27cSSam Lefflermac address that is formed by setting the U/L bits in the mac 131b032f27cSSam Leffleraddress assigned to the underlying device. 132b032f27cSSam LefflerAny number of 133b032f27cSSam Leffler.Cm wds 134b032f27cSSam Lefflervirtual interfaces may be configured together with 135b032f27cSSam Leffler.Cm hostap 136b032f27cSSam Lefflerinterfaces. 137b032f27cSSam LefflerMultiple 138b032f27cSSam Leffler.Cm station 139b032f27cSSam Lefflerinterfaces may be operated together with 140b032f27cSSam Leffler.Cm hostap 141b032f27cSSam Lefflerinterfaces to construct a wireless repeater device. 1426fd63a5dSSam LefflerThe driver also support 1436fd63a5dSSam Leffler.Cm tdma 1446fd63a5dSSam Leffleroperation when compiled with 1456fd63a5dSSam Leffler.Cd "options IEEE80211_SUPPORT_TDMA" 146930034efSSam Leffler(which also enables the required 802.11 support). 147cf8faa80SSam LefflerFor more information on configuring this device, see 148cf8faa80SSam Leffler.Xr ifconfig 8 . 149cf8faa80SSam Leffler.Pp 150cf8faa80SSam LefflerDevices supported by the 151cf8faa80SSam Leffler.Nm 152cf8faa80SSam Lefflerdriver come in either Cardbus or mini-PCI packages. 153cf8faa80SSam LefflerWireless cards in Cardbus slots may be inserted and ejected on the fly. 15471d4b49aSSimon L. B. Nielsen.Sh HARDWARE 155ab7350b7SGiorgos KeramidasThe 156ab7350b7SGiorgos Keramidas.Nm 157284699a7SSam Lefflerdriver supports all Atheros Cardbus and PCI cards, 158ab7350b7SGiorgos Keramidasexcept those that are based on the AR5005VL chipset. 159cf8faa80SSam Leffler.Sh EXAMPLES 160cf8faa80SSam LefflerJoin a specific BSS network with WEP encryption: 161cf8faa80SSam Leffler.Bd -literal -offset indent 162b032f27cSSam Lefflerifconfig wlan0 create wlandev ath0 163b032f27cSSam Lefflerifconfig wlan0 inet 192.168.0.20 netmask 0xffffff00 ssid my_net \e 164cf8faa80SSam Leffler wepmode on wepkey 0x8736639624 165cf8faa80SSam Leffler.Ed 166cf8faa80SSam Leffler.Pp 167cf8faa80SSam LefflerJoin/create an 802.11b IBSS network with network name 168cf8faa80SSam Leffler.Dq Li my_net : 169cf8faa80SSam Leffler.Bd -literal -offset indent 170b032f27cSSam Lefflerifconfig wlan0 create wlandev ath0 wlanmode adhoc 171b032f27cSSam Lefflerifconfig wlan0 inet 192.168.0.22 netmask 0xffffff00 ssid my_net \e 172b032f27cSSam Leffler mode 11b 173cf8faa80SSam Leffler.Ed 174cf8faa80SSam Leffler.Pp 175cf8faa80SSam LefflerCreate an 802.11g host-based access point: 176cf8faa80SSam Leffler.Bd -literal -offset indent 177b032f27cSSam Lefflerifconfig wlan0 create wlandev ath0 wlanmode hostap 178b032f27cSSam Lefflerifconfig wlan0 inet 192.168.0.10 netmask 0xffffff00 ssid my_ap \e 179b032f27cSSam Leffler mode 11g 180cf8faa80SSam Leffler.Ed 181cf8faa80SSam Leffler.Pp 18259aa14a9SRui PauloCreate an 802.11a mesh station: 18359aa14a9SRui Paulo.Bd -literal -offset indent 18459aa14a9SRui Pauloifconfig wlan0 create wlandev ath0 wlanmode mesh 18559aa14a9SRui Pauloifconfig wlan0 meshid my_mesh mode 11a inet 192.168.0.10/24 18659aa14a9SRui Paulo.Ed 18759aa14a9SRui Paulo.Pp 188b032f27cSSam LefflerCreate two virtual 802.11a host-based access points, one with 189*50d922a0SGlen BarberWEP enabled and one with no security, and bridge them to 190b032f27cSSam Lefflerthe fxp0 (wired) device: 191cf8faa80SSam Leffler.Bd -literal -offset indent 192b032f27cSSam Lefflerifconfig wlan0 create wlandev ath0 wlanmode hostap \e 193b032f27cSSam Leffler ssid paying-customers wepmode on wepkey 0x1234567890 \e 194b032f27cSSam Leffler mode 11a up 195b032f27cSSam Lefflerifconfig wlan1 create wlandev ath0 wlanmode hostap bssid \e 196b032f27cSSam Leffler ssid freeloaders up 197b032f27cSSam Lefflerifconfig bridge0 create addm wlan0 addm wlan1 addm fxp0 up 198cf8faa80SSam Leffler.Ed 1996fd63a5dSSam Leffler.Pp 2006fd63a5dSSam LefflerCreate a master node in a two slot TDMA BSS configured to use 2016fd63a5dSSam Leffler2.5 millisecond slots. 2026fd63a5dSSam Leffler.Bd -literal -offset indent 2036fd63a5dSSam Lefflerifconfig wlan0 create wlandev ath0 wlanmode tdma \e 2046fd63a5dSSam Leffler ssid tdma-test tmdaslot 0 tdmaslotlen 2500 \e 2056fd63a5dSSam Leffler channel 36 up 2066fd63a5dSSam Leffler.Ed 207cf8faa80SSam Leffler.Sh DIAGNOSTICS 208cf8faa80SSam Leffler.Bl -diag 209cf8faa80SSam Leffler.It "ath%d: unable to attach hardware; HAL status %u" 210cf8faa80SSam LefflerThe Atheros Hardware Access Layer was unable to configure the hardware 211cf8faa80SSam Leffleras requested. 212cf8faa80SSam LefflerThe status code is explained in the HAL include file 2136cbaa952SMaxim Konovalov.Pa sys/dev/ath/ath_hal/ah.h . 214cf8faa80SSam Leffler.It "ath%d: failed to allocate descriptors: %d" 215cf8faa80SSam LefflerThe driver was unable to allocate contiguous memory for the transmit 21659ddccc6SChristian Bruefferand receive descriptors. 217cf8faa80SSam LefflerThis usually indicates system memory is scarce and/or fragmented. 218cf8faa80SSam Leffler.It "ath%d: unable to setup a data xmit queue!" 219cf8faa80SSam LefflerThe request to the HAL to set up the transmit queue for normal 220cf8faa80SSam Lefflerdata frames failed. 221cf8faa80SSam LefflerThis should not happen. 222cf8faa80SSam Leffler.It "ath%d: unable to setup a beacon xmit queue!" 223cf8faa80SSam LefflerThe request to the HAL to set up the transmit queue for 802.11 beacon frames 224*50d922a0SGlen Barberfailed. 225cf8faa80SSam LefflerThis should not happen. 226cf8faa80SSam Leffler.It "ath%d: 802.11 address: %s" 227cf8faa80SSam LefflerThe MAC address programmed in the EEPROM is displayed. 228cf8faa80SSam Leffler.It "ath%d: hardware error; resetting" 229cf8faa80SSam LefflerAn unrecoverable error in the hardware occurred. 230cf8faa80SSam LefflerErrors of this sort include unrecoverable DMA errors. 231cf8faa80SSam LefflerThe driver will reset the hardware and continue. 232cf8faa80SSam Leffler.It "ath%d: rx FIFO overrun; resetting" 233cf8faa80SSam LefflerThe receive FIFO in the hardware overflowed before the data could be 234cf8faa80SSam Lefflertransferred to the host. 235cf8faa80SSam LefflerThis typically occurs because the hardware ran short of receive 236cf8faa80SSam Lefflerdescriptors and had no place to transfer received data. 237cf8faa80SSam LefflerThe driver will reset the hardware and continue. 238cf8faa80SSam Leffler.It "ath%d: unable to reset hardware; hal status %u" 239cf8faa80SSam LefflerThe Atheros Hardware Access Layer was unable to reset the hardware 240cf8faa80SSam Leffleras requested. 241cf8faa80SSam LefflerThe status code is explained in the HAL include file 2426cbaa952SMaxim Konovalov.Pa sys/dev/ath/ath_hal/ah.h . 243cf8faa80SSam LefflerThis should not happen. 244cf8faa80SSam Leffler.It "ath%d: unable to start recv logic" 245cf8faa80SSam LefflerThe driver was unable to restart frame reception. 246cf8faa80SSam LefflerThis should not happen. 247cf8faa80SSam Leffler.It "ath%d: device timeout" 248cf8faa80SSam LefflerA frame dispatched to the hardware for transmission did not complete in time. 249cf8faa80SSam LefflerThe driver will reset the hardware and continue. 250d562e82bSHideyuki KURASHINAThis should not happen. 251cf8faa80SSam Leffler.It "ath%d: bogus xmit rate 0x%x" 252cf8faa80SSam LefflerAn invalid transmit rate was specified for an outgoing frame. 253cf8faa80SSam LefflerThe frame is discarded. 254cf8faa80SSam LefflerThis should not happen. 25579649302SGavin Atkinson.It "ath%d: ath_chan_set: unable to reset channel %u (%u MHz)" 256cf8faa80SSam LefflerThe Atheros Hardware Access Layer was unable to reset the hardware 257cf8faa80SSam Lefflerwhen switching channels during scanning. 258cf8faa80SSam LefflerThis should not happen. 259cf8faa80SSam Leffler.It "ath%d: failed to enable memory mapping" 260cf8faa80SSam LefflerThe driver was unable to enable memory-mapped I/O to the PCI device registers. 261cf8faa80SSam LefflerThis should not happen. 262cf8faa80SSam Leffler.It "ath%d: failed to enable bus mastering" 263cf8faa80SSam LefflerThe driver was unable to enable the device as a PCI bus master for doing DMA. 264cf8faa80SSam LefflerThis should not happen. 265cf8faa80SSam Leffler.It "ath%d: cannot map register space" 266cf8faa80SSam LefflerThe driver was unable to map the device registers into the host address space. 267cf8faa80SSam LefflerThis should not happen. 268cf8faa80SSam Leffler.It "ath%d: could not map interrupt" 269cf8faa80SSam LefflerThe driver was unable to allocate an IRQ for the device interrupt. 270cf8faa80SSam LefflerThis should not happen. 271cf8faa80SSam Leffler.It "ath%d: could not establish interrupt" 272cf8faa80SSam LefflerThe driver was unable to install the device interrupt handler. 273cf8faa80SSam LefflerThis should not happen. 274cf8faa80SSam Leffler.El 275cf8faa80SSam Leffler.Sh SEE ALSO 276cf8faa80SSam Leffler.Xr ath_hal 4 , 277b032f27cSSam Leffler.Xr cardbus 4 , 278ca23ba6eSChristian Brueffer.Xr intro 4 , 279cf8faa80SSam Leffler.Xr pcic 4 , 280cf8faa80SSam Leffler.Xr wlan 4 , 281b032f27cSSam Leffler.Xr wlan_ccmp 4 , 282b032f27cSSam Leffler.Xr wlan_tkip 4 , 283b032f27cSSam Leffler.Xr wlan_wep 4 , 284b032f27cSSam Leffler.Xr wlan_xauth 4 , 285b032f27cSSam Leffler.Xr hostapd 8 , 286cf8faa80SSam Leffler.Xr ifconfig 8 , 287ca23ba6eSChristian Brueffer.Xr wpa_supplicant 8 288cf8faa80SSam Leffler.Sh HISTORY 289cf8faa80SSam LefflerThe 290cf8faa80SSam Leffler.Nm 291cf8faa80SSam Lefflerdevice driver first appeared in 292cf8faa80SSam Leffler.Fx 5.2 . 293cf8faa80SSam Leffler.Sh CAVEATS 294c6316a61SStefan EßerRevision A1 of the D-LINK DWL-G520 and DWL-G650 are based on an 295c6316a61SStefan EßerIntersil PrismGT chip and are not supported by this driver. 296cf8faa80SSam Leffler.Sh BUGS 297cf8faa80SSam LefflerThere is no software retransmit; only hardware retransmit is used. 298cf8faa80SSam Leffler.Pp 299b032f27cSSam LefflerThe driver does not fully enable power-save operation of the chip 300b032f27cSSam Lefflerin station mode; consequently power use is suboptimal (e.g. on a laptop). 301aa2fce50SSam Leffler.Pp 302aa2fce50SSam LefflerWPA is not supported for 5210 parts. 303