summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2011-06-23 10:41:27 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:38:43 -0800
commit03abae699127a5c6c5a99e9db5ee782d91032d66 (patch)
treec4acc24d13df67ba66ea33415810a96a2b1e2a6a /drivers
parent9695b4aacf171865d78262861d39f8bb83be2150 (diff)
net: wireless: bcmdhd: Set proper debug messages for private IOCTL
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/bcmdhd/wl_android.c28
-rw-r--r--drivers/net/wireless/bcmdhd/wldev_common.c3
2 files changed, 18 insertions, 13 deletions
diff --git a/drivers/net/wireless/bcmdhd/wl_android.c b/drivers/net/wireless/bcmdhd/wl_android.c
index 0e5ebc16d917..6dfdd6bdc59e 100644
--- a/drivers/net/wireless/bcmdhd/wl_android.c
+++ b/drivers/net/wireless/bcmdhd/wl_android.c
@@ -26,8 +26,11 @@
#include <linux/module.h>
#include <linux/netdevice.h>
-#include "wlioctl.h"
-#include "wldev_common.h"
+#include <wlioctl.h>
+#include <wldev_common.h>
+#include <bcmutils.h>
+#include <dhd_dbg.h>
+
/*
* Android private command strings, PLEASE define new private commands here
@@ -79,7 +82,7 @@ int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
command = kmalloc(priv_cmd->total_len, GFP_KERNEL);
if (!command)
{
- printk("%s: failed to allocate memory\n", __FUNCTION__);
+ DHD_ERROR(("%s: failed to allocate memory\n", __FUNCTION__));
ret = -ENOMEM;
goto exit;
}
@@ -88,11 +91,11 @@ int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
goto exit;
}
- printk("%s: Android private command \"%s\" on %s\n", __FUNCTION__, command, ifr->ifr_name);
+ DHD_TRACE(("%s: Android private command \"%s\" on %s\n", __FUNCTION__, command, ifr->ifr_name));
if (strnicmp(command, CMD_START, strlen(CMD_START)) == 0) {
/* TBD: START */
- printk("%s, Received regular START command\n", __FUNCTION__);
+ DHD_INFO(("%s, Received regular START command\n", __FUNCTION__));
g_wifi_on = 1;
}
if (!g_wifi_on) {
@@ -136,7 +139,7 @@ int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
bytes_written = wl_android_set_suspendopt(net, command, priv_cmd->total_len);
}
else {
- printk("Unknown PRIVATE command %s - ignored\n", command);
+ DHD_ERROR(("Unknown PRIVATE command %s - ignored\n", command));
snprintf(command, 3, "OK");
bytes_written = strlen("OK") + 1;
}
@@ -144,7 +147,8 @@ int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
if (bytes_written > 0) {
priv_cmd->used_len = bytes_written;
if (copy_to_user(priv_cmd->buf, command, bytes_written)) {
- printk("%s: failed to copy data to user buffer\n", __FUNCTION__);
+ DHD_ERROR(("%s: failed to copy data to user buffer\n", __FUNCTION__));
+ ret = -EFAULT;
}
} else {
ret = bytes_written;
@@ -172,7 +176,7 @@ static int wl_android_get_link_speed(struct net_device *net, char *command, int
/* Convert Kbps to Android Mbps */
link_speed = link_speed / 1000;
bytes_written = snprintf(command, total_len, "LinkSpeed %d", link_speed);
- printk("%s: command result is %s \n", __FUNCTION__, command);
+ DHD_INFO(("%s: command result is %s\n", __FUNCTION__, command));
return bytes_written;
}
@@ -193,7 +197,7 @@ static int wl_android_get_rssi(struct net_device *net, char *command, int total_
memcpy(command, ssid.SSID, ssid.SSID_len);
bytes_written = ssid.SSID_len;
bytes_written += snprintf(&command[bytes_written], total_len, " rssi %d", rssi);
- printk("%s: command result is %s \n", __FUNCTION__, command);
+ DHD_INFO(("%s: command result is %s \n", __FUNCTION__, command));
return bytes_written;
}
@@ -211,10 +215,10 @@ static int wl_android_set_suspendopt(struct net_device *dev, char *command, int
if (ret_now != suspend_flag) {
if (!(ret = net_os_set_suspend(dev, ret_now)))
- printk("%s: Suspend Flag %d -> %d\n",
- __FUNCTION__, ret_now, suspend_flag);
+ DHD_INFO(("%s: Suspend Flag %d -> %d\n",
+ __FUNCTION__, ret_now, suspend_flag));
else
- printk("%s: failed %d\n", __FUNCTION__, ret);
+ DHD_ERROR(("%s: failed %d\n", __FUNCTION__, ret));
}
return ret;
}
diff --git a/drivers/net/wireless/bcmdhd/wldev_common.c b/drivers/net/wireless/bcmdhd/wldev_common.c
index db2c456965d9..82d305a660bb 100644
--- a/drivers/net/wireless/bcmdhd/wldev_common.c
+++ b/drivers/net/wireless/bcmdhd/wldev_common.c
@@ -26,6 +26,7 @@
#include <wlioctl.h>
#include <bcmutils.h>
+#include <dhd_dbg.h>
#define htod32(i) i
#define htod16(i) i
@@ -156,7 +157,7 @@ s32 wldev_mkiovar_bsscfg(
if (buflen < 0 || iolen > (u32)buflen)
{
- printk("wldev_mkiovar_bsscfg buffer is too short\n");
+ DHD_ERROR(("%s: buffer is too short\n", __FUNCTION__));
return BCME_BUFTOOSHORT;
}