Merge pull request #2004 from enkiller/dev

[bsp][amebaz] Update WIFI driver
This commit is contained in:
Bernard Xiong 2018-11-24 16:08:18 +08:00 committed by GitHub
commit 0649494571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -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);