drivers/net/wireless/marvell/mwifiex/tdls.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/tdls.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/tdls.c- Extension
.c- Size
- 44762 bytes
- Lines
- 1558
- 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
main.hwmm.h11n.h11n_rxreorder.h11ac.h
Detected Declarations
function filefunction skb_queue_walk_safefunction mwifiex_hold_tdls_packetsfunction list_for_each_entryfunction mwifiex_tdls_append_rates_iefunction mwifiex_tdls_add_aidfunction mwifiex_tdls_add_vht_capabfunction mwifiex_tdls_add_ht_operfunction mwifiex_tdls_add_vht_operfunction mwifiex_tdls_add_ext_capabfunction mwifiex_tdls_add_qos_capabfunction mwifiex_tdls_add_wmm_param_iefunction mwifiex_add_wmm_info_iefunction mwifiex_tdls_add_bss_co_2040function mwifiex_tdls_add_supported_chanfunction mwifiex_tdls_add_oper_classfunction mwifiex_prep_tdls_encap_datafunction mwifiex_tdls_add_link_iefunction mwifiex_send_tdls_data_framefunction mwifiex_construct_tdls_action_framefunction mwifiex_send_tdls_action_framefunction mwifiex_process_tdls_action_framefunction mwifiex_tdls_process_config_linkfunction mwifiex_tdls_process_create_linkfunction mwifiex_tdls_process_disable_linkfunction mwifiex_tdls_process_enable_linkfunction mwifiex_tdls_operfunction mwifiex_get_tdls_link_statusfunction mwifiex_get_tdls_listfunction mwifiex_disable_all_tdls_linksfunction list_for_each_entryfunction mwifiex_tdls_check_txfunction mwifiex_flush_auto_tdls_listfunction mwifiex_add_auto_tdls_peerfunction mwifiex_auto_tdls_update_peer_statusfunction mwifiex_auto_tdls_update_peer_signalfunction mwifiex_check_auto_tdlsfunction mwifiex_setup_auto_tdls_timerfunction mwifiex_clean_auto_tdlsfunction mwifiex_config_tdlsfunction mwifiex_config_tdls_enablefunction mwifiex_config_tdls_disablefunction mwifiex_config_tdls_cs_paramsfunction mwifiex_stop_tdls_csfunction mwifiex_start_tdls_cs
Annotated Snippet
if (mwifiex_is_tdls_link_setup(status)) {
ra_list = mwifiex_wmm_get_queue_raptr(priv, tid, mac);
ra_list->tdls_link = true;
tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT;
} else {
tid_list = &priv->wmm.tid_tbl_ptr[tid_down].ra_list;
ra_list = list_first_entry_or_null(tid_list,
struct mwifiex_ra_list_tbl, list);
tx_info->flags &= ~MWIFIEX_BUF_FLAG_TDLS_PKT;
}
if (!ra_list) {
mwifiex_write_data_complete(priv->adapter, skb, 0, -1);
continue;
}
skb_queue_tail(&ra_list->skb_head, skb);
ra_list->ba_pkt_count++;
ra_list->total_pkt_count++;
if (atomic_read(&priv->wmm.highest_queued_prio) <
tos_to_tid_inv[tid_down])
atomic_set(&priv->wmm.highest_queued_prio,
tos_to_tid_inv[tid_down]);
atomic_inc(&priv->wmm.tx_pkts_queued);
}
spin_unlock_bh(&priv->wmm.ra_list_spinlock);
return;
}
static void mwifiex_hold_tdls_packets(struct mwifiex_private *priv,
const u8 *mac)
{
struct mwifiex_ra_list_tbl *ra_list;
struct list_head *ra_list_head;
struct sk_buff *skb, *tmp;
int i;
mwifiex_dbg(priv->adapter, DATA, "%s: %pM\n", __func__, mac);
spin_lock_bh(&priv->wmm.ra_list_spinlock);
for (i = 0; i < MAX_NUM_TID; i++) {
if (!list_empty(&priv->wmm.tid_tbl_ptr[i].ra_list)) {
ra_list_head = &priv->wmm.tid_tbl_ptr[i].ra_list;
list_for_each_entry(ra_list, ra_list_head, list) {
skb_queue_walk_safe(&ra_list->skb_head, skb,
tmp) {
if (!ether_addr_equal(mac, skb->data))
continue;
__skb_unlink(skb, &ra_list->skb_head);
atomic_dec(&priv->wmm.tx_pkts_queued);
ra_list->total_pkt_count--;
skb_queue_tail(&priv->tdls_txq, skb);
}
}
}
}
spin_unlock_bh(&priv->wmm.ra_list_spinlock);
return;
}
/* This function appends rate TLV to scan config command. */
static int
mwifiex_tdls_append_rates_ie(struct mwifiex_private *priv,
struct sk_buff *skb)
{
u8 rates[MWIFIEX_SUPPORTED_RATES], *pos;
u16 rates_size, supp_rates_size, ext_rates_size;
memset(rates, 0, sizeof(rates));
rates_size = mwifiex_get_supported_rates(priv, rates);
supp_rates_size = min_t(u16, rates_size, MWIFIEX_TDLS_SUPPORTED_RATES);
if (skb_tailroom(skb) < rates_size + 4) {
mwifiex_dbg(priv->adapter, ERROR,
"Insufficient space while adding rates\n");
return -ENOMEM;
}
pos = skb_put(skb, supp_rates_size + 2);
*pos++ = WLAN_EID_SUPP_RATES;
*pos++ = supp_rates_size;
memcpy(pos, rates, supp_rates_size);
if (rates_size > MWIFIEX_TDLS_SUPPORTED_RATES) {
Annotation
- Immediate include surface: `main.h`, `wmm.h`, `11n.h`, `11n_rxreorder.h`, `11ac.h`.
- Detected declarations: `function file`, `function skb_queue_walk_safe`, `function mwifiex_hold_tdls_packets`, `function list_for_each_entry`, `function mwifiex_tdls_append_rates_ie`, `function mwifiex_tdls_add_aid`, `function mwifiex_tdls_add_vht_capab`, `function mwifiex_tdls_add_ht_oper`, `function mwifiex_tdls_add_vht_oper`, `function mwifiex_tdls_add_ext_capab`.
- 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.