/* Callback from the LED subsystem. */ staticvoid b43legacy_led_brightness_set(struct led_classdev *led_dev, enum led_brightness brightness)
{ struct b43legacy_led *led = container_of(led_dev, struct b43legacy_led,
led_dev); struct b43legacy_wldev *dev = led->dev; bool radio_enabled;
/* Checking the radio-enabled status here is slightly racy, * but we want to avoid the locking overhead and we don't care
* whether the LED has the wrong state for a second. */
radio_enabled = (dev->phy.radio_on && dev->radio_hw_enable);
/* Map the b43 specific LED behaviour value to the
* generic LED triggers. */ switch (behaviour) { case B43legacy_LED_INACTIVE: break; case B43legacy_LED_OFF:
b43legacy_led_turn_off(dev, led_index, activelow); break; case B43legacy_LED_ON:
b43legacy_led_turn_on(dev, led_index, activelow); break; case B43legacy_LED_ACTIVITY: case B43legacy_LED_TRANSFER: case B43legacy_LED_APTRANSFER:
snprintf(name, sizeof(name), "b43legacy-%s::tx", wiphy_name(hw->wiphy));
b43legacy_register_led(dev, &dev->led_tx, name,
ieee80211_get_tx_led_name(hw),
led_index, activelow);
snprintf(name, sizeof(name), "b43legacy-%s::rx", wiphy_name(hw->wiphy));
b43legacy_register_led(dev, &dev->led_rx, name,
ieee80211_get_rx_led_name(hw),
led_index, activelow); break; case B43legacy_LED_RADIO_ALL: case B43legacy_LED_RADIO_A: case B43legacy_LED_RADIO_B: case B43legacy_LED_MODE_BG:
snprintf(name, sizeof(name), "b43legacy-%s::radio", wiphy_name(hw->wiphy));
b43legacy_register_led(dev, &dev->led_radio, name,
ieee80211_get_radio_led_name(hw),
led_index, activelow); /* Sync the RF-kill LED state with radio and switch states. */ if (dev->phy.radio_on && b43legacy_is_hw_radio_enabled(dev))
b43legacy_led_turn_on(dev, led_index, activelow); break; case B43legacy_LED_WEIRD: case B43legacy_LED_ASSOC:
snprintf(name, sizeof(name), "b43legacy-%s::assoc", wiphy_name(hw->wiphy));
b43legacy_register_led(dev, &dev->led_assoc, name,
ieee80211_get_assoc_led_name(hw),
led_index, activelow); break; default:
b43legacywarn(dev->wl, "LEDs: Unknown behaviour 0x%02X\n",
behaviour); break;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.