diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 17c0257..bd4ee19 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -519,6 +519,8 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr) } else { psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list); + if (!psta) + goto exit; rtw_list_delete(&(psta->list)); /* _exit_critical_bh(&(pfree_sta_queue->lock), &irqL); */ diff --git a/include/autoconf.h b/include/autoconf.h index 20588ab..030a3c0 100644 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -33,7 +33,7 @@ #define PLATFORM_LINUX -/* #define CONFIG_IOCTL_CFG80211 1 */ +#define CONFIG_IOCTL_CFG80211 1 #ifdef CONFIG_IOCTL_CFG80211 /* #define RTW_USE_CFG80211_STA_EVENT */ /* Indecate new sta asoc through cfg80211_new_sta */ diff --git a/include/hal_data.h b/include/hal_data.h index 516f5df..fca1c2e 100644 --- a/include/hal_data.h +++ b/include/hal_data.h @@ -1024,18 +1024,29 @@ int rtw_halmac_deinit_adapter(struct dvobj_priv *); #define REG_APK rAPK #define REG_ANTSEL_SW_JAGUAR r_ANTSEL_SW_Jaguar - - #define rf_welut_jaguar RF_WeLut_Jaguar #define rf_mode_table_addr RF_ModeTableAddr #define rf_mode_table_data0 RF_ModeTableData0 #define rf_mode_table_data1 RF_ModeTableData1 - - - - - #define RX_SMOOTH_FACTOR Rx_Smooth_Factor +#if defined(CONFIG_RESUME_IN_WORKQUEUE) || defined(CONFIG_HAS_EARLYSUSPEND) +int rtw_resume_process(_adapter *padapter); +#endif +#ifdef CONFIG_ANDROID_POWER +#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) +int rtw_resume_process(PADAPTER padapter); +#endif +#endif +#ifdef CONFIG_AUTOSUSPEND +void autosuspend_enter(_adapter* padapter); +int autoresume_enter(_adapter* padapter); +#endif + +#ifdef SUPPORT_HW_RFOFF_DETECTED +int rtw_hw_suspend(_adapter *padapter ); +int rtw_hw_resume(_adapter *padapter); +#endif + #endif /* __HAL_DATA_H__ */ diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index c3c5d91..1a1c213 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -2525,9 +2525,13 @@ void rtw_cfg80211_unlink_bss(_adapter *padapter, struct wlan_network *pnetwork) struct wireless_dev *pwdev = padapter->rtw_wdev; struct wiphy *wiphy = pwdev->wiphy; struct cfg80211_bss *bss = NULL; - WLAN_BSSID_EX select_network = pnetwork->network; + WLAN_BSSID_EX select_network; - bss = cfg80211_get_bss(wiphy, NULL/*notify_channel*/, + if (!pnetwork) + return; + select_network = pnetwork->network; + + bss = cfg80211_get_bss(wiphy, NULL /*notify_channel*/, select_network.MacAddress, select_network.Ssid.Ssid, select_network.Ssid.SsidLength, #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0) @@ -2538,10 +2542,18 @@ void rtw_cfg80211_unlink_bss(_adapter *padapter, struct wlan_network *pnetwork) select_network.InfrastructureMode == Ndis802_11Infrastructure?WLAN_CAPABILITY_ESS:WLAN_CAPABILITY_IBSS); #endif + if (!wiphy) { + pr_info("rtl8723bu: rtw_cfg80211_unlink_bss: wiphy is NULL\n"); + return; + } + + if (bss) { cfg80211_unlink_bss(wiphy, bss); RTW_INFO("%s(): cfg80211_unlink %s!!\n", __func__, select_network.Ssid.Ssid); #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) + if (!padapter->rtw_wdev->wiphy) + return; cfg80211_put_bss(padapter->rtw_wdev->wiphy, bss); #else cfg80211_put_bss(bss); diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index cabb2e3..3e182a5 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1651,18 +1651,19 @@ void rtw_os_ndev_unregister(_adapter *adapter) netdev = adapter->pnetdev; #if defined(CONFIG_IOCTL_CFG80211) - rtw_cfg80211_ndev_res_unregister(adapter); + rtw_cfg80211_ndev_res_unregister(adapter); #endif - if ((adapter->DriverState != DRIVER_DISAPPEAR) && netdev) { - struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); - u8 rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj); + if ((adapter->DriverState != DRIVER_DISAPPEAR) && netdev) { + struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); + u8 rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj); + + if (rtnl_lock_needed) + unregister_netdev(netdev); + else + unregister_netdevice(netdev); + } - if (rtnl_lock_needed) - unregister_netdev(netdev); - else - unregister_netdevice(netdev); - } #if defined(CONFIG_IOCTL_CFG80211) && !defined(RTW_SINGLE_WIPHY) #ifdef CONFIG_RFKILL_POLL