mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-28 23:23:40 +00:00
rtl8188eu: Fix checkpatch errors in os_dep/os_intfs.c
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
394828ff89
commit
a90ca697ca
2 changed files with 193 additions and 202 deletions
|
@ -52,6 +52,9 @@ void rtw_os_read_port(struct adapter *padapter, struct recv_buf *precvbuf);
|
|||
|
||||
void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl);
|
||||
int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb);
|
||||
int _netdev_open(struct net_device *pnetdev);
|
||||
int netdev_open(struct net_device *pnetdev);
|
||||
static int netdev_close(struct net_device *pnetdev);
|
||||
|
||||
|
||||
#endif //
|
||||
|
|
|
@ -39,20 +39,18 @@ MODULE_VERSION(DRIVERVERSION);
|
|||
/* module param defaults */
|
||||
static int rtw_chip_version = 0x00;
|
||||
static int rtw_rfintfs = HWPI;
|
||||
static int rtw_lbkmode = 0;//RTL8712_AIR_TRX;
|
||||
|
||||
|
||||
static int rtw_network_mode = Ndis802_11IBSS;//Ndis802_11Infrastructure;//infra, ad-hoc, auto
|
||||
static int rtw_channel = 1;//ad-hoc support requirement
|
||||
static int rtw_lbkmode;/* RTL8712_AIR_TRX; */
|
||||
static int rtw_network_mode = Ndis802_11IBSS;/* Ndis802_11Infrastructure; infra, ad-hoc, auto */
|
||||
static int rtw_channel = 1;/* ad-hoc support requirement */
|
||||
static int rtw_wireless_mode = WIRELESS_11BG_24N;
|
||||
static int rtw_vrtl_carrier_sense = AUTO_VCS;
|
||||
static int rtw_vcs_type = RTS_CTS;//*
|
||||
static int rtw_rts_thresh = 2347;//*
|
||||
static int rtw_frag_thresh = 2346;//*
|
||||
static int rtw_preamble = PREAMBLE_LONG;//long, short, auto
|
||||
static int rtw_scan_mode = 1;//active, passive
|
||||
static int rtw_vcs_type = RTS_CTS;/* */
|
||||
static int rtw_rts_thresh = 2347;/* */
|
||||
static int rtw_frag_thresh = 2346;/* */
|
||||
static int rtw_preamble = PREAMBLE_LONG;/* long, short, auto */
|
||||
static int rtw_scan_mode = 1;/* active, passive */
|
||||
static int rtw_adhoc_tx_pwr = 1;
|
||||
static int rtw_soft_ap = 0;
|
||||
static int rtw_soft_ap;
|
||||
static int rtw_power_mgnt = 1;
|
||||
static int rtw_ips_mode = IPS_NORMAL;
|
||||
|
||||
|
@ -68,57 +66,57 @@ static int rtw_short_retry_lmt = 7;
|
|||
static int rtw_busy_thresh = 40;
|
||||
static int rtw_ack_policy = NORMAL_ACK;
|
||||
|
||||
static int rtw_mp_mode = 0;
|
||||
static int rtw_mp_mode;
|
||||
|
||||
static int rtw_software_encrypt = 0;
|
||||
static int rtw_software_decrypt = 0;
|
||||
static int rtw_software_encrypt;
|
||||
static int rtw_software_decrypt;
|
||||
|
||||
static int rtw_acm_method = 0;// 0:By SW 1:By HW.
|
||||
static int rtw_acm_method;/* 0:By SW 1:By HW. */
|
||||
|
||||
static int rtw_wmm_enable = 1;// default is set to enable the wmm.
|
||||
static int rtw_uapsd_enable = 0;
|
||||
static int rtw_wmm_enable = 1;/* default is set to enable the wmm. */
|
||||
static int rtw_uapsd_enable;
|
||||
static int rtw_uapsd_max_sp = NO_LIMIT;
|
||||
static int rtw_uapsd_acbk_en = 0;
|
||||
static int rtw_uapsd_acbe_en = 0;
|
||||
static int rtw_uapsd_acvi_en = 0;
|
||||
static int rtw_uapsd_acvo_en = 0;
|
||||
static int rtw_uapsd_acbk_en;
|
||||
static int rtw_uapsd_acbe_en;
|
||||
static int rtw_uapsd_acvi_en;
|
||||
static int rtw_uapsd_acvo_en;
|
||||
|
||||
int rtw_ht_enable = 1;
|
||||
int rtw_cbw40_enable = 3; // 0 :diable, bit(0): enable 2.4g, bit(1): enable 5g
|
||||
int rtw_ampdu_enable = 1;//for enable tx_ampdu
|
||||
static int rtw_rx_stbc = 1;// 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ
|
||||
static int rtw_ampdu_amsdu = 0;// 0: disabled, 1:enabled, 2:auto
|
||||
int rtw_cbw40_enable = 3; /* 0 :diable, bit(0): enable 2.4g, bit(1): enable 5g */
|
||||
int rtw_ampdu_enable = 1;/* for enable tx_ampdu */
|
||||
static int rtw_rx_stbc = 1;/* 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ */
|
||||
static int rtw_ampdu_amsdu;/* 0: disabled, 1:enabled, 2:auto */
|
||||
|
||||
static int rtw_lowrate_two_xmit = 1;//Use 2 path Tx to transmit MCS0~7 and legacy mode
|
||||
static int rtw_lowrate_two_xmit = 1;/* Use 2 path Tx to transmit MCS0~7 and legacy mode */
|
||||
|
||||
static int rtw_rf_config = RF_819X_MAX_TYPE; //auto
|
||||
static int rtw_low_power = 0;
|
||||
static int rtw_wifi_spec = 0;
|
||||
static int rtw_rf_config = RF_819X_MAX_TYPE; /* auto */
|
||||
static int rtw_low_power;
|
||||
static int rtw_wifi_spec;
|
||||
static int rtw_channel_plan = RT_CHANNEL_DOMAIN_MAX;
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
int rtw_btcoex_enable = 1;
|
||||
int rtw_bt_iso = 2;// 0:Low, 1:High, 2:From Efuse
|
||||
int rtw_bt_sco = 3;// 0:Idle, 1:None-SCO, 2:SCO, 3:From Counter, 4.Busy, 5.OtherBusy
|
||||
int rtw_bt_ampdu =1 ;// 0:Disable BT control A-MPDU, 1:Enable BT control A-MPDU.
|
||||
int rtw_bt_iso = 2;/* 0:Low, 1:High, 2:From Efuse */
|
||||
int rtw_bt_sco = 3;/* 0:Idle, 1:None-SCO, 2:SCO, 3:From Counter, 4.Busy, 5.OtherBusy */
|
||||
int rtw_bt_ampdu = 1 ;/* 0:Disable BT control A-MPDU, 1:Enable BT control A-MPDU. */
|
||||
#endif
|
||||
|
||||
static int rtw_AcceptAddbaReq = true;// 0:Reject AP's Add BA req, 1:Accept AP's Add BA req.
|
||||
static int rtw_AcceptAddbaReq = true;/* 0:Reject AP's Add BA req, 1:Accept AP's Add BA req. */
|
||||
|
||||
static int rtw_antdiv_cfg = 2; // 0:OFF , 1:ON, 2:decide by Efuse config
|
||||
static int rtw_antdiv_type = 0 ; //0:decide by efuse 1: for 88EE, 1Tx and 1RxCG are diversity.(2 Ant with SPDT), 2: for 88EE, 1Tx and 2Rx are diversity.( 2 Ant, Tx and RxCG are both on aux port, RxCS is on main port ), 3: for 88EE, 1Tx and 1RxCG are fixed.(1Ant, Tx and RxCG are both on aux port)
|
||||
static int rtw_antdiv_cfg = 2; /* 0:OFF , 1:ON, 2:decide by Efuse config */
|
||||
static int rtw_antdiv_type; /* 0:decide by efuse 1: for 88EE, 1Tx and 1RxCG are diversity.(2 Ant with SPDT), 2: for 88EE, 1Tx and 2Rx are diversity.(2 Ant, Tx and RxCG are both on aux port, RxCS is on main port), 3: for 88EE, 1Tx and 1RxCG are fixed.(1Ant, Tx and RxCG are both on aux port) */
|
||||
|
||||
static int rtw_enusbss = 0;//0:disable,1:enable
|
||||
static int rtw_enusbss;/* 0:disable, 1:enable */
|
||||
|
||||
static int rtw_hwpdn_mode=2;//0:disable,1:enable,2: by EFUSE config
|
||||
static int rtw_hwpdn_mode = 2;/* 0:disable, 1:enable, 2: by EFUSE config */
|
||||
|
||||
static int rtw_hwpwrp_detect = 0; //HW power ping detect 0:disable , 1:enable
|
||||
static int rtw_hwpwrp_detect; /* HW power ping detect 0:disable , 1:enable */
|
||||
|
||||
static int rtw_hw_wps_pbc = 1;
|
||||
|
||||
int rtw_mc2u_disable = 0;
|
||||
int rtw_mc2u_disable;
|
||||
|
||||
static int rtw_80211d = 0;
|
||||
static int rtw_80211d;
|
||||
|
||||
static char *ifname = "wlan%d";
|
||||
module_param(ifname, charp, 0644);
|
||||
|
@ -128,7 +126,7 @@ static char* if2name = "wlan%d";
|
|||
module_param(if2name, charp, 0644);
|
||||
MODULE_PARM_DESC(if2name, "The default name to allocate for second interface");
|
||||
|
||||
char* rtw_initmac = NULL; // temp mac address if users want to use instead of the mac address in Efuse
|
||||
char *rtw_initmac; /* temp mac address if users want to use instead of the mac address in Efuse */
|
||||
|
||||
module_param(rtw_initmac, charp, 0644);
|
||||
module_param(rtw_channel_plan, int, 0644);
|
||||
|
@ -164,7 +162,7 @@ static uint rtw_max_roaming_times=2;
|
|||
module_param(rtw_max_roaming_times, uint, 0644);
|
||||
MODULE_PARM_DESC(rtw_max_roaming_times, "The max roaming times to try");
|
||||
|
||||
static int rtw_fw_iol=1;// 0:Disable, 1:enable, 2:by usb speed
|
||||
static int rtw_fw_iol = 1;/* 0:Disable, 1:enable, 2:by usb speed */
|
||||
module_param(rtw_fw_iol, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_fw_iol, "FW IOL");
|
||||
|
||||
|
@ -184,13 +182,10 @@ MODULE_PARM_DESC(rtw_notch_filter, "0:Disable, 1:Enable, 2:Enable only for P2P")
|
|||
module_param_named(debug, rtw_debug, int, 0444);
|
||||
MODULE_PARM_DESC(debug, "Set debug level (1-9) (default 1)");
|
||||
|
||||
int _netdev_open(struct net_device *pnetdev);
|
||||
int netdev_open (struct net_device *pnetdev);
|
||||
static int netdev_close (struct net_device *pnetdev);
|
||||
|
||||
static char rtw_proc_name[IFNAMSIZ];
|
||||
static struct proc_dir_entry *rtw_proc = NULL;
|
||||
static int rtw_proc_cnt = 0;
|
||||
static struct proc_dir_entry *rtw_proc;
|
||||
static int rtw_proc_cnt;
|
||||
|
||||
#define RTW_PROC_NAME DRV_NAME
|
||||
|
||||
|
@ -539,7 +534,7 @@ void rtw_proc_remove_one(struct net_device *dev)
|
|||
remove_proc_entry("rssi_disp", dir_dev);
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
remove_proc_entry("btcoex_dbg", dir_dev);
|
||||
#endif //CONFIG_BT_COEXIST
|
||||
#endif /* CONFIG_BT_COEXIST */
|
||||
remove_proc_entry(dev->name, rtw_proc);
|
||||
dir_dev = NULL;
|
||||
} else {
|
||||
|
@ -564,7 +559,6 @@ void rtw_proc_remove_one(struct net_device *dev)
|
|||
|
||||
static uint loadparam(struct adapter *padapter, struct net_device *pnetdev)
|
||||
{
|
||||
|
||||
uint status = _SUCCESS;
|
||||
struct registry_priv *registry_par = &padapter->registrypriv;
|
||||
|
||||
|
@ -602,7 +596,7 @@ _func_enter_;
|
|||
registry_par->software_decrypt = (u8)rtw_software_decrypt;
|
||||
registry_par->acm_method = (u8)rtw_acm_method;
|
||||
|
||||
//UAPSD
|
||||
/* UAPSD */
|
||||
registry_par->wmm_enable = (u8)rtw_wmm_enable;
|
||||
registry_par->uapsd_enable = (u8)rtw_uapsd_enable;
|
||||
registry_par->uapsd_max_sp = (u8)rtw_uapsd_max_sp;
|
||||
|
@ -630,8 +624,8 @@ _func_enter_;
|
|||
registry_par->bAcceptAddbaReq = (u8)rtw_AcceptAddbaReq;
|
||||
registry_par->antdiv_cfg = (u8)rtw_antdiv_cfg;
|
||||
registry_par->antdiv_type = (u8)rtw_antdiv_type;
|
||||
registry_par->hwpdn_mode = (u8)rtw_hwpdn_mode;//0:disable,1:enable,2:by EFUSE config
|
||||
registry_par->hwpwrp_detect = (u8)rtw_hwpwrp_detect;//0:disable,1:enable
|
||||
registry_par->hwpdn_mode = (u8)rtw_hwpdn_mode;/* 0:disable, 1:enable, 2:by EFUSE config */
|
||||
registry_par->hwpwrp_detect = (u8)rtw_hwpwrp_detect;/* 0:disable, 1:enable */
|
||||
registry_par->hw_wps_pbc = (u8)rtw_hw_wps_pbc;
|
||||
|
||||
registry_par->max_roaming_times = (u8)rtw_max_roaming_times;
|
||||
|
@ -651,7 +645,7 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p)
|
|||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
|
||||
struct sockaddr *addr = p;
|
||||
|
||||
if (padapter->bup == false)
|
||||
if (!padapter->bup)
|
||||
_rtw_memcpy(padapter->eeprompriv.mac_addr, addr->sa_data, ETH_ALEN);
|
||||
|
||||
return 0;
|
||||
|
@ -663,8 +657,8 @@ static struct net_device_stats *rtw_net_get_stats(struct net_device *pnetdev)
|
|||
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
|
||||
struct recv_priv *precvpriv = &(padapter->recvpriv);
|
||||
|
||||
padapter->stats.tx_packets = pxmitpriv->tx_pkts;//pxmitpriv->tx_pkts++;
|
||||
padapter->stats.rx_packets = precvpriv->rx_pkts;//precvpriv->rx_pkts++;
|
||||
padapter->stats.tx_packets = pxmitpriv->tx_pkts;/* pxmitpriv->tx_pkts++; */
|
||||
padapter->stats.rx_packets = precvpriv->rx_pkts;/* precvpriv->rx_pkts++; */
|
||||
padapter->stats.tx_dropped = pxmitpriv->tx_drop;
|
||||
padapter->stats.rx_dropped = precvpriv->rx_drop;
|
||||
padapter->stats.tx_bytes = pxmitpriv->tx_bytes;
|
||||
|
@ -808,7 +802,7 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter)
|
|||
pnetdev->wireless_handlers = (struct iw_handler_def *)&rtw_handlers_def;
|
||||
#endif
|
||||
|
||||
//step 2.
|
||||
/* step 2. */
|
||||
loadparam(padapter, pnetdev);
|
||||
|
||||
return pnetdev;
|
||||
|
@ -824,7 +818,7 @@ u32 rtw_start_drv_threads(struct adapter *padapter)
|
|||
if (IS_ERR(padapter->cmdThread))
|
||||
_status = _FAIL;
|
||||
else
|
||||
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); //wait for cmd_thread to run
|
||||
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); /* wait for cmd_thread to run */
|
||||
|
||||
rtw_hal_start_thread(padapter);
|
||||
return _status;
|
||||
|
@ -834,7 +828,7 @@ void rtw_stop_drv_threads (struct adapter *padapter)
|
|||
{
|
||||
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+rtw_stop_drv_threads\n"));
|
||||
|
||||
//Below is to termindate rtw_cmd_thread & event_thread...
|
||||
/* Below is to termindate rtw_cmd_thread & event_thread... */
|
||||
_rtw_up_sema(&padapter->cmdpriv.cmd_queue_sema);
|
||||
if (padapter->cmdThread)
|
||||
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema);
|
||||
|
@ -850,24 +844,24 @@ static u8 rtw_init_default_value(struct adapter *padapter)
|
|||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
|
||||
//xmit_priv
|
||||
/* xmit_priv */
|
||||
pxmitpriv->vcs_setting = pregistrypriv->vrtl_carrier_sense;
|
||||
pxmitpriv->vcs = pregistrypriv->vcs_type;
|
||||
pxmitpriv->vcs_type = pregistrypriv->vcs_type;
|
||||
pxmitpriv->frag_len = pregistrypriv->frag_thresh;
|
||||
|
||||
//mlme_priv
|
||||
pmlmepriv->scan_interval = SCAN_INTERVAL;// 30*2 sec = 60sec
|
||||
/* mlme_priv */
|
||||
pmlmepriv->scan_interval = SCAN_INTERVAL;/* 30*2 sec = 60sec */
|
||||
pmlmepriv->scan_mode = SCAN_ACTIVE;
|
||||
|
||||
//ht_priv
|
||||
pmlmepriv->htpriv.ampdu_enable = false;//set to disabled
|
||||
/* ht_priv */
|
||||
pmlmepriv->htpriv.ampdu_enable = false;/* set to disabled */
|
||||
|
||||
//security_priv
|
||||
/* security_priv */
|
||||
psecuritypriv->binstallGrpkey = _FAIL;
|
||||
psecuritypriv->sw_encrypt = pregistrypriv->software_encrypt;
|
||||
psecuritypriv->sw_decrypt = pregistrypriv->software_decrypt;
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; //open system
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
|
||||
psecuritypriv->dot11PrivacyKeyIndex = 0;
|
||||
psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_;
|
||||
|
@ -875,14 +869,14 @@ static u8 rtw_init_default_value(struct adapter *padapter)
|
|||
psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
psecuritypriv->ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
|
||||
//registry_priv
|
||||
/* registry_priv */
|
||||
rtw_init_registrypriv_dev_network(padapter);
|
||||
rtw_update_registrypriv_dev_network(padapter);
|
||||
|
||||
//hal_priv
|
||||
/* hal_priv */
|
||||
rtw_hal_def_value_init(padapter);
|
||||
|
||||
//misc.
|
||||
/* misc. */
|
||||
padapter->bReadPortCancel = false;
|
||||
padapter->bWritePortCancel = false;
|
||||
padapter->bRxRSSIDisplay = 0;
|
||||
|
@ -899,12 +893,12 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
|
|||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
|
||||
|
||||
//hal_priv
|
||||
/* hal_priv */
|
||||
rtw_hal_def_value_init(padapter);
|
||||
padapter->bReadPortCancel = false;
|
||||
padapter->bWritePortCancel = false;
|
||||
padapter->bRxRSSIDisplay = 0;
|
||||
pmlmepriv->scan_interval = SCAN_INTERVAL;// 30*2 sec = 60sec
|
||||
pmlmepriv->scan_interval = SCAN_INTERVAL;/* 30*2 sec = 60sec */
|
||||
|
||||
padapter->xmitpriv.tx_pkts = 0;
|
||||
padapter->recvpriv.rx_pkts = 0;
|
||||
|
@ -916,7 +910,7 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
|
|||
rtw_hal_sreset_reset_value(padapter);
|
||||
pwrctrlpriv->pwr_state_check_cnts = 0;
|
||||
|
||||
//mlmeextpriv
|
||||
/* mlmeextpriv */
|
||||
padapter->mlmeextpriv.sitesurvey_res.state = SCAN_DISABLE;
|
||||
|
||||
rtw_set_signal_stat_timer(&padapter->recvpriv);
|
||||
|
@ -1029,14 +1023,14 @@ void rtw_cancel_all_timer(struct adapter *padapter)
|
|||
_cancel_timer_ex(&padapter->mlmepriv.dynamic_chk_timer);
|
||||
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("rtw_cancel_all_timer:cancel dynamic_chk_timer!\n"));
|
||||
|
||||
// cancel sw led timer
|
||||
/* cancel sw led timer */
|
||||
rtw_hal_sw_led_deinit(padapter);
|
||||
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("rtw_cancel_all_timer:cancel DeInitSwLeds!\n"));
|
||||
|
||||
_cancel_timer_ex(&padapter->pwrctrlpriv.pwr_state_check_timer);
|
||||
|
||||
_cancel_timer_ex(&padapter->recvpriv.signal_stat_timer);
|
||||
//cancel dm timer
|
||||
/* cancel dm timer */
|
||||
rtw_hal_dm_deinit(padapter);
|
||||
}
|
||||
|
||||
|
@ -1046,9 +1040,9 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
|
|||
|
||||
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("==>rtw_free_drv_sw"));
|
||||
|
||||
//we can call rtw_p2p_enable here, but:
|
||||
// 1. rtw_p2p_enable may have IO operation
|
||||
// 2. rtw_p2p_enable is bundled with wext interface
|
||||
/* we can call rtw_p2p_enable here, but: */
|
||||
/* 1. rtw_p2p_enable may have IO operation */
|
||||
/* 2. rtw_p2p_enable is bundled with wext interface */
|
||||
#ifdef CONFIG_P2P
|
||||
{
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
|
@ -1073,7 +1067,7 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
|
|||
rtw_free_mlme_priv(&padapter->mlmepriv);
|
||||
_rtw_free_xmit_priv(&padapter->xmitpriv);
|
||||
|
||||
_rtw_free_sta_priv(&padapter->stapriv); //will free bcmc_stainfo here
|
||||
_rtw_free_sta_priv(&padapter->stapriv); /* will free bcmc_stainfo here */
|
||||
|
||||
_rtw_free_recv_priv(&padapter->recvpriv);
|
||||
|
||||
|
@ -1083,13 +1077,13 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
|
|||
|
||||
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("<== rtw_free_drv_sw\n"));
|
||||
|
||||
//free the old_pnetdev
|
||||
/* free the old_pnetdev */
|
||||
if (padapter->rereg_nd_name_priv.old_pnetdev) {
|
||||
free_netdev(padapter->rereg_nd_name_priv.old_pnetdev);
|
||||
padapter->rereg_nd_name_priv.old_pnetdev = NULL;
|
||||
}
|
||||
|
||||
// clear pbuddystruct adapter to avoid access wrong pointer.
|
||||
/* clear pbuddystruct adapter to avoid access wrong pointer. */
|
||||
if (padapter->pbuddy_adapter != NULL)
|
||||
padapter->pbuddy_adapter->pbuddy_adapter = NULL;
|
||||
|
||||
|
@ -1104,29 +1098,29 @@ void netdev_br_init(struct net_device *netdev)
|
|||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
|
||||
rcu_read_lock();
|
||||
#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
|
||||
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */
|
||||
|
||||
{
|
||||
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
|
||||
if (netdev->br_port)
|
||||
#else // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
|
||||
#else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
|
||||
if (rcu_dereference(adapter->pnetdev->rx_handler_data))
|
||||
#endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
|
||||
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
|
||||
{
|
||||
struct net_device *br_netdev;
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
|
||||
br_netdev = dev_get_by_name(CONFIG_BR_EXT_BRNAME);
|
||||
#else // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
|
||||
#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) */
|
||||
struct net *devnet = NULL;
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26))
|
||||
devnet = netdev->nd_net;
|
||||
#else // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
|
||||
#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)) */
|
||||
devnet = dev_net(netdev);
|
||||
#endif // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
|
||||
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)) */
|
||||
|
||||
br_netdev = dev_get_by_name(devnet, CONFIG_BR_EXT_BRNAME);
|
||||
#endif // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
|
||||
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) */
|
||||
|
||||
if (br_netdev) {
|
||||
memcpy(adapter->br_mac, br_netdev->dev_addr, ETH_ALEN);
|
||||
|
@ -1140,7 +1134,7 @@ void netdev_br_init(struct net_device *netdev)
|
|||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
|
||||
rcu_read_unlock();
|
||||
#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
|
||||
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */
|
||||
}
|
||||
|
||||
int _netdev_open(struct net_device *pnetdev)
|
||||
|
@ -1152,12 +1146,12 @@ int _netdev_open(struct net_device *pnetdev)
|
|||
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+88eu_drv - dev_open\n"));
|
||||
DBG_88E("+88eu_drv - drv_open, bup =%d\n", padapter->bup);
|
||||
|
||||
if (pwrctrlpriv->ps_flag == true){
|
||||
if (pwrctrlpriv->ps_flag) {
|
||||
padapter->net_closed = false;
|
||||
goto netdev_open_normal_process;
|
||||
}
|
||||
|
||||
if (padapter->bup == false) {
|
||||
if (!padapter->bup) {
|
||||
padapter->bDriverStopped = false;
|
||||
padapter->bSurpriseRemoved = false;
|
||||
padapter->bCardDisableWOHSM = false;
|
||||
|
@ -1203,22 +1197,16 @@ int _netdev_open(struct net_device *pnetdev)
|
|||
netdev_br_init(pnetdev);
|
||||
|
||||
netdev_open_normal_process:
|
||||
|
||||
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-88eu_drv - dev_open\n"));
|
||||
DBG_88E("-88eu_drv - drv_open, bup =%d\n", padapter->bup);
|
||||
|
||||
return 0;
|
||||
|
||||
netdev_open_error:
|
||||
|
||||
padapter->bup = false;
|
||||
|
||||
netif_carrier_off(pnetdev);
|
||||
rtw_netif_stop_queue(pnetdev);
|
||||
|
||||
RT_TRACE(_module_os_intfs_c_, _drv_err_, ("-88eu_drv - dev_open, fail!\n"));
|
||||
DBG_88E("-88eu_drv - drv_open fail, bup =%d\n", padapter->bup);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1230,7 +1218,6 @@ int netdev_open(struct net_device *pnetdev)
|
|||
_enter_critical_mutex(padapter->hw_init_mutex, NULL);
|
||||
ret = _netdev_open(pnetdev);
|
||||
_exit_critical_mutex(padapter->hw_init_mutex, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1306,8 +1293,8 @@ void rtw_ips_dev_unload(struct adapter *padapter)
|
|||
if (padapter->intf_stop)
|
||||
padapter->intf_stop(padapter);
|
||||
|
||||
//s5.
|
||||
if (padapter->bSurpriseRemoved == false)
|
||||
/* s5. */
|
||||
if (!padapter->bSurpriseRemoved)
|
||||
rtw_hal_deinit(padapter);
|
||||
}
|
||||
|
||||
|
@ -1315,7 +1302,7 @@ int pm_netdev_open(struct net_device *pnetdev,u8 bnormal)
|
|||
{
|
||||
int status;
|
||||
|
||||
if (true == bnormal)
|
||||
if (bnormal)
|
||||
status = netdev_open(pnetdev);
|
||||
else
|
||||
status = (_SUCCESS == ips_netdrv_open((struct adapter *)rtw_netdev_priv(pnetdev))) ? (0) : (-1);
|
||||
|
@ -1328,31 +1315,32 @@ static int netdev_close(struct net_device *pnetdev)
|
|||
|
||||
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+88eu_drv - drv_close\n"));
|
||||
|
||||
if (padapter->pwrctrlpriv.bInternalAutoSuspend == true) {
|
||||
if (padapter->pwrctrlpriv.bInternalAutoSuspend) {
|
||||
if (padapter->pwrctrlpriv.rf_pwrstate == rf_off)
|
||||
padapter->pwrctrlpriv.ps_flag = true;
|
||||
}
|
||||
padapter->net_closed = true;
|
||||
|
||||
if (padapter->pwrctrlpriv.rf_pwrstate == rf_on) {
|
||||
DBG_88E("(2)88eu_drv - drv_close, bup=%d, hw_init_completed=%d\n", padapter->bup, padapter->hw_init_completed);
|
||||
DBG_88E("(2)88eu_drv - drv_close, bup =%d, hw_init_completed =%d\n",
|
||||
padapter->bup, padapter->hw_init_completed);
|
||||
|
||||
//s1.
|
||||
/* s1. */
|
||||
if (pnetdev) {
|
||||
if (!rtw_netif_queue_stopped(pnetdev))
|
||||
rtw_netif_stop_queue(pnetdev);
|
||||
}
|
||||
|
||||
//s2.
|
||||
/* s2. */
|
||||
LeaveAllPowerSaveMode(padapter);
|
||||
rtw_disassoc_cmd(padapter, 500, false);
|
||||
//s2-2. indicate disconnect to os
|
||||
/* s2-2. indicate disconnect to os */
|
||||
rtw_indicate_disconnect(padapter);
|
||||
//s2-3.
|
||||
/* s2-3. */
|
||||
rtw_free_assoc_resources(padapter, 1);
|
||||
//s2-4.
|
||||
/* s2-4. */
|
||||
rtw_free_network_queue(padapter, true);
|
||||
// Close LED
|
||||
/* Close LED */
|
||||
rtw_led_control(padapter, LED_CTL_POWER_OFF);
|
||||
}
|
||||
|
||||
|
@ -1360,7 +1348,7 @@ static int netdev_close(struct net_device *pnetdev)
|
|||
|
||||
#ifdef CONFIG_P2P
|
||||
rtw_p2p_enable(padapter, P2P_ROLE_DISABLE);
|
||||
#endif //CONFIG_P2P
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-88eu_drv - drv_close\n"));
|
||||
DBG_88E("-88eu_drv - drv_close, bup =%d\n", padapter->bup);
|
||||
|
|
Loading…
Reference in a new issue