1.\" $OpenBSD: ath.4,v 1.54 2011/09/03 22:59:07 jmc Exp $ 2.\" $NetBSD: ath.4,v 1.5 2004/07/03 16:58:18 mycroft Exp $ 3.\" 4.\" Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting 5.\" All rights reserved. 6.\"" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer, 12.\" without modification. 13.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer 14.\" similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any 15.\" redistribution must be conditioned upon including a substantially 16.\" similar Disclaimer requirement for further binary redistribution. 17.\" 3. Neither the names of the above-listed copyright holders nor the names 18.\" of any contributors may be used to endorse or promote products derived 19.\" from this software without specific prior written permission. 20.\" 21.\" NO WARRANTY 22.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24.\" LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY 25.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 26.\" THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, 27.\" OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 29.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 30.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 31.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 32.\" THE POSSIBILITY OF SUCH DAMAGES. 33.\" 34.\" 35.\" Note: This man page was taken by Perry Metzger almost entirely 36.\" from the "ath" and "ath_hal" man pages in FreeBSD. I claim no 37.\" copyright because there was nearly no original work performed in 38.\" doing so. Maintainers should check the FreeBSD originals for 39.\" updates against the following two revisions and incorporate them 40.\" if needed: 41.\" 42.\" $FreeBSD: /repoman/r/ncvs/src/share/man/man4/ath.4,v 1.16 2004/02/18 08:30:08 maxim Exp $ 43.\" parts from $FreeBSD: /repoman/r/ncvs/src/share/man/man4/ath_hal.4,v 1.7 2004/01/07 20:49:51 blackend Exp $ 44.\" 45.Dd $Mdocdate: September 3 2011 $ 46.Dt ATH 4 47.Os 48.Sh NAME 49.Nm ath 50.Nd Atheros IEEE 802.11a/b/g wireless network device with GPIO 51.Sh SYNOPSIS 52.Cd "ath* at pci? dev ? function ?" 53.Cd "ath* at cardbus? dev ? function ?" 54.Cd "gpio* at ath?" 55.Sh DESCRIPTION 56The 57.Nm 58driver provides support for wireless network devices based on 59the Atheros AR5210, AR5211, and AR5212 chips. 60.Pp 61All host/device interaction is via DMA. 62The 63.Nm 64driver encapsulates all IP and ARP traffic as 802.11 frames, though 65it can receive either 802.11 or 802.3 frames. 66Transmit speed and operating mode is selectable and 67depends on the specific chipset. 68.Pp 69Support for the various devices is as follows: 70.Bl -tag -width "ARxxxx" 71.It AR5210 72These 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. 74.Pp 75.It AR5211 76These devices support 802.11a and 802.11b operation with 77transmit speeds as above for 802.11a and 781Mbps, 2Mbps, 5.5 Mbps, and 11Mbps for 802.11b operation. 79.Pp 80.It AR5212 81These devices support 802.11a, 802.11b, and 802.11g operation with 82transmit speeds as above for 802.11a, 802.11b, and 802.11g operation 83(802.11g speeds are the same as for 802.11a speeds). 84.El 85.Pp 86All chips also support an Atheros Turbo Mode (TM) that operates in the 87802.11a frequency range with 2x the transmit speeds. 88(This mode is, however, only interoperable with other Atheros-based devices.) 89.Pp 90The actual transmit speed used is dependent on signal quality and the 91.Dq rate control 92algorithm employed by the driver. 93.Pp 94These are the modes the 95.Nm 96driver can operate in: 97.Bl -tag -width "IBSS-masterXX" 98.It BSS mode 99Also known as 100.Em infrastructure 101mode, this is used when associating with an access point, through 102which all traffic passes. 103This mode is the default. 104.It IBSS mode 105Also known as 106.Em IEEE ad-hoc 107mode or 108.Em peer-to-peer 109mode. 110This is the standardized method of operating without an access point. 111Stations associate with a service set. 112However, actual connections between stations are peer-to-peer. 113.It Host AP 114In this mode the adapter acts as an access point (base station) 115for other cards. 116.It monitor mode 117In this mode the driver is able to receive packets without 118associating with an access point. 119This disables the internal receive filter and enables the card to 120capture packets from networks which it wouldn't normally have access to, 121or to scan for access points. 122.El 123.Pp 124The 125.Nm 126driver can be configured to use 127Wired Equivalent Privacy (WEP) or 128Wi-Fi Protected Access (WPA-PSK and WPA2-PSK). 129WPA is the de facto encryption standard for wireless networks. 130It is strongly recommended that WEP 131not be used as the sole mechanism 132to secure wireless communication, 133due to serious weaknesses in it. 134.Pp 135AR5211 and AR5212 support the AES, TKIP, and Michael cryptographic 136operations required for WPA in hardware but at this time the driver 137does not support them. 138.Pp 139The 140.Nm 141driver can be configured at runtime with 142.Xr ifconfig 8 143or on boot with 144.Xr hostname.if 5 . 145.Sh HARDWARE 146Devices supported by the 147.Nm 148driver come in either CardBus or Mini PCI packages. 149Wireless cards in CardBus slots may be inserted and ejected on the fly. 150.Pp 151The following cards are among those supported by the 152.Nm 153driver: 154.Bl -column "Proxim Skyline 4030" "AR5212" "Mini PCI" "Standard" -offset 6n 155.It Em Card Ta Em Chip Ta Em Bus Ta Em Standard 156.It "3Com 3CRPAG175" Ta AR5212 Ta CardBus Ta a/b/g 157.\"It "Aztech WL830PC" Ta AR5212 Ta CardBus Ta b/g 158.It "Cisco AIR-CB21AG" Ta AR5212 Ta CardBus Ta a/b/g 159.It "D-Link DWL-A650" Ta AR5210 Ta CardBus Ta a 160.It "D-Link DWL-AB650" Ta AR5211 Ta CardBus Ta a/b 161.It "D-Link DWL-A520" Ta AR5210 Ta PCI Ta a 162.\"It "D-Link DWL-AG520" Ta AR5212 Ta PCI Ta a/b/g 163.\"It "D-Link DWL-AG650" Ta AR5212 Ta CardBus Ta a/b/g 164.\"It "D-Link DWL-G520" Ta AR5212 Ta PCI Ta b/g 165.\"It "D-Link DWL-G650B" Ta AR5212 Ta CardBus Ta b/g 166.\"It "Elecom LD-WL54AG" Ta AR5212 Ta CardBus Ta a/b/g 167.It "Elecom LD-WL54" Ta AR5211 Ta CardBus Ta a 168.\"It "Fujitsu E5454" Ta AR5212 Ta CardBus Ta a/b/g 169.\"It "Fujitsu FMV-JW481" Ta AR5212 Ta CardBus Ta a/b/g 170.\"It "Fujitsu E5454" Ta AR5212 Ta CardBus Ta a/b/g 171.\"It "HP NC4000" Ta AR5212 Ta PCI Ta a/b/g 172.It "IBM 11ABG WL LAN" Ta AR5212 Ta Mini PCI Ta a/b/g 173.\"It "I/O Data WN-AB" Ta AR5212 Ta CardBus Ta a/b 174.\"It "I/O Data WN-AG" Ta AR5212 Ta CardBus Ta a/b/g 175.\"It "I/O Data WN-A54" Ta AR5212 Ta CardBus Ta a 176.\"It "Linksys WMP55AG" Ta AR5212 Ta PCI Ta a/b/g 177.It "Linksys WPC51AB" Ta AR5211 Ta CardBus Ta a/b 178.\"It "Linksys WPC55AG" Ta AR5212 Ta CardBus Ta a/b/g 179.\"It "NEC PA-WL/54AG" Ta AR5212 Ta CardBus Ta a/b/g 180.\"It "Netgear WAG311" Ta AR5212 Ta PCI Ta a/b/g 181.It "Netgear WAB501" Ta AR5211 Ta CardBus Ta a/b 182.\"It "Netgear WAG511" Ta AR5212 Ta CardBus Ta a/b/g 183.\"It "Netgear WG311 rev1" Ta AR5212 Ta PCI Ta b/g 184.\"It "Netgear WG511T" Ta AR5212 Ta CardBus Ta b/g 185.\"It "Orinoco 8480" Ta AR5212 Ta CardBus Ta a/b/g 186.\"It "Orinoco 8470WD" Ta AR5212 Ta CardBus Ta a/b/g 187.It "Planet WL-3560" Ta AR5211 Ta CardBus Ta a/b/g 188.It "Proxim Skyline 4030" Ta AR5210 Ta CardBus Ta a 189.It "Proxim Skyline 4032" Ta AR5210 Ta PCI Ta a 190.\"It "Samsung SWL-5200N" Ta AR5212 Ta CardBus Ta a/b/g 191.It "Senao NL-5354MP" Ta AR5212 Ta Mini PCI Ta a/b/g 192.It "SMC SMC2735W" Ta AR5210 Ta CardBus Ta a 193.\"It "Sony PCWA-C700" Ta AR5212 Ta CardBus Ta a/b 194.\"It "Sony PCWA-C300S" Ta AR5212 Ta CardBus Ta b/g 195.It "Sony PCWA-C500" Ta AR5210 Ta CardBus Ta a 196.It "Wistron CM9" Ta AR5212 Ta Mini PCI Ta a/b/g 197.El 198.Sh EXAMPLES 199The following 200.Xr hostname.if 5 201example configures ath0 to join whatever network is available on boot, 202using WEP key 203.Dq 0x1deadbeef1 , 204channel 11, obtaining an IP address using DHCP: 205.Bd -literal -offset indent 206dhcp NONE NONE NONE nwkey 0x1deadbeef1 chan 11 207.Ed 208.Pp 209The following 210.Xr hostname.if 5 211example creates a host-based access point on boot: 212.Bd -literal -offset indent 213inet 192.168.1.1 255.255.255.0 NONE media autoselect \e 214 mediaopt hostap nwid my_net chan 11 215.Ed 216.Pp 217Configure ath0 to join network 218.Dq my_net 219using WPA with passphrase 220.Dq my_passphrase : 221.Bd -literal -offset indent 222# ifconfig ath0 nwid my_net wpakey my_passphrase 223.Ed 224.Pp 225Join an existing BSS network, 226.Dq my_net : 227.Bd -literal -offset indent 228# ifconfig ath0 192.168.1.1 netmask 0xffffff00 nwid my_net 229.Ed 230.Sh DIAGNOSTICS 231.Bl -diag 232.It "ath%d: unable to attach hardware; HAL status %u" 233The Hardware Access Layer was unable to configure the hardware 234as requested. 235The status code is explained in the HAL include file 236.Pa sys/dev/ic/ar5xxx.h . 237.It "ath%d: failed to allocate descriptors: %d" 238The driver was unable to allocate contiguous memory for the transmit 239and receive descriptors. 240This usually indicates system memory is scarce and/or fragmented. 241.It "ath%d: unable to setup a data xmit queue!" 242The request to the HAL to set up the transmit queue for normal 243data frames failed. 244This should not happen. 245.It "ath%d: unable to setup a beacon xmit queue!" 246The request to the HAL to set up the transmit queue for 802.11 beacon frames 247failed. 248This should not happen. 249.It "ath%d: hardware error; resetting" 250An unrecoverable error in the hardware occurred. 251Errors of this sort include unrecoverable DMA errors. 252The driver will reset the hardware and continue. 253.It "ath%d: rx FIFO overrun; resetting" 254The receive FIFO in the hardware overflowed before the data could be 255transferred to the host. 256This typically occurs because the hardware ran short of receive 257descriptors and had no place to transfer received data. 258The driver will reset the hardware and continue. 259.It "ath%d: unable to reset hardware; hal status %u" 260The Hardware Access Layer was unable to reset the hardware 261as requested. 262The status code is explained in the HAL include file 263.Pa /sys/dev/ic/ar5xxx.h . 264This should not happen. 265.It "ath%d: unable to initialize the key cache" 266The driver was unable to initialize the hardware key cache. 267This should not happen. 268.It "ath%d: unable to start recv logic" 269The driver was unable to restart frame reception. 270This should not happen. 271.It "ath%d: device timeout" 272A frame dispatched to the hardware for transmission did not complete in time. 273The driver will reset the hardware and continue. 274This should not happen. 275.It "ath%d: bogus xmit rate 0x%x" 276An invalid transmit rate was specified for an outgoing frame. 277The frame is discarded. 278This should not happen. 279.It "ath%d: ath_chan_set: unable to reset channel %u (%u MHz)" 280The Hardware Access Layer was unable to reset the hardware 281when switching channels during scanning. 282This should not happen. 283.It "ath%d: unable to allocate channel table" 284The driver was unable to allocate memory for the table used to hold 285the set of available channels. 286.It "ath%d: unable to collect channel list from hal" 287A problem occurred while querying the HAL to find the set of available 288channels for the device. 289This should not happen. 290.It "ath%d: failed to enable memory mapping" 291The driver was unable to enable memory-mapped I/O to the PCI device registers. 292This should not happen. 293.It "ath%d: failed to enable bus mastering" 294The driver was unable to enable the device as a PCI bus master for doing DMA. 295This should not happen. 296.It "ath%d: cannot map register space" 297The driver was unable to map the device registers into the host address space. 298This should not happen. 299.It "ath%d: could not map interrupt" 300The driver was unable to allocate an IRQ for the device interrupt. 301This should not happen. 302.It "ath%d: could not establish interrupt" 303The driver was unable to install the device interrupt handler. 304This should not happen. 305.El 306.Sh SEE ALSO 307.Xr arp 4 , 308.Xr cardbus 4 , 309.Xr gpio 4 , 310.Xr ifmedia 4 , 311.Xr intro 4 , 312.Xr netintro 4 , 313.Xr pci 4 , 314.Xr hostname.if 5 , 315.Xr gpioctl 8 , 316.Xr hostapd 8 , 317.Xr ifconfig 8 318.Sh HISTORY 319The 320.Nm 321device driver first appeared in 322.Fx 5.2 323using a binary-only HAL module which was ported to 324.Nx 2.0 . 325The driver using a free HAL-replacement first appeared in 326.Ox 3.7 . 327.Sh AUTHORS 328.An -nosplit 329The 330.Nm 331driver was written by 332.An Sam Leffler , 333and was ported to 334.Ox 335by 336.An Reyk Floeter Aq reyk@openbsd.org 337who also wrote a free replacement of the binary-only HAL. 338.Sh CAVEATS 339Different regulatory domains may not be able to communicate with each 340other with 802.11a as different regulatory domains do not necessarily 341have overlapping channels. 342.Pp 343Host AP mode doesn't support power saving. 344Clients attempting to use power saving mode may experience significant 345packet loss (disabling power saving on the client will fix this). 346.Sh BUGS 347Performance in lossy environments is suboptimal. 348The algorithm used to select the rate for transmitted packets is 349very simplistic. 350There is no software retransmit; only hardware retransmit is used. 351Contributors are encouraged to replace the existing rate control algorithm 352with a better one. 353.Pp 354The driver does not fully enable power-save operation of the chip; 355consequently power use is suboptimal. 356