mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
Change "if(" to "if (" and the same changes for "while", "for", "switch" and "do"
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
124abebb96
commit
a55f866a62
105 changed files with 6893 additions and 6893 deletions
|
@ -544,8 +544,8 @@ static void rtw_gspi_if1_deinit(PADAPTER if1)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
if(if1->DriverState != DRIVER_DISAPPEAR) {
|
||||
if(pnetdev) {
|
||||
if (if1->DriverState != DRIVER_DISAPPEAR) {
|
||||
if (pnetdev) {
|
||||
unregister_netdev(pnetdev); //will call netdev_close()
|
||||
rtw_proc_remove_one(pnetdev);
|
||||
}
|
||||
|
@ -565,7 +565,7 @@ static void rtw_gspi_if1_deinit(PADAPTER if1)
|
|||
|
||||
rtw_free_drv_sw(if1);
|
||||
|
||||
if(pnetdev)
|
||||
if (pnetdev)
|
||||
rtw_free_netdev(pnetdev);
|
||||
}
|
||||
|
||||
|
@ -605,7 +605,7 @@ static int /*__devinit*/ rtw_drv_probe(struct spi_device *spi)
|
|||
goto free_if2;
|
||||
|
||||
#ifdef CONFIG_GLOBAL_UI_PID
|
||||
if(ui_pid[1]!=0) {
|
||||
if (ui_pid[1]!=0) {
|
||||
DBG_871X("ui_pid[1]:%d\n",ui_pid[1]);
|
||||
rtw_signal_process(ui_pid[1], SIGUSR2);
|
||||
}
|
||||
|
@ -693,7 +693,7 @@ static int rtw_gspi_suspend(struct spi_device *spi, pm_message_t mesg)
|
|||
while (pwrpriv->bips_processing == _TRUE)
|
||||
rtw_msleep_os(1);
|
||||
|
||||
if((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
|
||||
if ((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
|
||||
{
|
||||
DBG_871X("%s bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n", __FUNCTION__
|
||||
,padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved);
|
||||
|
@ -705,7 +705,7 @@ static int rtw_gspi_suspend(struct spi_device *spi, pm_message_t mesg)
|
|||
|
||||
//padapter->net_closed = _TRUE;
|
||||
//s1.
|
||||
if(pnetdev)
|
||||
if (pnetdev)
|
||||
{
|
||||
netif_carrier_off(pnetdev);
|
||||
rtw_netif_stop_queue(pnetdev);
|
||||
|
@ -718,7 +718,7 @@ static int rtw_gspi_suspend(struct spi_device *spi, pm_message_t mesg)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_LAYER2_ROAMING_RESUME
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) )
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) )
|
||||
{
|
||||
DBG_871X("%s %s(" MAC_FMT "), length:%d assoc_ssid.length:%d\n",__FUNCTION__,
|
||||
pmlmepriv->cur_network.network.Ssid.Ssid,
|
||||
|
@ -742,10 +742,10 @@ static int rtw_gspi_suspend(struct spi_device *spi, pm_message_t mesg)
|
|||
|
||||
rtw_dev_unload(padapter);
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
rtw_indicate_scan_done(padapter, 1);
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
rtw_indicate_disconnect(padapter);
|
||||
|
||||
// interface deinit
|
||||
|
@ -817,7 +817,7 @@ int rtw_resume_process(_adapter *padapter)
|
|||
pwrpriv->bkeepfwalive = _FALSE;
|
||||
|
||||
DBG_871X("bkeepfwalive(%x)\n",pwrpriv->bkeepfwalive);
|
||||
if(pm_netdev_open(pnetdev,_TRUE) != 0) {
|
||||
if (pm_netdev_open(pnetdev,_TRUE) != 0) {
|
||||
ret = -1;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -825,7 +825,7 @@ int rtw_resume_process(_adapter *padapter)
|
|||
netif_device_attach(pnetdev);
|
||||
netif_carrier_on(pnetdev);
|
||||
|
||||
if( padapter->pid[1]!=0) {
|
||||
if ( padapter->pid[1]!=0) {
|
||||
DBG_871X("pid[1]:%d\n",padapter->pid[1]);
|
||||
rtw_signal_process(padapter->pid[1], SIGUSR2);
|
||||
}
|
||||
|
@ -858,13 +858,13 @@ static int rtw_gspi_resume(struct spi_device *spi)
|
|||
|
||||
DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid);
|
||||
|
||||
if(pwrpriv->bInternalAutoSuspend ){
|
||||
if (pwrpriv->bInternalAutoSuspend ){
|
||||
ret = rtw_resume_process(padapter);
|
||||
} else {
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
rtw_resume_in_workqueue(pwrpriv);
|
||||
#elif defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
|
||||
if(rtw_is_earlysuspend_registered(pwrpriv)) {
|
||||
if (rtw_is_earlysuspend_registered(pwrpriv)) {
|
||||
//jeff: bypass resume here, do in late_resume
|
||||
pwrpriv->do_late_resume = _TRUE;
|
||||
} else {
|
||||
|
|
|
@ -137,7 +137,7 @@ int spi_read_write_reg(PADAPTER pAdapter, int write_flag, u32 addr, char * buf,
|
|||
{
|
||||
int remainder = addr % 4;
|
||||
u32 val32 = *(u32 *)buf;
|
||||
switch(len) {
|
||||
switch (len) {
|
||||
case 1:
|
||||
byte_en = (0x1 << remainder);
|
||||
data_tmp = (val32& 0xff)<< (remainder*8);
|
||||
|
@ -158,7 +158,7 @@ int spi_read_write_reg(PADAPTER pAdapter, int write_flag, u32 addr, char * buf,
|
|||
}
|
||||
else //read register
|
||||
{
|
||||
switch(len) {
|
||||
switch (len) {
|
||||
case 1:
|
||||
byte_en = 0x1;
|
||||
break;
|
||||
|
@ -380,7 +380,7 @@ _func_enter_;
|
|||
spi_get_status_info(Adapter, status);
|
||||
|
||||
more_data = GET_STATUS_HISR_LOW8BIT(status) & BIT(0);
|
||||
//if(more_data) {
|
||||
//if (more_data) {
|
||||
// rtw_queue_delayed_work(Adapter->recv_wq, &Adapter->recv_work, 0, (void*)Adapter);
|
||||
//}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -152,7 +152,7 @@ _func_enter_;
|
|||
rtw_indicate_wx_assoc_event(adapter);
|
||||
netif_carrier_on(adapter->pnetdev);
|
||||
|
||||
if(adapter->pid[2] !=0)
|
||||
if (adapter->pid[2] !=0)
|
||||
rtw_signal_process(adapter->pid[2], SIGALRM);
|
||||
|
||||
#ifdef RTK_DMP_PLATFORM
|
||||
|
@ -179,7 +179,7 @@ void rtw_reset_securitypriv( _adapter *adapter )
|
|||
u8 backupTKIPCountermeasure = 0x00;
|
||||
u32 backupTKIPcountermeasure_time = 0;
|
||||
|
||||
if(adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)//802.1x
|
||||
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)//802.1x
|
||||
{
|
||||
// Added by Albert 2009/02/18
|
||||
// We have to backup the PMK information for WiFi PMK Caching test item.
|
||||
|
@ -210,7 +210,7 @@ void rtw_reset_securitypriv( _adapter *adapter )
|
|||
}
|
||||
else //reset values in securitypriv
|
||||
{
|
||||
//if(adapter->mlmepriv.fw_state & WIFI_STATION_STATE)
|
||||
//if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE)
|
||||
//{
|
||||
struct security_priv *psec_priv=&adapter->securitypriv;
|
||||
|
||||
|
@ -261,7 +261,7 @@ _func_enter_;
|
|||
RT_TRACE(_module_mlme_osdep_c_,_drv_info_,("+rtw_report_sec_ie, authmode=%d\n", authmode));
|
||||
|
||||
buff = NULL;
|
||||
if(authmode==_WPA_IE_ID_)
|
||||
if (authmode==_WPA_IE_ID_)
|
||||
{
|
||||
RT_TRACE(_module_mlme_osdep_c_,_drv_info_,("rtw_report_sec_ie, authmode=%d\n", authmode));
|
||||
|
||||
|
@ -276,7 +276,7 @@ _func_enter_;
|
|||
len = sec_ie[1]+2;
|
||||
len = (len < IW_CUSTOM_MAX) ? len:IW_CUSTOM_MAX;
|
||||
|
||||
for(i=0;i<len;i++){
|
||||
for (i=0;i<len;i++){
|
||||
p+=sprintf(p,"%02x",sec_ie[i]);
|
||||
}
|
||||
|
||||
|
@ -292,7 +292,7 @@ _func_enter_;
|
|||
wireless_send_event(adapter->pnetdev,IWEVCUSTOM,&wrqu,buff);
|
||||
#endif
|
||||
|
||||
if(buff)
|
||||
if (buff)
|
||||
rtw_mfree(buff, IW_CUSTOM_MAX);
|
||||
|
||||
}
|
||||
|
@ -359,13 +359,13 @@ void rtw_indicate_sta_assoc_event(_adapter *padapter, struct sta_info *psta)
|
|||
union iwreq_data wrqu;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
if(psta==NULL)
|
||||
if (psta==NULL)
|
||||
return;
|
||||
|
||||
if(psta->aid > NUM_STA)
|
||||
if (psta->aid > NUM_STA)
|
||||
return;
|
||||
|
||||
if(pstapriv->sta_aid[psta->aid - 1] != psta)
|
||||
if (pstapriv->sta_aid[psta->aid - 1] != psta)
|
||||
return;
|
||||
|
||||
|
||||
|
@ -386,13 +386,13 @@ void rtw_indicate_sta_disassoc_event(_adapter *padapter, struct sta_info *psta)
|
|||
union iwreq_data wrqu;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
if(psta==NULL)
|
||||
if (psta==NULL)
|
||||
return;
|
||||
|
||||
if(psta->aid > NUM_STA)
|
||||
if (psta->aid > NUM_STA)
|
||||
return;
|
||||
|
||||
if(pstapriv->sta_aid[psta->aid - 1] != psta)
|
||||
if (pstapriv->sta_aid[psta->aid - 1] != psta)
|
||||
return;
|
||||
|
||||
|
||||
|
@ -430,7 +430,7 @@ static int mgnt_netdev_open(struct net_device *pnetdev)
|
|||
|
||||
init_usb_anchor(&phostapdpriv->anchored);
|
||||
|
||||
if(!rtw_netif_queue_stopped(pnetdev))
|
||||
if (!rtw_netif_queue_stopped(pnetdev))
|
||||
rtw_netif_start_queue(pnetdev);
|
||||
else
|
||||
rtw_netif_wake_queue(pnetdev);
|
||||
|
@ -525,7 +525,7 @@ int hostapd_mode_init(_adapter *padapter)
|
|||
|
||||
|
||||
|
||||
if(dev_alloc_name(pnetdev,"mgnt.wlan%d") < 0)
|
||||
if (dev_alloc_name(pnetdev,"mgnt.wlan%d") < 0)
|
||||
{
|
||||
DBG_871X("hostapd_mode_init(): dev_alloc_name, fail! \n");
|
||||
}
|
||||
|
@ -552,7 +552,7 @@ int hostapd_mode_init(_adapter *padapter)
|
|||
{
|
||||
DBG_871X("hostapd_mode_init(): register_netdev fail!\n");
|
||||
|
||||
if(pnetdev)
|
||||
if (pnetdev)
|
||||
{
|
||||
rtw_free_netdev(pnetdev);
|
||||
}
|
||||
|
|
|
@ -319,21 +319,21 @@ void rtw_proc_init_one(struct net_device *dev)
|
|||
_adapter *padapter = rtw_netdev_priv(dev);
|
||||
u8 rf_type;
|
||||
|
||||
if(rtw_proc == NULL)
|
||||
if (rtw_proc == NULL)
|
||||
{
|
||||
if(padapter->chip_type == RTL8188C_8192C)
|
||||
if (padapter->chip_type == RTL8188C_8192C)
|
||||
{
|
||||
_rtw_memcpy(rtw_proc_name, RTL8192C_PROC_NAME, sizeof(RTL8192C_PROC_NAME));
|
||||
}
|
||||
else if(padapter->chip_type == RTL8192D)
|
||||
else if (padapter->chip_type == RTL8192D)
|
||||
{
|
||||
_rtw_memcpy(rtw_proc_name, RTL8192D_PROC_NAME, sizeof(RTL8192D_PROC_NAME));
|
||||
}
|
||||
else if(padapter->chip_type == RTL8723A)
|
||||
else if (padapter->chip_type == RTL8723A)
|
||||
{
|
||||
_rtw_memcpy(rtw_proc_name, RTW_PROC_NAME, sizeof(RTW_PROC_NAME));
|
||||
}
|
||||
else if(padapter->chip_type == RTL8188E)
|
||||
else if (padapter->chip_type == RTL8188E)
|
||||
{
|
||||
_rtw_memcpy(rtw_proc_name, RTW_PROC_NAME, sizeof(RTW_PROC_NAME));
|
||||
}
|
||||
|
@ -342,7 +342,7 @@ void rtw_proc_init_one(struct net_device *dev)
|
|||
_rtw_memcpy(rtw_proc_name, RTW_PROC_NAME, sizeof(RTW_PROC_NAME));
|
||||
}
|
||||
|
||||
#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
|
||||
rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, proc_net);
|
||||
#else
|
||||
rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, init_net.proc_net);
|
||||
|
@ -361,7 +361,7 @@ void rtw_proc_init_one(struct net_device *dev)
|
|||
|
||||
|
||||
|
||||
if(padapter->dir_dev == NULL)
|
||||
if (padapter->dir_dev == NULL)
|
||||
{
|
||||
padapter->dir_dev = create_proc_entry(dev->name,
|
||||
S_IFDIR | S_IRUGO | S_IXUGO,
|
||||
|
@ -369,12 +369,12 @@ void rtw_proc_init_one(struct net_device *dev)
|
|||
|
||||
dir_dev = padapter->dir_dev;
|
||||
|
||||
if(dir_dev==NULL)
|
||||
if (dir_dev==NULL)
|
||||
{
|
||||
if(rtw_proc_cnt == 0)
|
||||
if (rtw_proc_cnt == 0)
|
||||
{
|
||||
if(rtw_proc){
|
||||
#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
|
||||
if (rtw_proc){
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
|
||||
remove_proc_entry(rtw_proc_name, proc_net);
|
||||
#else
|
||||
remove_proc_entry(rtw_proc_name, init_net.proc_net);
|
||||
|
@ -534,7 +534,7 @@ void rtw_proc_init_one(struct net_device *dev)
|
|||
}
|
||||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
if((RF_1T2R == rf_type) ||(RF_1T1R ==rf_type )) {
|
||||
if ((RF_1T2R == rf_type) ||(RF_1T1R ==rf_type )) {
|
||||
entry = create_proc_read_entry("rf_reg_dump3", S_IFREG | S_IRUGO,
|
||||
dir_dev, proc_get_rf_reg_dump3, dev);
|
||||
if (!entry) {
|
||||
|
@ -673,7 +673,7 @@ void rtw_proc_remove_one(struct net_device *dev)
|
|||
remove_proc_entry("rf_reg_dump1", dir_dev);
|
||||
remove_proc_entry("rf_reg_dump2", dir_dev);
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
if((RF_1T2R == rf_type) ||(RF_1T1R ==rf_type )) {
|
||||
if ((RF_1T2R == rf_type) ||(RF_1T1R ==rf_type )) {
|
||||
remove_proc_entry("rf_reg_dump3", dir_dev);
|
||||
remove_proc_entry("rf_reg_dump4", dir_dev);
|
||||
}
|
||||
|
@ -717,12 +717,12 @@ void rtw_proc_remove_one(struct net_device *dev)
|
|||
|
||||
rtw_proc_cnt--;
|
||||
|
||||
if(rtw_proc_cnt == 0)
|
||||
if (rtw_proc_cnt == 0)
|
||||
{
|
||||
if(rtw_proc){
|
||||
if (rtw_proc){
|
||||
remove_proc_entry("ver_info", rtw_proc);
|
||||
|
||||
#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
|
||||
remove_proc_entry(rtw_proc_name, proc_net);
|
||||
#else
|
||||
remove_proc_entry(rtw_proc_name, init_net.proc_net);
|
||||
|
@ -867,7 +867,7 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p)
|
|||
_adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev);
|
||||
struct sockaddr *addr = p;
|
||||
|
||||
if(padapter->bup == _FALSE)
|
||||
if (padapter->bup == _FALSE)
|
||||
{
|
||||
//DBG_871X("r8711_net_set_mac_address(), MAC=%x:%x:%x:%x:%x:%x\n", addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3],
|
||||
//addr->sa_data[4], addr->sa_data[5]);
|
||||
|
@ -937,7 +937,7 @@ static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb)
|
|||
|
||||
skb->priority = rtw_classify8021d(skb);
|
||||
|
||||
if(pmlmepriv->acm_mask != 0)
|
||||
if (pmlmepriv->acm_mask != 0)
|
||||
{
|
||||
skb->priority = qos_acm(pmlmepriv->acm_mask, skb->priority);
|
||||
}
|
||||
|
@ -998,7 +998,7 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
|
|||
_adapter *TargetAdapter = NULL;
|
||||
struct net *devnet = NULL;
|
||||
|
||||
if(padapter->bDongle == 1)
|
||||
if (padapter->bDongle == 1)
|
||||
{
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
|
||||
TargetNetdev = dev_get_by_name("wlan0");
|
||||
|
@ -1010,7 +1010,7 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
|
|||
#endif
|
||||
TargetNetdev = dev_get_by_name(devnet, "wlan0");
|
||||
#endif
|
||||
if(TargetNetdev) {
|
||||
if (TargetNetdev) {
|
||||
DBG_871X("Force onboard module driver disappear !!!\n");
|
||||
TargetAdapter = rtw_netdev_priv(TargetNetdev);
|
||||
TargetAdapter->DriverState = DRIVER_DISAPPEAR;
|
||||
|
@ -1022,7 +1022,7 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
|
|||
dev_put(TargetNetdev);
|
||||
unregister_netdev(TargetNetdev);
|
||||
|
||||
if(TargetAdapter->chip_type == padapter->chip_type)
|
||||
if (TargetAdapter->chip_type == padapter->chip_type)
|
||||
rtw_proc_remove_one(TargetNetdev);
|
||||
|
||||
padapter->DriverState = DRIVER_REPLACE_DONGLE;
|
||||
|
@ -1030,7 +1030,7 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
|
|||
}
|
||||
#endif
|
||||
|
||||
if(dev_alloc_name(pnetdev, ifname) < 0)
|
||||
if (dev_alloc_name(pnetdev, ifname) < 0)
|
||||
{
|
||||
RT_TRACE(_module_os_intfs_c_,_drv_err_,("dev_alloc_name, fail! \n"));
|
||||
}
|
||||
|
@ -1048,7 +1048,7 @@ struct net_device *rtw_init_netdev(_adapter *old_padapter)
|
|||
|
||||
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+init_net_dev\n"));
|
||||
|
||||
if(old_padapter != NULL)
|
||||
if (old_padapter != NULL)
|
||||
pnetdev = rtw_alloc_etherdev_with_old_priv(sizeof(_adapter), (void *)old_padapter);
|
||||
else
|
||||
pnetdev = rtw_alloc_etherdev(sizeof(_adapter));
|
||||
|
@ -1106,10 +1106,10 @@ u32 rtw_start_drv_threads(_adapter *padapter)
|
|||
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+rtw_start_drv_threads\n"));
|
||||
#ifdef CONFIG_XMIT_THREAD_MODE
|
||||
#if defined(CONFIG_SDIO_HCI) && defined(CONFIG_CONCURRENT_MODE)
|
||||
if(padapter->adapter_type == PRIMARY_ADAPTER){
|
||||
if (padapter->adapter_type == PRIMARY_ADAPTER){
|
||||
#endif
|
||||
padapter->xmitThread = kthread_run(rtw_xmit_thread, padapter, "RTW_XMIT_THREAD");
|
||||
if(IS_ERR(padapter->xmitThread))
|
||||
if (IS_ERR(padapter->xmitThread))
|
||||
_status = _FAIL;
|
||||
#if defined(CONFIG_SDIO_HCI) && defined(CONFIG_CONCURRENT_MODE)
|
||||
}
|
||||
|
@ -1118,17 +1118,17 @@ u32 rtw_start_drv_threads(_adapter *padapter)
|
|||
|
||||
#ifdef CONFIG_RECV_THREAD_MODE
|
||||
padapter->recvThread = kthread_run(rtw_recv_thread, padapter, "RTW_RECV_THREAD");
|
||||
if(IS_ERR(padapter->recvThread))
|
||||
if (IS_ERR(padapter->recvThread))
|
||||
_status = _FAIL;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->isprimary == _TRUE)
|
||||
if (padapter->isprimary == _TRUE)
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
padapter->cmdThread = kthread_run(rtw_cmd_thread, padapter, "RTW_CMD_THREAD");
|
||||
if(IS_ERR(padapter->cmdThread))
|
||||
if (IS_ERR(padapter->cmdThread))
|
||||
_status = _FAIL;
|
||||
else
|
||||
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); //wait for cmd_thread to run
|
||||
|
@ -1137,7 +1137,7 @@ u32 rtw_start_drv_threads(_adapter *padapter)
|
|||
|
||||
#ifdef CONFIG_EVENT_THREAD_MODE
|
||||
padapter->evtThread = kthread_run(event_thread, padapter, "RTW_EVENT_THREAD");
|
||||
if(IS_ERR(padapter->evtThread))
|
||||
if (IS_ERR(padapter->evtThread))
|
||||
_status = _FAIL;
|
||||
#endif
|
||||
|
||||
|
@ -1151,20 +1151,20 @@ void rtw_stop_drv_threads (_adapter *padapter)
|
|||
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+rtw_stop_drv_threads\n"));
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->isprimary == _TRUE)
|
||||
if (padapter->isprimary == _TRUE)
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
//Below is to termindate rtw_cmd_thread & event_thread...
|
||||
_rtw_up_sema(&padapter->cmdpriv.cmd_queue_sema);
|
||||
//_rtw_up_sema(&padapter->cmdpriv.cmd_done_sema);
|
||||
if(padapter->cmdThread){
|
||||
if (padapter->cmdThread){
|
||||
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_EVENT_THREAD_MODE
|
||||
_rtw_up_sema(&padapter->evtpriv.evt_notify);
|
||||
if(padapter->evtThread){
|
||||
if (padapter->evtThread){
|
||||
_rtw_down_sema(&padapter->evtpriv.terminate_evtthread_sema);
|
||||
}
|
||||
#endif
|
||||
|
@ -1173,7 +1173,7 @@ void rtw_stop_drv_threads (_adapter *padapter)
|
|||
// Below is to termindate tx_thread...
|
||||
#if defined(CONFIG_SDIO_HCI) && defined(CONFIG_CONCURRENT_MODE)
|
||||
// Only wake-up primary adapter
|
||||
if(padapter->adapter_type == PRIMARY_ADAPTER)
|
||||
if (padapter->adapter_type == PRIMARY_ADAPTER)
|
||||
#endif //SDIO_HCI + CONCURRENT
|
||||
{
|
||||
_rtw_up_sema(&padapter->xmitpriv.xmit_sema);
|
||||
|
@ -1349,12 +1349,12 @@ _func_enter_;
|
|||
rtw_init_cfg80211_wifidirect_info(padapter);
|
||||
#endif
|
||||
#ifdef CONFIG_WFD
|
||||
if(rtw_init_wifi_display_info(padapter) == _FAIL)
|
||||
if (rtw_init_wifi_display_info(padapter) == _FAIL)
|
||||
RT_TRACE(_module_os_intfs_c_,_drv_err_,("\n Can't init init_wifi_display_info\n"));
|
||||
#endif
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
if(init_mlme_ext_priv(padapter) == _FAIL)
|
||||
if (init_mlme_ext_priv(padapter) == _FAIL)
|
||||
{
|
||||
RT_TRACE(_module_os_intfs_c_,_drv_err_,("\n Can't init mlme_ext_priv\n"));
|
||||
ret8=_FAIL;
|
||||
|
@ -1362,7 +1362,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if(rtw_init_tdls_info(padapter) == _FAIL)
|
||||
if (rtw_init_tdls_info(padapter) == _FAIL)
|
||||
{
|
||||
DBG_871X("Can't rtw_init_tdls_info\n");
|
||||
ret8=_FAIL;
|
||||
|
@ -1370,14 +1370,14 @@ _func_enter_;
|
|||
}
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
if(_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL)
|
||||
if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL)
|
||||
{
|
||||
DBG_871X("Can't _rtw_init_xmit_priv\n");
|
||||
ret8=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if(_rtw_init_recv_priv(&padapter->recvpriv, padapter) == _FAIL)
|
||||
if (_rtw_init_recv_priv(&padapter->recvpriv, padapter) == _FAIL)
|
||||
{
|
||||
DBG_871X("Can't _rtw_init_recv_priv\n");
|
||||
ret8=_FAIL;
|
||||
|
@ -1389,7 +1389,7 @@ _func_enter_;
|
|||
|
||||
//_init_timer(&(padapter->securitypriv.tkip_timer), padapter->pifp, rtw_use_tkipkey_handler, padapter);
|
||||
|
||||
if(_rtw_init_sta_priv(&padapter->stapriv) == _FAIL)
|
||||
if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL)
|
||||
{
|
||||
DBG_871X("Can't _rtw_init_sta_priv\n");
|
||||
ret8=_FAIL;
|
||||
|
@ -1420,7 +1420,7 @@ _func_enter_;
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_INTEL_WIDI
|
||||
if(rtw_init_intel_widi(padapter) == _FAIL)
|
||||
if (rtw_init_intel_widi(padapter) == _FAIL)
|
||||
{
|
||||
DBG_871X("Can't rtw_init_intel_widi\n");
|
||||
ret8=_FAIL;
|
||||
|
@ -1516,7 +1516,7 @@ u8 rtw_free_drv_sw(_adapter *padapter)
|
|||
#ifdef CONFIG_P2P
|
||||
{
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
{
|
||||
_cancel_timer_ex( &pwdinfo->find_phase_timer );
|
||||
_cancel_timer_ex( &pwdinfo->restore_p2p_state_timer );
|
||||
|
@ -1574,13 +1574,13 @@ u8 rtw_free_drv_sw(_adapter *padapter)
|
|||
RT_TRACE(_module_os_intfs_c_,_drv_info_,("<==rtw_free_drv_sw\n"));
|
||||
|
||||
//free the old_pnetdev
|
||||
if(padapter->rereg_nd_name_priv.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 pbuddy_adapter to avoid access wrong pointer.
|
||||
if(padapter->pbuddy_adapter != NULL) {
|
||||
if (padapter->pbuddy_adapter != NULL) {
|
||||
padapter->pbuddy_adapter->pbuddy_adapter = NULL;
|
||||
}
|
||||
|
||||
|
@ -1598,12 +1598,12 @@ int _netdev_if2_open(struct net_device *pnetdev)
|
|||
|
||||
DBG_871X("+871x_drv - if2_open, bup=%d\n", padapter->bup);
|
||||
|
||||
if(primary_padapter->bup == _FALSE || primary_padapter->hw_init_completed == _FALSE)
|
||||
if (primary_padapter->bup == _FALSE || primary_padapter->hw_init_completed == _FALSE)
|
||||
{
|
||||
_netdev_open(primary_padapter->pnetdev);
|
||||
}
|
||||
|
||||
if(padapter->bup == _FALSE && primary_padapter->bup == _TRUE &&
|
||||
if (padapter->bup == _FALSE && primary_padapter->bup == _TRUE &&
|
||||
primary_padapter->hw_init_completed == _TRUE)
|
||||
{
|
||||
int i;
|
||||
|
@ -1621,13 +1621,13 @@ int _netdev_if2_open(struct net_device *pnetdev)
|
|||
// goto netdev_if2_open_error;
|
||||
|
||||
|
||||
if(rtw_start_drv_threads(padapter) == _FAIL)
|
||||
if (rtw_start_drv_threads(padapter) == _FAIL)
|
||||
{
|
||||
goto netdev_if2_open_error;
|
||||
}
|
||||
|
||||
|
||||
if(padapter->intf_start)
|
||||
if (padapter->intf_start)
|
||||
{
|
||||
padapter->intf_start(padapter);
|
||||
}
|
||||
|
@ -1652,7 +1652,7 @@ int _netdev_if2_open(struct net_device *pnetdev)
|
|||
|
||||
_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000);
|
||||
|
||||
if(!rtw_netif_queue_stopped(pnetdev))
|
||||
if (!rtw_netif_queue_stopped(pnetdev))
|
||||
rtw_netif_start_queue(pnetdev);
|
||||
else
|
||||
rtw_netif_wake_queue(pnetdev);
|
||||
|
@ -1688,7 +1688,7 @@ static int netdev_if2_close(struct net_device *pnetdev)
|
|||
|
||||
padapter->net_closed = _TRUE;
|
||||
|
||||
if(pnetdev)
|
||||
if (pnetdev)
|
||||
{
|
||||
if (!rtw_netif_queue_stopped(pnetdev))
|
||||
rtw_netif_stop_queue(pnetdev);
|
||||
|
@ -1812,12 +1812,12 @@ _adapter *rtw_drv_if2_init(_adapter *primary_padapter, char *name,
|
|||
|
||||
|
||||
//init drv data
|
||||
if(rtw_init_drv_sw(padapter)!= _SUCCESS)
|
||||
if (rtw_init_drv_sw(padapter)!= _SUCCESS)
|
||||
goto error_rtw_drv_if2_init;
|
||||
|
||||
|
||||
// alloc dev name after got efuse data.
|
||||
if(name == NULL)
|
||||
if (name == NULL)
|
||||
name = padapter->registrypriv.if2name;
|
||||
|
||||
rtw_init_netdev_name(pnetdev, name);
|
||||
|
@ -1854,7 +1854,7 @@ _adapter *rtw_drv_if2_init(_adapter *primary_padapter, char *name,
|
|||
primary_padapter->pbuddy_adapter = padapter;
|
||||
|
||||
//prepare concurrent shared data buffer
|
||||
if(!primary_padapter->pcodatapriv)
|
||||
if (!primary_padapter->pcodatapriv)
|
||||
{
|
||||
struct co_data_priv *pcodatapriv;
|
||||
|
||||
|
@ -1907,7 +1907,7 @@ void rtw_drv_if2_free(_adapter *if2)
|
|||
#endif /* CONFIG_IOCTL_CFG80211 */
|
||||
|
||||
/* free concurrent shared data buffer */
|
||||
if(padapter->pcodatapriv) {
|
||||
if (padapter->pcodatapriv) {
|
||||
rtw_vmfree((u8*)padapter->pcodatapriv, sizeof(struct co_data_priv));
|
||||
padapter->pcodatapriv = NULL;
|
||||
}
|
||||
|
@ -1942,7 +1942,7 @@ void rtw_drv_if2_stop(_adapter *if2)
|
|||
rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_DRV_STOP);
|
||||
#endif
|
||||
|
||||
if(padapter->intf_stop)
|
||||
if (padapter->intf_stop)
|
||||
{
|
||||
padapter->intf_stop(padapter);
|
||||
}
|
||||
|
@ -1971,7 +1971,7 @@ void netdev_br_init(struct net_device *netdev)
|
|||
rcu_read_lock();
|
||||
#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
|
||||
|
||||
//if(check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE)
|
||||
//if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE)
|
||||
{
|
||||
//struct net_bridge *br = netdev->br_port->br;//->dev->dev_addr;
|
||||
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
|
||||
|
@ -2020,12 +2020,12 @@ int _netdev_open(struct net_device *pnetdev)
|
|||
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+871x_drv - dev_open\n"));
|
||||
DBG_871X("+871x_drv - drv_open, bup=%d\n", padapter->bup);
|
||||
|
||||
if(pwrctrlpriv->ps_flag == _TRUE){
|
||||
if (pwrctrlpriv->ps_flag == _TRUE){
|
||||
padapter->net_closed = _FALSE;
|
||||
goto netdev_open_normal_process;
|
||||
}
|
||||
|
||||
if(padapter->bup == _FALSE)
|
||||
if (padapter->bup == _FALSE)
|
||||
{
|
||||
padapter->bDriverStopped = _FALSE;
|
||||
padapter->bSurpriseRemoved = _FALSE;
|
||||
|
@ -2045,7 +2045,7 @@ int _netdev_open(struct net_device *pnetdev)
|
|||
#endif //CONFIG_RF_GAIN_OFFSET
|
||||
|
||||
status=rtw_start_drv_threads(padapter);
|
||||
if(status ==_FAIL)
|
||||
if (status ==_FAIL)
|
||||
{
|
||||
DBG_871X("Initialize driver software resource Failed!\n");
|
||||
goto netdev_open_error;
|
||||
|
@ -2061,7 +2061,7 @@ int _netdev_open(struct net_device *pnetdev)
|
|||
init_drvext(padapter);
|
||||
#endif
|
||||
|
||||
if(padapter->intf_start)
|
||||
if (padapter->intf_start)
|
||||
{
|
||||
padapter->intf_start(padapter);
|
||||
}
|
||||
|
@ -2086,7 +2086,7 @@ int _netdev_open(struct net_device *pnetdev)
|
|||
rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv);
|
||||
|
||||
//netif_carrier_on(pnetdev);//call this func when rtw_joinbss_event_callback return success
|
||||
if(!rtw_netif_queue_stopped(pnetdev))
|
||||
if (!rtw_netif_queue_stopped(pnetdev))
|
||||
rtw_netif_start_queue(pnetdev);
|
||||
else
|
||||
rtw_netif_wake_queue(pnetdev);
|
||||
|
@ -2100,7 +2100,7 @@ netdev_open_normal_process:
|
|||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
_adapter *sec_adapter = padapter->pbuddy_adapter;
|
||||
if(sec_adapter && (sec_adapter->bup == _FALSE || sec_adapter->hw_init_completed == _FALSE))
|
||||
if (sec_adapter && (sec_adapter->bup == _FALSE || sec_adapter->hw_init_completed == _FALSE))
|
||||
_netdev_if2_open(sec_adapter->pnetdev);
|
||||
}
|
||||
#endif
|
||||
|
@ -2156,7 +2156,7 @@ int ips_netdrv_open(_adapter *padapter)
|
|||
goto netdev_open_error;
|
||||
}
|
||||
|
||||
if(padapter->intf_start)
|
||||
if (padapter->intf_start)
|
||||
{
|
||||
padapter->intf_start(padapter);
|
||||
}
|
||||
|
@ -2213,13 +2213,13 @@ void rtw_ips_dev_unload(_adapter *padapter)
|
|||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_FIFO_CLEARN_UP, 0);
|
||||
|
||||
if(padapter->intf_stop)
|
||||
if (padapter->intf_stop)
|
||||
{
|
||||
padapter->intf_stop(padapter);
|
||||
}
|
||||
|
||||
//s5.
|
||||
if(padapter->bSurpriseRemoved == _FALSE)
|
||||
if (padapter->bSurpriseRemoved == _FALSE)
|
||||
{
|
||||
rtw_hal_deinit(padapter);
|
||||
}
|
||||
|
@ -2268,15 +2268,15 @@ static int netdev_close(struct net_device *pnetdev)
|
|||
|
||||
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+871x_drv - drv_close\n"));
|
||||
|
||||
if(padapter->pwrctrlpriv.bInternalAutoSuspend == _TRUE)
|
||||
if (padapter->pwrctrlpriv.bInternalAutoSuspend == _TRUE)
|
||||
{
|
||||
//rtw_pwr_wakeup(padapter);
|
||||
if(padapter->pwrctrlpriv.rf_pwrstate == rf_off)
|
||||
if (padapter->pwrctrlpriv.rf_pwrstate == rf_off)
|
||||
padapter->pwrctrlpriv.ps_flag = _TRUE;
|
||||
}
|
||||
padapter->net_closed = _TRUE;
|
||||
|
||||
/* if(!padapter->hw_init_completed)
|
||||
/* if (!padapter->hw_init_completed)
|
||||
{
|
||||
DBG_871X("(1)871x_drv - drv_close, bup=%d, hw_init_completed=%d\n", padapter->bup, padapter->hw_init_completed);
|
||||
|
||||
|
@ -2285,11 +2285,11 @@ static int netdev_close(struct net_device *pnetdev)
|
|||
rtw_dev_unload(padapter);
|
||||
}
|
||||
else*/
|
||||
if(padapter->pwrctrlpriv.rf_pwrstate == rf_on){
|
||||
if (padapter->pwrctrlpriv.rf_pwrstate == rf_on){
|
||||
DBG_871X("(2)871x_drv - drv_close, bup=%d, hw_init_completed=%d\n", padapter->bup, padapter->hw_init_completed);
|
||||
|
||||
//s1.
|
||||
if(pnetdev)
|
||||
if (pnetdev)
|
||||
{
|
||||
if (!rtw_netif_queue_stopped(pnetdev))
|
||||
rtw_netif_stop_queue(pnetdev);
|
||||
|
@ -2320,7 +2320,7 @@ static int netdev_close(struct net_device *pnetdev)
|
|||
|
||||
#ifdef CONFIG_P2P
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled == _TRUE)
|
||||
if (wdev_to_priv(padapter->rtw_wdev)->p2p_enabled == _TRUE)
|
||||
wdev_to_priv(padapter->rtw_wdev)->p2p_enabled = _FALSE;
|
||||
#endif
|
||||
rtw_p2p_enable(padapter, P2P_ROLE_DISABLE);
|
||||
|
|
|
@ -55,10 +55,10 @@ atomic_t _malloc_size = ATOMIC_INIT(0);
|
|||
* @return: one of RTW_STATUS_CODE
|
||||
*/
|
||||
inline int RTW_STATUS_CODE(int error_code){
|
||||
if(error_code >=0)
|
||||
if (error_code >=0)
|
||||
return _SUCCESS;
|
||||
|
||||
switch(error_code) {
|
||||
switch (error_code) {
|
||||
//case -ETIMEDOUT:
|
||||
// return RTW_STATUS_TIMEDOUT;
|
||||
default:
|
||||
|
@ -76,17 +76,17 @@ u32 rtw_atoi(u8* s)
|
|||
|
||||
int num=0,flag=0;
|
||||
int i;
|
||||
for(i=0;i<=strlen(s);i++)
|
||||
for (i=0;i<=strlen(s);i++)
|
||||
{
|
||||
if(s[i] >= '0' && s[i] <= '9')
|
||||
if (s[i] >= '0' && s[i] <= '9')
|
||||
num = num * 10 + s[i] -'0';
|
||||
else if(s[0] == '-' && i==0)
|
||||
else if (s[0] == '-' && i==0)
|
||||
flag =1;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if(flag == 1)
|
||||
if (flag == 1)
|
||||
num = num * -1;
|
||||
|
||||
return(num);
|
||||
|
@ -166,7 +166,7 @@ u8* _rtw_malloc(u32 sz)
|
|||
|
||||
#ifdef PLATFORM_LINUX
|
||||
#ifdef RTK_DMP_PLATFORM
|
||||
if(sz > 0x4000)
|
||||
if (sz > 0x4000)
|
||||
pbuf = (u8 *)dvr_malloc(sz);
|
||||
else
|
||||
#endif
|
||||
|
@ -224,7 +224,7 @@ void _rtw_mfree(u8 *pbuf, u32 sz)
|
|||
|
||||
#ifdef PLATFORM_LINUX
|
||||
#ifdef RTK_DMP_PLATFORM
|
||||
if(sz > 0x4000)
|
||||
if (sz > 0x4000)
|
||||
dvr_free(pbuf);
|
||||
else
|
||||
#endif
|
||||
|
@ -306,7 +306,7 @@ void rtw_update_mem_stat(u8 flag, u32 sz)
|
|||
static u32 update_time = 0;
|
||||
int peak, alloc;
|
||||
|
||||
if(!update_time) {
|
||||
if (!update_time) {
|
||||
ATOMIC_SET(&rtw_dbg_mem_stat.vir_alloc,0);
|
||||
ATOMIC_SET(&rtw_dbg_mem_stat.vir_peak,0);
|
||||
ATOMIC_SET(&rtw_dbg_mem_stat.vir_alloc_err,0);
|
||||
|
@ -315,7 +315,7 @@ void rtw_update_mem_stat(u8 flag, u32 sz)
|
|||
ATOMIC_SET(&rtw_dbg_mem_stat.phy_alloc_err,0);
|
||||
}
|
||||
|
||||
switch(flag) {
|
||||
switch (flag) {
|
||||
case MEM_STAT_VIR_ALLOC_SUCCESS:
|
||||
alloc = ATOMIC_ADD_RETURN(&rtw_dbg_mem_stat.vir_alloc, sz);
|
||||
peak=ATOMIC_READ(&rtw_dbg_mem_stat.vir_peak);
|
||||
|
@ -434,7 +434,7 @@ inline u8* dbg_rtw_malloc(u32 sz, const char *func, int line)
|
|||
{
|
||||
u8 *p;
|
||||
|
||||
if((sz)>4096)
|
||||
if ((sz)>4096)
|
||||
DBG_871X("DBG_MEM_ALLOC !!!!!!!!!!!!!! %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
|
||||
|
||||
p=_rtw_malloc((sz));
|
||||
|
@ -451,7 +451,7 @@ inline u8* dbg_rtw_zmalloc(u32 sz, const char *func, int line)
|
|||
{
|
||||
u8 *p;
|
||||
|
||||
if((sz)>4096)
|
||||
if ((sz)>4096)
|
||||
DBG_871X("DBG_MEM_ALLOC !!!!!!!!!!!!!! %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
|
||||
|
||||
p = _rtw_zmalloc((sz));
|
||||
|
@ -467,7 +467,7 @@ inline u8* dbg_rtw_zmalloc(u32 sz, const char *func, int line)
|
|||
|
||||
inline void dbg_rtw_mfree(u8 *pbuf, u32 sz, const char *func, int line)
|
||||
{
|
||||
if((sz)>4096)
|
||||
if ((sz)>4096)
|
||||
DBG_871X("DBG_MEM_ALLOC !!!!!!!!!!!!!! %s:%d %s(%p,%d)\n", func, line, __FUNCTION__, (pbuf), (sz));
|
||||
|
||||
_rtw_mfree((pbuf), (sz));
|
||||
|
@ -484,13 +484,13 @@ void* rtw_malloc2d(int h, int w, int size)
|
|||
int j;
|
||||
|
||||
void **a = (void **) rtw_zmalloc( h*sizeof(void *) + h*w*size );
|
||||
if(a == NULL)
|
||||
if (a == NULL)
|
||||
{
|
||||
DBG_871X("%s: alloc memory fail!\n", __FUNCTION__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for( j=0; j<h; j++ )
|
||||
for ( j=0; j<h; j++ )
|
||||
a[j] = ((char *)(a+h)) + j*w*size;
|
||||
|
||||
return a;
|
||||
|
@ -583,10 +583,10 @@ struct sk_buff * dev_alloc_skb(unsigned int size)
|
|||
|
||||
//skb = (struct sk_buff *)_rtw_zmalloc(sizeof(struct sk_buff)); // for skb->len, etc.
|
||||
skb = (struct sk_buff *)_rtw_malloc(sizeof(struct sk_buff));
|
||||
if(!skb)
|
||||
if (!skb)
|
||||
goto out;
|
||||
data = _rtw_malloc(size);
|
||||
if(!data)
|
||||
if (!data)
|
||||
goto nodata;
|
||||
|
||||
skb->head = (unsigned char*)data;
|
||||
|
@ -608,10 +608,10 @@ goto out;
|
|||
void dev_kfree_skb_any(struct sk_buff *skb)
|
||||
{
|
||||
//printf("%s()-%d: skb->head = %p\n", __FUNCTION__, __LINE__, skb->head);
|
||||
if(skb->head)
|
||||
if (skb->head)
|
||||
_rtw_mfree(skb->head, 0);
|
||||
//printf("%s()-%d: skb = %p\n", __FUNCTION__, __LINE__, skb);
|
||||
if(skb)
|
||||
if (skb)
|
||||
_rtw_mfree((u8 *)skb, 0);
|
||||
}
|
||||
struct sk_buff *skb_clone(const struct sk_buff *skb)
|
||||
|
@ -745,7 +745,7 @@ void _rtw_init_sema(_sema *sema, int init_val)
|
|||
#endif
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
if(*sema == NULL)
|
||||
if (*sema == NULL)
|
||||
*sema = CreateSemaphore(NULL, init_val, SEMA_UPBND, NULL);
|
||||
#endif
|
||||
|
||||
|
@ -801,14 +801,14 @@ u32 _rtw_down_sema(_sema *sema)
|
|||
#endif
|
||||
#ifdef PLATFORM_OS_XP
|
||||
|
||||
if(STATUS_SUCCESS == KeWaitForSingleObject(sema, Executive, KernelMode, TRUE, NULL))
|
||||
if (STATUS_SUCCESS == KeWaitForSingleObject(sema, Executive, KernelMode, TRUE, NULL))
|
||||
return _SUCCESS;
|
||||
else
|
||||
return _FAIL;
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_OS_CE
|
||||
if(WAIT_OBJECT_0 == WaitForSingleObject(*sema, INFINITE ))
|
||||
if (WAIT_OBJECT_0 == WaitForSingleObject(*sema, INFINITE ))
|
||||
return _SUCCESS;
|
||||
else
|
||||
return _FAIL;
|
||||
|
@ -903,7 +903,7 @@ void _rtw_spinlock_free(_lock *plock)
|
|||
extern PADAPTER prtw_lock;
|
||||
|
||||
void rtw_mtx_lock(_lock *plock){
|
||||
if(prtw_lock){
|
||||
if (prtw_lock){
|
||||
mtx_lock(&prtw_lock->glock);
|
||||
}
|
||||
else{
|
||||
|
@ -911,7 +911,7 @@ void rtw_mtx_lock(_lock *plock){
|
|||
}
|
||||
}
|
||||
void rtw_mtx_unlock(_lock *plock){
|
||||
if(prtw_lock){
|
||||
if (prtw_lock){
|
||||
mtx_unlock(&prtw_lock->glock);
|
||||
}
|
||||
else{
|
||||
|
@ -1182,7 +1182,7 @@ void rtw_usleep_os(int us)
|
|||
void _rtw_mdelay_os(int ms, const char *func, const int line)
|
||||
{
|
||||
#if 0
|
||||
if(ms>10)
|
||||
if (ms>10)
|
||||
DBG_871X("%s:%d %s(%d)\n", func, line, __FUNCTION__, ms);
|
||||
rtw_msleep_os(ms);
|
||||
return;
|
||||
|
@ -1207,7 +1207,7 @@ void _rtw_udelay_os(int us, const char *func, const int line)
|
|||
{
|
||||
|
||||
#if 0
|
||||
if(us > 1000) {
|
||||
if (us > 1000) {
|
||||
DBG_871X("%s:%d %s(%d)\n", func, line, __FUNCTION__, us);
|
||||
rtw_usleep_os(us);
|
||||
return;
|
||||
|
@ -1478,7 +1478,7 @@ static int openFile(struct file **fpp, char *path, int flag, int mode)
|
|||
struct file *fp;
|
||||
|
||||
fp=filp_open(path, flag, mode);
|
||||
if(IS_ERR(fp)) {
|
||||
if (IS_ERR(fp)) {
|
||||
*fpp=NULL;
|
||||
return PTR_ERR(fp);
|
||||
}
|
||||
|
@ -1506,11 +1506,11 @@ static int readFile(struct file *fp,char *buf,int len)
|
|||
if (!fp->f_op || !fp->f_op->read)
|
||||
return -EPERM;
|
||||
|
||||
while(sum<len) {
|
||||
while (sum<len) {
|
||||
rlen=fp->f_op->read(fp,buf+sum,len-sum, &fp->f_pos);
|
||||
if(rlen>0)
|
||||
if (rlen>0)
|
||||
sum+=rlen;
|
||||
else if(0 != rlen)
|
||||
else if (0 != rlen)
|
||||
return rlen;
|
||||
else
|
||||
break;
|
||||
|
@ -1527,11 +1527,11 @@ static int writeFile(struct file *fp,char *buf,int len)
|
|||
if (!fp->f_op || !fp->f_op->write)
|
||||
return -EPERM;
|
||||
|
||||
while(sum<len) {
|
||||
while (sum<len) {
|
||||
wlen=fp->f_op->write(fp,buf+sum,len-sum, &fp->f_pos);
|
||||
if(wlen>0)
|
||||
if (wlen>0)
|
||||
sum+=wlen;
|
||||
else if(0 != wlen)
|
||||
else if (0 != wlen)
|
||||
return wlen;
|
||||
else
|
||||
break;
|
||||
|
@ -1554,13 +1554,13 @@ static int isFileReadable(char *path)
|
|||
char buf;
|
||||
|
||||
fp=filp_open(path, O_RDONLY, 0);
|
||||
if(IS_ERR(fp)) {
|
||||
if (IS_ERR(fp)) {
|
||||
ret = PTR_ERR(fp);
|
||||
}
|
||||
else {
|
||||
oldfs = get_fs(); set_fs(get_ds());
|
||||
|
||||
if(1!=readFile(fp, &buf, 1))
|
||||
if (1!=readFile(fp, &buf, 1))
|
||||
ret = PTR_ERR(fp);
|
||||
|
||||
set_fs(oldfs);
|
||||
|
@ -1582,8 +1582,8 @@ static int retriveFromFile(char *path, u8* buf, u32 sz)
|
|||
mm_segment_t oldfs;
|
||||
struct file *fp;
|
||||
|
||||
if(path && buf) {
|
||||
if( 0 == (ret=openFile(&fp,path, O_RDONLY, 0)) ){
|
||||
if (path && buf) {
|
||||
if ( 0 == (ret=openFile(&fp,path, O_RDONLY, 0)) ){
|
||||
DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp);
|
||||
|
||||
oldfs = get_fs(); set_fs(get_ds());
|
||||
|
@ -1616,8 +1616,8 @@ static int storeToFile(char *path, u8* buf, u32 sz)
|
|||
mm_segment_t oldfs;
|
||||
struct file *fp;
|
||||
|
||||
if(path && buf) {
|
||||
if( 0 == (ret=openFile(&fp, path, O_CREAT|O_WRONLY, 0666)) ) {
|
||||
if (path && buf) {
|
||||
if ( 0 == (ret=openFile(&fp, path, O_CREAT|O_WRONLY, 0666)) ) {
|
||||
DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp);
|
||||
|
||||
oldfs = get_fs(); set_fs(get_ds());
|
||||
|
@ -1646,7 +1646,7 @@ static int storeToFile(char *path, u8* buf, u32 sz)
|
|||
int rtw_is_file_readable(char *path)
|
||||
{
|
||||
#ifdef PLATFORM_LINUX
|
||||
if(isFileReadable(path) == 0)
|
||||
if (isFileReadable(path) == 0)
|
||||
return _TRUE;
|
||||
else
|
||||
return _FALSE;
|
||||
|
@ -1746,12 +1746,12 @@ void rtw_free_netdev(struct net_device * netdev)
|
|||
{
|
||||
struct rtw_netdev_priv_indicator *pnpi;
|
||||
|
||||
if(!netdev)
|
||||
if (!netdev)
|
||||
goto RETURN;
|
||||
|
||||
pnpi = netdev_priv(netdev);
|
||||
|
||||
if(!pnpi->priv)
|
||||
if (!pnpi->priv)
|
||||
goto RETURN;
|
||||
|
||||
rtw_vmfree(pnpi->priv, pnpi->sizeof_priv);
|
||||
|
@ -1772,19 +1772,19 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
|
|||
struct rereg_nd_name_data *rereg_priv;
|
||||
int ret;
|
||||
|
||||
if(!padapter)
|
||||
if (!padapter)
|
||||
goto error;
|
||||
|
||||
rereg_priv = &padapter->rereg_nd_name_priv;
|
||||
|
||||
//free the old_pnetdev
|
||||
if(rereg_priv->old_pnetdev) {
|
||||
if (rereg_priv->old_pnetdev) {
|
||||
free_netdev(rereg_priv->old_pnetdev);
|
||||
rereg_priv->old_pnetdev = NULL;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
|
||||
if(!rtnl_is_locked())
|
||||
if (!rtnl_is_locked())
|
||||
unregister_netdev(cur_pnetdev);
|
||||
else
|
||||
#endif
|
||||
|
@ -1807,7 +1807,7 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
|
|||
_rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
|
||||
if(!rtnl_is_locked())
|
||||
if (!rtnl_is_locked())
|
||||
ret = register_netdev(pnetdev);
|
||||
else
|
||||
#endif
|
||||
|
|
|
@ -131,7 +131,7 @@ static u8 rtw_pci_platform_switch_device_pci_aspm(_adapter *padapter, u8 value)
|
|||
|
||||
error = pci_write_config_byte(pdvobjpriv->ppcidev, 0x80, value);
|
||||
|
||||
if(error != 0)
|
||||
if (error != 0)
|
||||
{
|
||||
bresult = _FALSE;
|
||||
DBG_871X("rtw_pci_platform_switch_device_pci_aspm error (%d)\n",error);
|
||||
|
@ -151,12 +151,12 @@ static u8 rtw_pci_switch_clk_req(_adapter *padapter, u8 value)
|
|||
|
||||
buffer = value;
|
||||
|
||||
if(!padapter->hw_init_completed)
|
||||
if (!padapter->hw_init_completed)
|
||||
return bresult;
|
||||
|
||||
error = pci_write_config_byte(pdvobjpriv->ppcidev, 0x81, value);
|
||||
|
||||
if(error != 0)
|
||||
if (error != 0)
|
||||
{
|
||||
bresult = _FALSE;
|
||||
DBG_871X("rtw_pci_switch_clk_req error (%d)\n",error);
|
||||
|
@ -746,10 +746,10 @@ void rtw_pci_disable_aspm(_adapter *padapter)
|
|||
|
||||
// We do not diable/enable ASPM by driver, in the future, the BIOS will enable host and NIC ASPM.
|
||||
// Advertised by SD1 victorh. Added by tynli. 2009.11.23.
|
||||
if(pdvobjpriv->const_pci_aspm == 0)
|
||||
if (pdvobjpriv->const_pci_aspm == 0)
|
||||
return;
|
||||
|
||||
if(!padapter->hw_init_completed)
|
||||
if (!padapter->hw_init_completed)
|
||||
return;
|
||||
|
||||
if (pcipriv->pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) {
|
||||
|
@ -781,7 +781,7 @@ void rtw_pci_disable_aspm(_adapter *padapter)
|
|||
|
||||
//When there exists anyone's BusNum, DevNum, and FuncNum that are set to 0xff,
|
||||
// we do not execute any action and return. Added by tynli.
|
||||
if( (pcipriv->busnumber == 0xff && pcipriv->devnumber == 0xff && pcipriv->funcnumber == 0xff) ||
|
||||
if ( (pcipriv->busnumber == 0xff && pcipriv->devnumber == 0xff && pcipriv->funcnumber == 0xff) ||
|
||||
(pcipriv->pcibridge_busnum == 0xff && pcipriv->pcibridge_devnum == 0xff && pcipriv->pcibridge_funcnum == 0xff) )
|
||||
{
|
||||
// Do Nothing!!
|
||||
|
@ -821,12 +821,12 @@ void rtw_pci_enable_aspm(_adapter *padapter)
|
|||
|
||||
// We do not diable/enable ASPM by driver, in the future, the BIOS will enable host and NIC ASPM.
|
||||
// Advertised by SD1 victorh. Added by tynli. 2009.11.23.
|
||||
if(pdvobjpriv->const_pci_aspm == 0)
|
||||
if (pdvobjpriv->const_pci_aspm == 0)
|
||||
return;
|
||||
|
||||
//When there exists anyone's BusNum, DevNum, and FuncNum that are set to 0xff,
|
||||
// we do not execute any action and return. Added by tynli.
|
||||
if( (pcipriv->busnumber == 0xff && pcipriv->devnumber == 0xff && pcipriv->funcnumber == 0xff) ||
|
||||
if ( (pcipriv->busnumber == 0xff && pcipriv->devnumber == 0xff && pcipriv->funcnumber == 0xff) ||
|
||||
(pcipriv->pcibridge_busnum == 0xff && pcipriv->pcibridge_devnum == 0xff && pcipriv->pcibridge_funcnum == 0xff) )
|
||||
{
|
||||
DBG_871X("rtw_pci_enable_aspm(): Fail to enable ASPM. Cannot find the Bus of PCI(Bridge).\n");
|
||||
|
@ -844,24 +844,24 @@ void rtw_pci_enable_aspm(_adapter *padapter)
|
|||
//NdisRawReadPortUlong((ULONG_PTR)PCI_CONF_DATA,&uDeviceASPMSupportSetting);
|
||||
pci_read_config_dword(bridge_pdev, (pcipriv->pcibridge_pciehdr_offset+0x0C), &u_device_aspmsupportsetting);
|
||||
DBG_871X("rtw_pci_enable_aspm(): Bridge ASPM support %x \n",u_device_aspmsupportsetting);
|
||||
if(((u_device_aspmsupportsetting & BIT(11)) != BIT(11)) || ((u_device_aspmsupportsetting & BIT(10)) != BIT(10)))
|
||||
if (((u_device_aspmsupportsetting & BIT(11)) != BIT(11)) || ((u_device_aspmsupportsetting & BIT(10)) != BIT(10)))
|
||||
{
|
||||
if(pdvobjpriv->const_devicepci_aspm_setting == 3)
|
||||
if (pdvobjpriv->const_devicepci_aspm_setting == 3)
|
||||
{
|
||||
DBG_871X("rtw_pci_enable_aspm(): Bridge not support L0S or L1\n");
|
||||
return;
|
||||
}
|
||||
else if(pdvobjpriv->const_devicepci_aspm_setting == 2)
|
||||
else if (pdvobjpriv->const_devicepci_aspm_setting == 2)
|
||||
{
|
||||
if((u_device_aspmsupportsetting & BIT(11)) != BIT(11))
|
||||
if ((u_device_aspmsupportsetting & BIT(11)) != BIT(11))
|
||||
{
|
||||
DBG_871X("rtw_pci_enable_aspm(): Bridge not support L1 \n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(pdvobjpriv->const_devicepci_aspm_setting == 1)
|
||||
else if (pdvobjpriv->const_devicepci_aspm_setting == 1)
|
||||
{
|
||||
if((u_device_aspmsupportsetting & BIT(10)) != BIT(10))
|
||||
if ((u_device_aspmsupportsetting & BIT(10)) != BIT(10))
|
||||
{
|
||||
DBG_871X("rtw_pci_enable_aspm(): Bridge not support L0s \n");
|
||||
return;
|
||||
|
@ -1061,7 +1061,7 @@ static void rtw_pci_update_default_setting(_adapter *padapter)
|
|||
|
||||
pwrpriv->b_support_aspm = b_support_aspm;
|
||||
|
||||
/*if(pAdapter->MgntInfo.CustomerID == RT_CID_TOSHIBA &&
|
||||
/*if (pAdapter->MgntInfo.CustomerID == RT_CID_TOSHIBA &&
|
||||
pcipriv->pcibridge_vendor == PCI_BRIDGE_VENDOR_AMD &&
|
||||
!pcipriv->amd_l1_patch)
|
||||
b_support_backdoor = _FALSE;*/
|
||||
|
@ -1111,7 +1111,7 @@ static irqreturn_t rtw_pci_interrupt(int irq, void *priv, struct pt_regs *regs)
|
|||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
if(rtw_hal_interrupt_handler(adapter) == _FAIL)
|
||||
if (rtw_hal_interrupt_handler(adapter) == _FAIL)
|
||||
return IRQ_HANDLED;
|
||||
//return IRQ_NONE;
|
||||
|
||||
|
@ -1225,7 +1225,7 @@ _func_enter_;
|
|||
|
||||
/*find bridge info*/
|
||||
pcipriv->pcibridge_vendor = PCI_BRIDGE_VENDOR_UNKNOWN;
|
||||
if(bridge_pdev){
|
||||
if (bridge_pdev){
|
||||
pcipriv->pcibridge_vendorid = bridge_pdev->vendor;
|
||||
for (tmp = 0; tmp < PCI_BRIDGE_VENDOR_MAX; tmp++) {
|
||||
if (bridge_pdev->vendor == pcibridge_vendors[tmp]) {
|
||||
|
@ -1237,7 +1237,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
//if (pcipriv->pcibridge_vendor != PCI_BRIDGE_VENDOR_UNKNOWN) {
|
||||
if(bridge_pdev){
|
||||
if (bridge_pdev){
|
||||
pcipriv->pcibridge_busnum = bridge_pdev->bus->number;
|
||||
pcipriv->pcibridge_devnum = PCI_SLOT(bridge_pdev->devfn);
|
||||
pcipriv->pcibridge_funcnum = PCI_FUNC(bridge_pdev->devfn);
|
||||
|
@ -1380,7 +1380,7 @@ static void decide_chip_type_by_pci_device_id(_adapter *padapter, struct pci_dev
|
|||
//
|
||||
// Decide hardware type here.
|
||||
//
|
||||
if( deviceid == HAL_HW_PCI_8185_DEVICE_ID ||
|
||||
if ( deviceid == HAL_HW_PCI_8185_DEVICE_ID ||
|
||||
deviceid == HAL_HW_PCI_8188_DEVICE_ID ||
|
||||
deviceid == HAL_HW_PCI_8198_DEVICE_ID)
|
||||
{
|
||||
|
@ -1407,7 +1407,7 @@ static void decide_chip_type_by_pci_device_id(_adapter *padapter, struct pci_dev
|
|||
// 8192e and and 8192se may have the same device ID 8192. However, their Revision
|
||||
// ID is different
|
||||
// Added for 92DE. We deferentiate it from SVID,SDID.
|
||||
if( pdev->subsystem_vendor == 0x10EC && pdev->subsystem_device == 0xE020){
|
||||
if ( pdev->subsystem_vendor == 0x10EC && pdev->subsystem_device == 0xE020){
|
||||
padapter->HardwareType = HARDWARE_TYPE_RTL8192DE;
|
||||
DBG_871X("Adapter(8192DE) is found - VendorID/DeviceID/RID=%X/%X/%X\n", venderid, deviceid, revisionid);
|
||||
}else{
|
||||
|
@ -1427,7 +1427,7 @@ static void decide_chip_type_by_pci_device_id(_adapter *padapter, struct pci_dev
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(deviceid==HAL_HW_PCI_8723E_DEVICE_ID )
|
||||
else if (deviceid==HAL_HW_PCI_8723E_DEVICE_ID )
|
||||
{//RTL8723E may have the same device ID with RTL8192CET
|
||||
padapter->HardwareType = HARDWARE_TYPE_RTL8723AE;
|
||||
DBG_871X("Adapter(8723 PCI-E) is found - VendorID/DeviceID=%x/%x\n", venderid, deviceid);
|
||||
|
@ -1493,7 +1493,7 @@ static void pci_intf_stop(_adapter *padapter)
|
|||
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+pci_intf_stop\n"));
|
||||
|
||||
//Disable hw interrupt
|
||||
if(padapter->bSurpriseRemoved == _FALSE)
|
||||
if (padapter->bSurpriseRemoved == _FALSE)
|
||||
{
|
||||
//device still exists, so driver can do i/o operation
|
||||
rtw_hal_disable_interrupt(padapter);
|
||||
|
@ -1530,7 +1530,7 @@ static void rtw_dev_unload(_adapter *padapter)
|
|||
|
||||
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+rtw_dev_unload\n"));
|
||||
|
||||
if(padapter->bup == _TRUE)
|
||||
if (padapter->bup == _TRUE)
|
||||
{
|
||||
DBG_871X("+rtw_dev_unload\n");
|
||||
|
||||
|
@ -1541,7 +1541,7 @@ static void rtw_dev_unload(_adapter *padapter)
|
|||
#endif
|
||||
|
||||
//s3.
|
||||
if(padapter->intf_stop)
|
||||
if (padapter->intf_stop)
|
||||
{
|
||||
padapter->intf_stop(padapter);
|
||||
}
|
||||
|
@ -1551,7 +1551,7 @@ static void rtw_dev_unload(_adapter *padapter)
|
|||
|
||||
|
||||
//s5.
|
||||
if(padapter->bSurpriseRemoved == _FALSE)
|
||||
if (padapter->bSurpriseRemoved == _FALSE)
|
||||
{
|
||||
DBG_871X("r871x_dev_unload()->rtl871x_hal_deinit()\n");
|
||||
rtw_hal_deinit(padapter);
|
||||
|
@ -1581,13 +1581,13 @@ static void disable_ht_for_spec_devid(const struct pci_device_id *pdid)
|
|||
int i;
|
||||
int num = sizeof(specific_device_id_tbl)/sizeof(struct specific_device_id);
|
||||
|
||||
for(i=0; i<num; i++)
|
||||
for (i=0; i<num; i++)
|
||||
{
|
||||
vid = specific_device_id_tbl[i].idVendor;
|
||||
pid = specific_device_id_tbl[i].idProduct;
|
||||
flags = specific_device_id_tbl[i].flags;
|
||||
|
||||
if((pdid->vendor==vid) && (pdid->device==pid) && (flags&SPEC_DEV_ID_DISABLE_HT))
|
||||
if ((pdid->vendor==vid) && (pdid->device==pid) && (flags&SPEC_DEV_ID_DISABLE_HT))
|
||||
{
|
||||
rtw_ht_enable = 0;
|
||||
rtw_cbw40_enable = 0;
|
||||
|
@ -1650,7 +1650,7 @@ _adapter *rtw_pci_if1_init(struct dvobj_priv * dvobj, struct pci_dev *pdev, cons
|
|||
decide_chip_type_by_pci_device_id(padapter, pdev);
|
||||
#endif
|
||||
|
||||
if((pnetdev = rtw_init_netdev(padapter)) == NULL) {
|
||||
if ((pnetdev = rtw_init_netdev(padapter)) == NULL) {
|
||||
goto free_adapter;
|
||||
}
|
||||
|
||||
|
@ -1664,7 +1664,7 @@ _adapter *rtw_pci_if1_init(struct dvobj_priv * dvobj, struct pci_dev *pdev, cons
|
|||
padapter = rtw_netdev_priv(pnetdev);
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
if(rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj)) != 0) {
|
||||
if (rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj)) != 0) {
|
||||
goto free_adapter;
|
||||
}
|
||||
#endif //CONFIG_IOCTL_CFG80211
|
||||
|
@ -1693,12 +1693,12 @@ _adapter *rtw_pci_if1_init(struct dvobj_priv * dvobj, struct pci_dev *pdev, cons
|
|||
rtw_hal_read_chip_info(padapter);
|
||||
|
||||
//step 5.
|
||||
if(rtw_init_drv_sw(padapter) ==_FAIL) {
|
||||
if (rtw_init_drv_sw(padapter) ==_FAIL) {
|
||||
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("Initialize driver software resource Failed!\n"));
|
||||
goto free_hal_data;
|
||||
}
|
||||
|
||||
if(rtw_hal_inirp_init(padapter) ==_FAIL) {
|
||||
if (rtw_hal_inirp_init(padapter) ==_FAIL) {
|
||||
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("Initialize PCI desc ring Failed!\n"));
|
||||
goto free_hal_data;
|
||||
}
|
||||
|
@ -1748,11 +1748,11 @@ _adapter *rtw_pci_if1_init(struct dvobj_priv * dvobj, struct pci_dev *pdev, cons
|
|||
status = _SUCCESS;
|
||||
|
||||
free_hal_data:
|
||||
if(status != _SUCCESS && padapter->HalData)
|
||||
if (status != _SUCCESS && padapter->HalData)
|
||||
rtw_mfree(padapter->HalData, sizeof(*(padapter->HalData)));
|
||||
|
||||
free_wdev:
|
||||
if(status != _SUCCESS) {
|
||||
if (status != _SUCCESS) {
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_wdev_unregister(padapter->rtw_wdev);
|
||||
rtw_wdev_free(padapter->rtw_wdev);
|
||||
|
@ -1778,7 +1778,7 @@ static void rtw_pci_if1_deinit(_adapter *if1)
|
|||
|
||||
// padapter->intf_stop(padapter);
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
rtw_disassoc_cmd(if1, 0, _FALSE);
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
@ -1789,7 +1789,7 @@ static void rtw_pci_if1_deinit(_adapter *if1)
|
|||
#endif
|
||||
|
||||
if (if1->DriverState != DRIVER_DISAPPEAR) {
|
||||
if(pnetdev) {
|
||||
if (pnetdev) {
|
||||
unregister_netdev(pnetdev); //will call netdev_close()
|
||||
rtw_proc_remove_one(pnetdev);
|
||||
}
|
||||
|
@ -1814,7 +1814,7 @@ static void rtw_pci_if1_deinit(_adapter *if1)
|
|||
rtw_hal_inirp_deinit(if1);
|
||||
rtw_free_drv_sw(if1);
|
||||
|
||||
if(pnetdev)
|
||||
if (pnetdev)
|
||||
rtw_free_netdev(pnetdev);
|
||||
|
||||
#ifdef CONFIG_PLATFORM_RTD2880B
|
||||
|
@ -1858,7 +1858,7 @@ static int rtw_drv_init(struct pci_dev *pdev, const struct pci_device_id *pdid)
|
|||
|
||||
/* Initialize if2 */
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if((if2 = rtw_drv_if2_init(if1, NULL, pci_set_intf_ops)) == NULL) {
|
||||
if ((if2 = rtw_drv_if2_init(if1, NULL, pci_set_intf_ops)) == NULL) {
|
||||
goto free_if1;
|
||||
}
|
||||
#endif
|
||||
|
@ -1873,7 +1873,7 @@ static int rtw_drv_init(struct pci_dev *pdev, const struct pci_device_id *pdid)
|
|||
status = _SUCCESS;
|
||||
|
||||
free_if2:
|
||||
if(status != _SUCCESS && if2) {
|
||||
if (status != _SUCCESS && if2) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
rtw_drv_if2_stop(if2);
|
||||
rtw_drv_if2_free(if2);
|
||||
|
@ -1913,7 +1913,7 @@ _func_exit_;
|
|||
padapter->bSurpriseRemoved = _FALSE; // always trate as device exists
|
||||
// this will let the driver to disable it's interrupt
|
||||
#else
|
||||
if(pci_drvpriv.drv_registered == _TRUE)
|
||||
if (pci_drvpriv.drv_registered == _TRUE)
|
||||
{
|
||||
//DBG_871X("r871xu_dev_remove():padapter->bSurpriseRemoved == _TRUE\n");
|
||||
padapter->bSurpriseRemoved = _TRUE;
|
||||
|
|
|
@ -70,7 +70,7 @@ int rtw_os_recvbuf_resource_alloc(_adapter *padapter, struct recv_buf *precvbuf)
|
|||
|
||||
precvbuf->irp_pending = _FALSE;
|
||||
precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if(precvbuf->purb == NULL){
|
||||
if (precvbuf->purb == NULL){
|
||||
res = _FAIL;
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ int rtw_os_recvbuf_resource_alloc(_adapter *padapter, struct recv_buf *precvbuf)
|
|||
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
precvbuf->pallocated_buf = rtw_usb_buffer_alloc(pusbd, (size_t)precvbuf->alloc_sz, &precvbuf->dma_transfer_addr);
|
||||
precvbuf->pbuf = precvbuf->pallocated_buf;
|
||||
if(precvbuf->pallocated_buf == NULL)
|
||||
if (precvbuf->pallocated_buf == NULL)
|
||||
return _FAIL;
|
||||
#endif //CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
|
||||
|
@ -116,7 +116,7 @@ int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf)
|
|||
|
||||
#endif //CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
|
||||
if(precvbuf->purb)
|
||||
if (precvbuf->purb)
|
||||
{
|
||||
//usb_kill_urb(precvbuf->purb);
|
||||
usb_free_urb(precvbuf->purb);
|
||||
|
@ -125,7 +125,7 @@ int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf)
|
|||
#endif //CONFIG_USB_HCI
|
||||
|
||||
|
||||
if(precvbuf->pskb)
|
||||
if (precvbuf->pskb)
|
||||
dev_kfree_skb_any(precvbuf->pskb);
|
||||
|
||||
|
||||
|
@ -144,7 +144,7 @@ void rtw_handle_tkip_mic_err(_adapter *padapter,u8 bgroup)
|
|||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
u32 cur_time = 0;
|
||||
|
||||
if( psecuritypriv->last_mic_err_time == 0 )
|
||||
if ( psecuritypriv->last_mic_err_time == 0 )
|
||||
{
|
||||
psecuritypriv->last_mic_err_time = rtw_get_current_time();
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ void rtw_handle_tkip_mic_err(_adapter *padapter,u8 bgroup)
|
|||
{
|
||||
cur_time = rtw_get_current_time();
|
||||
|
||||
if( cur_time - psecuritypriv->last_mic_err_time < 60*HZ )
|
||||
if ( cur_time - psecuritypriv->last_mic_err_time < 60*HZ )
|
||||
{
|
||||
psecuritypriv->btkip_countermeasure = _TRUE;
|
||||
psecuritypriv->last_mic_err_time = 0;
|
||||
|
@ -218,7 +218,7 @@ void rtw_hostapd_mlme_rx(_adapter *padapter, union recv_frame *precv_frame)
|
|||
skb->len = precv_frame->u.hdr.len;
|
||||
|
||||
//pskb_copy = skb_copy(skb, GFP_ATOMIC);
|
||||
// if(skb == NULL) goto _exit;
|
||||
// if (skb == NULL) goto _exit;
|
||||
|
||||
skb->dev = pmgnt_netdev;
|
||||
skb->ip_summed = CHECKSUM_NONE;
|
||||
|
@ -275,7 +275,7 @@ _func_enter_;
|
|||
#endif
|
||||
|
||||
skb = precv_frame->u.hdr.pkt;
|
||||
if(skb == NULL)
|
||||
if (skb == NULL)
|
||||
{
|
||||
RT_TRACE(_module_recv_osdep_c_,_drv_err_,("rtw_recv_indicatepkt():skb==NULL something wrong!!!!\n"));
|
||||
goto _recv_indicatepkt_drop;
|
||||
|
@ -293,7 +293,7 @@ _func_enter_;
|
|||
|
||||
RT_TRACE(_module_recv_osdep_c_,_drv_info_,("\n skb->head=%p skb->data=%p skb->tail=%p skb->end=%p skb->len=%d\n", skb->head, skb->data, skb->tail, skb->end, skb->len));
|
||||
|
||||
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
||||
{
|
||||
_pkt *pskb2=NULL;
|
||||
struct sta_info *psta = NULL;
|
||||
|
@ -303,11 +303,11 @@ _func_enter_;
|
|||
|
||||
//DBG_871X("bmcast=%d\n", bmcast);
|
||||
|
||||
if(_rtw_memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)==_FALSE)
|
||||
if (_rtw_memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)==_FALSE)
|
||||
{
|
||||
//DBG_871X("not ap psta=%p, addr=%pM\n", psta, pattrib->dst);
|
||||
|
||||
if(bmcast)
|
||||
if (bmcast)
|
||||
{
|
||||
psta = rtw_get_bcmc_stainfo(padapter);
|
||||
pskb2 = skb_clone(skb, GFP_ATOMIC);
|
||||
|
@ -315,7 +315,7 @@ _func_enter_;
|
|||
psta = rtw_get_stainfo(pstapriv, pattrib->dst);
|
||||
}
|
||||
|
||||
if(psta)
|
||||
if (psta)
|
||||
{
|
||||
struct net_device *pnetdev= (struct net_device*)padapter->pnetdev;
|
||||
|
||||
|
@ -329,7 +329,7 @@ _func_enter_;
|
|||
|
||||
rtw_xmit_entry(skb, pnetdev);
|
||||
|
||||
if(bmcast)
|
||||
if (bmcast)
|
||||
skb = pskb2;
|
||||
else
|
||||
goto _recv_indicatepkt_end;
|
||||
|
@ -354,7 +354,7 @@ _func_enter_;
|
|||
rcu_read_unlock();
|
||||
#endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
|
||||
|
||||
if( br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE) )
|
||||
if ( br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE) )
|
||||
{
|
||||
int nat25_handle_frame(_adapter *priv, struct sk_buff *skb);
|
||||
if (nat25_handle_frame(padapter, skb) == -1) {
|
||||
|
@ -406,7 +406,7 @@ _func_exit_;
|
|||
_recv_indicatepkt_drop:
|
||||
|
||||
//enqueue back to free_recv_queue
|
||||
if(precv_frame)
|
||||
if (precv_frame)
|
||||
rtw_free_recvframe(precv_frame, pfree_recv_queue);
|
||||
|
||||
return _FAIL;
|
||||
|
@ -429,7 +429,7 @@ void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf)
|
|||
precvbuf->pskb = NULL;
|
||||
precvbuf->reuse = _FALSE;
|
||||
|
||||
if(precvbuf->irp_pending == _FALSE)
|
||||
if (precvbuf->irp_pending == _FALSE)
|
||||
{
|
||||
rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
|
||||
}
|
||||
|
|
|
@ -230,8 +230,8 @@ exit_proc:
|
|||
int rtw_android_cmdstr_to_num(char *cmdstr)
|
||||
{
|
||||
int cmd_num;
|
||||
for(cmd_num=0 ; cmd_num<ANDROID_WIFI_CMD_MAX; cmd_num++)
|
||||
if(0 == strnicmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])) )
|
||||
for (cmd_num=0 ; cmd_num<ANDROID_WIFI_CMD_MAX; cmd_num++)
|
||||
if (0 == strnicmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])) )
|
||||
break;
|
||||
|
||||
return cmd_num;
|
||||
|
@ -244,7 +244,7 @@ int rtw_android_get_rssi(struct net_device *net, char *command, int total_len)
|
|||
struct wlan_network *pcur_network = &pmlmepriv->cur_network;
|
||||
int bytes_written = 0;
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) {
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) {
|
||||
bytes_written += snprintf(&command[bytes_written], total_len, "%s rssi %d",
|
||||
pcur_network->network.Ssid.Ssid, padapter->recvpriv.rssi);
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ int get_int_from_command( char* pcmd )
|
|||
{
|
||||
int i = 0;
|
||||
|
||||
for( i = 0; i < strlen( pcmd ); i++ )
|
||||
for ( i = 0; i < strlen( pcmd ); i++ )
|
||||
{
|
||||
if ( pcmd[ i ] == '=' )
|
||||
{
|
||||
|
@ -370,7 +370,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
|
|||
|
||||
cmd_num = rtw_android_cmdstr_to_num(command);
|
||||
|
||||
switch(cmd_num) {
|
||||
switch (cmd_num) {
|
||||
case ANDROID_WIFI_CMD_START:
|
||||
//bytes_written = wl_android_wifi_on(net);
|
||||
goto response;
|
||||
|
@ -385,7 +385,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
|
|||
goto exit;
|
||||
}
|
||||
|
||||
switch(cmd_num) {
|
||||
switch (cmd_num) {
|
||||
|
||||
case ANDROID_WIFI_CMD_STOP:
|
||||
//bytes_written = wl_android_wifi_off(net);
|
||||
|
|
|
@ -542,11 +542,11 @@ _adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct sdio_device_i
|
|||
status = _SUCCESS;
|
||||
|
||||
free_hal_data:
|
||||
if(status != _SUCCESS && padapter->HalData)
|
||||
if (status != _SUCCESS && padapter->HalData)
|
||||
rtw_mfree(padapter->HalData, sizeof(*(padapter->HalData)));
|
||||
|
||||
free_wdev:
|
||||
if(status != _SUCCESS) {
|
||||
if (status != _SUCCESS) {
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_wdev_unregister(padapter->rtw_wdev);
|
||||
rtw_wdev_free(padapter->rtw_wdev);
|
||||
|
@ -570,7 +570,7 @@ static void rtw_sdio_if1_deinit(_adapter *if1)
|
|||
struct net_device *pnetdev = if1->pnetdev;
|
||||
struct mlme_priv *pmlmepriv= &if1->mlmepriv;
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
rtw_disassoc_cmd(if1, 0, _FALSE);
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
@ -580,8 +580,8 @@ static void rtw_sdio_if1_deinit(_adapter *if1)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
if(if1->DriverState != DRIVER_DISAPPEAR) {
|
||||
if(pnetdev) {
|
||||
if (if1->DriverState != DRIVER_DISAPPEAR) {
|
||||
if (pnetdev) {
|
||||
unregister_netdev(pnetdev); //will call netdev_close()
|
||||
rtw_proc_remove_one(pnetdev);
|
||||
}
|
||||
|
@ -606,7 +606,7 @@ static void rtw_sdio_if1_deinit(_adapter *if1)
|
|||
|
||||
rtw_free_drv_sw(if1);
|
||||
|
||||
if(pnetdev)
|
||||
if (pnetdev)
|
||||
rtw_free_netdev(pnetdev);
|
||||
|
||||
#ifdef CONFIG_PLATFORM_RTD2880B
|
||||
|
@ -655,7 +655,7 @@ static int rtw_drv_init(
|
|||
goto free_if2;
|
||||
|
||||
#ifdef CONFIG_GLOBAL_UI_PID
|
||||
if(ui_pid[1]!=0) {
|
||||
if (ui_pid[1]!=0) {
|
||||
DBG_871X("ui_pid[1]:%d\n",ui_pid[1]);
|
||||
rtw_signal_process(ui_pid[1], SIGUSR2);
|
||||
}
|
||||
|
@ -666,7 +666,7 @@ static int rtw_drv_init(
|
|||
status = _SUCCESS;
|
||||
|
||||
free_if2:
|
||||
if(status != _SUCCESS && if2) {
|
||||
if (status != _SUCCESS && if2) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
rtw_drv_if2_stop(if2);
|
||||
rtw_drv_if2_free(if2);
|
||||
|
@ -768,7 +768,7 @@ static int rtw_sdio_suspend(struct device *dev)
|
|||
while (pwrpriv->bips_processing == _TRUE)
|
||||
rtw_msleep_os(1);
|
||||
|
||||
if((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
|
||||
if ((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
|
||||
{
|
||||
DBG_871X("%s bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n", __FUNCTION__
|
||||
,padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved);
|
||||
|
@ -776,7 +776,7 @@ static int rtw_sdio_suspend(struct device *dev)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if(!padapter->pwrctrlpriv.wowlan_mode){
|
||||
if (!padapter->pwrctrlpriv.wowlan_mode){
|
||||
rtw_cancel_all_timer(padapter);
|
||||
|
||||
} else {
|
||||
|
@ -793,7 +793,7 @@ static int rtw_sdio_suspend(struct device *dev)
|
|||
//padapter->net_closed = _TRUE;
|
||||
//s1.
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if(pnetdev && !padapter->pwrctrlpriv.wowlan_mode)
|
||||
if (pnetdev && !padapter->pwrctrlpriv.wowlan_mode)
|
||||
{
|
||||
netif_carrier_off(pnetdev);
|
||||
rtw_netif_stop_queue(pnetdev);
|
||||
|
@ -801,7 +801,7 @@ static int rtw_sdio_suspend(struct device *dev)
|
|||
DBG_871X_LEVEL(_drv_always_, "wowlan_mode: NO netif_off and stop queuq\n");
|
||||
}
|
||||
#else
|
||||
if(pnetdev)
|
||||
if (pnetdev)
|
||||
{
|
||||
netif_carrier_off(pnetdev);
|
||||
rtw_netif_stop_queue(pnetdev);
|
||||
|
@ -809,7 +809,7 @@ static int rtw_sdio_suspend(struct device *dev)
|
|||
#endif
|
||||
#ifdef CONFIG_WOWLAN
|
||||
DBG_871X_LEVEL(_drv_always_, "wowlan_mode: %d\n", padapter->pwrctrlpriv.wowlan_mode);
|
||||
if(padapter->pwrctrlpriv.bSupportRemoteWakeup==_TRUE &&
|
||||
if (padapter->pwrctrlpriv.bSupportRemoteWakeup==_TRUE &&
|
||||
padapter->pwrctrlpriv.wowlan_mode==_TRUE){
|
||||
poidparam.subcode=WOWLAN_ENABLE;
|
||||
padapter->HalFunc.SetHwRegHandler(padapter,HW_VAR_WOWLAN,(u8 *)&poidparam);
|
||||
|
@ -822,7 +822,7 @@ static int rtw_sdio_suspend(struct device *dev)
|
|||
#endif //CONFIG_WOWLAN
|
||||
|
||||
#ifdef CONFIG_LAYER2_ROAMING_RESUME
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) )
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) )
|
||||
{
|
||||
DBG_871X("%s %s(" MAC_FMT "), length:%d assoc_ssid.length:%d\n",__FUNCTION__,
|
||||
pmlmepriv->cur_network.network.Ssid.Ssid,
|
||||
|
@ -835,7 +835,7 @@ static int rtw_sdio_suspend(struct device *dev)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if(!padapter->pwrctrlpriv.wowlan_mode){
|
||||
if (!padapter->pwrctrlpriv.wowlan_mode){
|
||||
//s2-2. indicate disconnect to os
|
||||
rtw_indicate_disconnect(padapter);
|
||||
//s2-3.
|
||||
|
@ -848,12 +848,12 @@ static int rtw_sdio_suspend(struct device *dev)
|
|||
|
||||
rtw_dev_unload(padapter);
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)){
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)){
|
||||
DBG_871X_LEVEL(_drv_always_, "%s: fw_under_survey\n", __func__);
|
||||
rtw_indicate_scan_done(padapter, 1);
|
||||
}
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING)){
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)){
|
||||
DBG_871X_LEVEL(_drv_always_, "%s: fw_under_linking\n", __func__);
|
||||
rtw_indicate_disconnect(padapter);
|
||||
}
|
||||
|
@ -862,11 +862,11 @@ static int rtw_sdio_suspend(struct device *dev)
|
|||
} else {
|
||||
DBG_871X_LEVEL(_drv_always_, "%s: wowmode suspending\n", __func__);
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)){
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)){
|
||||
DBG_871X_LEVEL(_drv_always_, "%s: fw_under_survey\n", __func__);
|
||||
rtw_indicate_scan_done(padapter, 1);
|
||||
}
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING)){
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)){
|
||||
DBG_871X_LEVEL(_drv_always_, "%s: fw_under_linking\n", __func__);
|
||||
rtw_indicate_disconnect(padapter);
|
||||
}
|
||||
|
@ -886,10 +886,10 @@ static int rtw_sdio_suspend(struct device *dev)
|
|||
|
||||
rtw_dev_unload(padapter);
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
rtw_indicate_scan_done(padapter, 1);
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
rtw_indicate_disconnect(padapter);
|
||||
|
||||
// interface deinit
|
||||
|
@ -990,7 +990,7 @@ int rtw_resume_process(_adapter *padapter)
|
|||
pwrpriv->bkeepfwalive = _FALSE;
|
||||
|
||||
DBG_871X("bkeepfwalive(%x)\n",pwrpriv->bkeepfwalive);
|
||||
if(pm_netdev_open(pnetdev,_TRUE) != 0) {
|
||||
if (pm_netdev_open(pnetdev,_TRUE) != 0) {
|
||||
ret = -1;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1038,7 +1038,7 @@ int rtw_resume_process(_adapter *padapter)
|
|||
pwrpriv->bkeepfwalive = _FALSE;
|
||||
|
||||
DBG_871X("bkeepfwalive(%x)\n",pwrpriv->bkeepfwalive);
|
||||
if(pm_netdev_open(pnetdev,_TRUE) != 0) {
|
||||
if (pm_netdev_open(pnetdev,_TRUE) != 0) {
|
||||
ret = -1;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1046,14 +1046,14 @@ int rtw_resume_process(_adapter *padapter)
|
|||
netif_device_attach(pnetdev);
|
||||
netif_carrier_on(pnetdev);
|
||||
#endif
|
||||
if( padapter->pid[1]!=0) {
|
||||
if ( padapter->pid[1]!=0) {
|
||||
DBG_871X("pid[1]:%d\n",padapter->pid[1]);
|
||||
rtw_signal_process(padapter->pid[1], SIGUSR2);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LAYER2_ROAMING_RESUME
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if(!padapter->pwrctrlpriv.wowlan_mode){
|
||||
if (!padapter->pwrctrlpriv.wowlan_mode){
|
||||
rtw_roaming(padapter, NULL);
|
||||
} else if (padapter->pwrctrlpriv.wowlan_wake_reason & FWDecisionDisconnect){
|
||||
rtw_indicate_disconnect(padapter);
|
||||
|
@ -1105,17 +1105,17 @@ static int rtw_sdio_resume(struct device *dev)
|
|||
|
||||
DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid);
|
||||
|
||||
if(pwrpriv->bInternalAutoSuspend ){
|
||||
if (pwrpriv->bInternalAutoSuspend ){
|
||||
ret = rtw_resume_process(padapter);
|
||||
} else {
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
rtw_resume_in_workqueue(pwrpriv);
|
||||
#elif defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if(rtw_is_earlysuspend_registered(pwrpriv) &&
|
||||
if (rtw_is_earlysuspend_registered(pwrpriv) &&
|
||||
!padapter->pwrctrlpriv.wowlan_mode) {
|
||||
#else
|
||||
if(rtw_is_earlysuspend_registered(pwrpriv)) {
|
||||
if (rtw_is_earlysuspend_registered(pwrpriv)) {
|
||||
#endif //CONFIG_WOWLAN
|
||||
//jeff: bypass resume here, do in late_resume
|
||||
pwrpriv->do_late_resume = _TRUE;
|
||||
|
@ -1171,7 +1171,7 @@ static int __init rtw_drv_entry(void)
|
|||
/*depends on sunxi power control */
|
||||
#if defined CONFIG_MMC_SUNXI_POWER_CONTROL
|
||||
|
||||
if(mod_sel == SUNXI_SDIO_WIFI_NUM_RTL8189ES)
|
||||
if (mod_sel == SUNXI_SDIO_WIFI_NUM_RTL8189ES)
|
||||
{
|
||||
rtl8189es_sdio_powerup();
|
||||
sunximmc_rescan_card(SDIOID, 1);
|
||||
|
@ -1183,7 +1183,7 @@ static int __init rtw_drv_entry(void)
|
|||
DBG_8192C("[rtl8189es] %s: mod_sel = %d is incorrect.\n", __FUNCTION__, mod_sel);
|
||||
}
|
||||
#endif // defined CONFIG_MMC_SUNXI_POWER_CONTROL
|
||||
if(ret != 0)
|
||||
if (ret != 0)
|
||||
goto exit;
|
||||
|
||||
#endif //CONFIG_PLATFORM_ARM_SUNxI
|
||||
|
@ -1283,7 +1283,7 @@ static void __exit rtw_drv_halt(void)
|
|||
#endif // CONFIG_RTL8188E
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if(mmc_host){
|
||||
if (mmc_host){
|
||||
mmc_host->pm_flags &= ~MMC_PM_KEEP_POWER;
|
||||
}
|
||||
#endif //CONFIG_WOWLAN
|
||||
|
|
|
@ -474,7 +474,7 @@ static u8 rtw_deinit_intf_priv(struct dvobj_priv *dvobj)
|
|||
u8 rst = _SUCCESS;
|
||||
|
||||
#ifdef CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC
|
||||
if(dvobj->usb_vendor_req_buf)
|
||||
if (dvobj->usb_vendor_req_buf)
|
||||
rtw_mfree(dvobj->usb_alloc_vendor_req_buf, MAX_USB_IO_CTL_SIZE);
|
||||
#endif
|
||||
|
||||
|
@ -699,7 +699,7 @@ static void usb_intf_stop(_adapter *padapter)
|
|||
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+usb_intf_stop\n"));
|
||||
|
||||
//disabel_hw_interrupt
|
||||
if(padapter->bSurpriseRemoved == _FALSE)
|
||||
if (padapter->bSurpriseRemoved == _FALSE)
|
||||
{
|
||||
//device still exists, so driver can do i/o operation
|
||||
//TODO:
|
||||
|
@ -724,7 +724,7 @@ static void rtw_dev_unload(_adapter *padapter)
|
|||
u8 val8;
|
||||
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+rtw_dev_unload\n"));
|
||||
|
||||
if(padapter->bup == _TRUE)
|
||||
if (padapter->bup == _TRUE)
|
||||
{
|
||||
DBG_871X("===> rtw_dev_unload\n");
|
||||
|
||||
|
@ -735,22 +735,22 @@ static void rtw_dev_unload(_adapter *padapter)
|
|||
#endif
|
||||
|
||||
//s3.
|
||||
if(padapter->intf_stop)
|
||||
if (padapter->intf_stop)
|
||||
{
|
||||
padapter->intf_stop(padapter);
|
||||
}
|
||||
|
||||
//s4.
|
||||
if(!padapter->pwrctrlpriv.bInternalAutoSuspend )
|
||||
if (!padapter->pwrctrlpriv.bInternalAutoSuspend )
|
||||
rtw_stop_drv_threads(padapter);
|
||||
|
||||
|
||||
//s5.
|
||||
if(padapter->bSurpriseRemoved == _FALSE)
|
||||
if (padapter->bSurpriseRemoved == _FALSE)
|
||||
{
|
||||
//DBG_871X("r871x_dev_unload()->rtl871x_hal_deinit()\n");
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if((padapter->pwrctrlpriv.bSupportRemoteWakeup==_TRUE)&&(padapter->pwrctrlpriv.wowlan_mode==_TRUE)){
|
||||
if ((padapter->pwrctrlpriv.bSupportRemoteWakeup==_TRUE)&&(padapter->pwrctrlpriv.wowlan_mode==_TRUE)){
|
||||
DBG_871X("%s bSupportWakeOnWlan==_TRUE do not run rtw_hal_deinit()\n",__FUNCTION__);
|
||||
}
|
||||
else
|
||||
|
@ -784,14 +784,14 @@ static void process_spec_devid(const struct usb_device_id *pdid)
|
|||
int i;
|
||||
int num = sizeof(specific_device_id_tbl)/sizeof(struct specific_device_id);
|
||||
|
||||
for(i=0; i<num; i++)
|
||||
for (i=0; i<num; i++)
|
||||
{
|
||||
vid = specific_device_id_tbl[i].idVendor;
|
||||
pid = specific_device_id_tbl[i].idProduct;
|
||||
flags = specific_device_id_tbl[i].flags;
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
if((pdid->idVendor==vid) && (pdid->idProduct==pid) && (flags&SPEC_DEV_ID_DISABLE_HT))
|
||||
if ((pdid->idVendor==vid) && (pdid->idProduct==pid) && (flags&SPEC_DEV_ID_DISABLE_HT))
|
||||
{
|
||||
rtw_ht_enable = 0;
|
||||
rtw_cbw40_enable = 0;
|
||||
|
@ -802,7 +802,7 @@ static void process_spec_devid(const struct usb_device_id *pdid)
|
|||
#ifdef RTK_DMP_PLATFORM
|
||||
// Change the ifname to wlan10 when PC side WFD dongle plugin on DMP platform.
|
||||
// It is used to distinguish between normal and PC-side wifi dongle/module.
|
||||
if((pdid->idVendor==vid) && (pdid->idProduct==pid) && (flags&SPEC_DEV_ID_ASSIGN_IFNAME))
|
||||
if ((pdid->idVendor==vid) && (pdid->idProduct==pid) && (flags&SPEC_DEV_ID_ASSIGN_IFNAME))
|
||||
{
|
||||
extern char* ifname;
|
||||
strncpy(ifname, "wlan10", 6);
|
||||
|
@ -822,14 +822,14 @@ int rtw_hw_suspend(_adapter *padapter )
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
|
||||
if ((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
|
||||
{
|
||||
DBG_871X("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n",
|
||||
padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved);
|
||||
goto error_exit;
|
||||
}
|
||||
|
||||
if(padapter)//system suspend
|
||||
if (padapter)//system suspend
|
||||
{
|
||||
LeaveAllPowerSaveMode(padapter);
|
||||
|
||||
|
@ -838,7 +838,7 @@ int rtw_hw_suspend(_adapter *padapter )
|
|||
pwrpriv->bips_processing = _TRUE;
|
||||
//padapter->net_closed = _TRUE;
|
||||
//s1.
|
||||
if(pnetdev)
|
||||
if (pnetdev)
|
||||
{
|
||||
netif_carrier_off(pnetdev);
|
||||
rtw_netif_stop_queue(pnetdev);
|
||||
|
@ -852,7 +852,7 @@ int rtw_hw_suspend(_adapter *padapter )
|
|||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
{
|
||||
_clr_fwstate_(pmlmepriv, _FW_LINKED);
|
||||
|
||||
|
@ -900,14 +900,14 @@ int rtw_hw_resume(_adapter *padapter)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if(padapter)//system resume
|
||||
if (padapter)//system resume
|
||||
{
|
||||
DBG_871X("==> rtw_hw_resume\n");
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
pwrpriv->bips_processing = _TRUE;
|
||||
rtw_reset_drv_sw(padapter);
|
||||
|
||||
if(pm_netdev_open(pnetdev,_FALSE) != 0)
|
||||
if (pm_netdev_open(pnetdev,_FALSE) != 0)
|
||||
{
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
goto error_exit;
|
||||
|
@ -916,7 +916,7 @@ int rtw_hw_resume(_adapter *padapter)
|
|||
netif_device_attach(pnetdev);
|
||||
netif_carrier_on(pnetdev);
|
||||
|
||||
if(!netif_queue_stopped(pnetdev))
|
||||
if (!netif_queue_stopped(pnetdev))
|
||||
netif_start_queue(pnetdev);
|
||||
else
|
||||
netif_wake_queue(pnetdev);
|
||||
|
@ -969,19 +969,19 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
|
|||
padapter->pwrctrlpriv.wowlan_mode = _FALSE;
|
||||
#endif
|
||||
|
||||
if((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
|
||||
if ((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
|
||||
{
|
||||
DBG_871X("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n",
|
||||
padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if(pwrpriv->bInternalAutoSuspend )
|
||||
if (pwrpriv->bInternalAutoSuspend )
|
||||
{
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
#ifdef SUPPORT_HW_RFOFF_DETECTED
|
||||
// The FW command register update must after MAC and FW init ready.
|
||||
if((padapter->bFWReady) && ( padapter->pwrctrlpriv.bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable ))
|
||||
if ((padapter->bFWReady) && ( padapter->pwrctrlpriv.bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable ))
|
||||
{
|
||||
u8 bOpen = _TRUE;
|
||||
rtw_interface_ps_func(padapter,HAL_USB_SELECT_SUSPEND,&bOpen);
|
||||
|
@ -997,14 +997,14 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
|
|||
_enter_pwrlock(&pwrpriv->lock);
|
||||
//padapter->net_closed = _TRUE;
|
||||
//s1.
|
||||
if(pnetdev)
|
||||
if (pnetdev)
|
||||
{
|
||||
netif_carrier_off(pnetdev);
|
||||
rtw_netif_stop_queue(pnetdev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if(padapter->pwrctrlpriv.bSupportRemoteWakeup==_TRUE&&padapter->pwrctrlpriv.wowlan_mode==_TRUE){
|
||||
if (padapter->pwrctrlpriv.bSupportRemoteWakeup==_TRUE&&padapter->pwrctrlpriv.wowlan_mode==_TRUE){
|
||||
//set H2C command
|
||||
poidparam.subcode=WOWLAN_ENABLE;
|
||||
padapter->HalFunc.SetHwRegHandler(padapter,HW_VAR_WOWLAN,(u8 *)&poidparam);
|
||||
|
@ -1018,7 +1018,7 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
|
|||
#endif //CONFIG_WOWLAN
|
||||
|
||||
#ifdef CONFIG_LAYER2_ROAMING_RESUME
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) )
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) )
|
||||
{
|
||||
//DBG_871X("%s:%d assoc_ssid:%s\n", __FUNCTION__, __LINE__, pmlmepriv->assoc_ssid.Ssid);
|
||||
DBG_871X("%s:%d %s(" MAC_FMT "), length:%d assoc_ssid.length:%d\n",__FUNCTION__, __LINE__,
|
||||
|
@ -1035,7 +1035,7 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
|
|||
//s2-3.
|
||||
rtw_free_assoc_resources(padapter, 1);
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if(!pwrpriv->bInternalAutoSuspend )
|
||||
if (!pwrpriv->bInternalAutoSuspend )
|
||||
#endif
|
||||
//s2-4.
|
||||
rtw_free_network_queue(padapter, _TRUE);
|
||||
|
@ -1047,10 +1047,10 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
|
|||
#endif
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
rtw_indicate_scan_done(padapter, 1);
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
rtw_indicate_disconnect(padapter);
|
||||
|
||||
exit:
|
||||
|
@ -1069,17 +1069,17 @@ static int rtw_resume(struct usb_interface *pusb_intf)
|
|||
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
|
||||
int ret = 0;
|
||||
|
||||
if(pwrpriv->bInternalAutoSuspend ){
|
||||
if (pwrpriv->bInternalAutoSuspend ){
|
||||
ret = rtw_resume_process(padapter);
|
||||
} else {
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
rtw_resume_in_workqueue(pwrpriv);
|
||||
#elif defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if(rtw_is_earlysuspend_registered(pwrpriv) &&
|
||||
if (rtw_is_earlysuspend_registered(pwrpriv) &&
|
||||
!padapter->pwrctrlpriv.wowlan_mode) {
|
||||
#else
|
||||
if(rtw_is_earlysuspend_registered(pwrpriv)) {
|
||||
if (rtw_is_earlysuspend_registered(pwrpriv)) {
|
||||
#endif //CONFIG_WOWLAN
|
||||
//jeff: bypass resume here, do in late_resume
|
||||
pwrpriv->do_late_resume = _TRUE;
|
||||
|
@ -1108,7 +1108,7 @@ int rtw_resume_process(_adapter *padapter)
|
|||
|
||||
DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid);
|
||||
|
||||
if(padapter) {
|
||||
if (padapter) {
|
||||
pnetdev= padapter->pnetdev;
|
||||
pwrpriv = &padapter->pwrctrlpriv;
|
||||
} else {
|
||||
|
@ -1127,7 +1127,7 @@ int rtw_resume_process(_adapter *padapter)
|
|||
#endif
|
||||
|
||||
DBG_871X("pwrpriv->bAutoResume (%x)\n",pwrpriv->bAutoResume );
|
||||
if( _TRUE == pwrpriv->bAutoResume ){
|
||||
if ( _TRUE == pwrpriv->bAutoResume ){
|
||||
pwrpriv->bInternalAutoSuspend = _FALSE;
|
||||
pwrpriv->bAutoResume=_FALSE;
|
||||
DBG_871X("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n",pwrpriv->bAutoResume,pwrpriv->bInternalAutoSuspend );
|
||||
|
@ -1139,19 +1139,19 @@ int rtw_resume_process(_adapter *padapter)
|
|||
pwrpriv->bkeepfwalive = _FALSE;
|
||||
|
||||
DBG_871X("bkeepfwalive(%x)\n",pwrpriv->bkeepfwalive);
|
||||
if(pm_netdev_open(pnetdev,_TRUE) != 0)
|
||||
if (pm_netdev_open(pnetdev,_TRUE) != 0)
|
||||
goto exit;
|
||||
|
||||
netif_device_attach(pnetdev);
|
||||
netif_carrier_on(pnetdev);
|
||||
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if(pwrpriv->bInternalAutoSuspend )
|
||||
if (pwrpriv->bInternalAutoSuspend )
|
||||
{
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
#ifdef SUPPORT_HW_RFOFF_DETECTED
|
||||
// The FW command register update must after MAC and FW init ready.
|
||||
if((padapter->bFWReady) && ( padapter->pwrctrlpriv.bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable ))
|
||||
if ((padapter->bFWReady) && ( padapter->pwrctrlpriv.bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable ))
|
||||
{
|
||||
//rtl8192c_set_FwSelectSuspend_cmd(padapter,_FALSE ,500);//note fw to support hw power down ping detect
|
||||
u8 bOpen = _FALSE;
|
||||
|
@ -1161,7 +1161,7 @@ int rtw_resume_process(_adapter *padapter)
|
|||
#endif
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
DBG_871X("pwrpriv->bAutoResume (%x)\n",pwrpriv->bAutoResume );
|
||||
if( _TRUE == pwrpriv->bAutoResume ){
|
||||
if ( _TRUE == pwrpriv->bAutoResume ){
|
||||
pwrpriv->bInternalAutoSuspend = _FALSE;
|
||||
pwrpriv->bAutoResume=_FALSE;
|
||||
DBG_871X("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n",pwrpriv->bAutoResume,pwrpriv->bInternalAutoSuspend );
|
||||
|
@ -1174,14 +1174,14 @@ int rtw_resume_process(_adapter *padapter)
|
|||
{
|
||||
DBG_871X("enc_algorithm(%x),wepkeymask(%x)\n",
|
||||
padapter->securitypriv.dot11PrivacyAlgrthm,pwrpriv->wepkeymask);
|
||||
if( (_WEP40_ == padapter->securitypriv.dot11PrivacyAlgrthm) ||
|
||||
if ( (_WEP40_ == padapter->securitypriv.dot11PrivacyAlgrthm) ||
|
||||
(_WEP104_ == padapter->securitypriv.dot11PrivacyAlgrthm))
|
||||
{
|
||||
sint keyid;
|
||||
|
||||
for(keyid=0;keyid<4;keyid++){
|
||||
if(pwrpriv->wepkeymask & BIT(keyid)) {
|
||||
if(keyid == padapter->securitypriv.dot11PrivacyKeyIndex)
|
||||
for (keyid=0;keyid<4;keyid++){
|
||||
if (pwrpriv->wepkeymask & BIT(keyid)) {
|
||||
if (keyid == padapter->securitypriv.dot11PrivacyKeyIndex)
|
||||
rtw_set_key(padapter,&padapter->securitypriv, keyid, 1);
|
||||
else
|
||||
rtw_set_key(padapter,&padapter->securitypriv, keyid, 0);
|
||||
|
@ -1193,7 +1193,7 @@ int rtw_resume_process(_adapter *padapter)
|
|||
#endif
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
if( padapter->pid[1]!=0) {
|
||||
if ( padapter->pid[1]!=0) {
|
||||
DBG_871X("pid[1]:%d\n",padapter->pid[1]);
|
||||
rtw_signal_process(padapter->pid[1], SIGUSR2);
|
||||
}
|
||||
|
@ -1228,7 +1228,7 @@ void autosuspend_enter(_adapter* padapter)
|
|||
pwrpriv->bInternalAutoSuspend = _TRUE;
|
||||
pwrpriv->bips_processing = _TRUE;
|
||||
|
||||
if(rf_off == pwrpriv->change_rfpwrstate )
|
||||
if (rf_off == pwrpriv->change_rfpwrstate )
|
||||
{
|
||||
#ifndef CONFIG_BT_COEXIST
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
|
||||
|
@ -1245,7 +1245,7 @@ void autosuspend_enter(_adapter* padapter)
|
|||
usb_autosuspend_device(dvobj->pusbdev, 1);
|
||||
#endif
|
||||
#else //#ifndef CONFIG_BT_COEXIST
|
||||
if(1==pwrpriv->autopm_cnt){
|
||||
if (1==pwrpriv->autopm_cnt){
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
|
||||
usb_enable_autosuspend(dvobj->pusbdev);
|
||||
#else
|
||||
|
@ -1284,7 +1284,7 @@ int autoresume_enter(_adapter* padapter)
|
|||
|
||||
DBG_871X("====> autoresume_enter \n");
|
||||
|
||||
if(rf_off == pwrpriv->rf_pwrstate )
|
||||
if (rf_off == pwrpriv->rf_pwrstate )
|
||||
{
|
||||
pwrpriv->ps_flag = _FALSE;
|
||||
#ifndef CONFIG_BT_COEXIST
|
||||
|
@ -1308,7 +1308,7 @@ int autoresume_enter(_adapter* padapter)
|
|||
#endif
|
||||
#else //#ifndef CONFIG_BT_COEXIST
|
||||
pwrpriv->bAutoResume=_TRUE;
|
||||
if(0==pwrpriv->autopm_cnt){
|
||||
if (0==pwrpriv->autopm_cnt){
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
|
||||
if (usb_autopm_get_interface(dvobj->pusbintf) < 0)
|
||||
{
|
||||
|
@ -1402,14 +1402,14 @@ _adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
|||
if (rtw_handle_dualmac(padapter, 1) != _SUCCESS)
|
||||
goto free_adapter;
|
||||
|
||||
if((pnetdev = rtw_init_netdev(padapter)) == NULL) {
|
||||
if ((pnetdev = rtw_init_netdev(padapter)) == NULL) {
|
||||
goto handle_dualmac;
|
||||
}
|
||||
SET_NETDEV_DEV(pnetdev, dvobj_to_dev(dvobj));
|
||||
padapter = rtw_netdev_priv(pnetdev);
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
if(rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj)) != 0) {
|
||||
if (rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj)) != 0) {
|
||||
goto handle_dualmac;
|
||||
}
|
||||
#endif
|
||||
|
@ -1434,14 +1434,14 @@ _adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
|||
rtw_hal_read_chip_info(padapter);
|
||||
|
||||
//step 5.
|
||||
if(rtw_init_drv_sw(padapter) ==_FAIL) {
|
||||
if (rtw_init_drv_sw(padapter) ==_FAIL) {
|
||||
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("Initialize driver software resource Failed!\n"));
|
||||
goto free_hal_data;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
|
||||
if(padapter->pwrctrlpriv.bSupportRemoteWakeup)
|
||||
if (padapter->pwrctrlpriv.bSupportRemoteWakeup)
|
||||
{
|
||||
dvobj->pusbdev->do_remote_wakeup=1;
|
||||
pusb_intf->needs_remote_wakeup = 1;
|
||||
|
@ -1453,9 +1453,9 @@ _adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if( padapter->registrypriv.power_mgnt != PS_MODE_ACTIVE )
|
||||
if ( padapter->registrypriv.power_mgnt != PS_MODE_ACTIVE )
|
||||
{
|
||||
if(padapter->registrypriv.usbss_enable ){ /* autosuspend (2s delay) */
|
||||
if (padapter->registrypriv.usbss_enable ){ /* autosuspend (2s delay) */
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,38))
|
||||
dvobj->pusbdev->dev.power.autosuspend_delay = 0 * HZ;//15 * HZ; idle-delay time
|
||||
#else
|
||||
|
@ -1526,10 +1526,10 @@ _adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
|||
status = _SUCCESS;
|
||||
|
||||
free_hal_data:
|
||||
if(status != _SUCCESS && padapter->HalData)
|
||||
if (status != _SUCCESS && padapter->HalData)
|
||||
rtw_mfree(padapter->HalData, sizeof(*(padapter->HalData)));
|
||||
free_wdev:
|
||||
if(status != _SUCCESS) {
|
||||
if (status != _SUCCESS) {
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_wdev_unregister(padapter->rtw_wdev);
|
||||
rtw_wdev_free(padapter->rtw_wdev);
|
||||
|
@ -1555,7 +1555,7 @@ static void rtw_usb_if1_deinit(_adapter *if1)
|
|||
struct net_device *pnetdev = if1->pnetdev;
|
||||
struct mlme_priv *pmlmepriv= &if1->mlmepriv;
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
rtw_disassoc_cmd(if1, 0, _FALSE);
|
||||
|
||||
|
||||
|
@ -1566,8 +1566,8 @@ static void rtw_usb_if1_deinit(_adapter *if1)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
if(if1->DriverState != DRIVER_DISAPPEAR) {
|
||||
if(pnetdev) {
|
||||
if (if1->DriverState != DRIVER_DISAPPEAR) {
|
||||
if (pnetdev) {
|
||||
unregister_netdev(pnetdev); //will call netdev_close()
|
||||
rtw_proc_remove_one(pnetdev);
|
||||
}
|
||||
|
@ -1591,7 +1591,7 @@ static void rtw_usb_if1_deinit(_adapter *if1)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
if(1 == if1->pwrctrlpriv.autopm_cnt){
|
||||
if (1 == if1->pwrctrlpriv.autopm_cnt){
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
|
||||
usb_autopm_put_interface(adapter_to_dvobj(if1)->pusbintf);
|
||||
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
|
||||
|
@ -1605,7 +1605,7 @@ static void rtw_usb_if1_deinit(_adapter *if1)
|
|||
|
||||
rtw_free_drv_sw(if1);
|
||||
|
||||
if(pnetdev)
|
||||
if (pnetdev)
|
||||
rtw_free_netdev(pnetdev);
|
||||
|
||||
#ifdef CONFIG_PLATFORM_RTD2880B
|
||||
|
@ -1762,7 +1762,7 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
|
|||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if((if2 = rtw_drv_if2_init(if1, NULL, usb_set_intf_ops)) == NULL) {
|
||||
if ((if2 = rtw_drv_if2_init(if1, NULL, usb_set_intf_ops)) == NULL) {
|
||||
goto free_if1;
|
||||
}
|
||||
#endif
|
||||
|
@ -1772,7 +1772,7 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_GLOBAL_UI_PID
|
||||
if(ui_pid[1]!=0) {
|
||||
if (ui_pid[1]!=0) {
|
||||
DBG_871X("ui_pid[1]:%d\n",ui_pid[1]);
|
||||
rtw_signal_process(ui_pid[1], SIGUSR2);
|
||||
}
|
||||
|
@ -1809,7 +1809,7 @@ _func_enter_;
|
|||
DBG_871X("+rtw_dev_remove\n");
|
||||
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+dev_remove()\n"));
|
||||
|
||||
if(usb_drv->drv_registered == _TRUE)
|
||||
if (usb_drv->drv_registered == _TRUE)
|
||||
{
|
||||
//DBG_871X("r871xu_dev_remove():padapter->bSurpriseRemoved == _TRUE\n");
|
||||
padapter->bSurpriseRemoved = _TRUE;
|
||||
|
@ -1875,7 +1875,7 @@ static int __init rtw_drv_entry(void)
|
|||
int ret = 0;
|
||||
/* ----------get usb_wifi_usbc_num------------- */
|
||||
ret = script_parser_fetch("usb_wifi_para", "usb_wifi_usbc_num", (int *)&usb_wifi_host, 64);
|
||||
if(ret != 0){
|
||||
if (ret != 0){
|
||||
DBG_8192C("ERR: script_parser_fetch usb_wifi_usbc_num failed\n");
|
||||
ret = -ENOMEM;
|
||||
return ret;
|
||||
|
|
|
@ -190,14 +190,14 @@ static void usb_bulkout_zero_complete(struct urb *purb, struct pt_regs *regs)
|
|||
|
||||
//DBG_8192C("+usb_bulkout_zero_complete\n");
|
||||
|
||||
if(pcontext)
|
||||
if (pcontext)
|
||||
{
|
||||
if(pcontext->pbuf)
|
||||
if (pcontext->pbuf)
|
||||
{
|
||||
rtw_mfree(pcontext->pbuf, sizeof(int));
|
||||
}
|
||||
|
||||
if(pcontext->purb && (pcontext->purb==purb))
|
||||
if (pcontext->purb && (pcontext->purb==purb))
|
||||
{
|
||||
usb_free_urb(pcontext->purb);
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ static u32 usb_bulkout_zero(struct intf_hdl *pintfhdl, u32 addr)
|
|||
//DBG_871X("%s\n", __func__);
|
||||
|
||||
|
||||
if((padapter->bDriverStopped) || (padapter->bSurpriseRemoved) ||(padapter->pwrctrlpriv.pnp_bstop_trx))
|
||||
if ((padapter->bDriverStopped) || (padapter->bSurpriseRemoved) ||(padapter->pwrctrlpriv.pnp_bstop_trx))
|
||||
{
|
||||
return _FAIL;
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
switch(pxmitbuf->flags)
|
||||
switch (pxmitbuf->flags)
|
||||
{
|
||||
case VO_QUEUE_INX:
|
||||
pxmitpriv->voq_cnt--;
|
||||
|
@ -345,7 +345,7 @@ _func_enter_;
|
|||
|
||||
pxmitpriv->txirp_cnt--;
|
||||
|
||||
switch(pattrib->priority)
|
||||
switch (pattrib->priority)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
|
@ -374,7 +374,7 @@ _func_enter_;
|
|||
_exit_critical(&pxmitpriv->lock, &irqL);
|
||||
|
||||
|
||||
if(pxmitpriv->txirp_cnt==0)
|
||||
if (pxmitpriv->txirp_cnt==0)
|
||||
{
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete: txirp_cnt== 0, set allrxreturnevt!\n"));
|
||||
_rtw_up_sema(&(pxmitpriv->tx_retevt));
|
||||
|
@ -382,7 +382,7 @@ _func_enter_;
|
|||
*/
|
||||
//rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
|
||||
if(padapter->bSurpriseRemoved || padapter->bDriverStopped ||padapter->bWritePortCancel)
|
||||
if (padapter->bSurpriseRemoved || padapter->bDriverStopped ||padapter->bWritePortCancel)
|
||||
{
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved));
|
||||
DBG_8192C("%s(): TX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bWritePortCancel(%d) pxmitbuf->ext_tag(%x) \n",
|
||||
|
@ -397,7 +397,7 @@ _func_enter_;
|
|||
} else {
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete : purb->status(%d) != 0 \n", purb->status));
|
||||
DBG_871X("###=> urb_write_port_complete status(%d)\n",purb->status);
|
||||
if((purb->status==-EPIPE)||(purb->status==-EPROTO))
|
||||
if ((purb->status==-EPIPE)||(purb->status==-EPROTO))
|
||||
{
|
||||
//usb_clear_halt(pusbdev, purb->pipe);
|
||||
//msleep(10);
|
||||
|
@ -445,7 +445,7 @@ check_completion:
|
|||
|
||||
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
|
||||
//if(rtw_txframes_pending(padapter))
|
||||
//if (rtw_txframes_pending(padapter))
|
||||
{
|
||||
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ _func_enter_;
|
|||
|
||||
_enter_critical(&pxmitpriv->lock, &irqL);
|
||||
|
||||
switch(addr)
|
||||
switch (addr)
|
||||
{
|
||||
case VO_QUEUE_INX:
|
||||
pxmitpriv->voq_cnt++;
|
||||
|
@ -516,9 +516,9 @@ _func_enter_;
|
|||
purb = pxmitbuf->pxmit_urb[0];
|
||||
|
||||
#if 0
|
||||
if(pdvobj->ishighspeed)
|
||||
if (pdvobj->ishighspeed)
|
||||
{
|
||||
if(cnt> 0 && cnt%512 == 0)
|
||||
if (cnt> 0 && cnt%512 == 0)
|
||||
{
|
||||
//DBG_8192C("ishighspeed, cnt=%d\n", cnt);
|
||||
bwritezero = _TRUE;
|
||||
|
@ -526,7 +526,7 @@ _func_enter_;
|
|||
}
|
||||
else
|
||||
{
|
||||
if(cnt > 0 && cnt%64 == 0)
|
||||
if (cnt > 0 && cnt%64 == 0)
|
||||
{
|
||||
//DBG_8192C("cnt=%d\n", cnt);
|
||||
bwritezero = _TRUE;
|
||||
|
@ -596,7 +596,7 @@ _func_enter_;
|
|||
// Commented by Albert 2009/10/13
|
||||
// We add the URB_ZERO_PACKET flag to urb so that the host will send the zero packet automatically.
|
||||
/*
|
||||
if(bwritezero == _TRUE)
|
||||
if (bwritezero == _TRUE)
|
||||
{
|
||||
usb_bulkout_zero(pintfhdl, addr);
|
||||
}
|
||||
|
@ -634,7 +634,7 @@ void usb_write_port_cancel(struct intf_hdl *pintfhdl)
|
|||
pxmitbuf = (struct xmit_buf*)padapter->xmitpriv.pxmit_extbuf;
|
||||
for (i = 0; i < NR_XMIT_EXTBUFF; i++) {
|
||||
for (j=0; j<8; j++) {
|
||||
if(pxmitbuf->pxmit_urb[j]) {
|
||||
if (pxmitbuf->pxmit_urb[j]) {
|
||||
usb_kill_urb(pxmitbuf->pxmit_urb[j]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ _func_enter_;
|
|||
len = rtw_remainder_len(pfile);
|
||||
len = (rlen > len)? len: rlen;
|
||||
|
||||
if(rmem)
|
||||
if (rmem)
|
||||
skb_copy_bits(pfile->pkt, pfile->buf_len-pfile->pkt_len, rmem, len);
|
||||
|
||||
pfile->cur_addr += len;
|
||||
|
@ -133,7 +133,7 @@ int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf,u32
|
|||
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
pxmitbuf->pallocated_buf = rtw_usb_buffer_alloc(pusbd, (size_t)alloc_sz, &pxmitbuf->dma_transfer_addr);
|
||||
pxmitbuf->pbuf = pxmitbuf->pallocated_buf;
|
||||
if(pxmitbuf->pallocated_buf == NULL)
|
||||
if (pxmitbuf->pallocated_buf == NULL)
|
||||
return _FAIL;
|
||||
#else // CONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
|
||||
|
@ -148,10 +148,10 @@ int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf,u32
|
|||
|
||||
#endif // CONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
|
||||
for(i=0; i<8; i++)
|
||||
for (i=0; i<8; i++)
|
||||
{
|
||||
pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if(pxmitbuf->pxmit_urb[i] == NULL)
|
||||
if (pxmitbuf->pxmit_urb[i] == NULL)
|
||||
{
|
||||
DBG_871X("pxmitbuf->pxmit_urb[i]==NULL");
|
||||
return _FAIL;
|
||||
|
@ -180,9 +180,9 @@ void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf,u32
|
|||
struct usb_device *pusbd = pdvobjpriv->pusbdev;
|
||||
|
||||
|
||||
for(i=0; i<8; i++)
|
||||
for (i=0; i<8; i++)
|
||||
{
|
||||
if(pxmitbuf->pxmit_urb[i])
|
||||
if (pxmitbuf->pxmit_urb[i])
|
||||
{
|
||||
//usb_kill_urb(pxmitbuf->pxmit_urb[i]);
|
||||
usb_free_urb(pxmitbuf->pxmit_urb[i]);
|
||||
|
@ -194,13 +194,13 @@ void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf,u32
|
|||
pxmitbuf->pallocated_buf = NULL;
|
||||
pxmitbuf->dma_transfer_addr = 0;
|
||||
#else // CONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
if(pxmitbuf->pallocated_buf)
|
||||
if (pxmitbuf->pallocated_buf)
|
||||
rtw_mfree(pxmitbuf->pallocated_buf, free_sz);
|
||||
#endif // CONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
|
||||
#endif
|
||||
#if defined(CONFIG_PCI_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
if(pxmitbuf->pallocated_buf)
|
||||
if (pxmitbuf->pallocated_buf)
|
||||
rtw_mfree(pxmitbuf->pallocated_buf, free_sz);
|
||||
#endif
|
||||
}
|
||||
|
@ -215,13 +215,13 @@ void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt)
|
|||
|
||||
queue = skb_get_queue_mapping(pkt);
|
||||
if (padapter->registrypriv.wifi_spec) {
|
||||
if(__netif_subqueue_stopped(padapter->pnetdev, queue) &&
|
||||
if (__netif_subqueue_stopped(padapter->pnetdev, queue) &&
|
||||
(pxmitpriv->hwxmits[queue].accnt < WMM_XMIT_THRESHOLD))
|
||||
{
|
||||
netif_wake_subqueue(padapter->pnetdev, queue);
|
||||
}
|
||||
} else {
|
||||
if(__netif_subqueue_stopped(padapter->pnetdev, queue))
|
||||
if (__netif_subqueue_stopped(padapter->pnetdev, queue))
|
||||
netif_wake_subqueue(padapter->pnetdev, queue);
|
||||
}
|
||||
#else
|
||||
|
@ -234,7 +234,7 @@ void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt)
|
|||
|
||||
void rtw_os_xmit_complete(_adapter *padapter, struct xmit_frame *pxframe)
|
||||
{
|
||||
if(pxframe->pkt)
|
||||
if (pxframe->pkt)
|
||||
{
|
||||
//RT_TRACE(_module_xmit_osdep_c_,_drv_err_,("linux : rtw_os_xmit_complete, dev_kfree_skb()\n"));
|
||||
|
||||
|
@ -251,11 +251,11 @@ void rtw_os_xmit_schedule(_adapter *padapter)
|
|||
_adapter *pri_adapter = padapter;
|
||||
|
||||
#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
if(!padapter)
|
||||
if (!padapter)
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->adapter_type > PRIMARY_ADAPTER)
|
||||
if (padapter->adapter_type > PRIMARY_ADAPTER)
|
||||
pri_adapter = padapter->pbuddy_adapter;
|
||||
#endif
|
||||
|
||||
|
@ -267,14 +267,14 @@ void rtw_os_xmit_schedule(_adapter *padapter)
|
|||
_irqL irqL;
|
||||
struct xmit_priv *pxmitpriv;
|
||||
|
||||
if(!padapter)
|
||||
if (!padapter)
|
||||
return;
|
||||
|
||||
pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
if(rtw_txframes_pending(padapter))
|
||||
if (rtw_txframes_pending(padapter))
|
||||
{
|
||||
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
|
||||
}
|
||||
|
@ -297,13 +297,13 @@ static void rtw_check_xmit_resource(_adapter *padapter, _pkt *pkt)
|
|||
netif_stop_subqueue(padapter->pnetdev, queue);
|
||||
}
|
||||
} else {
|
||||
if(pxmitpriv->free_xmitframe_cnt<=4) {
|
||||
if (pxmitpriv->free_xmitframe_cnt<=4) {
|
||||
if (!netif_tx_queue_stopped(netdev_get_tx_queue(padapter->pnetdev, queue)))
|
||||
netif_stop_subqueue(padapter->pnetdev, queue);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if(pxmitpriv->free_xmitframe_cnt<=4)
|
||||
if (pxmitpriv->free_xmitframe_cnt<=4)
|
||||
{
|
||||
if (!rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_stop_queue(padapter->pnetdev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue