aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/tables.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/b43/tables.c')
-rw-r--r--drivers/net/wireless/b43/tables.c101
1 files changed, 90 insertions, 11 deletions
diff --git a/drivers/net/wireless/b43/tables.c b/drivers/net/wireless/b43/tables.c
index 15a87183a572..0ac8653767b9 100644
--- a/drivers/net/wireless/b43/tables.c
+++ b/drivers/net/wireless/b43/tables.c
@@ -229,7 +229,7 @@ const u16 b43_tab_noisea2[] = {
229}; 229};
230 230
231const u16 b43_tab_noisea3[] = { 231const u16 b43_tab_noisea3[] = {
232 0x4C4C, 0x4C4C, 0x4C4C, 0x2D36, 232 0x5E5E, 0x5E5E, 0x5E5E, 0x3F48,
233 0x4C4C, 0x4C4C, 0x4C4C, 0x2D36, 233 0x4C4C, 0x4C4C, 0x4C4C, 0x2D36,
234}; 234};
235 235
@@ -243,6 +243,26 @@ const u16 b43_tab_noiseg2[] = {
243 0x0000, 0x0000, 0x0000, 0x0000, 243 0x0000, 0x0000, 0x0000, 0x0000,
244}; 244};
245 245
246const u16 b43_tab_noisescalea2[] = {
247 0x6767, 0x6767, 0x6767, 0x6767, /* 0 */
248 0x6767, 0x6767, 0x6767, 0x6767,
249 0x6767, 0x6767, 0x6767, 0x6767,
250 0x6767, 0x6700, 0x6767, 0x6767,
251 0x6767, 0x6767, 0x6767, 0x6767, /* 16 */
252 0x6767, 0x6767, 0x6767, 0x6767,
253 0x6767, 0x6767, 0x0067,
254};
255
256const u16 b43_tab_noisescalea3[] = {
257 0x2323, 0x2323, 0x2323, 0x2323, /* 0 */
258 0x2323, 0x2323, 0x2323, 0x2323,
259 0x2323, 0x2323, 0x2323, 0x2323,
260 0x2323, 0x2300, 0x2323, 0x2323,
261 0x2323, 0x2323, 0x2323, 0x2323, /* 16 */
262 0x2323, 0x2323, 0x2323, 0x2323,
263 0x2323, 0x2323, 0x0023,
264};
265
246const u16 b43_tab_noisescaleg1[] = { 266const u16 b43_tab_noisescaleg1[] = {
247 0x6C77, 0x5162, 0x3B40, 0x3335, /* 0 */ 267 0x6C77, 0x5162, 0x3B40, 0x3335, /* 0 */
248 0x2F2D, 0x2A2A, 0x2527, 0x1F21, 268 0x2F2D, 0x2A2A, 0x2527, 0x1F21,
@@ -254,7 +274,7 @@ const u16 b43_tab_noisescaleg1[] = {
254}; 274};
255 275
256const u16 b43_tab_noisescaleg2[] = { 276const u16 b43_tab_noisescaleg2[] = {
257 0xD8DD, 0xCBD4, 0xBCC0, 0XB6B7, /* 0 */ 277 0xD8DD, 0xCBD4, 0xBCC0, 0xB6B7, /* 0 */
258 0xB2B0, 0xADAD, 0xA7A9, 0x9FA1, 278 0xB2B0, 0xADAD, 0xA7A9, 0x9FA1,
259 0x969B, 0x9195, 0x8F8F, 0x8A8A, 279 0x969B, 0x9195, 0x8F8F, 0x8A8A,
260 0x8A8A, 0x8A00, 0x8A8A, 0x8F8A, 280 0x8A8A, 0x8A00, 0x8A8A, 0x8F8A,
@@ -307,6 +327,28 @@ const u16 b43_tab_sigmasqr2[] = {
307 0x00DE, 327 0x00DE,
308}; 328};
309 329
330const u16 b43_tab_rssiagc1[] = {
331 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8, /* 0 */
332 0xFFF8, 0xFFF9, 0xFFFC, 0xFFFE,
333 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8,
334 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8,
335};
336
337const u16 b43_tab_rssiagc2[] = {
338 0x0820, 0x0820, 0x0920, 0x0C38, /* 0 */
339 0x0820, 0x0820, 0x0820, 0x0820,
340 0x0820, 0x0820, 0x0920, 0x0A38,
341 0x0820, 0x0820, 0x0820, 0x0820,
342 0x0820, 0x0820, 0x0920, 0x0A38, /* 16 */
343 0x0820, 0x0820, 0x0820, 0x0820,
344 0x0820, 0x0820, 0x0920, 0x0A38,
345 0x0820, 0x0820, 0x0820, 0x0820,
346 0x0820, 0x0820, 0x0920, 0x0A38, /* 32 */
347 0x0820, 0x0820, 0x0820, 0x0820,
348 0x0820, 0x0820, 0x0920, 0x0A38,
349 0x0820, 0x0820, 0x0820, 0x0820,
350};
351
310static inline void assert_sizes(void) 352static inline void assert_sizes(void)
311{ 353{
312 BUILD_BUG_ON(B43_TAB_ROTOR_SIZE != ARRAY_SIZE(b43_tab_rotor)); 354 BUILD_BUG_ON(B43_TAB_ROTOR_SIZE != ARRAY_SIZE(b43_tab_rotor));
@@ -317,36 +359,65 @@ static inline void assert_sizes(void)
317 BUILD_BUG_ON(B43_TAB_NOISEA3_SIZE != ARRAY_SIZE(b43_tab_noisea3)); 359 BUILD_BUG_ON(B43_TAB_NOISEA3_SIZE != ARRAY_SIZE(b43_tab_noisea3));
318 BUILD_BUG_ON(B43_TAB_NOISEG1_SIZE != ARRAY_SIZE(b43_tab_noiseg1)); 360 BUILD_BUG_ON(B43_TAB_NOISEG1_SIZE != ARRAY_SIZE(b43_tab_noiseg1));
319 BUILD_BUG_ON(B43_TAB_NOISEG2_SIZE != ARRAY_SIZE(b43_tab_noiseg2)); 361 BUILD_BUG_ON(B43_TAB_NOISEG2_SIZE != ARRAY_SIZE(b43_tab_noiseg2));
320 BUILD_BUG_ON(B43_TAB_NOISESCALEG_SIZE != 362 BUILD_BUG_ON(B43_TAB_NOISESCALE_SIZE !=
363 ARRAY_SIZE(b43_tab_noisescalea2));
364 BUILD_BUG_ON(B43_TAB_NOISESCALE_SIZE !=
365 ARRAY_SIZE(b43_tab_noisescalea3));
366 BUILD_BUG_ON(B43_TAB_NOISESCALE_SIZE !=
321 ARRAY_SIZE(b43_tab_noisescaleg1)); 367 ARRAY_SIZE(b43_tab_noisescaleg1));
322 BUILD_BUG_ON(B43_TAB_NOISESCALEG_SIZE != 368 BUILD_BUG_ON(B43_TAB_NOISESCALE_SIZE !=
323 ARRAY_SIZE(b43_tab_noisescaleg2)); 369 ARRAY_SIZE(b43_tab_noisescaleg2));
324 BUILD_BUG_ON(B43_TAB_NOISESCALEG_SIZE != 370 BUILD_BUG_ON(B43_TAB_NOISESCALE_SIZE !=
325 ARRAY_SIZE(b43_tab_noisescaleg3)); 371 ARRAY_SIZE(b43_tab_noisescaleg3));
326 BUILD_BUG_ON(B43_TAB_SIGMASQR_SIZE != ARRAY_SIZE(b43_tab_sigmasqr1)); 372 BUILD_BUG_ON(B43_TAB_SIGMASQR_SIZE != ARRAY_SIZE(b43_tab_sigmasqr1));
327 BUILD_BUG_ON(B43_TAB_SIGMASQR_SIZE != ARRAY_SIZE(b43_tab_sigmasqr2)); 373 BUILD_BUG_ON(B43_TAB_SIGMASQR_SIZE != ARRAY_SIZE(b43_tab_sigmasqr2));
374 BUILD_BUG_ON(B43_TAB_RSSIAGC1_SIZE != ARRAY_SIZE(b43_tab_rssiagc1));
375 BUILD_BUG_ON(B43_TAB_RSSIAGC2_SIZE != ARRAY_SIZE(b43_tab_rssiagc2));
328} 376}
329 377
330u16 b43_ofdmtab_read16(struct b43_wldev *dev, u16 table, u16 offset) 378u16 b43_ofdmtab_read16(struct b43_wldev *dev, u16 table, u16 offset)
331{ 379{
332 assert_sizes(); 380 struct b43_phy *phy = &dev->phy;
381 u16 addr;
382
383 addr = table + offset;
384 if (addr - 1 != phy->ofdm_addr || phy->ofdm_valid != 1) {
385 b43_phy_write(dev, B43_PHY_OTABLECTL, addr);
386 phy->ofdm_valid = 1;
387 }
388 phy->ofdm_addr = addr;
333 389
334 b43_phy_write(dev, B43_PHY_OTABLECTL, table + offset);
335 return b43_phy_read(dev, B43_PHY_OTABLEI); 390 return b43_phy_read(dev, B43_PHY_OTABLEI);
391 assert_sizes();
336} 392}
337 393
338void b43_ofdmtab_write16(struct b43_wldev *dev, u16 table, 394void b43_ofdmtab_write16(struct b43_wldev *dev, u16 table,
339 u16 offset, u16 value) 395 u16 offset, u16 value)
340{ 396{
341 b43_phy_write(dev, B43_PHY_OTABLECTL, table + offset); 397 struct b43_phy *phy = &dev->phy;
398 u16 addr;
399
400 addr = table + offset;
401 if (addr - 1 != phy->ofdm_addr || phy->ofdm_valid != 2) {
402 b43_phy_write(dev, B43_PHY_OTABLECTL, addr);
403 phy->ofdm_valid = 2;
404 }
405 phy->ofdm_addr = addr;
342 b43_phy_write(dev, B43_PHY_OTABLEI, value); 406 b43_phy_write(dev, B43_PHY_OTABLEI, value);
343} 407}
344 408
345u32 b43_ofdmtab_read32(struct b43_wldev *dev, u16 table, u16 offset) 409u32 b43_ofdmtab_read32(struct b43_wldev *dev, u16 table, u16 offset)
346{ 410{
411 struct b43_phy *phy = &dev->phy;
347 u32 ret; 412 u32 ret;
413 u16 addr;
348 414
349 b43_phy_write(dev, B43_PHY_OTABLECTL, table + offset); 415 addr = table + offset;
416 if (addr - 1 != phy->ofdm_addr || phy->ofdm_valid != 1) {
417 b43_phy_write(dev, B43_PHY_OTABLECTL, addr);
418 phy->ofdm_valid = 1;
419 }
420 phy->ofdm_addr = addr;
350 ret = b43_phy_read(dev, B43_PHY_OTABLEQ); 421 ret = b43_phy_read(dev, B43_PHY_OTABLEQ);
351 ret <<= 16; 422 ret <<= 16;
352 ret |= b43_phy_read(dev, B43_PHY_OTABLEI); 423 ret |= b43_phy_read(dev, B43_PHY_OTABLEI);
@@ -357,9 +428,17 @@ u32 b43_ofdmtab_read32(struct b43_wldev *dev, u16 table, u16 offset)
357void b43_ofdmtab_write32(struct b43_wldev *dev, u16 table, 428void b43_ofdmtab_write32(struct b43_wldev *dev, u16 table,
358 u16 offset, u32 value) 429 u16 offset, u32 value)
359{ 430{
360 b43_phy_write(dev, B43_PHY_OTABLECTL, table + offset); 431 struct b43_phy *phy = &dev->phy;
432 u16 addr;
433
434 addr = table + offset;
435 if (addr - 1 != phy->ofdm_addr || phy->ofdm_valid != 2) {
436 b43_phy_write(dev, B43_PHY_OTABLECTL, addr);
437 phy->ofdm_valid = 2;
438 }
439 phy->ofdm_addr = addr;
440
361 b43_phy_write(dev, B43_PHY_OTABLEI, value); 441 b43_phy_write(dev, B43_PHY_OTABLEI, value);
362 b43_phy_write(dev, B43_PHY_OTABLEQ, (value >> 16));
363} 442}
364 443
365u16 b43_gtab_read(struct b43_wldev *dev, u16 table, u16 offset) 444u16 b43_gtab_read(struct b43_wldev *dev, u16 table, u16 offset)