drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c- Extension
.c- Size
- 2839 bytes
- Lines
- 113
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
net/mac80211.hlinux/bcma/bcma_driver_chipcommon.hlinux/gpio/driver.hlinux/gpio/machine.hlinux/gpio/consumer.hmac80211_if.hpub.hmain.hled.h
Detected Declarations
function brcms_radio_led_ctrlfunction brcms_led_brightness_setfunction brcms_led_unregisterfunction brcms_led_register
Annotated Snippet
if ((led & BRCMS_LED_BEH_MASK) == BRCMS_LED_RADIO) {
hwnum = i;
if (led & BRCMS_LED_AL_MASK)
lflags = GPIO_ACTIVE_LOW;
break;
}
}
/* No LED, bail out */
if (hwnum == -1)
return -ENODEV;
/* Try to obtain this LED GPIO line */
radio_led->gpiod = gpiochip_request_own_desc(bcma_gpio, hwnum,
"radio on", lflags,
GPIOD_OUT_LOW);
if (IS_ERR(radio_led->gpiod)) {
err = PTR_ERR(radio_led->gpiod);
wiphy_err(wl->wiphy, "requesting led GPIO failed (err: %d)\n",
err);
return err;
}
snprintf(wl->radio_led.name, sizeof(wl->radio_led.name),
"brcmsmac-%s:radio", wiphy_name(wl->wiphy));
wl->led_dev.name = wl->radio_led.name;
wl->led_dev.default_trigger =
ieee80211_get_radio_led_name(wl->pub->ieee_hw);
wl->led_dev.brightness_set = brcms_led_brightness_set;
err = led_classdev_register(wiphy_dev(wl->wiphy), &wl->led_dev);
if (err) {
wiphy_err(wl->wiphy, "cannot register led device: %s (err: %d)\n",
wl->radio_led.name, err);
return err;
}
wiphy_info(wl->wiphy, "registered radio enabled led device: %s\n",
wl->radio_led.name);
return 0;
}
Annotation
- Immediate include surface: `net/mac80211.h`, `linux/bcma/bcma_driver_chipcommon.h`, `linux/gpio/driver.h`, `linux/gpio/machine.h`, `linux/gpio/consumer.h`, `mac80211_if.h`, `pub.h`, `main.h`.
- Detected declarations: `function brcms_radio_led_ctrl`, `function brcms_led_brightness_set`, `function brcms_led_unregister`, `function brcms_led_register`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.