#include "ath5k.h"#include "reg.h"#include "base.h"Go to the source code of this file.
Functions | |
| FILE_LICENCE (MIT) | |
| int | ath5k_hw_set_capabilities (struct ath5k_hw *ah) |
| int | ath5k_hw_get_capability (struct ath5k_hw *ah, enum ath5k_capability_type cap_type, u32 capability __unused, u32 *result) |
| FILE_LICENCE | ( | MIT | ) |
| int ath5k_hw_set_capabilities | ( | struct ath5k_hw * | ah | ) |
Definition at line 36 of file ath5k_caps.c.
References ath5k_hw::ah_capabilities, ath5k_hw::ah_gpio_npins, ath5k_hw::ah_version, AR5K_AR5210, AR5K_AR5211, AR5K_AR5212, AR5K_EEPROM_HDR_11A, AR5K_EEPROM_HDR_11B, AR5K_EEPROM_HDR_11G, AR5K_MODE_BIT_11A, AR5K_MODE_BIT_11A_TURBO, AR5K_MODE_BIT_11B, AR5K_MODE_BIT_11G, AR5K_MODE_BIT_11G_TURBO, AR5K_NUM_GPIO, ath5k_capabilities::cap_eeprom, ath5k_capabilities::cap_mode, ath5k_capabilities::cap_queues, ath5k_capabilities::cap_range, ath5k_eeprom_info::ee_header, ath5k_capabilities::q_tx_num, ath5k_capabilities::range_2ghz_max, ath5k_capabilities::range_2ghz_min, ath5k_capabilities::range_5ghz_max, ath5k_capabilities::range_5ghz_min, and u16.
Referenced by ath5k_hw_attach().
00037 { 00038 u16 ee_header; 00039 00040 /* Capabilities stored in the EEPROM */ 00041 ee_header = ah->ah_capabilities.cap_eeprom.ee_header; 00042 00043 if (ah->ah_version == AR5K_AR5210) { 00044 /* 00045 * Set radio capabilities 00046 * (The AR5110 only supports the middle 5GHz band) 00047 */ 00048 ah->ah_capabilities.cap_range.range_5ghz_min = 5120; 00049 ah->ah_capabilities.cap_range.range_5ghz_max = 5430; 00050 ah->ah_capabilities.cap_range.range_2ghz_min = 0; 00051 ah->ah_capabilities.cap_range.range_2ghz_max = 0; 00052 00053 /* Set supported modes */ 00054 ah->ah_capabilities.cap_mode |= AR5K_MODE_BIT_11A; 00055 ah->ah_capabilities.cap_mode |= AR5K_MODE_BIT_11A_TURBO; 00056 } else { 00057 /* 00058 * XXX The tranceiver supports frequencies from 4920 to 6100GHz 00059 * XXX and from 2312 to 2732GHz. There are problems with the 00060 * XXX current ieee80211 implementation because the IEEE 00061 * XXX channel mapping does not support negative channel 00062 * XXX numbers (2312MHz is channel -19). Of course, this 00063 * XXX doesn't matter because these channels are out of range 00064 * XXX but some regulation domains like MKK (Japan) will 00065 * XXX support frequencies somewhere around 4.8GHz. 00066 */ 00067 00068 /* 00069 * Set radio capabilities 00070 */ 00071 00072 if (AR5K_EEPROM_HDR_11A(ee_header)) { 00073 /* 4920 */ 00074 ah->ah_capabilities.cap_range.range_5ghz_min = 5005; 00075 ah->ah_capabilities.cap_range.range_5ghz_max = 6100; 00076 00077 /* Set supported modes */ 00078 ah->ah_capabilities.cap_mode |= AR5K_MODE_BIT_11A; 00079 ah->ah_capabilities.cap_mode |= AR5K_MODE_BIT_11A_TURBO; 00080 if (ah->ah_version == AR5K_AR5212) 00081 ah->ah_capabilities.cap_mode |= 00082 AR5K_MODE_BIT_11G_TURBO; 00083 } 00084 00085 /* Enable 802.11b if a 2GHz capable radio (2111/5112) is 00086 * connected */ 00087 if (AR5K_EEPROM_HDR_11B(ee_header) || 00088 (AR5K_EEPROM_HDR_11G(ee_header) && 00089 ah->ah_version != AR5K_AR5211)) { 00090 /* 2312 */ 00091 ah->ah_capabilities.cap_range.range_2ghz_min = 2412; 00092 ah->ah_capabilities.cap_range.range_2ghz_max = 2732; 00093 00094 if (AR5K_EEPROM_HDR_11B(ee_header)) 00095 ah->ah_capabilities.cap_mode |= 00096 AR5K_MODE_BIT_11B; 00097 00098 if (AR5K_EEPROM_HDR_11G(ee_header) && 00099 ah->ah_version != AR5K_AR5211) 00100 ah->ah_capabilities.cap_mode |= 00101 AR5K_MODE_BIT_11G; 00102 } 00103 } 00104 00105 /* GPIO */ 00106 ah->ah_gpio_npins = AR5K_NUM_GPIO; 00107 00108 /* Set number of supported TX queues */ 00109 ah->ah_capabilities.cap_queues.q_tx_num = 1; 00110 00111 return 0; 00112 }
| int ath5k_hw_get_capability | ( | struct ath5k_hw * | ah, | |
| enum ath5k_capability_type | cap_type, | |||
| u32 capability | __unused, | |||
| u32 * | result | |||
| ) |
Definition at line 115 of file ath5k_caps.c.
References ath5k_hw::ah_version, AR5K_AR5212, AR5K_CAP_BSSIDMASK, AR5K_CAP_BURST, AR5K_CAP_COMPRESSION, AR5K_CAP_NUM_TXQUEUES, AR5K_CAP_TPC, AR5K_CAP_VEOL, AR5K_CAP_XR, and EINVAL.
00118 { 00119 switch (cap_type) { 00120 case AR5K_CAP_NUM_TXQUEUES: 00121 if (result) { 00122 *result = 1; 00123 goto yes; 00124 } 00125 case AR5K_CAP_VEOL: 00126 goto yes; 00127 case AR5K_CAP_COMPRESSION: 00128 if (ah->ah_version == AR5K_AR5212) 00129 goto yes; 00130 else 00131 goto no; 00132 case AR5K_CAP_BURST: 00133 goto yes; 00134 case AR5K_CAP_TPC: 00135 goto yes; 00136 case AR5K_CAP_BSSIDMASK: 00137 if (ah->ah_version == AR5K_AR5212) 00138 goto yes; 00139 else 00140 goto no; 00141 case AR5K_CAP_XR: 00142 if (ah->ah_version == AR5K_AR5212) 00143 goto yes; 00144 else 00145 goto no; 00146 default: 00147 goto no; 00148 } 00149 00150 no: 00151 return -EINVAL; 00152 yes: 00153 return 0; 00154 }
1.5.7.1