/* 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;
}
}
for (i = 0; i < 4; i++) { if (sprom[i] == 0xFF) { /* There is no LED information in the SPROM
* for this LED. Hardcode it here. */
activelow = false; switch (i) { case 0:
behaviour = B43legacy_LED_ACTIVITY;
activelow = true; if (bus->boardinfo.vendor == PCI_VENDOR_ID_COMPAQ)
behaviour = B43legacy_LED_RADIO_ALL; break; case 1:
behaviour = B43legacy_LED_RADIO_B; if (bus->boardinfo.vendor == PCI_VENDOR_ID_ASUSTEK)
behaviour = B43legacy_LED_ASSOC; break; case 2:
behaviour = B43legacy_LED_RADIO_A; break; case 3:
behaviour = B43legacy_LED_OFF; break; default:
B43legacy_WARN_ON(1); return;
}
} else {
behaviour = sprom[i] & B43legacy_LED_BEHAVIOUR;
activelow = !!(sprom[i] & B43legacy_LED_ACTIVELOW);
}
b43legacy_map_led(dev, i, behaviour, activelow);
}
}
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.