diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2009-04-16 20:56:38 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:57:16 -0400 |
commit | a027087a6b4c7d985b872cac3e19ce023670792e (patch) | |
tree | 7c2b85a9e417f1ed432332967efb95287d39c458 /drivers/net/wireless/rtl818x/rtl8187_dev.c | |
parent | 357303e2b61272b191f2e5d782d94fdd8f50fd71 (diff) |
rtl8187: Implement TX/RX blink for LED
The following patch implements some control over the LED on RTL8187B and
RTL8187L devices. Triggers are registered for TX and RX. Whenever the
trigger event occurs, the LED is turned off for 1/20 second, then turned
back on.
Note: For those RTL8187X devices that are built into the computer and have
a LED that is expected to be controlled with a radio switch, this patch will
not operate that LED. That will take a separate patch to be prepared later.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Tested-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtl818x/rtl8187_dev.c')
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187_dev.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c index d6d4001812a7..ac558da92aac 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c | |||
@@ -29,6 +29,9 @@ | |||
29 | 29 | ||
30 | #include "rtl8187.h" | 30 | #include "rtl8187.h" |
31 | #include "rtl8187_rtl8225.h" | 31 | #include "rtl8187_rtl8225.h" |
32 | #ifdef CONFIG_RTL8187_LEDS | ||
33 | #include "rtl8187_leds.h" | ||
34 | #endif | ||
32 | 35 | ||
33 | MODULE_AUTHOR("Michael Wu <flamingice@sourmilk.net>"); | 36 | MODULE_AUTHOR("Michael Wu <flamingice@sourmilk.net>"); |
34 | MODULE_AUTHOR("Andrea Merello <andreamrl@tiscali.it>"); | 37 | MODULE_AUTHOR("Andrea Merello <andreamrl@tiscali.it>"); |
@@ -734,10 +737,10 @@ static const u8 rtl8187b_reg_table[][3] = { | |||
734 | {0x85, 0x24, 0}, {0x88, 0x54, 0}, {0x8B, 0xB8, 0}, {0x8C, 0x07, 0}, | 737 | {0x85, 0x24, 0}, {0x88, 0x54, 0}, {0x8B, 0xB8, 0}, {0x8C, 0x07, 0}, |
735 | {0x8D, 0x00, 0}, {0x94, 0x1B, 0}, {0x95, 0x12, 0}, {0x96, 0x00, 0}, | 738 | {0x8D, 0x00, 0}, {0x94, 0x1B, 0}, {0x95, 0x12, 0}, {0x96, 0x00, 0}, |
736 | {0x97, 0x06, 0}, {0x9D, 0x1A, 0}, {0x9F, 0x10, 0}, {0xB4, 0x22, 0}, | 739 | {0x97, 0x06, 0}, {0x9D, 0x1A, 0}, {0x9F, 0x10, 0}, {0xB4, 0x22, 0}, |
737 | {0xBE, 0x80, 0}, {0xDB, 0x00, 0}, {0xEE, 0x00, 0}, {0x91, 0x03, 0}, | 740 | {0xBE, 0x80, 0}, {0xDB, 0x00, 0}, {0xEE, 0x00, 0}, {0x4C, 0x00, 2}, |
738 | 741 | ||
739 | {0x4C, 0x00, 2}, {0x9F, 0x00, 3}, {0x8C, 0x01, 0}, {0x8D, 0x10, 0}, | 742 | {0x9F, 0x00, 3}, {0x8C, 0x01, 0}, {0x8D, 0x10, 0}, {0x8E, 0x08, 0}, |
740 | {0x8E, 0x08, 0}, {0x8F, 0x00, 0} | 743 | {0x8F, 0x00, 0} |
741 | }; | 744 | }; |
742 | 745 | ||
743 | static int rtl8187b_init_hw(struct ieee80211_hw *dev) | 746 | static int rtl8187b_init_hw(struct ieee80211_hw *dev) |
@@ -1501,6 +1504,12 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, | |||
1501 | wiphy_name(dev->wiphy), dev->wiphy->perm_addr, | 1504 | wiphy_name(dev->wiphy), dev->wiphy->perm_addr, |
1502 | chip_name, priv->asic_rev, priv->rf->name); | 1505 | chip_name, priv->asic_rev, priv->rf->name); |
1503 | 1506 | ||
1507 | #ifdef CONFIG_RTL8187_LEDS | ||
1508 | eeprom_93cx6_read(&eeprom, 0x3F, ®); | ||
1509 | reg &= 0xFF; | ||
1510 | rtl8187_leds_init(dev, reg); | ||
1511 | #endif | ||
1512 | |||
1504 | return 0; | 1513 | return 0; |
1505 | 1514 | ||
1506 | err_free_dev: | 1515 | err_free_dev: |
@@ -1518,6 +1527,9 @@ static void __devexit rtl8187_disconnect(struct usb_interface *intf) | |||
1518 | if (!dev) | 1527 | if (!dev) |
1519 | return; | 1528 | return; |
1520 | 1529 | ||
1530 | #ifdef CONFIG_RTL8187_LEDS | ||
1531 | rtl8187_leds_exit(dev); | ||
1532 | #endif | ||
1521 | ieee80211_unregister_hw(dev); | 1533 | ieee80211_unregister_hw(dev); |
1522 | 1534 | ||
1523 | priv = dev->priv; | 1535 | priv = dev->priv; |