drivers/net/wireless/ti/wl1251/main.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ti/wl1251/main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ti/wl1251/main.c- Extension
.c- Size
- 38046 bytes
- Lines
- 1681
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/interrupt.hlinux/firmware.hlinux/delay.hlinux/irq.hlinux/crc32.hlinux/etherdevice.hlinux/vmalloc.hlinux/slab.hlinux/netdevice.hwl1251.hwl12xx_80211.hreg.hio.hcmd.hevent.htx.hrx.hps.hinit.hdebugfs.hboot.h
Detected Declarations
struct wl1251_filter_paramsfunction Copyrightfunction wl1251_disable_interruptsfunction wl1251_power_offfunction wl1251_power_onfunction wl1251_fetch_firmwarefunction wl1251_fetch_nvsfunction wl1251_fw_wakeupfunction wl1251_chip_wakeupfunction wl1251_irq_workfunction wl1251_joinfunction wl1251_op_txfunction wl1251_op_startfunction wl1251_op_stopfunction wl1251_op_add_interfacefunction wl1251_op_remove_interfacefunction wl1251_build_null_datafunction wl1251_build_qos_null_datafunction wl1251_can_do_pmfunction wl1251_op_configfunction presentfunction wl1251_op_prepare_multicastfunction netdev_hw_addr_list_for_eachfunction wl1251_op_configure_filterfunction wl1251_set_key_typefunction wl1251_op_set_keyfunction wl1251_op_hw_scanfunction wl1251_op_set_rts_thresholdfunction wl1251_op_bss_info_changedfunction wl1251_op_conf_txfunction wl1251_op_get_surveyfunction wl1251_read_eeprom_bytefunction wl1251_read_eepromfunction wl1251_read_eeprom_macfunction wl1251_check_nvs_macfunction wl1251_read_nvs_macfunction wl1251_write_nvs_macfunction wl1251_register_hwfunction wl1251_init_ieee80211function wl1251_free_hwexport wl1251_init_ieee80211export wl1251_alloc_hwexport wl1251_free_hw
Annotated Snippet
struct wl1251_filter_params {
bool enabled;
int mc_list_length;
u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN];
};
static u64 wl1251_op_prepare_multicast(struct ieee80211_hw *hw,
struct netdev_hw_addr_list *mc_list)
{
struct wl1251_filter_params *fp;
struct netdev_hw_addr *ha;
struct wl1251 *wl = hw->priv;
if (unlikely(wl->state == WL1251_STATE_OFF))
return 0;
fp = kzalloc_obj(*fp, GFP_ATOMIC);
if (!fp) {
wl1251_error("Out of memory setting filters.");
return 0;
}
/* update multicast filtering parameters */
fp->mc_list_length = 0;
if (netdev_hw_addr_list_count(mc_list) > ACX_MC_ADDRESS_GROUP_MAX) {
fp->enabled = false;
} else {
fp->enabled = true;
netdev_hw_addr_list_for_each(ha, mc_list) {
memcpy(fp->mc_list[fp->mc_list_length],
ha->addr, ETH_ALEN);
fp->mc_list_length++;
}
}
return (u64)(unsigned long)fp;
}
#define WL1251_SUPPORTED_FILTERS (FIF_ALLMULTI | \
FIF_FCSFAIL | \
FIF_BCN_PRBRESP_PROMISC | \
FIF_CONTROL | \
FIF_OTHER_BSS | \
FIF_PROBE_REQ)
static void wl1251_op_configure_filter(struct ieee80211_hw *hw,
unsigned int changed,
unsigned int *total, u64 multicast)
{
struct wl1251_filter_params *fp = (void *)(unsigned long)multicast;
struct wl1251 *wl = hw->priv;
int ret;
wl1251_debug(DEBUG_MAC80211, "mac80211 configure filter");
*total &= WL1251_SUPPORTED_FILTERS;
changed &= WL1251_SUPPORTED_FILTERS;
if (changed == 0) {
/* no filters which we support changed */
kfree(fp);
return;
}
mutex_lock(&wl->mutex);
wl->rx_config = WL1251_DEFAULT_RX_CONFIG;
wl->rx_filter = WL1251_DEFAULT_RX_FILTER;
if (*total & FIF_ALLMULTI)
/*
* CFG_MC_FILTER_EN in rx_config needs to be 0 to receive
* all multicast frames
*/
wl->rx_config &= ~CFG_MC_FILTER_EN;
if (*total & FIF_FCSFAIL)
wl->rx_filter |= CFG_RX_FCS_ERROR;
if (*total & FIF_BCN_PRBRESP_PROMISC) {
wl->rx_config &= ~CFG_BSSID_FILTER_EN;
wl->rx_config &= ~CFG_SSID_FILTER_EN;
}
if (*total & FIF_CONTROL)
wl->rx_filter |= CFG_RX_CTL_EN;
if (*total & FIF_OTHER_BSS || is_zero_ether_addr(wl->bssid))
wl->rx_config &= ~CFG_BSSID_FILTER_EN;
if (*total & FIF_PROBE_REQ)
wl->rx_filter |= CFG_RX_PREQ_EN;
if (wl->state == WL1251_STATE_OFF)
goto out;
Annotation
- Immediate include surface: `linux/module.h`, `linux/interrupt.h`, `linux/firmware.h`, `linux/delay.h`, `linux/irq.h`, `linux/crc32.h`, `linux/etherdevice.h`, `linux/vmalloc.h`.
- Detected declarations: `struct wl1251_filter_params`, `function Copyright`, `function wl1251_disable_interrupts`, `function wl1251_power_off`, `function wl1251_power_on`, `function wl1251_fetch_firmware`, `function wl1251_fetch_nvs`, `function wl1251_fw_wakeup`, `function wl1251_chip_wakeup`, `function wl1251_irq_work`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.