From 990bd9151927ad55c7e3da3b05cf13ecfe7a31bf Mon Sep 17 00:00:00 2001 From: Vasanthakumar Thiagarajan Date: Tue, 25 Oct 2011 19:34:20 +0530 Subject: ath6kl: Maintain virtual interface in a list This patch removes all references to ar->vif and takes vif from a list. Signed-off-by: Vasanthakumar Thiagarajan Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath6kl/debug.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'drivers/net/wireless/ath/ath6kl/debug.c') diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c index 54faa6b39e9..e515c83e379 100644 --- a/drivers/net/wireless/ath/ath6kl/debug.c +++ b/drivers/net/wireless/ath/ath6kl/debug.c @@ -397,15 +397,20 @@ static ssize_t read_file_tgt_stats(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { struct ath6kl *ar = file->private_data; - /* TODO: Findout vif */ - struct ath6kl_vif *vif = ar->vif; - struct target_stats *tgt_stats = &vif->target_stats; + struct ath6kl_vif *vif; + struct target_stats *tgt_stats; char *buf; unsigned int len = 0, buf_len = 1500; int i; long left; ssize_t ret_cnt; + vif = ath6kl_vif_first(ar); + if (!vif) + return -EIO; + + tgt_stats = &vif->target_stats; + buf = kzalloc(buf_len, GFP_KERNEL); if (!buf) return -ENOMEM; @@ -1249,8 +1254,7 @@ static ssize_t ath6kl_create_qos_write(struct file *file, { struct ath6kl *ar = file->private_data; - /* TODO: Findout vif */ - struct ath6kl_vif *vif = ar->vif; + struct ath6kl_vif *vif; char buf[100]; ssize_t len; char *sptr, *token; @@ -1258,6 +1262,10 @@ static ssize_t ath6kl_create_qos_write(struct file *file, u32 val32; u16 val16; + vif = ath6kl_vif_first(ar); + if (!vif) + return -EIO; + len = min(count, sizeof(buf) - 1); if (copy_from_user(buf, user_buf, len)) return -EFAULT; @@ -1423,14 +1431,17 @@ static ssize_t ath6kl_delete_qos_write(struct file *file, { struct ath6kl *ar = file->private_data; - /* TODO: Findout vif */ - struct ath6kl_vif *vif = ar->vif; + struct ath6kl_vif *vif; char buf[100]; ssize_t len; char *sptr, *token; u8 traffic_class; u8 tsid; + vif = ath6kl_vif_first(ar); + if (!vif) + return -EIO; + len = min(count, sizeof(buf) - 1); if (copy_from_user(buf, user_buf, len)) return -EFAULT; -- cgit v1.2.3