diff options
| author | tangyuxin <[email protected]> | 2018-11-24 09:47:26 +0800 |
|---|---|---|
| committer | tangyuxin <[email protected]> | 2018-11-24 09:47:26 +0800 |
| commit | e2e2c0a1e09bd5be25537dd5fdb33949bdf36ecc (patch) | |
| tree | cfe656632c0f9c1675a8739557fd906fea1246a6 | |
| parent | 2ca5995160285c70aa7c15555dc44c259d90a556 (diff) | |
[bsp][amebaz] Update WIFI driver
| -rw-r--r-- | bsp/amebaz/drivers/wlan/drv_wifi.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bsp/amebaz/drivers/wlan/drv_wifi.c b/bsp/amebaz/drivers/wlan/drv_wifi.c index 67a870b034..7e62ed1acf 100644 --- a/bsp/amebaz/drivers/wlan/drv_wifi.c +++ b/bsp/amebaz/drivers/wlan/drv_wifi.c @@ -91,10 +91,16 @@ int rthw_wifi_register(struct ameba_wifi *wifi) if ((wifi->flag & WIFI_INIT_FLAG) == 0) { + wlan = rt_malloc(sizeof(struct rt_wlan_device)); + RT_ASSERT(wlan != RT_NULL); if (wifi->type == WIFI_TYPE_STA) - wlan = rt_wlan_dev_register(RT_WLAN_DEVICE_STA_NAME, &ops, 0, wifi); + { + rt_wlan_dev_register(wlan, RT_WLAN_DEVICE_STA_NAME, &ops, 0, wifi); + } if (wifi->type == WIFI_TYPE_AP) - wlan = rt_wlan_dev_register(RT_WLAN_DEVICE_AP_NAME, &ops, 0, wifi); + { + rt_wlan_dev_register(wlan, RT_WLAN_DEVICE_AP_NAME, &ops, 0, wifi); + } wifi->flag |= WIFI_INIT_FLAG; wifi->wlan = wlan; LOG_D("F:%s L:%d wifi:0x%08x wlan:0x%08x\n", __FUNCTION__, __LINE__, wifi, wlan); |
