rtl8188eu: Update for driver to build on kernel 4.19

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2018-10-18 20:33:29 -05:00
parent f62909c0c1
commit 9d1d96c95d
23 changed files with 435 additions and 687 deletions

View file

@ -4028,7 +4028,7 @@ exit:
/*#define DBG_SWTIMER_BASED_TXBCN*/ /*#define DBG_SWTIMER_BASED_TXBCN*/
#ifdef CONFIG_SWTIMER_BASED_TXBCN #ifdef CONFIG_SWTIMER_BASED_TXBCN
void tx_beacon_handlder(struct dvobj_priv *pdvobj) void tx_beacon_handler(struct dvobj_priv *pdvobj)
{ {
#define BEACON_EARLY_TIME 20 /* unit:TU*/ #define BEACON_EARLY_TIME 20 /* unit:TU*/
_irqL irqL; _irqL irqL;
@ -4159,7 +4159,7 @@ void tx_beacon_handlder(struct dvobj_priv *pdvobj)
} }
void tx_beacon_timer_handlder(struct dvobj_priv *pdvobj) void tx_beacon_timer_handler(struct dvobj_priv *pdvobj)
{ {
_adapter *padapter = pdvobj->padapters[0]; _adapter *padapter = pdvobj->padapters[0];

View file

@ -3494,10 +3494,17 @@ exit:
return res; return res;
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void rtw_dfs_master_timer_hdl(RTW_TIMER_HDL_ARGS) void rtw_dfs_master_timer_hdl(RTW_TIMER_HDL_ARGS)
#else
void rtw_dfs_master_timer_hdl(strust timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *)FunctionContext; _adapter *adapter = (_adapter *)FunctionContext;
#else
_adapter *adapter = from_timer(adapter, t, dfs_master_timer);
#endif
rtw_dfs_master_cmd(adapter, _TRUE); rtw_dfs_master_cmd(adapter, _TRUE);
} }

View file

@ -888,18 +888,18 @@ void rtw_mi_buddy_adapter_reset(_adapter *padapter)
_rtw_mi_adapter_reset(padapter, _TRUE); _rtw_mi_adapter_reset(padapter, _TRUE);
} }
static u8 _rtw_mi_dynamic_check_timer_handlder(_adapter *adapter, void *data) static u8 _rtw_mi_dynamic_check_timer_handler(_adapter *adapter, void *data)
{ {
rtw_iface_dynamic_check_timer_handlder(adapter); rtw_iface_dynamic_check_timer_handler(adapter);
return _TRUE; return _TRUE;
} }
u8 rtw_mi_dynamic_check_timer_handlder(_adapter *padapter) u8 rtw_mi_dynamic_check_timer_handler(_adapter *padapter)
{ {
return _rtw_mi_process(padapter, _FALSE, NULL, _rtw_mi_dynamic_check_timer_handlder); return _rtw_mi_process(padapter, _FALSE, NULL, _rtw_mi_dynamic_check_timer_handler);
} }
u8 rtw_mi_buddy_dynamic_check_timer_handlder(_adapter *padapter) u8 rtw_mi_buddy_dynamic_check_timer_handler(_adapter *padapter)
{ {
return _rtw_mi_process(padapter, _TRUE, NULL, _rtw_mi_dynamic_check_timer_handlder); return _rtw_mi_process(padapter, _TRUE, NULL, _rtw_mi_dynamic_check_timer_handler);
} }
static u8 _rtw_mi_dev_unload(_adapter *adapter, void *data) static u8 _rtw_mi_dev_unload(_adapter *adapter, void *data)

View file

@ -2908,7 +2908,7 @@ static u8 is_drv_in_lps(_adapter *adapter)
#endif /* CONFIG_LPS_LCLK_WD_TIMER*/ #endif /* CONFIG_LPS_LCLK_WD_TIMER*/
return is_in_lps; return is_in_lps;
} }
void rtw_iface_dynamic_check_timer_handlder(_adapter *adapter) void rtw_iface_dynamic_check_timer_handler(_adapter *adapter)
{ {
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
@ -2960,7 +2960,7 @@ void rtw_iface_dynamic_check_timer_handlder(_adapter *adapter)
if (adapter->pppoe_connection_in_progress > 0) if (adapter->pppoe_connection_in_progress > 0)
adapter->pppoe_connection_in_progress--; adapter->pppoe_connection_in_progress--;
/* due to rtw_dynamic_check_timer_handlder() is called every 2 seconds */ /* due to rtw_dynamic_check_timer_handler() is called every 2 seconds */
if (adapter->pppoe_connection_in_progress > 0) if (adapter->pppoe_connection_in_progress > 0)
adapter->pppoe_connection_in_progress--; adapter->pppoe_connection_in_progress--;
} }
@ -3014,7 +3014,7 @@ static void collect_traffic_statistics(_adapter *padapter)
#endif #endif
} }
void rtw_dynamic_check_timer_handlder(_adapter *adapter) void rtw_dynamic_check_timer_handler(_adapter *adapter)
{ {
if (!adapter) if (!adapter)
return; return;
@ -3027,7 +3027,7 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter)
collect_traffic_statistics(adapter); collect_traffic_statistics(adapter);
rtw_mi_dynamic_check_timer_handlder(adapter); rtw_mi_dynamic_check_timer_handler(adapter);
if (!is_drv_in_lps(adapter)) if (!is_drv_in_lps(adapter))
rtw_dynamic_chk_wk_cmd(adapter); rtw_dynamic_chk_wk_cmd(adapter);

View file

@ -15011,7 +15011,7 @@ u8 tx_beacon_hdl(_adapter *padapter, unsigned char *pbuf)
#ifdef CONFIG_SWTIMER_BASED_TXBCN #ifdef CONFIG_SWTIMER_BASED_TXBCN
tx_beacon_handlder(padapter->dvobj); tx_beacon_handler(padapter->dvobj);
#else #else

View file

@ -3368,9 +3368,17 @@ exit:
return ret; return ret;
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void ro_ch_timer_process (void *FunctionContext) static void ro_ch_timer_process (void *FunctionContext)
#else
static void ro_ch_timer_process(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *)FunctionContext; _adapter *adapter = (_adapter *)FunctionContext;
#else
_adapter *adapter = from_timer(adapter, t, cfg80211_wdinfo.remain_on_ch_timer);
#endif
p2p_cancel_roch_cmd(adapter, 0, NULL, 0); p2p_cancel_roch_cmd(adapter, 0, NULL, 0);
} }
@ -4216,7 +4224,11 @@ void rtw_init_cfg80211_wifidirect_info(_adapter *padapter)
_rtw_memset(pcfg80211_wdinfo, 0x00, sizeof(struct cfg80211_wifidirect_info)); _rtw_memset(pcfg80211_wdinfo, 0x00, sizeof(struct cfg80211_wifidirect_info));
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&pcfg80211_wdinfo->remain_on_ch_timer, padapter->pnetdev, ro_ch_timer_process, padapter); _init_timer(&pcfg80211_wdinfo->remain_on_ch_timer, padapter->pnetdev, ro_ch_timer_process, padapter);
#else
timer_setup(&pcfg80211_wdinfo->remain_on_ch_timer, ro_ch_timer_process, 0);
#endif
} }
#endif /* CONFIG_IOCTL_CFG80211 */ #endif /* CONFIG_IOCTL_CFG80211 */
@ -4532,9 +4544,17 @@ exit:
} }
#endif /* CONFIG_P2P_PS */ #endif /* CONFIG_P2P_PS */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void reset_ch_sitesurvey_timer_process (void *FunctionContext) static void reset_ch_sitesurvey_timer_process (void *FunctionContext)
#else
static void reset_ch_sitesurvey_timer_process(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *)FunctionContext; _adapter *adapter = (_adapter *)FunctionContext;
#else
_adapter *adapter = from_timer(adapter, t, wdinfo.reset_ch_sitesurvey);
#endif
struct wifidirect_info *pwdinfo = &adapter->wdinfo; struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@ -4551,9 +4571,17 @@ static void reset_ch_sitesurvey_timer_process(void *FunctionContext)
pwdinfo->rx_invitereq_info.scan_op_ch_only = 0; pwdinfo->rx_invitereq_info.scan_op_ch_only = 0;
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void reset_ch_sitesurvey_timer_process2 (void *FunctionContext) static void reset_ch_sitesurvey_timer_process2 (void *FunctionContext)
#else
static void reset_ch_sitesurvey_timer_process2(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *)FunctionContext; _adapter *adapter = (_adapter *)FunctionContext;
#else
_adapter *adapter = from_timer(adapter, t, wdinfo.reset_ch_sitesurvey2);
#endif
struct wifidirect_info *pwdinfo = &adapter->wdinfo; struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@ -4570,9 +4598,18 @@ static void reset_ch_sitesurvey_timer_process2(void *FunctionContext)
pwdinfo->p2p_info.scan_op_ch_only = 0; pwdinfo->p2p_info.scan_op_ch_only = 0;
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void restore_p2p_state_timer_process (void *FunctionContext) static void restore_p2p_state_timer_process (void *FunctionContext)
#else
static void restore_p2p_state_timer_process(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *)FunctionContext; _adapter *adapter = (_adapter *)FunctionContext;
#else
_adapter *adapter = from_timer(adapter, t,
wdinfo.restore_p2p_state_timer);
#endif
struct wifidirect_info *pwdinfo = &adapter->wdinfo; struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@ -4581,9 +4618,17 @@ static void restore_p2p_state_timer_process(void *FunctionContext)
p2p_protocol_wk_cmd(adapter, P2P_RESTORE_STATE_WK); p2p_protocol_wk_cmd(adapter, P2P_RESTORE_STATE_WK);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void pre_tx_scan_timer_process (void *FunctionContext) static void pre_tx_scan_timer_process (void *FunctionContext)
#else
static void pre_tx_scan_timer_process(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *) FunctionContext; _adapter *adapter = (_adapter *) FunctionContext;
#else
_adapter *adapter = from_timer(adapter, t, wdinfo.pre_tx_scan_timer);
#endif
struct wifidirect_info *pwdinfo = &adapter->wdinfo; struct wifidirect_info *pwdinfo = &adapter->wdinfo;
_irqL irqL; _irqL irqL;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
@ -4613,9 +4658,17 @@ static void pre_tx_scan_timer_process(void *FunctionContext)
_exit_critical_bh(&pmlmepriv->lock, &irqL); _exit_critical_bh(&pmlmepriv->lock, &irqL);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void find_phase_timer_process (void *FunctionContext) static void find_phase_timer_process (void *FunctionContext)
#else
static void find_phase_timer_process(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *)FunctionContext; _adapter *adapter = (_adapter *)FunctionContext;
#else
_adapter *adapter = from_timer(adapter, t, wdinfo.find_phase_timer);
#endif
struct wifidirect_info *pwdinfo = &adapter->wdinfo; struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@ -4872,6 +4925,7 @@ void rtw_init_wifidirect_timers(_adapter *padapter)
{ {
struct wifidirect_info *pwdinfo = &padapter->wdinfo; struct wifidirect_info *pwdinfo = &padapter->wdinfo;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&pwdinfo->find_phase_timer, padapter->pnetdev, find_phase_timer_process, padapter); _init_timer(&pwdinfo->find_phase_timer, padapter->pnetdev, find_phase_timer_process, padapter);
_init_timer(&pwdinfo->restore_p2p_state_timer, padapter->pnetdev, restore_p2p_state_timer_process, padapter); _init_timer(&pwdinfo->restore_p2p_state_timer, padapter->pnetdev, restore_p2p_state_timer_process, padapter);
_init_timer(&pwdinfo->pre_tx_scan_timer, padapter->pnetdev, pre_tx_scan_timer_process, padapter); _init_timer(&pwdinfo->pre_tx_scan_timer, padapter->pnetdev, pre_tx_scan_timer_process, padapter);
@ -4880,6 +4934,20 @@ void rtw_init_wifidirect_timers(_adapter *padapter)
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
_init_timer(&pwdinfo->ap_p2p_switch_timer, padapter->pnetdev, ap_p2p_switch_timer_process, padapter); _init_timer(&pwdinfo->ap_p2p_switch_timer, padapter->pnetdev, ap_p2p_switch_timer_process, padapter);
#endif #endif
#else
timer_setup(&pwdinfo->find_phase_timer, find_phase_timer_process, 0);
timer_setup(&pwdinfo->restore_p2p_state_timer,
restore_p2p_state_timer_process, 0);
timer_setup(&pwdinfo->pre_tx_scan_timer, pre_tx_scan_timer_process, 0);
timer_setup(&pwdinfo->reset_ch_sitesurvey,
reset_ch_sitesurvey_timer_process, 0);
timer_setup(&pwdinfo->reset_ch_sitesurvey2,
reset_ch_sitesurvey_timer_process2, 0);
#ifdef CONFIG_CONCURRENT_MODE
timer_setup(&pwdinfo->ap_p2p_switch_timer,
ap_p2p_switch_timer_process, padapter);
#endif
#endif
} }
void rtw_init_wifidirect_addrs(_adapter *padapter, u8 *dev_addr, u8 *iface_addr) void rtw_init_wifidirect_addrs(_adapter *padapter, u8 *dev_addr, u8 *iface_addr)
@ -5261,8 +5329,13 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role)
_cancel_timer_ex(&pwdinfo->pre_tx_scan_timer); _cancel_timer_ex(&pwdinfo->pre_tx_scan_timer);
_cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey); _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey);
_cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey2); _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey2);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
reset_ch_sitesurvey_timer_process(padapter); reset_ch_sitesurvey_timer_process(padapter);
reset_ch_sitesurvey_timer_process2(padapter); reset_ch_sitesurvey_timer_process2(padapter);
#else
reset_ch_sitesurvey_timer_process(&padapter->wdinfo.reset_ch_sitesurvey);
reset_ch_sitesurvey_timer_process(&padapter->wdinfo.reset_ch_sitesurvey2);
#endif
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
_cancel_timer_ex(&pwdinfo->ap_p2p_switch_timer); _cancel_timer_ex(&pwdinfo->ap_p2p_switch_timer);
#endif #endif

