#include <dhd_bus.h>
#include <dhd_proto.h>
#include <dhd_config.h>
+#ifdef WL_ESCAN
+#include <wl_escan.h>
+#endif
#include <dhd_dbg.h>
#ifdef CONFIG_HAS_WAKELOCK
#include <linux/wakelock.h>
goto done;
}
ioc.cmd = compat_ioc.cmd;
- ioc.buf = compat_ptr(compat_ioc.buf);
- ioc.len = compat_ioc.len;
- ioc.set = compat_ioc.set;
- ioc.used = compat_ioc.used;
- ioc.needed = compat_ioc.needed;
- /* To differentiate between wl and dhd read 4 more byes */
- if ((copy_from_user(&ioc.driver, (char *)ifr->ifr_data + sizeof(compat_wl_ioctl_t),
- sizeof(uint)) != 0)) {
- ret = BCME_BADADDR;
- goto done;
- }
+ if (ioc.cmd & WLC_SPEC_FLAG) {
+ memset(&ioc, 0, sizeof(ioc));
+ /* Copy the ioc control structure part of ioctl request */
+ if (copy_from_user(&ioc, ifr->ifr_data, sizeof(wl_ioctl_t))) {
+ ret = BCME_BADADDR;
+ goto done;
+ }
+ ioc.cmd &= ~WLC_SPEC_FLAG; /* Clear the FLAG */
+
+ /* To differentiate between wl and dhd read 4 more byes */
+ if ((copy_from_user(&ioc.driver, (char *)ifr->ifr_data + sizeof(wl_ioctl_t),
+ sizeof(uint)) != 0)) {
+ ret = BCME_BADADDR;
+ goto done;
+ }
+
+ } else { /* ioc.cmd & WLC_SPEC_FLAG */
+ ioc.buf = compat_ptr(compat_ioc.buf);
+ ioc.len = compat_ioc.len;
+ ioc.set = compat_ioc.set;
+ ioc.used = compat_ioc.used;
+ ioc.needed = compat_ioc.needed;
+ /* To differentiate between wl and dhd read 4 more byes */
+ if ((copy_from_user(&ioc.driver, (char *)ifr->ifr_data + sizeof(compat_wl_ioctl_t),
+ sizeof(uint)) != 0)) {
+ ret = BCME_BADADDR;
+ goto done;
+ }
+ } /* ioc.cmd & WLC_SPEC_FLAG */
} else
#endif /* CONFIG_COMPAT */
{
ret = BCME_BADADDR;
goto done;
}
-
+#ifdef CONFIG_COMPAT
+ ioc.cmd &= ~WLC_SPEC_FLAG; /* make sure it was clear when it isn't a compat task*/
+#endif
/* To differentiate between wl and dhd read 4 more byes */
if ((copy_from_user(&ioc.driver, (char *)ifr->ifr_data + sizeof(wl_ioctl_t),
sizeof(uint)) != 0)) {
}
dhd_state |= DHD_ATTACH_STATE_WL_ATTACH;
}
+#ifdef WL_ESCAN
+ wl_escan_attach(net, (void *)&dhd->pub);
+#endif
#endif /* defined(WL_WIRELESS_EXT) */
#ifdef SHOW_LOGTRACE
#ifdef WLTDLS
setbit(eventmask, WLC_E_TDLS_PEER_EVENT);
#endif /* WLTDLS */
+#ifdef WL_ESCAN
+ setbit(eventmask, WLC_E_ESCAN_RESULT);
+#endif
#ifdef WL_CFG80211
setbit(eventmask, WLC_E_ESCAN_RESULT);
setbit(eventmask, WLC_E_AP_STARTED);
/* Detatch and unlink in the iw */
wl_iw_detach();
}
+#ifdef WL_ESCAN
+ wl_escan_detach();
+#endif
#endif /* defined(WL_WIRELESS_EXT) */
/* delete all interfaces, start with virtual */
printf("%s: Exit\n", __FUNCTION__);
}
-static void __exit
+static void
dhd_module_exit(void)
{
dhd_buzzz_detach();
unregister_reboot_notifier(&dhd_reboot_notifier);
}
-static int __init
+static int
dhd_module_init(void)
{
int err;
- int retry = POWERUP_MAX_RETRY;
+ int retry = 0;
printf("%s: in\n", __FUNCTION__);
return NOTIFY_DONE;
}
+static int wifi_init_thread(void *data)
+{
+ dhd_module_init();
+
+ return 0;
+}
+int rockchip_wifi_init_module_rkwifi(void)
+{
+ struct task_struct *kthread = NULL;
+
+ kthread = kthread_run(wifi_init_thread, NULL, "wifi_init_thread");
+ if (IS_ERR(kthread))
+ pr_err("create wifi_init_thread failed.\n");
+
+ return 0;
+}
+
+void rockchip_wifi_exit_module_rkwifi(void)
+{
+ dhd_module_exit();
+}
+
+#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
+late_initcall(rockchip_wifi_init_module_rkwifi);
+module_exit(rockchip_wifi_exit_module_rkwifi);
+#else
+module_init(rockchip_wifi_init_module_rkwifi);
+module_exit(rockchip_wifi_exit_module_rkwifi);
+#endif
+#if 0
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
#if defined(CONFIG_DEFERRED_INITCALLS)
#if defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_SOC_EXYNOS8890) || \
module_exit(dhd_module_exit);
+#endif
/*
* OS specific functions required to implement DHD driver in OS independent way
*/
net = dhd_idx2net(dhdp, ifidx);
if (!net) {
DHD_ERROR(("%s : Invalid index : %d\n", __FUNCTION__, ifidx));
- return -EINVAL;
+ return FALSE;
}
return dhd_check_hang(net, dhdp, ret);