]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
b43: move PHY reset code into PHY specific file
authorRafał Miłecki <zajec5@gmail.com>
Sat, 17 May 2014 21:24:54 +0000 (23:24 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 19 May 2014 20:42:14 +0000 (16:42 -0400)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/b43/main.c
drivers/net/wireless/b43/phy_common.c
drivers/net/wireless/b43/phy_common.h

index d670c878725b101793b2aa58718241ae5ae639dd..43fbb884859573ad66b396b723ada21e9aebd726 100644 (file)
@@ -3706,39 +3706,6 @@ static void b43_op_set_tsf(struct ieee80211_hw *hw,
        mutex_unlock(&wl->mutex);
 }
 
-static void b43_put_phy_into_reset(struct b43_wldev *dev)
-{
-#ifdef CONFIG_B43_SSB
-       u32 tmp;
-#endif
-
-       switch (dev->dev->bus_type) {
-#ifdef CONFIG_B43_BCMA
-       case B43_BUS_BCMA:
-               b43err(dev->wl,
-                      "Putting PHY into reset not supported on BCMA\n");
-               break;
-#endif
-#ifdef CONFIG_B43_SSB
-       case B43_BUS_SSB:
-               tmp = ssb_read32(dev->dev->sdev, SSB_TMSLOW);
-               tmp &= ~B43_TMSLOW_GMODE;
-               tmp |= B43_TMSLOW_PHYRESET;
-               tmp |= SSB_TMSLOW_FGC;
-               ssb_write32(dev->dev->sdev, SSB_TMSLOW, tmp);
-               msleep(1);
-
-               tmp = ssb_read32(dev->dev->sdev, SSB_TMSLOW);
-               tmp &= ~SSB_TMSLOW_FGC;
-               tmp |= B43_TMSLOW_PHYRESET;
-               ssb_write32(dev->dev->sdev, SSB_TMSLOW, tmp);
-               msleep(1);
-
-               break;
-#endif
-       }
-}
-
 static const char *band_to_string(enum ieee80211_band band)
 {
        switch (band) {
@@ -3804,7 +3771,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan)
        if (down_dev != up_dev) {
                /* We switch to a different core, so we put PHY into
                 * RESET on the old core. */
-               b43_put_phy_into_reset(down_dev);
+               b43_phy_put_into_reset(down_dev);
        }
 
        /* Now start the new core. */
index 3e45989f418d00876d00590094c6e9a1db1a4c56..85773a44349988683670910d99571b10d731b94e 100644 (file)
@@ -312,6 +312,39 @@ void b43_phy_maskset(struct b43_wldev *dev, u16 offset, u16 mask, u16 set)
        }
 }
 
+void b43_phy_put_into_reset(struct b43_wldev *dev)
+{
+#ifdef CONFIG_B43_SSB
+       u32 tmp;
+#endif
+
+       switch (dev->dev->bus_type) {
+#ifdef CONFIG_B43_BCMA
+       case B43_BUS_BCMA:
+               b43err(dev->wl,
+                      "Putting PHY into reset not supported on BCMA\n");
+               break;
+#endif
+#ifdef CONFIG_B43_SSB
+       case B43_BUS_SSB:
+               tmp = ssb_read32(dev->dev->sdev, SSB_TMSLOW);
+               tmp &= ~B43_TMSLOW_GMODE;
+               tmp |= B43_TMSLOW_PHYRESET;
+               tmp |= SSB_TMSLOW_FGC;
+               ssb_write32(dev->dev->sdev, SSB_TMSLOW, tmp);
+               msleep(1);
+
+               tmp = ssb_read32(dev->dev->sdev, SSB_TMSLOW);
+               tmp &= ~SSB_TMSLOW_FGC;
+               tmp |= B43_TMSLOW_PHYRESET;
+               ssb_write32(dev->dev->sdev, SSB_TMSLOW, tmp);
+               msleep(1);
+
+               break;
+#endif
+       }
+}
+
 int b43_switch_channel(struct b43_wldev *dev, unsigned int new_channel)
 {
        struct b43_phy *phy = &(dev->phy);
index f1b999349876bbfc8cad799858434f5e64a14b37..4f0fcec5b0330a57df60bac2beaa7aed37811840 100644 (file)
@@ -390,6 +390,8 @@ void b43_phy_lock(struct b43_wldev *dev);
  */
 void b43_phy_unlock(struct b43_wldev *dev);
 
+void b43_phy_put_into_reset(struct b43_wldev *dev);
+
 /**
  * b43_switch_channel - Switch to another channel
  */