net/mac80211/rc80211_minstrel_ht.c
Source file repositories/reference/linux-study-clean/net/mac80211/rc80211_minstrel_ht.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/rc80211_minstrel_ht.c- Extension
.c- Size
- 53690 bytes
- Lines
- 2032
- 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.
- 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/netdevice.hlinux/types.hlinux/skbuff.hlinux/debugfs.hlinux/random.hlinux/moduleparam.hlinux/ieee80211.hlinux/minmax.hnet/mac80211.hrate.hsta_info.hrc80211_minstrel_ht.h
Detected Declarations
function invalidfunction minstrel_ht_is_legacy_groupfunction minstrel_ht_get_group_idxfunction minstrel_ht_ri_get_group_idxfunction minstrel_vht_get_group_idxfunction minstrel_vht_ri_get_group_idxfunction minstrel_ht_get_statsfunction minstrel_ht_ri_get_statsfunction minstrel_get_ratestatsfunction minstrel_get_durationfunction minstrel_ht_avg_ampdu_lenfunction minstrel_ht_get_tp_avgfunction minstrel_ht_sort_best_tp_ratesfunction minstrel_ht_set_best_prob_ratefunction ratefunction minstrel_ht_prob_rate_reduce_streamsfunction __minstrel_ht_get_sample_ratefunction minstrel_ewmafunction minstrel_filter_avg_addfunction minstrel_ht_calc_rate_statsfunction minstrel_ht_find_sample_ratefunction minstrel_ht_move_sample_ratesfunction minstrel_ht_group_min_rate_offsetfunction minstrel_ht_next_inc_ratefunction minstrel_ht_next_group_sample_ratefunction minstrel_ht_next_jump_ratefunction minstrel_ht_refill_sample_ratesfunction minstrel_ht_update_statsfunction minstrel_ht_txstat_validfunction minstrel_ht_ri_txstat_validfunction minstrel_downgrade_ratefunction minstrel_ht_tx_statusfunction minstrel_calc_retransmitfunction minstrel_ht_set_ratefunction minstrel_ht_get_prob_avgfunction minstrel_ht_get_max_amsdu_lenfunction minstrel_ht_update_ratesfunction minstrel_ht_get_sample_ratefunction minstrel_ht_get_ratefunction minstrel_ht_update_cckfunction minstrel_ht_update_ofdmfunction minstrel_ht_update_capsfunction minstrel_ht_rate_initfunction minstrel_ht_rate_updatefunction minstrel_ht_alloc_stafunction minstrel_ht_free_stafunction minstrel_ht_fill_rate_arrayfunction minstrel_ht_init_cck_rates
Annotated Snippet
switch (type) {
case MINSTREL_SAMPLE_TYPE_SLOW:
valid = duration > fast_rate_dur &&
duration < slow_rate_dur;
break;
case MINSTREL_SAMPLE_TYPE_INC:
case MINSTREL_SAMPLE_TYPE_JUMP:
valid = duration < fast_rate_dur;
break;
default:
valid = false;
break;
}
if (!valid) {
rates[i] = 0;
continue;
}
if (i == j)
continue;
rates[j++] = cur;
rates[i] = 0;
}
return j;
}
static int
minstrel_ht_group_min_rate_offset(struct minstrel_ht_sta *mi, int group,
u32 max_duration)
{
u16 supported = mi->supported[group];
int i;
for (i = 0; i < MCS_GROUP_RATES && supported; i++, supported >>= 1) {
if (!(supported & BIT(0)))
continue;
if (minstrel_get_duration(MI_RATE(group, i)) >= max_duration)
continue;
return i;
}
return -1;
}
/*
* Incremental update rates:
* Flip through groups and pick the first group rate that is faster than the
* highest currently selected rate
*/
static u16
minstrel_ht_next_inc_rate(struct minstrel_ht_sta *mi, u32 fast_rate_dur)
{
u8 type = MINSTREL_SAMPLE_TYPE_INC;
int i, index = 0;
u8 group;
group = mi->sample[type].sample_group;
for (i = 0; i < ARRAY_SIZE(minstrel_mcs_groups); i++) {
group = (group + 1) % ARRAY_SIZE(minstrel_mcs_groups);
index = minstrel_ht_group_min_rate_offset(mi, group,
fast_rate_dur);
if (index < 0)
continue;
index = MI_RATE(group, index & 0xf);
if (!minstrel_ht_find_sample_rate(mi, type, index))
goto out;
}
index = 0;
out:
mi->sample[type].sample_group = group;
return index;
}
static int
minstrel_ht_next_group_sample_rate(struct minstrel_ht_sta *mi, int group,
u16 supported, int offset)
{
struct minstrel_mcs_group_data *mg = &mi->groups[group];
u16 idx;
int i;
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/types.h`, `linux/skbuff.h`, `linux/debugfs.h`, `linux/random.h`, `linux/moduleparam.h`, `linux/ieee80211.h`, `linux/minmax.h`.
- Detected declarations: `function invalid`, `function minstrel_ht_is_legacy_group`, `function minstrel_ht_get_group_idx`, `function minstrel_ht_ri_get_group_idx`, `function minstrel_vht_get_group_idx`, `function minstrel_vht_ri_get_group_idx`, `function minstrel_ht_get_stats`, `function minstrel_ht_ri_get_stats`, `function minstrel_get_ratestats`, `function minstrel_get_duration`.
- 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.