summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authornohee ko2010-10-17 19:51:24 +0200
committerGreg Kroah-Hartman2010-10-19 19:54:52 +0200
commitcd389a34a182639e8b6bf0e812fe8ec038bfddc5 (patch)
treeeb27042b61c37e63ee0be7b32b1b7d838b59e71b /drivers
parentstaging: brcm80211: brcmfmac: add profile, beacon_int, dtim_period (diff)
downloadkernel-qcow2-linux-cd389a34a182639e8b6bf0e812fe8ec038bfddc5.tar.gz
kernel-qcow2-linux-cd389a34a182639e8b6bf0e812fe8ec038bfddc5.tar.xz
kernel-qcow2-linux-cd389a34a182639e8b6bf0e812fe8ec038bfddc5.zip
staging: brcm80211: brcmfmac: add debugfs, display wi-fi statistics
Add debugfs to display wi-fi profile/statistics. Initially some profile parameters such as dtim_period, beacon_int will be seen at /sys/kernel/debug/ieee80211/phy#/netdev:eth#. This will provide users with current connection status. Signed-off-by: Nohee Ko <noheek@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c43
-rw-r--r--drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h1
2 files changed, 44 insertions, 0 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 5bda8569cfc6..621521b9e408 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -333,6 +333,12 @@ static __used s32 wl_update_pmklist(struct net_device *dev,
static void wl_set_mpc(struct net_device *ndev, int mpc);
+/*
+* debufs support
+*/
+static int wl_debugfs_add_netdev_params(struct wl_priv *wl);
+static void wl_debugfs_remove_netdev(struct wl_priv *wl);
+
#define WL_PRIV_GET() \
({ \
struct wl_iface *ci; \
@@ -3814,6 +3820,8 @@ static s32 __wl_cfg80211_up(struct wl_priv *wl)
{
s32 err = 0;
+ wl_debugfs_add_netdev_params(wl);
+
err = wl_config_dongle(wl, false);
if (unlikely(err))
return err;
@@ -3851,6 +3859,8 @@ static s32 __wl_cfg80211_down(struct wl_priv *wl)
clear_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
clear_bit(WL_STATUS_CONNECTED, &wl->status);
+ wl_debugfs_remove_netdev(wl);
+
return err;
}
@@ -4186,3 +4196,36 @@ static void wl_set_mpc(struct net_device *ndev, int mpc)
}
WL_DBG(("MPC : %d\n", mpc));
}
+
+static int wl_debugfs_add_netdev_params(struct wl_priv *wl)
+{
+ char buf[10+IFNAMSIZ];
+ struct dentry *fd;
+ s32 err = 0;
+
+ sprintf(buf, "netdev:%s", wl_to_ndev(wl)->name);
+ wl->debugfsdir = debugfs_create_dir(buf, wl_to_wiphy(wl)->debugfsdir);
+
+ fd = debugfs_create_u16("beacon_int", S_IRUGO, wl->debugfsdir,
+ (u16 *)&wl->profile->beacon_interval);
+ if (!fd) {
+ err = -ENOMEM;
+ goto err_out;
+ }
+
+ fd = debugfs_create_u8("dtim_period", S_IRUGO, wl->debugfsdir,
+ (u8 *)&wl->profile->dtim_period);
+ if (!fd) {
+ err = -ENOMEM;
+ goto err_out;
+ }
+
+err_out:
+ return err;
+}
+
+static void wl_debugfs_remove_netdev(struct wl_priv *wl)
+{
+ debugfs_remove_recursive(wl->debugfsdir);
+ wl->debugfsdir = NULL;
+}
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 72d12400ba72..f90ecaea09ac 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -341,6 +341,7 @@ struct wl_priv {
bool scan_tried; /* indicates if first scan attempted */
u8 *ioctl_buf; /* ioctl buffer */
u8 *extra_buf; /* maily to grab assoc information */
+ struct dentry *debugfsdir;
u8 ci[0] __attribute__ ((__aligned__(NETDEV_ALIGN)));
};