brcmsmac: write beacon period to hardware
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 24 Mar 2013 00:45:57 +0000 (01:45 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 27 Mar 2013 17:37:35 +0000 (13:37 -0400)
Make brcms_c_set_beacon_period() write the beacon period to the
hardware if a new one is set.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmsmac/main.c

index 7e192955b5c990076c9d03777192a15889af9635..4ffb0c6d1a0cab04f189756ac8bbd8d75be95566 100644 (file)
@@ -5551,10 +5551,20 @@ static void brcms_c_time_unlock(struct brcms_c_info *wlc)
 
 int brcms_c_set_beacon_period(struct brcms_c_info *wlc, u16 period)
 {
+       u32 bcnint_us;
+
        if (period == 0)
                return -EINVAL;
 
        wlc->default_bss->beacon_period = period;
+
+       bcnint_us = period << 10;
+       brcms_c_time_lock(wlc);
+       bcma_write32(wlc->hw->d11core, D11REGOFFS(tsf_cfprep),
+                    (bcnint_us << CFPREP_CBI_SHIFT));
+       bcma_write32(wlc->hw->d11core, D11REGOFFS(tsf_cfpstart), bcnint_us);
+       brcms_c_time_unlock(wlc);
+
        return 0;
 }