diff options
author | Michael Albaugh <michael.albaugh@qlogic.com> | 2007-05-16 18:45:09 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-07-09 23:12:25 -0400 |
commit | 82466f00ec6ef0a5ca7ea8991c731af2ec561c7d (patch) | |
tree | 48fcc8f78e6df67130e8c70b160fea42aeff79ca /drivers/infiniband/hw/ipath/ipath_kernel.h | |
parent | a024291b367f98188f4da4a66a9f2f40a2163efb (diff) |
IB/ipath: Support blinking LEDs with an led_override file
When we want to find an InfiniPath HCA in a rack of nodes, it is often
expeditious to blink the status LEDs via a userspace /sys file.
A write-only led_override "file" is published per device. Writes to
this file are interpreted as (string form) numbers, and the resulting
value sent to ipath_set_led_override(). The upper eight bits are
interpretted as a 4.4 fixed-point "frequency in Hertz", and the bottom
two 4-bit values are alternately (D0..3, then D4..7) used by the
board-specific LED-setting function to override the normal state.
Signed-off-by: Michael Albaugh <michael.albaugh@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_kernel.h')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_kernel.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h index 12194f3dd8cc..2f39db7df31c 100644 --- a/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/drivers/infiniband/hw/ipath/ipath_kernel.h | |||
@@ -575,6 +575,16 @@ struct ipath_devdata { | |||
575 | u16 ipath_gpio_scl_num; | 575 | u16 ipath_gpio_scl_num; |
576 | u64 ipath_gpio_sda; | 576 | u64 ipath_gpio_sda; |
577 | u64 ipath_gpio_scl; | 577 | u64 ipath_gpio_scl; |
578 | |||
579 | /* used to override LED behavior */ | ||
580 | u8 ipath_led_override; /* Substituted for normal value, if non-zero */ | ||
581 | u16 ipath_led_override_timeoff; /* delta to next timer event */ | ||
582 | u8 ipath_led_override_vals[2]; /* Alternates per blink-frame */ | ||
583 | u8 ipath_led_override_phase; /* Just counts, LSB picks from vals[] */ | ||
584 | atomic_t ipath_led_override_timer_active; | ||
585 | /* Used to flash LEDs in override mode */ | ||
586 | struct timer_list ipath_led_override_timer; | ||
587 | |||
578 | }; | 588 | }; |
579 | 589 | ||
580 | /* Private data for file operations */ | 590 | /* Private data for file operations */ |
@@ -717,6 +727,15 @@ u64 ipath_snap_cntr(struct ipath_devdata *, ipath_creg); | |||
717 | void ipath_disarm_senderrbufs(struct ipath_devdata *, int); | 727 | void ipath_disarm_senderrbufs(struct ipath_devdata *, int); |
718 | 728 | ||
719 | /* | 729 | /* |
730 | * Set LED override, only the two LSBs have "public" meaning, but | ||
731 | * any non-zero value substitutes them for the Link and LinkTrain | ||
732 | * LED states. | ||
733 | */ | ||
734 | #define IPATH_LED_PHYS 1 /* Physical (linktraining) GREEN LED */ | ||
735 | #define IPATH_LED_LOG 2 /* Logical (link) YELLOW LED */ | ||
736 | void ipath_set_led_override(struct ipath_devdata *dd, unsigned int val); | ||
737 | |||
738 | /* | ||
720 | * number of words used for protocol header if not set by ipath_userinit(); | 739 | * number of words used for protocol header if not set by ipath_userinit(); |
721 | */ | 740 | */ |
722 | #define IPATH_DFLT_RCVHDRSIZE 9 | 741 | #define IPATH_DFLT_RCVHDRSIZE 9 |