b43: Fix wakeup times
PATCH 1/1 b43: Fix wakeup times
Fix writing of some wakeup times.
The MMIO write does not change in functionality.
But I think the SHM writes are wrong. I think they are the old v3 firmware API. It seems that this stuff moved in the v4 firmware API.
I guess that the old 0x416 offset is the PRETBTT offset in the new API. That would make most sense to me. (We first write the PRETBTT MMIO register and then a SHM location with the same value. So it would make sense so me if this was the PRETBTT location).
The use of the new SH_SPUWKUP is also only a guess by me. It is SH_PRETBTT-2. But this seems to make some sense to me.
Johannes, Joseph: Does this patch make sense? Can you probably check what a recent vendor driver does?
Everybody, please test this patch for regressions.
NOT-signed-off-yet
drivers/net/wireless/b43/b43.h +1 -0
@@ -88,6 +88,7 @@#define B43_MMIO_GPIO_MASK 0x49E#define B43_MMIO_TSF_CFP_START_LOW 0x604#define B43_MMIO_TSF_CFP_START_HIGH 0x606 +#define B43_MMIO_TSF_CFP_PRETBTT 0x612#define B43_MMIO_TSF_0 0x632/* core rev < 3 only */ #define B43_MMIO_TSF_1 0x634/* core rev < 3 only */ #define B43_MMIO_TSF_2 0x636/* core rev < 3 only */
drivers/net/wireless/b43/main.c +5 -6
@@ -3376,12 +3376,11 @@ static int b43_wireless_core_init(struct goto err_chip_exit;b43_qos_init (dev); -//FIXME -#if 1 -b43_write16 (dev,0x0612 ,0x0050 ); -b43_shm_write16 (dev,B43_SHM_SHARED ,0x0416 ,0x0050 ); -b43_shm_write16 (dev,B43_SHM_SHARED ,0x0414 ,0x01F4 ); -#endif +/* Set the TSF CFP pre-TargetBeaconTransmissionTime (in microseconds). */ +b43_write16 (dev,B43_MMIO_TSF_CFP_PRETBTT ,80 ); +b43_shm_write16 (dev,B43_SHM_SHARED ,B43_SHM_SH_PRETBTT ,80 ); +/* Set the pre-wakeup for synthetic PU (in microseconds). */ +b43_shm_write16 (dev,B43_SHM_SHARED ,B43_SHM_SH_SPUWKUP ,500 );b43_bluetooth_coext_enable (dev);