1*565a3eb6Sjmc.\" $OpenBSD: athn.4,v 1.43 2022/01/05 17:39:24 jmc Exp $ 2498e8a28Sdamien.\" 3498e8a28Sdamien.\" Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>. 4498e8a28Sdamien.\" 5498e8a28Sdamien.\" Permission to use, copy, modify, and distribute this software for any 6498e8a28Sdamien.\" purpose with or without fee is hereby granted, provided that the above 7498e8a28Sdamien.\" copyright notice and this permission notice appear in all copies. 8498e8a28Sdamien.\" 9498e8a28Sdamien.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10498e8a28Sdamien.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11498e8a28Sdamien.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12498e8a28Sdamien.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13498e8a28Sdamien.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14498e8a28Sdamien.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15498e8a28Sdamien.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16498e8a28Sdamien.\" 17*565a3eb6Sjmc.Dd $Mdocdate: January 5 2022 $ 18498e8a28Sdamien.Dt ATHN 4 19c0fdb081Sjmc.Os 20498e8a28Sdamien.Sh NAME 21498e8a28Sdamien.Nm athn 22f2c600dcSsthen.Nd Atheros IEEE 802.11a/b/g/n wireless network device 23498e8a28Sdamien.Sh SYNOPSIS 24498e8a28Sdamien.Cd "athn* at cardbus?" 25498e8a28Sdamien.Cd "athn* at pci?" 2613236e8dSdamien.Cd "athn* at uhub? port ?" 27498e8a28Sdamien.Sh DESCRIPTION 28498e8a28SdamienThe 29498e8a28Sdamien.Nm 30498e8a28Sdamiendriver provides support for a wide variety of 31a7f88d8dSjmcAtheros 802.11n devices, ranging from the AR5008 up to the AR9287. 32498e8a28Sdamien.Pp 33498e8a28SdamienThe AR5008 (codenamed Owl) is the first generation of 34a7f88d8dSjmcAtheros 802.11n solutions. 35498e8a28SdamienIt consists of two chips, a MAC/Baseband Processor and a Radio-on-a-Chip. 36498e8a28SdamienThe MAC/Baseband Processor can be an AR5416 (PCI and CardBus form factors) 37498e8a28Sdamienor an AR5418 (PCIe Mini Card form factor). 38498e8a28SdamienThe radio can be an AR2122, AR2133, AR5122 or an AR5133 chip. 39498e8a28SdamienThe AR2122 chip operates in the 2GHz spectrum and supports up to 2 40498e8a28Sdamientransmit paths and 2 receiver paths (2T2R). 41498e8a28SdamienThe AR2133 chip operates in the 2GHz spectrum and supports up to 3 42498e8a28Sdamientransmit paths and 3 receiver paths (3T3R). 43498e8a28SdamienThe AR5122 chip operates in the 2GHz and 5GHz spectra and supports 44498e8a28Sdamienup to 2 transmit paths and 2 receiver paths (2T2R). 45498e8a28SdamienThe AR5133 chip operates in the 2GHz and 5GHz spectra and supports 46498e8a28Sdamienup to 3 transmit paths and 3 receiver paths (3T3R). 47498e8a28Sdamien.Pp 48498e8a28SdamienThe AR9001 (codenamed Sowl) is a Mini-PCI 802.11n solution. 49498e8a28SdamienIt consists of two chips, an AR9160 MAC/Baseband Processor and an 50498e8a28SdamienAR9103 or AR9106 Radio-on-a-Chip. 51498e8a28SdamienThe AR9103 chip operates in the 2GHz spectrum and supports up to 3 52498e8a28Sdamientransmit paths and 3 receiver paths (3T3R). 53498e8a28SdamienThe AR9106 chip operates in the 2GHz and 5GHz spectra and supports 54498e8a28Sdamienup to 3 transmit paths and 3 receiver paths (3T3R). 55498e8a28Sdamien.Pp 56498e8a28SdamienThe AR9220, AR9223 and AR9280 (codenamed Merlin) are the 57498e8a28Sdamienfirst generation of 58a7f88d8dSjmcAtheros single-chip 802.11n solutions. 59498e8a28SdamienThe AR9220 and AR9223 exist in PCI and Mini-PCI form factors. 6075aab460SjmcThe AR9280 exists in PCIe (DT92), PCIe Mini Card (XB92), 6175aab460Sjmchalf Mini Card (HB92) and USB 2.0 (AR9280+AR7010) form factors. 62498e8a28SdamienThe AR9220 and AR9280 operate in the 2GHz and 5GHz spectra and 63498e8a28Sdamiensupport 2 transmit paths and 2 receiver paths (2T2R). 64498e8a28SdamienThe AR9223 operates in the 2GHz spectrum and supports 2 65498e8a28Sdamientransmit paths and 2 receiver paths (2T2R). 66498e8a28Sdamien.Pp 67498e8a28SdamienThe AR9281 is a single-chip PCIe 802.11n solution. 68498e8a28SdamienIt exists in PCIe Mini Card (XB91) and half Mini Card (HB91) form 69498e8a28Sdamienfactors. 70498e8a28SdamienIt operates in the 2GHz spectrum and supports 1 transmit path and 71498e8a28Sdamien2 receiver paths (1T2R). 72498e8a28Sdamien.Pp 73498e8a28SdamienThe AR9285 (codenamed Kite) is a single-chip PCIe 802.11n solution that 74498e8a28Sdamientargets the value PC market. 75498e8a28SdamienIt exists in PCIe half Mini Card (HB95) form factor only. 76498e8a28SdamienIt operates in the 2GHz spectrum and supports a single stream (1T1R). 77498e8a28SdamienIt can be combined with the AR3011 chip to form a combo WiFi/Bluetooth 78498e8a28Sdamiendevice (WB195). 79498e8a28Sdamien.Pp 8013236e8dSdamienThe AR9271 is a single-chip USB 2.0 802.11n solution. 8113236e8dSdamienIt operates in the 2GHz spectrum and supports a single stream (1T1R). 8213236e8dSdamien.Pp 83d54d1cc0SdamienThe AR2427 is a single-chip PCIe 802.11b/g solution similar to the other 84d54d1cc0SdamienAR9280 solutions but with 802.11n capabilities removed. 85d54d1cc0SdamienIt exists in PCIe Mini Card form factor only. 86d54d1cc0SdamienIt operates in the 2GHz spectrum. 87d54d1cc0Sdamien.Pp 88498e8a28SdamienThe AR9227 and AR9287 are single-chip 802.11n solutions that 89498e8a28Sdamientarget mid-tier PCs. 90498e8a28SdamienThe AR9227 exists in PCI and Mini-PCI form factors. 9113236e8dSdamienThe AR9287 exists in PCIe half Mini Card (HB97) 9213236e8dSdamienand USB 2.0 (AR9287+AR7010) form factors. 93498e8a28SdamienThey operate in the 2GHz spectrum and support 2 transmit paths and 2 94498e8a28Sdamienreceiver paths (2T2R). 95498e8a28Sdamien.Pp 96498e8a28SdamienThe following table summarizes the supported chips and their capabilities. 97e324319bSjmc.Bl -column "AR9001-3NX2 (AR9160+AR9106)" "2GHz/5GHz" "3x3:3" "PCI/CardBus" -offset 6n 98e324319bSjmc.It Em Chipset Ta Em Spectrum Ta Em TxR:S Ta Em Bus 99e324319bSjmc.It "AR5008-2NG (AR5416+AR2122)" Ta 2GHz Ta 2x2:2 Ta PCI/CardBus 100e324319bSjmc.It "AR5008-3NG (AR5416+AR2133)" Ta 2GHz Ta 3x3:2 Ta PCI/CardBus 101e324319bSjmc.It "AR5008-2NX (AR5416+AR5122)" Ta 2GHz/5GHz Ta 2x2:2 Ta PCI/CardBus 102e324319bSjmc.It "AR5008-3NX (AR5416+AR5133)" Ta 2GHz/5GHz Ta 3x3:2 Ta PCI/CardBus 103e324319bSjmc.It "AR5008E-2NG (AR5418+AR2122)" Ta 2GHz Ta 2x2:2 Ta PCIe 104e324319bSjmc.It "AR5008E-3NG (AR5418+AR2133)" Ta 2GHz Ta 3x3:2 Ta PCIe 105e324319bSjmc.It "AR5008E-2NX (AR5418+AR5122)" Ta 2GHz/5GHz Ta 2x2:2 Ta PCIe 106e324319bSjmc.It "AR5008E-3NX (AR5418+AR5133)" Ta 2GHz/5GHz Ta 3x3:2 Ta PCIe 107e324319bSjmc.It "AR9001-2NG (AR9160+AR9103)" Ta 2GHz Ta 2x2:2 Ta PCI 108e324319bSjmc.It "AR9001-3NG (AR9160+AR9103)" Ta 2GHz Ta 3x3:2 Ta PCI 109e324319bSjmc.It "AR9001-3NX2 (AR9160+AR9106)" Ta 2GHz/5GHz Ta 3x3:2 Ta PCI 110e324319bSjmc.It "AR9220" Ta 2GHz/5GHz Ta 2x2:2 Ta PCI 111e324319bSjmc.It "AR9223" Ta 2GHz Ta 2x2:2 Ta PCI 112e324319bSjmc.It "AR9280" Ta 2GHz/5GHz Ta 2x2:2 Ta PCIe 113e324319bSjmc.It "AR9280+AR7010" Ta 2GHz/5GHz Ta 2x2:2 Ta USB 2.0 114e324319bSjmc.It "AR9281" Ta 2GHz Ta 1x2:2 Ta PCIe 115e324319bSjmc.It "AR9285" Ta 2GHz Ta 1x1:1 Ta PCIe 116e324319bSjmc.It "AR9271" Ta 2GHz Ta 1x1:1 Ta USB 2.0 117e324319bSjmc.It "AR2427" Ta 2GHz Ta 1x1:1 Ta PCIe 118e324319bSjmc.It "AR9227" Ta 2GHz Ta 2x2:2 Ta PCI 119e324319bSjmc.It "AR9287" Ta 2GHz Ta 2x2:2 Ta PCIe 120e324319bSjmc.It "AR9287+AR7010" Ta 2GHz Ta 2x2:2 Ta USB 2.0 121498e8a28Sdamien.El 122498e8a28Sdamien.Pp 123498e8a28SdamienThese are the modes the 124498e8a28Sdamien.Nm 125498e8a28Sdamiendriver can operate in: 126498e8a28Sdamien.Bl -tag -width "IBSS-masterXX" 127498e8a28Sdamien.It BSS mode 128498e8a28SdamienAlso known as 129498e8a28Sdamien.Em infrastructure 130498e8a28Sdamienmode, this is used when associating with an access point, through 131498e8a28Sdamienwhich all traffic passes. 132498e8a28SdamienThis mode is the default. 133823a1614Sdamien.It Host AP 134823a1614SdamienIn this mode the driver acts as an access point (base station) 135823a1614Sdamienfor other cards. 136498e8a28Sdamien.It monitor mode 137498e8a28SdamienIn this mode the driver is able to receive packets without 138498e8a28Sdamienassociating with an access point. 139498e8a28SdamienThis disables the internal receive filter and enables the card to 140498e8a28Sdamiencapture packets from networks which it wouldn't normally have access to, 141498e8a28Sdamienor to scan for access points. 142498e8a28Sdamien.El 143498e8a28Sdamien.Pp 144498e8a28SdamienThe 145498e8a28Sdamien.Nm 146498e8a28Sdamiendriver can be configured to use 147498e8a28SdamienWired Equivalent Privacy (WEP) or 14823b4b584SsthenWi-Fi Protected Access (WPA1 and WPA2). 14923b4b584SsthenWPA2 is the current encryption standard for wireless networks. 15023b4b584SsthenIt is strongly recommended that neither WEP nor WPA1 15123b4b584Ssthenare used as the sole mechanism to secure wireless communication, 15223b4b584Ssthendue to serious weaknesses. 15323b4b584SsthenWPA1 is disabled by default and may be enabled using the option 15423b4b584Ssthen.Qq Cm wpaprotos Ar wpa1,wpa2 . 15523b4b584SsthenFor standard WPA networks which use pre-shared keys (PSK), 15623b4b584Ssthenkeys are configured using the 15723b4b584Ssthen.Qq Cm wpakey 15823b4b584Ssthenoption. 15923b4b584SsthenWPA-Enterprise networks require use of the wpa_supplicant package. 160498e8a28SdamienThe 161498e8a28Sdamien.Nm 16248ad8d0eSstspdriver offloads both encryption and decryption to the hardware for the 16348ad8d0eSstspCCMP cipher. 164498e8a28Sdamien.Pp 165498e8a28SdamienThe transmit speed is user-selectable or can be adapted automatically by the 166498e8a28Sdamiendriver depending on the number of hardware transmission retries. 167416d9f2aSjmc.Pp 168416d9f2aSjmcIn BSS mode, 169416d9f2aSjmcthe driver supports powersave mode, 170416d9f2aSjmcwhich can be enabled via 171416d9f2aSjmc.Xr ifconfig 8 . 172416d9f2aSjmcIn Host AP mode, 1732ee2628eSstspthe driver is compatible with clients using powersave, except on AR7010 1742ee2628eSstspand AR9287 USB devices. 1756dc8205eSjmc.Pp 1766dc8205eSjmcThe 1776dc8205eSjmc.Nm 1786dc8205eSjmcdriver can be configured at runtime with 1796dc8205eSjmc.Xr ifconfig 8 1806dc8205eSjmcor on boot with 1816dc8205eSjmc.Xr hostname.if 5 . 18213236e8dSdamien.Sh FILES 183b86f193fSstspFor USB devices, the driver needs at least version 1.1p4 of the following 18413236e8dSdamienfirmware files, which are loaded when an interface is attached: 18513236e8dSdamien.Pp 18613236e8dSdamien.Bl -tag -width Ds -offset indent -compact 187b86f193fSstsp.It Pa /etc/firmware/athn-open-ar7010 188b86f193fSstsp.It Pa /etc/firmware/athn-open-ar9271 18913236e8dSdamien.El 19013236e8dSdamien.Pp 1911e06dbebSsthenA prepackaged version of the firmware can be installed using 192*565a3eb6Sjmc.Xr fw_update 8 . 193b86f193fSstspFirmware source code is available under a mix of BSD and GPLv2 licences. 194b86f193fSstspA port which cross-compiles the firmware can be found in 1955bb5f4aeSstsp.Pa /usr/ports/devel/open-ath9k-htc-firmware . 196498e8a28Sdamien.Sh EXAMPLES 197f0f562a5SjmcThe following example scans for available networks: 198f0f562a5Sjmc.Pp 199f0f562a5Sjmc.Dl # ifconfig athn0 scan 200f0f562a5Sjmc.Pp 201498e8a28SdamienThe following 202498e8a28Sdamien.Xr hostname.if 5 203f0f562a5Sjmcexample configures athn0 to join network 204f0f562a5Sjmc.Dq mynwid , 205f0f562a5Sjmcusing WPA key 206f0f562a5Sjmc.Dq mywpakey , 207f0f562a5Sjmcobtaining an IP address using DHCP: 208498e8a28Sdamien.Bd -literal -offset indent 20997be7480Sphesslernwid mynwid wpakey mywpakey 210b6ef1ff8Skninet autoconf 211498e8a28Sdamien.Ed 212498e8a28Sdamien.Pp 213823a1614SdamienThe following 214823a1614Sdamien.Xr hostname.if 5 215823a1614Sdamienexample creates a host-based access point on boot: 216823a1614Sdamien.Bd -literal -offset indent 217f0f562a5Sjmcmediaopt hostap 21897be7480Sphesslernwid mynwid wpakey mywpakey 21914989542Sstspinet 192.168.1.1 255.255.255.0 220a7f88d8dSjmc.Ed 221498e8a28Sdamien.Sh DIAGNOSTICS 222498e8a28Sdamien.Bl -diag 223b07071f0Stedu.It "athn0: device timeout" 224498e8a28SdamienA frame dispatched to the hardware for transmission did not complete in time. 225498e8a28SdamienThe driver will reset the hardware. 226498e8a28SdamienThis should not happen. 227b07071f0Stedu.It "athn0: radio is disabled by hardware switch" 228498e8a28SdamienThe radio transmitter is off and thus no packet can go out. 229498e8a28SdamienThe driver will reset the hardware. 230498e8a28SdamienMake sure the laptop radio switch is on. 231b07071f0Stedu.It "athn0: radio switch turned off" 232f7fff0bbSdamienThe radio switch has been turned off while the interface was up and running. 233f7fff0bbSdamienThe driver will turn the interface down. 234b07071f0Stedu.It "athn0: error N, could not read firmware ..." 23513236e8dSdamienFor some reason, the driver was unable to read the firmware file from the 23613236e8dSdamienfilesystem. 23713236e8dSdamienThe file might be missing or corrupted. 238498e8a28Sdamien.El 239498e8a28Sdamien.Sh SEE ALSO 240498e8a28Sdamien.Xr arp 4 , 241498e8a28Sdamien.Xr cardbus 4 , 242498e8a28Sdamien.Xr ifmedia 4 , 243498e8a28Sdamien.Xr intro 4 , 244498e8a28Sdamien.Xr netintro 4 , 245498e8a28Sdamien.Xr pci 4 , 24613236e8dSdamien.Xr usb 4 , 247498e8a28Sdamien.Xr hostname.if 5 , 248e37f152cSjmc.Xr ifconfig 8 249498e8a28Sdamien.Sh HISTORY 250498e8a28SdamienThe 251498e8a28Sdamien.Nm 252498e8a28Sdamiendriver first appeared in 253498e8a28Sdamien.Ox 4.7 . 25413236e8dSdamienSupport for USB 2.0 devices first appeared in 25513236e8dSdamien.Ox 4.9 . 256498e8a28Sdamien.Sh AUTHORS 257498e8a28SdamienThe 258498e8a28Sdamien.Nm 259498e8a28Sdamiendriver was written by 260c110737dSmillert.An Damien Bergamini Aq Mt damien.bergamini@free.fr 261498e8a28Sdamienbased on source code licensed under the ISC released in 2008 by 262a7f88d8dSjmcAtheros Communications for Linux. 263b86f193fSstsp.An Anthony J. Bentley Aq Mt bentley@openbsd.org 264b86f193fSstspadded the open source USB firmware and its cross-compiler to the ports tree. 265b86f193fSstsp.An Stefan Sperling Aq Mt stsp@openbsd.org 266b86f193fSstspimplemented driver support for the open source USB firmware. 267cb1e877eSdamien.Sh CAVEATS 2681c23896aSstspSupport for 802.11n 40MHz channels and Tx aggregation is not yet implemented. 269cb1e877eSdamienAdditional work is required in 270cb1e877eSdamien.Xr ieee80211 9 271cb1e877eSdamienbefore those features can be supported. 272b86f193fSstsp.Pp 2732ee2628eSstspOn USB devices, Host AP mode is limited to 7 concurrent clients and does 2742ee2628eSstspnot support power saving. 2752ee2628eSstspClients attempting to use power saving mode may experience significant 2762ee2628eSstsppacket loss. 277