aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/b43/main.c')
-rw-r--r--drivers/net/wireless/b43/main.c46
1 files changed, 38 insertions, 8 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 3fb4ef816842..6ecaf84da2fc 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3690,6 +3690,41 @@ static void b43_set_retry_limits(struct b43_wldev *dev,
3690 long_retry); 3690 long_retry);
3691} 3691}
3692 3692
3693static void b43_set_synth_pu_delay(struct b43_wldev *dev, bool idle)
3694{
3695 u16 pu_delay;
3696
3697 /* The time value is in microseconds. */
3698 if (dev->phy.type == B43_PHYTYPE_A)
3699 pu_delay = 3700;
3700 else
3701 pu_delay = 1050;
3702 if ((dev->wl->if_type == IEEE80211_IF_TYPE_IBSS) || idle)
3703 pu_delay = 500;
3704 if ((dev->phy.radio_ver == 0x2050) && (dev->phy.radio_rev == 8))
3705 pu_delay = max(pu_delay, (u16)2400);
3706
3707 b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_SPUWKUP, pu_delay);
3708}
3709
3710/* Set the TSF CFP pre-TargetBeaconTransmissionTime. */
3711static void b43_set_pretbtt(struct b43_wldev *dev)
3712{
3713 u16 pretbtt;
3714
3715 /* The time value is in microseconds. */
3716 if (dev->wl->if_type == IEEE80211_IF_TYPE_IBSS) {
3717 pretbtt = 2;
3718 } else {
3719 if (dev->phy.type == B43_PHYTYPE_A)
3720 pretbtt = 120;
3721 else
3722 pretbtt = 250;
3723 }
3724 b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_PRETBTT, pretbtt);
3725 b43_write16(dev, B43_MMIO_TSF_CFP_PRETBTT, pretbtt);
3726}
3727
3693/* Shutdown a wireless core */ 3728/* Shutdown a wireless core */
3694/* Locking: wl->mutex */ 3729/* Locking: wl->mutex */
3695static void b43_wireless_core_exit(struct b43_wldev *dev) 3730static void b43_wireless_core_exit(struct b43_wldev *dev)
@@ -3821,14 +3856,7 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
3821 if (err) 3856 if (err)
3822 goto err_chip_exit; 3857 goto err_chip_exit;
3823 b43_qos_init(dev); 3858 b43_qos_init(dev);
3824 3859 b43_set_synth_pu_delay(dev, 1);
3825//FIXME
3826#if 1
3827 b43_write16(dev, 0x0612, 0x0050);
3828 b43_shm_write16(dev, B43_SHM_SHARED, 0x0416, 0x0050);
3829 b43_shm_write16(dev, B43_SHM_SHARED, 0x0414, 0x01F4);
3830#endif
3831
3832 b43_bluetooth_coext_enable(dev); 3860 b43_bluetooth_coext_enable(dev);
3833 3861
3834 ssb_bus_powerup(bus, 1); /* Enable dynamic PCTL */ 3862 ssb_bus_powerup(bus, 1); /* Enable dynamic PCTL */
@@ -3888,6 +3916,8 @@ static int b43_op_add_interface(struct ieee80211_hw *hw,
3888 3916
3889 spin_lock_irqsave(&wl->irq_lock, flags); 3917 spin_lock_irqsave(&wl->irq_lock, flags);
3890 b43_adjust_opmode(dev); 3918 b43_adjust_opmode(dev);
3919 b43_set_pretbtt(dev);
3920 b43_set_synth_pu_delay(dev, 0);
3891 b43_upload_card_macaddress(dev); 3921 b43_upload_card_macaddress(dev);
3892 spin_unlock_irqrestore(&wl->irq_lock, flags); 3922 spin_unlock_irqrestore(&wl->irq_lock, flags);
3893 3923