Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License along |
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | * |
Jim Lieb | 612822f | 2009-08-12 14:54:03 -0700 | [diff] [blame] | 19 | * |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 20 | * File: baseband.c |
| 21 | * |
| 22 | * Purpose: Implement functions to access baseband |
| 23 | * |
| 24 | * Author: Kyle Hsu |
| 25 | * |
| 26 | * Date: Aug.22, 2002 |
| 27 | * |
| 28 | * Functions: |
| 29 | * BBuGetFrameTime - Calculate data frame transmitting time |
| 30 | * BBvCaculateParameter - Caculate PhyLength, PhyService and Phy Signal parameter for baseband Tx |
Justin P. Mattock | 623b2b3 | 2012-08-20 08:43:14 -0700 | [diff] [blame] | 31 | * BBbReadEmbedded - Embedded read baseband register via MAC |
| 32 | * BBbWriteEmbedded - Embedded write baseband register via MAC |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 33 | * BBbIsRegBitsOn - Test if baseband register bits on |
| 34 | * BBbIsRegBitsOff - Test if baseband register bits off |
| 35 | * BBbVT3253Init - VIA VT3253 baseband chip init code |
| 36 | * BBvReadAllRegs - Read All Baseband Registers |
| 37 | * BBvLoopbackOn - Turn on BaseBand Loopback mode |
| 38 | * BBvLoopbackOff - Turn off BaseBand Loopback mode |
| 39 | * |
| 40 | * Revision History: |
| 41 | * 06-10-2003 Bryan YC Fan: Re-write codes to support VT3253 spec. |
| 42 | * 08-07-2003 Bryan YC Fan: Add MAXIM2827/2825 and RFMD2959 support. |
Justin P. Mattock | 7664ec8 | 2012-08-20 08:43:15 -0700 | [diff] [blame] | 43 | * 08-26-2003 Kyle Hsu : Modify BBuGetFrameTime() and BBvCalculateParameter(). |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 44 | * cancel the setting of MAC_REG_SOFTPWRCTL on BBbVT3253Init(). |
| 45 | * Add the comments. |
| 46 | * 09-01-2003 Bryan YC Fan: RF & BB tables updated. |
| 47 | * Modified BBvLoopbackOn & BBvLoopbackOff(). |
Jim Lieb | 612822f | 2009-08-12 14:54:03 -0700 | [diff] [blame] | 48 | * |
| 49 | * |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 50 | */ |
| 51 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 52 | #include "tmacro.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 53 | #include "tether.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 54 | #include "mac.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 55 | #include "baseband.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 56 | #include "srom.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 57 | #include "rf.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 58 | |
| 59 | /*--------------------- Static Definitions -------------------------*/ |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 60 | /* static int msglevel =MSG_LEVEL_DEBUG; */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 61 | static int msglevel = MSG_LEVEL_INFO; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 62 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 63 | /*--------------------- Static Classes ----------------------------*/ |
| 64 | |
| 65 | /*--------------------- Static Variables --------------------------*/ |
Jim Lieb | 612822f | 2009-08-12 14:54:03 -0700 | [diff] [blame] | 66 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 67 | /*--------------------- Static Functions --------------------------*/ |
| 68 | |
| 69 | /*--------------------- Export Variables --------------------------*/ |
| 70 | |
| 71 | /*--------------------- Static Definitions -------------------------*/ |
| 72 | |
| 73 | /*--------------------- Static Classes ----------------------------*/ |
| 74 | |
| 75 | /*--------------------- Static Variables --------------------------*/ |
| 76 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 77 | #define CB_VT3253_INIT_FOR_RFMD 446 |
Guillaume Clement | 9e4c5c2 | 2014-07-22 22:08:28 +0200 | [diff] [blame^] | 78 | static unsigned char byVT3253InitTab_RFMD[CB_VT3253_INIT_FOR_RFMD][2] = { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 79 | {0x00, 0x30}, |
| 80 | {0x01, 0x00}, |
| 81 | {0x02, 0x00}, |
| 82 | {0x03, 0x00}, |
| 83 | {0x04, 0x00}, |
| 84 | {0x05, 0x00}, |
| 85 | {0x06, 0x00}, |
| 86 | {0x07, 0x00}, |
| 87 | {0x08, 0x70}, |
| 88 | {0x09, 0x45}, |
| 89 | {0x0a, 0x2a}, |
| 90 | {0x0b, 0x76}, |
| 91 | {0x0c, 0x00}, |
| 92 | {0x0d, 0x01}, |
| 93 | {0x0e, 0x80}, |
| 94 | {0x0f, 0x00}, |
| 95 | {0x10, 0x00}, |
| 96 | {0x11, 0x00}, |
| 97 | {0x12, 0x00}, |
| 98 | {0x13, 0x00}, |
| 99 | {0x14, 0x00}, |
| 100 | {0x15, 0x00}, |
| 101 | {0x16, 0x00}, |
| 102 | {0x17, 0x00}, |
| 103 | {0x18, 0x00}, |
| 104 | {0x19, 0x00}, |
| 105 | {0x1a, 0x00}, |
| 106 | {0x1b, 0x9d}, |
| 107 | {0x1c, 0x05}, |
| 108 | {0x1d, 0x00}, |
| 109 | {0x1e, 0x00}, |
| 110 | {0x1f, 0x00}, |
| 111 | {0x20, 0x00}, |
| 112 | {0x21, 0x00}, |
| 113 | {0x22, 0x00}, |
| 114 | {0x23, 0x00}, |
| 115 | {0x24, 0x00}, |
| 116 | {0x25, 0x4a}, |
| 117 | {0x26, 0x00}, |
| 118 | {0x27, 0x00}, |
| 119 | {0x28, 0x00}, |
| 120 | {0x29, 0x00}, |
| 121 | {0x2a, 0x00}, |
| 122 | {0x2b, 0x00}, |
| 123 | {0x2c, 0x00}, |
| 124 | {0x2d, 0xa8}, |
| 125 | {0x2e, 0x1a}, |
| 126 | {0x2f, 0x0c}, |
| 127 | {0x30, 0x26}, |
| 128 | {0x31, 0x5b}, |
| 129 | {0x32, 0x00}, |
| 130 | {0x33, 0x00}, |
| 131 | {0x34, 0x00}, |
| 132 | {0x35, 0x00}, |
| 133 | {0x36, 0xaa}, |
| 134 | {0x37, 0xaa}, |
| 135 | {0x38, 0xff}, |
| 136 | {0x39, 0xff}, |
| 137 | {0x3a, 0x00}, |
| 138 | {0x3b, 0x00}, |
| 139 | {0x3c, 0x00}, |
| 140 | {0x3d, 0x0d}, |
| 141 | {0x3e, 0x51}, |
| 142 | {0x3f, 0x04}, |
| 143 | {0x40, 0x00}, |
| 144 | {0x41, 0x08}, |
| 145 | {0x42, 0x00}, |
| 146 | {0x43, 0x08}, |
| 147 | {0x44, 0x06}, |
| 148 | {0x45, 0x14}, |
| 149 | {0x46, 0x05}, |
| 150 | {0x47, 0x08}, |
| 151 | {0x48, 0x00}, |
| 152 | {0x49, 0x00}, |
| 153 | {0x4a, 0x00}, |
| 154 | {0x4b, 0x00}, |
| 155 | {0x4c, 0x09}, |
| 156 | {0x4d, 0x80}, |
| 157 | {0x4e, 0x00}, |
| 158 | {0x4f, 0xc5}, |
| 159 | {0x50, 0x14}, |
| 160 | {0x51, 0x19}, |
| 161 | {0x52, 0x00}, |
| 162 | {0x53, 0x00}, |
| 163 | {0x54, 0x00}, |
| 164 | {0x55, 0x00}, |
| 165 | {0x56, 0x00}, |
| 166 | {0x57, 0x00}, |
| 167 | {0x58, 0x00}, |
| 168 | {0x59, 0xb0}, |
| 169 | {0x5a, 0x00}, |
| 170 | {0x5b, 0x00}, |
| 171 | {0x5c, 0x00}, |
| 172 | {0x5d, 0x00}, |
| 173 | {0x5e, 0x00}, |
| 174 | {0x5f, 0x00}, |
| 175 | {0x60, 0x44}, |
| 176 | {0x61, 0x04}, |
| 177 | {0x62, 0x00}, |
| 178 | {0x63, 0x00}, |
| 179 | {0x64, 0x00}, |
| 180 | {0x65, 0x00}, |
| 181 | {0x66, 0x04}, |
| 182 | {0x67, 0xb7}, |
| 183 | {0x68, 0x00}, |
| 184 | {0x69, 0x00}, |
| 185 | {0x6a, 0x00}, |
| 186 | {0x6b, 0x00}, |
| 187 | {0x6c, 0x00}, |
| 188 | {0x6d, 0x03}, |
| 189 | {0x6e, 0x01}, |
| 190 | {0x6f, 0x00}, |
| 191 | {0x70, 0x00}, |
| 192 | {0x71, 0x00}, |
| 193 | {0x72, 0x00}, |
| 194 | {0x73, 0x00}, |
| 195 | {0x74, 0x00}, |
| 196 | {0x75, 0x00}, |
| 197 | {0x76, 0x00}, |
| 198 | {0x77, 0x00}, |
| 199 | {0x78, 0x00}, |
| 200 | {0x79, 0x00}, |
| 201 | {0x7a, 0x00}, |
| 202 | {0x7b, 0x00}, |
| 203 | {0x7c, 0x00}, |
| 204 | {0x7d, 0x00}, |
| 205 | {0x7e, 0x00}, |
| 206 | {0x7f, 0x00}, |
| 207 | {0x80, 0x0b}, |
| 208 | {0x81, 0x00}, |
| 209 | {0x82, 0x3c}, |
| 210 | {0x83, 0x00}, |
| 211 | {0x84, 0x00}, |
| 212 | {0x85, 0x00}, |
| 213 | {0x86, 0x00}, |
| 214 | {0x87, 0x00}, |
| 215 | {0x88, 0x08}, |
| 216 | {0x89, 0x00}, |
| 217 | {0x8a, 0x08}, |
| 218 | {0x8b, 0xa6}, |
| 219 | {0x8c, 0x84}, |
| 220 | {0x8d, 0x47}, |
| 221 | {0x8e, 0xbb}, |
| 222 | {0x8f, 0x02}, |
| 223 | {0x90, 0x21}, |
| 224 | {0x91, 0x0c}, |
| 225 | {0x92, 0x04}, |
| 226 | {0x93, 0x22}, |
| 227 | {0x94, 0x00}, |
| 228 | {0x95, 0x00}, |
| 229 | {0x96, 0x00}, |
| 230 | {0x97, 0xeb}, |
| 231 | {0x98, 0x00}, |
| 232 | {0x99, 0x00}, |
| 233 | {0x9a, 0x00}, |
| 234 | {0x9b, 0x00}, |
| 235 | {0x9c, 0x00}, |
| 236 | {0x9d, 0x00}, |
| 237 | {0x9e, 0x00}, |
| 238 | {0x9f, 0x00}, |
| 239 | {0xa0, 0x00}, |
| 240 | {0xa1, 0x00}, |
| 241 | {0xa2, 0x00}, |
| 242 | {0xa3, 0x00}, |
| 243 | {0xa4, 0x00}, |
| 244 | {0xa5, 0x00}, |
| 245 | {0xa6, 0x10}, |
| 246 | {0xa7, 0x04}, |
| 247 | {0xa8, 0x10}, |
| 248 | {0xa9, 0x00}, |
| 249 | {0xaa, 0x8f}, |
| 250 | {0xab, 0x00}, |
| 251 | {0xac, 0x00}, |
| 252 | {0xad, 0x00}, |
| 253 | {0xae, 0x00}, |
| 254 | {0xaf, 0x80}, |
| 255 | {0xb0, 0x38}, |
| 256 | {0xb1, 0x00}, |
| 257 | {0xb2, 0x00}, |
| 258 | {0xb3, 0x00}, |
| 259 | {0xb4, 0xee}, |
| 260 | {0xb5, 0xff}, |
| 261 | {0xb6, 0x10}, |
| 262 | {0xb7, 0x00}, |
| 263 | {0xb8, 0x00}, |
| 264 | {0xb9, 0x00}, |
| 265 | {0xba, 0x00}, |
| 266 | {0xbb, 0x03}, |
| 267 | {0xbc, 0x00}, |
| 268 | {0xbd, 0x00}, |
| 269 | {0xbe, 0x00}, |
| 270 | {0xbf, 0x00}, |
| 271 | {0xc0, 0x10}, |
| 272 | {0xc1, 0x10}, |
| 273 | {0xc2, 0x18}, |
| 274 | {0xc3, 0x20}, |
| 275 | {0xc4, 0x10}, |
| 276 | {0xc5, 0x00}, |
| 277 | {0xc6, 0x22}, |
| 278 | {0xc7, 0x14}, |
| 279 | {0xc8, 0x0f}, |
| 280 | {0xc9, 0x08}, |
| 281 | {0xca, 0xa4}, |
| 282 | {0xcb, 0xa7}, |
| 283 | {0xcc, 0x3c}, |
| 284 | {0xcd, 0x10}, |
| 285 | {0xce, 0x20}, |
| 286 | {0xcf, 0x00}, |
| 287 | {0xd0, 0x00}, |
| 288 | {0xd1, 0x10}, |
| 289 | {0xd2, 0x00}, |
| 290 | {0xd3, 0x00}, |
| 291 | {0xd4, 0x10}, |
| 292 | {0xd5, 0x33}, |
| 293 | {0xd6, 0x70}, |
| 294 | {0xd7, 0x01}, |
| 295 | {0xd8, 0x00}, |
| 296 | {0xd9, 0x00}, |
| 297 | {0xda, 0x00}, |
| 298 | {0xdb, 0x00}, |
| 299 | {0xdc, 0x00}, |
| 300 | {0xdd, 0x00}, |
| 301 | {0xde, 0x00}, |
| 302 | {0xdf, 0x00}, |
| 303 | {0xe0, 0x00}, |
| 304 | {0xe1, 0x00}, |
| 305 | {0xe2, 0xcc}, |
| 306 | {0xe3, 0x04}, |
| 307 | {0xe4, 0x08}, |
| 308 | {0xe5, 0x10}, |
| 309 | {0xe6, 0x00}, |
| 310 | {0xe7, 0x0e}, |
| 311 | {0xe8, 0x88}, |
| 312 | {0xe9, 0xd4}, |
| 313 | {0xea, 0x05}, |
| 314 | {0xeb, 0xf0}, |
| 315 | {0xec, 0x79}, |
| 316 | {0xed, 0x0f}, |
| 317 | {0xee, 0x04}, |
| 318 | {0xef, 0x04}, |
| 319 | {0xf0, 0x00}, |
| 320 | {0xf1, 0x00}, |
| 321 | {0xf2, 0x00}, |
| 322 | {0xf3, 0x00}, |
| 323 | {0xf4, 0x00}, |
| 324 | {0xf5, 0x00}, |
| 325 | {0xf6, 0x00}, |
| 326 | {0xf7, 0x00}, |
| 327 | {0xf8, 0x00}, |
| 328 | {0xf9, 0x00}, |
| 329 | {0xF0, 0x00}, |
| 330 | {0xF1, 0xF8}, |
| 331 | {0xF0, 0x80}, |
| 332 | {0xF0, 0x00}, |
| 333 | {0xF1, 0xF4}, |
| 334 | {0xF0, 0x81}, |
| 335 | {0xF0, 0x01}, |
| 336 | {0xF1, 0xF0}, |
| 337 | {0xF0, 0x82}, |
| 338 | {0xF0, 0x02}, |
| 339 | {0xF1, 0xEC}, |
| 340 | {0xF0, 0x83}, |
| 341 | {0xF0, 0x03}, |
| 342 | {0xF1, 0xE8}, |
| 343 | {0xF0, 0x84}, |
| 344 | {0xF0, 0x04}, |
| 345 | {0xF1, 0xE4}, |
| 346 | {0xF0, 0x85}, |
| 347 | {0xF0, 0x05}, |
| 348 | {0xF1, 0xE0}, |
| 349 | {0xF0, 0x86}, |
| 350 | {0xF0, 0x06}, |
| 351 | {0xF1, 0xDC}, |
| 352 | {0xF0, 0x87}, |
| 353 | {0xF0, 0x07}, |
| 354 | {0xF1, 0xD8}, |
| 355 | {0xF0, 0x88}, |
| 356 | {0xF0, 0x08}, |
| 357 | {0xF1, 0xD4}, |
| 358 | {0xF0, 0x89}, |
| 359 | {0xF0, 0x09}, |
| 360 | {0xF1, 0xD0}, |
| 361 | {0xF0, 0x8A}, |
| 362 | {0xF0, 0x0A}, |
| 363 | {0xF1, 0xCC}, |
| 364 | {0xF0, 0x8B}, |
| 365 | {0xF0, 0x0B}, |
| 366 | {0xF1, 0xC8}, |
| 367 | {0xF0, 0x8C}, |
| 368 | {0xF0, 0x0C}, |
| 369 | {0xF1, 0xC4}, |
| 370 | {0xF0, 0x8D}, |
| 371 | {0xF0, 0x0D}, |
| 372 | {0xF1, 0xC0}, |
| 373 | {0xF0, 0x8E}, |
| 374 | {0xF0, 0x0E}, |
| 375 | {0xF1, 0xBC}, |
| 376 | {0xF0, 0x8F}, |
| 377 | {0xF0, 0x0F}, |
| 378 | {0xF1, 0xB8}, |
| 379 | {0xF0, 0x90}, |
| 380 | {0xF0, 0x10}, |
| 381 | {0xF1, 0xB4}, |
| 382 | {0xF0, 0x91}, |
| 383 | {0xF0, 0x11}, |
| 384 | {0xF1, 0xB0}, |
| 385 | {0xF0, 0x92}, |
| 386 | {0xF0, 0x12}, |
| 387 | {0xF1, 0xAC}, |
| 388 | {0xF0, 0x93}, |
| 389 | {0xF0, 0x13}, |
| 390 | {0xF1, 0xA8}, |
| 391 | {0xF0, 0x94}, |
| 392 | {0xF0, 0x14}, |
| 393 | {0xF1, 0xA4}, |
| 394 | {0xF0, 0x95}, |
| 395 | {0xF0, 0x15}, |
| 396 | {0xF1, 0xA0}, |
| 397 | {0xF0, 0x96}, |
| 398 | {0xF0, 0x16}, |
| 399 | {0xF1, 0x9C}, |
| 400 | {0xF0, 0x97}, |
| 401 | {0xF0, 0x17}, |
| 402 | {0xF1, 0x98}, |
| 403 | {0xF0, 0x98}, |
| 404 | {0xF0, 0x18}, |
| 405 | {0xF1, 0x94}, |
| 406 | {0xF0, 0x99}, |
| 407 | {0xF0, 0x19}, |
| 408 | {0xF1, 0x90}, |
| 409 | {0xF0, 0x9A}, |
| 410 | {0xF0, 0x1A}, |
| 411 | {0xF1, 0x8C}, |
| 412 | {0xF0, 0x9B}, |
| 413 | {0xF0, 0x1B}, |
| 414 | {0xF1, 0x88}, |
| 415 | {0xF0, 0x9C}, |
| 416 | {0xF0, 0x1C}, |
| 417 | {0xF1, 0x84}, |
| 418 | {0xF0, 0x9D}, |
| 419 | {0xF0, 0x1D}, |
| 420 | {0xF1, 0x80}, |
| 421 | {0xF0, 0x9E}, |
| 422 | {0xF0, 0x1E}, |
| 423 | {0xF1, 0x7C}, |
| 424 | {0xF0, 0x9F}, |
| 425 | {0xF0, 0x1F}, |
| 426 | {0xF1, 0x78}, |
| 427 | {0xF0, 0xA0}, |
| 428 | {0xF0, 0x20}, |
| 429 | {0xF1, 0x74}, |
| 430 | {0xF0, 0xA1}, |
| 431 | {0xF0, 0x21}, |
| 432 | {0xF1, 0x70}, |
| 433 | {0xF0, 0xA2}, |
| 434 | {0xF0, 0x22}, |
| 435 | {0xF1, 0x6C}, |
| 436 | {0xF0, 0xA3}, |
| 437 | {0xF0, 0x23}, |
| 438 | {0xF1, 0x68}, |
| 439 | {0xF0, 0xA4}, |
| 440 | {0xF0, 0x24}, |
| 441 | {0xF1, 0x64}, |
| 442 | {0xF0, 0xA5}, |
| 443 | {0xF0, 0x25}, |
| 444 | {0xF1, 0x60}, |
| 445 | {0xF0, 0xA6}, |
| 446 | {0xF0, 0x26}, |
| 447 | {0xF1, 0x5C}, |
| 448 | {0xF0, 0xA7}, |
| 449 | {0xF0, 0x27}, |
| 450 | {0xF1, 0x58}, |
| 451 | {0xF0, 0xA8}, |
| 452 | {0xF0, 0x28}, |
| 453 | {0xF1, 0x54}, |
| 454 | {0xF0, 0xA9}, |
| 455 | {0xF0, 0x29}, |
| 456 | {0xF1, 0x50}, |
| 457 | {0xF0, 0xAA}, |
| 458 | {0xF0, 0x2A}, |
| 459 | {0xF1, 0x4C}, |
| 460 | {0xF0, 0xAB}, |
| 461 | {0xF0, 0x2B}, |
| 462 | {0xF1, 0x48}, |
| 463 | {0xF0, 0xAC}, |
| 464 | {0xF0, 0x2C}, |
| 465 | {0xF1, 0x44}, |
| 466 | {0xF0, 0xAD}, |
| 467 | {0xF0, 0x2D}, |
| 468 | {0xF1, 0x40}, |
| 469 | {0xF0, 0xAE}, |
| 470 | {0xF0, 0x2E}, |
| 471 | {0xF1, 0x3C}, |
| 472 | {0xF0, 0xAF}, |
| 473 | {0xF0, 0x2F}, |
| 474 | {0xF1, 0x38}, |
| 475 | {0xF0, 0xB0}, |
| 476 | {0xF0, 0x30}, |
| 477 | {0xF1, 0x34}, |
| 478 | {0xF0, 0xB1}, |
| 479 | {0xF0, 0x31}, |
| 480 | {0xF1, 0x30}, |
| 481 | {0xF0, 0xB2}, |
| 482 | {0xF0, 0x32}, |
| 483 | {0xF1, 0x2C}, |
| 484 | {0xF0, 0xB3}, |
| 485 | {0xF0, 0x33}, |
| 486 | {0xF1, 0x28}, |
| 487 | {0xF0, 0xB4}, |
| 488 | {0xF0, 0x34}, |
| 489 | {0xF1, 0x24}, |
| 490 | {0xF0, 0xB5}, |
| 491 | {0xF0, 0x35}, |
| 492 | {0xF1, 0x20}, |
| 493 | {0xF0, 0xB6}, |
| 494 | {0xF0, 0x36}, |
| 495 | {0xF1, 0x1C}, |
| 496 | {0xF0, 0xB7}, |
| 497 | {0xF0, 0x37}, |
| 498 | {0xF1, 0x18}, |
| 499 | {0xF0, 0xB8}, |
| 500 | {0xF0, 0x38}, |
| 501 | {0xF1, 0x14}, |
| 502 | {0xF0, 0xB9}, |
| 503 | {0xF0, 0x39}, |
| 504 | {0xF1, 0x10}, |
| 505 | {0xF0, 0xBA}, |
| 506 | {0xF0, 0x3A}, |
| 507 | {0xF1, 0x0C}, |
| 508 | {0xF0, 0xBB}, |
| 509 | {0xF0, 0x3B}, |
| 510 | {0xF1, 0x08}, |
| 511 | {0xF0, 0x00}, |
| 512 | {0xF0, 0x3C}, |
| 513 | {0xF1, 0x04}, |
| 514 | {0xF0, 0xBD}, |
| 515 | {0xF0, 0x3D}, |
| 516 | {0xF1, 0x00}, |
| 517 | {0xF0, 0xBE}, |
| 518 | {0xF0, 0x3E}, |
| 519 | {0xF1, 0x00}, |
| 520 | {0xF0, 0xBF}, |
| 521 | {0xF0, 0x3F}, |
| 522 | {0xF1, 0x00}, |
| 523 | {0xF0, 0xC0}, |
| 524 | {0xF0, 0x00}, |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 525 | }; |
| 526 | |
| 527 | #define CB_VT3253B0_INIT_FOR_RFMD 256 |
Guillaume Clement | 9e4c5c2 | 2014-07-22 22:08:28 +0200 | [diff] [blame^] | 528 | static unsigned char byVT3253B0_RFMD[CB_VT3253B0_INIT_FOR_RFMD][2] = { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 529 | {0x00, 0x31}, |
| 530 | {0x01, 0x00}, |
| 531 | {0x02, 0x00}, |
| 532 | {0x03, 0x00}, |
| 533 | {0x04, 0x00}, |
| 534 | {0x05, 0x81}, |
| 535 | {0x06, 0x00}, |
| 536 | {0x07, 0x00}, |
| 537 | {0x08, 0x38}, |
| 538 | {0x09, 0x45}, |
| 539 | {0x0a, 0x2a}, |
| 540 | {0x0b, 0x76}, |
| 541 | {0x0c, 0x00}, |
| 542 | {0x0d, 0x00}, |
| 543 | {0x0e, 0x80}, |
| 544 | {0x0f, 0x00}, |
| 545 | {0x10, 0x00}, |
| 546 | {0x11, 0x00}, |
| 547 | {0x12, 0x00}, |
| 548 | {0x13, 0x00}, |
| 549 | {0x14, 0x00}, |
| 550 | {0x15, 0x00}, |
| 551 | {0x16, 0x00}, |
| 552 | {0x17, 0x00}, |
| 553 | {0x18, 0x00}, |
| 554 | {0x19, 0x00}, |
| 555 | {0x1a, 0x00}, |
| 556 | {0x1b, 0x8e}, |
| 557 | {0x1c, 0x06}, |
| 558 | {0x1d, 0x00}, |
| 559 | {0x1e, 0x00}, |
| 560 | {0x1f, 0x00}, |
| 561 | {0x20, 0x00}, |
| 562 | {0x21, 0x00}, |
| 563 | {0x22, 0x00}, |
| 564 | {0x23, 0x00}, |
| 565 | {0x24, 0x00}, |
| 566 | {0x25, 0x4a}, |
| 567 | {0x26, 0x00}, |
| 568 | {0x27, 0x00}, |
| 569 | {0x28, 0x00}, |
| 570 | {0x29, 0x00}, |
| 571 | {0x2a, 0x00}, |
| 572 | {0x2b, 0x00}, |
| 573 | {0x2c, 0x00}, |
| 574 | {0x2d, 0x34}, |
| 575 | {0x2e, 0x18}, |
| 576 | {0x2f, 0x0c}, |
| 577 | {0x30, 0x26}, |
| 578 | {0x31, 0x5b}, |
| 579 | {0x32, 0x00}, |
| 580 | {0x33, 0x00}, |
| 581 | {0x34, 0x00}, |
| 582 | {0x35, 0x00}, |
| 583 | {0x36, 0xaa}, |
| 584 | {0x37, 0xaa}, |
| 585 | {0x38, 0xff}, |
| 586 | {0x39, 0xff}, |
| 587 | {0x3a, 0xf8}, |
| 588 | {0x3b, 0x00}, |
| 589 | {0x3c, 0x00}, |
| 590 | {0x3d, 0x09}, |
| 591 | {0x3e, 0x0d}, |
| 592 | {0x3f, 0x04}, |
| 593 | {0x40, 0x00}, |
| 594 | {0x41, 0x08}, |
| 595 | {0x42, 0x00}, |
| 596 | {0x43, 0x08}, |
| 597 | {0x44, 0x08}, |
| 598 | {0x45, 0x14}, |
| 599 | {0x46, 0x05}, |
| 600 | {0x47, 0x08}, |
| 601 | {0x48, 0x00}, |
| 602 | {0x49, 0x00}, |
| 603 | {0x4a, 0x00}, |
| 604 | {0x4b, 0x00}, |
| 605 | {0x4c, 0x09}, |
| 606 | {0x4d, 0x80}, |
| 607 | {0x4e, 0x00}, |
| 608 | {0x4f, 0xc5}, |
| 609 | {0x50, 0x14}, |
| 610 | {0x51, 0x19}, |
| 611 | {0x52, 0x00}, |
| 612 | {0x53, 0x00}, |
| 613 | {0x54, 0x00}, |
| 614 | {0x55, 0x00}, |
| 615 | {0x56, 0x00}, |
| 616 | {0x57, 0x00}, |
| 617 | {0x58, 0x00}, |
| 618 | {0x59, 0xb0}, |
| 619 | {0x5a, 0x00}, |
| 620 | {0x5b, 0x00}, |
| 621 | {0x5c, 0x00}, |
| 622 | {0x5d, 0x00}, |
| 623 | {0x5e, 0x00}, |
| 624 | {0x5f, 0x00}, |
| 625 | {0x60, 0x39}, |
| 626 | {0x61, 0x83}, |
| 627 | {0x62, 0x00}, |
| 628 | {0x63, 0x00}, |
| 629 | {0x64, 0x00}, |
| 630 | {0x65, 0x00}, |
| 631 | {0x66, 0xc0}, |
| 632 | {0x67, 0x49}, |
| 633 | {0x68, 0x00}, |
| 634 | {0x69, 0x00}, |
| 635 | {0x6a, 0x00}, |
| 636 | {0x6b, 0x00}, |
| 637 | {0x6c, 0x00}, |
| 638 | {0x6d, 0x03}, |
| 639 | {0x6e, 0x01}, |
| 640 | {0x6f, 0x00}, |
| 641 | {0x70, 0x00}, |
| 642 | {0x71, 0x00}, |
| 643 | {0x72, 0x00}, |
| 644 | {0x73, 0x00}, |
| 645 | {0x74, 0x00}, |
| 646 | {0x75, 0x00}, |
| 647 | {0x76, 0x00}, |
| 648 | {0x77, 0x00}, |
| 649 | {0x78, 0x00}, |
| 650 | {0x79, 0x00}, |
| 651 | {0x7a, 0x00}, |
| 652 | {0x7b, 0x00}, |
| 653 | {0x7c, 0x00}, |
| 654 | {0x7d, 0x00}, |
| 655 | {0x7e, 0x00}, |
| 656 | {0x7f, 0x00}, |
| 657 | {0x80, 0x89}, |
| 658 | {0x81, 0x00}, |
| 659 | {0x82, 0x0e}, |
| 660 | {0x83, 0x00}, |
| 661 | {0x84, 0x00}, |
| 662 | {0x85, 0x00}, |
| 663 | {0x86, 0x00}, |
| 664 | {0x87, 0x00}, |
| 665 | {0x88, 0x08}, |
| 666 | {0x89, 0x00}, |
| 667 | {0x8a, 0x0e}, |
| 668 | {0x8b, 0xa7}, |
| 669 | {0x8c, 0x88}, |
| 670 | {0x8d, 0x47}, |
| 671 | {0x8e, 0xaa}, |
| 672 | {0x8f, 0x02}, |
| 673 | {0x90, 0x23}, |
| 674 | {0x91, 0x0c}, |
| 675 | {0x92, 0x06}, |
| 676 | {0x93, 0x08}, |
| 677 | {0x94, 0x00}, |
| 678 | {0x95, 0x00}, |
| 679 | {0x96, 0x00}, |
| 680 | {0x97, 0xeb}, |
| 681 | {0x98, 0x00}, |
| 682 | {0x99, 0x00}, |
| 683 | {0x9a, 0x00}, |
| 684 | {0x9b, 0x00}, |
| 685 | {0x9c, 0x00}, |
| 686 | {0x9d, 0x00}, |
| 687 | {0x9e, 0x00}, |
| 688 | {0x9f, 0x00}, |
| 689 | {0xa0, 0x00}, |
| 690 | {0xa1, 0x00}, |
| 691 | {0xa2, 0x00}, |
| 692 | {0xa3, 0xcd}, |
| 693 | {0xa4, 0x07}, |
| 694 | {0xa5, 0x33}, |
| 695 | {0xa6, 0x18}, |
| 696 | {0xa7, 0x00}, |
| 697 | {0xa8, 0x18}, |
| 698 | {0xa9, 0x00}, |
| 699 | {0xaa, 0x28}, |
| 700 | {0xab, 0x00}, |
| 701 | {0xac, 0x00}, |
| 702 | {0xad, 0x00}, |
| 703 | {0xae, 0x00}, |
| 704 | {0xaf, 0x18}, |
| 705 | {0xb0, 0x38}, |
| 706 | {0xb1, 0x30}, |
| 707 | {0xb2, 0x00}, |
| 708 | {0xb3, 0x00}, |
| 709 | {0xb4, 0x00}, |
| 710 | {0xb5, 0x00}, |
| 711 | {0xb6, 0x84}, |
| 712 | {0xb7, 0xfd}, |
| 713 | {0xb8, 0x00}, |
| 714 | {0xb9, 0x00}, |
| 715 | {0xba, 0x00}, |
| 716 | {0xbb, 0x03}, |
| 717 | {0xbc, 0x00}, |
| 718 | {0xbd, 0x00}, |
| 719 | {0xbe, 0x00}, |
| 720 | {0xbf, 0x00}, |
| 721 | {0xc0, 0x10}, |
| 722 | {0xc1, 0x20}, |
| 723 | {0xc2, 0x18}, |
| 724 | {0xc3, 0x20}, |
| 725 | {0xc4, 0x10}, |
| 726 | {0xc5, 0x2c}, |
| 727 | {0xc6, 0x1e}, |
| 728 | {0xc7, 0x10}, |
| 729 | {0xc8, 0x12}, |
| 730 | {0xc9, 0x01}, |
| 731 | {0xca, 0x6f}, |
| 732 | {0xcb, 0xa7}, |
| 733 | {0xcc, 0x3c}, |
| 734 | {0xcd, 0x10}, |
| 735 | {0xce, 0x00}, |
| 736 | {0xcf, 0x22}, |
| 737 | {0xd0, 0x00}, |
| 738 | {0xd1, 0x10}, |
| 739 | {0xd2, 0x00}, |
| 740 | {0xd3, 0x00}, |
| 741 | {0xd4, 0x10}, |
| 742 | {0xd5, 0x33}, |
| 743 | {0xd6, 0x80}, |
| 744 | {0xd7, 0x21}, |
| 745 | {0xd8, 0x00}, |
| 746 | {0xd9, 0x00}, |
| 747 | {0xda, 0x00}, |
| 748 | {0xdb, 0x00}, |
| 749 | {0xdc, 0x00}, |
| 750 | {0xdd, 0x00}, |
| 751 | {0xde, 0x00}, |
| 752 | {0xdf, 0x00}, |
| 753 | {0xe0, 0x00}, |
| 754 | {0xe1, 0xB3}, |
| 755 | {0xe2, 0x00}, |
| 756 | {0xe3, 0x00}, |
| 757 | {0xe4, 0x00}, |
| 758 | {0xe5, 0x10}, |
| 759 | {0xe6, 0x00}, |
| 760 | {0xe7, 0x18}, |
| 761 | {0xe8, 0x08}, |
| 762 | {0xe9, 0xd4}, |
| 763 | {0xea, 0x00}, |
| 764 | {0xeb, 0xff}, |
| 765 | {0xec, 0x79}, |
| 766 | {0xed, 0x10}, |
| 767 | {0xee, 0x30}, |
| 768 | {0xef, 0x02}, |
| 769 | {0xf0, 0x00}, |
| 770 | {0xf1, 0x09}, |
| 771 | {0xf2, 0x00}, |
| 772 | {0xf3, 0x00}, |
| 773 | {0xf4, 0x00}, |
| 774 | {0xf5, 0x00}, |
| 775 | {0xf6, 0x00}, |
| 776 | {0xf7, 0x00}, |
| 777 | {0xf8, 0x00}, |
| 778 | {0xf9, 0x00}, |
| 779 | {0xfa, 0x00}, |
| 780 | {0xfb, 0x00}, |
| 781 | {0xfc, 0x00}, |
| 782 | {0xfd, 0x00}, |
| 783 | {0xfe, 0x00}, |
| 784 | {0xff, 0x00}, |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 785 | }; |
| 786 | |
| 787 | #define CB_VT3253B0_AGC_FOR_RFMD2959 195 |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 788 | /* For RFMD2959 */ |
Guillaume Clement | 9e4c5c2 | 2014-07-22 22:08:28 +0200 | [diff] [blame^] | 789 | static unsigned char byVT3253B0_AGC4_RFMD2959[CB_VT3253B0_AGC_FOR_RFMD2959][2] = { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 790 | {0xF0, 0x00}, |
| 791 | {0xF1, 0x3E}, |
| 792 | {0xF0, 0x80}, |
| 793 | {0xF0, 0x00}, |
| 794 | {0xF1, 0x3E}, |
| 795 | {0xF0, 0x81}, |
| 796 | {0xF0, 0x01}, |
| 797 | {0xF1, 0x3E}, |
| 798 | {0xF0, 0x82}, |
| 799 | {0xF0, 0x02}, |
| 800 | {0xF1, 0x3E}, |
| 801 | {0xF0, 0x83}, |
| 802 | {0xF0, 0x03}, |
| 803 | {0xF1, 0x3B}, |
| 804 | {0xF0, 0x84}, |
| 805 | {0xF0, 0x04}, |
| 806 | {0xF1, 0x39}, |
| 807 | {0xF0, 0x85}, |
| 808 | {0xF0, 0x05}, |
| 809 | {0xF1, 0x38}, |
| 810 | {0xF0, 0x86}, |
| 811 | {0xF0, 0x06}, |
| 812 | {0xF1, 0x37}, |
| 813 | {0xF0, 0x87}, |
| 814 | {0xF0, 0x07}, |
| 815 | {0xF1, 0x36}, |
| 816 | {0xF0, 0x88}, |
| 817 | {0xF0, 0x08}, |
| 818 | {0xF1, 0x35}, |
| 819 | {0xF0, 0x89}, |
| 820 | {0xF0, 0x09}, |
| 821 | {0xF1, 0x35}, |
| 822 | {0xF0, 0x8A}, |
| 823 | {0xF0, 0x0A}, |
| 824 | {0xF1, 0x34}, |
| 825 | {0xF0, 0x8B}, |
| 826 | {0xF0, 0x0B}, |
| 827 | {0xF1, 0x34}, |
| 828 | {0xF0, 0x8C}, |
| 829 | {0xF0, 0x0C}, |
| 830 | {0xF1, 0x33}, |
| 831 | {0xF0, 0x8D}, |
| 832 | {0xF0, 0x0D}, |
| 833 | {0xF1, 0x32}, |
| 834 | {0xF0, 0x8E}, |
| 835 | {0xF0, 0x0E}, |
| 836 | {0xF1, 0x31}, |
| 837 | {0xF0, 0x8F}, |
| 838 | {0xF0, 0x0F}, |
| 839 | {0xF1, 0x30}, |
| 840 | {0xF0, 0x90}, |
| 841 | {0xF0, 0x10}, |
| 842 | {0xF1, 0x2F}, |
| 843 | {0xF0, 0x91}, |
| 844 | {0xF0, 0x11}, |
| 845 | {0xF1, 0x2F}, |
| 846 | {0xF0, 0x92}, |
| 847 | {0xF0, 0x12}, |
| 848 | {0xF1, 0x2E}, |
| 849 | {0xF0, 0x93}, |
| 850 | {0xF0, 0x13}, |
| 851 | {0xF1, 0x2D}, |
| 852 | {0xF0, 0x94}, |
| 853 | {0xF0, 0x14}, |
| 854 | {0xF1, 0x2C}, |
| 855 | {0xF0, 0x95}, |
| 856 | {0xF0, 0x15}, |
| 857 | {0xF1, 0x2B}, |
| 858 | {0xF0, 0x96}, |
| 859 | {0xF0, 0x16}, |
| 860 | {0xF1, 0x2B}, |
| 861 | {0xF0, 0x97}, |
| 862 | {0xF0, 0x17}, |
| 863 | {0xF1, 0x2A}, |
| 864 | {0xF0, 0x98}, |
| 865 | {0xF0, 0x18}, |
| 866 | {0xF1, 0x29}, |
| 867 | {0xF0, 0x99}, |
| 868 | {0xF0, 0x19}, |
| 869 | {0xF1, 0x28}, |
| 870 | {0xF0, 0x9A}, |
| 871 | {0xF0, 0x1A}, |
| 872 | {0xF1, 0x27}, |
| 873 | {0xF0, 0x9B}, |
| 874 | {0xF0, 0x1B}, |
| 875 | {0xF1, 0x26}, |
| 876 | {0xF0, 0x9C}, |
| 877 | {0xF0, 0x1C}, |
| 878 | {0xF1, 0x25}, |
| 879 | {0xF0, 0x9D}, |
| 880 | {0xF0, 0x1D}, |
| 881 | {0xF1, 0x24}, |
| 882 | {0xF0, 0x9E}, |
| 883 | {0xF0, 0x1E}, |
| 884 | {0xF1, 0x24}, |
| 885 | {0xF0, 0x9F}, |
| 886 | {0xF0, 0x1F}, |
| 887 | {0xF1, 0x23}, |
| 888 | {0xF0, 0xA0}, |
| 889 | {0xF0, 0x20}, |
| 890 | {0xF1, 0x22}, |
| 891 | {0xF0, 0xA1}, |
| 892 | {0xF0, 0x21}, |
| 893 | {0xF1, 0x21}, |
| 894 | {0xF0, 0xA2}, |
| 895 | {0xF0, 0x22}, |
| 896 | {0xF1, 0x20}, |
| 897 | {0xF0, 0xA3}, |
| 898 | {0xF0, 0x23}, |
| 899 | {0xF1, 0x20}, |
| 900 | {0xF0, 0xA4}, |
| 901 | {0xF0, 0x24}, |
| 902 | {0xF1, 0x1F}, |
| 903 | {0xF0, 0xA5}, |
| 904 | {0xF0, 0x25}, |
| 905 | {0xF1, 0x1E}, |
| 906 | {0xF0, 0xA6}, |
| 907 | {0xF0, 0x26}, |
| 908 | {0xF1, 0x1D}, |
| 909 | {0xF0, 0xA7}, |
| 910 | {0xF0, 0x27}, |
| 911 | {0xF1, 0x1C}, |
| 912 | {0xF0, 0xA8}, |
| 913 | {0xF0, 0x28}, |
| 914 | {0xF1, 0x1B}, |
| 915 | {0xF0, 0xA9}, |
| 916 | {0xF0, 0x29}, |
| 917 | {0xF1, 0x1B}, |
| 918 | {0xF0, 0xAA}, |
| 919 | {0xF0, 0x2A}, |
| 920 | {0xF1, 0x1A}, |
| 921 | {0xF0, 0xAB}, |
| 922 | {0xF0, 0x2B}, |
| 923 | {0xF1, 0x1A}, |
| 924 | {0xF0, 0xAC}, |
| 925 | {0xF0, 0x2C}, |
| 926 | {0xF1, 0x19}, |
| 927 | {0xF0, 0xAD}, |
| 928 | {0xF0, 0x2D}, |
| 929 | {0xF1, 0x18}, |
| 930 | {0xF0, 0xAE}, |
| 931 | {0xF0, 0x2E}, |
| 932 | {0xF1, 0x17}, |
| 933 | {0xF0, 0xAF}, |
| 934 | {0xF0, 0x2F}, |
| 935 | {0xF1, 0x16}, |
| 936 | {0xF0, 0xB0}, |
| 937 | {0xF0, 0x30}, |
| 938 | {0xF1, 0x15}, |
| 939 | {0xF0, 0xB1}, |
| 940 | {0xF0, 0x31}, |
| 941 | {0xF1, 0x15}, |
| 942 | {0xF0, 0xB2}, |
| 943 | {0xF0, 0x32}, |
| 944 | {0xF1, 0x15}, |
| 945 | {0xF0, 0xB3}, |
| 946 | {0xF0, 0x33}, |
| 947 | {0xF1, 0x14}, |
| 948 | {0xF0, 0xB4}, |
| 949 | {0xF0, 0x34}, |
| 950 | {0xF1, 0x13}, |
| 951 | {0xF0, 0xB5}, |
| 952 | {0xF0, 0x35}, |
| 953 | {0xF1, 0x12}, |
| 954 | {0xF0, 0xB6}, |
| 955 | {0xF0, 0x36}, |
| 956 | {0xF1, 0x11}, |
| 957 | {0xF0, 0xB7}, |
| 958 | {0xF0, 0x37}, |
| 959 | {0xF1, 0x10}, |
| 960 | {0xF0, 0xB8}, |
| 961 | {0xF0, 0x38}, |
| 962 | {0xF1, 0x0F}, |
| 963 | {0xF0, 0xB9}, |
| 964 | {0xF0, 0x39}, |
| 965 | {0xF1, 0x0E}, |
| 966 | {0xF0, 0xBA}, |
| 967 | {0xF0, 0x3A}, |
| 968 | {0xF1, 0x0D}, |
| 969 | {0xF0, 0xBB}, |
| 970 | {0xF0, 0x3B}, |
| 971 | {0xF1, 0x0C}, |
| 972 | {0xF0, 0xBC}, |
| 973 | {0xF0, 0x3C}, |
| 974 | {0xF1, 0x0B}, |
| 975 | {0xF0, 0xBD}, |
| 976 | {0xF0, 0x3D}, |
| 977 | {0xF1, 0x0B}, |
| 978 | {0xF0, 0xBE}, |
| 979 | {0xF0, 0x3E}, |
| 980 | {0xF1, 0x0A}, |
| 981 | {0xF0, 0xBF}, |
| 982 | {0xF0, 0x3F}, |
| 983 | {0xF1, 0x09}, |
| 984 | {0xF0, 0x00}, |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 985 | }; |
| 986 | |
| 987 | #define CB_VT3253B0_INIT_FOR_AIROHA2230 256 |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 988 | /* For AIROHA */ |
Guillaume Clement | 9e4c5c2 | 2014-07-22 22:08:28 +0200 | [diff] [blame^] | 989 | static unsigned char byVT3253B0_AIROHA2230[CB_VT3253B0_INIT_FOR_AIROHA2230][2] = { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 990 | {0x00, 0x31}, |
| 991 | {0x01, 0x00}, |
| 992 | {0x02, 0x00}, |
| 993 | {0x03, 0x00}, |
| 994 | {0x04, 0x00}, |
| 995 | {0x05, 0x80}, |
| 996 | {0x06, 0x00}, |
| 997 | {0x07, 0x00}, |
| 998 | {0x08, 0x70}, |
| 999 | {0x09, 0x41}, |
| 1000 | {0x0a, 0x2A}, |
| 1001 | {0x0b, 0x76}, |
| 1002 | {0x0c, 0x00}, |
| 1003 | {0x0d, 0x00}, |
| 1004 | {0x0e, 0x80}, |
| 1005 | {0x0f, 0x00}, |
| 1006 | {0x10, 0x00}, |
| 1007 | {0x11, 0x00}, |
| 1008 | {0x12, 0x00}, |
| 1009 | {0x13, 0x00}, |
| 1010 | {0x14, 0x00}, |
| 1011 | {0x15, 0x00}, |
| 1012 | {0x16, 0x00}, |
| 1013 | {0x17, 0x00}, |
| 1014 | {0x18, 0x00}, |
| 1015 | {0x19, 0x00}, |
| 1016 | {0x1a, 0x00}, |
| 1017 | {0x1b, 0x8f}, |
| 1018 | {0x1c, 0x09}, |
| 1019 | {0x1d, 0x00}, |
| 1020 | {0x1e, 0x00}, |
| 1021 | {0x1f, 0x00}, |
| 1022 | {0x20, 0x00}, |
| 1023 | {0x21, 0x00}, |
| 1024 | {0x22, 0x00}, |
| 1025 | {0x23, 0x00}, |
| 1026 | {0x24, 0x00}, |
| 1027 | {0x25, 0x4a}, |
| 1028 | {0x26, 0x00}, |
| 1029 | {0x27, 0x00}, |
| 1030 | {0x28, 0x00}, |
| 1031 | {0x29, 0x00}, |
| 1032 | {0x2a, 0x00}, |
| 1033 | {0x2b, 0x00}, |
| 1034 | {0x2c, 0x00}, |
| 1035 | {0x2d, 0x4a}, |
| 1036 | {0x2e, 0x00}, |
| 1037 | {0x2f, 0x0a}, |
| 1038 | {0x30, 0x26}, |
| 1039 | {0x31, 0x5b}, |
| 1040 | {0x32, 0x00}, |
| 1041 | {0x33, 0x00}, |
| 1042 | {0x34, 0x00}, |
| 1043 | {0x35, 0x00}, |
| 1044 | {0x36, 0xaa}, |
| 1045 | {0x37, 0xaa}, |
| 1046 | {0x38, 0xff}, |
| 1047 | {0x39, 0xff}, |
| 1048 | {0x3a, 0x79}, |
| 1049 | {0x3b, 0x00}, |
| 1050 | {0x3c, 0x00}, |
| 1051 | {0x3d, 0x0b}, |
| 1052 | {0x3e, 0x48}, |
| 1053 | {0x3f, 0x04}, |
| 1054 | {0x40, 0x00}, |
| 1055 | {0x41, 0x08}, |
| 1056 | {0x42, 0x00}, |
| 1057 | {0x43, 0x08}, |
| 1058 | {0x44, 0x08}, |
| 1059 | {0x45, 0x14}, |
| 1060 | {0x46, 0x05}, |
| 1061 | {0x47, 0x09}, |
| 1062 | {0x48, 0x00}, |
| 1063 | {0x49, 0x00}, |
| 1064 | {0x4a, 0x00}, |
| 1065 | {0x4b, 0x00}, |
| 1066 | {0x4c, 0x09}, |
| 1067 | {0x4d, 0x73}, |
| 1068 | {0x4e, 0x00}, |
| 1069 | {0x4f, 0xc5}, |
| 1070 | {0x50, 0x15}, |
| 1071 | {0x51, 0x19}, |
| 1072 | {0x52, 0x00}, |
| 1073 | {0x53, 0x00}, |
| 1074 | {0x54, 0x00}, |
| 1075 | {0x55, 0x00}, |
| 1076 | {0x56, 0x00}, |
| 1077 | {0x57, 0x00}, |
| 1078 | {0x58, 0x00}, |
| 1079 | {0x59, 0xb0}, |
| 1080 | {0x5a, 0x00}, |
| 1081 | {0x5b, 0x00}, |
| 1082 | {0x5c, 0x00}, |
| 1083 | {0x5d, 0x00}, |
| 1084 | {0x5e, 0x00}, |
| 1085 | {0x5f, 0x00}, |
| 1086 | {0x60, 0xe4}, |
| 1087 | {0x61, 0x80}, |
| 1088 | {0x62, 0x00}, |
| 1089 | {0x63, 0x00}, |
| 1090 | {0x64, 0x00}, |
| 1091 | {0x65, 0x00}, |
| 1092 | {0x66, 0x98}, |
| 1093 | {0x67, 0x0a}, |
| 1094 | {0x68, 0x00}, |
| 1095 | {0x69, 0x00}, |
| 1096 | {0x6a, 0x00}, |
| 1097 | {0x6b, 0x00}, |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1098 | {0x6c, 0x00}, /* RobertYu:20050125, request by JJSue */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1099 | {0x6d, 0x03}, |
| 1100 | {0x6e, 0x01}, |
| 1101 | {0x6f, 0x00}, |
| 1102 | {0x70, 0x00}, |
| 1103 | {0x71, 0x00}, |
| 1104 | {0x72, 0x00}, |
| 1105 | {0x73, 0x00}, |
| 1106 | {0x74, 0x00}, |
| 1107 | {0x75, 0x00}, |
| 1108 | {0x76, 0x00}, |
| 1109 | {0x77, 0x00}, |
| 1110 | {0x78, 0x00}, |
| 1111 | {0x79, 0x00}, |
| 1112 | {0x7a, 0x00}, |
| 1113 | {0x7b, 0x00}, |
| 1114 | {0x7c, 0x00}, |
| 1115 | {0x7d, 0x00}, |
| 1116 | {0x7e, 0x00}, |
| 1117 | {0x7f, 0x00}, |
| 1118 | {0x80, 0x8c}, |
| 1119 | {0x81, 0x01}, |
| 1120 | {0x82, 0x09}, |
| 1121 | {0x83, 0x00}, |
| 1122 | {0x84, 0x00}, |
| 1123 | {0x85, 0x00}, |
| 1124 | {0x86, 0x00}, |
| 1125 | {0x87, 0x00}, |
| 1126 | {0x88, 0x08}, |
| 1127 | {0x89, 0x00}, |
| 1128 | {0x8a, 0x0f}, |
| 1129 | {0x8b, 0xb7}, |
| 1130 | {0x8c, 0x88}, |
| 1131 | {0x8d, 0x47}, |
| 1132 | {0x8e, 0xaa}, |
| 1133 | {0x8f, 0x02}, |
| 1134 | {0x90, 0x22}, |
| 1135 | {0x91, 0x00}, |
| 1136 | {0x92, 0x00}, |
| 1137 | {0x93, 0x00}, |
| 1138 | {0x94, 0x00}, |
| 1139 | {0x95, 0x00}, |
| 1140 | {0x96, 0x00}, |
| 1141 | {0x97, 0xeb}, |
| 1142 | {0x98, 0x00}, |
| 1143 | {0x99, 0x00}, |
| 1144 | {0x9a, 0x00}, |
| 1145 | {0x9b, 0x00}, |
| 1146 | {0x9c, 0x00}, |
| 1147 | {0x9d, 0x00}, |
| 1148 | {0x9e, 0x00}, |
| 1149 | {0x9f, 0x01}, |
| 1150 | {0xa0, 0x00}, |
| 1151 | {0xa1, 0x00}, |
| 1152 | {0xa2, 0x00}, |
| 1153 | {0xa3, 0x00}, |
| 1154 | {0xa4, 0x00}, |
| 1155 | {0xa5, 0x00}, |
| 1156 | {0xa6, 0x10}, |
| 1157 | {0xa7, 0x00}, |
| 1158 | {0xa8, 0x18}, |
| 1159 | {0xa9, 0x00}, |
| 1160 | {0xaa, 0x00}, |
| 1161 | {0xab, 0x00}, |
| 1162 | {0xac, 0x00}, |
| 1163 | {0xad, 0x00}, |
| 1164 | {0xae, 0x00}, |
| 1165 | {0xaf, 0x18}, |
| 1166 | {0xb0, 0x38}, |
| 1167 | {0xb1, 0x30}, |
| 1168 | {0xb2, 0x00}, |
| 1169 | {0xb3, 0x00}, |
| 1170 | {0xb4, 0xff}, |
| 1171 | {0xb5, 0x0f}, |
| 1172 | {0xb6, 0xe4}, |
| 1173 | {0xb7, 0xe2}, |
| 1174 | {0xb8, 0x00}, |
| 1175 | {0xb9, 0x00}, |
| 1176 | {0xba, 0x00}, |
| 1177 | {0xbb, 0x03}, |
| 1178 | {0xbc, 0x01}, |
| 1179 | {0xbd, 0x00}, |
| 1180 | {0xbe, 0x00}, |
| 1181 | {0xbf, 0x00}, |
| 1182 | {0xc0, 0x18}, |
| 1183 | {0xc1, 0x20}, |
| 1184 | {0xc2, 0x07}, |
| 1185 | {0xc3, 0x18}, |
| 1186 | {0xc4, 0xff}, |
| 1187 | {0xc5, 0x2c}, |
| 1188 | {0xc6, 0x0c}, |
| 1189 | {0xc7, 0x0a}, |
| 1190 | {0xc8, 0x0e}, |
| 1191 | {0xc9, 0x01}, |
| 1192 | {0xca, 0x68}, |
| 1193 | {0xcb, 0xa7}, |
| 1194 | {0xcc, 0x3c}, |
| 1195 | {0xcd, 0x10}, |
| 1196 | {0xce, 0x00}, |
| 1197 | {0xcf, 0x25}, |
| 1198 | {0xd0, 0x40}, |
| 1199 | {0xd1, 0x12}, |
| 1200 | {0xd2, 0x00}, |
| 1201 | {0xd3, 0x00}, |
| 1202 | {0xd4, 0x10}, |
| 1203 | {0xd5, 0x28}, |
| 1204 | {0xd6, 0x80}, |
| 1205 | {0xd7, 0x2A}, |
| 1206 | {0xd8, 0x00}, |
| 1207 | {0xd9, 0x00}, |
| 1208 | {0xda, 0x00}, |
| 1209 | {0xdb, 0x00}, |
| 1210 | {0xdc, 0x00}, |
| 1211 | {0xdd, 0x00}, |
| 1212 | {0xde, 0x00}, |
| 1213 | {0xdf, 0x00}, |
| 1214 | {0xe0, 0x00}, |
| 1215 | {0xe1, 0xB3}, |
| 1216 | {0xe2, 0x00}, |
| 1217 | {0xe3, 0x00}, |
| 1218 | {0xe4, 0x00}, |
| 1219 | {0xe5, 0x10}, |
| 1220 | {0xe6, 0x00}, |
| 1221 | {0xe7, 0x1C}, |
| 1222 | {0xe8, 0x00}, |
| 1223 | {0xe9, 0xf4}, |
| 1224 | {0xea, 0x00}, |
| 1225 | {0xeb, 0xff}, |
| 1226 | {0xec, 0x79}, |
| 1227 | {0xed, 0x20}, |
| 1228 | {0xee, 0x30}, |
| 1229 | {0xef, 0x01}, |
| 1230 | {0xf0, 0x00}, |
| 1231 | {0xf1, 0x3e}, |
| 1232 | {0xf2, 0x00}, |
| 1233 | {0xf3, 0x00}, |
| 1234 | {0xf4, 0x00}, |
| 1235 | {0xf5, 0x00}, |
| 1236 | {0xf6, 0x00}, |
| 1237 | {0xf7, 0x00}, |
| 1238 | {0xf8, 0x00}, |
| 1239 | {0xf9, 0x00}, |
| 1240 | {0xfa, 0x00}, |
| 1241 | {0xfb, 0x00}, |
| 1242 | {0xfc, 0x00}, |
| 1243 | {0xfd, 0x00}, |
| 1244 | {0xfe, 0x00}, |
| 1245 | {0xff, 0x00}, |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1246 | }; |
| 1247 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1248 | #define CB_VT3253B0_INIT_FOR_UW2451 256 |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1249 | /* For UW2451 */ |
Guillaume Clement | 9e4c5c2 | 2014-07-22 22:08:28 +0200 | [diff] [blame^] | 1250 | static unsigned char byVT3253B0_UW2451[CB_VT3253B0_INIT_FOR_UW2451][2] = { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1251 | {0x00, 0x31}, |
| 1252 | {0x01, 0x00}, |
| 1253 | {0x02, 0x00}, |
| 1254 | {0x03, 0x00}, |
| 1255 | {0x04, 0x00}, |
| 1256 | {0x05, 0x81}, |
| 1257 | {0x06, 0x00}, |
| 1258 | {0x07, 0x00}, |
| 1259 | {0x08, 0x38}, |
| 1260 | {0x09, 0x45}, |
| 1261 | {0x0a, 0x28}, |
| 1262 | {0x0b, 0x76}, |
| 1263 | {0x0c, 0x00}, |
| 1264 | {0x0d, 0x00}, |
| 1265 | {0x0e, 0x80}, |
| 1266 | {0x0f, 0x00}, |
| 1267 | {0x10, 0x00}, |
| 1268 | {0x11, 0x00}, |
| 1269 | {0x12, 0x00}, |
| 1270 | {0x13, 0x00}, |
| 1271 | {0x14, 0x00}, |
| 1272 | {0x15, 0x00}, |
| 1273 | {0x16, 0x00}, |
| 1274 | {0x17, 0x00}, |
| 1275 | {0x18, 0x00}, |
| 1276 | {0x19, 0x00}, |
| 1277 | {0x1a, 0x00}, |
| 1278 | {0x1b, 0x8f}, |
| 1279 | {0x1c, 0x0f}, |
| 1280 | {0x1d, 0x00}, |
| 1281 | {0x1e, 0x00}, |
| 1282 | {0x1f, 0x00}, |
| 1283 | {0x20, 0x00}, |
| 1284 | {0x21, 0x00}, |
| 1285 | {0x22, 0x00}, |
| 1286 | {0x23, 0x00}, |
| 1287 | {0x24, 0x00}, |
| 1288 | {0x25, 0x4a}, |
| 1289 | {0x26, 0x00}, |
| 1290 | {0x27, 0x00}, |
| 1291 | {0x28, 0x00}, |
| 1292 | {0x29, 0x00}, |
| 1293 | {0x2a, 0x00}, |
| 1294 | {0x2b, 0x00}, |
| 1295 | {0x2c, 0x00}, |
| 1296 | {0x2d, 0x18}, |
| 1297 | {0x2e, 0x00}, |
| 1298 | {0x2f, 0x0a}, |
| 1299 | {0x30, 0x26}, |
| 1300 | {0x31, 0x5b}, |
| 1301 | {0x32, 0x00}, |
| 1302 | {0x33, 0x00}, |
| 1303 | {0x34, 0x00}, |
| 1304 | {0x35, 0x00}, |
| 1305 | {0x36, 0xaa}, |
| 1306 | {0x37, 0xaa}, |
| 1307 | {0x38, 0xff}, |
| 1308 | {0x39, 0xff}, |
| 1309 | {0x3a, 0x00}, |
| 1310 | {0x3b, 0x00}, |
| 1311 | {0x3c, 0x00}, |
| 1312 | {0x3d, 0x03}, |
| 1313 | {0x3e, 0x1d}, |
| 1314 | {0x3f, 0x04}, |
| 1315 | {0x40, 0x00}, |
| 1316 | {0x41, 0x08}, |
| 1317 | {0x42, 0x00}, |
| 1318 | {0x43, 0x08}, |
| 1319 | {0x44, 0x08}, |
| 1320 | {0x45, 0x14}, |
| 1321 | {0x46, 0x05}, |
| 1322 | {0x47, 0x09}, |
| 1323 | {0x48, 0x00}, |
| 1324 | {0x49, 0x00}, |
| 1325 | {0x4a, 0x00}, |
| 1326 | {0x4b, 0x00}, |
| 1327 | {0x4c, 0x09}, |
| 1328 | {0x4d, 0x90}, |
| 1329 | {0x4e, 0x00}, |
| 1330 | {0x4f, 0xc5}, |
| 1331 | {0x50, 0x15}, |
| 1332 | {0x51, 0x19}, |
| 1333 | {0x52, 0x00}, |
| 1334 | {0x53, 0x00}, |
| 1335 | {0x54, 0x00}, |
| 1336 | {0x55, 0x00}, |
| 1337 | {0x56, 0x00}, |
| 1338 | {0x57, 0x00}, |
| 1339 | {0x58, 0x00}, |
| 1340 | {0x59, 0xb0}, |
| 1341 | {0x5a, 0x00}, |
| 1342 | {0x5b, 0x00}, |
| 1343 | {0x5c, 0x00}, |
| 1344 | {0x5d, 0x00}, |
| 1345 | {0x5e, 0x00}, |
| 1346 | {0x5f, 0x00}, |
| 1347 | {0x60, 0xb3}, |
| 1348 | {0x61, 0x81}, |
| 1349 | {0x62, 0x00}, |
| 1350 | {0x63, 0x00}, |
| 1351 | {0x64, 0x00}, |
| 1352 | {0x65, 0x00}, |
| 1353 | {0x66, 0x57}, |
| 1354 | {0x67, 0x6c}, |
| 1355 | {0x68, 0x00}, |
| 1356 | {0x69, 0x00}, |
| 1357 | {0x6a, 0x00}, |
| 1358 | {0x6b, 0x00}, |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1359 | {0x6c, 0x00}, /* RobertYu:20050125, request by JJSue */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1360 | {0x6d, 0x03}, |
| 1361 | {0x6e, 0x01}, |
| 1362 | {0x6f, 0x00}, |
| 1363 | {0x70, 0x00}, |
| 1364 | {0x71, 0x00}, |
| 1365 | {0x72, 0x00}, |
| 1366 | {0x73, 0x00}, |
| 1367 | {0x74, 0x00}, |
| 1368 | {0x75, 0x00}, |
| 1369 | {0x76, 0x00}, |
| 1370 | {0x77, 0x00}, |
| 1371 | {0x78, 0x00}, |
| 1372 | {0x79, 0x00}, |
| 1373 | {0x7a, 0x00}, |
| 1374 | {0x7b, 0x00}, |
| 1375 | {0x7c, 0x00}, |
| 1376 | {0x7d, 0x00}, |
| 1377 | {0x7e, 0x00}, |
| 1378 | {0x7f, 0x00}, |
| 1379 | {0x80, 0x8c}, |
| 1380 | {0x81, 0x00}, |
| 1381 | {0x82, 0x0e}, |
| 1382 | {0x83, 0x00}, |
| 1383 | {0x84, 0x00}, |
| 1384 | {0x85, 0x00}, |
| 1385 | {0x86, 0x00}, |
| 1386 | {0x87, 0x00}, |
| 1387 | {0x88, 0x08}, |
| 1388 | {0x89, 0x00}, |
| 1389 | {0x8a, 0x0e}, |
| 1390 | {0x8b, 0xa7}, |
| 1391 | {0x8c, 0x88}, |
| 1392 | {0x8d, 0x47}, |
| 1393 | {0x8e, 0xaa}, |
| 1394 | {0x8f, 0x02}, |
| 1395 | {0x90, 0x00}, |
| 1396 | {0x91, 0x00}, |
| 1397 | {0x92, 0x00}, |
| 1398 | {0x93, 0x00}, |
| 1399 | {0x94, 0x00}, |
| 1400 | {0x95, 0x00}, |
| 1401 | {0x96, 0x00}, |
| 1402 | {0x97, 0xe3}, |
| 1403 | {0x98, 0x00}, |
| 1404 | {0x99, 0x00}, |
| 1405 | {0x9a, 0x00}, |
| 1406 | {0x9b, 0x00}, |
| 1407 | {0x9c, 0x00}, |
| 1408 | {0x9d, 0x00}, |
| 1409 | {0x9e, 0x00}, |
| 1410 | {0x9f, 0x00}, |
| 1411 | {0xa0, 0x00}, |
| 1412 | {0xa1, 0x00}, |
| 1413 | {0xa2, 0x00}, |
| 1414 | {0xa3, 0x00}, |
| 1415 | {0xa4, 0x00}, |
| 1416 | {0xa5, 0x00}, |
| 1417 | {0xa6, 0x10}, |
| 1418 | {0xa7, 0x00}, |
| 1419 | {0xa8, 0x18}, |
| 1420 | {0xa9, 0x00}, |
| 1421 | {0xaa, 0x00}, |
| 1422 | {0xab, 0x00}, |
| 1423 | {0xac, 0x00}, |
| 1424 | {0xad, 0x00}, |
| 1425 | {0xae, 0x00}, |
| 1426 | {0xaf, 0x18}, |
| 1427 | {0xb0, 0x18}, |
| 1428 | {0xb1, 0x30}, |
| 1429 | {0xb2, 0x00}, |
| 1430 | {0xb3, 0x00}, |
| 1431 | {0xb4, 0x00}, |
| 1432 | {0xb5, 0x00}, |
| 1433 | {0xb6, 0x00}, |
| 1434 | {0xb7, 0x00}, |
| 1435 | {0xb8, 0x00}, |
| 1436 | {0xb9, 0x00}, |
| 1437 | {0xba, 0x00}, |
| 1438 | {0xbb, 0x03}, |
| 1439 | {0xbc, 0x01}, |
| 1440 | {0xbd, 0x00}, |
| 1441 | {0xbe, 0x00}, |
| 1442 | {0xbf, 0x00}, |
| 1443 | {0xc0, 0x10}, |
| 1444 | {0xc1, 0x20}, |
| 1445 | {0xc2, 0x00}, |
| 1446 | {0xc3, 0x20}, |
| 1447 | {0xc4, 0x00}, |
| 1448 | {0xc5, 0x2c}, |
| 1449 | {0xc6, 0x1c}, |
| 1450 | {0xc7, 0x10}, |
| 1451 | {0xc8, 0x10}, |
| 1452 | {0xc9, 0x01}, |
| 1453 | {0xca, 0x68}, |
| 1454 | {0xcb, 0xa7}, |
| 1455 | {0xcc, 0x3c}, |
| 1456 | {0xcd, 0x09}, |
| 1457 | {0xce, 0x00}, |
| 1458 | {0xcf, 0x20}, |
| 1459 | {0xd0, 0x40}, |
| 1460 | {0xd1, 0x10}, |
| 1461 | {0xd2, 0x00}, |
| 1462 | {0xd3, 0x00}, |
| 1463 | {0xd4, 0x20}, |
| 1464 | {0xd5, 0x28}, |
| 1465 | {0xd6, 0xa0}, |
| 1466 | {0xd7, 0x2a}, |
| 1467 | {0xd8, 0x00}, |
| 1468 | {0xd9, 0x00}, |
| 1469 | {0xda, 0x00}, |
| 1470 | {0xdb, 0x00}, |
| 1471 | {0xdc, 0x00}, |
| 1472 | {0xdd, 0x00}, |
| 1473 | {0xde, 0x00}, |
| 1474 | {0xdf, 0x00}, |
| 1475 | {0xe0, 0x00}, |
| 1476 | {0xe1, 0xd3}, |
| 1477 | {0xe2, 0xc0}, |
| 1478 | {0xe3, 0x00}, |
| 1479 | {0xe4, 0x00}, |
| 1480 | {0xe5, 0x10}, |
| 1481 | {0xe6, 0x00}, |
| 1482 | {0xe7, 0x12}, |
| 1483 | {0xe8, 0x12}, |
| 1484 | {0xe9, 0x34}, |
| 1485 | {0xea, 0x00}, |
| 1486 | {0xeb, 0xff}, |
| 1487 | {0xec, 0x79}, |
| 1488 | {0xed, 0x20}, |
| 1489 | {0xee, 0x30}, |
| 1490 | {0xef, 0x01}, |
| 1491 | {0xf0, 0x00}, |
| 1492 | {0xf1, 0x3e}, |
| 1493 | {0xf2, 0x00}, |
| 1494 | {0xf3, 0x00}, |
| 1495 | {0xf4, 0x00}, |
| 1496 | {0xf5, 0x00}, |
| 1497 | {0xf6, 0x00}, |
| 1498 | {0xf7, 0x00}, |
| 1499 | {0xf8, 0x00}, |
| 1500 | {0xf9, 0x00}, |
| 1501 | {0xfa, 0x00}, |
| 1502 | {0xfb, 0x00}, |
| 1503 | {0xfc, 0x00}, |
| 1504 | {0xfd, 0x00}, |
| 1505 | {0xfe, 0x00}, |
| 1506 | {0xff, 0x00}, |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1507 | }; |
| 1508 | |
| 1509 | #define CB_VT3253B0_AGC 193 |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1510 | /* For AIROHA */ |
Guillaume Clement | 9e4c5c2 | 2014-07-22 22:08:28 +0200 | [diff] [blame^] | 1511 | static unsigned char byVT3253B0_AGC[CB_VT3253B0_AGC][2] = { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1512 | {0xF0, 0x00}, |
| 1513 | {0xF1, 0x00}, |
| 1514 | {0xF0, 0x80}, |
| 1515 | {0xF0, 0x01}, |
| 1516 | {0xF1, 0x00}, |
| 1517 | {0xF0, 0x81}, |
| 1518 | {0xF0, 0x02}, |
| 1519 | {0xF1, 0x02}, |
| 1520 | {0xF0, 0x82}, |
| 1521 | {0xF0, 0x03}, |
| 1522 | {0xF1, 0x04}, |
| 1523 | {0xF0, 0x83}, |
| 1524 | {0xF0, 0x03}, |
| 1525 | {0xF1, 0x04}, |
| 1526 | {0xF0, 0x84}, |
| 1527 | {0xF0, 0x04}, |
| 1528 | {0xF1, 0x06}, |
| 1529 | {0xF0, 0x85}, |
| 1530 | {0xF0, 0x05}, |
| 1531 | {0xF1, 0x06}, |
| 1532 | {0xF0, 0x86}, |
| 1533 | {0xF0, 0x06}, |
| 1534 | {0xF1, 0x06}, |
| 1535 | {0xF0, 0x87}, |
| 1536 | {0xF0, 0x07}, |
| 1537 | {0xF1, 0x08}, |
| 1538 | {0xF0, 0x88}, |
| 1539 | {0xF0, 0x08}, |
| 1540 | {0xF1, 0x08}, |
| 1541 | {0xF0, 0x89}, |
| 1542 | {0xF0, 0x09}, |
| 1543 | {0xF1, 0x0A}, |
| 1544 | {0xF0, 0x8A}, |
| 1545 | {0xF0, 0x0A}, |
| 1546 | {0xF1, 0x0A}, |
| 1547 | {0xF0, 0x8B}, |
| 1548 | {0xF0, 0x0B}, |
| 1549 | {0xF1, 0x0C}, |
| 1550 | {0xF0, 0x8C}, |
| 1551 | {0xF0, 0x0C}, |
| 1552 | {0xF1, 0x0C}, |
| 1553 | {0xF0, 0x8D}, |
| 1554 | {0xF0, 0x0D}, |
| 1555 | {0xF1, 0x0E}, |
| 1556 | {0xF0, 0x8E}, |
| 1557 | {0xF0, 0x0E}, |
| 1558 | {0xF1, 0x0E}, |
| 1559 | {0xF0, 0x8F}, |
| 1560 | {0xF0, 0x0F}, |
| 1561 | {0xF1, 0x10}, |
| 1562 | {0xF0, 0x90}, |
| 1563 | {0xF0, 0x10}, |
| 1564 | {0xF1, 0x10}, |
| 1565 | {0xF0, 0x91}, |
| 1566 | {0xF0, 0x11}, |
| 1567 | {0xF1, 0x12}, |
| 1568 | {0xF0, 0x92}, |
| 1569 | {0xF0, 0x12}, |
| 1570 | {0xF1, 0x12}, |
| 1571 | {0xF0, 0x93}, |
| 1572 | {0xF0, 0x13}, |
| 1573 | {0xF1, 0x14}, |
| 1574 | {0xF0, 0x94}, |
| 1575 | {0xF0, 0x14}, |
| 1576 | {0xF1, 0x14}, |
| 1577 | {0xF0, 0x95}, |
| 1578 | {0xF0, 0x15}, |
| 1579 | {0xF1, 0x16}, |
| 1580 | {0xF0, 0x96}, |
| 1581 | {0xF0, 0x16}, |
| 1582 | {0xF1, 0x16}, |
| 1583 | {0xF0, 0x97}, |
| 1584 | {0xF0, 0x17}, |
| 1585 | {0xF1, 0x18}, |
| 1586 | {0xF0, 0x98}, |
| 1587 | {0xF0, 0x18}, |
| 1588 | {0xF1, 0x18}, |
| 1589 | {0xF0, 0x99}, |
| 1590 | {0xF0, 0x19}, |
| 1591 | {0xF1, 0x1A}, |
| 1592 | {0xF0, 0x9A}, |
| 1593 | {0xF0, 0x1A}, |
| 1594 | {0xF1, 0x1A}, |
| 1595 | {0xF0, 0x9B}, |
| 1596 | {0xF0, 0x1B}, |
| 1597 | {0xF1, 0x1C}, |
| 1598 | {0xF0, 0x9C}, |
| 1599 | {0xF0, 0x1C}, |
| 1600 | {0xF1, 0x1C}, |
| 1601 | {0xF0, 0x9D}, |
| 1602 | {0xF0, 0x1D}, |
| 1603 | {0xF1, 0x1E}, |
| 1604 | {0xF0, 0x9E}, |
| 1605 | {0xF0, 0x1E}, |
| 1606 | {0xF1, 0x1E}, |
| 1607 | {0xF0, 0x9F}, |
| 1608 | {0xF0, 0x1F}, |
| 1609 | {0xF1, 0x20}, |
| 1610 | {0xF0, 0xA0}, |
| 1611 | {0xF0, 0x20}, |
| 1612 | {0xF1, 0x20}, |
| 1613 | {0xF0, 0xA1}, |
| 1614 | {0xF0, 0x21}, |
| 1615 | {0xF1, 0x22}, |
| 1616 | {0xF0, 0xA2}, |
| 1617 | {0xF0, 0x22}, |
| 1618 | {0xF1, 0x22}, |
| 1619 | {0xF0, 0xA3}, |
| 1620 | {0xF0, 0x23}, |
| 1621 | {0xF1, 0x24}, |
| 1622 | {0xF0, 0xA4}, |
| 1623 | {0xF0, 0x24}, |
| 1624 | {0xF1, 0x24}, |
| 1625 | {0xF0, 0xA5}, |
| 1626 | {0xF0, 0x25}, |
| 1627 | {0xF1, 0x26}, |
| 1628 | {0xF0, 0xA6}, |
| 1629 | {0xF0, 0x26}, |
| 1630 | {0xF1, 0x26}, |
| 1631 | {0xF0, 0xA7}, |
| 1632 | {0xF0, 0x27}, |
| 1633 | {0xF1, 0x28}, |
| 1634 | {0xF0, 0xA8}, |
| 1635 | {0xF0, 0x28}, |
| 1636 | {0xF1, 0x28}, |
| 1637 | {0xF0, 0xA9}, |
| 1638 | {0xF0, 0x29}, |
| 1639 | {0xF1, 0x2A}, |
| 1640 | {0xF0, 0xAA}, |
| 1641 | {0xF0, 0x2A}, |
| 1642 | {0xF1, 0x2A}, |
| 1643 | {0xF0, 0xAB}, |
| 1644 | {0xF0, 0x2B}, |
| 1645 | {0xF1, 0x2C}, |
| 1646 | {0xF0, 0xAC}, |
| 1647 | {0xF0, 0x2C}, |
| 1648 | {0xF1, 0x2C}, |
| 1649 | {0xF0, 0xAD}, |
| 1650 | {0xF0, 0x2D}, |
| 1651 | {0xF1, 0x2E}, |
| 1652 | {0xF0, 0xAE}, |
| 1653 | {0xF0, 0x2E}, |
| 1654 | {0xF1, 0x2E}, |
| 1655 | {0xF0, 0xAF}, |
| 1656 | {0xF0, 0x2F}, |
| 1657 | {0xF1, 0x30}, |
| 1658 | {0xF0, 0xB0}, |
| 1659 | {0xF0, 0x30}, |
| 1660 | {0xF1, 0x30}, |
| 1661 | {0xF0, 0xB1}, |
| 1662 | {0xF0, 0x31}, |
| 1663 | {0xF1, 0x32}, |
| 1664 | {0xF0, 0xB2}, |
| 1665 | {0xF0, 0x32}, |
| 1666 | {0xF1, 0x32}, |
| 1667 | {0xF0, 0xB3}, |
| 1668 | {0xF0, 0x33}, |
| 1669 | {0xF1, 0x34}, |
| 1670 | {0xF0, 0xB4}, |
| 1671 | {0xF0, 0x34}, |
| 1672 | {0xF1, 0x34}, |
| 1673 | {0xF0, 0xB5}, |
| 1674 | {0xF0, 0x35}, |
| 1675 | {0xF1, 0x36}, |
| 1676 | {0xF0, 0xB6}, |
| 1677 | {0xF0, 0x36}, |
| 1678 | {0xF1, 0x36}, |
| 1679 | {0xF0, 0xB7}, |
| 1680 | {0xF0, 0x37}, |
| 1681 | {0xF1, 0x38}, |
| 1682 | {0xF0, 0xB8}, |
| 1683 | {0xF0, 0x38}, |
| 1684 | {0xF1, 0x38}, |
| 1685 | {0xF0, 0xB9}, |
| 1686 | {0xF0, 0x39}, |
| 1687 | {0xF1, 0x3A}, |
| 1688 | {0xF0, 0xBA}, |
| 1689 | {0xF0, 0x3A}, |
| 1690 | {0xF1, 0x3A}, |
| 1691 | {0xF0, 0xBB}, |
| 1692 | {0xF0, 0x3B}, |
| 1693 | {0xF1, 0x3C}, |
| 1694 | {0xF0, 0xBC}, |
| 1695 | {0xF0, 0x3C}, |
| 1696 | {0xF1, 0x3C}, |
| 1697 | {0xF0, 0xBD}, |
| 1698 | {0xF0, 0x3D}, |
| 1699 | {0xF1, 0x3E}, |
| 1700 | {0xF0, 0xBE}, |
| 1701 | {0xF0, 0x3E}, |
| 1702 | {0xF1, 0x3E}, |
| 1703 | {0xF0, 0xBF}, |
| 1704 | {0xF0, 0x00}, |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1705 | }; |
| 1706 | |
Guillaume Clement | 9e4c5c2 | 2014-07-22 22:08:28 +0200 | [diff] [blame^] | 1707 | static const unsigned short awcFrameTime[MAX_RATE] = |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1708 | {10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216}; |
| 1709 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1710 | /*--------------------- Static Functions --------------------------*/ |
| 1711 | |
| 1712 | static |
Charles Clément | e3fd16d | 2010-06-02 09:52:02 -0700 | [diff] [blame] | 1713 | unsigned long |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1714 | s_ulGetRatio(PSDevice pDevice); |
| 1715 | |
| 1716 | static |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 1717 | void |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1718 | s_vChangeAntenna( |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1719 | PSDevice pDevice |
| 1720 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1721 | |
| 1722 | static |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 1723 | void |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1724 | s_vChangeAntenna( |
| 1725 | PSDevice pDevice |
| 1726 | ) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1727 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1728 | if (pDevice->dwRxAntennaSel == 0) { |
| 1729 | pDevice->dwRxAntennaSel = 1; |
| 1730 | if (pDevice->bTxRxAntInv == true) |
| 1731 | BBvSetRxAntennaMode(pDevice->PortOffset, ANT_A); |
| 1732 | else |
| 1733 | BBvSetRxAntennaMode(pDevice->PortOffset, ANT_B); |
| 1734 | } else { |
| 1735 | pDevice->dwRxAntennaSel = 0; |
| 1736 | if (pDevice->bTxRxAntInv == true) |
| 1737 | BBvSetRxAntennaMode(pDevice->PortOffset, ANT_B); |
| 1738 | else |
| 1739 | BBvSetRxAntennaMode(pDevice->PortOffset, ANT_A); |
| 1740 | } |
| 1741 | if (pDevice->dwTxAntennaSel == 0) { |
| 1742 | pDevice->dwTxAntennaSel = 1; |
| 1743 | BBvSetTxAntennaMode(pDevice->PortOffset, ANT_B); |
| 1744 | } else { |
| 1745 | pDevice->dwTxAntennaSel = 0; |
| 1746 | BBvSetTxAntennaMode(pDevice->PortOffset, ANT_A); |
| 1747 | } |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1748 | } |
| 1749 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1750 | /*--------------------- Export Variables --------------------------*/ |
| 1751 | /* |
| 1752 | * Description: Calculate data frame transmitting time |
| 1753 | * |
| 1754 | * Parameters: |
| 1755 | * In: |
| 1756 | * byPreambleType - Preamble Type |
| 1757 | * byPktType - PK_TYPE_11A, PK_TYPE_11B, PK_TYPE_11GB, PK_TYPE_11GA |
| 1758 | * cbFrameLength - Baseband Type |
| 1759 | * wRate - Tx Rate |
| 1760 | * Out: |
| 1761 | * |
| 1762 | * Return Value: FrameTime |
| 1763 | * |
| 1764 | */ |
Charles Clément | b6e95cd | 2010-06-02 09:52:01 -0700 | [diff] [blame] | 1765 | unsigned int |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1766 | BBuGetFrameTime( |
| 1767 | unsigned char byPreambleType, |
| 1768 | unsigned char byPktType, |
| 1769 | unsigned int cbFrameLength, |
| 1770 | unsigned short wRate |
| 1771 | ) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1772 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1773 | unsigned int uFrameTime; |
| 1774 | unsigned int uPreamble; |
| 1775 | unsigned int uTmp; |
| 1776 | unsigned int uRateIdx = (unsigned int) wRate; |
| 1777 | unsigned int uRate = 0; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1778 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1779 | if (uRateIdx > RATE_54M) { |
| 1780 | ASSERT(0); |
| 1781 | return 0; |
| 1782 | } |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1783 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1784 | uRate = (unsigned int)awcFrameTime[uRateIdx]; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1785 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1786 | if (uRateIdx <= 3) { /* CCK mode */ |
| 1787 | if (byPreambleType == 1) /* Short */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1788 | uPreamble = 96; |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 1789 | else |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1790 | uPreamble = 192; |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 1791 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1792 | uFrameTime = (cbFrameLength * 80) / uRate; /* ????? */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1793 | uTmp = (uFrameTime * uRate) / 80; |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 1794 | if (cbFrameLength != uTmp) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1795 | uFrameTime++; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1796 | |
Joe Perches | a4ef27a | 2013-03-18 20:55:38 -0700 | [diff] [blame] | 1797 | return uPreamble + uFrameTime; |
Joe Perches | 5e0cc8a | 2013-03-18 20:55:37 -0700 | [diff] [blame] | 1798 | } else { |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1799 | uFrameTime = (cbFrameLength * 8 + 22) / uRate; /* ???????? */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1800 | uTmp = ((uFrameTime * uRate) - 22) / 8; |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 1801 | if (cbFrameLength != uTmp) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1802 | uFrameTime++; |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 1803 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1804 | uFrameTime = uFrameTime * 4; /* ??????? */ |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 1805 | if (byPktType != PK_TYPE_11A) |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1806 | uFrameTime += 6; /* ?????? */ |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 1807 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1808 | return 20 + uFrameTime; /* ?????? */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1809 | } |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1810 | } |
| 1811 | |
| 1812 | /* |
Justin P. Mattock | 7664ec8 | 2012-08-20 08:43:15 -0700 | [diff] [blame] | 1813 | * Description: Calculate Length, Service, and Signal fields of Phy for Tx |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1814 | * |
| 1815 | * Parameters: |
| 1816 | * In: |
| 1817 | * pDevice - Device Structure |
| 1818 | * cbFrameLength - Tx Frame Length |
| 1819 | * wRate - Tx Rate |
| 1820 | * Out: |
| 1821 | * pwPhyLen - pointer to Phy Length field |
| 1822 | * pbyPhySrv - pointer to Phy Service field |
| 1823 | * pbyPhySgn - pointer to Phy Signal field |
| 1824 | * |
| 1825 | * Return Value: none |
| 1826 | * |
| 1827 | */ |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 1828 | void |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1829 | BBvCalculateParameter( |
| 1830 | PSDevice pDevice, |
| 1831 | unsigned int cbFrameLength, |
| 1832 | unsigned short wRate, |
| 1833 | unsigned char byPacketType, |
| 1834 | unsigned short *pwPhyLen, |
| 1835 | unsigned char *pbyPhySrv, |
| 1836 | unsigned char *pbyPhySgn |
| 1837 | ) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1838 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1839 | unsigned int cbBitCount; |
| 1840 | unsigned int cbUsCount = 0; |
| 1841 | unsigned int cbTmp; |
| 1842 | bool bExtBit; |
| 1843 | unsigned char byPreambleType = pDevice->byPreambleType; |
| 1844 | bool bCCK = pDevice->bCCK; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1845 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1846 | cbBitCount = cbFrameLength * 8; |
| 1847 | bExtBit = false; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1848 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1849 | switch (wRate) { |
| 1850 | case RATE_1M: |
| 1851 | cbUsCount = cbBitCount; |
| 1852 | *pbyPhySgn = 0x00; |
| 1853 | break; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1854 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1855 | case RATE_2M: |
| 1856 | cbUsCount = cbBitCount / 2; |
| 1857 | if (byPreambleType == 1) |
| 1858 | *pbyPhySgn = 0x09; |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1859 | else /* long preamble */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1860 | *pbyPhySgn = 0x01; |
| 1861 | break; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1862 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1863 | case RATE_5M: |
Teodora Baluta | 1208f14 | 2013-11-10 17:12:42 +0200 | [diff] [blame] | 1864 | if (!bCCK) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1865 | cbBitCount++; |
| 1866 | cbUsCount = (cbBitCount * 10) / 55; |
| 1867 | cbTmp = (cbUsCount * 55) / 10; |
| 1868 | if (cbTmp != cbBitCount) |
| 1869 | cbUsCount++; |
| 1870 | if (byPreambleType == 1) |
| 1871 | *pbyPhySgn = 0x0a; |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1872 | else /* long preamble */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1873 | *pbyPhySgn = 0x02; |
| 1874 | break; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1875 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1876 | case RATE_11M: |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1877 | |
Teodora Baluta | 1208f14 | 2013-11-10 17:12:42 +0200 | [diff] [blame] | 1878 | if (!bCCK) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1879 | cbBitCount++; |
| 1880 | cbUsCount = cbBitCount / 11; |
| 1881 | cbTmp = cbUsCount * 11; |
| 1882 | if (cbTmp != cbBitCount) { |
| 1883 | cbUsCount++; |
| 1884 | if ((cbBitCount - cbTmp) <= 3) |
| 1885 | bExtBit = true; |
| 1886 | } |
| 1887 | if (byPreambleType == 1) |
| 1888 | *pbyPhySgn = 0x0b; |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1889 | else /* long preamble */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1890 | *pbyPhySgn = 0x03; |
| 1891 | break; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1892 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1893 | case RATE_6M: |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1894 | if (byPacketType == PK_TYPE_11A) { /*11a, 5GHZ */ |
| 1895 | *pbyPhySgn = 0x9B; /* 1001 1011 */ |
| 1896 | } else {/* 11g, 2.4GHZ */ |
| 1897 | *pbyPhySgn = 0x8B; /* 1000 1011 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1898 | } |
| 1899 | break; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1900 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1901 | case RATE_9M: |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1902 | if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */ |
| 1903 | *pbyPhySgn = 0x9F; /* 1001 1111 */ |
| 1904 | } else {/* 11g, 2.4GHZ */ |
| 1905 | *pbyPhySgn = 0x8F; /* 1000 1111 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1906 | } |
| 1907 | break; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1908 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1909 | case RATE_12M: |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1910 | if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */ |
| 1911 | *pbyPhySgn = 0x9A; /* 1001 1010 */ |
| 1912 | } else {/* 11g, 2.4GHZ */ |
| 1913 | *pbyPhySgn = 0x8A; /* 1000 1010 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1914 | } |
| 1915 | break; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1916 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1917 | case RATE_18M: |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1918 | if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */ |
| 1919 | *pbyPhySgn = 0x9E; /* 1001 1110 */ |
| 1920 | } else {/* 11g, 2.4GHZ */ |
| 1921 | *pbyPhySgn = 0x8E; /* 1000 1110 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1922 | } |
| 1923 | break; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1924 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1925 | case RATE_24M: |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1926 | if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */ |
| 1927 | *pbyPhySgn = 0x99; /* 1001 1001 */ |
| 1928 | } else {/* 11g, 2.4GHZ */ |
| 1929 | *pbyPhySgn = 0x89; /* 1000 1001 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1930 | } |
| 1931 | break; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1932 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1933 | case RATE_36M: |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1934 | if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */ |
| 1935 | *pbyPhySgn = 0x9D; /* 1001 1101 */ |
| 1936 | } else {/* 11g, 2.4GHZ */ |
| 1937 | *pbyPhySgn = 0x8D; /* 1000 1101 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1938 | } |
| 1939 | break; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1940 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1941 | case RATE_48M: |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1942 | if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */ |
| 1943 | *pbyPhySgn = 0x98; /* 1001 1000 */ |
| 1944 | } else {/* 11g, 2.4GHZ */ |
| 1945 | *pbyPhySgn = 0x88; /* 1000 1000 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1946 | } |
| 1947 | break; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1948 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1949 | case RATE_54M: |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1950 | if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */ |
| 1951 | *pbyPhySgn = 0x9C; /* 1001 1100 */ |
| 1952 | } else {/* 11g, 2.4GHZ */ |
| 1953 | *pbyPhySgn = 0x8C; /* 1000 1100 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1954 | } |
| 1955 | break; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1956 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1957 | default: |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1958 | if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */ |
| 1959 | *pbyPhySgn = 0x9C; /* 1001 1100 */ |
| 1960 | } else {/* 11g, 2.4GHZ */ |
| 1961 | *pbyPhySgn = 0x8C; /* 1000 1100 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1962 | } |
| 1963 | break; |
| 1964 | } |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1965 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1966 | if (byPacketType == PK_TYPE_11B) { |
| 1967 | *pbyPhySrv = 0x00; |
| 1968 | if (bExtBit) |
| 1969 | *pbyPhySrv = *pbyPhySrv | 0x80; |
| 1970 | *pwPhyLen = (unsigned short)cbUsCount; |
Joe Perches | 5e0cc8a | 2013-03-18 20:55:37 -0700 | [diff] [blame] | 1971 | } else { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1972 | *pbyPhySrv = 0x00; |
| 1973 | *pwPhyLen = (unsigned short)cbFrameLength; |
| 1974 | } |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1975 | } |
| 1976 | |
| 1977 | /* |
Justin P. Mattock | 789d1ae | 2012-08-20 08:43:13 -0700 | [diff] [blame] | 1978 | * Description: Read a byte from BASEBAND, by embedded programming |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1979 | * |
| 1980 | * Parameters: |
| 1981 | * In: |
| 1982 | * dwIoBase - I/O base address |
| 1983 | * byBBAddr - address of register in Baseband |
| 1984 | * Out: |
| 1985 | * pbyData - data read |
| 1986 | * |
Charles Clément | 5a5a2a6 | 2010-08-01 17:15:49 +0200 | [diff] [blame] | 1987 | * Return Value: true if succeeded; false if failed. |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1988 | * |
| 1989 | */ |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 1990 | bool BBbReadEmbedded(void __iomem *dwIoBase, unsigned char byBBAddr, unsigned char *pbyData) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1991 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1992 | unsigned short ww; |
| 1993 | unsigned char byValue; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1994 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1995 | /* BB reg offset */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1996 | VNSvOutPortB(dwIoBase + MAC_REG_BBREGADR, byBBAddr); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1997 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 1998 | /* turn on REGR */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 1999 | MACvRegBitsOn(dwIoBase, MAC_REG_BBREGCTL, BBREGCTL_REGR); |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2000 | /* W_MAX_TIMEOUT is the timeout period */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2001 | for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { |
| 2002 | VNSvInPortB(dwIoBase + MAC_REG_BBREGCTL, &byValue); |
| 2003 | if (byValue & BBREGCTL_DONE) |
| 2004 | break; |
| 2005 | } |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2006 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2007 | /* get BB data */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2008 | VNSvInPortB(dwIoBase + MAC_REG_BBREGDATA, pbyData); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2009 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2010 | if (ww == W_MAX_TIMEOUT) { |
| 2011 | DBG_PORT80(0x30); |
| 2012 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x30)\n"); |
| 2013 | return false; |
| 2014 | } |
| 2015 | return true; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2016 | } |
| 2017 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2018 | /* |
Justin P. Mattock | 789d1ae | 2012-08-20 08:43:13 -0700 | [diff] [blame] | 2019 | * Description: Write a Byte to BASEBAND, by embedded programming |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2020 | * |
| 2021 | * Parameters: |
| 2022 | * In: |
| 2023 | * dwIoBase - I/O base address |
| 2024 | * byBBAddr - address of register in Baseband |
| 2025 | * byData - data to write |
| 2026 | * Out: |
| 2027 | * none |
| 2028 | * |
Charles Clément | 5a5a2a6 | 2010-08-01 17:15:49 +0200 | [diff] [blame] | 2029 | * Return Value: true if succeeded; false if failed. |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2030 | * |
| 2031 | */ |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2032 | bool BBbWriteEmbedded(void __iomem *dwIoBase, unsigned char byBBAddr, unsigned char byData) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2033 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2034 | unsigned short ww; |
| 2035 | unsigned char byValue; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2036 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2037 | /* BB reg offset */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2038 | VNSvOutPortB(dwIoBase + MAC_REG_BBREGADR, byBBAddr); |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2039 | /* set BB data */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2040 | VNSvOutPortB(dwIoBase + MAC_REG_BBREGDATA, byData); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2041 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2042 | /* turn on BBREGCTL_REGW */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2043 | MACvRegBitsOn(dwIoBase, MAC_REG_BBREGCTL, BBREGCTL_REGW); |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2044 | /* W_MAX_TIMEOUT is the timeout period */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2045 | for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { |
| 2046 | VNSvInPortB(dwIoBase + MAC_REG_BBREGCTL, &byValue); |
| 2047 | if (byValue & BBREGCTL_DONE) |
| 2048 | break; |
| 2049 | } |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2050 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2051 | if (ww == W_MAX_TIMEOUT) { |
| 2052 | DBG_PORT80(0x31); |
| 2053 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x31)\n"); |
| 2054 | return false; |
| 2055 | } |
| 2056 | return true; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2057 | } |
| 2058 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2059 | /* |
| 2060 | * Description: Test if all bits are set for the Baseband register |
| 2061 | * |
| 2062 | * Parameters: |
| 2063 | * In: |
| 2064 | * dwIoBase - I/O base address |
| 2065 | * byBBAddr - address of register in Baseband |
| 2066 | * byTestBits - TestBits |
| 2067 | * Out: |
| 2068 | * none |
| 2069 | * |
Charles Clément | 5a5a2a6 | 2010-08-01 17:15:49 +0200 | [diff] [blame] | 2070 | * Return Value: true if all TestBits are set; false otherwise. |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2071 | * |
| 2072 | */ |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2073 | bool BBbIsRegBitsOn(void __iomem *dwIoBase, unsigned char byBBAddr, unsigned char byTestBits) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2074 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2075 | unsigned char byOrgData; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2076 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2077 | BBbReadEmbedded(dwIoBase, byBBAddr, &byOrgData); |
| 2078 | return (byOrgData & byTestBits) == byTestBits; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2079 | } |
| 2080 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2081 | /* |
| 2082 | * Description: Test if all bits are clear for the Baseband register |
| 2083 | * |
| 2084 | * Parameters: |
| 2085 | * In: |
| 2086 | * dwIoBase - I/O base address |
| 2087 | * byBBAddr - address of register in Baseband |
| 2088 | * byTestBits - TestBits |
| 2089 | * Out: |
| 2090 | * none |
| 2091 | * |
Charles Clément | 5a5a2a6 | 2010-08-01 17:15:49 +0200 | [diff] [blame] | 2092 | * Return Value: true if all TestBits are clear; false otherwise. |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2093 | * |
| 2094 | */ |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2095 | bool BBbIsRegBitsOff(void __iomem *dwIoBase, unsigned char byBBAddr, unsigned char byTestBits) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2096 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2097 | unsigned char byOrgData; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2098 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2099 | BBbReadEmbedded(dwIoBase, byBBAddr, &byOrgData); |
| 2100 | return (byOrgData & byTestBits) == 0; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2101 | } |
| 2102 | |
| 2103 | /* |
| 2104 | * Description: VIA VT3253 Baseband chip init function |
| 2105 | * |
| 2106 | * Parameters: |
| 2107 | * In: |
| 2108 | * dwIoBase - I/O base address |
| 2109 | * byRevId - Revision ID |
| 2110 | * byRFType - RF type |
| 2111 | * Out: |
| 2112 | * none |
| 2113 | * |
Charles Clément | 5a5a2a6 | 2010-08-01 17:15:49 +0200 | [diff] [blame] | 2114 | * Return Value: true if succeeded; false if failed. |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2115 | * |
| 2116 | */ |
| 2117 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2118 | bool BBbVT3253Init(PSDevice pDevice) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2119 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2120 | bool bResult = true; |
| 2121 | int ii; |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2122 | void __iomem *dwIoBase = pDevice->PortOffset; |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2123 | unsigned char byRFType = pDevice->byRFType; |
| 2124 | unsigned char byLocalID = pDevice->byLocalID; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2125 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2126 | if (byRFType == RF_RFMD2959) { |
| 2127 | if (byLocalID <= REV_ID_VT3253_A1) { |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2128 | for (ii = 0; ii < CB_VT3253_INIT_FOR_RFMD; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2129 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253InitTab_RFMD[ii][0], byVT3253InitTab_RFMD[ii][1]); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2130 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2131 | } else { |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2132 | for (ii = 0; ii < CB_VT3253B0_INIT_FOR_RFMD; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2133 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_RFMD[ii][0], byVT3253B0_RFMD[ii][1]); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2134 | |
| 2135 | for (ii = 0; ii < CB_VT3253B0_AGC_FOR_RFMD2959; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2136 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC4_RFMD2959[ii][0], byVT3253B0_AGC4_RFMD2959[ii][1]); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2137 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2138 | VNSvOutPortD(dwIoBase + MAC_REG_ITRTMSET, 0x23); |
| 2139 | MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0); |
| 2140 | } |
| 2141 | pDevice->abyBBVGA[0] = 0x18; |
| 2142 | pDevice->abyBBVGA[1] = 0x0A; |
| 2143 | pDevice->abyBBVGA[2] = 0x0; |
| 2144 | pDevice->abyBBVGA[3] = 0x0; |
| 2145 | pDevice->ldBmThreshold[0] = -70; |
| 2146 | pDevice->ldBmThreshold[1] = -50; |
| 2147 | pDevice->ldBmThreshold[2] = 0; |
| 2148 | pDevice->ldBmThreshold[3] = 0; |
| 2149 | } else if ((byRFType == RF_AIROHA) || (byRFType == RF_AL2230S)) { |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2150 | for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2151 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AIROHA2230[ii][0], byVT3253B0_AIROHA2230[ii][1]); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2152 | |
| 2153 | for (ii = 0; ii < CB_VT3253B0_AGC; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2154 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2155 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2156 | pDevice->abyBBVGA[0] = 0x1C; |
| 2157 | pDevice->abyBBVGA[1] = 0x10; |
| 2158 | pDevice->abyBBVGA[2] = 0x0; |
| 2159 | pDevice->abyBBVGA[3] = 0x0; |
| 2160 | pDevice->ldBmThreshold[0] = -70; |
| 2161 | pDevice->ldBmThreshold[1] = -48; |
| 2162 | pDevice->ldBmThreshold[2] = 0; |
| 2163 | pDevice->ldBmThreshold[3] = 0; |
| 2164 | } else if (byRFType == RF_UW2451) { |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2165 | for (ii = 0; ii < CB_VT3253B0_INIT_FOR_UW2451; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2166 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_UW2451[ii][0], byVT3253B0_UW2451[ii][1]); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2167 | |
| 2168 | for (ii = 0; ii < CB_VT3253B0_AGC; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2169 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2170 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2171 | VNSvOutPortB(dwIoBase + MAC_REG_ITRTMSET, 0x23); |
| 2172 | MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2173 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2174 | pDevice->abyBBVGA[0] = 0x14; |
| 2175 | pDevice->abyBBVGA[1] = 0x0A; |
| 2176 | pDevice->abyBBVGA[2] = 0x0; |
| 2177 | pDevice->abyBBVGA[3] = 0x0; |
| 2178 | pDevice->ldBmThreshold[0] = -60; |
| 2179 | pDevice->ldBmThreshold[1] = -50; |
| 2180 | pDevice->ldBmThreshold[2] = 0; |
| 2181 | pDevice->ldBmThreshold[3] = 0; |
| 2182 | } else if (byRFType == RF_UW2452) { |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2183 | for (ii = 0; ii < CB_VT3253B0_INIT_FOR_UW2451; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2184 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_UW2451[ii][0], byVT3253B0_UW2451[ii][1]); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2185 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2186 | /* Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted) */ |
| 2187 | /*bResult &= BBbWriteEmbedded(dwIoBase,0x09,0x41);*/ |
| 2188 | /* Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted) */ |
| 2189 | /*bResult &= BBbWriteEmbedded(dwIoBase,0x0a,0x28);*/ |
| 2190 | /* Select VC1/VC2, CR215 = 0x02->0x06 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2191 | bResult &= BBbWriteEmbedded(dwIoBase, 0xd7, 0x06); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2192 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2193 | /* {{RobertYu:20050125, request by Jack */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2194 | bResult &= BBbWriteEmbedded(dwIoBase, 0x90, 0x20); |
| 2195 | bResult &= BBbWriteEmbedded(dwIoBase, 0x97, 0xeb); |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2196 | /* }} */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2197 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2198 | /* {{RobertYu:20050221, request by Jack */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2199 | bResult &= BBbWriteEmbedded(dwIoBase, 0xa6, 0x00); |
| 2200 | bResult &= BBbWriteEmbedded(dwIoBase, 0xa8, 0x30); |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2201 | /* }} */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2202 | bResult &= BBbWriteEmbedded(dwIoBase, 0xb0, 0x58); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2203 | |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2204 | for (ii = 0; ii < CB_VT3253B0_AGC; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2205 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2206 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2207 | pDevice->abyBBVGA[0] = 0x14; |
| 2208 | pDevice->abyBBVGA[1] = 0x0A; |
| 2209 | pDevice->abyBBVGA[2] = 0x0; |
| 2210 | pDevice->abyBBVGA[3] = 0x0; |
| 2211 | pDevice->ldBmThreshold[0] = -60; |
| 2212 | pDevice->ldBmThreshold[1] = -50; |
| 2213 | pDevice->ldBmThreshold[2] = 0; |
| 2214 | pDevice->ldBmThreshold[3] = 0; |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2215 | /* }} RobertYu */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2216 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2217 | } else if (byRFType == RF_VT3226) { |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2218 | for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2219 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AIROHA2230[ii][0], byVT3253B0_AIROHA2230[ii][1]); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2220 | |
| 2221 | for (ii = 0; ii < CB_VT3253B0_AGC; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2222 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2223 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2224 | pDevice->abyBBVGA[0] = 0x1C; |
| 2225 | pDevice->abyBBVGA[1] = 0x10; |
| 2226 | pDevice->abyBBVGA[2] = 0x0; |
| 2227 | pDevice->abyBBVGA[3] = 0x0; |
| 2228 | pDevice->ldBmThreshold[0] = -70; |
| 2229 | pDevice->ldBmThreshold[1] = -48; |
| 2230 | pDevice->ldBmThreshold[2] = 0; |
| 2231 | pDevice->ldBmThreshold[3] = 0; |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2232 | /* Fix VT3226 DFC system timing issue */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2233 | MACvSetRFLE_LatchBase(dwIoBase); |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2234 | /* {{ RobertYu: 20050104 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2235 | } else if (byRFType == RF_AIROHA7230) { |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2236 | for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2237 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AIROHA2230[ii][0], byVT3253B0_AIROHA2230[ii][1]); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2238 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2239 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2240 | /* {{ RobertYu:20050223, request by JerryChung */ |
| 2241 | /* Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted) */ |
| 2242 | /*bResult &= BBbWriteEmbedded(dwIoBase,0x09,0x41);*/ |
| 2243 | /* Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted) */ |
| 2244 | /*bResult &= BBbWriteEmbedded(dwIoBase,0x0a,0x28);*/ |
| 2245 | /* Select VC1/VC2, CR215 = 0x02->0x06 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2246 | bResult &= BBbWriteEmbedded(dwIoBase, 0xd7, 0x06); |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2247 | /* }} */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2248 | |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2249 | for (ii = 0; ii < CB_VT3253B0_AGC; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2250 | bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2251 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2252 | pDevice->abyBBVGA[0] = 0x1C; |
| 2253 | pDevice->abyBBVGA[1] = 0x10; |
| 2254 | pDevice->abyBBVGA[2] = 0x0; |
| 2255 | pDevice->abyBBVGA[3] = 0x0; |
| 2256 | pDevice->ldBmThreshold[0] = -70; |
| 2257 | pDevice->ldBmThreshold[1] = -48; |
| 2258 | pDevice->ldBmThreshold[2] = 0; |
| 2259 | pDevice->ldBmThreshold[3] = 0; |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2260 | /* }} RobertYu */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2261 | } else { |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2262 | /* No VGA Table now */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2263 | pDevice->bUpdateBBVGA = false; |
| 2264 | pDevice->abyBBVGA[0] = 0x1C; |
| 2265 | } |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2266 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2267 | if (byLocalID > REV_ID_VT3253_A1) { |
| 2268 | BBbWriteEmbedded(dwIoBase, 0x04, 0x7F); |
| 2269 | BBbWriteEmbedded(dwIoBase, 0x0D, 0x01); |
| 2270 | } |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2271 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2272 | return bResult; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2273 | } |
| 2274 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2275 | /* |
| 2276 | * Description: Read All Baseband Registers |
| 2277 | * |
| 2278 | * Parameters: |
| 2279 | * In: |
| 2280 | * dwIoBase - I/O base address |
| 2281 | * pbyBBRegs - Point to struct that stores Baseband Registers |
| 2282 | * Out: |
| 2283 | * none |
| 2284 | * |
| 2285 | * Return Value: none |
| 2286 | * |
| 2287 | */ |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2288 | void BBvReadAllRegs(void __iomem *dwIoBase, unsigned char *pbyBBRegs) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2289 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2290 | int ii; |
| 2291 | unsigned char byBase = 1; |
| 2292 | for (ii = 0; ii < BB_MAX_CONTEXT_SIZE; ii++) { |
| 2293 | BBbReadEmbedded(dwIoBase, (unsigned char)(ii*byBase), pbyBBRegs); |
| 2294 | pbyBBRegs += byBase; |
| 2295 | } |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2296 | } |
| 2297 | |
| 2298 | /* |
| 2299 | * Description: Turn on BaseBand Loopback mode |
| 2300 | * |
| 2301 | * Parameters: |
| 2302 | * In: |
| 2303 | * dwIoBase - I/O base address |
| 2304 | * bCCK - If CCK is set |
| 2305 | * Out: |
| 2306 | * none |
| 2307 | * |
| 2308 | * Return Value: none |
| 2309 | * |
| 2310 | */ |
| 2311 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2312 | void BBvLoopbackOn(PSDevice pDevice) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2313 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2314 | unsigned char byData; |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2315 | void __iomem *dwIoBase = pDevice->PortOffset; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2316 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2317 | /* CR C9 = 0x00 */ |
| 2318 | BBbReadEmbedded(dwIoBase, 0xC9, &pDevice->byBBCRc9); /* CR201 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2319 | BBbWriteEmbedded(dwIoBase, 0xC9, 0); |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2320 | BBbReadEmbedded(dwIoBase, 0x4D, &pDevice->byBBCR4d); /* CR77 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2321 | BBbWriteEmbedded(dwIoBase, 0x4D, 0x90); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2322 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2323 | /* CR 88 = 0x02(CCK), 0x03(OFDM) */ |
| 2324 | BBbReadEmbedded(dwIoBase, 0x88, &pDevice->byBBCR88); /* CR136 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2325 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2326 | if (pDevice->uConnectionRate <= RATE_11M) { /* CCK */ |
| 2327 | /* Enable internal digital loopback: CR33 |= 0000 0001 */ |
| 2328 | BBbReadEmbedded(dwIoBase, 0x21, &byData); /* CR33 */ |
| 2329 | BBbWriteEmbedded(dwIoBase, 0x21, (unsigned char)(byData | 0x01)); /* CR33 */ |
| 2330 | /* CR154 = 0x00 */ |
| 2331 | BBbWriteEmbedded(dwIoBase, 0x9A, 0); /* CR154 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2332 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2333 | BBbWriteEmbedded(dwIoBase, 0x88, 0x02); /* CR239 */ |
| 2334 | } else { /* OFDM */ |
| 2335 | /* Enable internal digital loopback:CR154 |= 0000 0001 */ |
| 2336 | BBbReadEmbedded(dwIoBase, 0x9A, &byData); /* CR154 */ |
| 2337 | BBbWriteEmbedded(dwIoBase, 0x9A, (unsigned char)(byData | 0x01)); /* CR154 */ |
| 2338 | /* CR33 = 0x00 */ |
| 2339 | BBbWriteEmbedded(dwIoBase, 0x21, 0); /* CR33 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2340 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2341 | BBbWriteEmbedded(dwIoBase, 0x88, 0x03); /* CR239 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2342 | } |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2343 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2344 | /* CR14 = 0x00 */ |
| 2345 | BBbWriteEmbedded(dwIoBase, 0x0E, 0); /* CR14 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2346 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2347 | /* Disable TX_IQUN */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2348 | BBbReadEmbedded(pDevice->PortOffset, 0x09, &pDevice->byBBCR09); |
| 2349 | BBbWriteEmbedded(pDevice->PortOffset, 0x09, (unsigned char)(pDevice->byBBCR09 & 0xDE)); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2350 | } |
| 2351 | |
| 2352 | /* |
| 2353 | * Description: Turn off BaseBand Loopback mode |
| 2354 | * |
| 2355 | * Parameters: |
| 2356 | * In: |
| 2357 | * pDevice - Device Structure |
| 2358 | * |
| 2359 | * Out: |
| 2360 | * none |
| 2361 | * |
| 2362 | * Return Value: none |
| 2363 | * |
| 2364 | */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2365 | void BBvLoopbackOff(PSDevice pDevice) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2366 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2367 | unsigned char byData; |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2368 | void __iomem *dwIoBase = pDevice->PortOffset; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2369 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2370 | BBbWriteEmbedded(dwIoBase, 0xC9, pDevice->byBBCRc9); /* CR201 */ |
| 2371 | BBbWriteEmbedded(dwIoBase, 0x88, pDevice->byBBCR88); /* CR136 */ |
| 2372 | BBbWriteEmbedded(dwIoBase, 0x09, pDevice->byBBCR09); /* CR136 */ |
| 2373 | BBbWriteEmbedded(dwIoBase, 0x4D, pDevice->byBBCR4d); /* CR77 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2374 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2375 | if (pDevice->uConnectionRate <= RATE_11M) { /* CCK */ |
| 2376 | /* Set the CR33 Bit2 to disable internal Loopback. */ |
| 2377 | BBbReadEmbedded(dwIoBase, 0x21, &byData);/* CR33 */ |
| 2378 | BBbWriteEmbedded(dwIoBase, 0x21, (unsigned char)(byData & 0xFE)); /* CR33 */ |
| 2379 | } else { /* OFDM */ |
| 2380 | BBbReadEmbedded(dwIoBase, 0x9A, &byData); /* CR154 */ |
| 2381 | BBbWriteEmbedded(dwIoBase, 0x9A, (unsigned char)(byData & 0xFE)); /* CR154 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2382 | } |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2383 | BBbReadEmbedded(dwIoBase, 0x0E, &byData); /* CR14 */ |
| 2384 | BBbWriteEmbedded(dwIoBase, 0x0E, (unsigned char)(byData | 0x80)); /* CR14 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2385 | } |
| 2386 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2387 | /* |
| 2388 | * Description: Set ShortSlotTime mode |
| 2389 | * |
| 2390 | * Parameters: |
| 2391 | * In: |
| 2392 | * pDevice - Device Structure |
| 2393 | * Out: |
| 2394 | * none |
| 2395 | * |
| 2396 | * Return Value: none |
| 2397 | * |
| 2398 | */ |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 2399 | void |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2400 | BBvSetShortSlotTime(PSDevice pDevice) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2401 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2402 | unsigned char byBBRxConf = 0; |
| 2403 | unsigned char byBBVGA = 0; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2404 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2405 | BBbReadEmbedded(pDevice->PortOffset, 0x0A, &byBBRxConf); /* CR10 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2406 | |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2407 | if (pDevice->bShortSlotTime) |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2408 | byBBRxConf &= 0xDF; /* 1101 1111 */ |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2409 | else |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2410 | byBBRxConf |= 0x20; /* 0010 0000 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2411 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2412 | /* patch for 3253B0 Baseband with Cardbus module */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2413 | BBbReadEmbedded(pDevice->PortOffset, 0xE7, &byBBVGA); |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2414 | if (byBBVGA == pDevice->abyBBVGA[0]) |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2415 | byBBRxConf |= 0x20; /* 0010 0000 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2416 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2417 | BBbWriteEmbedded(pDevice->PortOffset, 0x0A, byBBRxConf); /* CR10 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2418 | } |
| 2419 | |
Charles Clément | 3fc9b58 | 2010-06-24 11:02:27 -0700 | [diff] [blame] | 2420 | void BBvSetVGAGainOffset(PSDevice pDevice, unsigned char byData) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2421 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2422 | unsigned char byBBRxConf = 0; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2423 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2424 | BBbWriteEmbedded(pDevice->PortOffset, 0xE7, byData); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2425 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2426 | BBbReadEmbedded(pDevice->PortOffset, 0x0A, &byBBRxConf); /* CR10 */ |
| 2427 | /* patch for 3253B0 Baseband with Cardbus module */ |
Archana kumari | 5c36d5a | 2013-10-24 23:59:47 +0530 | [diff] [blame] | 2428 | if (byData == pDevice->abyBBVGA[0]) |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2429 | byBBRxConf |= 0x20; /* 0010 0000 */ |
Archana kumari | 5c36d5a | 2013-10-24 23:59:47 +0530 | [diff] [blame] | 2430 | else if (pDevice->bShortSlotTime) |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2431 | byBBRxConf &= 0xDF; /* 1101 1111 */ |
Archana kumari | 5c36d5a | 2013-10-24 23:59:47 +0530 | [diff] [blame] | 2432 | else |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2433 | byBBRxConf |= 0x20; /* 0010 0000 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2434 | pDevice->byBBVGACurrent = byData; |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2435 | BBbWriteEmbedded(pDevice->PortOffset, 0x0A, byBBRxConf); /* CR10 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2436 | } |
| 2437 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2438 | /* |
| 2439 | * Description: Baseband SoftwareReset |
| 2440 | * |
| 2441 | * Parameters: |
| 2442 | * In: |
| 2443 | * dwIoBase - I/O base address |
| 2444 | * Out: |
| 2445 | * none |
| 2446 | * |
| 2447 | * Return Value: none |
| 2448 | * |
| 2449 | */ |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 2450 | void |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2451 | BBvSoftwareReset(void __iomem *dwIoBase) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2452 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2453 | BBbWriteEmbedded(dwIoBase, 0x50, 0x40); |
| 2454 | BBbWriteEmbedded(dwIoBase, 0x50, 0); |
| 2455 | BBbWriteEmbedded(dwIoBase, 0x9C, 0x01); |
| 2456 | BBbWriteEmbedded(dwIoBase, 0x9C, 0); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2457 | } |
| 2458 | |
| 2459 | /* |
| 2460 | * Description: Baseband Power Save Mode ON |
| 2461 | * |
| 2462 | * Parameters: |
| 2463 | * In: |
| 2464 | * dwIoBase - I/O base address |
| 2465 | * Out: |
| 2466 | * none |
| 2467 | * |
| 2468 | * Return Value: none |
| 2469 | * |
| 2470 | */ |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 2471 | void |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2472 | BBvPowerSaveModeON(void __iomem *dwIoBase) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2473 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2474 | unsigned char byOrgData; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2475 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2476 | BBbReadEmbedded(dwIoBase, 0x0D, &byOrgData); |
| 2477 | byOrgData |= BIT0; |
| 2478 | BBbWriteEmbedded(dwIoBase, 0x0D, byOrgData); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2479 | } |
| 2480 | |
| 2481 | /* |
| 2482 | * Description: Baseband Power Save Mode OFF |
| 2483 | * |
| 2484 | * Parameters: |
| 2485 | * In: |
| 2486 | * dwIoBase - I/O base address |
| 2487 | * Out: |
| 2488 | * none |
| 2489 | * |
| 2490 | * Return Value: none |
| 2491 | * |
| 2492 | */ |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 2493 | void |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2494 | BBvPowerSaveModeOFF(void __iomem *dwIoBase) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2495 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2496 | unsigned char byOrgData; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2497 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2498 | BBbReadEmbedded(dwIoBase, 0x0D, &byOrgData); |
| 2499 | byOrgData &= ~(BIT0); |
| 2500 | BBbWriteEmbedded(dwIoBase, 0x0D, byOrgData); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2501 | } |
| 2502 | |
| 2503 | /* |
| 2504 | * Description: Set Tx Antenna mode |
| 2505 | * |
| 2506 | * Parameters: |
| 2507 | * In: |
| 2508 | * pDevice - Device Structure |
| 2509 | * byAntennaMode - Antenna Mode |
| 2510 | * Out: |
| 2511 | * none |
| 2512 | * |
| 2513 | * Return Value: none |
| 2514 | * |
| 2515 | */ |
| 2516 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 2517 | void |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2518 | BBvSetTxAntennaMode(void __iomem *dwIoBase, unsigned char byAntennaMode) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2519 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2520 | unsigned char byBBTxConf; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2521 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2522 | BBbReadEmbedded(dwIoBase, 0x09, &byBBTxConf); /* CR09 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2523 | if (byAntennaMode == ANT_DIVERSITY) { |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2524 | /* bit 1 is diversity */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2525 | byBBTxConf |= 0x02; |
| 2526 | } else if (byAntennaMode == ANT_A) { |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2527 | /* bit 2 is ANTSEL */ |
| 2528 | byBBTxConf &= 0xF9; /* 1111 1001 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2529 | } else if (byAntennaMode == ANT_B) { |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2530 | byBBTxConf &= 0xFD; /* 1111 1101 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2531 | byBBTxConf |= 0x04; |
| 2532 | } |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2533 | BBbWriteEmbedded(dwIoBase, 0x09, byBBTxConf); /* CR09 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2534 | } |
| 2535 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2536 | /* |
| 2537 | * Description: Set Rx Antenna mode |
| 2538 | * |
| 2539 | * Parameters: |
| 2540 | * In: |
| 2541 | * pDevice - Device Structure |
| 2542 | * byAntennaMode - Antenna Mode |
| 2543 | * Out: |
| 2544 | * none |
| 2545 | * |
| 2546 | * Return Value: none |
| 2547 | * |
| 2548 | */ |
| 2549 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 2550 | void |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2551 | BBvSetRxAntennaMode(void __iomem *dwIoBase, unsigned char byAntennaMode) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2552 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2553 | unsigned char byBBRxConf; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2554 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2555 | BBbReadEmbedded(dwIoBase, 0x0A, &byBBRxConf); /* CR10 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2556 | if (byAntennaMode == ANT_DIVERSITY) { |
| 2557 | byBBRxConf |= 0x01; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2558 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2559 | } else if (byAntennaMode == ANT_A) { |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2560 | byBBRxConf &= 0xFC; /* 1111 1100 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2561 | } else if (byAntennaMode == ANT_B) { |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2562 | byBBRxConf &= 0xFE; /* 1111 1110 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2563 | byBBRxConf |= 0x02; |
| 2564 | } |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2565 | BBbWriteEmbedded(dwIoBase, 0x0A, byBBRxConf); /* CR10 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2566 | } |
| 2567 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2568 | /* |
| 2569 | * Description: BBvSetDeepSleep |
| 2570 | * |
| 2571 | * Parameters: |
| 2572 | * In: |
| 2573 | * pDevice - Device Structure |
| 2574 | * Out: |
| 2575 | * none |
| 2576 | * |
| 2577 | * Return Value: none |
| 2578 | * |
| 2579 | */ |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 2580 | void |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2581 | BBvSetDeepSleep(void __iomem *dwIoBase, unsigned char byLocalID) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2582 | { |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2583 | BBbWriteEmbedded(dwIoBase, 0x0C, 0x17); /* CR12 */ |
| 2584 | BBbWriteEmbedded(dwIoBase, 0x0D, 0xB9); /* CR13 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2585 | } |
| 2586 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 2587 | void |
Guillaume Clement | 1683440 | 2014-07-22 22:08:26 +0200 | [diff] [blame] | 2588 | BBvExitDeepSleep(void __iomem *dwIoBase, unsigned char byLocalID) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2589 | { |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2590 | BBbWriteEmbedded(dwIoBase, 0x0C, 0x00); /* CR12 */ |
| 2591 | BBbWriteEmbedded(dwIoBase, 0x0D, 0x01); /* CR13 */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2592 | } |
| 2593 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2594 | static |
Charles Clément | e3fd16d | 2010-06-02 09:52:02 -0700 | [diff] [blame] | 2595 | unsigned long |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2596 | s_ulGetRatio(PSDevice pDevice) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2597 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2598 | unsigned long ulRatio = 0; |
| 2599 | unsigned long ulMaxPacket; |
| 2600 | unsigned long ulPacketNum; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2601 | |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2602 | /* This is a thousand-ratio */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2603 | ulMaxPacket = pDevice->uNumSQ3[RATE_54M]; |
| 2604 | if (pDevice->uNumSQ3[RATE_54M] != 0) { |
| 2605 | ulPacketNum = pDevice->uNumSQ3[RATE_54M]; |
| 2606 | ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2607 | ulRatio += TOP_RATE_54M; |
| 2608 | } |
| 2609 | if (pDevice->uNumSQ3[RATE_48M] > ulMaxPacket) { |
| 2610 | ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M]; |
| 2611 | ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2612 | ulRatio += TOP_RATE_48M; |
| 2613 | ulMaxPacket = pDevice->uNumSQ3[RATE_48M]; |
| 2614 | } |
| 2615 | if (pDevice->uNumSQ3[RATE_36M] > ulMaxPacket) { |
| 2616 | ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M] + |
| 2617 | pDevice->uNumSQ3[RATE_36M]; |
| 2618 | ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2619 | ulRatio += TOP_RATE_36M; |
| 2620 | ulMaxPacket = pDevice->uNumSQ3[RATE_36M]; |
| 2621 | } |
| 2622 | if (pDevice->uNumSQ3[RATE_24M] > ulMaxPacket) { |
| 2623 | ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M] + |
| 2624 | pDevice->uNumSQ3[RATE_36M] + pDevice->uNumSQ3[RATE_24M]; |
| 2625 | ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2626 | ulRatio += TOP_RATE_24M; |
| 2627 | ulMaxPacket = pDevice->uNumSQ3[RATE_24M]; |
| 2628 | } |
| 2629 | if (pDevice->uNumSQ3[RATE_18M] > ulMaxPacket) { |
| 2630 | ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M] + |
| 2631 | pDevice->uNumSQ3[RATE_36M] + pDevice->uNumSQ3[RATE_24M] + |
| 2632 | pDevice->uNumSQ3[RATE_18M]; |
| 2633 | ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2634 | ulRatio += TOP_RATE_18M; |
| 2635 | ulMaxPacket = pDevice->uNumSQ3[RATE_18M]; |
| 2636 | } |
| 2637 | if (pDevice->uNumSQ3[RATE_12M] > ulMaxPacket) { |
| 2638 | ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M] + |
| 2639 | pDevice->uNumSQ3[RATE_36M] + pDevice->uNumSQ3[RATE_24M] + |
| 2640 | pDevice->uNumSQ3[RATE_18M] + pDevice->uNumSQ3[RATE_12M]; |
| 2641 | ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2642 | ulRatio += TOP_RATE_12M; |
| 2643 | ulMaxPacket = pDevice->uNumSQ3[RATE_12M]; |
| 2644 | } |
| 2645 | if (pDevice->uNumSQ3[RATE_11M] > ulMaxPacket) { |
| 2646 | ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M] - |
| 2647 | pDevice->uNumSQ3[RATE_2M] - pDevice->uNumSQ3[RATE_5M] - |
| 2648 | pDevice->uNumSQ3[RATE_6M] - pDevice->uNumSQ3[RATE_9M]; |
| 2649 | ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2650 | ulRatio += TOP_RATE_11M; |
| 2651 | ulMaxPacket = pDevice->uNumSQ3[RATE_11M]; |
| 2652 | } |
| 2653 | if (pDevice->uNumSQ3[RATE_9M] > ulMaxPacket) { |
| 2654 | ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M] - |
| 2655 | pDevice->uNumSQ3[RATE_2M] - pDevice->uNumSQ3[RATE_5M] - |
| 2656 | pDevice->uNumSQ3[RATE_6M]; |
| 2657 | ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2658 | ulRatio += TOP_RATE_9M; |
| 2659 | ulMaxPacket = pDevice->uNumSQ3[RATE_9M]; |
| 2660 | } |
| 2661 | if (pDevice->uNumSQ3[RATE_6M] > ulMaxPacket) { |
| 2662 | ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M] - |
| 2663 | pDevice->uNumSQ3[RATE_2M] - pDevice->uNumSQ3[RATE_5M]; |
| 2664 | ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2665 | ulRatio += TOP_RATE_6M; |
| 2666 | ulMaxPacket = pDevice->uNumSQ3[RATE_6M]; |
| 2667 | } |
| 2668 | if (pDevice->uNumSQ3[RATE_5M] > ulMaxPacket) { |
| 2669 | ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M] - |
| 2670 | pDevice->uNumSQ3[RATE_2M]; |
| 2671 | ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2672 | ulRatio += TOP_RATE_55M; |
| 2673 | ulMaxPacket = pDevice->uNumSQ3[RATE_5M]; |
| 2674 | } |
| 2675 | if (pDevice->uNumSQ3[RATE_2M] > ulMaxPacket) { |
| 2676 | ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M]; |
| 2677 | ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2678 | ulRatio += TOP_RATE_2M; |
| 2679 | ulMaxPacket = pDevice->uNumSQ3[RATE_2M]; |
| 2680 | } |
| 2681 | if (pDevice->uNumSQ3[RATE_1M] > ulMaxPacket) { |
| 2682 | ulPacketNum = pDevice->uDiversityCnt; |
| 2683 | ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2684 | ulRatio += TOP_RATE_1M; |
| 2685 | } |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2686 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2687 | return ulRatio; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2688 | } |
| 2689 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 2690 | void |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2691 | BBvClearAntDivSQ3Value(PSDevice pDevice) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2692 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2693 | unsigned int ii; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2694 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2695 | pDevice->uDiversityCnt = 0; |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2696 | for (ii = 0; ii < MAX_RATE; ii++) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2697 | pDevice->uNumSQ3[ii] = 0; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2698 | } |
| 2699 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2700 | /* |
| 2701 | * Description: Antenna Diversity |
| 2702 | * |
| 2703 | * Parameters: |
| 2704 | * In: |
| 2705 | * pDevice - Device Structure |
| 2706 | * byRSR - RSR from received packet |
| 2707 | * bySQ3 - SQ3 value from received packet |
| 2708 | * Out: |
| 2709 | * none |
| 2710 | * |
| 2711 | * Return Value: none |
| 2712 | * |
| 2713 | */ |
| 2714 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 2715 | void |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2716 | BBvAntennaDiversity(PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ3) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2717 | { |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2718 | if ((byRxRate >= MAX_RATE) || (pDevice->wAntDiversityMaxRate >= MAX_RATE)) |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2719 | return; |
Guido Martínez | bc5cf65 | 2014-04-19 16:45:00 -0300 | [diff] [blame] | 2720 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2721 | pDevice->uDiversityCnt++; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2722 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2723 | pDevice->uNumSQ3[byRxRate]++; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2724 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2725 | if (pDevice->byAntennaState == 0) { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2726 | if (pDevice->uDiversityCnt > pDevice->ulDiversityNValue) { |
| 2727 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ulDiversityNValue=[%d],54M-[%d]\n", |
| 2728 | (int)pDevice->ulDiversityNValue, (int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate]); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2729 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2730 | if (pDevice->uNumSQ3[pDevice->wAntDiversityMaxRate] < pDevice->uDiversityCnt/2) { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2731 | pDevice->ulRatio_State0 = s_ulGetRatio(pDevice); |
| 2732 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SQ3_State0, rate = [%08x]\n", (int)pDevice->ulRatio_State0); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2733 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2734 | if (pDevice->byTMax == 0) |
| 2735 | return; |
| 2736 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "1.[%08x], uNumSQ3[%d]=%d, %d\n", |
| 2737 | (int)pDevice->ulRatio_State0, (int)pDevice->wAntDiversityMaxRate, |
| 2738 | (int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate], (int)pDevice->uDiversityCnt); |
Joe Perches | f2046f9 | 2013-03-18 20:55:36 -0700 | [diff] [blame] | 2739 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2740 | s_vChangeAntenna(pDevice); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2741 | pDevice->byAntennaState = 1; |
| 2742 | del_timer(&pDevice->TimerSQ3Tmax3); |
| 2743 | del_timer(&pDevice->TimerSQ3Tmax2); |
| 2744 | pDevice->TimerSQ3Tmax1.expires = RUN_AT(pDevice->byTMax * HZ); |
| 2745 | add_timer(&pDevice->TimerSQ3Tmax1); |
| 2746 | |
| 2747 | } else { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2748 | pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ); |
| 2749 | add_timer(&pDevice->TimerSQ3Tmax3); |
| 2750 | } |
| 2751 | BBvClearAntDivSQ3Value(pDevice); |
| 2752 | |
| 2753 | } |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2754 | } else { /* byAntennaState == 1 */ |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2755 | |
| 2756 | if (pDevice->uDiversityCnt > pDevice->ulDiversityMValue) { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2757 | del_timer(&pDevice->TimerSQ3Tmax1); |
| 2758 | |
| 2759 | pDevice->ulRatio_State1 = s_ulGetRatio(pDevice); |
| 2760 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "RX:SQ3_State1, rate0 = %08x,rate1 = %08x\n", |
| 2761 | (int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1); |
| 2762 | |
| 2763 | if (pDevice->ulRatio_State1 < pDevice->ulRatio_State0) { |
| 2764 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "2.[%08x][%08x], uNumSQ3[%d]=%d, %d\n", |
| 2765 | (int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1, |
| 2766 | (int)pDevice->wAntDiversityMaxRate, |
| 2767 | (int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate], (int)pDevice->uDiversityCnt); |
Joe Perches | f2046f9 | 2013-03-18 20:55:36 -0700 | [diff] [blame] | 2768 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2769 | s_vChangeAntenna(pDevice); |
| 2770 | pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ); |
| 2771 | pDevice->TimerSQ3Tmax2.expires = RUN_AT(pDevice->byTMax2 * HZ); |
| 2772 | add_timer(&pDevice->TimerSQ3Tmax3); |
| 2773 | add_timer(&pDevice->TimerSQ3Tmax2); |
| 2774 | } |
| 2775 | pDevice->byAntennaState = 0; |
| 2776 | BBvClearAntDivSQ3Value(pDevice); |
| 2777 | } |
James A Shackleford | 15974dc | 2014-06-01 23:06:57 -0400 | [diff] [blame] | 2778 | } /* byAntennaState */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2779 | } |
| 2780 | |
| 2781 | /*+ |
| 2782 | * |
| 2783 | * Description: |
| 2784 | * Timer for SQ3 antenna diversity |
| 2785 | * |
| 2786 | * Parameters: |
| 2787 | * In: |
| 2788 | * Out: |
| 2789 | * none |
| 2790 | * |
| 2791 | * Return Value: none |
| 2792 | * |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2793 | -*/ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2794 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 2795 | void |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2796 | TimerSQ3CallBack( |
| 2797 | void *hDeviceContext |
| 2798 | ) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2799 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2800 | PSDevice pDevice = (PSDevice)hDeviceContext; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2801 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2802 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "TimerSQ3CallBack..."); |
| 2803 | spin_lock_irq(&pDevice->lock); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2804 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2805 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "3.[%08x][%08x], %d\n", (int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1, (int)pDevice->uDiversityCnt); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2806 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2807 | s_vChangeAntenna(pDevice); |
| 2808 | pDevice->byAntennaState = 0; |
| 2809 | BBvClearAntDivSQ3Value(pDevice); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2810 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2811 | pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ); |
| 2812 | pDevice->TimerSQ3Tmax2.expires = RUN_AT(pDevice->byTMax2 * HZ); |
| 2813 | add_timer(&pDevice->TimerSQ3Tmax3); |
| 2814 | add_timer(&pDevice->TimerSQ3Tmax2); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2815 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2816 | spin_unlock_irq(&pDevice->lock); |
| 2817 | return; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2818 | } |
| 2819 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2820 | /*+ |
| 2821 | * |
| 2822 | * Description: |
| 2823 | * Timer for SQ3 antenna diversity |
| 2824 | * |
| 2825 | * Parameters: |
| 2826 | * In: |
| 2827 | * pvSysSpec1 |
| 2828 | * hDeviceContext - Pointer to the adapter |
| 2829 | * pvSysSpec2 |
| 2830 | * pvSysSpec3 |
| 2831 | * Out: |
| 2832 | * none |
| 2833 | * |
| 2834 | * Return Value: none |
| 2835 | * |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2836 | -*/ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2837 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 2838 | void |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2839 | TimerState1CallBack( |
| 2840 | void *hDeviceContext |
| 2841 | ) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2842 | { |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2843 | PSDevice pDevice = (PSDevice)hDeviceContext; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2844 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2845 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "TimerState1CallBack..."); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2846 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2847 | spin_lock_irq(&pDevice->lock); |
| 2848 | if (pDevice->uDiversityCnt < pDevice->ulDiversityMValue/100) { |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2849 | s_vChangeAntenna(pDevice); |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2850 | pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ); |
| 2851 | pDevice->TimerSQ3Tmax2.expires = RUN_AT(pDevice->byTMax2 * HZ); |
| 2852 | add_timer(&pDevice->TimerSQ3Tmax3); |
| 2853 | add_timer(&pDevice->TimerSQ3Tmax2); |
| 2854 | } else { |
| 2855 | pDevice->ulRatio_State1 = s_ulGetRatio(pDevice); |
| 2856 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SQ3_State1, rate0 = %08x,rate1 = %08x\n", |
| 2857 | (int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2858 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2859 | if (pDevice->ulRatio_State1 < pDevice->ulRatio_State0) { |
| 2860 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "2.[%08x][%08x], uNumSQ3[%d]=%d, %d\n", |
| 2861 | (int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1, |
| 2862 | (int)pDevice->wAntDiversityMaxRate, |
| 2863 | (int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate], (int)pDevice->uDiversityCnt); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2864 | |
| 2865 | s_vChangeAntenna(pDevice); |
| 2866 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2867 | pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ); |
| 2868 | pDevice->TimerSQ3Tmax2.expires = RUN_AT(pDevice->byTMax2 * HZ); |
| 2869 | add_timer(&pDevice->TimerSQ3Tmax3); |
| 2870 | add_timer(&pDevice->TimerSQ3Tmax2); |
| 2871 | } |
| 2872 | } |
| 2873 | pDevice->byAntennaState = 0; |
| 2874 | BBvClearAntDivSQ3Value(pDevice); |
| 2875 | spin_unlock_irq(&pDevice->lock); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2876 | |
Joe Perches | 3752936 | 2013-03-18 10:44:38 -0700 | [diff] [blame] | 2877 | return; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 2878 | } |