Blame view

net/mac80211/rc80211_minstrel.h 2.32 KB
cccf129f8   Felix Fietkau   mac80211: add the...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  /*
   * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
  
  #ifndef __RC_MINSTREL_H
  #define __RC_MINSTREL_H
  
  struct minstrel_rate {
  	int bitrate;
  	int rix;
  
  	unsigned int perfect_tx_time;
  	unsigned int ack_time;
f4a8cd94f   Felix Fietkau   minstrel: improve...
18
  	int sample_limit;
cccf129f8   Felix Fietkau   mac80211: add the...
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  	unsigned int retry_count;
  	unsigned int retry_count_cts;
  	unsigned int retry_count_rtscts;
  	unsigned int adjusted_retry_count;
  
  	u32 success;
  	u32 attempts;
  	u32 last_attempts;
  	u32 last_success;
  
  	/* parts per thousand */
  	u32 cur_prob;
  	u32 probability;
  
  	/* per-rate throughput */
  	u32 cur_tp;
cccf129f8   Felix Fietkau   mac80211: add the...
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
  
  	u64 succ_hist;
  	u64 att_hist;
  };
  
  struct minstrel_sta_info {
  	unsigned long stats_update;
  	unsigned int sp_ack_dur;
  	unsigned int rate_avg;
  
  	unsigned int lowest_rix;
  
  	unsigned int max_tp_rate;
  	unsigned int max_tp_rate2;
  	unsigned int max_prob_rate;
  	unsigned int packet_count;
  	unsigned int sample_count;
  	int sample_deferred;
  
  	unsigned int sample_idx;
  	unsigned int sample_column;
  
  	int n_rates;
  	struct minstrel_rate *r;
f4a8cd94f   Felix Fietkau   minstrel: improve...
59
  	bool prev_sample;
cccf129f8   Felix Fietkau   mac80211: add the...
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
  
  	/* sampling table */
  	u8 *sample_table;
  
  #ifdef CONFIG_MAC80211_DEBUGFS
  	struct dentry *dbg_stats;
  #endif
  };
  
  struct minstrel_priv {
  	struct ieee80211_hw *hw;
  	bool has_mrr;
  	unsigned int cw_min;
  	unsigned int cw_max;
  	unsigned int max_retry;
  	unsigned int ewma_level;
  	unsigned int segment_size;
  	unsigned int update_interval;
  	unsigned int lookaround_rate;
  	unsigned int lookaround_rate_mrr;
24f7580e8   Zefir Kurtisi   minstrel_ht: fixe...
80
81
82
83
84
85
86
87
88
89
90
  
  #ifdef CONFIG_MAC80211_DEBUGFS
  	/*
  	 * enable fixed rate processing per RC
  	 *   - write static index to debugfs:ieee80211/phyX/rc/fixed_rate_idx
  	 *   - write -1 to enable RC processing again
  	 *   - setting will be applied on next update
  	 */
  	u32 fixed_rate_idx;
  	struct dentry *dbg_fixed_rate;
  #endif
cccf129f8   Felix Fietkau   mac80211: add the...
91
  };
44ac91ea8   Felix Fietkau   minstrel: simplif...
92
93
94
95
  struct minstrel_debugfs_info {
  	size_t len;
  	char buf[];
  };
eae44756d   Felix Fietkau   minstrel: make th...
96
  extern struct rate_control_ops mac80211_minstrel;
cccf129f8   Felix Fietkau   mac80211: add the...
97
98
  void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
  void minstrel_remove_sta_debugfs(void *priv, void *priv_sta);
eae44756d   Felix Fietkau   minstrel: make th...
99
100
101
102
  /* debugfs */
  int minstrel_stats_open(struct inode *inode, struct file *file);
  ssize_t minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppos);
  int minstrel_stats_release(struct inode *inode, struct file *file);
cccf129f8   Felix Fietkau   mac80211: add the...
103
  #endif