diff options
Diffstat (limited to 'drivers/net/wireless/b43/tables.c')
-rw-r--r-- | drivers/net/wireless/b43/tables.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/drivers/net/wireless/b43/tables.c b/drivers/net/wireless/b43/tables.c index be9c7eb94ac4..fd5595ba5e8b 100644 --- a/drivers/net/wireless/b43/tables.c +++ b/drivers/net/wireless/b43/tables.c | |||
@@ -381,13 +381,17 @@ u16 b43_ofdmtab_read16(struct b43_wldev *dev, u16 table, u16 offset) | |||
381 | u16 addr; | 381 | u16 addr; |
382 | 382 | ||
383 | addr = table + offset; | 383 | addr = table + offset; |
384 | if (addr - 1 != phy->ofdm_addr || phy->ofdm_valid != 1) { | 384 | if ((phy->ofdmtab_addr_direction != B43_OFDMTAB_DIRECTION_READ) || |
385 | (addr - 1 != phy->ofdmtab_addr)) { | ||
386 | /* The hardware has a different address in memory. Update it. */ | ||
385 | b43_phy_write(dev, B43_PHY_OTABLECTL, addr); | 387 | b43_phy_write(dev, B43_PHY_OTABLECTL, addr); |
386 | phy->ofdm_valid = 1; | 388 | phy->ofdmtab_addr_direction = B43_OFDMTAB_DIRECTION_READ; |
387 | } | 389 | } |
388 | phy->ofdm_addr = addr; | 390 | phy->ofdmtab_addr = addr; |
389 | 391 | ||
390 | return b43_phy_read(dev, B43_PHY_OTABLEI); | 392 | return b43_phy_read(dev, B43_PHY_OTABLEI); |
393 | |||
394 | /* Some compiletime assertions... */ | ||
391 | assert_sizes(); | 395 | assert_sizes(); |
392 | } | 396 | } |
393 | 397 | ||
@@ -398,11 +402,13 @@ void b43_ofdmtab_write16(struct b43_wldev *dev, u16 table, | |||
398 | u16 addr; | 402 | u16 addr; |
399 | 403 | ||
400 | addr = table + offset; | 404 | addr = table + offset; |
401 | if (addr - 1 != phy->ofdm_addr || phy->ofdm_valid != 2) { | 405 | if ((phy->ofdmtab_addr_direction != B43_OFDMTAB_DIRECTION_WRITE) || |
406 | (addr -1 != phy->ofdmtab_addr)) { | ||
407 | /* The hardware has a different address in memory. Update it. */ | ||
402 | b43_phy_write(dev, B43_PHY_OTABLECTL, addr); | 408 | b43_phy_write(dev, B43_PHY_OTABLECTL, addr); |
403 | phy->ofdm_valid = 2; | 409 | phy->ofdmtab_addr_direction = B43_OFDMTAB_DIRECTION_WRITE; |
404 | } | 410 | } |
405 | phy->ofdm_addr = addr; | 411 | phy->ofdmtab_addr = addr; |
406 | b43_phy_write(dev, B43_PHY_OTABLEI, value); | 412 | b43_phy_write(dev, B43_PHY_OTABLEI, value); |
407 | } | 413 | } |
408 | 414 | ||
@@ -413,11 +419,13 @@ u32 b43_ofdmtab_read32(struct b43_wldev *dev, u16 table, u16 offset) | |||
413 | u16 addr; | 419 | u16 addr; |
414 | 420 | ||
415 | addr = table + offset; | 421 | addr = table + offset; |
416 | if (addr - 1 != phy->ofdm_addr || phy->ofdm_valid != 1) { | 422 | if ((phy->ofdmtab_addr_direction != B43_OFDMTAB_DIRECTION_READ) || |
423 | (addr - 1 != phy->ofdmtab_addr)) { | ||
424 | /* The hardware has a different address in memory. Update it. */ | ||
417 | b43_phy_write(dev, B43_PHY_OTABLECTL, addr); | 425 | b43_phy_write(dev, B43_PHY_OTABLECTL, addr); |
418 | phy->ofdm_valid = 1; | 426 | phy->ofdmtab_addr_direction = B43_OFDMTAB_DIRECTION_READ; |
419 | } | 427 | } |
420 | phy->ofdm_addr = addr; | 428 | phy->ofdmtab_addr = addr; |
421 | ret = b43_phy_read(dev, B43_PHY_OTABLEQ); | 429 | ret = b43_phy_read(dev, B43_PHY_OTABLEQ); |
422 | ret <<= 16; | 430 | ret <<= 16; |
423 | ret |= b43_phy_read(dev, B43_PHY_OTABLEI); | 431 | ret |= b43_phy_read(dev, B43_PHY_OTABLEI); |
@@ -432,13 +440,16 @@ void b43_ofdmtab_write32(struct b43_wldev *dev, u16 table, | |||
432 | u16 addr; | 440 | u16 addr; |
433 | 441 | ||
434 | addr = table + offset; | 442 | addr = table + offset; |
435 | if (addr - 1 != phy->ofdm_addr || phy->ofdm_valid != 2) { | 443 | if ((phy->ofdmtab_addr_direction != B43_OFDMTAB_DIRECTION_WRITE) || |
444 | (addr - 1 != phy->ofdmtab_addr)) { | ||
445 | /* The hardware has a different address in memory. Update it. */ | ||
436 | b43_phy_write(dev, B43_PHY_OTABLECTL, addr); | 446 | b43_phy_write(dev, B43_PHY_OTABLECTL, addr); |
437 | phy->ofdm_valid = 2; | 447 | phy->ofdmtab_addr_direction = B43_OFDMTAB_DIRECTION_WRITE; |
438 | } | 448 | } |
439 | phy->ofdm_addr = addr; | 449 | phy->ofdmtab_addr = addr; |
440 | 450 | ||
441 | b43_phy_write(dev, B43_PHY_OTABLEI, value); | 451 | b43_phy_write(dev, B43_PHY_OTABLEI, value); |
452 | b43_phy_write(dev, B43_PHY_OTABLEQ, (value >> 16)); | ||
442 | } | 453 | } |
443 | 454 | ||
444 | u16 b43_gtab_read(struct b43_wldev *dev, u16 table, u16 offset) | 455 | u16 b43_gtab_read(struct b43_wldev *dev, u16 table, u16 offset) |