mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-20 04:21:14 +09:00
esp8089: fix ESP8089 wifi can not work when use CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOT
Change-Id: Ib08bcc45f3c11e2de0f29c9739772d56071d467f Signed-off-by: Xu Xuehui <xxh@rock-chips.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -92,33 +92,20 @@ static void /*__exit */ esp_exit(void)
|
||||
esp_common_exit();
|
||||
}
|
||||
|
||||
#include <linux/rfkill-wlan.h>
|
||||
extern int get_wifi_chip_type(void);
|
||||
|
||||
int rockchip_wifi_init_module_esp8089(void)
|
||||
{
|
||||
#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
|
||||
int type = get_wifi_chip_type();
|
||||
if (type != WIFI_ESP8089) return 0;
|
||||
#endif
|
||||
|
||||
return esp_init();
|
||||
}
|
||||
|
||||
void rockchip_wifi_exit_module_esp8089(void)
|
||||
{
|
||||
#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
|
||||
int type = get_wifi_chip_type();
|
||||
if (type != WIFI_ESP8089) return;
|
||||
#endif
|
||||
esp_exit();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
|
||||
late_initcall(rockchip_wifi_init_module_esp8089);
|
||||
module_exit(rockchip_wifi_exit_module_esp8089);
|
||||
#else
|
||||
EXPORT_SYMBOL(rockchip_wifi_init_module_esp8089);
|
||||
EXPORT_SYMBOL(rockchip_wifi_exit_module_esp8089);
|
||||
#endif
|
||||
|
||||
//module_init(esp_init);
|
||||
//module_exit(esp_exit);
|
||||
|
||||
@@ -149,7 +149,11 @@ void esp_put_sip_skb(struct sk_buff **skb)
|
||||
for (i = 0; i < SIP_SKB_ARR_NUM; i++) {
|
||||
if (gl_sip_skb_arr[i].skb_p == *skb) {
|
||||
gl_sip_skb_arr[i].skb_p->data = gl_sip_skb_arr[i].skb_p->head;
|
||||
//gl_sip_skb_arr[i].skb_p->tail = gl_sip_skb_arr[i].skb_p->head;
|
||||
#if BITS_PER_LONG > 32
|
||||
gl_sip_skb_arr[i].skb_p->tail = 0;
|
||||
#else
|
||||
gl_sip_skb_arr[i].skb_p->tail = gl_sip_skb_arr[i].skb_p->head;
|
||||
#endif
|
||||
gl_sip_skb_arr[i].skb_p->data_len = 0;
|
||||
gl_sip_skb_arr[i].skb_p->len = 0;
|
||||
skb_trim(gl_sip_skb_arr[i].skb_p, 0);
|
||||
|
||||
@@ -152,13 +152,21 @@ static int wifi_driver_insmod = 0;
|
||||
|
||||
static int wifi_init_exit_module(int enable)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
int ret = 0;
|
||||
int type = 0;
|
||||
#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
|
||||
type = get_wifi_chip_type();
|
||||
if (type == WIFI_ESP8089) {
|
||||
if (enable > 0)
|
||||
ret = rockchip_wifi_init_module_esp8089();
|
||||
else
|
||||
rockchip_wifi_exit_module_esp8089();
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
int type = get_wifi_chip_type();
|
||||
type = get_wifi_chip_type();
|
||||
//#ifdef CONFIG_RKWIFI
|
||||
if (type < WIFI_AP6XXX_SERIES) {
|
||||
if (type < WIFI_AP6XXX_SERIES) {
|
||||
if (enable > 0)
|
||||
ret = rockchip_wifi_init_module_rkwifi();
|
||||
else
|
||||
@@ -168,7 +176,7 @@ static int wifi_init_exit_module(int enable)
|
||||
//#endif
|
||||
//#ifdef CONFIG_RTL_WIRELESS_SOLUTION
|
||||
if (type < WIFI_RTL_SERIES) {
|
||||
if (enable > 0)
|
||||
if (enable > 0)
|
||||
ret = rockchip_wifi_init_module_rtkwifi();
|
||||
else
|
||||
rockchip_wifi_exit_module_rtkwifi();
|
||||
@@ -177,7 +185,7 @@ static int wifi_init_exit_module(int enable)
|
||||
//#endif
|
||||
//#ifdef CONFIG_ESP8089
|
||||
if (type == WIFI_ESP8089) {
|
||||
if (enable > 0)
|
||||
if (enable > 0)
|
||||
ret = rockchip_wifi_init_module_esp8089();
|
||||
else
|
||||
rockchip_wifi_exit_module_esp8089();
|
||||
|
||||
Reference in New Issue
Block a user