diff options
Diffstat (limited to 'drivers/net/wireless/b43/main.c')
-rw-r--r-- | drivers/net/wireless/b43/main.c | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 3f4360ad0e4e..925f346ea361 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -395,9 +395,8 @@ u32 __b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset) | |||
395 | /* Unaligned access */ | 395 | /* Unaligned access */ |
396 | b43_shm_control_word(dev, routing, offset >> 2); | 396 | b43_shm_control_word(dev, routing, offset >> 2); |
397 | ret = b43_read16(dev, B43_MMIO_SHM_DATA_UNALIGNED); | 397 | ret = b43_read16(dev, B43_MMIO_SHM_DATA_UNALIGNED); |
398 | ret <<= 16; | ||
399 | b43_shm_control_word(dev, routing, (offset >> 2) + 1); | 398 | b43_shm_control_word(dev, routing, (offset >> 2) + 1); |
400 | ret |= b43_read16(dev, B43_MMIO_SHM_DATA); | 399 | ret |= ((u32)b43_read16(dev, B43_MMIO_SHM_DATA)) << 16; |
401 | 400 | ||
402 | goto out; | 401 | goto out; |
403 | } | 402 | } |
@@ -464,9 +463,10 @@ void __b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value | |||
464 | /* Unaligned access */ | 463 | /* Unaligned access */ |
465 | b43_shm_control_word(dev, routing, offset >> 2); | 464 | b43_shm_control_word(dev, routing, offset >> 2); |
466 | b43_write16(dev, B43_MMIO_SHM_DATA_UNALIGNED, | 465 | b43_write16(dev, B43_MMIO_SHM_DATA_UNALIGNED, |
467 | (value >> 16) & 0xffff); | 466 | value & 0xFFFF); |
468 | b43_shm_control_word(dev, routing, (offset >> 2) + 1); | 467 | b43_shm_control_word(dev, routing, (offset >> 2) + 1); |
469 | b43_write16(dev, B43_MMIO_SHM_DATA, value & 0xffff); | 468 | b43_write16(dev, B43_MMIO_SHM_DATA, |
469 | (value >> 16) & 0xFFFF); | ||
470 | return; | 470 | return; |
471 | } | 471 | } |
472 | offset >>= 2; | 472 | offset >>= 2; |
@@ -1524,10 +1524,13 @@ static void b43_write_probe_resp_template(struct b43_wldev *dev, | |||
1524 | /* Looks like PLCP headers plus packet timings are stored for | 1524 | /* Looks like PLCP headers plus packet timings are stored for |
1525 | * all possible basic rates | 1525 | * all possible basic rates |
1526 | */ | 1526 | */ |
1527 | /* FIXME this is the wrong offset : it goes in tkip rx phase1 shm */ | ||
1528 | #if 0 | ||
1527 | b43_write_probe_resp_plcp(dev, 0x31A, size, &b43_b_ratetable[0]); | 1529 | b43_write_probe_resp_plcp(dev, 0x31A, size, &b43_b_ratetable[0]); |
1528 | b43_write_probe_resp_plcp(dev, 0x32C, size, &b43_b_ratetable[1]); | 1530 | b43_write_probe_resp_plcp(dev, 0x32C, size, &b43_b_ratetable[1]); |
1529 | b43_write_probe_resp_plcp(dev, 0x33E, size, &b43_b_ratetable[2]); | 1531 | b43_write_probe_resp_plcp(dev, 0x33E, size, &b43_b_ratetable[2]); |
1530 | b43_write_probe_resp_plcp(dev, 0x350, size, &b43_b_ratetable[3]); | 1532 | b43_write_probe_resp_plcp(dev, 0x350, size, &b43_b_ratetable[3]); |
1533 | #endif | ||
1531 | 1534 | ||
1532 | size = min((size_t) size, 0x200 - sizeof(struct b43_plcp_hdr6)); | 1535 | size = min((size_t) size, 0x200 - sizeof(struct b43_plcp_hdr6)); |
1533 | b43_write_template_common(dev, probe_resp_data, | 1536 | b43_write_template_common(dev, probe_resp_data, |
@@ -1654,7 +1657,7 @@ static void b43_update_templates(struct b43_wl *wl) | |||
1654 | wl->current_beacon = beacon; | 1657 | wl->current_beacon = beacon; |
1655 | wl->beacon0_uploaded = 0; | 1658 | wl->beacon0_uploaded = 0; |
1656 | wl->beacon1_uploaded = 0; | 1659 | wl->beacon1_uploaded = 0; |
1657 | queue_work(wl->hw->workqueue, &wl->beacon_update_trigger); | 1660 | ieee80211_queue_work(wl->hw, &wl->beacon_update_trigger); |
1658 | } | 1661 | } |
1659 | 1662 | ||
1660 | static void b43_set_beacon_int(struct b43_wldev *dev, u16 beacon_int) | 1663 | static void b43_set_beacon_int(struct b43_wldev *dev, u16 beacon_int) |
@@ -2914,7 +2917,7 @@ out_requeue: | |||
2914 | delay = msecs_to_jiffies(50); | 2917 | delay = msecs_to_jiffies(50); |
2915 | else | 2918 | else |
2916 | delay = round_jiffies_relative(HZ * 15); | 2919 | delay = round_jiffies_relative(HZ * 15); |
2917 | queue_delayed_work(wl->hw->workqueue, &dev->periodic_work, delay); | 2920 | ieee80211_queue_delayed_work(wl->hw, &dev->periodic_work, delay); |
2918 | out: | 2921 | out: |
2919 | mutex_unlock(&wl->mutex); | 2922 | mutex_unlock(&wl->mutex); |
2920 | } | 2923 | } |
@@ -2925,15 +2928,16 @@ static void b43_periodic_tasks_setup(struct b43_wldev *dev) | |||
2925 | 2928 | ||
2926 | dev->periodic_state = 0; | 2929 | dev->periodic_state = 0; |
2927 | INIT_DELAYED_WORK(work, b43_periodic_work_handler); | 2930 | INIT_DELAYED_WORK(work, b43_periodic_work_handler); |
2928 | queue_delayed_work(dev->wl->hw->workqueue, work, 0); | 2931 | ieee80211_queue_delayed_work(dev->wl->hw, work, 0); |
2929 | } | 2932 | } |
2930 | 2933 | ||
2931 | /* Check if communication with the device works correctly. */ | 2934 | /* Check if communication with the device works correctly. */ |
2932 | static int b43_validate_chipaccess(struct b43_wldev *dev) | 2935 | static int b43_validate_chipaccess(struct b43_wldev *dev) |
2933 | { | 2936 | { |
2934 | u32 v, backup; | 2937 | u32 v, backup0, backup4; |
2935 | 2938 | ||
2936 | backup = b43_shm_read32(dev, B43_SHM_SHARED, 0); | 2939 | backup0 = b43_shm_read32(dev, B43_SHM_SHARED, 0); |
2940 | backup4 = b43_shm_read32(dev, B43_SHM_SHARED, 4); | ||
2937 | 2941 | ||
2938 | /* Check for read/write and endianness problems. */ | 2942 | /* Check for read/write and endianness problems. */ |
2939 | b43_shm_write32(dev, B43_SHM_SHARED, 0, 0x55AAAA55); | 2943 | b43_shm_write32(dev, B43_SHM_SHARED, 0, 0x55AAAA55); |
@@ -2943,7 +2947,23 @@ static int b43_validate_chipaccess(struct b43_wldev *dev) | |||
2943 | if (b43_shm_read32(dev, B43_SHM_SHARED, 0) != 0xAA5555AA) | 2947 | if (b43_shm_read32(dev, B43_SHM_SHARED, 0) != 0xAA5555AA) |
2944 | goto error; | 2948 | goto error; |
2945 | 2949 | ||
2946 | b43_shm_write32(dev, B43_SHM_SHARED, 0, backup); | 2950 | /* Check if unaligned 32bit SHM_SHARED access works properly. |
2951 | * However, don't bail out on failure, because it's noncritical. */ | ||
2952 | b43_shm_write16(dev, B43_SHM_SHARED, 0, 0x1122); | ||
2953 | b43_shm_write16(dev, B43_SHM_SHARED, 2, 0x3344); | ||
2954 | b43_shm_write16(dev, B43_SHM_SHARED, 4, 0x5566); | ||
2955 | b43_shm_write16(dev, B43_SHM_SHARED, 6, 0x7788); | ||
2956 | if (b43_shm_read32(dev, B43_SHM_SHARED, 2) != 0x55663344) | ||
2957 | b43warn(dev->wl, "Unaligned 32bit SHM read access is broken\n"); | ||
2958 | b43_shm_write32(dev, B43_SHM_SHARED, 2, 0xAABBCCDD); | ||
2959 | if (b43_shm_read16(dev, B43_SHM_SHARED, 0) != 0x1122 || | ||
2960 | b43_shm_read16(dev, B43_SHM_SHARED, 2) != 0xCCDD || | ||
2961 | b43_shm_read16(dev, B43_SHM_SHARED, 4) != 0xAABB || | ||
2962 | b43_shm_read16(dev, B43_SHM_SHARED, 6) != 0x7788) | ||
2963 | b43warn(dev->wl, "Unaligned 32bit SHM write access is broken\n"); | ||
2964 | |||
2965 | b43_shm_write32(dev, B43_SHM_SHARED, 0, backup0); | ||
2966 | b43_shm_write32(dev, B43_SHM_SHARED, 4, backup4); | ||
2947 | 2967 | ||
2948 | if ((dev->dev->id.revision >= 3) && (dev->dev->id.revision <= 10)) { | 2968 | if ((dev->dev->id.revision >= 3) && (dev->dev->id.revision <= 10)) { |
2949 | /* The 32bit register shadows the two 16bit registers | 2969 | /* The 32bit register shadows the two 16bit registers |
@@ -4871,7 +4891,7 @@ void b43_controller_restart(struct b43_wldev *dev, const char *reason) | |||
4871 | if (b43_status(dev) < B43_STAT_INITIALIZED) | 4891 | if (b43_status(dev) < B43_STAT_INITIALIZED) |
4872 | return; | 4892 | return; |
4873 | b43info(dev->wl, "Controller RESET (%s) ...\n", reason); | 4893 | b43info(dev->wl, "Controller RESET (%s) ...\n", reason); |
4874 | queue_work(dev->wl->hw->workqueue, &dev->restart_work); | 4894 | ieee80211_queue_work(dev->wl->hw, &dev->restart_work); |
4875 | } | 4895 | } |
4876 | 4896 | ||
4877 | #ifdef CONFIG_PM | 4897 | #ifdef CONFIG_PM |