b43: tell the ucode the mac capabilities
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 14 Sep 2014 21:09:08 +0000 (23:09 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 15 Sep 2014 19:00:53 +0000 (15:00 -0400)
This is based on code form brcmsmac.

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

index a9805950f780e197c7c1eeb05557049bed791a10..8ebce26ef4d01404dea3481eab9324cd370a3936 100644 (file)
@@ -45,6 +45,7 @@
 #define B43_MMIO_RAM_DATA              0x134
 #define B43_MMIO_PS_STATUS             0x140
 #define B43_MMIO_RADIO_HWENABLED_HI    0x158
+#define B43_MMIO_MAC_HW_CAP            0x15C   /* MAC capabilities (corerev >= 13) */
 #define B43_MMIO_SHM_CONTROL           0x160
 #define B43_MMIO_SHM_DATA              0x164
 #define B43_MMIO_SHM_DATA_UNALIGNED    0x166
@@ -253,6 +254,8 @@ enum {
 #define B43_SHM_SH_CHAN                        0x00A0  /* Current channel (low 8bit only) */
 #define  B43_SHM_SH_CHAN_5GHZ          0x0100  /* Bit set, if 5 Ghz channel */
 #define  B43_SHM_SH_CHAN_40MHZ         0x0200  /* Bit set, if 40 Mhz channel width */
+#define B43_SHM_SH_MACHW_L             0x00C0  /* Location where the ucode expects the MAC capabilities */
+#define B43_SHM_SH_MACHW_H             0x00C2  /* Location where the ucode expects the MAC capabilities */
 #define B43_SHM_SH_HOSTF5              0x00D4  /* Hostflags 5 for ucode options */
 #define B43_SHM_SH_BCMCFIFOID          0x0108  /* Last posted cookie to the bcast/mcast FIFO */
 /* TSSI information */
index 3adc13f6ffef08c809865382681352fe6c5a5ee7..85ab46c42734ba8cc9fc18b9854dca74dc5f07eb 100644 (file)
@@ -4857,6 +4857,16 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
        hf &= ~B43_HF_SKCFPUP;
        b43_hf_write(dev, hf);
 
+       /* tell the ucode MAC capabilities */
+       if (dev->dev->core_rev >= 13) {
+               u32 mac_hw_cap = b43_read32(dev, B43_MMIO_MAC_HW_CAP);
+
+               b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_MACHW_L,
+                               mac_hw_cap & 0xffff);
+               b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_MACHW_H,
+                               (mac_hw_cap >> 16) & 0xffff);
+       }
+
        b43_set_retry_limits(dev, B43_DEFAULT_SHORT_RETRY_LIMIT,
                             B43_DEFAULT_LONG_RETRY_LIMIT);
        b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_SFFBLIM, 3);