View file

@ -393,10 +393,19 @@ exit:
return; return;
} }
void pwr_state_check_handler(RTW_TIMER_HDL_ARGS); #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void pwr_state_check_handler(RTW_TIMER_HDL_ARGS) void pwr_state_check_handler(RTW_TIMER_HDL_ARGS)
#else
void pwr_state_check_handler(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *padapter = (_adapter *)FunctionContext; _adapter *padapter = (_adapter *)FunctionContext;
#else
struct pwrctrl_priv *pwrpriv = from_timer(pwrpriv, t, pwr_state_check_timer);
_adapter *padapter = pwrpriv->padapter;
#endif
rtw_ps_cmd(padapter); rtw_ps_cmd(padapter);
} }
@ -1939,12 +1948,6 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
if (padapter->adapter_type != PRIMARY_ADAPTER) if (padapter->adapter_type != PRIMARY_ADAPTER)
return; return;
#endif #endif
#ifdef PLATFORM_WINDOWS
pwrctrlpriv->pnp_current_pwr_state = NdisDeviceStateD0;
#endif
_init_pwrlock(&pwrctrlpriv->lock); _init_pwrlock(&pwrctrlpriv->lock);
_init_pwrlock(&pwrctrlpriv->check_32k_lock); _init_pwrlock(&pwrctrlpriv->check_32k_lock);
pwrctrlpriv->rf_pwrstate = rf_on; pwrctrlpriv->rf_pwrstate = rf_on;
@ -1962,6 +1965,7 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
pwrctrlpriv->bInternalAutoSuspend = _FALSE; pwrctrlpriv->bInternalAutoSuspend = _FALSE;
pwrctrlpriv->bInSuspend = _FALSE; pwrctrlpriv->bInSuspend = _FALSE;
pwrctrlpriv->bkeepfwalive = _FALSE; pwrctrlpriv->bkeepfwalive = _FALSE;
pwrctrlpriv->padapter = padapter;
#ifdef CONFIG_AUTOSUSPEND #ifdef CONFIG_AUTOSUSPEND
#ifdef SUPPORT_HW_RFOFF_DETECTED #ifdef SUPPORT_HW_RFOFF_DETECTED
@ -2008,7 +2012,11 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
#endif /* CONFIG_LPS_RPWM_TIMER */ #endif /* CONFIG_LPS_RPWM_TIMER */
#endif /* CONFIG_LPS_LCLK */ #endif /* CONFIG_LPS_LCLK */
rtw_init_timer(&pwrctrlpriv->pwr_state_check_timer, padapter, pwr_state_check_handler); #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&pwrctrlpriv->pwr_state_check_timer, padapter->pnetdev, pwr_state_check_handler, padapter);
#else
timer_setup(&pwrctrlpriv->pwr_state_check_timer, pwr_state_check_handler, 0);
#endif
pwrctrlpriv->wowlan_mode = _FALSE; pwrctrlpriv->wowlan_mode = _FALSE;
pwrctrlpriv->wowlan_ap_mode = _FALSE; pwrctrlpriv->wowlan_ap_mode = _FALSE;
@ -2057,7 +2065,6 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
} }
void rtw_free_pwrctrl_priv(PADAPTER adapter) void rtw_free_pwrctrl_priv(PADAPTER adapter)
{ {
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(adapter); struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(adapter);

View file

@ -30,7 +30,11 @@
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS); void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS);
#else
void rtw_signal_stat_timer_hdl(struct timer_list *t);
#endif
enum { enum {
SIGNAL_STAT_CALC_PROFILE_0 = 0, SIGNAL_STAT_CALC_PROFILE_0 = 0,
@ -144,7 +148,11 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter)
res = rtw_hal_init_recv_priv(padapter); res = rtw_hal_init_recv_priv(padapter);
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
rtw_init_timer(&precvpriv->signal_stat_timer, padapter, RTW_TIMER_HDL_NAME(signal_stat)); #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&precvpriv->signal_stat_timer, padapter->pnetdev, RTW_TIMER_HDL_NAME(signal_stat), padapter);
#else
timer_setup(&precvpriv->signal_stat_timer, RTW_TIMER_HDL_NAME(signal_stat), 9);
#endif
precvpriv->signal_stat_sampling_interval = 2000; /* ms */ precvpriv->signal_stat_sampling_interval = 2000; /* ms */
/* precvpriv->signal_stat_converging_constant = 5000; */ /* ms */ /* precvpriv->signal_stat_converging_constant = 5000; */ /* ms */
@ -159,7 +167,6 @@ exit:
} }
void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv);
void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv) void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv)
{ {
_rtw_spinlock_free(&precvpriv->lock); _rtw_spinlock_free(&precvpriv->lock);
@ -4312,9 +4319,17 @@ _recv_entry_drop:
} }
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS) void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS)
#else
void rtw_signal_stat_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *)FunctionContext; _adapter *adapter = (_adapter *)FunctionContext;
#else
_adapter *adapter = from_timer(adapter, t, recvpriv.signal_stat_timer);
#endif
struct recv_priv *recvpriv = &adapter->recvpriv; struct recv_priv *recvpriv = &adapter->recvpriv;
u32 tmp_s, tmp_q; u32 tmp_s, tmp_q;

View file

@ -1825,9 +1825,17 @@ void BlinkHandler(PLED_USB pLed)
* Callback function of LED BlinkTimer, * Callback function of LED BlinkTimer,
* it just schedules to corresponding BlinkWorkItem/led_blink_hdl * it just schedules to corresponding BlinkWorkItem/led_blink_hdl
* */ * */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void BlinkTimerCallback(void *data) void BlinkTimerCallback(void *data)
#else
void BlinkTimerCallback(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
PLED_USB pLed = (PLED_USB)data; PLED_USB pLed = (PLED_USB)data;
#else
PLED_USB pLed = from_timer(pLed, t, BlinkTimer);
#endif
_adapter *padapter = pLed->padapter; _adapter *padapter = pLed->padapter;
/* RTW_INFO("%s\n", __FUNCTION__); */ /* RTW_INFO("%s\n", __FUNCTION__); */
@ -4267,7 +4275,11 @@ InitLed(
pLed->LedPin = LedPin; pLed->LedPin = LedPin;
ResetLedStatus(pLed); ResetLedStatus(pLed);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed); _init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed);
#else
timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0);
#endif
_init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed); _init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed);
} }

View file

