~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/mac80211/rate.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php