drivers/net/wireless/ath/ath6kl/wmi.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath6kl/wmi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath6kl/wmi.c- Extension
.c- Size
- 110621 bytes
- Lines
- 4161
- 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.
- 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/ip.hlinux/in.hcore.hdebug.htestmode.htrace.h../regd.h../regd_common.h
Detected Declarations
function ath6kl_wmi_set_control_epfunction ath6kl_wmi_get_control_epfunction ath6kl_wmi_dix_2_dot3function ath6kl_wmi_meta_addfunction ath6kl_wmi_data_hdr_addfunction ath6kl_wmi_determine_user_priorityfunction ath6kl_wmi_get_traffic_classfunction ath6kl_wmi_implicit_create_pstreamfunction ath6kl_wmi_dot11_hdr_removefunction ath6kl_wmi_dot3_2_dixfunction ath6kl_wmi_tx_complete_event_rxfunction ath6kl_wmi_remain_on_chnl_event_rxfunction ath6kl_wmi_cancel_remain_on_chnl_event_rxfunction ath6kl_wmi_tx_status_event_rxfunction ath6kl_wmi_rx_probe_req_event_rxfunction ath6kl_wmi_p2p_capabilities_event_rxfunction ath6kl_wmi_rx_action_event_rxfunction ath6kl_wmi_p2p_info_event_rxfunction ath6kl_wmi_simple_cmdfunction ath6kl_wmi_ready_event_rxfunction ath6kl_wmi_set_roam_lrssi_cmdfunction ath6kl_wmi_force_roam_cmdfunction ath6kl_wmi_ap_set_beacon_intvl_cmdfunction ath6kl_wmi_ap_set_dtim_cmdfunction ath6kl_wmi_set_roam_mode_cmdfunction ath6kl_wmi_connect_event_rxfunction ath6kl_regd_find_countryfunction ath6kl_get_regpairfunction ath6kl_regd_find_country_by_rdfunction ath6kl_wmi_regdomain_eventfunction ath6kl_wmi_disconnect_event_rxfunction ath6kl_wmi_peer_node_event_rxfunction ath6kl_wmi_tkip_micerr_event_rxfunction ath6kl_wmi_sscan_timerfunction ath6kl_wmi_bssinfo_event_rxfunction ath6kl_wmi_pstream_timeout_event_rxfunction ath6kl_wmi_bitrate_reply_rxfunction ath6kl_wmi_test_rxfunction ath6kl_wmi_ratemask_reply_rxfunction ath6kl_wmi_ch_list_reply_rxfunction ath6kl_wmi_tx_pwr_reply_rxfunction ath6kl_wmi_keepalive_reply_rxfunction ath6kl_wmi_scan_complete_rxfunction ath6kl_wmi_neighbor_report_event_rxfunction ath6kl_wmi_error_event_rxfunction ath6kl_wmi_stats_event_rxfunction ath6kl_wmi_get_upper_thresholdfunction ath6kl_wmi_get_lower_threshold
Annotated Snippet
if (vif->fw_vif_idx == if_idx) {
found = vif;
break;
}
}
spin_unlock_bh(&ar->list_lock);
return found;
}
/* Performs DIX to 802.3 encapsulation for transmit packets.
* Assumes the entire DIX header is contiguous and that there is
* enough room in the buffer for a 802.3 mac header and LLC+SNAP headers.
*/
int ath6kl_wmi_dix_2_dot3(struct wmi *wmi, struct sk_buff *skb)
{
struct ath6kl_llc_snap_hdr *llc_hdr;
struct ethhdr *eth_hdr;
size_t new_len;
__be16 type;
u8 *datap;
u16 size;
if (WARN_ON(skb == NULL))
return -EINVAL;
size = sizeof(struct ath6kl_llc_snap_hdr) + sizeof(struct wmi_data_hdr);
if (skb_headroom(skb) < size)
return -ENOMEM;
eth_hdr = (struct ethhdr *) skb->data;
type = eth_hdr->h_proto;
if (!is_ethertype(be16_to_cpu(type))) {
ath6kl_dbg(ATH6KL_DBG_WMI,
"%s: pkt is already in 802.3 format\n", __func__);
return 0;
}
new_len = skb->len - sizeof(*eth_hdr) + sizeof(*llc_hdr);
skb_push(skb, sizeof(struct ath6kl_llc_snap_hdr));
datap = skb->data;
eth_hdr->h_proto = cpu_to_be16(new_len);
memcpy(datap, eth_hdr, sizeof(*eth_hdr));
llc_hdr = (struct ath6kl_llc_snap_hdr *)(datap + sizeof(*eth_hdr));
llc_hdr->dsap = 0xAA;
llc_hdr->ssap = 0xAA;
llc_hdr->cntl = 0x03;
llc_hdr->org_code[0] = 0x0;
llc_hdr->org_code[1] = 0x0;
llc_hdr->org_code[2] = 0x0;
llc_hdr->eth_type = type;
return 0;
}
static int ath6kl_wmi_meta_add(struct wmi *wmi, struct sk_buff *skb,
u8 *version, void *tx_meta_info)
{
struct wmi_tx_meta_v1 *v1;
struct wmi_tx_meta_v2 *v2;
if (WARN_ON(skb == NULL || version == NULL))
return -EINVAL;
switch (*version) {
case WMI_META_VERSION_1:
skb_push(skb, WMI_MAX_TX_META_SZ);
v1 = (struct wmi_tx_meta_v1 *) skb->data;
v1->pkt_id = 0;
v1->rate_plcy_id = 0;
*version = WMI_META_VERSION_1;
break;
case WMI_META_VERSION_2:
skb_push(skb, WMI_MAX_TX_META_SZ);
v2 = (struct wmi_tx_meta_v2 *) skb->data;
memcpy(v2, (struct wmi_tx_meta_v2 *) tx_meta_info,
sizeof(struct wmi_tx_meta_v2));
break;
}
return 0;
}
int ath6kl_wmi_data_hdr_add(struct wmi *wmi, struct sk_buff *skb,
u8 msg_type, u32 flags,
Annotation
- Immediate include surface: `linux/ip.h`, `linux/in.h`, `core.h`, `debug.h`, `testmode.h`, `trace.h`, `../regd.h`, `../regd_common.h`.
- Detected declarations: `function ath6kl_wmi_set_control_ep`, `function ath6kl_wmi_get_control_ep`, `function ath6kl_wmi_dix_2_dot3`, `function ath6kl_wmi_meta_add`, `function ath6kl_wmi_data_hdr_add`, `function ath6kl_wmi_determine_user_priority`, `function ath6kl_wmi_get_traffic_class`, `function ath6kl_wmi_implicit_create_pstream`, `function ath6kl_wmi_dot11_hdr_remove`, `function ath6kl_wmi_dot3_2_dix`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.