drivers/net/wireless/microchip/wilc1000/wlan_cfg.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/microchip/wilc1000/wlan_cfg.c- Extension
.c- Size
- 9043 bytes
- Lines
- 434
- 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.
- 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/bitfield.hwlan_if.hwlan.hwlan_cfg.hnetdev.h
Detected Declarations
enum cfg_cmd_typefunction wilc_wlan_cfg_set_bytefunction wilc_wlan_cfg_set_hwordfunction wilc_wlan_cfg_set_wordfunction wilc_wlan_cfg_set_strfunction wilc_wlan_cfg_set_binfunction wilc_wlan_parse_response_framefunction wilc_wlan_parse_info_framefunction wilc_wlan_cfg_set_widfunction wilc_wlan_cfg_get_widfunction wilc_wlan_cfg_get_valfunction wilc_wlan_cfg_indicate_rxfunction wilc_wlan_cfg_initfunction wilc_wlan_cfg_deinit
Annotated Snippet
switch (FIELD_GET(WILC_WID_TYPE, wid)) {
case WID_CHAR:
len = 3;
if (len + 2 > size)
return;
while (cfg->b[i].id != WID_NIL && cfg->b[i].id != wid)
i++;
if (cfg->b[i].id == wid)
cfg->b[i].val = info[4];
break;
case WID_SHORT:
len = 4;
if (len + 2 > size)
return;
while (cfg->hw[i].id != WID_NIL && cfg->hw[i].id != wid)
i++;
if (cfg->hw[i].id == wid)
cfg->hw[i].val = get_unaligned_le16(&info[4]);
break;
case WID_INT:
len = 6;
if (len + 2 > size)
return;
while (cfg->w[i].id != WID_NIL && cfg->w[i].id != wid)
i++;
if (cfg->w[i].id == wid)
cfg->w[i].val = get_unaligned_le32(&info[4]);
break;
case WID_STR:
len = 2 + get_unaligned_le16(&info[2]);
while (cfg->s[i].id != WID_NIL && cfg->s[i].id != wid)
i++;
if (cfg->s[i].id == wid) {
if (len > cfg->s[i].len || (len + 2 > size))
return;
memcpy(cfg->s[i].str, &info[2],
len);
}
break;
default:
break;
}
size -= (2 + len);
info += (2 + len);
}
}
static void wilc_wlan_parse_info_frame(struct wilc *wl, u8 *info)
{
u32 wid, len;
wid = get_unaligned_le16(info);
len = info[2];
if (len == 1 && wid == WID_STATUS) {
int i = 0;
while (wl->cfg.b[i].id != WID_NIL &&
wl->cfg.b[i].id != wid)
i++;
if (wl->cfg.b[i].id == wid)
wl->cfg.b[i].val = info[3];
}
}
/********************************************
*
* Configuration Exported Functions
*
********************************************/
Annotation
- Immediate include surface: `linux/bitfield.h`, `wlan_if.h`, `wlan.h`, `wlan_cfg.h`, `netdev.h`.
- Detected declarations: `enum cfg_cmd_type`, `function wilc_wlan_cfg_set_byte`, `function wilc_wlan_cfg_set_hword`, `function wilc_wlan_cfg_set_word`, `function wilc_wlan_cfg_set_str`, `function wilc_wlan_cfg_set_bin`, `function wilc_wlan_parse_response_frame`, `function wilc_wlan_parse_info_frame`, `function wilc_wlan_cfg_set_wid`, `function wilc_wlan_cfg_get_wid`.
- 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.