Fixed crash when debug flag is set

This commit is contained in:
kimocoder 2019-11-13 17:24:08 +01:00
parent b9f88289b2
commit 02e8c82c9b
2 changed files with 10 additions and 28 deletions

View File

@ -1169,7 +1169,7 @@ PHY_SetTxPowerLevel8814(
{MGN_VHT3SS_MCS4, MGN_VHT3SS_MCS5, MGN_VHT3SS_MCS6, MGN_VHT3SS_MCS7}, {MGN_VHT3SS_MCS4, MGN_VHT3SS_MCS5, MGN_VHT3SS_MCS6, MGN_VHT3SS_MCS7},
{MGN_VHT3SS_MCS8, MGN_VHT3SS_MCS9, 0, 0}}; {MGN_VHT3SS_MCS8, MGN_VHT3SS_MCS9, 0, 0}};
for( path = RF_PATH_A; path <= RF_PATH_D; ++path ) for( path = RF_PATH_A; path <= RF_PATH_D; ++path )
{ {
phy_set_tx_power_level_by_path(Adapter, Channel, (u8)path); phy_set_tx_power_level_by_path(Adapter, Channel, (u8)path);
@ -1183,7 +1183,7 @@ PHY_SetTxPowerLevel8814(
} }
/************************************************************************************************************** /**************************************************************************************************************
* Description: * Description:
* The low-level interface to get the FINAL Tx Power Index , called by both MP and Normal Driver. * The low-level interface to get the FINAL Tx Power Index , called by both MP and Normal Driver.
* *
* <20120830, Kordan> * <20120830, Kordan>
@ -1192,8 +1192,8 @@ u8
PHY_GetTxPowerIndex8814A( PHY_GetTxPowerIndex8814A(
IN PADAPTER pAdapter, IN PADAPTER pAdapter,
IN enum rf_path RFPath, IN enum rf_path RFPath,
IN u8 Rate, IN u8 Rate,
IN u8 BandWidth, IN u8 BandWidth,
IN u8 Channel, IN u8 Channel,
struct txpwr_idx_comp *tic struct txpwr_idx_comp *tic
) )

View File

@ -1419,6 +1419,7 @@ static u8 is_rtw_ndev(struct net_device *ndev)
static int rtw_ndev_notifier_call(struct notifier_block *nb, unsigned long state, void *ptr) static int rtw_ndev_notifier_call(struct notifier_block *nb, unsigned long state, void *ptr)
{ {
struct net_device *ndev; struct net_device *ndev;
_adapter *adapter;
if (ptr == NULL) if (ptr == NULL)
return NOTIFY_DONE; return NOTIFY_DONE;
@ -1432,6 +1433,8 @@ static int rtw_ndev_notifier_call(struct notifier_block *nb, unsigned long state
if (ndev == NULL) if (ndev == NULL)
return NOTIFY_DONE; return NOTIFY_DONE;
adapter = rtw_netdev_priv(ndev);
if (!is_rtw_ndev(ndev)) if (!is_rtw_ndev(ndev))
return NOTIFY_DONE; return NOTIFY_DONE;
@ -1959,7 +1962,6 @@ u32 rtw_start_drv_threads(_adapter *padapter)
} }
} }
#ifdef CONFIG_EVENT_THREAD_MODE #ifdef CONFIG_EVENT_THREAD_MODE
if (padapter->evtThread == NULL) { if (padapter->evtThread == NULL) {
RTW_INFO(FUNC_ADPT_FMT " start RTW_EVENT_THREAD\n", FUNC_ADPT_ARG(padapter)); RTW_INFO(FUNC_ADPT_FMT " start RTW_EVENT_THREAD\n", FUNC_ADPT_ARG(padapter));
@ -2060,7 +2062,6 @@ u8 rtw_init_default_value(_adapter *padapter)
rtw_init_registrypriv_dev_network(padapter); rtw_init_registrypriv_dev_network(padapter);
rtw_update_registrypriv_dev_network(padapter); rtw_update_registrypriv_dev_network(padapter);
/* hal_priv */ /* hal_priv */
rtw_hal_def_value_init(padapter); rtw_hal_def_value_init(padapter);
@ -2509,8 +2510,6 @@ u8 rtw_init_drv_sw(_adapter *padapter)
exit: exit:
return ret8; return ret8;
} }
@ -2870,7 +2869,6 @@ _adapter *rtw_drv_add_vir_if(_adapter *primary_padapter,
padapter->hw_port = HW_PORT1; padapter->hw_port = HW_PORT1;
#endif #endif
/****** hook vir if into dvobj ******/ /****** hook vir if into dvobj ******/
pdvobjpriv = adapter_to_dvobj(padapter); pdvobjpriv = adapter_to_dvobj(padapter);
padapter->iface_id = pdvobjpriv->iface_nums; padapter->iface_id = pdvobjpriv->iface_nums;
@ -2888,7 +2886,6 @@ _adapter *rtw_drv_add_vir_if(_adapter *primary_padapter,
if (rtw_init_drv_sw(padapter) != _SUCCESS) if (rtw_init_drv_sw(padapter) != _SUCCESS)
goto free_drv_sw; goto free_drv_sw;
/*get mac address from primary_padapter*/ /*get mac address from primary_padapter*/
_rtw_memcpy(mac, adapter_mac_addr(primary_padapter), ETH_ALEN); _rtw_memcpy(mac, adapter_mac_addr(primary_padapter), ETH_ALEN);
@ -2983,7 +2980,6 @@ void rtw_drv_free_vir_if(_adapter *padapter)
rtw_vmfree((u8 *)padapter, sizeof(_adapter)); rtw_vmfree((u8 *)padapter, sizeof(_adapter));
} }
void rtw_drv_stop_vir_ifaces(struct dvobj_priv *dvobj) void rtw_drv_stop_vir_ifaces(struct dvobj_priv *dvobj)
{ {
int i; int i;
@ -3000,7 +2996,6 @@ void rtw_drv_free_vir_ifaces(struct dvobj_priv *dvobj)
rtw_drv_free_vir_if(dvobj->padapters[i]); rtw_drv_free_vir_if(dvobj->padapters[i]);
} }
#endif /*end of CONFIG_CONCURRENT_MODE*/ #endif /*end of CONFIG_CONCURRENT_MODE*/
/* IPv4, IPv6 IP addr notifier */ /* IPv4, IPv6 IP addr notifier */
@ -3338,7 +3333,7 @@ int _netdev_open(struct net_device *pnetdev)
{ {
#ifdef CONFIG_BT_COEXIST_SOCKET_TRX #ifdef CONFIG_BT_COEXIST_SOCKET_TRX
_adapter *prim_adpt = GET_PRIMARY_ADAPTER(padapter); _adapter *prim_adpt = GET_PRIMARY_ADAPTER(padapter);
if (prim_adpt && (_TRUE == prim_adpt->EEPROMBluetoothCoexist)) { if (prim_adpt && (_TRUE == prim_adpt->EEPROMBluetoothCoexist)) {
rtw_btcoex_init_socket(prim_adpt); rtw_btcoex_init_socket(prim_adpt);
prim_adpt->coex_info.BtMgnt.ExtConfig.HCIExtensionVer = 0x04; prim_adpt->coex_info.BtMgnt.ExtConfig.HCIExtensionVer = 0x04;
@ -3378,14 +3373,12 @@ int _netdev_open(struct net_device *pnetdev)
netdev_br_init(pnetdev); netdev_br_init(pnetdev);
#endif /* CONFIG_BR_EXT */ #endif /* CONFIG_BR_EXT */
padapter->bup = _TRUE; padapter->bup = _TRUE;
padapter->net_closed = _FALSE; padapter->net_closed = _FALSE;
padapter->netif_up = _TRUE; padapter->netif_up = _TRUE;
pwrctrlpriv->bips_processing = _FALSE; pwrctrlpriv->bips_processing = _FALSE;
} }
netdev_open_normal_process: netdev_open_normal_process:
RTW_INFO(FUNC_NDEV_FMT" Success (bup=%d)\n", FUNC_NDEV_ARG(pnetdev), padapter->bup); RTW_INFO(FUNC_NDEV_FMT" Success (bup=%d)\n", FUNC_NDEV_ARG(pnetdev), padapter->bup);
return 0; return 0;
@ -3589,7 +3582,6 @@ int netdev_open(struct net_device *pnetdev)
#endif #endif
_exit_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL); _exit_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL);
#ifdef CONFIG_AUTO_AP_MODE #ifdef CONFIG_AUTO_AP_MODE
if (padapter->iface_id == IFACE_ID2) if (padapter->iface_id == IFACE_ID2)
rtw_start_auto_ap(padapter); rtw_start_auto_ap(padapter);
@ -3608,7 +3600,6 @@ int ips_netdrv_open(_adapter *padapter)
RTW_INFO("===> %s.........\n", __FUNCTION__); RTW_INFO("===> %s.........\n", __FUNCTION__);
rtw_clr_drv_stopped(padapter); rtw_clr_drv_stopped(padapter);
/* padapter->bup = _TRUE; */ /* padapter->bup = _TRUE; */
#ifdef CONFIG_NEW_NETDEV_HDL #ifdef CONFIG_NEW_NETDEV_HDL
@ -3695,7 +3686,6 @@ void rtw_ips_dev_unload(_adapter *padapter)
#endif /* defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS) */ #endif /* defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS) */
RTW_INFO("====> %s...\n", __FUNCTION__); RTW_INFO("====> %s...\n", __FUNCTION__);
#if defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS) #if defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS)
#ifdef DBG_CONFIG_ERROR_DETECT #ifdef DBG_CONFIG_ERROR_DETECT
if (psrtpriv->silent_reset_inprogress == _TRUE) if (psrtpriv->silent_reset_inprogress == _TRUE)
@ -3726,7 +3716,7 @@ int _pm_netdev_open(_adapter *padapter)
} }
#endif /*CONFIG_AUTOSUSPEND*/ #endif /*CONFIG_AUTOSUSPEND*/
if (!rtw_is_hw_init_completed(padapter)) { // ips if (!rtw_is_hw_init_completed(padapter)) { // ips
rtw_clr_surprise_removed(padapter); rtw_clr_surprise_removed(padapter);
rtw_clr_drv_stopped(padapter); rtw_clr_drv_stopped(padapter);
status = rtw_hal_init(padapter); status = rtw_hal_init(padapter);
@ -3763,7 +3753,6 @@ int _pm_netdev_open(_adapter *padapter)
pwrctrlpriv->bips_processing = _FALSE; pwrctrlpriv->bips_processing = _FALSE;
} }
netdev_open_normal_process: netdev_open_normal_process:
RTW_INFO(FUNC_NDEV_FMT" Success (bup=%d)\n", FUNC_NDEV_ARG(pnetdev), padapter->bup); RTW_INFO(FUNC_NDEV_FMT" Success (bup=%d)\n", FUNC_NDEV_ARG(pnetdev), padapter->bup);
return 0; return 0;
@ -4396,7 +4385,6 @@ int rtw_suspend_wow(_adapter *padapter)
RTW_INFO("==> "FUNC_ADPT_FMT" entry....\n", FUNC_ADPT_ARG(padapter)); RTW_INFO("==> "FUNC_ADPT_FMT" entry....\n", FUNC_ADPT_ARG(padapter));
RTW_INFO("wowlan_mode: %d\n", pwrpriv->wowlan_mode); RTW_INFO("wowlan_mode: %d\n", pwrpriv->wowlan_mode);
RTW_INFO("wowlan_pno_enable: %d\n", pwrpriv->wowlan_pno_enable); RTW_INFO("wowlan_pno_enable: %d\n", pwrpriv->wowlan_pno_enable);
#ifdef CONFIG_P2P_WOWLAN #ifdef CONFIG_P2P_WOWLAN
@ -4614,7 +4602,6 @@ int rtw_suspend_ap_wow(_adapter *padapter)
} }
#endif /* #ifdef CONFIG_AP_WOWLAN */ #endif /* #ifdef CONFIG_AP_WOWLAN */
int rtw_suspend_normal(_adapter *padapter) int rtw_suspend_normal(_adapter *padapter)
{ {
int ret = _SUCCESS; int ret = _SUCCESS;
@ -4634,7 +4621,6 @@ int rtw_suspend_normal(_adapter *padapter)
|| (adapter_to_pwrctl(padapter)->rf_pwrstate == rf_off)) || (adapter_to_pwrctl(padapter)->rf_pwrstate == rf_off))
RTW_PRINT("%s: ### ERROR #### driver in IPS ####ERROR###!!!\n", __FUNCTION__); RTW_PRINT("%s: ### ERROR #### driver in IPS ####ERROR###!!!\n", __FUNCTION__);
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
rtw_set_drv_stopped(padapter); /*for stop thread*/ rtw_set_drv_stopped(padapter); /*for stop thread*/
rtw_stop_cmd_thread(padapter); rtw_stop_cmd_thread(padapter);
@ -4727,7 +4713,6 @@ int rtw_suspend_common(_adapter *padapter)
#endif /*CONFIG_AP_WOWLAN*/ #endif /*CONFIG_AP_WOWLAN*/
} }
RTW_PRINT("rtw suspend success in %d ms\n", RTW_PRINT("rtw suspend success in %d ms\n",
rtw_get_passing_time_ms(start_time)); rtw_get_passing_time_ms(start_time));
@ -4814,14 +4799,13 @@ int rtw_resume_process_wow(_adapter *padapter)
if (psta) if (psta)
set_sta_rate(padapter, psta); set_sta_rate(padapter, psta);
rtw_clr_drv_stopped(padapter); rtw_clr_drv_stopped(padapter);
RTW_INFO("%s: wowmode resuming, DriverStopped:%s\n", __func__, rtw_is_drv_stopped(padapter) ? "True" : "False"); RTW_INFO("%s: wowmode resuming, DriverStopped:%s\n", __func__, rtw_is_drv_stopped(padapter) ? "True" : "False");
rtw_mi_start_drv_threads(padapter); rtw_mi_start_drv_threads(padapter);
rtw_mi_intf_start(padapter); rtw_mi_intf_start(padapter);
if(registry_par->suspend_type == FW_IPS_DISABLE_BBRF && !check_fwstate(pmlmepriv, _FW_LINKED)) { if(registry_par->suspend_type == FW_IPS_DISABLE_BBRF && !check_fwstate(pmlmepriv, _FW_LINKED)) {
if (!rtw_is_surprise_removed(padapter)) { if (!rtw_is_surprise_removed(padapter)) {
rtw_hal_deinit(padapter); rtw_hal_deinit(padapter);
@ -4925,7 +4909,6 @@ int rtw_resume_process_ap_wow(_adapter *padapter)
goto exit; goto exit;
} }
#ifdef CONFIG_LPS #ifdef CONFIG_LPS
if (!(pwrpriv->wowlan_dis_lps)) { if (!(pwrpriv->wowlan_dis_lps)) {
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "AP-WOWLAN"); rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "AP-WOWLAN");
@ -5163,7 +5146,6 @@ int rtw_resume_common(_adapter *padapter)
RTW_PRINT("%s:%d in %d ms\n", __FUNCTION__ , ret, RTW_PRINT("%s:%d in %d ms\n", __FUNCTION__ , ret,
rtw_get_passing_time_ms(start_time)); rtw_get_passing_time_ms(start_time));
return ret; return ret;
} }