#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
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;
}
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) {
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;
}
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;
/* 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;
}
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;
}
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;
}