net/mac80211/wme.c
Source file repositories/reference/linux-study-clean/net/mac80211/wme.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/wme.c- Extension
.c- Size
- 5927 bytes
- Lines
- 247
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/netdevice.hlinux/skbuff.hlinux/module.hlinux/if_arp.hlinux/types.hnet/ip.hnet/pkt_sched.hnet/mac80211.hieee80211_i.hwme.h
Detected Declarations
function wme_downgrade_acfunction ieee80211_fix_reserved_tidfunction ieee80211_downgrade_queuefunction ieee80211_select_queue_80211function ieee80211_select_queuefunction ieee80211_set_qos_hdr
Annotated Snippet
if (wme_downgrade_ac(skb)) {
/*
* This should not really happen. The AP has marked all
* lower ACs to require admission control which is not
* a reasonable configuration. Allow the frame to be
* transmitted using AC_BK as a workaround.
*/
break;
}
}
/* Check to see if this is a reserved TID */
if (sta && sta->reserved_tid == skb->priority)
skb->priority = ieee80211_fix_reserved_tid(skb->priority);
/* look up which queue to use for frames with this 1d tag */
return ieee802_1d_to_ac[skb->priority];
}
/* Indicate which queue to use for this fully formed 802.11 frame */
u16 ieee80211_select_queue_80211(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb,
struct ieee80211_hdr *hdr)
{
struct ieee80211_local *local = sdata->local;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
u8 *p;
/* Ensure hash is set prior to potential SW encryption */
skb_get_hash(skb);
if ((info->control.flags & IEEE80211_TX_CTRL_DONT_REORDER) ||
local->hw.queues < IEEE80211_NUM_ACS)
return 0;
if (!ieee80211_is_data(hdr->frame_control)) {
skb->priority = 7;
return ieee802_1d_to_ac[skb->priority];
}
if (!ieee80211_is_data_qos(hdr->frame_control)) {
skb->priority = 0;
return ieee802_1d_to_ac[skb->priority];
}
p = ieee80211_get_qos_ctl(hdr);
skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK;
return ieee80211_downgrade_queue(sdata, NULL, skb);
}
u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
struct sta_info *sta, struct sk_buff *skb)
{
const struct ethhdr *eth = (void *)skb->data;
struct mac80211_qos_map *qos_map;
bool qos;
/* Ensure hash is set prior to potential SW encryption */
skb_get_hash(skb);
/* all mesh/ocb stations are required to support WME */
if ((sdata->vif.type == NL80211_IFTYPE_MESH_POINT &&
!is_multicast_ether_addr(eth->h_dest)) ||
(sdata->vif.type == NL80211_IFTYPE_OCB && sta))
qos = true;
else if (sta)
qos = sta->sta.wme;
else
qos = false;
if (!qos) {
skb->priority = 0; /* required for correct WPA/11i MIC */
return IEEE80211_AC_BE;
}
if (skb->protocol == sdata->control_port_protocol) {
skb->priority = 7;
goto downgrade;
}
/* use the data classifier to determine what 802.1d tag the
* data frame has */
qos_map = rcu_dereference(sdata->qos_map);
skb->priority = cfg80211_classify8021d(skb, qos_map ?
&qos_map->qos_map : NULL);
downgrade:
return ieee80211_downgrade_queue(sdata, sta, skb);
}
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/skbuff.h`, `linux/module.h`, `linux/if_arp.h`, `linux/types.h`, `net/ip.h`, `net/pkt_sched.h`, `net/mac80211.h`.
- Detected declarations: `function wme_downgrade_ac`, `function ieee80211_fix_reserved_tid`, `function ieee80211_downgrade_queue`, `function ieee80211_select_queue_80211`, `function ieee80211_select_queue`, `function ieee80211_set_qos_hdr`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.