Commit eae44756 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

minstrel: make the rate control ops reusable from another rc implementation

This patch makes it possible to reuse the minstrel rate control ops
from another rate control module. This is useful in preparing for the
new 802.11n implementation of minstrel, which will reuse the old code
for legacy stations.
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 44ac91ea
...@@ -541,7 +541,7 @@ minstrel_free(void *priv) ...@@ -541,7 +541,7 @@ minstrel_free(void *priv)
kfree(priv); kfree(priv);
} }
static struct rate_control_ops mac80211_minstrel = { struct rate_control_ops mac80211_minstrel = {
.name = "minstrel", .name = "minstrel",
.tx_status = minstrel_tx_status, .tx_status = minstrel_tx_status,
.get_rate = minstrel_get_rate, .get_rate = minstrel_get_rate,
......
...@@ -85,7 +85,13 @@ struct minstrel_debugfs_info { ...@@ -85,7 +85,13 @@ struct minstrel_debugfs_info {
char buf[]; char buf[];
}; };
extern struct rate_control_ops mac80211_minstrel;
void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir); void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
void minstrel_remove_sta_debugfs(void *priv, void *priv_sta); void minstrel_remove_sta_debugfs(void *priv, void *priv_sta);
/* 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);
#endif #endif
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#include <net/mac80211.h> #include <net/mac80211.h>
#include "rc80211_minstrel.h" #include "rc80211_minstrel.h"
static int int
minstrel_stats_open(struct inode *inode, struct file *file) minstrel_stats_open(struct inode *inode, struct file *file)
{ {
struct minstrel_sta_info *mi = inode->i_private; struct minstrel_sta_info *mi = inode->i_private;
...@@ -100,7 +100,7 @@ minstrel_stats_open(struct inode *inode, struct file *file) ...@@ -100,7 +100,7 @@ minstrel_stats_open(struct inode *inode, struct file *file)
return 0; return 0;
} }
static ssize_t ssize_t
minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppos) minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppos)
{ {
struct minstrel_debugfs_info *ms; struct minstrel_debugfs_info *ms;
...@@ -109,7 +109,7 @@ minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppo ...@@ -109,7 +109,7 @@ minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppo
return simple_read_from_buffer(buf, len, ppos, ms->buf, ms->len); return simple_read_from_buffer(buf, len, ppos, ms->buf, ms->len);
} }
static int int
minstrel_stats_release(struct inode *inode, struct file *file) minstrel_stats_release(struct inode *inode, struct file *file)
{ {
kfree(file->private_data); kfree(file->private_data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment