diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-12-20 04:55:57 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:58:37 -0500 |
commit | 7396faf4f3228b88c6c815c7a93081b456716d5f (patch) | |
tree | 86eeb5aa85d0300cbfea04ac6d2e14ce7528c04b /drivers/net/wireless/rt2x00/rt2500usb.c | |
parent | a07dbea210e146aedf8929cdabe082b58696260c (diff) |
rt2x00: Add RFKILL support to rt2500usb and rt73usb
Some very rare Ralink USB hardware exists which features
the RFKILL switch on the USB stick.
This patch adds the EEPROM check function to see if RFKILL
is supported and the polling function to rt2500usb and
rt73usb in order to support RFKILL for that hardware.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 557fcf2b30e4..01e5584d8f77 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -280,6 +280,18 @@ static const struct rt2x00debug rt2500usb_rt2x00debug = { | |||
280 | }; | 280 | }; |
281 | #endif /* CONFIG_RT2X00_LIB_DEBUGFS */ | 281 | #endif /* CONFIG_RT2X00_LIB_DEBUGFS */ |
282 | 282 | ||
283 | #ifdef CONFIG_RT2X00_LIB_RFKILL | ||
284 | static int rt2500usb_rfkill_poll(struct rt2x00_dev *rt2x00dev) | ||
285 | { | ||
286 | u16 reg; | ||
287 | |||
288 | rt2500usb_register_read(rt2x00dev, MAC_CSR19, ®); | ||
289 | return rt2x00_get_field32(reg, MAC_CSR19_BIT7); | ||
290 | } | ||
291 | #else | ||
292 | #define rt2500usb_rfkill_poll NULL | ||
293 | #endif /* CONFIG_RT2X00_LIB_RFKILL */ | ||
294 | |||
283 | #ifdef CONFIG_RT2X00_LIB_LEDS | 295 | #ifdef CONFIG_RT2X00_LIB_LEDS |
284 | static void rt2500usb_brightness_set(struct led_classdev *led_cdev, | 296 | static void rt2500usb_brightness_set(struct led_classdev *led_cdev, |
285 | enum led_brightness brightness) | 297 | enum led_brightness brightness) |
@@ -1597,6 +1609,14 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1597 | #endif /* CONFIG_RT2X00_LIB_LEDS */ | 1609 | #endif /* CONFIG_RT2X00_LIB_LEDS */ |
1598 | 1610 | ||
1599 | /* | 1611 | /* |
1612 | * Detect if this device has an hardware controlled radio. | ||
1613 | */ | ||
1614 | #ifdef CONFIG_RT2X00_LIB_RFKILL | ||
1615 | if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) | ||
1616 | __set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags); | ||
1617 | #endif /* CONFIG_RT2X00_LIB_RFKILL */ | ||
1618 | |||
1619 | /* | ||
1600 | * Check if the BBP tuning should be disabled. | 1620 | * Check if the BBP tuning should be disabled. |
1601 | */ | 1621 | */ |
1602 | rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); | 1622 | rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); |
@@ -1902,6 +1922,7 @@ static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = { | |||
1902 | .uninitialize = rt2x00usb_uninitialize, | 1922 | .uninitialize = rt2x00usb_uninitialize, |
1903 | .clear_entry = rt2x00usb_clear_entry, | 1923 | .clear_entry = rt2x00usb_clear_entry, |
1904 | .set_device_state = rt2500usb_set_device_state, | 1924 | .set_device_state = rt2500usb_set_device_state, |
1925 | .rfkill_poll = rt2500usb_rfkill_poll, | ||
1905 | .link_stats = rt2500usb_link_stats, | 1926 | .link_stats = rt2500usb_link_stats, |
1906 | .reset_tuner = rt2500usb_reset_tuner, | 1927 | .reset_tuner = rt2500usb_reset_tuner, |
1907 | .link_tuner = rt2500usb_link_tuner, | 1928 | .link_tuner = rt2500usb_link_tuner, |