2 * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #ifndef __RC_MINSTREL_H
10 #define __RC_MINSTREL_H
12 struct minstrel_rate {
16 unsigned int perfect_tx_time;
17 unsigned int ack_time;
20 unsigned int retry_count;
21 unsigned int retry_count_cts;
22 unsigned int retry_count_rtscts;
23 unsigned int adjusted_retry_count;
30 /* parts per thousand */
34 /* per-rate throughput */
41 struct minstrel_sta_info {
42 unsigned long stats_update;
43 unsigned int sp_ack_dur;
44 unsigned int rate_avg;
46 unsigned int lowest_rix;
48 unsigned int max_tp_rate;
49 unsigned int max_tp_rate2;
50 unsigned int max_prob_rate;
51 unsigned int packet_count;
52 unsigned int sample_count;
55 unsigned int sample_idx;
56 unsigned int sample_column;
59 struct minstrel_rate *r;
65 #ifdef CONFIG_MAC80211_DEBUGFS
66 struct dentry *dbg_stats;
70 struct minstrel_priv {
71 struct ieee80211_hw *hw;
75 unsigned int max_retry;
76 unsigned int ewma_level;
77 unsigned int segment_size;
78 unsigned int update_interval;
79 unsigned int lookaround_rate;
80 unsigned int lookaround_rate_mrr;
82 #ifdef CONFIG_MAC80211_DEBUGFS
84 * enable fixed rate processing per RC
85 * - write static index to debugfs:ieee80211/phyX/rc/fixed_rate_idx
86 * - write -1 to enable RC processing again
87 * - setting will be applied on next update
90 struct dentry *dbg_fixed_rate;
95 struct minstrel_debugfs_info {
100 extern struct rate_control_ops mac80211_minstrel;
101 void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
102 void minstrel_remove_sta_debugfs(void *priv, void *priv_sta);
105 int minstrel_stats_open(struct inode *inode, struct file *file);
106 ssize_t minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppos);
107 int minstrel_stats_release(struct inode *inode, struct file *file);