/* Trigger a LED event in response to a CAN device event */ void can_led_event(struct net_device *netdev, enum can_led_event event) { struct can_priv *priv = netdev_priv(netdev); switch (event) { case CAN_LED_EVENT_OPEN: led_trigger_event(priv->tx_led_trig, LED_FULL); led_trigger_event(priv->rx_led_trig, LED_FULL); break; case CAN_LED_EVENT_STOP: led_trigger_event(priv->tx_led_trig, LED_OFF); led_trigger_event(priv->rx_led_trig, LED_OFF); break; case CAN_LED_EVENT_TX: if (led_delay) led_trigger_blink_oneshot(priv->tx_led_trig, &led_delay, &led_delay, 1); break; case CAN_LED_EVENT_RX: if (led_delay) led_trigger_blink_oneshot(priv->rx_led_trig, &led_delay, &led_delay, 1); break; } }
void ledtrig_disk_activity(bool write) { unsigned long blink_delay = BLINK_DELAY; led_trigger_blink_oneshot(ledtrig_disk, &blink_delay, &blink_delay, 0); led_trigger_blink_oneshot(ledtrig_ide, &blink_delay, &blink_delay, 0); if (write) led_trigger_blink_oneshot(ledtrig_disk_write, &blink_delay, &blink_delay, 0); else led_trigger_blink_oneshot(ledtrig_disk_read, &blink_delay, &blink_delay, 0); }
void ieee80211_led_tx(struct ieee80211_local *local) { unsigned long led_delay = MAC80211_BLINK_DELAY; if (unlikely(!local->tx_led)) return; led_trigger_blink_oneshot(local->tx_led, &led_delay, &led_delay, 0); }
void ieee80211_led_rx(struct ieee80211_local *local) { if (unlikely(!local->rx_led)) return; #if 0 /* Not in RHEL */ unsigned long led_delay = MAC80211_BLINK_DELAY; led_trigger_blink_oneshot(local->rx_led, &led_delay, &led_delay, 0); #else if (local->rx_led_counter++ % 2 == 0) led_trigger_event(local->rx_led, LED_OFF); else led_trigger_event(local->rx_led, LED_FULL); #endif }
void ledtrig_ir_activity(void) { led_trigger_blink_oneshot(ledtrig_ir_click, &ir_blink_delay, &ir_blink_delay,1); }
void ledtrig_ide_activity(void) { led_trigger_blink_oneshot(ledtrig_ide, &ide_blink_delay, &ide_blink_delay, 0); }