@ -449,72 +449,8 @@ odm_bd_ccoex_type_with_bfer_client(
} }
} }
void void odm_bf_ant_div_mode_arbitration(void *p_dm_void)
odm_bf_ant_div_mode_arbitration(
void *p_dm_void
)
{ {
struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void;
struct _BF_DIV_COEX_ *p_dm_bdc_table = &p_dm_odm->dm_bdc_table;
u8 current_bdc_mode;
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("\n"));
/* 2 mode 1 */
if ((p_dm_bdc_table->num_txbfee_client != 0) && (p_dm_bdc_table->num_txbfer_client == 0)) {
current_bdc_mode = BDC_MODE_1;
if (current_bdc_mode != p_dm_bdc_table->bdc_mode) {
p_dm_bdc_table->bdc_mode = BDC_MODE_1;
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVON_CSIOFF);
p_dm_bdc_table->bdc_rx_idle_update_counter = 1;
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Change to (( Mode1 ))\n"));
}
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Antdiv + BF coextance mode] : (( Mode1 ))\n"));
}
/* 2 mode 2 */
else if ((p_dm_bdc_table->num_txbfee_client == 0) && (p_dm_bdc_table->num_txbfer_client != 0)) {
current_bdc_mode = BDC_MODE_2;
if (current_bdc_mode != p_dm_bdc_table->bdc_mode) {
p_dm_bdc_table->bdc_mode = BDC_MODE_2;
p_dm_bdc_table->BDC_state = BDC_DIV_TRAIN_STATE;
p_dm_bdc_table->bdc_try_flag = 0;
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Change to (( Mode2 ))\n"));
}
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Antdiv + BF coextance mode] : (( Mode2 ))\n"));
}
/* 2 mode 3 */
else if ((p_dm_bdc_table->num_txbfee_client != 0) && (p_dm_bdc_table->num_txbfer_client != 0)) {
current_bdc_mode = BDC_MODE_3;
if (current_bdc_mode != p_dm_bdc_table->bdc_mode) {
p_dm_bdc_table->bdc_mode = BDC_MODE_3;
p_dm_bdc_table->BDC_state = BDC_DIV_TRAIN_STATE;
p_dm_bdc_table->bdc_try_flag = 0;
p_dm_bdc_table->bdc_rx_idle_update_counter = 1;
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Change to (( Mode3 ))\n"));
}
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Antdiv + BF coextance mode] : (( Mode3 ))\n"));
}
/* 2 mode 4 */
else if ((p_dm_bdc_table->num_txbfee_client == 0) && (p_dm_bdc_table->num_txbfer_client == 0)) {
current_bdc_mode = BDC_MODE_4;
if (current_bdc_mode != p_dm_bdc_table->bdc_mode) {
p_dm_bdc_table->bdc_mode = BDC_MODE_4;
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVON_CSIOFF);
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Change to (( Mode4 ))\n"));
}
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[Antdiv + BF coextance mode] : (( Mode4 ))\n"));
}
#endif
} }
void void
@ -543,232 +479,6 @@ odm_bd_ccoex_bfee_rx_div_arbitration(
u8 bdc_active_mode; u8 bdc_active_mode;
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***{ num_BFee, num_BFer, num_client} = (( %d , %d , %d))\n", p_dm_bdc_table->num_txbfee_client, p_dm_bdc_table->num_txbfer_client, p_dm_bdc_table->num_client));
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***{ num_BF_tars, num_DIV_tars } = (( %d , %d ))\n", p_dm_bdc_table->num_bf_tar, p_dm_bdc_table->num_div_tar));
/* 2 [ MIB control ] */
if (p_dm_odm->bdc_holdstate == 2) {
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVOFF_CSION);
p_dm_bdc_table->BDC_state = BDC_BF_HOLD_STATE;
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Force in [ BF STATE]\n"));
return;
} else if (p_dm_odm->bdc_holdstate == 1) {
p_dm_bdc_table->BDC_state = BDC_DIV_HOLD_STATE;
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVON_CSIOFF);
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Force in [ DIV STATE]\n"));
return;
}
/* ------------------------------------------------------------ */
/* 2 mode 2 & 3 */
if (p_dm_bdc_table->bdc_mode == BDC_MODE_2 || p_dm_bdc_table->bdc_mode == BDC_MODE_3) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("\n{ Try_flag, Try_counter } = { %d , %d }\n", p_dm_bdc_table->bdc_try_flag, p_dm_bdc_table->bdc_try_counter));
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BDCcoexType = (( %d )) \n\n", p_dm_bdc_table->bd_ccoex_type_wbfer));
/* All Client have Bfer-Cap------------------------------- */
if (p_dm_bdc_table->num_txbfer_client == p_dm_bdc_table->num_client) { /* BFer STA Only?: yes */
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BFer STA only? (( Yes ))\n"));
p_dm_bdc_table->bdc_try_flag = 0;
p_dm_bdc_table->BDC_state = BDC_DIV_TRAIN_STATE;
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVOFF_CSION);
return;
} else
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BFer STA only? (( No ))\n"));
/* */
if (p_dm_bdc_table->is_all_bf_sta_idle == false && p_dm_bdc_table->is_all_div_sta_idle == true) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("All DIV-STA are idle, but BF-STA not\n"));
p_dm_bdc_table->bdc_try_flag = 0;
p_dm_bdc_table->BDC_state = bdc_bfer_train_state;
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVOFF_CSION);
return;
} else if (p_dm_bdc_table->is_all_bf_sta_idle == true && p_dm_bdc_table->is_all_div_sta_idle == false) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("All BF-STA are idle, but DIV-STA not\n"));
p_dm_bdc_table->bdc_try_flag = 0;
p_dm_bdc_table->BDC_state = BDC_DIV_TRAIN_STATE;
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVON_CSIOFF);
return;
}
/* Select active mode-------------------------------------- */
if (p_dm_bdc_table->num_bf_tar == 0) { /* Selsect_1, Selsect_2 */
if (p_dm_bdc_table->num_div_tar == 0) { /* Selsect_3 */
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Select active mode (( 1 ))\n"));
p_dm_bdc_table->bdc_active_mode = 1;
} else {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Select active mode (( 2 ))\n"));
p_dm_bdc_table->bdc_active_mode = 2;
}
p_dm_bdc_table->bdc_try_flag = 0;
p_dm_bdc_table->BDC_state = BDC_DIV_TRAIN_STATE;
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVON_CSIOFF);
return;
} else { /* num_bf_tar > 0 */
if (p_dm_bdc_table->num_div_tar == 0) { /* Selsect_3 */
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Select active mode (( 3 ))\n"));
p_dm_bdc_table->bdc_active_mode = 3;
p_dm_bdc_table->bdc_try_flag = 0;
p_dm_bdc_table->BDC_state = bdc_bfer_train_state;
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVOFF_CSION);
return;
} else { /* Selsect_4 */
bdc_active_mode = 4;
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Select active mode (( 4 ))\n"));
if (bdc_active_mode != p_dm_bdc_table->bdc_active_mode) {
p_dm_bdc_table->bdc_active_mode = 4;
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Change to active mode (( 4 )) & return!!!\n"));
return;
}
}
}
#if 1
if (p_dm_odm->bdc_holdstate == 0xff) {
p_dm_bdc_table->BDC_state = BDC_DIV_HOLD_STATE;
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVON_CSIOFF);
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Force in [ DIV STATE]\n"));
return;
}
#endif
/* Does Client number changed ? ------------------------------- */
if (p_dm_bdc_table->num_client != p_dm_bdc_table->pre_num_client) {
p_dm_bdc_table->bdc_try_flag = 0;
p_dm_bdc_table->BDC_state = BDC_DIV_TRAIN_STATE;
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ The number of client has been changed !!!] return to (( BDC_DIV_TRAIN_STATE ))\n"));
}
p_dm_bdc_table->pre_num_client = p_dm_bdc_table->num_client;
if (p_dm_bdc_table->bdc_try_flag == 0) {
/* 2 DIV_TRAIN_STATE (mode 2-0) */
if (p_dm_bdc_table->BDC_state == BDC_DIV_TRAIN_STATE)
odm_div_train_state_setting(p_dm_odm);
/* 2 BFer_TRAIN_STATE (mode 2-1) */
else if (p_dm_bdc_table->BDC_state == bdc_bfer_train_state) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*****[2-1. BFer_TRAIN_STATE ]*****\n"));
/* if(p_dm_bdc_table->num_bf_tar==0) */
/* { */
/* ODM_RT_TRACE(p_dm_odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BF_tars exist? : (( No )), [ bdc_bfer_train_state ] >> [BDC_DIV_TRAIN_STATE]\n")); */
/* odm_div_train_state_setting( p_dm_odm); */
/* } */
/* else */ /* num_bf_tar != 0 */
/* { */
p_dm_bdc_table->bdc_try_counter = 2;
p_dm_bdc_table->bdc_try_flag = 1;
p_dm_bdc_table->BDC_state = BDC_DECISION_STATE;
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVOFF_CSION);
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BF_tars exist? : (( Yes )), [ bdc_bfer_train_state ] >> [BDC_DECISION_STATE]\n"));
/* } */
}
/* 2 DECISION_STATE (mode 2-2) */
else if (p_dm_bdc_table->BDC_state == BDC_DECISION_STATE) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*****[2-2. DECISION_STATE]*****\n"));
/* if(p_dm_bdc_table->num_bf_tar==0) */
/* { */
/* ODM_AntDiv_Printk(("BF_tars exist? : (( No )), [ DECISION_STATE ] >> [BDC_DIV_TRAIN_STATE]\n")); */
/* odm_div_train_state_setting( p_dm_odm); */
/* } */
/* else */ /* num_bf_tar != 0 */
/* { */
if (p_dm_bdc_table->BF_pass == false || p_dm_bdc_table->DIV_pass == false)
stop_bf_flag = true;
else
stop_bf_flag = false;
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BF_tars exist? : (( Yes )), {BF_pass, DIV_pass, stop_bf_flag } = { %d, %d, %d }\n", p_dm_bdc_table->BF_pass, p_dm_bdc_table->DIV_pass, stop_bf_flag));
if (stop_bf_flag == true) { /* DIV_en */
p_dm_bdc_table->bdc_hold_counter = 10; /* 20 */
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVON_CSIOFF);
p_dm_bdc_table->BDC_state = BDC_DIV_HOLD_STATE;
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ stop_bf_flag= ((true)), BDC_DECISION_STATE ] >> [BDC_DIV_HOLD_STATE]\n"));
} else { /* BF_en */
p_dm_bdc_table->bdc_hold_counter = 10; /* 20 */
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVOFF_CSION);
p_dm_bdc_table->BDC_state = BDC_BF_HOLD_STATE;
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[stop_bf_flag= ((false)), BDC_DECISION_STATE ] >> [BDC_BF_HOLD_STATE]\n"));
}
/* } */
}
/* 2 BF-HOLD_STATE (mode 2-3) */
else if (p_dm_bdc_table->BDC_state == BDC_BF_HOLD_STATE) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*****[2-3. BF_HOLD_STATE ]*****\n"));
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("bdc_hold_counter = (( %d ))\n", p_dm_bdc_table->bdc_hold_counter));
if (p_dm_bdc_table->bdc_hold_counter == 1) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ BDC_BF_HOLD_STATE ] >> [BDC_DIV_TRAIN_STATE]\n"));
odm_div_train_state_setting(p_dm_odm);
} else {
p_dm_bdc_table->bdc_hold_counter--;
/* if(p_dm_bdc_table->num_bf_tar==0) */
/* { */
/* ODM_RT_TRACE(p_dm_odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BF_tars exist? : (( No )), [ BDC_BF_HOLD_STATE ] >> [BDC_DIV_TRAIN_STATE]\n")); */
/* odm_div_train_state_setting( p_dm_odm); */
/* } */
/* else */ /* num_bf_tar != 0 */
/* { */
/* ODM_RT_TRACE(p_dm_odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("BF_tars exist? : (( Yes ))\n")); */
p_dm_bdc_table->BDC_state = BDC_BF_HOLD_STATE;
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVOFF_CSION);
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ BDC_BF_HOLD_STATE ] >> [BDC_BF_HOLD_STATE]\n"));
/* } */
}
}
/* 2 DIV-HOLD_STATE (mode 2-4) */
else if (p_dm_bdc_table->BDC_state == BDC_DIV_HOLD_STATE) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("*****[2-4. DIV_HOLD_STATE ]*****\n"));
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("bdc_hold_counter = (( %d ))\n", p_dm_bdc_table->bdc_hold_counter));
if (p_dm_bdc_table->bdc_hold_counter == 1) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ BDC_DIV_HOLD_STATE ] >> [BDC_DIV_TRAIN_STATE]\n"));
odm_div_train_state_setting(p_dm_odm);
} else {
p_dm_bdc_table->bdc_hold_counter--;
p_dm_bdc_table->BDC_state = BDC_DIV_HOLD_STATE;
odm_bd_ccoex_type_with_bfer_client(p_dm_odm, DIVON_CSIOFF);
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ BDC_DIV_HOLD_STATE ] >> [BDC_DIV_HOLD_STATE]\n"));
}
}
} else if (p_dm_bdc_table->bdc_try_flag == 1) {
/* 2 Set Training counter */
if (p_dm_bdc_table->bdc_try_counter > 1) {
p_dm_bdc_table->bdc_try_counter--;
if (p_dm_bdc_table->bdc_try_counter == 1)
p_dm_bdc_table->bdc_try_flag = 0;
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Training !!\n"));
/* return ; */
}
}
}
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("\n[end]\n"));
#endif /* #if(DM_ODM_SUPPORT_TYPE == ODM_AP) */
}
#endif
#endif /* #ifdef BEAMFORMING_SUPPORT */ #endif /* #ifdef BEAMFORMING_SUPPORT */
@ -784,14 +494,6 @@ odm_rx_hw_ant_div_init_88e(
u32 value32; u32 value32;
struct _FAST_ANTENNA_TRAINNING_ *p_dm_fat_table = &p_dm_odm->dm_fat_table; struct _FAST_ANTENNA_TRAINNING_ *p_dm_fat_table = &p_dm_odm->dm_fat_table;
#if 0
if (p_dm_odm->mp_mode == true) {
odm_set_bb_reg(p_dm_odm, ODM_REG_IGI_A_11N, BIT(7), 0); /* disable HW AntDiv */
odm_set_bb_reg(p_dm_odm, ODM_REG_LNA_SWITCH_11N, BIT(31), 1); /* 1:CG, 0:CS */
return;
}
#endif
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => ant_div_type=[CGCS_RX_HW_ANTDIV]\n")); ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => ant_div_type=[CGCS_RX_HW_ANTDIV]\n"));
/* MAC setting */ /* MAC setting */
@ -822,14 +524,6 @@ odm_trx_hw_ant_div_init_88e(
u32 value32; u32 value32;
struct _FAST_ANTENNA_TRAINNING_ *p_dm_fat_table = &p_dm_odm->dm_fat_table; struct _FAST_ANTENNA_TRAINNING_ *p_dm_fat_table = &p_dm_odm->dm_fat_table;
#if 0
if (p_dm_odm->mp_mode == true) {
odm_set_bb_reg(p_dm_odm, ODM_REG_IGI_A_11N, BIT(7), 0); /* disable HW AntDiv */
odm_set_bb_reg(p_dm_odm, ODM_REG_RX_ANT_CTRL_11N, BIT(5) | BIT4 | BIT3, 0); /* Default RX (0/1) */
return;
}
#endif
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => ant_div_type=[CG_TRX_HW_ANTDIV (SPDT)]\n")); ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => ant_div_type=[CG_TRX_HW_ANTDIV (SPDT)]\n"));
/* MAC setting */ /* MAC setting */
@ -858,10 +552,7 @@ odm_trx_hw_ant_div_init_88e(
#if (defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY)) || (defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY)) #if (defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY)) || (defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY))
void void odm_smart_hw_ant_div_init_88e(void *p_dm_void)
odm_smart_hw_ant_div_init_88e(
void *p_dm_void
)
{ {
struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void;
u32 value32, i; u32 value32, i;
@ -869,13 +560,6 @@ odm_smart_hw_ant_div_init_88e(
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => ant_div_type=[CG_TRX_SMART_ANTDIV]\n")); ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8188E AntDiv_Init => ant_div_type=[CG_TRX_SMART_ANTDIV]\n"));
#if 0
if (p_dm_odm->mp_mode == true) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("p_dm_odm->ant_div_type: %d\n", p_dm_odm->ant_div_type));
return;
}
#endif
p_dm_fat_table->train_idx = 0; p_dm_fat_table->train_idx = 0;
p_dm_fat_table->fat_state = FAT_PREPARE_STATE; p_dm_fat_table->fat_state = FAT_PREPARE_STATE;
@ -970,15 +654,6 @@ odm_rx_hw_ant_div_init_92e(
struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void;
struct _FAST_ANTENNA_TRAINNING_ *p_dm_fat_table = &p_dm_odm->dm_fat_table; struct _FAST_ANTENNA_TRAINNING_ *p_dm_fat_table = &p_dm_odm->dm_fat_table;
#if 0
if (p_dm_odm->mp_mode == true) {
odm_ant_div_on_off(p_dm_odm, ANTDIV_OFF);
odm_set_bb_reg(p_dm_odm, 0xc50, BIT(8), 0); /* r_rxdiv_enable_anta regc50[8]=1'b0 0: control by c50[9] */
odm_set_bb_reg(p_dm_odm, 0xc50, BIT(9), 1); /* 1:CG, 0:CS */
return;
}
#endif
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8192E AntDiv_Init => ant_div_type=[CGCS_RX_HW_ANTDIV]\n")); ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8192E AntDiv_Init => ant_div_type=[CGCS_RX_HW_ANTDIV]\n"));
/* Pin Settings */ /* Pin Settings */
@ -1020,15 +695,6 @@ odm_trx_hw_ant_div_init_92e(
struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void;
struct _FAST_ANTENNA_TRAINNING_ *p_dm_fat_table = &p_dm_odm->dm_fat_table; struct _FAST_ANTENNA_TRAINNING_ *p_dm_fat_table = &p_dm_odm->dm_fat_table;
#if 0
if (p_dm_odm->mp_mode == true) {
odm_ant_div_on_off(p_dm_odm, ANTDIV_OFF);
odm_set_bb_reg(p_dm_odm, 0xc50, BIT(8), 0); /* r_rxdiv_enable_anta regc50[8]=1'b0 0: control by c50[9] */
odm_set_bb_reg(p_dm_odm, 0xc50, BIT(9), 1); /* 1:CG, 0:CS */
return;
}
#endif
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8192E AntDiv_Init => ant_div_type=[ Only for DIR605, CG_TRX_HW_ANTDIV]\n")); ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8192E AntDiv_Init => ant_div_type=[ Only for DIR605, CG_TRX_HW_ANTDIV]\n"));
/* 3 --RFE pin setting--------- */ /* 3 --RFE pin setting--------- */
@ -1051,14 +717,6 @@ odm_trx_hw_ant_div_init_92e(
/* Pin Settings */ /* Pin Settings */
odm_set_bb_reg(p_dm_odm, 0xC50, BIT(8), 0); /* path-A */ /* disable CS/CG switch */ odm_set_bb_reg(p_dm_odm, 0xC50, BIT(8), 0); /* path-A */ /* disable CS/CG switch */
#if 0
/* Let it follows PHY_REG for bit9 setting */
if (p_dm_odm->priv->pshare->rf_ft_var.use_ext_pa || p_dm_odm->priv->pshare->rf_ft_var.use_ext_lna)
odm_set_bb_reg(p_dm_odm, 0xC50, BIT(9), 1);/* path-A //output at CS */
else
odm_set_bb_reg(p_dm_odm, 0xC50, BIT(9), 0); /* path-A //output at CG ->normal power */
#endif
odm_set_bb_reg(p_dm_odm, 0x870, BIT(9) | BIT8, 0); /* path-A */ /* antsel antselb by HW */ odm_set_bb_reg(p_dm_odm, 0x870, BIT(9) | BIT8, 0); /* path-A */ /* antsel antselb by HW */
odm_set_bb_reg(p_dm_odm, 0xB38, BIT(10), 0); /* path-A */ /* antsel2 by HW */ odm_set_bb_reg(p_dm_odm, 0xB38, BIT(10), 0); /* path-A */ /* antsel2 by HW */
@ -1166,11 +824,7 @@ odm_trx_hw_ant_div_init_8723d(
} }
void void phydm_set_tx_ant_pwr_8723d(void *p_dm_void, u8 ant)
phydm_set_tx_ant_pwr_8723d(
void *p_dm_void,
u8 ant
)
{ {
struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void;
struct _FAST_ANTENNA_TRAINNING_ *p_dm_fat_table = &p_dm_odm->dm_fat_table; struct _FAST_ANTENNA_TRAINNING_ *p_dm_fat_table = &p_dm_odm->dm_fat_table;
@ -1179,12 +833,7 @@ phydm_set_tx_ant_pwr_8723d(
p_dm_fat_table->rx_idle_ant = ant; p_dm_fat_table->rx_idle_ant = ant;
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
p_adapter->HalFunc.SetTxPowerLevelHandler(p_adapter, *p_dm_odm->p_channel);
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
rtw_hal_set_tx_power_level(p_adapter, *p_dm_odm->p_channel); rtw_hal_set_tx_power_level(p_adapter, *p_dm_odm->p_channel);
#endif
} }
#endif #endif
@ -1238,8 +887,6 @@ odm_trx_hw_ant_div_init_8723b(
} }
void void
odm_s0s1_sw_ant_div_init_8723b( odm_s0s1_sw_ant_div_init_8723b(
void *p_dm_void void *p_dm_void
@ -1289,33 +936,6 @@ odm_update_rx_idle_ant_8723b(
return; return;
} }
#if 0
/* Send H2C command to FW */
/* Enable wifi calibration */
h2c_parameter = true;
odm_fill_h2c_cmd(p_dm_odm, ODM_H2C_WIFI_CALIBRATION, 1, &h2c_parameter);
/* Check if H2C command sucess or not (0x1e6) */
u1_temp = odm_read_1byte(p_dm_odm, 0x1e6);
while ((u1_temp != 0x1) && (count < 100)) {
ODM_delay_us(10);
u1_temp = odm_read_1byte(p_dm_odm, 0x1e6);
count++;
}
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-ant ] 8723B: H2C command status = %d, count = %d\n", u1_temp, count));
if (u1_temp == 0x1) {
/* Check if BT is doing IQK (0x1e7) */
count = 0;
u1_temp = odm_read_1byte(p_dm_odm, 0x1e7);
while ((!(u1_temp & BIT(0))) && (count < 100)) {
ODM_delay_us(50);
u1_temp = odm_read_1byte(p_dm_odm, 0x1e7);
count++;
}
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-ant ] 8723B: BT IQK status = %d, count = %d\n", u1_temp, count));
if (u1_temp & BIT(0)) {
odm_set_bb_reg(p_dm_odm, 0x948, BIT(6), 0x1); odm_set_bb_reg(p_dm_odm, 0x948, BIT(6), 0x1);
odm_set_bb_reg(p_dm_odm, 0x948, BIT(9), default_ant); odm_set_bb_reg(p_dm_odm, 0x948, BIT(9), default_ant);
odm_set_bb_reg(p_dm_odm, 0x864, BIT(5) | BIT4 | BIT3, default_ant); /*Default RX*/ odm_set_bb_reg(p_dm_odm, 0x864, BIT(5) | BIT4 | BIT3, default_ant); /*Default RX*/
@ -1325,46 +945,11 @@ odm_update_rx_idle_ant_8723b(
/* Set TX AGC by S0/S1 */ /* Set TX AGC by S0/S1 */
/* Need to consider Linux driver */ /* Need to consider Linux driver */
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
p_adapter->hal_func.set_tx_power_level_handler(p_adapter, *p_dm_odm->p_channel);
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
rtw_hal_set_tx_power_level(p_adapter, *p_dm_odm->p_channel); rtw_hal_set_tx_power_level(p_adapter, *p_dm_odm->p_channel);
#endif
/* Set IQC by S0/S1 */
odm_set_iqc_by_rfpath(p_dm_odm, default_ant);
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-ant ] 8723B: Sucess to set RX antenna\n"));
} else
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-ant ] 8723B: Fail to set RX antenna due to BT IQK\n"));
} else
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-ant ] 8723B: Fail to set RX antenna due to H2C command fail\n"));
/* Send H2C command to FW */
/* Disable wifi calibration */
h2c_parameter = false;
odm_fill_h2c_cmd(p_dm_odm, ODM_H2C_WIFI_CALIBRATION, 1, &h2c_parameter);
#else
odm_set_bb_reg(p_dm_odm, 0x948, BIT(6), 0x1);
odm_set_bb_reg(p_dm_odm, 0x948, BIT(9), default_ant);
odm_set_bb_reg(p_dm_odm, 0x864, BIT(5) | BIT4 | BIT3, default_ant); /*Default RX*/
odm_set_bb_reg(p_dm_odm, 0x864, BIT(8) | BIT7 | BIT6, optional_ant); /*Optional RX*/
odm_set_bb_reg(p_dm_odm, 0x860, BIT(14) | BIT13 | BIT12, default_ant); /*Default TX*/
p_dm_fat_table->rx_idle_ant = ant;
/* Set TX AGC by S0/S1 */
/* Need to consider Linux driver */
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
p_adapter->HalFunc.SetTxPowerLevelHandler(p_adapter, *p_dm_odm->p_channel);
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
rtw_hal_set_tx_power_level(p_adapter, *p_dm_odm->p_channel);
#endif
/* Set IQC by S0/S1 */ /* Set IQC by S0/S1 */
odm_set_iqc_by_rfpath(p_dm_odm, default_ant); odm_set_iqc_by_rfpath(p_dm_odm, default_ant);
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-ant ] 8723B: Success to set RX antenna\n")); ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[ Update Rx-Idle-ant ] 8723B: Success to set RX antenna\n"));
#endif
} }
bool bool
@ -1403,7 +988,6 @@ phydm_hl_smart_ant_type1_init_8821a(
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8821A SmartAnt_Init => ant_div_type=[Hong-Lin Smart ant Type1]\n")); ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("***8821A SmartAnt_Init => ant_div_type=[Hong-Lin Smart ant Type1]\n"));
#if 0
/* ---------------------------------------- */ /* ---------------------------------------- */
/* GPIO 2-3 for Beam control */ /* GPIO 2-3 for Beam control */
/* reg0x66[2]=0 */ /* reg0x66[2]=0 */
@ -1412,7 +996,6 @@ phydm_hl_smart_ant_type1_init_8821a(
/* reg0x44[15:8] output_value for P_GPIO[7:0] */ /* reg0x44[15:8] output_value for P_GPIO[7:0] */
/* reg0x40[1:0] = 0 GPIO function */ /* reg0x40[1:0] = 0 GPIO function */
/* ------------------------------------------ */ /* ------------------------------------------ */
#endif
/*GPIO setting*/ /*GPIO setting*/
odm_set_mac_reg(p_dm_odm, 0x64, BIT(18), 0); odm_set_mac_reg(p_dm_odm, 0x64, BIT(18), 0);
@ -1622,9 +1205,6 @@ phydm_hl_smart_ant_type1_init_8822b(
/*CGCS setting*/ /*CGCS setting*/
odm_set_bb_reg(p_dm_odm, 0xC1C, (BIT(7) | BIT6), 0); /*force to CG*/ odm_set_bb_reg(p_dm_odm, 0xC1C, (BIT(7) | BIT6), 0); /*force to CG*/
#if 0
/* ---------------------------------------- */ /* ---------------------------------------- */
/* GPIO 0-1 for Beam control */ /* GPIO 0-1 for Beam control */
/* reg0x66[2:0]=0 */ /* reg0x66[2:0]=0 */
@ -1633,7 +1213,6 @@ phydm_hl_smart_ant_type1_init_8822b(
/* reg0x44[15:8] output_value for P_GPIO[7:0] */ /* reg0x44[15:8] output_value for P_GPIO[7:0] */
/* reg0x40[1:0] = 0 GPIO function */ /* reg0x40[1:0] = 0 GPIO function */
/* ------------------------------------------ */ /* ------------------------------------------ */
#endif
/*GPIO setting*/ /*GPIO setting*/
odm_set_mac_reg(p_dm_odm, 0x64, (BIT(18) | BIT(17) | BIT(16)), 0); odm_set_mac_reg(p_dm_odm, 0x64, (BIT(18) | BIT(17) | BIT(16)), 0);
@ -2133,12 +1712,18 @@ odm_evm_enhance_ant_div(
} }
} }
void #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
odm_evm_fast_ant_training_callback( void odm_evm_fast_ant_training_callback(void *p_dm_void)
void *p_dm_void #else
) void odm_evm_fast_ant_training_callback(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void;
#else
struct PHY_DM_STRUCT *p_dm_odm = from_timer(p_dm_odm, t, evm_fast_ant_training_timer);
#endif
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("******odm_evm_fast_ant_training_callback******\n")); ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("******odm_evm_fast_ant_training_callback******\n"));
odm_hw_ant_div(p_dm_odm); odm_hw_ant_div(p_dm_odm);
} }
@ -2816,71 +2401,31 @@ odm_s0s1_sw_ant_div(
odm_set_timer(p_dm_odm, &(p_dm_swat_table->phydm_sw_antenna_switch_timer), p_dm_swat_table->train_time); /*ms*/ odm_set_timer(p_dm_odm, &(p_dm_swat_table->phydm_sw_antenna_switch_timer), p_dm_swat_table->train_time); /*ms*/
} }
void odm_sw_antdiv_workitem_callback(void *p_context)
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
void
odm_sw_antdiv_callback(
struct timer_list *p_timer
)
{
struct _ADAPTER *adapter = (struct _ADAPTER *)p_timer->Adapter;
HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(adapter);
struct _sw_antenna_switch_ *p_dm_swat_table = &p_hal_data->DM_OutSrc.dm_swat_table;
#if DEV_BUS_TYPE == RT_PCI_INTERFACE
#if USE_WORKITEM
odm_schedule_work_item(&p_dm_swat_table->phydm_sw_antenna_switch_workitem);
#else
{
/* dbg_print("SW_antdiv_Callback"); */
odm_s0s1_sw_ant_div(&p_hal_data->DM_OutSrc, SWAW_STEP_DETERMINE);
}
#endif
#else
odm_schedule_work_item(&p_dm_swat_table->phydm_sw_antenna_switch_workitem);
#endif
}
void
odm_sw_antdiv_workitem_callback(
void *p_context
)
{ {
struct _ADAPTER * p_adapter = (struct _ADAPTER *)p_context; struct _ADAPTER * p_adapter = (struct _ADAPTER *)p_context;
HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(p_adapter); HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(p_adapter);
/* dbg_print("SW_antdiv_Workitem_Callback"); */
odm_s0s1_sw_ant_div(&p_hal_data->DM_OutSrc, SWAW_STEP_DETERMINE);
}
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
void
odm_sw_antdiv_workitem_callback(
void *p_context
)
{
struct _ADAPTER *
p_adapter = (struct _ADAPTER *)p_context;
HAL_DATA_TYPE
*p_hal_data = GET_HAL_DATA(p_adapter);
/*dbg_print("SW_antdiv_Workitem_Callback");*/ /*dbg_print("SW_antdiv_Workitem_Callback");*/
odm_s0s1_sw_ant_div(&p_hal_data->odmpriv, SWAW_STEP_DETERMINE); odm_s0s1_sw_ant_div(&p_hal_data->odmpriv, SWAW_STEP_DETERMINE);
} }
void #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
odm_sw_antdiv_callback(void *function_context) void odm_sw_antdiv_callback(void *function_context)
#else
void odm_sw_antdiv_callback(istruct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)function_context; struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)function_context;
#else
struct PHY_DM_STRUCT *p_dm_odm = timer_list(p_dm_odm, t, dm_swat_table.phydm_sw_antenna_switch_timer);
#endif
struct _ADAPTER *padapter = p_dm_odm->adapter; struct _ADAPTER *padapter = p_dm_odm->adapter;
if (padapter->net_closed == _TRUE) if (padapter->net_closed == _TRUE)
return; return;
#if 0 /* Can't do I/O in timer callback*/
odm_s0s1_sw_ant_div(p_dm_odm, SWAW_STEP_DETERMINE);
#else
rtw_run_in_thread_cmd(padapter, odm_sw_antdiv_workitem_callback, padapter); rtw_run_in_thread_cmd(padapter, odm_sw_antdiv_workitem_callback, padapter);
#endif
} }
@ -3285,20 +2830,23 @@ odm_fast_ant_training(
} }
void #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
odm_fast_ant_training_callback( void odm_fast_ant_training_callback(void *p_dm_void)
void *p_dm_void #else
) void odm_fast_ant_training_callback(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void;
#else
#if (DM_ODM_SUPPORT_TYPE == ODM_CE) struct PHY_DM_STRUCT *p_dm_odm = from_timer(p_gm_odm, t, fast_ant_training_timer);
#endif
struct _ADAPTER *padapter = p_dm_odm->adapter; struct _ADAPTER *padapter = p_dm_odm->adapter;
if (padapter->net_closed == _TRUE) if (padapter->net_closed == _TRUE)
return; return;
/* if(*p_dm_odm->p_is_net_closed == true) */ /* if(*p_dm_odm->p_is_net_closed == true) */
/* return; */ /* return; */
#endif
#if USE_WORKITEM #if USE_WORKITEM
odm_schedule_work_item(&p_dm_odm->fast_ant_training_workitem); odm_schedule_work_item(&p_dm_odm->fast_ant_training_workitem);
@ -4008,20 +3556,6 @@ odm_ant_div_init(
return; return;
} }
/* --- */ /* --- */
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
if (p_dm_fat_table->ant_div_2g_5g == ODM_ANTDIV_2G) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[2G AntDiv Init]: Only Support 2G Antenna Diversity Function\n"));
if (!(p_dm_odm->support_ic_type & ODM_ANTDIV_2G_SUPPORT_IC))
return;
} else if (p_dm_fat_table->ant_div_2g_5g == ODM_ANTDIV_5G) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[5G AntDiv Init]: Only Support 5G Antenna Diversity Function\n"));
if (!(p_dm_odm->support_ic_type & ODM_ANTDIV_5G_SUPPORT_IC))
return;
} else if (p_dm_fat_table->ant_div_2g_5g == (ODM_ANTDIV_2G | ODM_ANTDIV_5G))
ODM_RT_TRACE(p_dm_odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("[2G & 5G AntDiv Init]:Support Both 2G & 5G Antenna Diversity Function\n"));
#endif
/* --- */
/* 2 [--General---] */ /* 2 [--General---] */
p_dm_odm->antdiv_period = 0; p_dm_odm->antdiv_period = 0;
@ -4030,19 +3564,6 @@ odm_ant_div_init(
p_dm_fat_table->ant_div_on_off = 0xff; p_dm_fat_table->ant_div_on_off = 0xff;
/* 3 - AP - */ /* 3 - AP - */
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
#if (BEAMFORMING_SUPPORT == 1)
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
odm_bdc_init(p_dm_odm);
#endif
#endif
/* 3 - WIN - */
#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)
p_dm_swat_table->ant_5g = MAIN_ANT;
p_dm_swat_table->ant_2g = MAIN_ANT;
#endif
/* 2 [---Set MAIN_ANT as default antenna if Auto-ant enable---] */ /* 2 [---Set MAIN_ANT as default antenna if Auto-ant enable---] */
odm_ant_div_on_off(p_dm_odm, ANTDIV_OFF); odm_ant_div_on_off(p_dm_odm, ANTDIV_OFF);
@ -5116,16 +4637,28 @@ odm_ant_div_timers(
struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void;
if (state == INIT_ANTDIV_TIMMER) { if (state == INIT_ANTDIV_TIMMER) {
#ifdef CONFIG_S0S1_SW_ANTENNA_DIVERSITY #ifdef CONFIG_S0S1_SW_ANTENNA_DIVERSITY
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
odm_initialize_timer(p_dm_odm, &(p_dm_odm->dm_swat_table.phydm_sw_antenna_switch_timer), odm_initialize_timer(p_dm_odm, &(p_dm_odm->dm_swat_table.phydm_sw_antenna_switch_timer),
(void *)odm_sw_antdiv_callback, NULL, "phydm_sw_antenna_switch_timer"); (void *)odm_sw_antdiv_callback, NULL, "phydm_sw_antenna_switch_timer");
#else
timer_setup(&p_dm_odm->dm_swat_table.phydm_sw_antenna_switch_timer, odm_sw_antdiv_callback, 0);
#endif
#elif (defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY)) || (defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY)) #elif (defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY)) || (defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY))
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
odm_initialize_timer(p_dm_odm, &p_dm_odm->fast_ant_training_timer, odm_initialize_timer(p_dm_odm, &p_dm_odm->fast_ant_training_timer,
(void *)odm_fast_ant_training_callback, NULL, "fast_ant_training_timer"); (void *)odm_fast_ant_training_callback, NULL, "fast_ant_training_timer");
#else
timer_setup(&p_dm_odm->fast_ant_training_timer, odm_fast_ant_training_callback, 0);
#endif
#endif #endif
#ifdef ODM_EVM_ENHANCE_ANTDIV #ifdef ODM_EVM_ENHANCE_ANTDIV
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
odm_initialize_timer(p_dm_odm, &p_dm_odm->evm_fast_ant_training_timer, odm_initialize_timer(p_dm_odm, &p_dm_odm->evm_fast_ant_training_timer,
(void *)odm_evm_fast_ant_training_callback, NULL, "evm_fast_ant_training_timer"); (void *)odm_evm_fast_ant_training_callback, NULL, "evm_fast_ant_training_timer");
#else
timer_setup(&p_dm_odm->evm_fast_ant_training_timer, odm_evm_fast_ant_training_callback, 0);
#endif
#endif #endif
} else if (state == CANCEL_ANTDIV_TIMMER) { } else if (state == CANCEL_ANTDIV_TIMMER) {
#ifdef CONFIG_S0S1_SW_ANTENNA_DIVERSITY #ifdef CONFIG_S0S1_SW_ANTENNA_DIVERSITY

View file

@ -572,6 +572,7 @@ odm_set_timer(
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void void
odm_initialize_timer( odm_initialize_timer(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
@ -581,20 +582,10 @@ odm_initialize_timer(
const char *sz_id const char *sz_id
) )
{ {
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
init_timer(p_timer);
p_timer->function = call_back_func;
p_timer->data = (unsigned long)p_dm_odm;
/*mod_timer(p_timer, jiffies+RTL_MILISECONDS_TO_JIFFIES(10)); */
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
struct _ADAPTER *adapter = p_dm_odm->adapter; struct _ADAPTER *adapter = p_dm_odm->adapter;
_init_timer(p_timer, adapter->pnetdev, call_back_func, p_dm_odm); _init_timer(p_timer, adapter->pnetdev, call_back_func, p_dm_odm);
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
struct _ADAPTER *adapter = p_dm_odm->adapter;
PlatformInitializeTimer(adapter, p_timer, call_back_func, p_context, sz_id);
#endif
} }
#endif
void void
odm_cancel_timer( odm_cancel_timer(

View file

@ -373,7 +373,11 @@ struct led_priv {
(adapter)->ledpriv.SwLedOff((adapter), (pLed)); \ (adapter)->ledpriv.SwLedOff((adapter), (pLed)); \
} while (0) } while (0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void BlinkTimerCallback(void *data); void BlinkTimerCallback(void *data);
#else
void BlinkTimerCallback(struct timer_list *t);
#endif
void BlinkWorkItemCallback(_workitem *work); void BlinkWorkItemCallback(_workitem *work);
void ResetLedStatus(PLED_DATA pLed); void ResetLedStatus(PLED_DATA pLed);

View file

@ -83,6 +83,6 @@ void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_l
int rtw_ht_operation_update(_adapter *padapter); int rtw_ht_operation_update(_adapter *padapter);
#ifdef CONFIG_SWTIMER_BASED_TXBCN #ifdef CONFIG_SWTIMER_BASED_TXBCN
void tx_beacon_handlder(struct dvobj_priv *pdvobj); void tx_beacon_handler(struct dvobj_priv *pdvobj);
void tx_beacon_timer_handlder(struct dvobj_priv *pdvobj); void tx_beacon_timer_handler(struct dvobj_priv *pdvobj);
#endif #endif

View file

@ -1074,7 +1074,11 @@ extern u8 rtw_ps_cmd(_adapter *padapter);
u8 rtw_chk_hi_queue_cmd(_adapter *padapter); u8 rtw_chk_hi_queue_cmd(_adapter *padapter);
#ifdef CONFIG_DFS_MASTER #ifdef CONFIG_DFS_MASTER
u8 rtw_dfs_master_cmd(_adapter *adapter, bool enqueue); u8 rtw_dfs_master_cmd(_adapter *adapter, bool enqueue);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void rtw_dfs_master_timer_hdl(RTW_TIMER_HDL_ARGS); void rtw_dfs_master_timer_hdl(RTW_TIMER_HDL_ARGS);
#else
void rtw_dfs_master_timer_hdl(struct timer_list *t);
#endif
void rtw_dfs_master_enable(_adapter *adapter, u8 ch, u8 bw, u8 offset); void rtw_dfs_master_enable(_adapter *adapter, u8 ch, u8 bw, u8 offset);
void rtw_dfs_master_disable(_adapter *adapter, u8 ch, u8 bw, u8 offset, bool by_others); void rtw_dfs_master_disable(_adapter *adapter, u8 ch, u8 bw, u8 offset, bool by_others);
enum { enum {

View file

@ -190,8 +190,8 @@ u8 rtw_mi_buddy_dequeue_writeport(_adapter *padapter);
void rtw_mi_adapter_reset(_adapter *padapter); void rtw_mi_adapter_reset(_adapter *padapter);
void rtw_mi_buddy_adapter_reset(_adapter *padapter); void rtw_mi_buddy_adapter_reset(_adapter *padapter);
u8 rtw_mi_dynamic_check_timer_handlder(_adapter *padapter); u8 rtw_mi_dynamic_check_timer_handler(_adapter *padapter);
u8 rtw_mi_buddy_dynamic_check_timer_handlder(_adapter *padapter); u8 rtw_mi_buddy_dynamic_check_timer_handler(_adapter *padapter);
u8 rtw_mi_dev_unload(_adapter *padapter); u8 rtw_mi_dev_unload(_adapter *padapter);
u8 rtw_mi_buddy_dev_unload(_adapter *padapter); u8 rtw_mi_buddy_dev_unload(_adapter *padapter);

View file

@ -903,8 +903,13 @@ void rtw_sta_timeout_event_callback(_adapter *adapter, u8 *pbuf);
void rtw_update_ft_stainfo(_adapter *padapter, WLAN_BSSID_EX *pnetwork); void rtw_update_ft_stainfo(_adapter *padapter, WLAN_BSSID_EX *pnetwork);
void rtw_ft_reassoc_event_callback(_adapter *padapter, u8 *pbuf); void rtw_ft_reassoc_event_callback(_adapter *padapter, u8 *pbuf);
#endif #endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
extern void rtw_join_timeout_handler(RTW_TIMER_HDL_ARGS); extern void rtw_join_timeout_handler(RTW_TIMER_HDL_ARGS);
extern void _rtw_scan_timeout_handler(RTW_TIMER_HDL_ARGS); extern void _rtw_scan_timeout_handler(RTW_TIMER_HDL_ARGS);
#else
void rtw_join_timeout_handler(struct timer_list *t);
void _rtw_scan_timeout_handler(struct timer_list *t);
#endif
thread_return event_thread(thread_context context); thread_return event_thread(thread_context context);
@ -1055,9 +1060,13 @@ extern void rtw_get_encrypt_decrypt_from_registrypriv(_adapter *adapter);
extern void _rtw_join_timeout_handler(_adapter *adapter); extern void _rtw_join_timeout_handler(_adapter *adapter);
extern void rtw_scan_timeout_handler(_adapter *adapter); extern void rtw_scan_timeout_handler(_adapter *adapter);
extern void _dynamic_check_timer_handlder(void *FunctionContext); #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
extern void rtw_dynamic_check_timer_handlder(_adapter *adapter); void _dynamic_check_timer_handler (void *FunctionContext);
extern void rtw_iface_dynamic_check_timer_handlder(_adapter *adapter); #else
void _dynamic_check_timer_handler(struct timer_list *t);
#endif
extern void rtw_dynamic_check_timer_handler(_adapter *adapter);
extern void rtw_iface_dynamic_check_timer_handler(_adapter *adapter);
#ifdef CONFIG_SET_SCAN_DENY_TIMER #ifdef CONFIG_SET_SCAN_DENY_TIMER
bool rtw_is_scan_deny(_adapter *adapter); bool rtw_is_scan_deny(_adapter *adapter);

View file

@ -308,6 +308,7 @@ struct aoac_report {
}; };
struct pwrctrl_priv { struct pwrctrl_priv {
_adapter *padapter;
_pwrlock lock; _pwrlock lock;
_pwrlock check_32k_lock; _pwrlock check_32k_lock;
volatile u8 rpwm; /* requested power state for fw */ volatile u8 rpwm; /* requested power state for fw */

View file

@ -3905,8 +3905,7 @@ static struct net_device *
#else #else
static int static int
#endif #endif
cfg80211_rtw_add_virtual_intf( cfg80211_rtw_add_virtual_intf(struct wiphy *wiphy,
struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
const char *name, const char *name,
#else #else

View file

@ -58,9 +58,17 @@ void Linkdown_workitem_callback(struct work_struct *work)
/* /*
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void sitesurvey_ctrl_handler(void *FunctionContext) void sitesurvey_ctrl_handler(void *FunctionContext)
#else
void sitesurvey_ctrl_handler(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *)FunctionContext; _adapter *adapter = (_adapter *)FunctionContext;
#else
_adapter *adapter = from_timer(adapter, t, sitesurveyctrl.sitesurvey_ctrl_timer);
#endif
_sitesurvey_ctrl_handler(adapter); _sitesurvey_ctrl_handler(adapter);
@ -68,63 +76,110 @@ void sitesurvey_ctrl_handler(void *FunctionContext)
} }
*/ */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void rtw_join_timeout_handler(void *FunctionContext) void rtw_join_timeout_handler(void *FunctionContext)
#else
void rtw_join_timeout_handler(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *)FunctionContext; _adapter *adapter = (_adapter *)FunctionContext;
#else
_adapter *adapter = from_timer(adapter, t, mlmepriv.assoc_timer);
#endif
_rtw_join_timeout_handler(adapter); _rtw_join_timeout_handler(adapter);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _rtw_scan_timeout_handler(void *FunctionContext) void _rtw_scan_timeout_handler(void *FunctionContext)
#else
void _rtw_scan_timeout_handler(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *)FunctionContext; _adapter *adapter = (_adapter *)FunctionContext;
#else
_adapter *adapter = from_timer(adapter, t, mlmepriv.scan_to_timer);
#endif
rtw_scan_timeout_handler(adapter); rtw_scan_timeout_handler(adapter);
} }
void _dynamic_check_timer_handlder(void *FunctionContext) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _dynamic_check_timer_handler (void *FunctionContext)
#else
void _dynamic_check_timer_handler(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct dvobj_priv *pdvobj = (struct dvobj_priv *)FunctionContext; struct dvobj_priv *pdvobj = (struct dvobj_priv *)FunctionContext;
#else
struct dvobj_priv *pdvobj = from_timer(pdvobj, t, dynamic_chk_timer);
#endif
_adapter *adapter = dvobj_get_primary_adapter(pdvobj); _adapter *adapter = dvobj_get_primary_adapter(pdvobj);
#if (MP_DRIVER == 1) #if (MP_DRIVER == 1)
if (adapter->registrypriv.mp_mode == 1 && adapter->mppriv.mp_dm == 0) { /* for MP ODM dynamic Tx power tracking */ if (adapter->registrypriv.mp_mode == 1 && adapter->mppriv.mp_dm == 0) { /* for MP ODM dynamic Tx power tracking */
/* RTW_INFO("_dynamic_check_timer_handlder mp_dm =0 return\n"); */ /* RTW_INFO("_dynamic_check_timer_handler mp_dm =0 return\n"); */
_set_timer(&pdvobj->dynamic_chk_timer, 2000); _set_timer(&pdvobj->dynamic_chk_timer, 2000);
return; return;
} }
#endif #endif
rtw_dynamic_check_timer_handlder(adapter); rtw_dynamic_check_timer_handler(adapter);
_set_timer(&pdvobj->dynamic_chk_timer, 2000); _set_timer(&pdvobj->dynamic_chk_timer, 2000);
} }
#ifdef CONFIG_SET_SCAN_DENY_TIMER #ifdef CONFIG_SET_SCAN_DENY_TIMER
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _rtw_set_scan_deny_timer_hdl(void *FunctionContext) void _rtw_set_scan_deny_timer_hdl(void *FunctionContext)
#else
void _rtw_set_scan_deny_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *)FunctionContext; _adapter *adapter = (_adapter *)FunctionContext;
#else
_adapter *adapter = from_timer(adapter, t, mlmepriv.set_scan_deny_timer);
#endif
rtw_set_scan_deny_timer_hdl(adapter); rtw_set_scan_deny_timer_hdl(adapter);
} }
#endif #endif
void rtw_init_mlme_timer(_adapter *padapter) void rtw_init_mlme_timer(_adapter *padapter)
{ {
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
_init_timer(&(pmlmepriv->assoc_timer), padapter->pnetdev, rtw_join_timeout_handler, padapter); #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
/* _init_timer(&(pmlmepriv->sitesurveyctrl.sitesurvey_ctrl_timer), padapter->pnetdev, sitesurvey_ctrl_handler, padapter); */ _init_timer(&pmlmepriv->assoc_timer, padapter->pnetdev, rtw_join_timeout_handler, padapter);
_init_timer(&(pmlmepriv->scan_to_timer), padapter->pnetdev, _rtw_scan_timeout_handler, padapter); /* _init_timer(&pmlmepriv->sitesurveyctrl.sitesurvey_ctrl_timer, padapter->pnetdev, sitesurvey_ctrl_handler, padapter); */
_init_timer(&pmlmepriv->scan_to_timer, padapter->pnetdev, _rtw_scan_timeout_handler, padapter);
#ifdef CONFIG_DFS_MASTER #ifdef CONFIG_DFS_MASTER
_init_timer(&(pmlmepriv->dfs_master_timer), padapter->pnetdev, rtw_dfs_master_timer_hdl, padapter); _init_timer(&pmlmepriv->dfs_master_timer, padapter->pnetdev, rtw_dfs_master_timer_hdl, padapter);
#endif #endif
#ifdef CONFIG_SET_SCAN_DENY_TIMER #ifdef CONFIG_SET_SCAN_DENY_TIMER
_init_timer(&(pmlmepriv->set_scan_deny_timer), padapter->pnetdev, _rtw_set_scan_deny_timer_hdl, padapter); _init_timer(&pmlmepriv->set_scan_deny_timer, padapter->pnetdev, _rtw_set_scan_deny_timer_hdl, padapter);
#endif
#else
timer_setup(&pmlmepriv->assoc_timer, rtw_join_timeout_handler, 0);
/* timer_setup(&pmlmepriv->sitesurveyctrl.sitesurvey_ctrl_timer, sitesurvey_ctrl_handler, 0); */
timer_setup(&pmlmepriv->scan_to_timer, _rtw_scan_timeout_handler, 0);
#ifdef CONFIG_DFS_MASTER
timer_setup(&pmlmepriv->dfs_master_timer, rtw_dfs_master_timer_hdl, 0);
#endif #endif
#ifdef CONFIG_SET_SCAN_DENY_TIMER
timer_setup(&pmlmepriv->set_scan_deny_timer, _rtw_set_scan_deny_timer_hdl, 0);
#endif
#endif
#ifdef RTK_DMP_PLATFORM #ifdef RTK_DMP_PLATFORM
_init_workitem(&(pmlmepriv->Linkup_workitem), Linkup_workitem_callback, padapter); _init_workitem(&(pmlmepriv->Linkup_workitem), Linkup_workitem_callback, padapter);
_init_workitem(&(pmlmepriv->Linkdown_workitem), Linkdown_workitem_callback, padapter); _init_workitem(&(pmlmepriv->Linkdown_workitem), Linkdown_workitem_callback, padapter);
@ -300,53 +355,108 @@ void rtw_report_sec_ie(_adapter *adapter, u8 authmode, u8 *sec_ie)
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _survey_timer_hdl(void *FunctionContext) void _survey_timer_hdl(void *FunctionContext)
#else
void _survey_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *padapter = (_adapter *)FunctionContext; _adapter *padapter = (_adapter *)FunctionContext;
#else
_adapter *padapter = from_timer(padapter, t, mlmeextpriv.survey_timer);
#endif
survey_timer_hdl(padapter); survey_timer_hdl(padapter);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _link_timer_hdl(void *FunctionContext) void _link_timer_hdl(void *FunctionContext)
#else
void _link_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *padapter = (_adapter *)FunctionContext; _adapter *padapter = (_adapter *)FunctionContext;
#else
_adapter *padapter = from_timer(padapter, t, mlmeextpriv.link_timer);
#endif
link_timer_hdl(padapter); link_timer_hdl(padapter);
} }
#ifdef CONFIG_RTW_80211R #ifdef CONFIG_RTW_80211R
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _ft_link_timer_hdl(void *FunctionContext) void _ft_link_timer_hdl(void *FunctionContext)
#else
void _ft_link_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *padapter = (_adapter *)FunctionContext; _adapter *padapter = (_adapter *)FunctionContext;
#else
_adapter *padapter = from_timer(ipadapter, t, ft_link_timer);
#endif
ft_link_timer_hdl(padapter); ft_link_timer_hdl(padapter);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _ft_roam_timer_hdl(void *FunctionContext) void _ft_roam_timer_hdl(void *FunctionContext)
#else
void _ft_roam_timer_hdl(struct timer_list *t);
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *padapter = (_adapter *)FunctionContext; _adapter *padapter = (_adapter *)FunctionContext;
#else
_adapter *padapter = from_timer(adapter, t, ft_roam_timer);
#endif
ft_roam_timer_hdl(padapter); ft_roam_timer_hdl(padapter);
} }
#endif #endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _addba_timer_hdl(void *FunctionContext) void _addba_timer_hdl(void *FunctionContext)
#else
void _addba_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct sta_info *psta = (struct sta_info *)FunctionContext; struct sta_info *psta = (struct sta_info *)FunctionContext;
#else
struct sta_info *psta = from_timer(psta, t, addba_retry_timer);
#endif
addba_timer_hdl(psta); addba_timer_hdl(psta);
} }
#ifdef CONFIG_IEEE80211W #ifdef CONFIG_IEEE80211W
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _sa_query_timer_hdl(void *FunctionContext) void _sa_query_timer_hdl(void *FunctionContext)
#else
void _sa_query_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct sta_info *psta = (struct sta_info *)FunctionContext; struct sta_info *psta = (struct sta_info *)FunctionContext;
#else
struct sta_info *psta = from_timer(psta, t, dot11w_expire_timer);
#endif
sa_query_timer_hdl(psta); sa_query_timer_hdl(psta);
} }
void init_dot11w_expire_timer(_adapter *padapter, struct sta_info *psta) void init_dot11w_expire_timer(_adapter *padapter, struct sta_info *psta)
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&psta->dot11w_expire_timer, padapter->pnetdev, _sa_query_timer_hdl, psta); _init_timer(&psta->dot11w_expire_timer, padapter->pnetdev, _sa_query_timer_hdl, psta);
#else
timer_setip(&psta->dot11w_expire_timer, _sa_query_timer_hdl, 0);
#endif
} }
#endif /* CONFIG_IEEE80211W */ #endif /* CONFIG_IEEE80211W */
@ -354,20 +464,42 @@ void init_dot11w_expire_timer(_adapter *padapter, struct sta_info *psta)
void init_addba_retry_timer(_adapter *padapter, struct sta_info *psta) void init_addba_retry_timer(_adapter *padapter, struct sta_info *psta)
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&psta->addba_retry_timer, padapter->pnetdev, _addba_timer_hdl, psta); _init_timer(&psta->addba_retry_timer, padapter->pnetdev, _addba_timer_hdl, psta);
#else
timer_setup(&psta->addba_retry_timer, _addba_timer_hdl, 0);
#endif
} }
/* /*
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _reauth_timer_hdl(void *FunctionContext) void _reauth_timer_hdl(void *FunctionContext)
#else
void _reauth_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *padapter = (_adapter *)FunctionContext; _adapter *padapter = (_adapter *)FunctionContext;
#else
_adapter *padapter = from_timer(adapter, t, reauth_timer);
#endif
reauth_timer_hdl(padapter); reauth_timer_hdl(padapter);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _reassoc_timer_hdl(void *FunctionContext) void _reassoc_timer_hdl(void *FunctionContext)
#else
void _reassoc_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *padapter = (_adapter *)FunctionContext; _adapter *padapter = (_adapter *)FunctionContext;
reassoc_timer_hdl(padapter); #else
_adapter *padapter = from_timer(adapter, t, reassoc_timer);
#endif
` reassoc_timer_hdl(padapter);
} }
*/ */
@ -375,6 +507,7 @@ void init_mlme_ext_timer(_adapter *padapter)
{ {
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&pmlmeext->survey_timer, padapter->pnetdev, _survey_timer_hdl, padapter); _init_timer(&pmlmeext->survey_timer, padapter->pnetdev, _survey_timer_hdl, padapter);
_init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter); _init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter);
#ifdef CONFIG_RTW_80211R #ifdef CONFIG_RTW_80211R
@ -386,6 +519,19 @@ void init_mlme_ext_timer(_adapter *padapter)
/* _init_timer(&pmlmeext->reauth_timer, padapter->pnetdev, _reauth_timer_hdl, padapter); */ /* _init_timer(&pmlmeext->reauth_timer, padapter->pnetdev, _reauth_timer_hdl, padapter); */
/* _init_timer(&pmlmeext->reassoc_timer, padapter->pnetdev, _reassoc_timer_hdl, padapter); */ /* _init_timer(&pmlmeext->reassoc_timer, padapter->pnetdev, _reassoc_timer_hdl, padapter); */
#else
timer_setup(&pmlmeext->survey_timer, _survey_timer_hdl, 0);
timer_setup(&pmlmeext->link_timer, _link_timer_hdl, 0);
#ifdef CONFIG_RTW_80211R
timer_setup(&pmlmeext->ft_link_timer, _ft_link_timer_hdl, 0);
timer_setup(&pmlmeext->ft_roam_timer, _ft_roam_timer_hdl, 0);
#endif
/* timer_setup(&pmlmeext->ADDBA_timer, _addba_timer_hdl, 0); */
/* timer_setup(&pmlmeext->reauth_timer, _reauth_timer_hdl, 0); */
/* timer_setup(&pmlmeext->reassoc_timer, _reassoc_timer_hdl, 0); */
#endif
} }
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE

