diff options
Diffstat (limited to 'net/mac80211/rate.h')
-rw-r--r-- | net/mac80211/rate.h | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/net/mac80211/rate.h b/net/mac80211/rate.h index 5b45f33cb766..ede7ab56f65b 100644 --- a/net/mac80211/rate.h +++ b/net/mac80211/rate.h | |||
@@ -19,22 +19,22 @@ | |||
19 | #include "ieee80211_i.h" | 19 | #include "ieee80211_i.h" |
20 | #include "sta_info.h" | 20 | #include "sta_info.h" |
21 | 21 | ||
22 | /* TODO: kdoc */ | 22 | /** |
23 | * struct rate_selection - rate selection for rate control algos | ||
24 | * @rate: selected transmission rate index | ||
25 | * @nonerp: Non-ERP rate to use instead if ERP cannot be used | ||
26 | * @probe: rate for probing (or -1) | ||
27 | * | ||
28 | */ | ||
23 | struct rate_selection { | 29 | struct rate_selection { |
24 | /* Selected transmission rate */ | 30 | s8 rate_idx, nonerp_idx, probe_idx; |
25 | struct ieee80211_rate *rate; | ||
26 | /* Non-ERP rate to use if mac80211 decides it cannot use an ERP rate */ | ||
27 | struct ieee80211_rate *nonerp; | ||
28 | /* probe with this rate, or NULL for no probing */ | ||
29 | struct ieee80211_rate *probe; | ||
30 | }; | 31 | }; |
31 | 32 | ||
32 | struct rate_control_ops { | 33 | struct rate_control_ops { |
33 | struct module *module; | 34 | struct module *module; |
34 | const char *name; | 35 | const char *name; |
35 | void (*tx_status)(void *priv, struct net_device *dev, | 36 | void (*tx_status)(void *priv, struct net_device *dev, |
36 | struct sk_buff *skb, | 37 | struct sk_buff *skb); |
37 | struct ieee80211_tx_status *status); | ||
38 | void (*get_rate)(void *priv, struct net_device *dev, | 38 | void (*get_rate)(void *priv, struct net_device *dev, |
39 | struct ieee80211_supported_band *band, | 39 | struct ieee80211_supported_band *band, |
40 | struct sk_buff *skb, | 40 | struct sk_buff *skb, |
@@ -76,13 +76,12 @@ struct rate_control_ref *rate_control_get(struct rate_control_ref *ref); | |||
76 | void rate_control_put(struct rate_control_ref *ref); | 76 | void rate_control_put(struct rate_control_ref *ref); |
77 | 77 | ||
78 | static inline void rate_control_tx_status(struct net_device *dev, | 78 | static inline void rate_control_tx_status(struct net_device *dev, |
79 | struct sk_buff *skb, | 79 | struct sk_buff *skb) |
80 | struct ieee80211_tx_status *status) | ||
81 | { | 80 | { |
82 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 81 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
83 | struct rate_control_ref *ref = local->rate_ctrl; | 82 | struct rate_control_ref *ref = local->rate_ctrl; |
84 | 83 | ||
85 | ref->ops->tx_status(ref->priv, dev, skb, status); | 84 | ref->ops->tx_status(ref->priv, dev, skb); |
86 | } | 85 | } |
87 | 86 | ||
88 | 87 | ||
@@ -138,7 +137,7 @@ static inline int rate_supported(struct sta_info *sta, | |||
138 | return (sta == NULL || sta->supp_rates[band] & BIT(index)); | 137 | return (sta == NULL || sta->supp_rates[band] & BIT(index)); |
139 | } | 138 | } |
140 | 139 | ||
141 | static inline int | 140 | static inline s8 |
142 | rate_lowest_index(struct ieee80211_local *local, | 141 | rate_lowest_index(struct ieee80211_local *local, |
143 | struct ieee80211_supported_band *sband, | 142 | struct ieee80211_supported_band *sband, |
144 | struct sta_info *sta) | 143 | struct sta_info *sta) |
@@ -155,14 +154,6 @@ rate_lowest_index(struct ieee80211_local *local, | |||
155 | return 0; | 154 | return 0; |
156 | } | 155 | } |
157 | 156 | ||
158 | static inline struct ieee80211_rate * | ||
159 | rate_lowest(struct ieee80211_local *local, | ||
160 | struct ieee80211_supported_band *sband, | ||
161 | struct sta_info *sta) | ||
162 | { | ||
163 | return &sband->bitrates[rate_lowest_index(local, sband, sta)]; | ||
164 | } | ||
165 | |||
166 | 157 | ||
167 | /* functions for rate control related to a device */ | 158 | /* functions for rate control related to a device */ |
168 | int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local, | 159 | int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local, |
@@ -171,9 +162,7 @@ void rate_control_deinitialize(struct ieee80211_local *local); | |||
171 | 162 | ||
172 | 163 | ||
173 | /* Rate control algorithms */ | 164 | /* Rate control algorithms */ |
174 | #if defined(RC80211_PID_COMPILE) || \ | 165 | #ifdef CONFIG_MAC80211_RC_PID |
175 | (defined(CONFIG_MAC80211_RC_PID) && \ | ||
176 | !defined(CONFIG_MAC80211_RC_PID_MODULE)) | ||
177 | extern int rc80211_pid_init(void); | 166 | extern int rc80211_pid_init(void); |
178 | extern void rc80211_pid_exit(void); | 167 | extern void rc80211_pid_exit(void); |
179 | #else | 168 | #else |