1203c4805SLuis R. Rodriguez /* 2203c4805SLuis R. Rodriguez * RF Gain optimization 3203c4805SLuis R. Rodriguez * 4203c4805SLuis R. Rodriguez * Copyright (c) 2004-2009 Reyk Floeter <reyk@openbsd.org> 5203c4805SLuis R. Rodriguez * Copyright (c) 2006-2009 Nick Kossifidis <mickflemm@gmail.com> 6203c4805SLuis R. Rodriguez * 7203c4805SLuis R. Rodriguez * Permission to use, copy, modify, and distribute this software for any 8203c4805SLuis R. Rodriguez * purpose with or without fee is hereby granted, provided that the above 9203c4805SLuis R. Rodriguez * copyright notice and this permission notice appear in all copies. 10203c4805SLuis R. Rodriguez * 11203c4805SLuis R. Rodriguez * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12203c4805SLuis R. Rodriguez * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13203c4805SLuis R. Rodriguez * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14203c4805SLuis R. Rodriguez * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15203c4805SLuis R. Rodriguez * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16203c4805SLuis R. Rodriguez * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17203c4805SLuis R. Rodriguez * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18203c4805SLuis R. Rodriguez * 19203c4805SLuis R. Rodriguez */ 20203c4805SLuis R. Rodriguez 21*c47faa36SNick Kossifidis /** 22*c47faa36SNick Kossifidis * struct ath5k_ini_rfgain - RF Gain table 23*c47faa36SNick Kossifidis * @rfg_register: RF Gain register address 24*c47faa36SNick Kossifidis * @rfg_value: Register value for 5 and 2GHz 25*c47faa36SNick Kossifidis * 26203c4805SLuis R. Rodriguez * Mode-specific RF Gain table (64bytes) for RF5111/5112 27203c4805SLuis R. Rodriguez * (RF5110 only comes with AR5210 and only supports a/turbo a mode so initial 28203c4805SLuis R. Rodriguez * RF Gain values are included in AR5K_AR5210_INI) 29203c4805SLuis R. Rodriguez */ 30203c4805SLuis R. Rodriguez struct ath5k_ini_rfgain { 31*c47faa36SNick Kossifidis u16 rfg_register; 32203c4805SLuis R. Rodriguez u32 rfg_value[2]; /* [freq (see below)] */ 33203c4805SLuis R. Rodriguez }; 34203c4805SLuis R. Rodriguez 35203c4805SLuis R. Rodriguez /* Initial RF Gain settings for RF5111 */ 36203c4805SLuis R. Rodriguez static const struct ath5k_ini_rfgain rfgain_5111[] = { 376a2a0e73SPavel Roskin /* 5GHz 2GHz */ 38203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(0), { 0x000001a9, 0x00000000 } }, 39203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(1), { 0x000001e9, 0x00000040 } }, 40203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(2), { 0x00000029, 0x00000080 } }, 41203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(3), { 0x00000069, 0x00000150 } }, 42203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(4), { 0x00000199, 0x00000190 } }, 43203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(5), { 0x000001d9, 0x000001d0 } }, 44203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(6), { 0x00000019, 0x00000010 } }, 45203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(7), { 0x00000059, 0x00000044 } }, 46203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(8), { 0x00000099, 0x00000084 } }, 47203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(9), { 0x000001a5, 0x00000148 } }, 48203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(10), { 0x000001e5, 0x00000188 } }, 49203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(11), { 0x00000025, 0x000001c8 } }, 50203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(12), { 0x000001c8, 0x00000014 } }, 51203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(13), { 0x00000008, 0x00000042 } }, 52203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(14), { 0x00000048, 0x00000082 } }, 53203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(15), { 0x00000088, 0x00000178 } }, 54203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(16), { 0x00000198, 0x000001b8 } }, 55203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(17), { 0x000001d8, 0x000001f8 } }, 56203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(18), { 0x00000018, 0x00000012 } }, 57203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(19), { 0x00000058, 0x00000052 } }, 58203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(20), { 0x00000098, 0x00000092 } }, 59203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(21), { 0x000001a4, 0x0000017c } }, 60203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(22), { 0x000001e4, 0x000001bc } }, 61203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(23), { 0x00000024, 0x000001fc } }, 62203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(24), { 0x00000064, 0x0000000a } }, 63203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(25), { 0x000000a4, 0x0000004a } }, 64203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(26), { 0x000000e4, 0x0000008a } }, 65203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(27), { 0x0000010a, 0x0000015a } }, 66203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(28), { 0x0000014a, 0x0000019a } }, 67203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(29), { 0x0000018a, 0x000001da } }, 68203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(30), { 0x000001ca, 0x0000000e } }, 69203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(31), { 0x0000000a, 0x0000004e } }, 70203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(32), { 0x0000004a, 0x0000008e } }, 71203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(33), { 0x0000008a, 0x0000015e } }, 72203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(34), { 0x000001ba, 0x0000019e } }, 73203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(35), { 0x000001fa, 0x000001de } }, 74203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(36), { 0x0000003a, 0x00000009 } }, 75203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(37), { 0x0000007a, 0x00000049 } }, 76203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(38), { 0x00000186, 0x00000089 } }, 77203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(39), { 0x000001c6, 0x00000179 } }, 78203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(40), { 0x00000006, 0x000001b9 } }, 79203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(41), { 0x00000046, 0x000001f9 } }, 80203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(42), { 0x00000086, 0x00000039 } }, 81203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(43), { 0x000000c6, 0x00000079 } }, 82203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(44), { 0x000000c6, 0x000000b9 } }, 83203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(45), { 0x000000c6, 0x000001bd } }, 84203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(46), { 0x000000c6, 0x000001fd } }, 85203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(47), { 0x000000c6, 0x0000003d } }, 86203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(48), { 0x000000c6, 0x0000007d } }, 87203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(49), { 0x000000c6, 0x000000bd } }, 88203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(50), { 0x000000c6, 0x000000fd } }, 89203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(51), { 0x000000c6, 0x000000fd } }, 90203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(52), { 0x000000c6, 0x000000fd } }, 91203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(53), { 0x000000c6, 0x000000fd } }, 92203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(54), { 0x000000c6, 0x000000fd } }, 93203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(55), { 0x000000c6, 0x000000fd } }, 94203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(56), { 0x000000c6, 0x000000fd } }, 95203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(57), { 0x000000c6, 0x000000fd } }, 96203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(58), { 0x000000c6, 0x000000fd } }, 97203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(59), { 0x000000c6, 0x000000fd } }, 98203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(60), { 0x000000c6, 0x000000fd } }, 99203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(61), { 0x000000c6, 0x000000fd } }, 100203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(62), { 0x000000c6, 0x000000fd } }, 101203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(63), { 0x000000c6, 0x000000fd } }, 102203c4805SLuis R. Rodriguez }; 103203c4805SLuis R. Rodriguez 104203c4805SLuis R. Rodriguez /* Initial RF Gain settings for RF5112 */ 105203c4805SLuis R. Rodriguez static const struct ath5k_ini_rfgain rfgain_5112[] = { 1066a2a0e73SPavel Roskin /* 5GHz 2GHz */ 107203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(0), { 0x00000007, 0x00000007 } }, 108203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(1), { 0x00000047, 0x00000047 } }, 109203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(2), { 0x00000087, 0x00000087 } }, 110203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(3), { 0x000001a0, 0x000001a0 } }, 111203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(4), { 0x000001e0, 0x000001e0 } }, 112203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(5), { 0x00000020, 0x00000020 } }, 113203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(6), { 0x00000060, 0x00000060 } }, 114203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(7), { 0x000001a1, 0x000001a1 } }, 115203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(8), { 0x000001e1, 0x000001e1 } }, 116203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(9), { 0x00000021, 0x00000021 } }, 117203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(10), { 0x00000061, 0x00000061 } }, 118203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(11), { 0x00000162, 0x00000162 } }, 119203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(12), { 0x000001a2, 0x000001a2 } }, 120203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(13), { 0x000001e2, 0x000001e2 } }, 121203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(14), { 0x00000022, 0x00000022 } }, 122203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(15), { 0x00000062, 0x00000062 } }, 123203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(16), { 0x00000163, 0x00000163 } }, 124203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(17), { 0x000001a3, 0x000001a3 } }, 125203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(18), { 0x000001e3, 0x000001e3 } }, 126203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(19), { 0x00000023, 0x00000023 } }, 127203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(20), { 0x00000063, 0x00000063 } }, 128203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(21), { 0x00000184, 0x00000184 } }, 129203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(22), { 0x000001c4, 0x000001c4 } }, 130203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(23), { 0x00000004, 0x00000004 } }, 131203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(24), { 0x000001ea, 0x0000000b } }, 132203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(25), { 0x0000002a, 0x0000004b } }, 133203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(26), { 0x0000006a, 0x0000008b } }, 134203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(27), { 0x000000aa, 0x000001ac } }, 135203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(28), { 0x000001ab, 0x000001ec } }, 136203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(29), { 0x000001eb, 0x0000002c } }, 137203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(30), { 0x0000002b, 0x00000012 } }, 138203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(31), { 0x0000006b, 0x00000052 } }, 139203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(32), { 0x000000ab, 0x00000092 } }, 140203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(33), { 0x000001ac, 0x00000193 } }, 141203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(34), { 0x000001ec, 0x000001d3 } }, 142203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(35), { 0x0000002c, 0x00000013 } }, 143203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(36), { 0x0000003a, 0x00000053 } }, 144203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(37), { 0x0000007a, 0x00000093 } }, 145203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(38), { 0x000000ba, 0x00000194 } }, 146203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(39), { 0x000001bb, 0x000001d4 } }, 147203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(40), { 0x000001fb, 0x00000014 } }, 148203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(41), { 0x0000003b, 0x0000003a } }, 149203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(42), { 0x0000007b, 0x0000007a } }, 150203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(43), { 0x000000bb, 0x000000ba } }, 151203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(44), { 0x000001bc, 0x000001bb } }, 152203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(45), { 0x000001fc, 0x000001fb } }, 153203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(46), { 0x0000003c, 0x0000003b } }, 154203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(47), { 0x0000007c, 0x0000007b } }, 155203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(48), { 0x000000bc, 0x000000bb } }, 156203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(49), { 0x000000fc, 0x000001bc } }, 157203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(50), { 0x000000fc, 0x000001fc } }, 158203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(51), { 0x000000fc, 0x0000003c } }, 159203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(52), { 0x000000fc, 0x0000007c } }, 160203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(53), { 0x000000fc, 0x000000bc } }, 161203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(54), { 0x000000fc, 0x000000fc } }, 162203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(55), { 0x000000fc, 0x000000fc } }, 163203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(56), { 0x000000fc, 0x000000fc } }, 164203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(57), { 0x000000fc, 0x000000fc } }, 165203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(58), { 0x000000fc, 0x000000fc } }, 166203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(59), { 0x000000fc, 0x000000fc } }, 167203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(60), { 0x000000fc, 0x000000fc } }, 168203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(61), { 0x000000fc, 0x000000fc } }, 169203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(62), { 0x000000fc, 0x000000fc } }, 170203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(63), { 0x000000fc, 0x000000fc } }, 171203c4805SLuis R. Rodriguez }; 172203c4805SLuis R. Rodriguez 173203c4805SLuis R. Rodriguez /* Initial RF Gain settings for RF2413 */ 174203c4805SLuis R. Rodriguez static const struct ath5k_ini_rfgain rfgain_2413[] = { 175203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(0), { 0x00000000, 0x00000000 } }, 176203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(1), { 0x00000000, 0x00000040 } }, 177203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(2), { 0x00000000, 0x00000080 } }, 178203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(3), { 0x00000000, 0x00000181 } }, 179203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(4), { 0x00000000, 0x000001c1 } }, 180203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(5), { 0x00000000, 0x00000001 } }, 181203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(6), { 0x00000000, 0x00000041 } }, 182203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(7), { 0x00000000, 0x00000081 } }, 183203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(8), { 0x00000000, 0x00000168 } }, 184203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(9), { 0x00000000, 0x000001a8 } }, 185203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(10), { 0x00000000, 0x000001e8 } }, 186203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(11), { 0x00000000, 0x00000028 } }, 187203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(12), { 0x00000000, 0x00000068 } }, 188203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(13), { 0x00000000, 0x00000189 } }, 189203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(14), { 0x00000000, 0x000001c9 } }, 190203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(15), { 0x00000000, 0x00000009 } }, 191203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(16), { 0x00000000, 0x00000049 } }, 192203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(17), { 0x00000000, 0x00000089 } }, 193203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(18), { 0x00000000, 0x00000190 } }, 194203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(19), { 0x00000000, 0x000001d0 } }, 195203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(20), { 0x00000000, 0x00000010 } }, 196203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(21), { 0x00000000, 0x00000050 } }, 197203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(22), { 0x00000000, 0x00000090 } }, 198203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(23), { 0x00000000, 0x00000191 } }, 199203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(24), { 0x00000000, 0x000001d1 } }, 200203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(25), { 0x00000000, 0x00000011 } }, 201203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(26), { 0x00000000, 0x00000051 } }, 202203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(27), { 0x00000000, 0x00000091 } }, 203203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(28), { 0x00000000, 0x00000178 } }, 204203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(29), { 0x00000000, 0x000001b8 } }, 205203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(30), { 0x00000000, 0x000001f8 } }, 206203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(31), { 0x00000000, 0x00000038 } }, 207203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(32), { 0x00000000, 0x00000078 } }, 208203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(33), { 0x00000000, 0x00000199 } }, 209203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(34), { 0x00000000, 0x000001d9 } }, 210203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(35), { 0x00000000, 0x00000019 } }, 211203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(36), { 0x00000000, 0x00000059 } }, 212203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(37), { 0x00000000, 0x00000099 } }, 213203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(38), { 0x00000000, 0x000000d9 } }, 214203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(39), { 0x00000000, 0x000000f9 } }, 215203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(40), { 0x00000000, 0x000000f9 } }, 216203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(41), { 0x00000000, 0x000000f9 } }, 217203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(42), { 0x00000000, 0x000000f9 } }, 218203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(43), { 0x00000000, 0x000000f9 } }, 219203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(44), { 0x00000000, 0x000000f9 } }, 220203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(45), { 0x00000000, 0x000000f9 } }, 221203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(46), { 0x00000000, 0x000000f9 } }, 222203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(47), { 0x00000000, 0x000000f9 } }, 223203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(48), { 0x00000000, 0x000000f9 } }, 224203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(49), { 0x00000000, 0x000000f9 } }, 225203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(50), { 0x00000000, 0x000000f9 } }, 226203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(51), { 0x00000000, 0x000000f9 } }, 227203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(52), { 0x00000000, 0x000000f9 } }, 228203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(53), { 0x00000000, 0x000000f9 } }, 229203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(54), { 0x00000000, 0x000000f9 } }, 230203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(55), { 0x00000000, 0x000000f9 } }, 231203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(56), { 0x00000000, 0x000000f9 } }, 232203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(57), { 0x00000000, 0x000000f9 } }, 233203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(58), { 0x00000000, 0x000000f9 } }, 234203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(59), { 0x00000000, 0x000000f9 } }, 235203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(60), { 0x00000000, 0x000000f9 } }, 236203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(61), { 0x00000000, 0x000000f9 } }, 237203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(62), { 0x00000000, 0x000000f9 } }, 238203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(63), { 0x00000000, 0x000000f9 } }, 239203c4805SLuis R. Rodriguez }; 240203c4805SLuis R. Rodriguez 241203c4805SLuis R. Rodriguez /* Initial RF Gain settings for AR2316 */ 242203c4805SLuis R. Rodriguez static const struct ath5k_ini_rfgain rfgain_2316[] = { 243203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(0), { 0x00000000, 0x00000000 } }, 244203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(1), { 0x00000000, 0x00000040 } }, 245203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(2), { 0x00000000, 0x00000080 } }, 246203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(3), { 0x00000000, 0x000000c0 } }, 247203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(4), { 0x00000000, 0x000000e0 } }, 248203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(5), { 0x00000000, 0x000000e0 } }, 249203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(6), { 0x00000000, 0x00000128 } }, 250203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(7), { 0x00000000, 0x00000128 } }, 251203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(8), { 0x00000000, 0x00000128 } }, 252203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(9), { 0x00000000, 0x00000168 } }, 253203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(10), { 0x00000000, 0x000001a8 } }, 254203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(11), { 0x00000000, 0x000001e8 } }, 255203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(12), { 0x00000000, 0x00000028 } }, 256203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(13), { 0x00000000, 0x00000068 } }, 257203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(14), { 0x00000000, 0x000000a8 } }, 258203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(15), { 0x00000000, 0x000000e8 } }, 259203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(16), { 0x00000000, 0x000000e8 } }, 260203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(17), { 0x00000000, 0x00000130 } }, 261203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(18), { 0x00000000, 0x00000130 } }, 262203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(19), { 0x00000000, 0x00000170 } }, 263203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(20), { 0x00000000, 0x000001b0 } }, 264203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(21), { 0x00000000, 0x000001f0 } }, 265203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(22), { 0x00000000, 0x00000030 } }, 266203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(23), { 0x00000000, 0x00000070 } }, 267203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(24), { 0x00000000, 0x000000b0 } }, 268203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(25), { 0x00000000, 0x000000f0 } }, 269203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(26), { 0x00000000, 0x000000f0 } }, 270203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(27), { 0x00000000, 0x000000f0 } }, 271203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(28), { 0x00000000, 0x000000f0 } }, 272203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(29), { 0x00000000, 0x000000f0 } }, 273203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(30), { 0x00000000, 0x000000f0 } }, 274203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(31), { 0x00000000, 0x000000f0 } }, 275203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(32), { 0x00000000, 0x000000f0 } }, 276203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(33), { 0x00000000, 0x000000f0 } }, 277203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(34), { 0x00000000, 0x000000f0 } }, 278203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(35), { 0x00000000, 0x000000f0 } }, 279203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(36), { 0x00000000, 0x000000f0 } }, 280203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(37), { 0x00000000, 0x000000f0 } }, 281203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(38), { 0x00000000, 0x000000f0 } }, 282203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(39), { 0x00000000, 0x000000f0 } }, 283203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(40), { 0x00000000, 0x000000f0 } }, 284203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(41), { 0x00000000, 0x000000f0 } }, 285203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(42), { 0x00000000, 0x000000f0 } }, 286203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(43), { 0x00000000, 0x000000f0 } }, 287203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(44), { 0x00000000, 0x000000f0 } }, 288203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(45), { 0x00000000, 0x000000f0 } }, 289203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(46), { 0x00000000, 0x000000f0 } }, 290203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(47), { 0x00000000, 0x000000f0 } }, 291203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(48), { 0x00000000, 0x000000f0 } }, 292203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(49), { 0x00000000, 0x000000f0 } }, 293203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(50), { 0x00000000, 0x000000f0 } }, 294203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(51), { 0x00000000, 0x000000f0 } }, 295203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(52), { 0x00000000, 0x000000f0 } }, 296203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(53), { 0x00000000, 0x000000f0 } }, 297203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(54), { 0x00000000, 0x000000f0 } }, 298203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(55), { 0x00000000, 0x000000f0 } }, 299203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(56), { 0x00000000, 0x000000f0 } }, 300203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(57), { 0x00000000, 0x000000f0 } }, 301203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(58), { 0x00000000, 0x000000f0 } }, 302203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(59), { 0x00000000, 0x000000f0 } }, 303203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(60), { 0x00000000, 0x000000f0 } }, 304203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(61), { 0x00000000, 0x000000f0 } }, 305203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(62), { 0x00000000, 0x000000f0 } }, 306203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(63), { 0x00000000, 0x000000f0 } }, 307203c4805SLuis R. Rodriguez }; 308203c4805SLuis R. Rodriguez 309203c4805SLuis R. Rodriguez 310203c4805SLuis R. Rodriguez /* Initial RF Gain settings for RF5413 */ 311203c4805SLuis R. Rodriguez static const struct ath5k_ini_rfgain rfgain_5413[] = { 3126a2a0e73SPavel Roskin /* 5GHz 2GHz */ 313203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(0), { 0x00000000, 0x00000000 } }, 314203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(1), { 0x00000040, 0x00000040 } }, 315203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(2), { 0x00000080, 0x00000080 } }, 316203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(3), { 0x000001a1, 0x00000161 } }, 317203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(4), { 0x000001e1, 0x000001a1 } }, 318203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(5), { 0x00000021, 0x000001e1 } }, 319203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(6), { 0x00000061, 0x00000021 } }, 320203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(7), { 0x00000188, 0x00000061 } }, 321203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(8), { 0x000001c8, 0x00000188 } }, 322203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(9), { 0x00000008, 0x000001c8 } }, 323203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(10), { 0x00000048, 0x00000008 } }, 324203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(11), { 0x00000088, 0x00000048 } }, 325203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(12), { 0x000001a9, 0x00000088 } }, 326203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(13), { 0x000001e9, 0x00000169 } }, 327203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(14), { 0x00000029, 0x000001a9 } }, 328203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(15), { 0x00000069, 0x000001e9 } }, 329203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(16), { 0x000001d0, 0x00000029 } }, 330203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(17), { 0x00000010, 0x00000069 } }, 331203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(18), { 0x00000050, 0x00000190 } }, 332203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(19), { 0x00000090, 0x000001d0 } }, 333203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(20), { 0x000001b1, 0x00000010 } }, 334203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(21), { 0x000001f1, 0x00000050 } }, 335203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(22), { 0x00000031, 0x00000090 } }, 336203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(23), { 0x00000071, 0x00000171 } }, 337203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(24), { 0x000001b8, 0x000001b1 } }, 338203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(25), { 0x000001f8, 0x000001f1 } }, 339203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(26), { 0x00000038, 0x00000031 } }, 340203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(27), { 0x00000078, 0x00000071 } }, 341203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(28), { 0x00000199, 0x00000198 } }, 342203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(29), { 0x000001d9, 0x000001d8 } }, 343203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(30), { 0x00000019, 0x00000018 } }, 344203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(31), { 0x00000059, 0x00000058 } }, 345203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(32), { 0x00000099, 0x00000098 } }, 346203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(33), { 0x000000d9, 0x00000179 } }, 347203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(34), { 0x000000f9, 0x000001b9 } }, 348203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(35), { 0x000000f9, 0x000001f9 } }, 349203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(36), { 0x000000f9, 0x00000039 } }, 350203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(37), { 0x000000f9, 0x00000079 } }, 351203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(38), { 0x000000f9, 0x000000b9 } }, 352203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(39), { 0x000000f9, 0x000000f9 } }, 353203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(40), { 0x000000f9, 0x000000f9 } }, 354203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(41), { 0x000000f9, 0x000000f9 } }, 355203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(42), { 0x000000f9, 0x000000f9 } }, 356203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(43), { 0x000000f9, 0x000000f9 } }, 357203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(44), { 0x000000f9, 0x000000f9 } }, 358203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(45), { 0x000000f9, 0x000000f9 } }, 359203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(46), { 0x000000f9, 0x000000f9 } }, 360203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(47), { 0x000000f9, 0x000000f9 } }, 361203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(48), { 0x000000f9, 0x000000f9 } }, 362203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(49), { 0x000000f9, 0x000000f9 } }, 363203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(50), { 0x000000f9, 0x000000f9 } }, 364203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(51), { 0x000000f9, 0x000000f9 } }, 365203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(52), { 0x000000f9, 0x000000f9 } }, 366203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(53), { 0x000000f9, 0x000000f9 } }, 367203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(54), { 0x000000f9, 0x000000f9 } }, 368203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(55), { 0x000000f9, 0x000000f9 } }, 369203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(56), { 0x000000f9, 0x000000f9 } }, 370203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(57), { 0x000000f9, 0x000000f9 } }, 371203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(58), { 0x000000f9, 0x000000f9 } }, 372203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(59), { 0x000000f9, 0x000000f9 } }, 373203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(60), { 0x000000f9, 0x000000f9 } }, 374203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(61), { 0x000000f9, 0x000000f9 } }, 375203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(62), { 0x000000f9, 0x000000f9 } }, 376203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(63), { 0x000000f9, 0x000000f9 } }, 377203c4805SLuis R. Rodriguez }; 378203c4805SLuis R. Rodriguez 379203c4805SLuis R. Rodriguez 380203c4805SLuis R. Rodriguez /* Initial RF Gain settings for RF2425 */ 381203c4805SLuis R. Rodriguez static const struct ath5k_ini_rfgain rfgain_2425[] = { 382203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(0), { 0x00000000, 0x00000000 } }, 383203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(1), { 0x00000000, 0x00000040 } }, 384203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(2), { 0x00000000, 0x00000080 } }, 385203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(3), { 0x00000000, 0x00000181 } }, 386203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(4), { 0x00000000, 0x000001c1 } }, 387203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(5), { 0x00000000, 0x00000001 } }, 388203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(6), { 0x00000000, 0x00000041 } }, 389203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(7), { 0x00000000, 0x00000081 } }, 390203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(8), { 0x00000000, 0x00000188 } }, 391203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(9), { 0x00000000, 0x000001c8 } }, 392203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(10), { 0x00000000, 0x00000008 } }, 393203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(11), { 0x00000000, 0x00000048 } }, 394203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(12), { 0x00000000, 0x00000088 } }, 395203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(13), { 0x00000000, 0x00000189 } }, 396203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(14), { 0x00000000, 0x000001c9 } }, 397203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(15), { 0x00000000, 0x00000009 } }, 398203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(16), { 0x00000000, 0x00000049 } }, 399203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(17), { 0x00000000, 0x00000089 } }, 400203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(18), { 0x00000000, 0x000001b0 } }, 401203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(19), { 0x00000000, 0x000001f0 } }, 402203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(20), { 0x00000000, 0x00000030 } }, 403203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(21), { 0x00000000, 0x00000070 } }, 404203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(22), { 0x00000000, 0x00000171 } }, 405203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(23), { 0x00000000, 0x000001b1 } }, 406203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(24), { 0x00000000, 0x000001f1 } }, 407203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(25), { 0x00000000, 0x00000031 } }, 408203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(26), { 0x00000000, 0x00000071 } }, 409203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(27), { 0x00000000, 0x000001b8 } }, 410203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(28), { 0x00000000, 0x000001f8 } }, 411203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(29), { 0x00000000, 0x00000038 } }, 412203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(30), { 0x00000000, 0x00000078 } }, 413203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(31), { 0x00000000, 0x000000b8 } }, 414203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(32), { 0x00000000, 0x000001b9 } }, 415203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(33), { 0x00000000, 0x000001f9 } }, 416203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(34), { 0x00000000, 0x00000039 } }, 417203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(35), { 0x00000000, 0x00000079 } }, 418203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(36), { 0x00000000, 0x000000b9 } }, 419203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(37), { 0x00000000, 0x000000f9 } }, 420203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(38), { 0x00000000, 0x000000f9 } }, 421203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(39), { 0x00000000, 0x000000f9 } }, 422203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(40), { 0x00000000, 0x000000f9 } }, 423203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(41), { 0x00000000, 0x000000f9 } }, 424203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(42), { 0x00000000, 0x000000f9 } }, 425203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(43), { 0x00000000, 0x000000f9 } }, 426203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(44), { 0x00000000, 0x000000f9 } }, 427203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(45), { 0x00000000, 0x000000f9 } }, 428203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(46), { 0x00000000, 0x000000f9 } }, 429203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(47), { 0x00000000, 0x000000f9 } }, 430203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(48), { 0x00000000, 0x000000f9 } }, 431203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(49), { 0x00000000, 0x000000f9 } }, 432203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(50), { 0x00000000, 0x000000f9 } }, 433203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(51), { 0x00000000, 0x000000f9 } }, 434203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(52), { 0x00000000, 0x000000f9 } }, 435203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(53), { 0x00000000, 0x000000f9 } }, 436203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(54), { 0x00000000, 0x000000f9 } }, 437203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(55), { 0x00000000, 0x000000f9 } }, 438203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(56), { 0x00000000, 0x000000f9 } }, 439203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(57), { 0x00000000, 0x000000f9 } }, 440203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(58), { 0x00000000, 0x000000f9 } }, 441203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(59), { 0x00000000, 0x000000f9 } }, 442203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(60), { 0x00000000, 0x000000f9 } }, 443203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(61), { 0x00000000, 0x000000f9 } }, 444203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(62), { 0x00000000, 0x000000f9 } }, 445203c4805SLuis R. Rodriguez { AR5K_RF_GAIN(63), { 0x00000000, 0x000000f9 } }, 446203c4805SLuis R. Rodriguez }; 447203c4805SLuis R. Rodriguez 448203c4805SLuis R. Rodriguez #define AR5K_GAIN_CRN_FIX_BITS_5111 4 449203c4805SLuis R. Rodriguez #define AR5K_GAIN_CRN_FIX_BITS_5112 7 450203c4805SLuis R. Rodriguez #define AR5K_GAIN_CRN_MAX_FIX_BITS AR5K_GAIN_CRN_FIX_BITS_5112 451203c4805SLuis R. Rodriguez #define AR5K_GAIN_DYN_ADJUST_HI_MARGIN 15 452203c4805SLuis R. Rodriguez #define AR5K_GAIN_DYN_ADJUST_LO_MARGIN 20 453203c4805SLuis R. Rodriguez #define AR5K_GAIN_CCK_PROBE_CORR 5 454203c4805SLuis R. Rodriguez #define AR5K_GAIN_CCK_OFDM_GAIN_DELTA 15 455203c4805SLuis R. Rodriguez #define AR5K_GAIN_STEP_COUNT 10 456203c4805SLuis R. Rodriguez 457203c4805SLuis R. Rodriguez /* Check if our current measurement is inside our 458203c4805SLuis R. Rodriguez * current variable attenuation window */ 459203c4805SLuis R. Rodriguez #define AR5K_GAIN_CHECK_ADJUST(_g) \ 460203c4805SLuis R. Rodriguez ((_g)->g_current <= (_g)->g_low || (_g)->g_current >= (_g)->g_high) 461203c4805SLuis R. Rodriguez 462*c47faa36SNick Kossifidis /** 463*c47faa36SNick Kossifidis * struct ath5k_gain_opt_step - An RF gain optimization step 464*c47faa36SNick Kossifidis * @gos_param: Set of parameters 465*c47faa36SNick Kossifidis * @gos_gain: Gain 466*c47faa36SNick Kossifidis */ 467203c4805SLuis R. Rodriguez struct ath5k_gain_opt_step { 468203c4805SLuis R. Rodriguez s8 gos_param[AR5K_GAIN_CRN_MAX_FIX_BITS]; 469203c4805SLuis R. Rodriguez s8 gos_gain; 470203c4805SLuis R. Rodriguez }; 471203c4805SLuis R. Rodriguez 472*c47faa36SNick Kossifidis /** 473*c47faa36SNick Kossifidis * struct ath5k_gain_opt - RF Gain optimization ladder 474*c47faa36SNick Kossifidis * @go_default: The default step 475*c47faa36SNick Kossifidis * @go_steps_count: How many optimization steps 476*c47faa36SNick Kossifidis * @go_step: Array of &struct ath5k_gain_opt_step 477*c47faa36SNick Kossifidis */ 478203c4805SLuis R. Rodriguez struct ath5k_gain_opt { 479203c4805SLuis R. Rodriguez u8 go_default; 480203c4805SLuis R. Rodriguez u8 go_steps_count; 481203c4805SLuis R. Rodriguez const struct ath5k_gain_opt_step go_step[AR5K_GAIN_STEP_COUNT]; 482203c4805SLuis R. Rodriguez }; 483203c4805SLuis R. Rodriguez 484*c47faa36SNick Kossifidis 485203c4805SLuis R. Rodriguez /* 486*c47faa36SNick Kossifidis * RF5111 487203c4805SLuis R. Rodriguez * Parameters on gos_param: 488203c4805SLuis R. Rodriguez * 1) Tx clip PHY register 489203c4805SLuis R. Rodriguez * 2) PWD 90 RF register 490203c4805SLuis R. Rodriguez * 3) PWD 84 RF register 491203c4805SLuis R. Rodriguez * 4) RFGainSel RF register 492203c4805SLuis R. Rodriguez */ 493203c4805SLuis R. Rodriguez static const struct ath5k_gain_opt rfgain_opt_5111 = { 494203c4805SLuis R. Rodriguez 4, 495203c4805SLuis R. Rodriguez 9, 496203c4805SLuis R. Rodriguez { 497203c4805SLuis R. Rodriguez { { 4, 1, 1, 1 }, 6 }, 498203c4805SLuis R. Rodriguez { { 4, 0, 1, 1 }, 4 }, 499203c4805SLuis R. Rodriguez { { 3, 1, 1, 1 }, 3 }, 500203c4805SLuis R. Rodriguez { { 4, 0, 0, 1 }, 1 }, 501203c4805SLuis R. Rodriguez { { 4, 1, 1, 0 }, 0 }, 502203c4805SLuis R. Rodriguez { { 4, 0, 1, 0 }, -2 }, 503203c4805SLuis R. Rodriguez { { 3, 1, 1, 0 }, -3 }, 504203c4805SLuis R. Rodriguez { { 4, 0, 0, 0 }, -4 }, 505203c4805SLuis R. Rodriguez { { 2, 1, 1, 0 }, -6 } 506203c4805SLuis R. Rodriguez } 507203c4805SLuis R. Rodriguez }; 508203c4805SLuis R. Rodriguez 509203c4805SLuis R. Rodriguez /* 510*c47faa36SNick Kossifidis * RF5112 511203c4805SLuis R. Rodriguez * Parameters on gos_param: 512203c4805SLuis R. Rodriguez * 1) Mixgain ovr RF register 513203c4805SLuis R. Rodriguez * 2) PWD 138 RF register 514203c4805SLuis R. Rodriguez * 3) PWD 137 RF register 515203c4805SLuis R. Rodriguez * 4) PWD 136 RF register 516203c4805SLuis R. Rodriguez * 5) PWD 132 RF register 517203c4805SLuis R. Rodriguez * 6) PWD 131 RF register 518203c4805SLuis R. Rodriguez * 7) PWD 130 RF register 519203c4805SLuis R. Rodriguez */ 520203c4805SLuis R. Rodriguez static const struct ath5k_gain_opt rfgain_opt_5112 = { 521203c4805SLuis R. Rodriguez 1, 522203c4805SLuis R. Rodriguez 8, 523203c4805SLuis R. Rodriguez { 524203c4805SLuis R. Rodriguez { { 3, 0, 0, 0, 0, 0, 0 }, 6 }, 525203c4805SLuis R. Rodriguez { { 2, 0, 0, 0, 0, 0, 0 }, 0 }, 526203c4805SLuis R. Rodriguez { { 1, 0, 0, 0, 0, 0, 0 }, -3 }, 527203c4805SLuis R. Rodriguez { { 0, 0, 0, 0, 0, 0, 0 }, -6 }, 528203c4805SLuis R. Rodriguez { { 0, 1, 1, 0, 0, 0, 0 }, -8 }, 529203c4805SLuis R. Rodriguez { { 0, 1, 1, 0, 1, 1, 0 }, -10 }, 530203c4805SLuis R. Rodriguez { { 0, 1, 0, 1, 1, 1, 0 }, -13 }, 531203c4805SLuis R. Rodriguez { { 0, 1, 0, 1, 1, 0, 1 }, -16 }, 532203c4805SLuis R. Rodriguez } 533203c4805SLuis R. Rodriguez }; 534203c4805SLuis R. Rodriguez 535