mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-22 04:23:39 +00:00
rtl8188eu: Remove RTW_ENABLE_WIFI_CONTROL_FUNC - not defined
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
237fa4c813
commit
d1802e72f4
2 changed files with 0 additions and 227 deletions
|
@ -61,18 +61,7 @@ enum ANDROID_WIFI_CMD {
|
|||
int rtw_android_cmdstr_to_num(char *cmdstr);
|
||||
int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd);
|
||||
|
||||
#if defined(RTW_ENABLE_WIFI_CONTROL_FUNC)
|
||||
int rtw_android_wifictrl_func_add(void);
|
||||
void rtw_android_wifictrl_func_del(void);
|
||||
void* wl_android_prealloc(int section, unsigned long size);
|
||||
|
||||
int wifi_get_irq_number(unsigned long *irq_flags_ptr);
|
||||
int wifi_set_power(int on, unsigned long msec);
|
||||
int wifi_get_mac_addr(unsigned char *buf);
|
||||
void *wifi_get_country_code(char *ccode);
|
||||
#else
|
||||
static int rtw_android_wifictrl_func_add(void) { return 0; }
|
||||
static void rtw_android_wifictrl_func_del(void) {}
|
||||
#endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */
|
||||
|
||||
#endif //__RTW_ANDROID_H__
|
||||
|
|
|
@ -27,16 +27,6 @@
|
|||
#include <ioctl_cfg80211.h>
|
||||
#include <rtw_ioctl_set.h>
|
||||
|
||||
|
||||
#if defined(RTW_ENABLE_WIFI_CONTROL_FUNC)
|
||||
#include <linux/platform_device.h>
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
|
||||
#include <linux/wlan_plat.h>
|
||||
#else
|
||||
#include <linux/wifi_tiwlan.h>
|
||||
#endif
|
||||
#endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */
|
||||
|
||||
static const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = {
|
||||
"START",
|
||||
"STOP",
|
||||
|
@ -322,209 +312,3 @@ exit:
|
|||
kfree(command);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Functions for Android WiFi card detection
|
||||
*/
|
||||
#if defined(RTW_ENABLE_WIFI_CONTROL_FUNC)
|
||||
|
||||
static int g_wifidev_registered = 0;
|
||||
static struct semaphore wifi_control_sem;
|
||||
static struct wifi_platform_data *wifi_control_data = NULL;
|
||||
static struct resource *wifi_irqres = NULL;
|
||||
|
||||
static int wifi_add_dev(void);
|
||||
static void wifi_del_dev(void);
|
||||
|
||||
int rtw_android_wifictrl_func_add(void)
|
||||
{
|
||||
int ret = 0;
|
||||
sema_init(&wifi_control_sem, 0);
|
||||
|
||||
ret = wifi_add_dev();
|
||||
if (ret) {
|
||||
DBG_88E("%s: platform_driver_register failed\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
g_wifidev_registered = 1;
|
||||
|
||||
/* Waiting callback after platform_driver_register is done or exit with error */
|
||||
if (down_timeout(&wifi_control_sem, msecs_to_jiffies(1000)) != 0) {
|
||||
ret = -EINVAL;
|
||||
DBG_88E("%s: platform_driver_register timeout\n", __func__);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void rtw_android_wifictrl_func_del(void)
|
||||
{
|
||||
if (g_wifidev_registered)
|
||||
{
|
||||
wifi_del_dev();
|
||||
g_wifidev_registered = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void *wl_android_prealloc(int section, unsigned long size)
|
||||
{
|
||||
void *alloc_ptr = NULL;
|
||||
if (wifi_control_data && wifi_control_data->mem_prealloc) {
|
||||
alloc_ptr = wifi_control_data->mem_prealloc(section, size);
|
||||
if (alloc_ptr) {
|
||||
DBG_88E("success alloc section %d\n", section);
|
||||
if (size != 0L)
|
||||
memset(alloc_ptr, 0, size);
|
||||
return alloc_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
DBG_88E("can't alloc section %d\n", section);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int wifi_get_irq_number(unsigned long *irq_flags_ptr)
|
||||
{
|
||||
if (wifi_irqres) {
|
||||
*irq_flags_ptr = wifi_irqres->flags & IRQF_TRIGGER_MASK;
|
||||
return (int)wifi_irqres->start;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int wifi_set_power(int on, unsigned long msec)
|
||||
{
|
||||
DBG_88E("%s = %d\n", __func__, on);
|
||||
if (wifi_control_data && wifi_control_data->set_power) {
|
||||
wifi_control_data->set_power(on);
|
||||
}
|
||||
if (msec)
|
||||
msleep(msec);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
|
||||
int wifi_get_mac_addr(unsigned char *buf)
|
||||
{
|
||||
DBG_88E("%s\n", __func__);
|
||||
if (!buf)
|
||||
return -EINVAL;
|
||||
if (wifi_control_data && wifi_control_data->get_mac_addr) {
|
||||
return wifi_control_data->get_mac_addr(buf);
|
||||
}
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) */
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) || defined(COMPAT_KERNEL_RELEASE)
|
||||
void *wifi_get_country_code(char *ccode)
|
||||
{
|
||||
DBG_88E("%s\n", __func__);
|
||||
if (!ccode)
|
||||
return NULL;
|
||||
if (wifi_control_data && wifi_control_data->get_country_code) {
|
||||
return wifi_control_data->get_country_code(ccode);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) */
|
||||
|
||||
static int wifi_set_carddetect(int on)
|
||||
{
|
||||
DBG_88E("%s = %d\n", __func__, on);
|
||||
if (wifi_control_data && wifi_control_data->set_carddetect) {
|
||||
wifi_control_data->set_carddetect(on);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int wifi_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct wifi_platform_data *wifi_ctrl =
|
||||
(struct wifi_platform_data *)(pdev->dev.platform_data);
|
||||
|
||||
DBG_88E("## %s\n", __func__);
|
||||
wifi_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "bcmdhd_wlan_irq");
|
||||
if (wifi_irqres == NULL)
|
||||
wifi_irqres = platform_get_resource_byname(pdev,
|
||||
IORESOURCE_IRQ, "bcm4329_wlan_irq");
|
||||
wifi_control_data = wifi_ctrl;
|
||||
|
||||
wifi_set_power(1, 0); /* Power On */
|
||||
wifi_set_carddetect(1); /* CardDetect (0->1) */
|
||||
|
||||
up(&wifi_control_sem);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int wifi_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct wifi_platform_data *wifi_ctrl =
|
||||
(struct wifi_platform_data *)(pdev->dev.platform_data);
|
||||
|
||||
DBG_88E("## %s\n", __func__);
|
||||
wifi_control_data = wifi_ctrl;
|
||||
|
||||
wifi_set_power(0, 0); /* Power Off */
|
||||
wifi_set_carddetect(0); /* CardDetect (1->0) */
|
||||
|
||||
up(&wifi_control_sem);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int wifi_suspend(struct platform_device *pdev, pm_message_t state)
|
||||
{
|
||||
DBG_88E("##> %s\n", __func__);
|
||||
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY)
|
||||
bcmsdh_oob_intr_set(0);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int wifi_resume(struct platform_device *pdev)
|
||||
{
|
||||
DBG_88E("##> %s\n", __func__);
|
||||
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY)
|
||||
if (dhd_os_check_if_up(bcmsdh_get_drvdata()))
|
||||
bcmsdh_oob_intr_set(1);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* temporarily use these two */
|
||||
static struct platform_driver wifi_device = {
|
||||
.probe = wifi_probe,
|
||||
.remove = wifi_remove,
|
||||
.suspend = wifi_suspend,
|
||||
.resume = wifi_resume,
|
||||
.driver = {
|
||||
.name = "bcmdhd_wlan",
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_driver wifi_device_legacy = {
|
||||
.probe = wifi_probe,
|
||||
.remove = wifi_remove,
|
||||
.suspend = wifi_suspend,
|
||||
.resume = wifi_resume,
|
||||
.driver = {
|
||||
.name = "bcm4329_wlan",
|
||||
}
|
||||
};
|
||||
|
||||
static int wifi_add_dev(void)
|
||||
{
|
||||
DBG_88E("## Calling platform_driver_register\n");
|
||||
platform_driver_register(&wifi_device);
|
||||
platform_driver_register(&wifi_device_legacy);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void wifi_del_dev(void)
|
||||
{
|
||||
DBG_88E("## Unregister platform_driver_register\n");
|
||||
platform_driver_unregister(&wifi_device);
|
||||
platform_driver_unregister(&wifi_device_legacy);
|
||||
}
|
||||
#endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */
|
||||
|
|
Loading…
Reference in a new issue