From b38fd3e5db680f54c518c8be7342208c7d9e1eb3 Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Thu, 23 Jun 2011 10:41:27 -0700 Subject: [PATCH] net: wireless: bcmdhd: Set proper debug messages for private IOCTL Signed-off-by: Dmitry Shmidt --- drivers/net/wireless/bcmdhd/wl_android.c | 28 ++++++++++++++++------------ drivers/net/wireless/bcmdhd/wldev_common.c | 3 ++- 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 0e5ebc1..6dfdd6b 100644 --- a/drivers/net/wireless/bcmdhd/wl_android.c +++ b/drivers/net/wireless/bcmdhd/wl_android.c @@ -26,8 +26,11 @@ #include #include -#include "wlioctl.h" -#include "wldev_common.h" +#include +#include +#include +#include + /* * 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 db2c456..82d305a 100644 --- a/drivers/net/wireless/bcmdhd/wldev_common.c +++ b/drivers/net/wireless/bcmdhd/wldev_common.c @@ -26,6 +26,7 @@ #include #include +#include #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; } -- 2.7.4