Path: blob/master/net/mac80211/rc80211_minstrel_ht.h
15109 views
/*1* Copyright (C) 2010 Felix Fietkau <[email protected]>2*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License version 2 as5* published by the Free Software Foundation.6*/78#ifndef __RC_MINSTREL_HT_H9#define __RC_MINSTREL_HT_H1011/*12* The number of streams can be changed to 2 to reduce code13* size and memory footprint.14*/15#define MINSTREL_MAX_STREAMS 316#define MINSTREL_STREAM_GROUPS 41718/* scaled fraction values */19#define MINSTREL_SCALE 1620#define MINSTREL_FRAC(val, div) (((val) << MINSTREL_SCALE) / div)21#define MINSTREL_TRUNC(val) ((val) >> MINSTREL_SCALE)2223#define MCS_GROUP_RATES 82425struct mcs_group {26u32 flags;27unsigned int streams;28unsigned int duration[MCS_GROUP_RATES];29};3031extern const struct mcs_group minstrel_mcs_groups[];3233struct minstrel_rate_stats {34/* current / last sampling period attempts/success counters */35unsigned int attempts, last_attempts;36unsigned int success, last_success;3738/* total attempts/success counters */39u64 att_hist, succ_hist;4041/* current throughput */42unsigned int cur_tp;4344/* packet delivery probabilities */45unsigned int cur_prob, probability;4647/* maximum retry counts */48unsigned int retry_count;49unsigned int retry_count_rtscts;5051bool retry_updated;52u8 sample_skipped;53};5455struct minstrel_mcs_group_data {56u8 index;57u8 column;5859/* bitfield of supported MCS rates of this group */60u8 supported;6162/* selected primary rates */63unsigned int max_tp_rate;64unsigned int max_tp_rate2;65unsigned int max_prob_rate;6667/* MCS rate statistics */68struct minstrel_rate_stats rates[MCS_GROUP_RATES];69};7071struct minstrel_ht_sta {72/* ampdu length (average, per sampling interval) */73unsigned int ampdu_len;74unsigned int ampdu_packets;7576/* ampdu length (EWMA) */77unsigned int avg_ampdu_len;7879/* best throughput rate */80unsigned int max_tp_rate;8182/* second best throughput rate */83unsigned int max_tp_rate2;8485/* best probability rate */86unsigned int max_prob_rate;8788/* time of last status update */89unsigned long stats_update;9091/* overhead time in usec for each frame */92unsigned int overhead;93unsigned int overhead_rtscts;9495unsigned int total_packets;96unsigned int sample_packets;9798/* tx flags to add for frames for this sta */99u32 tx_flags;100101u8 sample_wait;102u8 sample_tries;103u8 sample_count;104u8 sample_slow;105106/* current MCS group to be sampled */107u8 sample_group;108109/* MCS rate group info and statistics */110struct minstrel_mcs_group_data groups[MINSTREL_MAX_STREAMS * MINSTREL_STREAM_GROUPS];111};112113struct minstrel_ht_sta_priv {114union {115struct minstrel_ht_sta ht;116struct minstrel_sta_info legacy;117};118#ifdef CONFIG_MAC80211_DEBUGFS119struct dentry *dbg_stats;120#endif121void *ratelist;122void *sample_table;123bool is_ht;124};125126void minstrel_ht_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);127void minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta);128129#endif130131132