View file

@ -84,7 +84,7 @@ module_param(rtw_usb_rxagg_mode, int, 0644);
#ifdef RTW_LOG_LEVEL #ifdef RTW_LOG_LEVEL
uint rtw_drv_log_level = (uint)RTW_LOG_LEVEL; /* from Makefile */ uint rtw_drv_log_level = (uint)RTW_LOG_LEVEL; /* from Makefile */
#else #else
uint rtw_drv_log_level = _DRV_ERR_; uint rtw_drv_log_level = _DRV_INFO_;
#endif #endif
module_param(rtw_drv_log_level, uint, 0644); module_param(rtw_drv_log_level, uint, 0644);
MODULE_PARM_DESC(rtw_drv_log_level, "set log level when insert driver module, default log level is _DRV_INFO_ = 4"); MODULE_PARM_DESC(rtw_drv_log_level, "set log level when insert driver module, default log level is _DRV_INFO_ = 4");
@ -1015,20 +1015,6 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *addr)
_rtw_memcpy(adapter_mac_addr(padapter), sa->sa_data, ETH_ALEN); /* set mac addr to adapter */ _rtw_memcpy(adapter_mac_addr(padapter), sa->sa_data, ETH_ALEN); /* set mac addr to adapter */
_rtw_memcpy(pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /* set mac addr to net_device */ _rtw_memcpy(pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /* set mac addr to net_device */
#if 0
if (rtw_is_hw_init_completed(padapter)) {
rtw_ps_deny(padapter, PS_DENY_IOCTL);
LeaveAllPowerSaveModeDirect(padapter); /* leave PS mode for guaranteeing to access hw register successfully */
#ifdef CONFIG_MI_WITH_MBSSID_CAM
rtw_hal_change_macaddr_mbid(padapter, sa->sa_data);
#else
rtw_hal_set_hwreg(padapter, HW_VAR_MAC_ADDR, sa->sa_data); /* set mac addr to mac register */
#endif
rtw_ps_deny_cancel(padapter, PS_DENY_IOCTL);
}
#else
rtw_ps_deny(padapter, PS_DENY_IOCTL); rtw_ps_deny(padapter, PS_DENY_IOCTL);
LeaveAllPowerSaveModeDirect(padapter); /* leave PS mode for guaranteeing to access hw register successfully */ LeaveAllPowerSaveModeDirect(padapter); /* leave PS mode for guaranteeing to access hw register successfully */
#ifdef CONFIG_MI_WITH_MBSSID_CAM #ifdef CONFIG_MI_WITH_MBSSID_CAM
@ -1037,7 +1023,6 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *addr)
rtw_hal_set_hwreg(padapter, HW_VAR_MAC_ADDR, sa->sa_data); /* set mac addr to mac register */ rtw_hal_set_hwreg(padapter, HW_VAR_MAC_ADDR, sa->sa_data); /* set mac addr to mac register */
#endif #endif
rtw_ps_deny_cancel(padapter, PS_DENY_IOCTL); rtw_ps_deny_cancel(padapter, PS_DENY_IOCTL);
#endif
RTW_INFO(FUNC_ADPT_FMT": Set Mac Addr to "MAC_FMT" Successfully\n" RTW_INFO(FUNC_ADPT_FMT": Set Mac Addr to "MAC_FMT" Successfully\n"
, FUNC_ADPT_ARG(padapter), MAC_ARG(sa->sa_data)); , FUNC_ADPT_ARG(padapter), MAC_ARG(sa->sa_data));
@ -1100,11 +1085,12 @@ unsigned int rtw_classify8021d(struct sk_buff *skb)
static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
, void *accel_priv ,struct net_device *sb_dev
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) ,select_queue_fallback_t fallback
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
,void *unused
,select_queue_fallback_t fallback ,select_queue_fallback_t fallback
#endif
#endif #endif
) )
{ {
@ -1786,17 +1772,26 @@ u8 rtw_init_default_value(_adapter *padapter)
} }
#ifdef CONFIG_SWTIMER_BASED_TXBCN #ifdef CONFIG_SWTIMER_BASED_TXBCN
void _tx_beacon_timer_handlder(void *FunctionContext) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _tx_beacon_timer_handler(void *FunctionContext)
#else
void _tx_beacon_timer_handler(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct dvobj_priv *pdvobj = (struct dvobj_priv *)FunctionContext; struct dvobj_priv *pdvobj = (struct dvobj_priv *)FunctionContext;
#else
struct dvobj_priv *pdvobj = from_timer(pdvobj, t, txbcn_timer);
#endif
tx_beacon_timer_handlder(pdvobj); tx_beacon_timer_handler(pdvobj);
} }
#endif #endif
struct dvobj_priv *devobj_init(void) struct dvobj_priv *devobj_init(void)
{ {
struct dvobj_priv *pdvobj = NULL; struct dvobj_priv *pdvobj = NULL;
_adapter *adapter;
pdvobj = (struct dvobj_priv *)rtw_zmalloc(sizeof(*pdvobj)); pdvobj = (struct dvobj_priv *)rtw_zmalloc(sizeof(*pdvobj));
if (pdvobj == NULL) if (pdvobj == NULL)
@ -1835,11 +1830,19 @@ struct dvobj_priv *devobj_init(void)
pdvobj->inter_bcn_space = DEFAULT_BCN_INTERVAL; /* default value is equal to the default beacon_interval (100ms) */ pdvobj->inter_bcn_space = DEFAULT_BCN_INTERVAL; /* default value is equal to the default beacon_interval (100ms) */
_rtw_init_queue(&pdvobj->ap_if_q); _rtw_init_queue(&pdvobj->ap_if_q);
#ifdef CONFIG_SWTIMER_BASED_TXBCN #ifdef CONFIG_SWTIMER_BASED_TXBCN
_init_timer(&(pdvobj->txbcn_timer), NULL, _tx_beacon_timer_handlder, pdvobj); #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&pdvobj->txbcn_timer, NULL, _tx_beacon_timer_handler, pdvobj);
#else
timer_setup(&pdvobj->txbcn_timer, _tx_beacon_timer_handler, 0);
#endif
#endif #endif
#endif #endif
_init_timer(&(pdvobj->dynamic_chk_timer), NULL, _dynamic_check_timer_handlder, pdvobj); #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&pdvobj->dynamic_chk_timer, NULL, _dynamic_check_timer_handler, pdvobj);
#else
timer_setup(&pdvobj->dynamic_chk_timer, _dynamic_check_timer_handler, 0);
#endif
#ifdef CONFIG_MCC_MODE #ifdef CONFIG_MCC_MODE
_rtw_mutex_init(&(pdvobj->mcc_objpriv.mcc_mutex)); _rtw_mutex_init(&(pdvobj->mcc_objpriv.mcc_mutex));
@ -1983,13 +1986,9 @@ u8 rtw_reset_drv_sw(_adapter *padapter)
u8 rtw_init_drv_sw(_adapter *padapter) u8 rtw_init_drv_sw(_adapter *padapter)
{ {
u8 ret8 = _SUCCESS; u8 ret8 = _SUCCESS;
_rtw_init_listhead(&padapter->list); _rtw_init_listhead(&padapter->list);
ret8 = rtw_init_default_value(padapter); ret8 = rtw_init_default_value(padapter);
if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) { if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) {
@ -3495,7 +3494,7 @@ int rtw_gw_addr_query(_adapter *padapter)
} }
#endif #endif
void rtw_dev_unload(PADAPTER padapter) void rtw_dev_unload(_adapter *padapter)
{ {
struct net_device *pnetdev = (struct net_device *)padapter->pnetdev; struct net_device *pnetdev = (struct net_device *)padapter->pnetdev;
struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter); struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter);
@ -4217,7 +4216,6 @@ int rtw_resume_process_ap_wow(_adapter *padapter)
rtw_mi_start_drv_threads(padapter); rtw_mi_start_drv_threads(padapter);
#if 1
if (rtw_mi_check_status(padapter, MI_LINKED)) { if (rtw_mi_check_status(padapter, MI_LINKED)) {
ch = rtw_mi_get_union_chan(padapter); ch = rtw_mi_get_union_chan(padapter);
bw = rtw_mi_get_union_bw(padapter); bw = rtw_mi_get_union_bw(padapter);
@ -4225,13 +4223,6 @@ int rtw_resume_process_ap_wow(_adapter *padapter)
RTW_INFO(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", FUNC_ADPT_ARG(padapter), ch, bw, offset); RTW_INFO(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", FUNC_ADPT_ARG(padapter), ch, bw, offset);
set_channel_bwmode(padapter, ch, offset, bw); set_channel_bwmode(padapter, ch, offset, bw);
} }
#else
if (rtw_mi_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) {
RTW_INFO(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", FUNC_ADPT_ARG(padapter), ch, bw, offset);
set_channel_bwmode(padapter, ch, offset, bw);
rtw_mi_update_union_chan_inf(padapter, ch, offset, bw);
}
#endif
/*FOR ONE AP - TODO :Multi-AP*/ /*FOR ONE AP - TODO :Multi-AP*/
{ {

View file

@ -869,10 +869,18 @@ void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf)
#endif #endif
} }
void _rtw_reordering_ctrl_timeout_handler(void *FunctionContext); #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _rtw_reordering_ctrl_timeout_handler(void *FunctionContext) void _rtw_reordering_ctrl_timeout_handler(void *FunctionContext)
#else
void _rtw_reordering_ctrl_timeout_handler(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct recv_reorder_ctrl *preorder_ctrl = (struct recv_reorder_ctrl *)FunctionContext; struct recv_reorder_ctrl *preorder_ctrl = (struct recv_reorder_ctrl *)FunctionContext;
#else
struct recv_reorder_ctrl *preorder_ctrl = from_timer(preorder_ctrl, t, reordering_ctrl_timer);
#endif
rtw_reordering_ctrl_timeout_handler(preorder_ctrl); rtw_reordering_ctrl_timeout_handler(preorder_ctrl);
} }
@ -880,6 +888,10 @@ void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
{ {
_adapter *padapter = preorder_ctrl->padapter; _adapter *padapter = preorder_ctrl->padapter;
_init_timer(&(preorder_ctrl->reordering_ctrl_timer), padapter->pnetdev, _rtw_reordering_ctrl_timeout_handler, preorder_ctrl); #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&preorder_ctrl->reordering_ctrl_timer, padapter->pnetdev, _rtw_reordering_ctrl_timeout_handler, preorder_ctrl);
#else
timer_setup(&preorder_ctrl->reordering_ctrl_timer, _rtw_reordering_ctrl_timeout_handler, 0);
#endif
} }

View file

@ -463,68 +463,18 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf, const s
pdvobjpriv->RtNumInPipes = 0; pdvobjpriv->RtNumInPipes = 0;
pdvobjpriv->RtNumOutPipes = 0; pdvobjpriv->RtNumOutPipes = 0;
/* padapter->EepromAddressSize = 6; */
/* pdvobjpriv->nr_endpoint = 6; */
pdev_desc = &pusbd->descriptor; pdev_desc = &pusbd->descriptor;
#if 0
RTW_INFO("\n8712_usb_device_descriptor:\n");
RTW_INFO("bLength=%x\n", pdev_desc->bLength);
RTW_INFO("bDescriptorType=%x\n", pdev_desc->bDescriptorType);
RTW_INFO("bcdUSB=%x\n", pdev_desc->bcdUSB);
RTW_INFO("bDeviceClass=%x\n", pdev_desc->bDeviceClass);
RTW_INFO("bDeviceSubClass=%x\n", pdev_desc->bDeviceSubClass);
RTW_INFO("bDeviceProtocol=%x\n", pdev_desc->bDeviceProtocol);
RTW_INFO("bMaxPacketSize0=%x\n", pdev_desc->bMaxPacketSize0);
RTW_INFO("idVendor=%x\n", pdev_desc->idVendor);
RTW_INFO("idProduct=%x\n", pdev_desc->idProduct);
RTW_INFO("bcdDevice=%x\n", pdev_desc->bcdDevice);
RTW_INFO("iManufacturer=%x\n", pdev_desc->iManufacturer);
RTW_INFO("iProduct=%x\n", pdev_desc->iProduct);
RTW_INFO("iSerialNumber=%x\n", pdev_desc->iSerialNumber);
RTW_INFO("bNumConfigurations=%x\n", pdev_desc->bNumConfigurations);
#endif
phost_conf = pusbd->actconfig; phost_conf = pusbd->actconfig;
pconf_desc = &phost_conf->desc; pconf_desc = &phost_conf->desc;
#if 0
RTW_INFO("\n8712_usb_configuration_descriptor:\n");
RTW_INFO("bLength=%x\n", pconf_desc->bLength);
RTW_INFO("bDescriptorType=%x\n", pconf_desc->bDescriptorType);
RTW_INFO("wTotalLength=%x\n", pconf_desc->wTotalLength);
RTW_INFO("bNumInterfaces=%x\n", pconf_desc->bNumInterfaces);
RTW_INFO("bConfigurationValue=%x\n", pconf_desc->bConfigurationValue);
RTW_INFO("iConfiguration=%x\n", pconf_desc->iConfiguration);
RTW_INFO("bmAttributes=%x\n", pconf_desc->bmAttributes);
RTW_INFO("bMaxPower=%x\n", pconf_desc->bMaxPower);
#endif
/* RTW_INFO("\n***** num of altsetting = (%d) *****\n", pusb_interface->num_altsetting); */
phost_iface = &usb_intf->altsetting[0]; phost_iface = &usb_intf->altsetting[0];
piface_desc = &phost_iface->desc; piface_desc = &phost_iface->desc;
#if 0
RTW_INFO("\n8712_usb_interface_descriptor:\n");
RTW_INFO("bLength=%x\n", piface_desc->bLength);
RTW_INFO("bDescriptorType=%x\n", piface_desc->bDescriptorType);
RTW_INFO("bInterfaceNumber=%x\n", piface_desc->bInterfaceNumber);
RTW_INFO("bAlternateSetting=%x\n", piface_desc->bAlternateSetting);
RTW_INFO("bNumEndpoints=%x\n", piface_desc->bNumEndpoints);
RTW_INFO("bInterfaceClass=%x\n", piface_desc->bInterfaceClass);
RTW_INFO("bInterfaceSubClass=%x\n", piface_desc->bInterfaceSubClass);
RTW_INFO("bInterfaceProtocol=%x\n", piface_desc->bInterfaceProtocol);
RTW_INFO("iInterface=%x\n", piface_desc->iInterface);
#endif
pdvobjpriv->NumInterfaces = pconf_desc->bNumInterfaces; pdvobjpriv->NumInterfaces = pconf_desc->bNumInterfaces;
pdvobjpriv->InterfaceNumber = piface_desc->bInterfaceNumber; pdvobjpriv->InterfaceNumber = piface_desc->bInterfaceNumber;
pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints; pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints;
/* RTW_INFO("\ndump usb_endpoint_descriptor:\n"); */
for (i = 0; i < pdvobjpriv->nr_endpoint; i++) { for (i = 0; i < pdvobjpriv->nr_endpoint; i++) {
phost_endp = phost_iface->endpoint + i; phost_endp = phost_iface->endpoint + i;
if (phost_endp) { if (phost_endp) {
@ -534,11 +484,8 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf, const s
RTW_INFO("bLength=%x\n", pendp_desc->bLength); RTW_INFO("bLength=%x\n", pendp_desc->bLength);
RTW_INFO("bDescriptorType=%x\n", pendp_desc->bDescriptorType); RTW_INFO("bDescriptorType=%x\n", pendp_desc->bDescriptorType);
RTW_INFO("bEndpointAddress=%x\n", pendp_desc->bEndpointAddress); RTW_INFO("bEndpointAddress=%x\n", pendp_desc->bEndpointAddress);
/* RTW_INFO("bmAttributes=%x\n",pendp_desc->bmAttributes); */
RTW_INFO("wMaxPacketSize=%d\n", le16_to_cpu(pendp_desc->wMaxPacketSize)); RTW_INFO("wMaxPacketSize=%d\n", le16_to_cpu(pendp_desc->wMaxPacketSize));
RTW_INFO("bInterval=%x\n", pendp_desc->bInterval); RTW_INFO("bInterval=%x\n", pendp_desc->bInterval);
/* RTW_INFO("bRefresh=%x\n",pendp_desc->bRefresh); */
/* RTW_INFO("bSynchAddress=%x\n",pendp_desc->bSynchAddress); */
if (RT_usb_endpoint_is_bulk_in(pendp_desc)) { if (RT_usb_endpoint_is_bulk_in(pendp_desc)) {
RTW_INFO("RT_usb_endpoint_is_bulk_in = %x\n", RT_usb_endpoint_num(pendp_desc)); RTW_INFO("RT_usb_endpoint_is_bulk_in = %x\n", RT_usb_endpoint_num(pendp_desc));

View file

@ -1066,13 +1066,6 @@ void rtw_list_insert_tail(_list *plist, _list *phead)
} }
void rtw_init_timer(struct timer_list *ptimer, void *padapter, void *pfunc)
{
_adapter *adapter = (_adapter *)padapter;
_init_timer(ptimer, adapter->pnetdev, pfunc, adapter);
}
/* /*
Caller must check if the list is empty before calling rtw_list_delete Caller must check if the list is empty before calling rtw_list_delete
@ -1980,7 +1973,11 @@ static int readFile(struct file *fp, char *buf, int len)
while (sum < len) { while (sum < len) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
rlen = kernel_read(fp, buf + sum, len - sum, &fp->f_pos);
#else
rlen = __vfs_read(fp, buf + sum, len - sum, &fp->f_pos); rlen = __vfs_read(fp, buf + sum, len - sum, &fp->f_pos);
#endif
#else #else
rlen = fp->f_op->read(fp, buf + sum, len - sum, &fp->f_pos); rlen = fp->f_op->read(fp, buf + sum, len - sum, &fp->f_pos);
#endif #endif