]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/b43/main.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[karo-tx-linux.git] / drivers / net / wireless / b43 / main.c
index cae31463ead93810838b025171e3775de5260ee3..e9a01e3eede7ca41bbff2c73f7d4a621f4471257 100644 (file)
@@ -123,6 +123,7 @@ static const struct bcma_device_id b43_bcma_tbl[] = {
 MODULE_DEVICE_TABLE(bcma, b43_bcma_tbl);
 #endif
 
+#ifdef CONFIG_B43_SSB
 static const struct ssb_device_id b43_ssb_tbl[] = {
        SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5),
        SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 6),
@@ -136,8 +137,8 @@ static const struct ssb_device_id b43_ssb_tbl[] = {
        SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 16),
        SSB_DEVTABLE_END
 };
-
 MODULE_DEVICE_TABLE(ssb, b43_ssb_tbl);
+#endif
 
 /* Channel and ratetables are shared for all devices.
  * They can't be const, because ieee80211 puts some precalculated
@@ -4096,6 +4097,12 @@ static int b43_phy_versioning(struct b43_wldev *dev)
                if (phy_rev > 2)
                        unsupported = 1;
                break;
+#endif
+#ifdef CONFIG_B43_PHY_HT
+       case B43_PHYTYPE_HT:
+               if (phy_rev > 1)
+                       unsupported = 1;
+               break;
 #endif
        default:
                unsupported = 1;
@@ -4153,6 +4160,10 @@ static int b43_phy_versioning(struct b43_wldev *dev)
                if (radio_ver != 0x2062 && radio_ver != 0x2063)
                        unsupported = 1;
                break;
+       case B43_PHYTYPE_HT:
+               if (radio_ver != 0x2059)
+                       unsupported = 1;
+               break;
        default:
                B43_WARN_ON(1);
        }
@@ -5016,6 +5027,7 @@ static struct bcma_driver b43_bcma_driver = {
 };
 #endif
 
+#ifdef CONFIG_B43_SSB
 static
 int b43_ssb_probe(struct ssb_device *sdev, const struct ssb_device_id *id)
 {
@@ -5025,6 +5037,8 @@ int b43_ssb_probe(struct ssb_device *sdev, const struct ssb_device_id *id)
        int first = 0;
 
        dev = b43_bus_dev_ssb_init(sdev);
+       if (!dev)
+               return -ENOMEM;
 
        wl = ssb_get_devtypedata(sdev);
        if (!wl) {
@@ -5091,6 +5105,14 @@ static void b43_ssb_remove(struct ssb_device *sdev)
        }
 }
 
+static struct ssb_driver b43_ssb_driver = {
+       .name           = KBUILD_MODNAME,
+       .id_table       = b43_ssb_tbl,
+       .probe          = b43_ssb_probe,
+       .remove         = b43_ssb_remove,
+};
+#endif /* CONFIG_B43_SSB */
+
 /* Perform a hardware reset. This can be called from any context. */
 void b43_controller_restart(struct b43_wldev *dev, const char *reason)
 {
@@ -5101,13 +5123,6 @@ void b43_controller_restart(struct b43_wldev *dev, const char *reason)
        ieee80211_queue_work(dev->wl->hw, &dev->restart_work);
 }
 
-static struct ssb_driver b43_ssb_driver = {
-       .name           = KBUILD_MODNAME,
-       .id_table       = b43_ssb_tbl,
-       .probe          = b43_ssb_probe,
-       .remove         = b43_ssb_remove,
-};
-
 static void b43_print_driverinfo(void)
 {
        const char *feat_pci = "", *feat_pcmcia = "", *feat_nphy = "",
@@ -5151,14 +5166,18 @@ static int __init b43_init(void)
        if (err)
                goto err_sdio_exit;
 #endif
+#ifdef CONFIG_B43_SSB
        err = ssb_driver_register(&b43_ssb_driver);
        if (err)
                goto err_bcma_driver_exit;
+#endif
        b43_print_driverinfo();
 
        return err;
 
+#ifdef CONFIG_B43_SSB
 err_bcma_driver_exit:
+#endif
 #ifdef CONFIG_B43_BCMA
        bcma_driver_unregister(&b43_bcma_driver);
 err_sdio_exit:
@@ -5173,7 +5192,9 @@ err_dfs_exit:
 
 static void __exit b43_exit(void)
 {
+#ifdef CONFIG_B43_SSB
        ssb_driver_unregister(&b43_ssb_driver);
+#endif
 #ifdef CONFIG_B43_BCMA
        bcma_driver_unregister(&b43_bcma_driver);
 #endif