diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-06-07 13:30:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-06-10 13:27:54 -0400 |
commit | f41f3f373dd72344c65d801d6381fe83ef3a2c54 (patch) | |
tree | fd5a9da51f07d2128fa741032d9f09ce1fa96cfb /drivers/net/wireless/b43/main.c | |
parent | e6a3b61681dcb963e6465ffbc4330b44824f35e3 (diff) |
b43/legacy: port to cfg80211 rfkill
This ports the b43/legacy rfkill code to the new API offered
by cfg80211 and thus removes a lot of useless stuff.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/main.c')
-rw-r--r-- | drivers/net/wireless/b43/main.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 1d3e40095ada..5d9f1981f2ce 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -4298,7 +4298,6 @@ static int b43_op_start(struct ieee80211_hw *hw) | |||
4298 | struct b43_wldev *dev = wl->current_dev; | 4298 | struct b43_wldev *dev = wl->current_dev; |
4299 | int did_init = 0; | 4299 | int did_init = 0; |
4300 | int err = 0; | 4300 | int err = 0; |
4301 | bool do_rfkill_exit = 0; | ||
4302 | 4301 | ||
4303 | /* Kill all old instance specific information to make sure | 4302 | /* Kill all old instance specific information to make sure |
4304 | * the card won't use it in the short timeframe between start | 4303 | * the card won't use it in the short timeframe between start |
@@ -4312,18 +4311,12 @@ static int b43_op_start(struct ieee80211_hw *hw) | |||
4312 | wl->beacon1_uploaded = 0; | 4311 | wl->beacon1_uploaded = 0; |
4313 | wl->beacon_templates_virgin = 1; | 4312 | wl->beacon_templates_virgin = 1; |
4314 | 4313 | ||
4315 | /* First register RFkill. | ||
4316 | * LEDs that are registered later depend on it. */ | ||
4317 | b43_rfkill_init(dev); | ||
4318 | |||
4319 | mutex_lock(&wl->mutex); | 4314 | mutex_lock(&wl->mutex); |
4320 | 4315 | ||
4321 | if (b43_status(dev) < B43_STAT_INITIALIZED) { | 4316 | if (b43_status(dev) < B43_STAT_INITIALIZED) { |
4322 | err = b43_wireless_core_init(dev); | 4317 | err = b43_wireless_core_init(dev); |
4323 | if (err) { | 4318 | if (err) |
4324 | do_rfkill_exit = 1; | ||
4325 | goto out_mutex_unlock; | 4319 | goto out_mutex_unlock; |
4326 | } | ||
4327 | did_init = 1; | 4320 | did_init = 1; |
4328 | } | 4321 | } |
4329 | 4322 | ||
@@ -4332,17 +4325,16 @@ static int b43_op_start(struct ieee80211_hw *hw) | |||
4332 | if (err) { | 4325 | if (err) { |
4333 | if (did_init) | 4326 | if (did_init) |
4334 | b43_wireless_core_exit(dev); | 4327 | b43_wireless_core_exit(dev); |
4335 | do_rfkill_exit = 1; | ||
4336 | goto out_mutex_unlock; | 4328 | goto out_mutex_unlock; |
4337 | } | 4329 | } |
4338 | } | 4330 | } |
4339 | 4331 | ||
4332 | /* XXX: only do if device doesn't support rfkill irq */ | ||
4333 | wiphy_rfkill_start_polling(hw->wiphy); | ||
4334 | |||
4340 | out_mutex_unlock: | 4335 | out_mutex_unlock: |
4341 | mutex_unlock(&wl->mutex); | 4336 | mutex_unlock(&wl->mutex); |
4342 | 4337 | ||
4343 | if (do_rfkill_exit) | ||
4344 | b43_rfkill_exit(dev); | ||
4345 | |||
4346 | return err; | 4338 | return err; |
4347 | } | 4339 | } |
4348 | 4340 | ||
@@ -4351,7 +4343,6 @@ static void b43_op_stop(struct ieee80211_hw *hw) | |||
4351 | struct b43_wl *wl = hw_to_b43_wl(hw); | 4343 | struct b43_wl *wl = hw_to_b43_wl(hw); |
4352 | struct b43_wldev *dev = wl->current_dev; | 4344 | struct b43_wldev *dev = wl->current_dev; |
4353 | 4345 | ||
4354 | b43_rfkill_exit(dev); | ||
4355 | cancel_work_sync(&(wl->beacon_update_trigger)); | 4346 | cancel_work_sync(&(wl->beacon_update_trigger)); |
4356 | 4347 | ||
4357 | mutex_lock(&wl->mutex); | 4348 | mutex_lock(&wl->mutex); |
@@ -4433,6 +4424,7 @@ static const struct ieee80211_ops b43_hw_ops = { | |||
4433 | .sta_notify = b43_op_sta_notify, | 4424 | .sta_notify = b43_op_sta_notify, |
4434 | .sw_scan_start = b43_op_sw_scan_start_notifier, | 4425 | .sw_scan_start = b43_op_sw_scan_start_notifier, |
4435 | .sw_scan_complete = b43_op_sw_scan_complete_notifier, | 4426 | .sw_scan_complete = b43_op_sw_scan_complete_notifier, |
4427 | .rfkill_poll = b43_rfkill_poll, | ||
4436 | }; | 4428 | }; |
4437 | 4429 | ||
4438 | /* Hard-reset the chip. Do not call this directly. | 4430 | /* Hard-reset the chip. Do not call this directly. |
@@ -4920,7 +4912,7 @@ static struct ssb_driver b43_ssb_driver = { | |||
4920 | static void b43_print_driverinfo(void) | 4912 | static void b43_print_driverinfo(void) |
4921 | { | 4913 | { |
4922 | const char *feat_pci = "", *feat_pcmcia = "", *feat_nphy = "", | 4914 | const char *feat_pci = "", *feat_pcmcia = "", *feat_nphy = "", |
4923 | *feat_leds = "", *feat_rfkill = ""; | 4915 | *feat_leds = ""; |
4924 | 4916 | ||
4925 | #ifdef CONFIG_B43_PCI_AUTOSELECT | 4917 | #ifdef CONFIG_B43_PCI_AUTOSELECT |
4926 | feat_pci = "P"; | 4918 | feat_pci = "P"; |
@@ -4934,14 +4926,11 @@ static void b43_print_driverinfo(void) | |||
4934 | #ifdef CONFIG_B43_LEDS | 4926 | #ifdef CONFIG_B43_LEDS |
4935 | feat_leds = "L"; | 4927 | feat_leds = "L"; |
4936 | #endif | 4928 | #endif |
4937 | #ifdef CONFIG_B43_RFKILL | ||
4938 | feat_rfkill = "R"; | ||
4939 | #endif | ||
4940 | printk(KERN_INFO "Broadcom 43xx driver loaded " | 4929 | printk(KERN_INFO "Broadcom 43xx driver loaded " |
4941 | "[ Features: %s%s%s%s%s, Firmware-ID: " | 4930 | "[ Features: %s%s%s%s, Firmware-ID: " |
4942 | B43_SUPPORTED_FIRMWARE_ID " ]\n", | 4931 | B43_SUPPORTED_FIRMWARE_ID " ]\n", |
4943 | feat_pci, feat_pcmcia, feat_nphy, | 4932 | feat_pci, feat_pcmcia, feat_nphy, |
4944 | feat_leds, feat_rfkill); | 4933 | feat_leds); |
4945 | } | 4934 | } |
4946 | 4935 | ||
4947 | static int __init b43_init(void) | 4936 | static int __init b43_init(void) |