aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/zd1211rw/zd_chip.h
diff options
context:
space:
mode:
authorUlrich Kunitz <kune@deine-taler.de>2006-09-12 21:42:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2006-09-25 16:52:17 -0400
commit583afd1e4f25c87000c85ad7d03f5299fd4155dc (patch)
treee5ceeee697091a1b9a654ae3e6411cd4674a47c2 /drivers/net/wireless/zd1211rw/zd_chip.h
parentbc5f06a8aaa29a79c9da2cedb5b9779b8081289c (diff)
[PATCH] zd1211rw: Add LED support
This patch includes a big cleanup of the existing unused LED code, and adds support for controlling the LED. The link LED will blink if the device is not associated. The LED switches between 2 seconds on and 1 second off. If the device is associated the LED is switched on. The link LED also indicates packet TX. I do a little bit more led resetting than the vendor driver, but the device works now as expected for single LED and double LED devices. Signed-off-by: Ulrich Kunitz <kune@deine-taler.de> Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_chip.h')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_chip.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.h b/drivers/net/wireless/zd1211rw/zd_chip.h
index 4b1250859897..ae59597ce4e1 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.h
+++ b/drivers/net/wireless/zd1211rw/zd_chip.h
@@ -428,6 +428,7 @@
428/* masks for controlling LEDs */ 428/* masks for controlling LEDs */
429#define LED1 0x0100 429#define LED1 0x0100
430#define LED2 0x0200 430#define LED2 0x0200
431#define LED_SW 0x0400
431 432
432/* Seems to indicate that the configuration is over. 433/* Seems to indicate that the configuration is over.
433 */ 434 */
@@ -629,6 +630,10 @@
629#define FW_SOFT_RESET FW_REG(4) 630#define FW_SOFT_RESET FW_REG(4)
630#define FW_FLASH_CHK FW_REG(5) 631#define FW_FLASH_CHK FW_REG(5)
631 632
633#define FW_LINK_OFF 0x0
634#define FW_LINK_TX 0x1
635/* 0x2 - link led on? */
636
632enum { 637enum {
633 CR_BASE_OFFSET = 0x9000, 638 CR_BASE_OFFSET = 0x9000,
634 FW_START_OFFSET = 0xee00, 639 FW_START_OFFSET = 0xee00,
@@ -663,8 +668,11 @@ struct zd_chip {
663 u8 pwr_int_values[E2P_CHANNEL_COUNT]; 668 u8 pwr_int_values[E2P_CHANNEL_COUNT];
664 /* SetPointOFDM in the vendor driver */ 669 /* SetPointOFDM in the vendor driver */
665 u8 ofdm_cal_values[3][E2P_CHANNEL_COUNT]; 670 u8 ofdm_cal_values[3][E2P_CHANNEL_COUNT];
666 u8 pa_type:4, patch_cck_gain:1, patch_cr157:1, patch_6m_band_edge:1, 671 u16 link_led;
667 new_phy_layout:1, is_zd1211b:1; 672 unsigned int pa_type:4,
673 patch_cck_gain:1, patch_cr157:1, patch_6m_band_edge:1,
674 new_phy_layout:1,
675 is_zd1211b:1, supports_tx_led:1;
668}; 676};
669 677
670static inline struct zd_chip *zd_usb_to_chip(struct zd_usb *usb) 678static inline struct zd_chip *zd_usb_to_chip(struct zd_usb *usb)
@@ -812,15 +820,12 @@ int zd_chip_lock_phy_regs(struct zd_chip *chip);
812int zd_chip_unlock_phy_regs(struct zd_chip *chip); 820int zd_chip_unlock_phy_regs(struct zd_chip *chip);
813 821
814enum led_status { 822enum led_status {
815 LED_OFF = 0, 823 LED_OFF = 0,
816 LED_ON = 1, 824 LED_SCANNING = 1,
817 LED_FLIP = 2, 825 LED_ASSOCIATED = 2,
818 LED_STATUS = 3,
819}; 826};
820 827
821int zd_chip_led_status(struct zd_chip *chip, int led, enum led_status status); 828int zd_chip_control_leds(struct zd_chip *chip, enum led_status status);
822int zd_chip_led_flip(struct zd_chip *chip, int led,
823 const unsigned int *phases_msecs, unsigned int count);
824 829
825int zd_set_beacon_interval(struct zd_chip *chip, u32 interval); 830int zd_set_beacon_interval(struct zd_chip *chip, u32 interval);
826 831