diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-06-14 02:18:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-17 14:22:22 -0400 |
commit | aec7ffdf4ff24df1fe85ed5bc9e050c4dd77617b (patch) | |
tree | 3d5183e13e11353e5dd01fcc58b8a9ed33fff1f2 /drivers | |
parent | 545a8aa793e04bee7a7e2aa8caa70bed94fd7a5c (diff) |
b43: add Kconfig option for compiling SSB driver
It is always "y" for now, b43 will not compile without CONFIG_SSB yet.
This is just a first step of dropping SSB dependency.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/b43/Kconfig | 5 | ||||
-rw-r--r-- | drivers/net/wireless/b43/bus.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/b43/main.c | 25 |
3 files changed, 24 insertions, 9 deletions
diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig index e02db1be1723..d5add69aac8f 100644 --- a/drivers/net/wireless/b43/Kconfig +++ b/drivers/net/wireless/b43/Kconfig | |||
@@ -31,6 +31,11 @@ config B43_BCMA | |||
31 | depends on B43 && BCMA && BROKEN | 31 | depends on B43 && BCMA && BROKEN |
32 | default y | 32 | default y |
33 | 33 | ||
34 | config B43_SSB | ||
35 | bool | ||
36 | depends on B43 && SSB | ||
37 | default y | ||
38 | |||
34 | # Auto-select SSB PCI-HOST support, if possible | 39 | # Auto-select SSB PCI-HOST support, if possible |
35 | config B43_PCI_AUTOSELECT | 40 | config B43_PCI_AUTOSELECT |
36 | bool | 41 | bool |
diff --git a/drivers/net/wireless/b43/bus.c b/drivers/net/wireless/b43/bus.c index 8a10b82f8ea7..4200713eb597 100644 --- a/drivers/net/wireless/b43/bus.c +++ b/drivers/net/wireless/b43/bus.c | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | 26 | ||
27 | /* SSB */ | 27 | /* SSB */ |
28 | 28 | #ifdef CONFIG_B43_SSB | |
29 | static inline int b43_bus_ssb_bus_may_powerdown(struct b43_bus_dev *dev) | 29 | static inline int b43_bus_ssb_bus_may_powerdown(struct b43_bus_dev *dev) |
30 | { | 30 | { |
31 | return ssb_bus_may_powerdown(dev->sdev->bus); | 31 | return ssb_bus_may_powerdown(dev->sdev->bus); |
@@ -124,3 +124,4 @@ struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev) | |||
124 | 124 | ||
125 | return dev; | 125 | return dev; |
126 | } | 126 | } |
127 | #endif /* CONFIG_B43_SSB */ | ||
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index acee7b6af29a..834df5a3fb6a 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -123,6 +123,7 @@ static const struct bcma_device_id b43_bcma_tbl[] = { | |||
123 | MODULE_DEVICE_TABLE(bcma, b43_bcma_tbl); | 123 | MODULE_DEVICE_TABLE(bcma, b43_bcma_tbl); |
124 | #endif | 124 | #endif |
125 | 125 | ||
126 | #ifdef CONFIG_B43_SSB | ||
126 | static const struct ssb_device_id b43_ssb_tbl[] = { | 127 | static const struct ssb_device_id b43_ssb_tbl[] = { |
127 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5), | 128 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5), |
128 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 6), | 129 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 6), |
@@ -136,8 +137,8 @@ static const struct ssb_device_id b43_ssb_tbl[] = { | |||
136 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 16), | 137 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 16), |
137 | SSB_DEVTABLE_END | 138 | SSB_DEVTABLE_END |
138 | }; | 139 | }; |
139 | |||
140 | MODULE_DEVICE_TABLE(ssb, b43_ssb_tbl); | 140 | MODULE_DEVICE_TABLE(ssb, b43_ssb_tbl); |
141 | #endif | ||
141 | 142 | ||
142 | /* Channel and ratetables are shared for all devices. | 143 | /* Channel and ratetables are shared for all devices. |
143 | * They can't be const, because ieee80211 puts some precalculated | 144 | * They can't be const, because ieee80211 puts some precalculated |
@@ -5026,6 +5027,7 @@ static struct bcma_driver b43_bcma_driver = { | |||
5026 | }; | 5027 | }; |
5027 | #endif | 5028 | #endif |
5028 | 5029 | ||
5030 | #ifdef CONFIG_B43_SSB | ||
5029 | static | 5031 | static |
5030 | int b43_ssb_probe(struct ssb_device *sdev, const struct ssb_device_id *id) | 5032 | int b43_ssb_probe(struct ssb_device *sdev, const struct ssb_device_id *id) |
5031 | { | 5033 | { |
@@ -5103,6 +5105,14 @@ static void b43_ssb_remove(struct ssb_device *sdev) | |||
5103 | } | 5105 | } |
5104 | } | 5106 | } |
5105 | 5107 | ||
5108 | static struct ssb_driver b43_ssb_driver = { | ||
5109 | .name = KBUILD_MODNAME, | ||
5110 | .id_table = b43_ssb_tbl, | ||
5111 | .probe = b43_ssb_probe, | ||
5112 | .remove = b43_ssb_remove, | ||
5113 | }; | ||
5114 | #endif /* CONFIG_B43_SSB */ | ||
5115 | |||
5106 | /* Perform a hardware reset. This can be called from any context. */ | 5116 | /* Perform a hardware reset. This can be called from any context. */ |
5107 | void b43_controller_restart(struct b43_wldev *dev, const char *reason) | 5117 | void b43_controller_restart(struct b43_wldev *dev, const char *reason) |
5108 | { | 5118 | { |
@@ -5113,13 +5123,6 @@ void b43_controller_restart(struct b43_wldev *dev, const char *reason) | |||
5113 | ieee80211_queue_work(dev->wl->hw, &dev->restart_work); | 5123 | ieee80211_queue_work(dev->wl->hw, &dev->restart_work); |
5114 | } | 5124 | } |
5115 | 5125 | ||
5116 | static struct ssb_driver b43_ssb_driver = { | ||
5117 | .name = KBUILD_MODNAME, | ||
5118 | .id_table = b43_ssb_tbl, | ||
5119 | .probe = b43_ssb_probe, | ||
5120 | .remove = b43_ssb_remove, | ||
5121 | }; | ||
5122 | |||
5123 | static void b43_print_driverinfo(void) | 5126 | static void b43_print_driverinfo(void) |
5124 | { | 5127 | { |
5125 | const char *feat_pci = "", *feat_pcmcia = "", *feat_nphy = "", | 5128 | const char *feat_pci = "", *feat_pcmcia = "", *feat_nphy = "", |
@@ -5163,14 +5166,18 @@ static int __init b43_init(void) | |||
5163 | if (err) | 5166 | if (err) |
5164 | goto err_sdio_exit; | 5167 | goto err_sdio_exit; |
5165 | #endif | 5168 | #endif |
5169 | #ifdef CONFIG_B43_SSB | ||
5166 | err = ssb_driver_register(&b43_ssb_driver); | 5170 | err = ssb_driver_register(&b43_ssb_driver); |
5167 | if (err) | 5171 | if (err) |
5168 | goto err_bcma_driver_exit; | 5172 | goto err_bcma_driver_exit; |
5173 | #endif | ||
5169 | b43_print_driverinfo(); | 5174 | b43_print_driverinfo(); |
5170 | 5175 | ||
5171 | return err; | 5176 | return err; |
5172 | 5177 | ||
5178 | #ifdef CONFIG_B43_SSB | ||
5173 | err_bcma_driver_exit: | 5179 | err_bcma_driver_exit: |
5180 | #endif | ||
5174 | #ifdef CONFIG_B43_BCMA | 5181 | #ifdef CONFIG_B43_BCMA |
5175 | bcma_driver_unregister(&b43_bcma_driver); | 5182 | bcma_driver_unregister(&b43_bcma_driver); |
5176 | err_sdio_exit: | 5183 | err_sdio_exit: |
@@ -5185,7 +5192,9 @@ err_dfs_exit: | |||
5185 | 5192 | ||
5186 | static void __exit b43_exit(void) | 5193 | static void __exit b43_exit(void) |
5187 | { | 5194 | { |
5195 | #ifdef CONFIG_B43_SSB | ||
5188 | ssb_driver_unregister(&b43_ssb_driver); | 5196 | ssb_driver_unregister(&b43_ssb_driver); |
5197 | #endif | ||
5189 | #ifdef CONFIG_B43_BCMA | 5198 | #ifdef CONFIG_B43_BCMA |
5190 | bcma_driver_unregister(&b43_bcma_driver); | 5199 | bcma_driver_unregister(&b43_bcma_driver); |
5191 | #endif | 5200 | #endif |