| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2002-2005, Instant802 Networks, Inc. |
|---|
| 3 | 4 | * Copyright 2005, Devicescape Software, Inc. |
|---|
| 4 | 5 | * Copyright (c) 2006 Jiri Benc <jbenc@suse.cz> |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | 6 | */ |
|---|
| 10 | 7 | |
|---|
| 11 | 8 | #ifndef IEEE80211_RATE_H |
|---|
| .. | .. |
|---|
| 63 | 60 | #endif |
|---|
| 64 | 61 | } |
|---|
| 65 | 62 | |
|---|
| 66 | | -static inline void rate_control_remove_sta_debugfs(struct sta_info *sta) |
|---|
| 63 | +extern const struct file_operations rcname_ops; |
|---|
| 64 | + |
|---|
| 65 | +static inline void rate_control_add_debugfs(struct ieee80211_local *local) |
|---|
| 67 | 66 | { |
|---|
| 68 | 67 | #ifdef CONFIG_MAC80211_DEBUGFS |
|---|
| 69 | | - struct rate_control_ref *ref = sta->rate_ctrl; |
|---|
| 70 | | - if (ref && ref->ops->remove_sta_debugfs) |
|---|
| 71 | | - ref->ops->remove_sta_debugfs(ref->priv, sta->rate_ctrl_priv); |
|---|
| 68 | + struct dentry *debugfsdir; |
|---|
| 69 | + |
|---|
| 70 | + if (!local->rate_ctrl) |
|---|
| 71 | + return; |
|---|
| 72 | + |
|---|
| 73 | + if (!local->rate_ctrl->ops->add_debugfs) |
|---|
| 74 | + return; |
|---|
| 75 | + |
|---|
| 76 | + debugfsdir = debugfs_create_dir("rc", local->hw.wiphy->debugfsdir); |
|---|
| 77 | + local->debugfs.rcdir = debugfsdir; |
|---|
| 78 | + debugfs_create_file("name", 0400, debugfsdir, |
|---|
| 79 | + local->rate_ctrl, &rcname_ops); |
|---|
| 80 | + |
|---|
| 81 | + local->rate_ctrl->ops->add_debugfs(&local->hw, local->rate_ctrl->priv, |
|---|
| 82 | + debugfsdir); |
|---|
| 72 | 83 | #endif |
|---|
| 73 | 84 | } |
|---|
| 74 | 85 | |
|---|
| .. | .. |
|---|
| 91 | 102 | return 0; |
|---|
| 92 | 103 | } |
|---|
| 93 | 104 | static inline void rc80211_minstrel_exit(void) |
|---|
| 94 | | -{ |
|---|
| 95 | | -} |
|---|
| 96 | | -#endif |
|---|
| 97 | | - |
|---|
| 98 | | -#ifdef CONFIG_MAC80211_RC_MINSTREL_HT |
|---|
| 99 | | -int rc80211_minstrel_ht_init(void); |
|---|
| 100 | | -void rc80211_minstrel_ht_exit(void); |
|---|
| 101 | | -#else |
|---|
| 102 | | -static inline int rc80211_minstrel_ht_init(void) |
|---|
| 103 | | -{ |
|---|
| 104 | | - return 0; |
|---|
| 105 | | -} |
|---|
| 106 | | -static inline void rc80211_minstrel_ht_exit(void) |
|---|
| 107 | 105 | { |
|---|
| 108 | 106 | } |
|---|
| 109 | 107 | #endif |
|---|