drivers/net/wireless/marvell/mwifiex/util.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/util.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/util.c- Extension
.c- Size
- 25296 bytes
- Lines
- 844
- 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
decl.hioctl.hutil.hfw.hmain.hwmm.h11n.h
Detected Declarations
function mwifiex_init_shutdown_fwfunction mwifiex_get_debug_infofunction mwifiex_debug_info_to_bufferfunction mwifiex_parse_mgmt_packetfunction mwifiex_host_mlme_disconnectfunction mwifiex_process_mgmt_packetfunction mwifiex_recv_packetfunction mwifiex_complete_cmdfunction mwifiex_get_sta_entryfunction list_for_each_entryfunction mwifiex_get_tdls_sta_entryfunction list_for_each_entryfunction mwifiex_is_tdls_chan_switchingfunction mwifiex_is_tdls_off_chanfunction mwifiex_is_send_cmd_allowedfunction mwifiex_add_sta_entryfunction mwifiex_set_sta_ht_capfunction mwifiex_del_sta_entryfunction mwifiex_del_all_sta_listfunction list_for_each_entry_safefunction mwifiex_hist_data_addfunction mwifiex_hist_data_setfunction mwifiex_hist_data_resetfunction mwifiex_fw_dump_eventexport mwifiex_init_shutdown_fwexport mwifiex_alloc_dma_align_bufexport mwifiex_fw_dump_event
Annotated Snippet
switch (size) {
case 1:
val = *((u8 *)addr);
break;
case 2:
val = get_unaligned((u16 *)addr);
break;
case 4:
val = get_unaligned((u32 *)addr);
break;
case 8:
val = get_unaligned((long long *)addr);
break;
default:
val = -1;
break;
}
p += sprintf(p, "%#lx ", val);
addr += size;
}
p += sprintf(p, "\n");
}
if (info->tx_tbl_num) {
p += sprintf(p, "Tx BA stream table:\n");
for (i = 0; i < info->tx_tbl_num; i++)
p += sprintf(p, "tid = %d, ra = %pM\n",
info->tx_tbl[i].tid, info->tx_tbl[i].ra);
}
if (info->rx_tbl_num) {
p += sprintf(p, "Rx reorder table:\n");
for (i = 0; i < info->rx_tbl_num; i++) {
p += sprintf(p, "tid = %d, ta = %pM, ",
info->rx_tbl[i].tid,
info->rx_tbl[i].ta);
p += sprintf(p, "start_win = %d, ",
info->rx_tbl[i].start_win);
p += sprintf(p, "win_size = %d, buffer: ",
info->rx_tbl[i].win_size);
for (j = 0; j < info->rx_tbl[i].win_size; j++)
p += sprintf(p, "%c ",
info->rx_tbl[i].buffer[j] ?
'1' : '0');
p += sprintf(p, "\n");
}
}
if (info->tdls_peer_num) {
p += sprintf(p, "TDLS peer table:\n");
for (i = 0; i < info->tdls_peer_num; i++) {
p += sprintf(p, "peer = %pM",
info->tdls_list[i].peer_addr);
p += sprintf(p, "\n");
}
}
return p - buf;
}
static int
mwifiex_parse_mgmt_packet(struct mwifiex_private *priv, u8 *payload, u16 len,
struct rxpd *rx_pd)
{
u16 stype;
u8 category, action_code, *addr2;
struct ieee80211_hdr *ieee_hdr = (void *)payload;
stype = (le16_to_cpu(ieee_hdr->frame_control) & IEEE80211_FCTL_STYPE);
switch (stype) {
case IEEE80211_STYPE_ACTION:
category = *(payload + sizeof(struct ieee80211_hdr));
switch (category) {
case WLAN_CATEGORY_PUBLIC:
action_code = *(payload + sizeof(struct ieee80211_hdr)
+ 1);
if (action_code == WLAN_PUB_ACTION_TDLS_DISCOVER_RES) {
addr2 = ieee_hdr->addr2;
mwifiex_dbg(priv->adapter, INFO,
"TDLS discovery response %pM nf=%d, snr=%d\n",
addr2, rx_pd->nf, rx_pd->snr);
mwifiex_auto_tdls_update_peer_signal(priv,
addr2,
rx_pd->snr,
rx_pd->nf);
Annotation
- Immediate include surface: `decl.h`, `ioctl.h`, `util.h`, `fw.h`, `main.h`, `wmm.h`, `11n.h`.
- Detected declarations: `function mwifiex_init_shutdown_fw`, `function mwifiex_get_debug_info`, `function mwifiex_debug_info_to_buffer`, `function mwifiex_parse_mgmt_packet`, `function mwifiex_host_mlme_disconnect`, `function mwifiex_process_mgmt_packet`, `function mwifiex_recv_packet`, `function mwifiex_complete_cmd`, `function mwifiex_get_sta_entry`, `function list_for_each_entry`.
- 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.