Blame view
net/mac80211/rate.h
2.88 KB
d2912cb15
|
1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
f0706e828
|
2 3 4 5 |
/* * Copyright 2002-2005, Instant802 Networks, Inc. * Copyright 2005, Devicescape Software, Inc. * Copyright (c) 2006 Jiri Benc <jbenc@suse.cz> |
f0706e828
|
6 7 8 9 10 11 12 13 14 15 16 |
*/ #ifndef IEEE80211_RATE_H #define IEEE80211_RATE_H #include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/types.h> #include <net/mac80211.h> #include "ieee80211_i.h" #include "sta_info.h" |
8f727ef3c
|
17 |
#include "driver-ops.h" |
f0706e828
|
18 |
|
f0706e828
|
19 |
struct rate_control_ref { |
631ad703b
|
20 |
const struct rate_control_ops *ops; |
f0706e828
|
21 |
void *priv; |
f0706e828
|
22 |
}; |
4b7679a56
|
23 |
void rate_control_get_rate(struct ieee80211_sub_if_data *sdata, |
e6a9854b0
|
24 25 |
struct sta_info *sta, struct ieee80211_tx_rate_control *txrc); |
f0706e828
|
26 |
|
18fb84d98
|
27 28 29 |
void rate_control_tx_status(struct ieee80211_local *local, struct ieee80211_supported_band *sband, struct ieee80211_tx_status *st); |
f0706e828
|
30 |
|
eb6d9293d
|
31 32 |
void rate_control_rate_init(struct sta_info *sta); void rate_control_rate_update(struct ieee80211_local *local, |
81cb7623a
|
33 |
struct ieee80211_supported_band *sband, |
eb6d9293d
|
34 |
struct sta_info *sta, u32 changed); |
f0706e828
|
35 |
|
f0706e828
|
36 |
static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, |
35c347ac5
|
37 |
struct sta_info *sta, gfp_t gfp) |
f0706e828
|
38 |
{ |
35c347ac5
|
39 40 |
spin_lock_init(&sta->rate_ctrl_lock); return ref->ops->alloc_sta(ref->priv, &sta->sta, gfp); |
f0706e828
|
41 |
} |
4b7679a56
|
42 |
static inline void rate_control_free_sta(struct sta_info *sta) |
f0706e828
|
43 |
{ |
4b7679a56
|
44 45 46 47 48 |
struct rate_control_ref *ref = sta->rate_ctrl; struct ieee80211_sta *ista = &sta->sta; void *priv_sta = sta->rate_ctrl_priv; ref->ops->free_sta(ref->priv, ista, priv_sta); |
f0706e828
|
49 |
} |
e9f207f0f
|
50 51 52 53 |
static inline void rate_control_add_sta_debugfs(struct sta_info *sta) { #ifdef CONFIG_MAC80211_DEBUGFS struct rate_control_ref *ref = sta->rate_ctrl; |
fc4a25c5b
|
54 |
if (ref && sta->debugfs_dir && ref->ops->add_sta_debugfs) |
e9f207f0f
|
55 |
ref->ops->add_sta_debugfs(ref->priv, sta->rate_ctrl_priv, |
fc4a25c5b
|
56 |
sta->debugfs_dir); |
e9f207f0f
|
57 58 |
#endif } |
6cb5f3ea4
|
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
extern const struct file_operations rcname_ops; static inline void rate_control_add_debugfs(struct ieee80211_local *local) { #ifdef CONFIG_MAC80211_DEBUGFS struct dentry *debugfsdir; if (!local->rate_ctrl) return; if (!local->rate_ctrl->ops->add_debugfs) return; debugfsdir = debugfs_create_dir("rc", local->hw.wiphy->debugfsdir); local->debugfs.rcdir = debugfsdir; debugfs_create_file("name", 0400, debugfsdir, local->rate_ctrl, &rcname_ops); local->rate_ctrl->ops->add_debugfs(&local->hw, local->rate_ctrl->priv, debugfsdir); #endif } |
e8e4f5280
|
81 |
void ieee80211_check_rate_mask(struct ieee80211_sub_if_data *sdata); |
209c671db
|
82 83 |
/* Get a reference to the rate control algorithm. If `name' is NULL, get the * first available algorithm. */ |
ff6880892
|
84 85 86 |
int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local, const char *name); void rate_control_deinitialize(struct ieee80211_local *local); |
4b475898e
|
87 88 |
/* Rate control algorithms */ |
cccf129f8
|
89 |
#ifdef CONFIG_MAC80211_RC_MINSTREL |
c1b1203d6
|
90 91 |
int rc80211_minstrel_init(void); void rc80211_minstrel_exit(void); |
cccf129f8
|
92 93 94 95 96 97 98 99 100 |
#else static inline int rc80211_minstrel_init(void) { return 0; } static inline void rc80211_minstrel_exit(void) { } #endif |
f0706e828
|
101 |
#endif /* IEEE80211_RATE_H */ |