Skip to content

Commit

Permalink
net: readd Allwinner bits to rtl8192cu
Browse files Browse the repository at this point in the history
Signed-off-by: Emilio López <turl@linux-sunxi.org>
  • Loading branch information
turl committed Jan 19, 2013
1 parent 54b54ee commit 155ec4b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
8 changes: 5 additions & 3 deletions drivers/net/wireless/rtl8192cu/Kconfig
@@ -1,6 +1,8 @@
config RTL8192CU
tristate "Realtek 8192C USB WiFi"
config RTL8192CU_SW
tristate "Realtek 8192C USB WiFi (Allwinner)"
depends on USB
select WIRELESS_EXT
select WEXT_PRIV
---help---
Help message of RTL8192CU
Help message of RTL8192CU_SW

4 changes: 2 additions & 2 deletions drivers/net/wireless/rtl8192cu/Makefile
Expand Up @@ -492,11 +492,11 @@ $(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += core/rtw_mp.o \
core/rtw_mp_ioctl.o \
core/rtw_ioctl_rtl.o

obj-$(CONFIG_RTL8192CU) := $(MODULE_NAME).o
obj-$(CONFIG_RTL8192CU_SW) := $(MODULE_NAME).o

else

export CONFIG_RTL8192CU = m
export CONFIG_RTL8192CU_SW = m

all: modules

Expand Down
27 changes: 27 additions & 0 deletions drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c
Expand Up @@ -1104,6 +1104,13 @@ int autoresume_enter(_adapter* padapter)
}
#endif

#if 1 /* Allwinnerization */
#include <mach/sys_config.h>
extern int sw_usb_disable_hcd(__u32 usbc_no);
extern int sw_usb_enable_hcd(__u32 usbc_no);
static int usb_wifi_host = 2;
#endif

extern char* ifname;
/*
* drv_init() - a device potentially for us
Expand Down Expand Up @@ -1457,6 +1464,7 @@ extern int console_suspend_enabled;

static int __init rtw_drv_entry(void)
{
int ret;
#ifdef CONFIG_PLATFORM_RTK_DMP
u32 tmp;
tmp=readl((volatile unsigned int*)0xb801a608);
Expand All @@ -1468,6 +1476,20 @@ static int __init rtw_drv_entry(void)

RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+rtw_drv_entry\n"));

#if 1 /* Allwinnerization */
/* ----------get usb_wifi_usbc_num------------- */
ret = script_parser_fetch("usb_wifi_para", "usb_wifi_usbc_num", (int *)&usb_wifi_host, 64);
if(ret != 0){
ERR_8192C("ERR: script_parser_fetch usb_wifi_usbc_num failed\n");
ret = -ENOMEM;
return ret;
}

MSG_8192C("sw_usb_enable_hcd: usbc_num = %d\n", usb_wifi_host);

sw_usb_enable_hcd(usb_wifi_host);
#endif

DBG_871X("rtw driver version=%s \n", DRIVERVERSION);
DBG_871X("Build at: %s %s\n", __DATE__, __TIME__);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
Expand All @@ -1490,6 +1512,11 @@ static void __exit rtw_drv_halt(void)
drvpriv.drv_registered = _FALSE;
usb_deregister(&drvpriv.rtw_usb_drv);
DBG_8192C("-rtw_drv_halt\n");

#if 1 /* Allwinnerization */
MSG_8192C("sw_usb_disable_hcd: usbc_num = %d\n", usb_wifi_host);
sw_usb_disable_hcd(usb_wifi_host);
#endif
}


Expand Down

0 comments on commit 155ec4b

Please sign in to comment.