2 * Copyright (c) 2004-2008 Reyk Floeter <reyk@openbsd.org>
3 * Copyright (c) 2006-2008 Nick Kossifidis <mickflemm@gmail.com>
4 * Copyright (c) 2007-2008 Jiri Slaby <jirislaby@gmail.com>
6 * Lightly modified for gPXE, July 2009, by Joshua Oreman <oremanj@rwcr.net>.
8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies.
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
33 * Fill the capabilities struct
34 * TODO: Merge this with EEPROM code when we are done with it
36 int ath5k_hw_set_capabilities(struct ath5k_hw
*ah
)
40 /* Capabilities stored in the EEPROM */
41 ee_header
= ah
->ah_capabilities
.cap_eeprom
.ee_header
;
43 if (ah
->ah_version
== AR5K_AR5210
) {
45 * Set radio capabilities
46 * (The AR5110 only supports the middle 5GHz band)
48 ah
->ah_capabilities
.cap_range
.range_5ghz_min
= 5120;
49 ah
->ah_capabilities
.cap_range
.range_5ghz_max
= 5430;
50 ah
->ah_capabilities
.cap_range
.range_2ghz_min
= 0;
51 ah
->ah_capabilities
.cap_range
.range_2ghz_max
= 0;
53 /* Set supported modes */
54 ah
->ah_capabilities
.cap_mode
|= AR5K_MODE_BIT_11A
;
55 ah
->ah_capabilities
.cap_mode
|= AR5K_MODE_BIT_11A_TURBO
;
58 * XXX The tranceiver supports frequencies from 4920 to 6100GHz
59 * XXX and from 2312 to 2732GHz. There are problems with the
60 * XXX current ieee80211 implementation because the IEEE
61 * XXX channel mapping does not support negative channel
62 * XXX numbers (2312MHz is channel -19). Of course, this
63 * XXX doesn't matter because these channels are out of range
64 * XXX but some regulation domains like MKK (Japan) will
65 * XXX support frequencies somewhere around 4.8GHz.
69 * Set radio capabilities
72 if (AR5K_EEPROM_HDR_11A(ee_header
)) {
74 ah
->ah_capabilities
.cap_range
.range_5ghz_min
= 5005;
75 ah
->ah_capabilities
.cap_range
.range_5ghz_max
= 6100;
77 /* Set supported modes */
78 ah
->ah_capabilities
.cap_mode
|= AR5K_MODE_BIT_11A
;
79 ah
->ah_capabilities
.cap_mode
|= AR5K_MODE_BIT_11A_TURBO
;
80 if (ah
->ah_version
== AR5K_AR5212
)
81 ah
->ah_capabilities
.cap_mode
|=
82 AR5K_MODE_BIT_11G_TURBO
;
85 /* Enable 802.11b if a 2GHz capable radio (2111/5112) is
87 if (AR5K_EEPROM_HDR_11B(ee_header
) ||
88 (AR5K_EEPROM_HDR_11G(ee_header
) &&
89 ah
->ah_version
!= AR5K_AR5211
)) {
91 ah
->ah_capabilities
.cap_range
.range_2ghz_min
= 2412;
92 ah
->ah_capabilities
.cap_range
.range_2ghz_max
= 2732;
94 if (AR5K_EEPROM_HDR_11B(ee_header
))
95 ah
->ah_capabilities
.cap_mode
|=
98 if (AR5K_EEPROM_HDR_11G(ee_header
) &&
99 ah
->ah_version
!= AR5K_AR5211
)
100 ah
->ah_capabilities
.cap_mode
|=
106 ah
->ah_gpio_npins
= AR5K_NUM_GPIO
;
108 /* Set number of supported TX queues */
109 ah
->ah_capabilities
.cap_queues
.q_tx_num
= 1;
114 /* Main function used by the driver part to check caps */
115 int ath5k_hw_get_capability(struct ath5k_hw
*ah
,
116 enum ath5k_capability_type cap_type
,
117 u32 capability __unused
, u32
*result
)
120 case AR5K_CAP_NUM_TXQUEUES
:
127 case AR5K_CAP_COMPRESSION
:
128 if (ah
->ah_version
== AR5K_AR5212
)
136 case AR5K_CAP_BSSIDMASK
:
137 if (ah
->ah_version
== AR5K_AR5212
)
142 if (ah
->ah_version
== AR5K_AR5212
)