rtl8188eu: Convert C90 comments in os_dep

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2015-02-19 22:11:26 -06:00
parent 592c85f4e2
commit 34c3293686
10 changed files with 1412 additions and 1669 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -128,7 +128,7 @@ void rtw_init_mlme_timer(struct adapter *padapter)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
_init_timer(&(pmlmepriv->assoc_timer), padapter->pnetdev, rtw_join_timeout_handler, padapter);
//_init_timer(&(pmlmepriv->sitesurveyctrl.sitesurvey_ctrl_timer), padapter->pnetdev, sitesurvey_ctrl_handler, padapter);
/* _init_timer(&(pmlmepriv->sitesurveyctrl.sitesurvey_ctrl_timer), padapter->pnetdev, sitesurvey_ctrl_handler, padapter); */
_init_timer(&(pmlmepriv->scan_to_timer), padapter->pnetdev, _rtw_scan_timeout_handler, padapter);
_init_timer(&(pmlmepriv->dynamic_chk_timer), padapter->pnetdev, _dynamic_check_timer_handlder, padapter);
@ -164,7 +164,7 @@ void rtw_os_indicate_connect(struct adapter *adapter)
}
else
rtw_cfg80211_indicate_connect(adapter);
#endif //CONFIG_IOCTL_CFG80211
#endif /* CONFIG_IOCTL_CFG80211 */
rtw_indicate_wx_assoc_event(adapter);
netif_carrier_on(adapter->pnetdev);
@ -194,19 +194,19 @@ void rtw_reset_securitypriv( struct adapter *adapter )
u8 backupPMKIDIndex = 0;
u8 backupTKIPCountermeasure = 0x00;
u32 backupTKIPcountermeasure_time = 0;
// add for CONFIG_IEEE80211W, none 11w also can use
/* add for CONFIG_IEEE80211W, none 11w also can use */
_irqL irqL;
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
_enter_critical_bh(&adapter->security_key_mutex, &irqL);
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.
//
// Backup the btkip_countermeasure information.
// When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds.
/* Added by Albert 2009/02/18 */
/* We have to backup the PMK information for WiFi PMK Caching test item. */
/* */
/* Backup the btkip_countermeasure information. */
/* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */
memset( &backupPMKIDList[ 0 ], 0x00, sizeof( RT_PMKID_LIST ) * NUM_PMKID_CACHE );
@ -215,14 +215,14 @@ void rtw_reset_securitypriv( struct adapter *adapter )
backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure;
backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time;
#ifdef CONFIG_IEEE80211W
//reset RX BIP packet number
/* reset RX BIP packet number */
pmlmeext->mgnt_80211w_IPN_rx = 0;
#endif //CONFIG_IEEE80211W
#endif /* CONFIG_IEEE80211W */
memset((unsigned char *)&adapter->securitypriv, 0, sizeof (struct security_priv));
//_init_timer(&(adapter->securitypriv.tkip_timer),adapter->pnetdev, rtw_use_tkipkey_handler, adapter);
/* _init_timer(&(adapter->securitypriv.tkip_timer),adapter->pnetdev, rtw_use_tkipkey_handler, adapter); */
// Added by Albert 2009/02/18
// Restore the PMK information to securitypriv structure for the following connection.
/* Added by Albert 2009/02/18 */
/* Restore the PMK information to securitypriv structure for the following connection. */
memcpy( &adapter->securitypriv.PMKIDList[ 0 ], &backupPMKIDList[ 0 ], sizeof( RT_PMKID_LIST ) * NUM_PMKID_CACHE );
adapter->securitypriv.PMKIDIndex = backupPMKIDIndex;
adapter->securitypriv.btkip_countermeasure = backupTKIPCountermeasure;
@ -232,13 +232,13 @@ void rtw_reset_securitypriv( struct adapter *adapter )
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
}
else //reset values in securitypriv
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;
psec_priv->dot11AuthAlgrthm =dot11AuthAlgrthm_Open; //open system
psec_priv->dot11AuthAlgrthm =dot11AuthAlgrthm_Open; /* open system */
psec_priv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
psec_priv->dot11PrivacyKeyIndex = 0;
@ -247,30 +247,30 @@ void rtw_reset_securitypriv( struct adapter *adapter )
psec_priv->ndisauthtype = Ndis802_11AuthModeOpen;
psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled;
//}
/* */
}
// add for CONFIG_IEEE80211W, none 11w also can use
/* add for CONFIG_IEEE80211W, none 11w also can use */
_exit_critical_bh(&adapter->security_key_mutex, &irqL);
}
void rtw_os_indicate_disconnect( struct adapter *adapter )
{
//RT_PMKID_LIST backupPMKIDList[ NUM_PMKID_CACHE ];
/* RT_PMKID_LIST backupPMKIDList[ NUM_PMKID_CACHE ]; */
;
netif_carrier_off(adapter->pnetdev); // Do it first for tx broadcast pkt after disconnection issue!
netif_carrier_off(adapter->pnetdev); /* Do it first for tx broadcast pkt after disconnection issue! */
#ifdef CONFIG_IOCTL_CFG80211
rtw_cfg80211_indicate_disconnect(adapter);
#endif //CONFIG_IOCTL_CFG80211
#endif /* CONFIG_IOCTL_CFG80211 */
rtw_indicate_wx_disassoc_event(adapter);
#ifdef RTK_DMP_PLATFORM
_set_workitem(&adapter->mlmepriv.Linkdown_workitem);
#endif
//modify for CONFIG_IEEE80211W, none 11w also can use the same command
/* modify for CONFIG_IEEE80211W, none 11w also can use the same command */
rtw_reset_securitypriv_cmd(adapter);
;
@ -353,7 +353,7 @@ void _sa_query_timer_hdl (void *FunctionContext)
struct adapter *padapter = (struct adapter *)FunctionContext;
sa_query_timer_hdl(padapter);
}
#endif //CONFIG_IEEE80211W
#endif /* CONFIG_IEEE80211W */
void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta)
{
@ -383,11 +383,11 @@ void init_mlme_ext_timer(struct adapter *padapter)
_init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter);
#ifdef CONFIG_IEEE80211W
_init_timer(&pmlmeext->sa_query_timer, padapter->pnetdev, _sa_query_timer_hdl, padapter);
#endif //CONFIG_IEEE80211W
//_init_timer(&pmlmeext->ADDBA_timer, padapter->pnetdev, _addba_timer_hdl, padapter);
#endif /* CONFIG_IEEE80211W */
/* _init_timer(&pmlmeext->ADDBA_timer, padapter->pnetdev, _addba_timer_hdl, padapter); */
//_init_timer(&pmlmeext->reauth_timer, padapter->pnetdev, _reauth_timer_hdl, padapter);
//_init_timer(&pmlmeext->reassoc_timer, padapter->pnetdev, _reassoc_timer_hdl, padapter);
/* _init_timer(&pmlmeext->reauth_timer, padapter->pnetdev, _reauth_timer_hdl, padapter); */
/* _init_timer(&pmlmeext->reassoc_timer, padapter->pnetdev, _reassoc_timer_hdl, padapter); */
}
#ifdef CONFIG_AP_MODE
@ -454,7 +454,7 @@ static int mgnt_xmit_entry(struct sk_buff *skb, struct net_device *pnetdev)
struct hostapd_priv *phostapdpriv = rtw_netdev_priv(pnetdev);
struct adapter *padapter = (struct adapter *)phostapdpriv->padapter;
//DBG_871X("%s\n", __FUNCTION__);
/* DBG_871X("%s\n", __FUNCTION__); */
return rtw_hal_hostap_mgnt_xmit_entry(padapter, skb);
}
@ -473,11 +473,8 @@ static int mgnt_netdev_open(struct net_device *pnetdev)
else
rtw_netif_wake_queue(pnetdev);
netif_carrier_on(pnetdev);
//rtw_write16(phostapdpriv->padapter, 0x0116, 0x0100);//only excluding beacon
return 0;
}
static int mgnt_netdev_close(struct net_device *pnetdev)
@ -493,7 +490,7 @@ static int mgnt_netdev_close(struct net_device *pnetdev)
if (!rtw_netif_queue_stopped(pnetdev))
rtw_netif_stop_queue(pnetdev);
//rtw_write16(phostapdpriv->padapter, 0x0116, 0x3f3f);
/* rtw_write16(phostapdpriv->padapter, 0x0116, 0x3f3f); */
return 0;
}
@ -503,9 +500,9 @@ static const struct net_device_ops rtl871x_mgnt_netdev_ops = {
.ndo_open = mgnt_netdev_open,
.ndo_stop = mgnt_netdev_close,
.ndo_start_xmit = mgnt_xmit_entry,
//.ndo_set_mac_address = r871x_net_set_mac_address,
//.ndo_get_stats = r871x_net_get_stats,
//.ndo_do_ioctl = r871x_mp_ioctl,
/* ndo_set_mac_address = r871x_net_set_mac_address, */
/* ndo_get_stats = r871x_net_get_stats, */
/* ndo_do_ioctl = r871x_mp_ioctl, */
};
#endif
@ -519,17 +516,17 @@ int hostapd_mode_init(struct adapter *padapter)
if (!pnetdev)
return -ENOMEM;
//SET_MODULE_OWNER(pnetdev);
/* SET_MODULE_OWNER(pnetdev); */
ether_setup(pnetdev);
//pnetdev->type = ARPHRD_IEEE80211;
/* pnetdev->type = ARPHRD_IEEE80211; */
phostapdpriv = rtw_netdev_priv(pnetdev);
phostapdpriv->pmgnt_netdev = pnetdev;
phostapdpriv->padapter= padapter;
padapter->phostapdpriv = phostapdpriv;
//pnetdev->init = NULL;
/* pnetdev->init = NULL; */
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
@ -545,17 +542,17 @@ int hostapd_mode_init(struct adapter *padapter)
pnetdev->hard_start_xmit = mgnt_xmit_entry;
//pnetdev->set_mac_address = r871x_net_set_mac_address;
/* pnetdev->set_mac_address = r871x_net_set_mac_address; */
//pnetdev->get_stats = r871x_net_get_stats;
/* pnetdev->get_stats = r871x_net_get_stats; */
//pnetdev->do_ioctl = r871x_mp_ioctl;
/* pnetdev->do_ioctl = r871x_mp_ioctl; */
#endif
pnetdev->watchdog_timeo = HZ; /* 1 second timeout */
//pnetdev->wireless_handlers = NULL;
/* pnetdev->wireless_handlers = NULL; */
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
pnetdev->features |= NETIF_F_IP_CSUM;
@ -569,7 +566,7 @@ int hostapd_mode_init(struct adapter *padapter)
}
//SET_NETDEV_DEV(pnetdev, pintfpriv->udev);
/* SET_NETDEV_DEV(pnetdev, pintfpriv->udev); */
mac[0]=0x00;

View file

@ -35,13 +35,13 @@
#ifdef CONFIG_BR_EXT
#include <rtw_br_ext.h>
#endif //CONFIG_BR_EXT
#endif /* CONFIG_BR_EXT */
#ifdef CONFIG_RF_GAIN_OFFSET
#define RF_GAIN_OFFSET_ON BIT4
#define REG_RF_BB_GAIN_OFFSET 0x55
#define RF_GAIN_OFFSET_MASK 0xfffff
#endif //CONFIG_RF_GAIN_OFFSET
#endif /* CONFIG_RF_GAIN_OFFSET */
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Realtek Wireless Lan Driver");
@ -51,22 +51,22 @@ MODULE_VERSION(DRIVERVERSION);
/* module param defaults */
static int rtw_chip_version = 0x00;
static int rtw_rfintfs = HWPI;
static int rtw_lbkmode = 0;//RTL8712_AIR_TRX;
static int rtw_lbkmode = 0;/* RTL8712_AIR_TRX; */
static int rtw_network_mode = Ndis802_11IBSS;//Ndis802_11Infrastructure;//infra, ad-hoc, auto
//NDIS_802_11_SSID ssid;
static int rtw_channel = 1;//ad-hoc support requirement
static int rtw_network_mode = Ndis802_11IBSS;/* Ndis802_11Infrastructure;infra, ad-hoc, auto */
/* NDIS_802_11_SSID ssid; */
static int rtw_channel = 1;/* ad-hoc support requirement */
static int rtw_wireless_mode = WIRELESS_11BG_24N;
static int rtw_vrtl_carrier_sense = AUTO_VCS;
static int rtw_vcs_type = RTS_CTS;//*
static int rtw_rts_thresh = 2347;//*
static int rtw_frag_thresh = 2346;//*
static int rtw_preamble = PREAMBLE_LONG;//long, short, auto
static int rtw_scan_mode = 1;//active, passive
static int rtw_vcs_type = RTS_CTS;/* */
static int rtw_rts_thresh = 2347;/* */
static int rtw_frag_thresh = 2346;/* */
static int rtw_preamble = PREAMBLE_LONG;/* long, short, auto */
static int rtw_scan_mode = 1;/* active, passive */
static int rtw_adhoc_tx_pwr = 1;
static int rtw_soft_ap = 0;
//int smart_ps = 1;
/* int smart_ps = 1; */
#ifdef CONFIG_POWER_SAVING
static int rtw_power_mgnt = 1;
#ifdef CONFIG_IPS_LEVEL_2
@ -92,7 +92,6 @@ static int rtw_radio_enable = 1;
static int rtw_long_retry_lmt = 7;
static int rtw_short_retry_lmt = 7;
static int rtw_busy_thresh = 40;
//int qos_enable = 0; //*
static int rtw_ack_policy = NORMAL_ACK;
static int rtw_mp_mode = 0;
@ -100,9 +99,9 @@ static int rtw_mp_mode = 0;
static int rtw_software_encrypt = 0;
static int rtw_software_decrypt = 0;
static int rtw_acm_method = 0;// 0:By SW 1:By HW.
static int rtw_acm_method = 0;/* 0:By SW 1:By HW. */
static int rtw_wmm_enable = 1;// default is set to enable the wmm.
static int rtw_wmm_enable = 1;/* default is set to enable the wmm. */
static int rtw_uapsd_enable = 0;
static int rtw_uapsd_max_sp = NO_LIMIT;
static int rtw_uapsd_acbk_en = 0;
@ -112,19 +111,19 @@ static int rtw_uapsd_acvo_en = 0;
#ifdef CONFIG_80211N_HT
int rtw_ht_enable = 1;
int rtw_cbw40_enable = 3; // 0 :diable, bit(0): enable 2.4g, bit(1): enable 5g
int rtw_ampdu_enable = 1;//for enable tx_ampdu
static int rtw_rx_stbc = 1;// 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ
static int rtw_ampdu_amsdu = 0;// 0: disabled, 1:enabled, 2:auto
int rtw_cbw40_enable = 3; /* 0 :diable, bit(0): enable 2.4g, bit(1): enable 5g */
int rtw_ampdu_enable = 1;/* for enable tx_ampdu */
static int rtw_rx_stbc = 1;/* 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ */
static int rtw_ampdu_amsdu = 0;/* 0: disabled, 1:enabled, 2:auto */
#endif
static int rtw_lowrate_two_xmit = 1;//Use 2 path Tx to transmit MCS0~7 and legacy mode
static int rtw_lowrate_two_xmit = 1;/* Use 2 path Tx to transmit MCS0~7 and legacy mode */
//int rf_config = RF_1T2R; // 1T2R
static int rtw_rf_config = RF_819X_MAX_TYPE; //auto
/* int rf_config = RF_1T2R; 1T2R */
static int rtw_rf_config = RF_819X_MAX_TYPE; /* auto */
static int rtw_low_power = 0;
#ifdef CONFIG_WIFI_TEST
static int rtw_wifi_spec = 1;//for wifi test
static int rtw_wifi_spec = 1;/* for wifi test */
#else
static int rtw_wifi_spec = 0;
#endif
@ -132,36 +131,36 @@ static int rtw_channel_plan = RT_CHANNEL_DOMAIN_MAX;
#ifdef CONFIG_BT_COEXIST
static int rtw_btcoex_enable = 1;
static int rtw_bt_iso = 2;// 0:Low, 1:High, 2:From Efuse
static int rtw_bt_sco = 3;// 0:Idle, 1:None-SCO, 2:SCO, 3:From Counter, 4.Busy, 5.OtherBusy
static int rtw_bt_ampdu =1 ;// 0:Disable BT control A-MPDU, 1:Enable BT control A-MPDU.
static int rtw_bt_iso = 2;/* 0:Low, 1:High, 2:From Efuse */
static int rtw_bt_sco = 3;/* 0:Idle, 1:None-SCO, 2:SCO, 3:From Counter, 4.Busy, 5.OtherBusy */
static int rtw_bt_ampdu =1 ;/* 0:Disable BT control A-MPDU, 1:Enable BT control A-MPDU. */
#endif
static int rtw_AcceptAddbaReq = true;// 0:Reject AP's Add BA req, 1:Accept AP's Add BA req.
static int rtw_AcceptAddbaReq = true;/* 0:Reject AP's Add BA req, 1:Accept AP's Add BA req. */
static int rtw_antdiv_cfg = 2; // 0:OFF , 1:ON, 2:decide by Efuse config
static int rtw_antdiv_type = 0 ; //0:decide by efuse 1: for 88EE, 1Tx and 1RxCG are diversity.(2 Ant with SPDT), 2: for 88EE, 1Tx and 2Rx are diversity.( 2 Ant, Tx and RxCG are both on aux port, RxCS is on main port ), 3: for 88EE, 1Tx and 1RxCG are fixed.(1Ant, Tx and RxCG are both on aux port)
static int rtw_antdiv_cfg = 2; /* 0:OFF , 1:ON, 2:decide by Efuse config */
static int rtw_antdiv_type = 0 ; /* 0:decide by efuse 1: for 88EE, 1Tx and 1RxCG are diversity.(2 Ant with SPDT), 2: for 88EE, 1Tx and 2Rx are diversity.( 2 Ant, Tx and RxCG are both on aux port, RxCS is on main port ), 3: for 88EE, 1Tx and 1RxCG are fixed.(1Ant, Tx and RxCG are both on aux port) */
#ifdef CONFIG_USB_AUTOSUSPEND
static int rtw_enusbss = 1;//0:disable,1:enable
static int rtw_enusbss = 1;/* 0:disable,1:enable */
#else
static int rtw_enusbss = 0;//0:disable,1:enable
static int rtw_enusbss = 0;/* 0:disable,1:enable */
#endif
static int rtw_hwpdn_mode=2;//0:disable,1:enable,2: by EFUSE config
static int rtw_hwpdn_mode=2;/* 0:disable,1:enable,2: by EFUSE config */
#ifdef CONFIG_HW_PWRP_DETECTION
static int rtw_hwpwrp_detect = 1;
#else
static int rtw_hwpwrp_detect = 0; //HW power ping detect 0:disable , 1:enable
static int rtw_hwpwrp_detect = 0; /* HW power ping detect 0:disable , 1:enable */
#endif
static int rtw_hw_wps_pbc = 1;
#ifdef CONFIG_TX_MCAST2UNI
int rtw_mc2u_disable = 0;
#endif // CONFIG_TX_MCAST2UNI
#endif /* CONFIG_TX_MCAST2UNI */
#ifdef CONFIG_80211D
static int rtw_80211d = 0;
@ -170,22 +169,22 @@ static int rtw_80211d = 0;
#ifdef CONFIG_REGULATORY_CTRL
static int rtw_regulatory_id =2;
#else
static int rtw_regulatory_id = 0xff;// Regulatory tab id, 0xff = follow efuse's setting
static int rtw_regulatory_id = 0xff;/* Regulatory tab id, 0xff = follow efuse's setting */
#endif
module_param(rtw_regulatory_id, int, 0644);
#ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV
static int rtw_force_ant = 2;//0 :normal, 1:Main ant, 2:Aux ant
static int rtw_force_igi =0;//0 :normal
static int rtw_force_ant = 2;/* 0 :normal, 1:Main ant, 2:Aux ant */
static int rtw_force_igi =0;/* 0 :normal */
module_param(rtw_force_ant, int, 0644);
module_param(rtw_force_igi, int, 0644);
#endif
#ifdef CONFIG_QOS_OPTIMIZATION
static int rtw_qos_opt_enable=1;//0: disable,1:enable
static int rtw_qos_opt_enable=1;/* 0: disable,1:enable */
#else
static int rtw_qos_opt_enable=0;//0: disable,1:enable
static int rtw_qos_opt_enable=0;/* 0: disable,1:enable */
#endif
module_param(rtw_qos_opt_enable,int,0644);
@ -197,7 +196,7 @@ static char* if2name = "wlan%d";
module_param(if2name, charp, 0644);
MODULE_PARM_DESC(if2name, "The default name to allocate for second interface");
char* rtw_initmac = NULL; // temp mac address if users want to use instead of the mac address in Efuse
char* rtw_initmac = NULL; /* temp mac address if users want to use instead of the mac address in Efuse */
module_param(rtw_initmac, charp, 0644);
module_param(rtw_channel_plan, int, 0644);
@ -243,29 +242,29 @@ module_param(rtw_early_mode, int, 0644);
char *rtw_adaptor_info_caching_file_path= "/data/misc/wifi/rtw_cache";
module_param(rtw_adaptor_info_caching_file_path, charp, 0644);
MODULE_PARM_DESC(rtw_adaptor_info_caching_file_path, "The path of adapter info cache file");
#endif //CONFIG_ADAPTOR_INFO_CACHING_FILE
#endif /* CONFIG_ADAPTOR_INFO_CACHING_FILE */
#ifdef CONFIG_LAYER2_ROAMING
static uint rtw_max_roaming_times=2;
module_param(rtw_max_roaming_times, uint, 0644);
MODULE_PARM_DESC(rtw_max_roaming_times,"The max roaming times to try");
#endif //CONFIG_LAYER2_ROAMING
#endif /* CONFIG_LAYER2_ROAMING */
#ifdef CONFIG_IOL
static int rtw_fw_iol=1;// 0:Disable, 1:enable, 2:by usb speed
static int rtw_fw_iol=1;/* 0:Disable, 1:enable, 2:by usb speed */
module_param(rtw_fw_iol, int, 0644);
MODULE_PARM_DESC(rtw_fw_iol,"FW IOL");
#endif //CONFIG_IOL
#endif /* CONFIG_IOL */
#ifdef CONFIG_FILE_FWIMG
static char *rtw_fw_file_path= "";
module_param(rtw_fw_file_path, charp, 0644);
MODULE_PARM_DESC(rtw_fw_file_path, "The path of fw image");
#endif //CONFIG_FILE_FWIMG
#endif /* CONFIG_FILE_FWIMG */
#ifdef CONFIG_TX_MCAST2UNI
module_param(rtw_mc2u_disable, int, 0644);
#endif // CONFIG_TX_MCAST2UNI
#endif /* CONFIG_TX_MCAST2UNI */
#ifdef CONFIG_80211D
module_param(rtw_80211d, int, 0644);
@ -288,7 +287,7 @@ int _netdev_open(struct net_device *pnetdev);
int netdev_open (struct net_device *pnetdev);
static int netdev_close (struct net_device *pnetdev);
//#ifdef RTK_DMP_PLATFORM
/* ifdef RTK_DMP_PLATFORM */
#ifdef CONFIG_PROC_DEBUG
#define RTL8192C_PROC_NAME "rtl819xC"
#define RTL8192D_PROC_NAME "rtl819xD"
@ -319,7 +318,7 @@ static uint loadparam( struct adapter *padapter, _nic_hdl pnetdev)
registry_par->chip_version = (u8)rtw_chip_version;
registry_par->rfintfs = (u8)rtw_rfintfs;
registry_par->lbkmode = (u8)rtw_lbkmode;
//registry_par->hci = (u8)hci;
/* registry_par->hci = (u8)hci; */
registry_par->network_mode = (u8)rtw_network_mode;
memcpy(registry_par->ssid.Ssid, "ANY", 3);
@ -343,7 +342,7 @@ static uint loadparam( struct adapter *padapter, _nic_hdl pnetdev)
registry_par->long_retry_lmt = (u8)rtw_long_retry_lmt;
registry_par->short_retry_lmt = (u8)rtw_short_retry_lmt;
registry_par->busy_thresh = (u16)rtw_busy_thresh;
//registry_par->qos_enable = (u8)rtw_qos_enable;
/* registry_par->qos_enable = (u8)rtw_qos_enable; */
registry_par->ack_policy = (u8)rtw_ack_policy;
registry_par->mp_mode = (u8)rtw_mp_mode;
registry_par->software_encrypt = (u8)rtw_software_encrypt;
@ -351,7 +350,7 @@ static uint loadparam( struct adapter *padapter, _nic_hdl pnetdev)
registry_par->acm_method = (u8)rtw_acm_method;
//UAPSD
/* UAPSD */
registry_par->wmm_enable = (u8)rtw_wmm_enable;
registry_par->uapsd_enable = (u8)rtw_uapsd_enable;
registry_par->uapsd_max_sp = (u8)rtw_uapsd_max_sp;
@ -391,11 +390,11 @@ static uint loadparam( struct adapter *padapter, _nic_hdl pnetdev)
registry_par->antdiv_type = (u8)rtw_antdiv_type;
#ifdef CONFIG_AUTOSUSPEND
registry_par->usbss_enable = (u8)rtw_enusbss;//0:disable,1:enable
registry_par->usbss_enable = (u8)rtw_enusbss;/* 0:disable,1:enable */
#endif
#ifdef SUPPORT_HW_RFOFF_DETECTED
registry_par->hwpdn_mode = (u8)rtw_hwpdn_mode;//0:disable,1:enable,2:by EFUSE config
registry_par->hwpwrp_detect = (u8)rtw_hwpwrp_detect;//0:disable,1:enable
registry_par->hwpdn_mode = (u8)rtw_hwpdn_mode;/* 0:disable,1:enable,2:by EFUSE config */
registry_par->hwpwrp_detect = (u8)rtw_hwpwrp_detect;/* 0:disable,1:enable */
#endif
registry_par->qos_opt_enable = (u8)rtw_qos_opt_enable;
@ -410,7 +409,7 @@ static uint loadparam( struct adapter *padapter, _nic_hdl pnetdev)
registry_par->max_roaming_times = (u8)rtw_max_roaming_times;
#ifdef CONFIG_INTEL_WIDI
registry_par->max_roaming_times = (u8)rtw_max_roaming_times + 2;
#endif // CONFIG_INTEL_WIDI
#endif /* CONFIG_INTEL_WIDI */
#endif
#ifdef CONFIG_IOL
@ -445,11 +444,11 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p)
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]);
/* 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]); */
memcpy(padapter->eeprompriv.mac_addr, addr->sa_data, ETH_ALEN);
//memcpy(pnetdev->dev_addr, addr->sa_data, ETH_ALEN);
//padapter->bset_hwaddr = true;
/* memcpy(pnetdev->dev_addr, addr->sa_data, ETH_ALEN); */
/* padapter->bset_hwaddr = true; */
}
return 0;
@ -461,8 +460,8 @@ static struct net_device_stats *rtw_net_get_stats(struct net_device *pnetdev)
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct recv_priv *precvpriv = &(padapter->recvpriv);
padapter->stats.tx_packets = pxmitpriv->tx_pkts;//pxmitpriv->tx_pkts++;
padapter->stats.rx_packets = precvpriv->rx_pkts;//precvpriv->rx_pkts++;
padapter->stats.tx_packets = pxmitpriv->tx_pkts;/* pxmitpriv->tx_pkts++; */
padapter->stats.rx_packets = precvpriv->rx_pkts;/* precvpriv->rx_pkts++; */
padapter->stats.tx_dropped = pxmitpriv->tx_drop;
padapter->stats.rx_dropped = precvpriv->rx_drop;
padapter->stats.tx_bytes = pxmitpriv->tx_bytes;
@ -623,7 +622,7 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
}
netif_carrier_off(pnetdev);
//rtw_netif_stop_queue(pnetdev);
/* rtw_netif_stop_queue(pnetdev); */
return 0;
}
@ -650,7 +649,7 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter)
SET_MODULE_OWNER(pnetdev);
#endif
//pnetdev->init = NULL;
/* pnetdev->init = NULL; */
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
DBG_871X("register rtw_netdev_ops to netdev_ops\n");
@ -668,18 +667,18 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter)
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
pnetdev->features |= NETIF_F_IP_CSUM;
#endif
//pnetdev->tx_timeout = NULL;
/* pnetdev->tx_timeout = NULL; */
pnetdev->watchdog_timeo = HZ*3; /* 3 second timeout */
#ifdef CONFIG_WIRELESS_EXT
pnetdev->wireless_handlers = (struct iw_handler_def *)&rtw_handlers_def;
#endif
#ifdef WIRELESS_SPY
//priv->wireless_data.spy_data = &priv->spy_data;
//pnetdev->wireless_data = &priv->wireless_data;
/* priv->wireless_data.spy_data = &priv->spy_data; */
/* pnetdev->wireless_data = &priv->wireless_data; */
#endif
//step 2.
/* step 2. */
loadparam(padapter, pnetdev);
return pnetdev;
@ -707,7 +706,7 @@ u32 rtw_start_drv_threads(struct adapter *padapter)
if(IS_ERR(padapter->cmdThread))
_status = _FAIL;
else
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); //wait for cmd_thread to run
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); /* wait for cmd_thread to run */
#ifdef CONFIG_EVENT_THREAD_MODE
padapter->evtThread = kthread_run(event_thread, padapter, "RTW_EVENT_THREAD");
@ -738,7 +737,7 @@ void rtw_unregister_netdevs(struct dvobj_priv *dvobj)
if((padapter->DriverState != DRIVER_DISAPPEAR) && pnetdev) {
unregister_netdev(pnetdev); //will call netdev_close()
unregister_netdev(pnetdev); /* will call netdev_close() */
rtw_proc_remove_one(pnetdev);
}
@ -765,7 +764,7 @@ void rtw_stop_drv_threads (struct adapter *padapter)
#endif
#ifdef CONFIG_XMIT_THREAD_MODE
// Below is to termindate tx_thread...
/* Below is to termindate tx_thread... */
{
_rtw_up_sema(&padapter->xmitpriv.xmit_sema);
_rtw_down_sema(&padapter->xmitpriv.terminate_xmitthread_sema);
@ -774,7 +773,7 @@ void rtw_stop_drv_threads (struct adapter *padapter)
#endif
#ifdef CONFIG_RECV_THREAD_MODE
// Below is to termindate rx_thread...
/* Below is to termindate rx_thread... */
_rtw_up_sema(&padapter->recvpriv.recv_sema);
_rtw_down_sema(&padapter->recvpriv.terminate_recvthread_sema);
RT_TRACE(_module_os_intfs_c_,_drv_info_,("\n drv_halt:recv_thread can be terminated! \n"));
@ -792,37 +791,37 @@ u8 rtw_init_default_value(struct adapter *padapter)
struct mlme_priv *pmlmepriv= &padapter->mlmepriv;
struct security_priv *psecuritypriv = &padapter->securitypriv;
//xmit_priv
/* xmit_priv */
pxmitpriv->vcs_setting = pregistrypriv->vrtl_carrier_sense;
pxmitpriv->vcs = pregistrypriv->vcs_type;
pxmitpriv->vcs_type = pregistrypriv->vcs_type;
//pxmitpriv->rts_thresh = pregistrypriv->rts_thresh;
/* pxmitpriv->rts_thresh = pregistrypriv->rts_thresh; */
pxmitpriv->frag_len = pregistrypriv->frag_thresh;
//recv_priv
/* recv_priv */
//mlme_priv
pmlmepriv->scan_interval = SCAN_INTERVAL;// 30*2 sec = 60sec
/* mlme_priv */
pmlmepriv->scan_interval = SCAN_INTERVAL;/* 30*2 sec = 60sec */
pmlmepriv->scan_mode = SCAN_ACTIVE;
//qos_priv
//pmlmepriv->qospriv.qos_option = pregistrypriv->wmm_enable;
/* qos_priv */
/* pmlmepriv->qospriv.qos_option = pregistrypriv->wmm_enable; */
//ht_priv
/* ht_priv */
#ifdef CONFIG_80211N_HT
pmlmepriv->htpriv.ampdu_enable = false;//set to disabled
pmlmepriv->htpriv.ampdu_enable = false;/* set to disabled */
#endif
//security_priv
//rtw_get_encrypt_decrypt_from_registrypriv(padapter);
/* security_priv */
/* rtw_get_encrypt_decrypt_from_registrypriv(padapter); */
psecuritypriv->binstallGrpkey = _FAIL;
psecuritypriv->sw_encrypt=pregistrypriv->software_encrypt;
psecuritypriv->sw_decrypt=pregistrypriv->software_decrypt;
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; //open system
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
psecuritypriv->dot11PrivacyKeyIndex = 0;
@ -834,18 +833,18 @@ u8 rtw_init_default_value(struct adapter *padapter)
psecuritypriv->ndisencryptstatus = Ndis802_11WEPDisabled;
//pwrctrl_priv
/* pwrctrl_priv */
//registry_priv
/* registry_priv */
rtw_init_registrypriv_dev_network(padapter);
rtw_update_registrypriv_dev_network(padapter);
//hal_priv
/* hal_priv */
rtw_hal_def_value_init(padapter);
//misc.
/* misc. */
padapter->bReadPortCancel = false;
padapter->bWritePortCancel = false;
padapter->bRxRSSIDisplay = 0;
@ -863,12 +862,12 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
struct mlme_priv *pmlmepriv= &padapter->mlmepriv;
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
//hal_priv
/* hal_priv */
rtw_hal_def_value_init(padapter);
padapter->bReadPortCancel = false;
padapter->bWritePortCancel = false;
padapter->bRxRSSIDisplay = 0;
pmlmepriv->scan_interval = SCAN_INTERVAL;// 30*2 sec = 60sec
pmlmepriv->scan_interval = SCAN_INTERVAL;/* 30*2 sec = 60sec */
padapter->xmitpriv.tx_pkts = 0;
padapter->recvpriv.rx_pkts = 0;
@ -879,7 +878,7 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
#ifdef CONFIG_AUTOSUSPEND
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,34))
adapter_to_dvobj(padapter)->pusbdev->autosuspend_disabled = 1;//autosuspend disabled by the user
adapter_to_dvobj(padapter)->pusbdev->autosuspend_disabled = 1;/* autosuspend disabled by the user */
#endif
#endif
@ -888,7 +887,7 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
#endif
pwrctrlpriv->pwr_state_check_cnts = 0;
//mlmeextpriv
/* mlmeextpriv */
padapter->mlmeextpriv.sitesurvey_res.state= SCAN_DISABLE;
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
@ -959,7 +958,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
ret8=_FAIL;
goto exit;
}
#endif //CONFIG_TDLS
#endif /* CONFIG_TDLS */
if(_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL)
{
@ -974,13 +973,13 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
ret8=_FAIL;
goto exit;
}
// add for CONFIG_IEEE80211W, none 11w also can use
/* add for CONFIG_IEEE80211W, none 11w also can use */
_rtw_spinlock_init(&padapter->security_key_mutex);
// We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc().
//memset((unsigned char *)&padapter->securitypriv, 0, sizeof (struct security_priv));
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
/* memset((unsigned char *)&padapter->securitypriv, 0, sizeof (struct security_priv)); */
//_init_timer(&(padapter->securitypriv.tkip_timer), padapter->pifp, rtw_use_tkipkey_handler, padapter);
/* _init_timer(&(padapter->securitypriv.tkip_timer), padapter->pifp, rtw_use_tkipkey_handler, padapter); */
if(_rtw_init_sta_priv(&padapter->stapriv) == _FAIL)
{
@ -1012,16 +1011,16 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
ret8=_FAIL;
goto exit;
}
#endif //CONFIG_INTEL_WIDI
#endif /* CONFIG_INTEL_WIDI */
#ifdef CONFIG_WAPI_SUPPORT
padapter->WapiSupport = true; //set true temp, will revise according to Efuse or Registry value later.
padapter->WapiSupport = true; /* set true temp, will revise according to Efuse or Registry value later. */
rtw_wapi_init(padapter);
#endif
#ifdef CONFIG_BR_EXT
_rtw_spinlock_init(&padapter->br_ext_lock);
#endif // CONFIG_BR_EXT
#endif /* CONFIG_BR_EXT */
exit:
@ -1048,8 +1047,8 @@ void rtw_cancel_all_timer(struct adapter *padapter)
_cancel_timer_ex(&padapter->mlmepriv.assoc_timer);
RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel association timer complete! \n"));
//_cancel_timer_ex(&padapter->securitypriv.tkip_timer);
//RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel tkip_timer! \n"));
/* _cancel_timer_ex(&padapter->securitypriv.tkip_timer); */
/* RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel tkip_timer! \n")); */
_cancel_timer_ex(&padapter->mlmepriv.scan_to_timer);
RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel scan_to_timer! \n"));
@ -1057,7 +1056,7 @@ void rtw_cancel_all_timer(struct adapter *padapter)
_cancel_timer_ex(&padapter->mlmepriv.dynamic_chk_timer);
RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel dynamic_chk_timer! \n"));
// cancel sw led timer
/* cancel sw led timer */
rtw_hal_sw_led_deinit(padapter);
RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel DeInitSwLeds! \n"));
@ -1066,8 +1065,8 @@ void rtw_cancel_all_timer(struct adapter *padapter)
#ifdef CONFIG_IOCTL_CFG80211
#ifdef CONFIG_P2P
_cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer);
#endif //CONFIG_P2P
#endif //CONFIG_IOCTL_CFG80211
#endif /* CONFIG_P2P */
#endif /* CONFIG_IOCTL_CFG80211 */
#ifdef CONFIG_SET_SCAN_DENY_TIMER
_cancel_timer_ex(&padapter->mlmepriv.set_scan_deny_timer);
@ -1087,7 +1086,7 @@ void rtw_cancel_all_timer(struct adapter *padapter)
if (padapter->HalFunc.hal_cancel_checkbthang_workqueue)
padapter->HalFunc.hal_cancel_checkbthang_workqueue(padapter);
#endif
//cancel dm timer
/* cancel dm timer */
rtw_hal_dm_deinit(padapter);
}
@ -1102,9 +1101,9 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
rtw_wapi_free(padapter);
#endif
//we can call rtw_p2p_enable here, but:
// 1. rtw_p2p_enable may have IO operation
// 2. rtw_p2p_enable is bundled with wext interface
/* we can call rtw_p2p_enable here, but: */
/* 1. rtw_p2p_enable may have IO operation */
/* 2. rtw_p2p_enable is bundled with wext interface */
#ifdef CONFIG_P2P
{
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
@ -1117,22 +1116,22 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
}
}
#endif
// add for CONFIG_IEEE80211W, none 11w also can use
/* add for CONFIG_IEEE80211W, none 11w also can use */
_rtw_spinlock_free(&padapter->security_key_mutex);
#ifdef CONFIG_BR_EXT
_rtw_spinlock_free(&padapter->br_ext_lock);
#endif // CONFIG_BR_EXT
#endif /* CONFIG_BR_EXT */
#ifdef CONFIG_INTEL_WIDI
rtw_free_intel_widi(padapter);
#endif //CONFIG_INTEL_WIDI
#endif /* CONFIG_INTEL_WIDI */
free_mlme_ext_priv(&padapter->mlmeextpriv);
#ifdef CONFIG_TDLS
//rtw_free_tdls_info(&padapter->tdlsinfo);
#endif //CONFIG_TDLS
/* rtw_free_tdls_info(&padapter->tdlsinfo); */
#endif /* CONFIG_TDLS */
rtw_free_cmd_priv(&padapter->cmdpriv);
@ -1143,17 +1142,17 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
if (padapter->HalFunc.hal_free_checkbthang_workqueue)
padapter->HalFunc.hal_free_checkbthang_workqueue(padapter);
#endif
//free_io_queue(padapter);
/* free_io_queue(padapter); */
_rtw_free_xmit_priv(&padapter->xmitpriv);
_rtw_free_sta_priv(&padapter->stapriv); //will free bcmc_stainfo here
_rtw_free_sta_priv(&padapter->stapriv); /* will free bcmc_stainfo here */
_rtw_free_recv_priv(&padapter->recvpriv);
rtw_free_pwrctrl_priv(padapter);
//rtw_mfree((void *)padapter, sizeof (padapter));
/* rtw_mfree((void *)padapter, sizeof (padapter)); */
#ifdef CONFIG_DRVEXT_MODULE
free_drvext(&padapter->drvextpriv);
@ -1163,13 +1162,13 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
RT_TRACE(_module_os_intfs_c_,_drv_info_,("<==rtw_free_drv_sw\n"));
//free the old_pnetdev
/* free the old_pnetdev */
if(padapter->rereg_nd_name_priv.old_pnetdev) {
free_netdev(padapter->rereg_nd_name_priv.old_pnetdev);
padapter->rereg_nd_name_priv.old_pnetdev = NULL;
}
// clear pbuddy_adapter to avoid access wrong pointer.
/* clear pbuddy_adapter to avoid access wrong pointer. */
if(padapter->pbuddy_adapter != NULL) {
padapter->pbuddy_adapter->pbuddy_adapter = NULL;
}
@ -1187,31 +1186,31 @@ void netdev_br_init(struct net_device *netdev)
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
rcu_read_lock();
#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */
//if(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;
/* struct net_bridge *br = netdev->br_port->br;->dev->dev_addr; */
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
if (netdev->br_port)
#else // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
#else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
if (rcu_dereference(adapter->pnetdev->rx_handler_data))
#endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
{
struct net_device *br_netdev;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
br_netdev = dev_get_by_name(CONFIG_BR_EXT_BRNAME);
#else // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) */
struct net *devnet = NULL;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
devnet = netdev->nd_net;
#else // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)) */
devnet = dev_net(netdev);
#endif // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)) */
br_netdev = dev_get_by_name(devnet, CONFIG_BR_EXT_BRNAME);
#endif // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) */
if (br_netdev) {
memcpy(adapter->br_mac, br_netdev->dev_addr, ETH_ALEN);
@ -1225,9 +1224,9 @@ void netdev_br_init(struct net_device *netdev)
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
rcu_read_unlock();
#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */
}
#endif //CONFIG_BR_EXT
#endif /* CONFIG_BR_EXT */
static int _rtw_drv_register_netdev(struct adapter *padapter, char *name)
{
@ -1325,7 +1324,7 @@ int _netdev_open(struct net_device *pnetdev)
#ifdef CONFIG_RF_GAIN_OFFSET
rtw_bb_rf_gain_offset(padapter);
#endif //CONFIG_RF_GAIN_OFFSET
#endif /* CONFIG_RF_GAIN_OFFSET */
status=rtw_start_drv_threads(padapter);
if(status ==_FAIL)
@ -1367,7 +1366,7 @@ int _netdev_open(struct net_device *pnetdev)
rtw_set_pwr_state_check_timer(pwrctrlpriv);
//netif_carrier_on(pnetdev);//call this func when rtw_joinbss_event_callback return success
/* netif_carrier_on(pnetdev);call this func when rtw_joinbss_event_callback return success */
if(!rtw_netif_queue_stopped(pnetdev))
rtw_netif_start_queue(pnetdev);
else
@ -1375,7 +1374,7 @@ int _netdev_open(struct net_device *pnetdev)
#ifdef CONFIG_BR_EXT
netdev_br_init(pnetdev);
#endif // CONFIG_BR_EXT
#endif /* CONFIG_BR_EXT */
netdev_open_normal_process:
@ -1420,7 +1419,7 @@ static int ips_netdrv_open(struct adapter *padapter)
padapter->bDriverStopped = false;
padapter->bCardDisableWOHSM = false;
//padapter->bup = true;
/* padapter->bup = true; */
status = rtw_hal_init(padapter);
if (status ==_FAIL)
@ -1431,7 +1430,7 @@ static int ips_netdrv_open(struct adapter *padapter)
#ifdef CONFIG_RF_GAIN_OFFSET
rtw_bb_rf_gain_offset(padapter);
#endif //CONFIG_RF_GAIN_OFFSET
#endif /* CONFIG_RF_GAIN_OFFSET */
if(padapter->intf_start)
{
@ -1444,7 +1443,7 @@ static int ips_netdrv_open(struct adapter *padapter)
return _SUCCESS;
netdev_open_error:
//padapter->bup = false;
/* padapter->bup = false; */
DBG_871X("-ips_netdrv_open - drv_open failure, bup=%d\n", padapter->bup);
return _FAIL;
@ -1495,7 +1494,7 @@ void rtw_ips_dev_unload(struct adapter *padapter)
padapter->intf_stop(padapter);
}
//s5.
/* s5. */
if(padapter->bSurpriseRemoved == false)
{
rtw_hal_deinit(padapter);
@ -1513,8 +1512,8 @@ void rtw_bb_rf_gain_offset(struct adapter *padapter)
DBG_871X("+%s value: 0x%02x+\n", __func__, value);
if (value & RF_GAIN_OFFSET_ON) {
//DBG_871X("Offset RF Gain.\n");
//DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x\n",padapter->eeprompriv.EEPROMRFGainVal);
/* DBG_871X("Offset RF Gain.\n"); */
/* DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x\n",padapter->eeprompriv.EEPROMRFGainVal); */
if(padapter->eeprompriv.EEPROMRFGainVal != 0xff){
res = rtw_hal_read_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, 0xffffffff);
DBG_871X("REG_RF_BB_GAIN_OFFSET=%x \n",res);
@ -1525,14 +1524,14 @@ void rtw_bb_rf_gain_offset(struct adapter *padapter)
}
else
{
//DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x != 0xff, didn't run Kfree\n",padapter->eeprompriv.EEPROMRFGainVal);
/* DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x != 0xff, didn't run Kfree\n",padapter->eeprompriv.EEPROMRFGainVal); */
}
} else {
//DBG_871X("Using the default RF gain.\n");
/* DBG_871X("Using the default RF gain.\n"); */
}
}
#endif //CONFIG_RF_GAIN_OFFSET
#endif /* CONFIG_RF_GAIN_OFFSET */
int pm_netdev_open(struct net_device *pnetdev,u8 bnormal)
{
@ -1557,7 +1556,7 @@ static int netdev_close(struct net_device *pnetdev)
if(adapter_to_pwrctl(padapter)->bInternalAutoSuspend == true)
{
//rtw_pwr_wakeup(padapter);
/* rtw_pwr_wakeup(padapter); */
if(adapter_to_pwrctl(padapter)->rf_pwrstate == rf_off)
adapter_to_pwrctl(padapter)->ps_flag = true;
}
@ -1575,7 +1574,7 @@ static int netdev_close(struct net_device *pnetdev)
if(adapter_to_pwrctl(padapter)->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.
/* s1. */
if(pnetdev)
{
if (!rtw_netif_queue_stopped(pnetdev))
@ -1583,37 +1582,37 @@ static int netdev_close(struct net_device *pnetdev)
}
#ifndef CONFIG_ANDROID
//s2.
/* s2. */
LeaveAllPowerSaveMode(padapter);
rtw_disassoc_cmd(padapter, 500, false);
//s2-2. indicate disconnect to os
/* s2-2. indicate disconnect to os */
rtw_indicate_disconnect(padapter);
//s2-3.
/* s2-3. */
rtw_free_assoc_resources(padapter, 1);
//s2-4.
/* s2-4. */
rtw_free_network_queue(padapter,true);
#endif
// Close LED
/* Close LED */
rtw_led_control(padapter, LED_CTL_POWER_OFF);
}
#ifdef CONFIG_BR_EXT
//if (OPMODE & (WIFI_STATION_STATE | WIFI_ADHOC_STATE))
/* if (OPMODE & (WIFI_STATION_STATE | WIFI_ADHOC_STATE)) */
{
//void nat25_db_cleanup(struct adapter *priv);
/* void nat25_db_cleanup(struct adapter *priv); */
nat25_db_cleanup(padapter);
}
#endif // CONFIG_BR_EXT
#endif /* CONFIG_BR_EXT */
#ifdef CONFIG_P2P
rtw_p2p_enable(padapter, P2P_ROLE_DISABLE);
#endif //CONFIG_P2P
#endif /* CONFIG_P2P */
#ifdef CONFIG_IOCTL_CFG80211
rtw_scan_abort(padapter);
wdev_to_priv(padapter->rtw_wdev)->bandroid_scan = false;
padapter->rtw_wdev->iftype = NL80211_IFTYPE_MONITOR; //set this at the end
#endif //CONFIG_IOCTL_CFG80211
padapter->rtw_wdev->iftype = NL80211_IFTYPE_MONITOR; /* set this at the end */
#endif /* CONFIG_IOCTL_CFG80211 */
#ifdef CONFIG_WAPI_SUPPORT
rtw_wapi_disable_tx(padapter);
@ -1855,14 +1854,14 @@ static int arp_query(unsigned char *haddr, u32 paddr,
static int get_defaultgw(u32 *ip_addr ,char mac[])
{
int gw_index = 0; // oif device index
struct net_device *gw_dev = NULL; //oif device
int gw_index = 0; /* oif device index */
struct net_device *gw_dev = NULL; /* oif device */
route_dump(ip_addr, &gw_index);
if( !(*ip_addr) || !gw_index )
{
//DBG_871X("No default GW \n");
/* DBG_871X("No default GW \n"); */
return -1;
}
@ -1870,13 +1869,13 @@ static int get_defaultgw(u32 *ip_addr ,char mac[])
if(gw_dev == NULL)
{
//DBG_871X("get Oif Device Fail \n");
/* DBG_871X("get Oif Device Fail \n"); */
return -1;
}
if(!arp_query(mac, *ip_addr, gw_dev))
{
//DBG_871X( "arp query failed\n");
/* DBG_871X( "arp query failed\n"); */
dev_put(gw_dev);
return -1;
@ -1889,8 +1888,8 @@ static int get_defaultgw(u32 *ip_addr ,char mac[])
int rtw_gw_addr_query(struct adapter *padapter)
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
u32 gw_addr = 0; // default gw address
unsigned char gw_mac[32] = {0}; // default gw mac
u32 gw_addr = 0; /* default gw address */
unsigned char gw_mac[32] = {0}; /* default gw mac */
int i;
int res;
@ -1907,7 +1906,7 @@ int rtw_gw_addr_query(struct adapter *padapter)
}
else
{
//DBG_871X("Get Gateway IP/MAC fail!\n");
/* DBG_871X("Get Gateway IP/MAC fail!\n"); */
}
return res;
@ -1938,7 +1937,7 @@ static int rtw_suspend_free_assoc_resource(struct adapter *padapter)
pmlmepriv->assoc_ssid.SsidLength);
rtw_set_roaming(padapter, 1);
}
#endif //CONFIG_LAYER2_ROAMING_RESUME
#endif /* CONFIG_LAYER2_ROAMING_RESUME */
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED))
{
@ -1951,14 +1950,14 @@ static int rtw_suspend_free_assoc_resource(struct adapter *padapter)
}
#endif
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) ){
//s2-2. indicate disconnect to os
/* s2-2. indicate disconnect to os */
rtw_indicate_disconnect(padapter);
}
//s2-3.
/* s2-3. */
rtw_free_assoc_resources(padapter, 1);
//s2-4.
/* s2-4. */
#ifdef CONFIG_AUTOSUSPEND
if(is_primary_adapter(padapter) && (!adapter_to_pwrctl(padapter)->bInternalAutoSuspend ))
#endif
@ -2017,7 +2016,7 @@ int rtw_resume_common(struct adapter *padapter)
#ifdef CONFIG_LAYER2_ROAMING_RESUME
rtw_roaming(padapter, NULL);
#endif //CONFIG_LAYER2_ROAMING_RESUME
#endif /* CONFIG_LAYER2_ROAMING_RESUME */
} else if (check_fwstate(mlmepriv, WIFI_AP_STATE)) {
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_AP_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));

View file

@ -44,8 +44,8 @@ inline int RTW_STATUS_CODE(int error_code){
return _SUCCESS;
switch(error_code) {
//case -ETIMEDOUT:
// return RTW_STATUS_TIMEDOUT;
/* case -ETIMEDOUT: */
/* return RTW_STATUS_TIMEDOUT; */
default:
return _FAIL;
}
@ -187,10 +187,10 @@ inline void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr
#ifdef DBG_MEM_ALLOC
struct rtw_mem_stat {
ATOMIC_T alloc; // the memory bytes we allocate currently
ATOMIC_T peak; // the peak memory bytes we allocate
ATOMIC_T alloc_cnt; // the alloc count for alloc currently
ATOMIC_T alloc_err_cnt; // the error times we fail to allocate memory
ATOMIC_T alloc; /* the memory bytes we allocate currently */
ATOMIC_T peak; /* the peak memory bytes we allocate */
ATOMIC_T alloc_cnt; /* the alloc count for alloc currently */
ATOMIC_T alloc_err_cnt; /* the error times we fail to allocate memory */
};
struct rtw_mem_stat rtw_mem_type_stat[mstat_tf_idx(MSTAT_TYPE_MAX)];
@ -297,10 +297,10 @@ void rtw_mstat_update(const enum mstat_f flags, const MSTAT_STATUS status, u32 s
break;
};
//if (rtw_get_passing_time_ms(update_time) > 5000) {
// rtw_mstat_dump();
/* if (rtw_get_passing_time_ms(update_time) > 5000) { */
/* rtw_mstat_dump(); */
update_time=rtw_get_current_time();
//}
/* */
}
@ -308,7 +308,7 @@ void rtw_mstat_update(const enum mstat_f flags, const MSTAT_STATUS status, u32 s
inline u8* dbg_rtw_vmalloc(u32 sz, const enum mstat_f flags, const char *func, const int line)
{
u8 *p;
//DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); */
p=_rtw_vmalloc((sz));
@ -324,7 +324,7 @@ inline u8* dbg_rtw_vmalloc(u32 sz, const enum mstat_f flags, const char *func, c
inline u8* dbg_rtw_zvmalloc(u32 sz, const enum mstat_f flags, const char *func, const int line)
{
u8 *p;
//DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); */
p=_rtw_zvmalloc((sz));
@ -339,7 +339,7 @@ inline u8* dbg_rtw_zvmalloc(u32 sz, const enum mstat_f flags, const char *func,
inline void dbg_rtw_vmfree(u8 *pbuf, u32 sz, const enum mstat_f flags, const char *func, const int line)
{
//DBG_871X("DBG_MEM_ALLOC %s:%d %s(%p,%d)\n", func, line, __FUNCTION__, (pbuf), (sz));
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%p,%d)\n", func, line, __FUNCTION__, (pbuf), (sz)); */
_rtw_vmfree((pbuf), (sz));
@ -354,11 +354,11 @@ inline u8* dbg_rtw_malloc(u32 sz, const enum mstat_f flags, const char *func, co
{
u8 *p;
//if(sz>=153 && sz<=306)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
/* if(sz>=153 && sz<=306) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); */
//if((sz)>4096)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
/* if((sz)>4096) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); */
p=_rtw_malloc((sz));
@ -375,11 +375,11 @@ inline u8* dbg_rtw_zmalloc(u32 sz, const enum mstat_f flags, const char *func, c
{
u8 *p;
//if(sz>=153 && sz<=306)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
/* if(sz>=153 && sz<=306) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); */
//if((sz)>4096)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
/* if((sz)>4096) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); */
p = _rtw_zmalloc((sz));
@ -394,11 +394,11 @@ inline u8* dbg_rtw_zmalloc(u32 sz, const enum mstat_f flags, const char *func, c
inline void dbg_rtw_mfree(u8 *pbuf, u32 sz, const enum mstat_f flags, const char *func, const int line)
{
//if(sz>=153 && sz<=306)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
/* if(sz>=153 && sz<=306) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); */
//if((sz)>4096)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s(%p,%d)\n", func, line, __FUNCTION__, (pbuf), (sz));
/* if((sz)>4096) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%p,%d)\n", func, line, __FUNCTION__, (pbuf), (sz)); */
_rtw_mfree((pbuf), (sz));
@ -435,8 +435,8 @@ inline void dbg_rtw_skb_free(struct sk_buff *skb, const enum mstat_f flags, cons
{
unsigned int truesize = skb->truesize;
//if(truesize > 4096)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize);
/* if(truesize > 4096) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize); */
_rtw_skb_free(skb);
@ -496,8 +496,8 @@ inline int dbg_rtw_netif_rx(_nic_hdl ndev, struct sk_buff *skb, const enum mstat
int ret;
unsigned int truesize = skb->truesize;
//if(truesize > 4096)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize);
/* if(truesize > 4096) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize); */
ret = _rtw_netif_rx(ndev, skb);
@ -521,7 +521,7 @@ inline void dbg_rtw_skb_queue_purge(struct sk_buff_head *list, enum mstat_f flag
inline void *dbg_rtw_usb_buffer_alloc(struct usb_device *dev, size_t size, dma_addr_t *dma, const enum mstat_f flags, const char *func, int line)
{
void *p;
//DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, size);
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, size); */
p = _rtw_usb_buffer_alloc(dev, size, dma);
@ -536,7 +536,7 @@ inline void *dbg_rtw_usb_buffer_alloc(struct usb_device *dev, size_t size, dma_a
inline void dbg_rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_addr_t dma, const enum mstat_f flags, const char *func, int line)
{
//DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, size);
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, size); */
_rtw_usb_buffer_free(dev, size, addr, dma);
@ -572,7 +572,7 @@ void rtw_mfree2d(void *pbuf, int h, int w, int size)
int _rtw_memcmp(void *dst, void *src, u32 sz)
{
//under Linux/GNU/GLibc, the return value of memcmp for two same mem. chunk is 0
/* under Linux/GNU/GLibc, the return value of memcmp for two same mem. chunk is 0 */
if (!(memcmp(dst, src, sz)))
return true;
else
@ -704,7 +704,7 @@ inline u32 rtw_ms_to_systime(u32 ms)
return ms * HZ / 1000;
}
// the input parameter start use the same unit as returned by rtw_get_current_time
/* the input parameter start use the same unit as returned by rtw_get_current_time */
inline s32 rtw_get_passing_time_ms(u32 start)
{
return rtw_systime_to_ms(jiffies-start);
@ -720,9 +720,9 @@ void rtw_sleep_schedulable(int ms)
{
u32 delta;
delta = (ms * HZ)/1000;//(ms)
delta = (ms * HZ)/1000;/* ms) */
if (delta == 0) {
delta = 1;// 1 ms
delta = 1;/* 1 ms */
}
set_current_state(TASK_INTERRUPTIBLE);
if (schedule_timeout(delta) != 0) {
@ -820,7 +820,7 @@ inline void rtw_lock_suspend(void)
#endif
#if defined(CONFIG_WAKELOCK) || defined(CONFIG_ANDROID_POWER)
//DBG_871X("####%s: suspend_lock_count:%d####\n", __FUNCTION__, rtw_suspend_lock.stat.count);
/* DBG_871X("####%s: suspend_lock_count:%d####\n", __FUNCTION__, rtw_suspend_lock.stat.count); */
#endif
}
@ -833,7 +833,7 @@ inline void rtw_unlock_suspend(void)
#endif
#if defined(CONFIG_WAKELOCK) || defined(CONFIG_ANDROID_POWER)
//DBG_871X("####%s: suspend_lock_count:%d####\n", __FUNCTION__, rtw_suspend_lock.stat.count);
/* DBG_871X("####%s: suspend_lock_count:%d####\n", __FUNCTION__, rtw_suspend_lock.stat.count); */
#endif
}
@ -1116,7 +1116,7 @@ int rtw_store_to_file(char *path, u8* buf, u32 sz)
return ret>=0?ret:0;
}
#if 1 //#ifdef MEM_ALLOC_REFINE_ADAPTOR
#if 1 /* ifdef MEM_ALLOC_REFINE_ADAPTOR */
struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_priv)
{
struct net_device *pnetdev;
@ -1200,7 +1200,7 @@ int rtw_change_ifname(struct adapter *padapter, const char *ifname)
rereg_priv = &padapter->rereg_nd_name_priv;
//free the old_pnetdev
/* free the old_pnetdev */
if(rereg_priv->old_pnetdev) {
free_netdev(rereg_priv->old_pnetdev);
rereg_priv->old_pnetdev = NULL;
@ -1250,7 +1250,7 @@ error:
return -1;
}
#endif //MEM_ALLOC_REFINE_ADAPTOR
#endif /* MEM_ALLOC_REFINE_ADAPTOR */
#ifdef CONFIG_PLATFORM_SPRD
#ifdef do_div

View file

@ -30,7 +30,7 @@
#include <ethernet.h>
#include <usb_ops.h>
//init os related resource in struct recv_priv
/* init os related resource in struct recv_priv */
int rtw_os_recv_resource_init(struct recv_priv *precvpriv, struct adapter *padapter)
{
int res=_SUCCESS;
@ -38,7 +38,7 @@ int rtw_os_recv_resource_init(struct recv_priv *precvpriv, struct adapter *padap
return res;
}
//alloc os related resource in union recv_frame
/* alloc os related resource in union recv_frame */
int rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precvframe)
{
int res=_SUCCESS;
@ -49,7 +49,7 @@ int rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precv
}
//free os related resource in union recv_frame
/* free os related resource in union recv_frame */
void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
{
sint i;
@ -60,7 +60,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
{
if(precvframe->u.hdr.pkt)
{
rtw_skb_free(precvframe->u.hdr.pkt);//free skb by driver
rtw_skb_free(precvframe->u.hdr.pkt);/* free skb by driver */
precvframe->u.hdr.pkt = NULL;
}
precvframe++;
@ -69,7 +69,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
}
//alloc os related resource in struct recv_buf
/* alloc os related resource in struct recv_buf */
int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, struct recv_buf *precvbuf)
{
int res=_SUCCESS;
@ -100,11 +100,11 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, struct recv_buf *pre
precvbuf->pbuf = precvbuf->pallocated_buf;
if(precvbuf->pallocated_buf == NULL)
return _FAIL;
#endif //CONFIG_USE_USB_BUFFER_ALLOC_RX
#endif /* CONFIG_USE_USB_BUFFER_ALLOC_RX */
return res;
}
//free os related resource in struct recv_buf
/* free os related resource in struct recv_buf */
int rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf)
{
int ret = _SUCCESS;
@ -118,11 +118,11 @@ int rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *prec
precvbuf->pallocated_buf = NULL;
precvbuf->dma_transfer_addr = 0;
#endif //CONFIG_USE_USB_BUFFER_ALLOC_RX
#endif /* CONFIG_USE_USB_BUFFER_ALLOC_RX */
if(precvbuf->purb)
{
//usb_kill_urb(precvbuf->purb);
/* usb_kill_urb(precvbuf->purb); */
usb_free_urb(precvbuf->purb);
}
if(precvbuf->pskb)
@ -217,26 +217,26 @@ void rtw_hostapd_mlme_rx(struct adapter *padapter, union recv_frame *precv_frame
skb->tail = precv_frame->u.hdr.rx_tail;
skb->len = precv_frame->u.hdr.len;
//pskb_copy = rtw_skb_copy(skb);
// if(skb == NULL) goto _exit;
/* pskb_copy = rtw_skb_copy(skb); */
/* if(skb == NULL) goto _exit; */
skb->dev = pmgnt_netdev;
skb->ip_summed = CHECKSUM_NONE;
skb->pkt_type = PACKET_OTHERHOST;
//skb->protocol = __constant_htons(0x0019); /*ETH_P_80211_RAW*/
/* skb->protocol = __constant_htons(0x0019); /*ETH_P_80211_RAW*/ */
skb->protocol = __constant_htons(0x0003); /*ETH_P_80211_RAW*/
//DBG_871X("(1)data=0x%x, head=0x%x, tail=0x%x, mac_header=0x%x, len=%d\n", skb->data, skb->head, skb->tail, skb->mac_header, skb->len);
/* DBG_871X("(1)data=0x%x, head=0x%x, tail=0x%x, mac_header=0x%x, len=%d\n", skb->data, skb->head, skb->tail, skb->mac_header, skb->len); */
//skb->mac.raw = skb->data;
/* skb->mac.raw = skb->data; */
skb_reset_mac_header(skb);
//skb_pull(skb, 24);
/* skb_pull(skb, 24); */
memset(skb->cb, 0, sizeof(skb->cb));
rtw_netif_rx(pmgnt_netdev, skb);
precv_frame->u.hdr.pkt = NULL; // set pointer to NULL before rtw_free_recvframe() if call rtw_netif_rx()
precv_frame->u.hdr.pkt = NULL; /* set pointer to NULL before rtw_free_recvframe() if call rtw_netif_rx() */
#endif
}
@ -301,11 +301,11 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
int bmcast = IS_MCAST(pattrib->dst);
//DBG_871X("bmcast=%d\n", bmcast);
/* DBG_871X("bmcast=%d\n", bmcast); */
if(_rtw_memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)==false)
{
//DBG_871X("not ap psta=%p, addr=%pM\n", psta, pattrib->dst);
/* DBG_871X("not ap psta=%p, addr=%pM\n", psta, pattrib->dst); */
if(bmcast)
{
@ -319,9 +319,9 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
{
struct net_device *pnetdev= (struct net_device*)padapter->pnetdev;
//DBG_871X("directly forwarding to the rtw_xmit_entry\n");
/* DBG_871X("directly forwarding to the rtw_xmit_entry\n"); */
//skb->ip_summed = CHECKSUM_NONE;
/* skb->ip_summed = CHECKSUM_NONE; */
skb->dev = pnetdev;
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0))
@ -330,7 +330,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
skb_set_queue_mapping(skb, rtw_recv_select_queue(skb,
NULL, NULL));
#endif
#endif //LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35)
#endif /* LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35) */
_rtw_xmit_entry(skb, pnetdev);
@ -342,9 +342,9 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
}
else// to APself
else/* to APself */
{
//DBG_871X("to APSelf\n");
/* DBG_871X("to APSelf\n"); */
}
}
@ -353,37 +353,37 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
br_port = padapter->pnetdev->br_port;
#else // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
#else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
rcu_read_lock();
br_port = rcu_dereference(padapter->pnetdev->rx_handler_data);
rcu_read_unlock();
#endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
if( br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) )
{
int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb);
if (nat25_handle_frame(padapter, skb) == -1) {
//priv->ext_stats.rx_data_drops++;
//DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n");
//return FAIL;
/* priv->ext_stats.rx_data_drops++; */
/* DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n"); */
/* return FAIL; */
#if 1
// bypass this frame to upper layer!!
/* bypass this frame to upper layer!! */
#else
goto _recv_indicatepkt_drop;
#endif
}
}
#endif // CONFIG_BR_EXT
#endif /* CONFIG_BR_EXT */
#ifdef CONFIG_TCP_CSUM_OFFLOAD_RX
if ( (pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1) ) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
//DBG_871X("CHECKSUM_UNNECESSARY \n");
/* DBG_871X("CHECKSUM_UNNECESSARY \n"); */
} else {
skb->ip_summed = CHECKSUM_NONE;
//DBG_871X("CHECKSUM_NONE(%d, %d) \n", pattrib->tcpchk_valid, pattrib->tcp_chkrpt);
/* DBG_871X("CHECKSUM_NONE(%d, %d) \n", pattrib->tcpchk_valid, pattrib->tcp_chkrpt); */
}
#else /* !CONFIG_TCP_CSUM_OFFLOAD_RX */
@ -439,7 +439,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
_recv_indicatepkt_end:
precv_frame->u.hdr.pkt = NULL; // pointers to NULL before rtw_free_recvframe()
precv_frame->u.hdr.pkt = NULL; /* pointers to NULL before rtw_free_recvframe() */
rtw_free_recvframe(precv_frame, pfree_recv_queue);
@ -451,7 +451,7 @@ _recv_indicatepkt_end:
_recv_indicatepkt_drop:
//enqueue back to free_recv_queue
/* enqueue back to free_recv_queue */
if(precv_frame)
rtw_free_recvframe(precv_frame, pfree_recv_queue);
@ -467,7 +467,7 @@ void rtw_os_read_port(struct adapter *padapter, struct recv_buf *precvbuf)
precvbuf->ref_cnt--;
//free skb in recv_buf
/* free skb in recv_buf */
rtw_skb_free(precvbuf->pskb);
precvbuf->pskb = NULL;

View file

@ -295,7 +295,7 @@ static int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, i
{
int bytes_written = 0;
//We use the same address as our HW MAC address
/* We use the same address as our HW MAC address */
memcpy(command, net->dev_addr, ETH_ALEN);
bytes_written = ETH_ALEN;
@ -322,7 +322,7 @@ static int get_int_from_command(char *pcmd)
{
if ( pcmd[ i ] == '=' )
{
// Skip the '=' and space characters.
/* Skip the '=' and space characters. */
i += 2;
break;
}
@ -353,7 +353,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
goto exit;
}
//DBG_871X("%s priv_cmd.buf=%p priv_cmd.total_len=%d priv_cmd.used_len=%d\n",__func__,priv_cmd.buf,priv_cmd.total_len,priv_cmd.used_len);
/* DBG_871X("%s priv_cmd.buf=%p priv_cmd.total_len=%d priv_cmd.used_len=%d\n",__func__,priv_cmd.buf,priv_cmd.total_len,priv_cmd.used_len); */
command = rtw_zmalloc(priv_cmd.total_len);
if (!command)
{
@ -379,7 +379,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
switch(cmd_num) {
case ANDROID_WIFI_CMD_START:
//bytes_written = wl_android_wifi_on(net);
/* bytes_written = wl_android_wifi_on(net); */
goto response;
case ANDROID_WIFI_CMD_SETFWPATH:
goto response;
@ -395,19 +395,19 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
switch(cmd_num) {
case ANDROID_WIFI_CMD_STOP:
//bytes_written = wl_android_wifi_off(net);
/* bytes_written = wl_android_wifi_off(net); */
break;
case ANDROID_WIFI_CMD_SCAN_ACTIVE:
//rtw_set_scan_mode((struct adapter *)rtw_netdev_priv(net), SCAN_ACTIVE);
/* rtw_set_scan_mode((struct adapter *)rtw_netdev_priv(net), SCAN_ACTIVE); */
#ifdef CONFIG_PLATFORM_MSTAR
#ifdef CONFIG_IOCTL_CFG80211
(wdev_to_priv(net->ieee80211_ptr))->bandroid_scan = true;
#endif //CONFIG_IOCTL_CFG80211
#endif //CONFIG_PLATFORM_MSTAR
#endif /* CONFIG_IOCTL_CFG80211 */
#endif /* CONFIG_PLATFORM_MSTAR */
break;
case ANDROID_WIFI_CMD_SCAN_PASSIVE:
//rtw_set_scan_mode((struct adapter *)rtw_netdev_priv(net), SCAN_PASSIVE);
/* rtw_set_scan_mode((struct adapter *)rtw_netdev_priv(net), SCAN_PASSIVE); */
break;
case ANDROID_WIFI_CMD_RSSI:
@ -426,18 +426,18 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
break;
case ANDROID_WIFI_CMD_RXFILTER_START:
//bytes_written = net_os_set_packet_filter(net, 1);
/* bytes_written = net_os_set_packet_filter(net, 1); */
break;
case ANDROID_WIFI_CMD_RXFILTER_STOP:
//bytes_written = net_os_set_packet_filter(net, 0);
/* bytes_written = net_os_set_packet_filter(net, 0); */
break;
case ANDROID_WIFI_CMD_RXFILTER_ADD:
//int filter_num = *(command + strlen(CMD_RXFILTER_ADD) + 1) - '0';
//bytes_written = net_os_rxfilter_add_remove(net, TRUE, filter_num);
/* int filter_num = *(command + strlen(CMD_RXFILTER_ADD) + 1) - '0'; */
/* bytes_written = net_os_rxfilter_add_remove(net, TRUE, filter_num); */
break;
case ANDROID_WIFI_CMD_RXFILTER_REMOVE:
//int filter_num = *(command + strlen(CMD_RXFILTER_REMOVE) + 1) - '0';
//bytes_written = net_os_rxfilter_add_remove(net, FALSE, filter_num);
/* int filter_num = *(command + strlen(CMD_RXFILTER_REMOVE) + 1) - '0'; */
/* bytes_written = net_os_rxfilter_add_remove(net, FALSE, filter_num); */
break;
case ANDROID_WIFI_CMD_BTCOEXSCAN_START:
@ -449,7 +449,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
case ANDROID_WIFI_CMD_BTCOEXMODE:
break;
case ANDROID_WIFI_CMD_SETSUSPENDOPT:
//bytes_written = wl_android_set_suspendopt(net, command, priv_cmd.total_len);
/* bytes_written = wl_android_set_suspendopt(net, command, priv_cmd.total_len); */
break;
case ANDROID_WIFI_CMD_SETBAND:
{
@ -462,7 +462,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
break;
}
case ANDROID_WIFI_CMD_GETBAND:
//bytes_written = wl_android_get_band(net, command, priv_cmd.total_len);
/* bytes_written = wl_android_get_band(net, command, priv_cmd.total_len); */
break;
case ANDROID_WIFI_CMD_COUNTRY:
@ -471,14 +471,14 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
#ifdef PNO_SUPPORT
case ANDROID_WIFI_CMD_PNOSSIDCLR_SET:
//bytes_written = dhd_dev_pno_reset(net);
/* bytes_written = dhd_dev_pno_reset(net); */
break;
case ANDROID_WIFI_CMD_PNOSETUP_SET:
//bytes_written = wl_android_set_pno_setup(net, command, priv_cmd.total_len);
/* bytes_written = wl_android_set_pno_setup(net, command, priv_cmd.total_len); */
break;
case ANDROID_WIFI_CMD_PNOENABLE_SET:
//uint pfn_enabled = *(command + strlen(CMD_PNOENABLE_SET) + 1) - '0';
//bytes_written = dhd_dev_pno_enable(net, pfn_enabled);
/* uint pfn_enabled = *(command + strlen(CMD_PNOENABLE_SET) + 1) - '0'; */
/* bytes_written = dhd_dev_pno_enable(net, pfn_enabled); */
break;
#endif
@ -486,15 +486,15 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
bytes_written = rtw_android_get_p2p_dev_addr(net, command, priv_cmd.total_len);
break;
case ANDROID_WIFI_CMD_P2P_SET_NOA:
//int skip = strlen(CMD_P2P_SET_NOA) + 1;
//bytes_written = wl_cfg80211_set_p2p_noa(net, command + skip, priv_cmd.total_len - skip);
/* int skip = strlen(CMD_P2P_SET_NOA) + 1; */
/* bytes_written = wl_cfg80211_set_p2p_noa(net, command + skip, priv_cmd.total_len - skip); */
break;
case ANDROID_WIFI_CMD_P2P_GET_NOA:
//bytes_written = wl_cfg80211_get_p2p_noa(net, command, priv_cmd.total_len);
/* bytes_written = wl_cfg80211_get_p2p_noa(net, command, priv_cmd.total_len); */
break;
case ANDROID_WIFI_CMD_P2P_SET_PS:
//int skip = strlen(CMD_P2P_SET_PS) + 1;
//bytes_written = wl_cfg80211_set_p2p_ps(net, command + skip, priv_cmd.total_len - skip);
/* int skip = strlen(CMD_P2P_SET_PS) + 1; */
/* bytes_written = wl_cfg80211_set_p2p_ps(net, command + skip, priv_cmd.total_len - skip); */
break;
#ifdef CONFIG_IOCTL_CFG80211
@ -504,31 +504,31 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
bytes_written = rtw_cfg80211_set_mgnt_wpsp2pie(net, command + skip, priv_cmd.total_len - skip, *(command + skip - 2) - '0');
break;
}
#endif //CONFIG_IOCTL_CFG80211
#endif /* CONFIG_IOCTL_CFG80211 */
#ifdef CONFIG_WFD
case ANDROID_WIFI_CMD_WFD_ENABLE:
// Commented by Albert 2012/07/24
// We can enable the WFD function by using the following command:
// wpa_cli driver wfd-enable
/* Commented by Albert 2012/07/24 */
/* We can enable the WFD function by using the following command: */
/* wpa_cli driver wfd-enable */
pwfd_info = &padapter->wfd_info;
if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
pwfd_info->wfd_enable = true;
break;
case ANDROID_WIFI_CMD_WFD_DISABLE:
// Commented by Albert 2012/07/24
// We can disable the WFD function by using the following command:
// wpa_cli driver wfd-disable
/* Commented by Albert 2012/07/24 */
/* We can disable the WFD function by using the following command: */
/* wpa_cli driver wfd-disable */
pwfd_info = &padapter->wfd_info;
if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
pwfd_info->wfd_enable = false;
break;
case ANDROID_WIFI_CMD_WFD_SET_TCPPORT:
// Commented by Albert 2012/07/24
// We can set the tcp port number by using the following command:
// wpa_cli driver wfd-set-tcpport = 554
/* Commented by Albert 2012/07/24 */
/* We can set the tcp port number by using the following command: */
/* wpa_cli driver wfd-set-tcpport = 554 */
pwfd_info = &padapter->wfd_info;
if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
@ -538,8 +538,8 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
break;
case ANDROID_WIFI_CMD_WFD_SET_DEVTYPE:
{
// Commented by Albert 2012/08/28
// Specify the WFD device type ( WFD source/primary sink )
/* Commented by Albert 2012/08/28 */
/* Specify the WFD device type ( WFD source/primary sink ) */
struct wifi_display_info *pwfd_info;
struct adapter* padapter = ( struct adapter * ) rtw_netdev_priv(net);

View file

@ -137,14 +137,14 @@ MODULE_DEVICE_TABLE(usb, rtw_usb_id_tbl);
static struct specific_device_id specific_device_id_tbl[] = {
{.idVendor=USB_VENDER_ID_REALTEK, .idProduct=0x8177, .flags=SPEC_DEV_ID_DISABLE_HT},//8188cu 1*1 dongole, (b/g mode only)
{.idVendor=USB_VENDER_ID_REALTEK, .idProduct=0x817E, .flags=SPEC_DEV_ID_DISABLE_HT},//8188CE-VAU USB minCard (b/g mode only)
{.idVendor=USB_VENDER_ID_REALTEK, .idProduct=0x8177, .flags=SPEC_DEV_ID_DISABLE_HT},/* 8188cu 1*1 dongole, (b/g mode only) */
{.idVendor=USB_VENDER_ID_REALTEK, .idProduct=0x817E, .flags=SPEC_DEV_ID_DISABLE_HT},/* 8188CE-VAU USB minCard (b/g mode only) */
{.idVendor=0x0b05, .idProduct=0x1791, .flags=SPEC_DEV_ID_DISABLE_HT},
{.idVendor=0x13D3, .idProduct=0x3311, .flags=SPEC_DEV_ID_DISABLE_HT},
{.idVendor=0x13D3, .idProduct=0x3359, .flags=SPEC_DEV_ID_DISABLE_HT},//Russian customer -Azwave (8188CE-VAU g mode)
{.idVendor=0x13D3, .idProduct=0x3359, .flags=SPEC_DEV_ID_DISABLE_HT},/* Russian customer -Azwave (8188CE-VAU g mode) */
#ifdef RTK_DMP_PLATFORM
{.idVendor=USB_VENDER_ID_REALTEK, .idProduct=0x8111, .flags=SPEC_DEV_ID_ASSIGN_IFNAME}, // Realtek 5G dongle for WiFi Display
{.idVendor=0x2019, .idProduct=0xAB2D, .flags=SPEC_DEV_ID_ASSIGN_IFNAME}, // PCI-Abocom 5G dongle for WiFi Display
{.idVendor=USB_VENDER_ID_REALTEK, .idProduct=0x8111, .flags=SPEC_DEV_ID_ASSIGN_IFNAME}, /* Realtek 5G dongle for WiFi Display */
{.idVendor=0x2019, .idProduct=0xAB2D, .flags=SPEC_DEV_ID_ASSIGN_IFNAME}, /* PCI-Abocom 5G dongle for WiFi Display */
#endif /* RTK_DMP_PLATFORM */
{}
};
@ -297,8 +297,8 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
pdvobjpriv->RtNumInPipes = 0;
pdvobjpriv->RtNumOutPipes = 0;
//padapter->EepromAddressSize = 6;
//pdvobjpriv->nr_endpoint = 6;
/* padapter->EepromAddressSize = 6; */
/* pdvobjpriv->nr_endpoint = 6; */
pdev_desc = &pusbd->descriptor;
@ -358,7 +358,7 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
goto free_dvobj;
}
//.3 misc
/* 3 misc */
_rtw_init_sema(&(pdvobjpriv->usb_suspend_sema), 0);
rtw_reset_continual_io_error(pdvobjpriv);
@ -389,12 +389,12 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf)
usb_set_intfdata(usb_intf, NULL);
if (dvobj) {
//Modify condition for 92DU DMDP 2010.11.18, by Thomas
/* Modify condition for 92DU DMDP 2010.11.18, by Thomas */
if ((dvobj->NumInterfaces != 2 && dvobj->NumInterfaces != 3)
|| (dvobj->InterfaceNumber == 1)) {
if (interface_to_usbdev(usb_intf)->state != USB_STATE_NOTATTACHED) {
//If we didn't unplug usb dongle and remove/insert modlue, driver fails on sitesurvey for the first time when device is up .
//Reset usb port for sitesurvey fail issue. 2009.8.13, by Thomas
/* If we didn't unplug usb dongle and remove/insert modlue, driver fails on sitesurvey for the first time when device is up . */
/* Reset usb port for sitesurvey fail issue. 2009.8.13, by Thomas */
DBG_871X("usb attached..., try to reset usb device\n");
usb_reset_device(interface_to_usbdev(usb_intf));
}
@ -407,7 +407,7 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf)
rtw_mfree((u8*)dvobj, sizeof(*dvobj));
}
//DBG_871X("%s %d\n", __func__, ATOMIC_READ(&usb_intf->dev.kobj.kref.refcount));
/* DBG_871X("%s %d\n", __func__, ATOMIC_READ(&usb_intf->dev.kobj.kref.refcount)); */
usb_put_dev(interface_to_usbdev(usb_intf));
;
@ -435,21 +435,21 @@ static void usb_intf_stop(struct adapter *padapter)
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+usb_intf_stop\n"));
//disabel_hw_interrupt
/* disabel_hw_interrupt */
if(padapter->bSurpriseRemoved == false)
{
//device still exists, so driver can do i/o operation
//TODO:
/* device still exists, so driver can do i/o operation */
/* TODO: */
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("SurpriseRemoved==false\n"));
}
//cancel in irp
/* cancel in irp */
rtw_hal_inirp_deinit(padapter);
//cancel out irp
/* cancel out irp */
rtw_write_port_cancel(padapter);
//todo:cancel other irps
/* todo:cancel other irps */
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("-usb_intf_stop\n"));
@ -471,27 +471,27 @@ void rtw_dev_unload(struct adapter *padapter)
rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_DRV_STOP);
#endif
//s3.
/* s3. */
if(padapter->intf_stop)
{
padapter->intf_stop(padapter);
}
//s4.
/* s4. */
if(!adapter_to_pwrctl(padapter)->bInternalAutoSuspend )
rtw_stop_drv_threads(padapter);
//s5.
/* s5. */
if(padapter->bSurpriseRemoved == false)
{
//DBG_871X("r871x_dev_unload()->rtl871x_hal_deinit()\n");
/* DBG_871X("r871x_dev_unload()->rtl871x_hal_deinit()\n"); */
#ifdef CONFIG_WOWLAN
if((adapter_to_pwrctl(padapter)->bSupportRemoteWakeup==true)&&(adapter_to_pwrctl(padapter)->wowlan_mode==true)){
DBG_871X("%s bSupportWakeOnWlan==true do not run rtw_hal_deinit()\n",__FUNCTION__);
}
else
#endif //CONFIG_WOWLAN
#endif /* CONFIG_WOWLAN */
{
rtw_hal_deinit(padapter);
}
@ -501,7 +501,7 @@ void rtw_dev_unload(struct adapter *padapter)
padapter->bup = false;
#ifdef CONFIG_WOWLAN
padapter->hw_init_completed=false;
#endif //CONFIG_WOWLAN
#endif /* CONFIG_WOWLAN */
}
else
{
@ -537,13 +537,13 @@ static void process_spec_devid(const struct usb_device_id *pdid)
#endif
#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.
/* 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))
{
extern char* ifname;
strncpy(ifname, "wlan10", 6);
//DBG_871X("%s()-%d: ifname=%s, vid=%04X, pid=%04X\n", __FUNCTION__, __LINE__, ifname, vid, pid);
/* DBG_871X("%s()-%d: ifname=%s, vid=%04X, pid=%04X\n", __FUNCTION__, __LINE__, ifname, vid, pid); */
}
#endif /* RTK_DMP_PLATFORM */
@ -566,26 +566,26 @@ int rtw_hw_suspend(struct adapter *padapter )
goto error_exit;
}
if(padapter)//system suspend
if(padapter)/* system suspend */
{
LeaveAllPowerSaveMode(padapter);
DBG_871X("==> rtw_hw_suspend\n");
_enter_pwrlock(&pwrpriv->lock);
pwrpriv->bips_processing = true;
//padapter->net_closed = true;
//s1.
/* padapter->net_closed = true; */
/* s1. */
if(pnetdev)
{
netif_carrier_off(pnetdev);
rtw_netif_stop_queue(pnetdev);
}
//s2.
/* s2. */
rtw_disassoc_cmd(padapter, 500, false);
//s2-2. indicate disconnect to os
//rtw_indicate_disconnect(padapter);
/* s2-2. indicate disconnect to os */
/* rtw_indicate_disconnect(padapter); */
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -598,16 +598,16 @@ int rtw_hw_suspend(struct adapter *padapter )
rtw_os_indicate_disconnect(padapter);
#ifdef CONFIG_LPS
//donnot enqueue cmd
/* donnot enqueue cmd */
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 0);
#endif
}
}
//s2-3.
/* s2-3. */
rtw_free_assoc_resources(padapter, 1);
//s2-4.
/* s2-4. */
rtw_free_network_queue(padapter,true);
#ifdef CONFIG_IPS
rtw_ips_dev_unload(padapter);
@ -637,7 +637,7 @@ int rtw_hw_resume(struct adapter *padapter)
;
if(padapter)//system resume
if(padapter)/* system resume */
{
DBG_871X("==> rtw_hw_resume\n");
_enter_pwrlock(&pwrpriv->lock);
@ -701,8 +701,8 @@ static void rtw_suspend_wow(struct adapter *padapter)
rtw_stop_cmd_thread(padapter);
//padapter->net_closed = true;
//s1.
/* padapter->net_closed = true; */
/* s1. */
if(pnetdev)
{
netif_carrier_off(pnetdev);
@ -710,13 +710,13 @@ static void rtw_suspend_wow(struct adapter *padapter)
}
if(pwrpriv->bSupportRemoteWakeup==true && pwrpriv->wowlan_mode==true){
//set H2C command
/* set H2C command */
poidparam.subcode=WOWLAN_ENABLE;
padapter->HalFunc.SetHwRegHandler(padapter,HW_VAR_WOWLAN,(u8 *)&poidparam);
}
else
{
//s2.
/* s2. */
rtw_disassoc_cmd(padapter, 0, false);
}
@ -724,7 +724,7 @@ static void rtw_suspend_wow(struct adapter *padapter)
#ifdef CONFIG_LAYER2_ROAMING_RESUME
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED)&& rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
{
//DBG_871X("%s:%d assoc_ssid:%s\n", __FUNCTION__, __LINE__, pmlmepriv->assoc_ssid.Ssid);
/* 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__,
pmlmepriv->cur_network.network.Ssid.Ssid,
MAC_ARG(pmlmepriv->cur_network.network.MacAddress),
@ -734,14 +734,14 @@ static void rtw_suspend_wow(struct adapter *padapter)
rtw_set_roaming(padapter, 1);
}
#endif
//s2-2. indicate disconnect to os
/* s2-2. indicate disconnect to os */
rtw_indicate_disconnect(padapter);
//s2-3.
/* s2-3. */
rtw_free_assoc_resources(padapter, 1);
#ifdef CONFIG_AUTOSUSPEND
if(!pwrpriv->bInternalAutoSuspend )
#endif
//s2-4.
/* s2-4. */
rtw_free_network_queue(padapter, true);
rtw_dev_unload(padapter);
@ -749,8 +749,8 @@ static void rtw_suspend_wow(struct adapter *padapter)
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
rtw_indicate_scan_done(padapter, 1);
//if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
// rtw_indicate_disconnect(padapter);
/* if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) */
/* rtw_indicate_disconnect(padapter); */
}
#endif
@ -792,12 +792,11 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
{
#ifdef CONFIG_AUTOSUSPEND
#ifdef SUPPORT_HW_RFOFF_DETECTED
// The FW command register update must after MAC and FW init ready.
/* The FW command register update must after MAC and FW init ready. */
if((padapter->bFWReady) && (pwrpriv->bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable ))
{
u8 bOpen = true;
rtw_interface_ps_func(padapter,HAL_USB_SELECT_SUSPEND,&bOpen);
//rtl8192c_set_FwSelectSuspend_cmd(padapter,true ,500);//note fw to support hw power down ping detect
}
#endif
#endif
@ -826,127 +825,6 @@ exit:
;
return ret;
}
#else
static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
{
struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
struct adapter *padapter = dvobj->if1;
struct net_device *pnetdev = padapter->pnetdev;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj);
struct usb_device *usb_dev = interface_to_usbdev(pusb_intf);
#ifdef CONFIG_WOWLAN
struct wowlan_ioctl_param poidparam;
#endif // CONFIG_WOWLAN
int ret = 0;
u32 start_time = rtw_get_current_time();
;
DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid);
#ifdef CONFIG_WOWLAN
if (check_fwstate(pmlmepriv, _FW_LINKED))
pwrpriv->wowlan_mode = true;
else
pwrpriv->wowlan_mode = false;
#endif
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 )
{
#ifdef CONFIG_AUTOSUSPEND
#ifdef SUPPORT_HW_RFOFF_DETECTED
// The FW command register update must after MAC and FW init ready.
if((padapter->bFWReady) && (pwrpriv->bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable ))
{
u8 bOpen = true;
rtw_interface_ps_func(padapter,HAL_USB_SELECT_SUSPEND,&bOpen);
//rtl8192c_set_FwSelectSuspend_cmd(padapter,true ,500);//note fw to support hw power down ping detect
}
#endif
#endif
}
pwrpriv->bInSuspend = true;
rtw_cancel_all_timer(padapter);
LeaveAllPowerSaveMode(padapter);
rtw_stop_cmd_thread(padapter);
_enter_pwrlock(&pwrpriv->lock);
//padapter->net_closed = true;
//s1.
if(pnetdev)
{
netif_carrier_off(pnetdev);
rtw_netif_stop_queue(pnetdev);
}
#ifdef CONFIG_WOWLAN
if(pwrpriv->bSupportRemoteWakeup==true && pwrpriv->wowlan_mode==true){
//set H2C command
poidparam.subcode=WOWLAN_ENABLE;
padapter->HalFunc.SetHwRegHandler(padapter,HW_VAR_WOWLAN,(u8 *)&poidparam);
}
else
#else
{
//s2.
rtw_disassoc_cmd(padapter, 0, false);
}
#endif //CONFIG_WOWLAN
#ifdef CONFIG_LAYER2_ROAMING_RESUME
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__,
pmlmepriv->cur_network.network.Ssid.Ssid,
MAC_ARG(pmlmepriv->cur_network.network.MacAddress),
pmlmepriv->cur_network.network.Ssid.SsidLength,
pmlmepriv->assoc_ssid.SsidLength);
rtw_set_roaming(padapter, 1);
}
#endif
//s2-2. indicate disconnect to os
rtw_indicate_disconnect(padapter);
//s2-3.
rtw_free_assoc_resources(padapter, 1);
#ifdef CONFIG_AUTOSUSPEND
if(!pwrpriv->bInternalAutoSuspend )
#endif
//s2-4.
rtw_free_network_queue(padapter, true);
rtw_dev_unload(padapter);
#ifdef CONFIG_AUTOSUSPEND
pwrpriv->rf_pwrstate = rf_off;
pwrpriv->bips_processing = false;
#endif
_exit_pwrlock(&pwrpriv->lock);
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
rtw_indicate_scan_done(padapter, 1);
if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
rtw_indicate_disconnect(padapter);
exit:
DBG_871X("<=== %s return %d.............. in %dms\n", __FUNCTION__
, ret, rtw_get_passing_time_ms(start_time));
;
return ret;
}
#endif
static int rtw_resume(struct usb_interface *pusb_intf)
{
@ -987,7 +865,7 @@ int rtw_resume_process(struct adapter *padapter)
u32 start_time = rtw_get_current_time();
#ifdef CONFIG_BT_COEXIST
u8 pm_cnt;
#endif //#ifdef CONFIG_BT_COEXIST
#endif /* ifdef CONFIG_BT_COEXIST */
;
DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid);
@ -1017,8 +895,8 @@ int rtw_resume_process(struct adapter *padapter)
DBG_871X("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n",pwrpriv->bAutoResume,pwrpriv->bInternalAutoSuspend );
}
#endif //#ifdef CONFIG_AUTOSUSPEND
#endif //#ifdef CONFIG_BT_COEXIST
#endif /* ifdef CONFIG_AUTOSUSPEND */
#endif /* ifdef CONFIG_BT_COEXIST */
if(rtw_resume_common(padapter)!= 0) {
@ -1032,10 +910,9 @@ int rtw_resume_process(struct adapter *padapter)
{
#ifdef CONFIG_AUTOSUSPEND
#ifdef SUPPORT_HW_RFOFF_DETECTED
// The FW command register update must after MAC and FW init ready.
/* The FW command register update must after MAC and FW init ready. */
if((padapter->bFWReady) && (pwrpriv->bHWPwrPindetect) && (padapter->registrypriv.usbss_enable ))
{
//rtl8192c_set_FwSelectSuspend_cmd(padapter,false ,500);//note fw to support hw power down ping detect
u8 bOpen = false;
rtw_interface_ps_func(padapter,HAL_USB_SELECT_SUSPEND,&bOpen);
}
@ -1049,9 +926,9 @@ int rtw_resume_process(struct adapter *padapter)
DBG_871X("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n",pwrpriv->bAutoResume,pwrpriv->bInternalAutoSuspend );
}
#else //#ifdef CONFIG_BT_COEXIST
#else /* ifdef CONFIG_BT_COEXIST */
pwrpriv->bInternalAutoSuspend = false;
#endif //#ifdef CONFIG_BT_COEXIST
#endif /* ifdef CONFIG_BT_COEXIST */
pwrpriv->brfoffbyhw = false;
}
#endif
@ -1066,7 +943,7 @@ int rtw_resume_process(struct adapter *padapter)
exit:
#ifdef CONFIG_RESUME_IN_WORKQUEUE
rtw_unlock_suspend();
#endif //CONFIG_RESUME_IN_WORKQUEUE
#endif /* CONFIG_RESUME_IN_WORKQUEUE */
pwrpriv->bInSuspend = false;
DBG_871X("<=== %s return %d.............. in %dms\n", __FUNCTION__
@ -1094,7 +971,7 @@ void autosuspend_enter(struct adapter* padapter)
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_enable_autosuspend(dvobj->pusbdev);
#else
dvobj->pusbdev->autosuspend_disabled = 0;//autosuspend disabled by the user
dvobj->pusbdev->autosuspend_disabled = 0;/* autosuspend disabled by the user */
#endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
@ -1104,12 +981,12 @@ void autosuspend_enter(struct adapter* padapter)
#else
usb_autosuspend_device(dvobj->pusbdev, 1);
#endif
#else //#ifndef CONFIG_BT_COEXIST
#else /* ifndef CONFIG_BT_COEXIST */
if(1==pwrpriv->autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_enable_autosuspend(dvobj->pusbdev);
#else
dvobj->pusbdev->autosuspend_disabled = 0;//autosuspend disabled by the user
dvobj->pusbdev->autosuspend_disabled = 0;/* autosuspend disabled by the user */
#endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
@ -1124,7 +1001,7 @@ void autosuspend_enter(struct adapter* padapter)
else
DBG_871X("0!=pwrpriv->autopm_cnt[%d] didn't usb_autopm_put_interface\n", pwrpriv->autopm_cnt);
#endif //#ifndef CONFIG_BT_COEXIST
#endif /* ifndef CONFIG_BT_COEXIST */
}
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32))
DBG_871X("...pm_usage_cnt(%d).....\n", atomic_read(&(dvobj->pusbintf->pm_usage_cnt)));
@ -1166,7 +1043,7 @@ int autoresume_enter(struct adapter* padapter)
#else
DBG_871X("...pm_usage_cnt(%d).....\n", dvobj->pusbintf->pm_usage_cnt);
#endif
#else //#ifndef CONFIG_BT_COEXIST
#else /* ifndef CONFIG_BT_COEXIST */
pwrpriv->bAutoResume=true;
if(0==pwrpriv->autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
@ -1190,7 +1067,7 @@ int autoresume_enter(struct adapter* padapter)
}
else
DBG_871X("0!=pwrpriv->autopm_cnt[%d] didn't usb_autopm_get_interface\n",pwrpriv->autopm_cnt);
#endif //#ifndef CONFIG_BT_COEXIST
#endif /* ifndef CONFIG_BT_COEXIST */
}
DBG_871X("<==== autoresume_enter \n");
error_exit:
@ -1246,7 +1123,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
padapter->iface_id = IFACE_ID0;
#ifndef RTW_DVOBJ_CHIP_HW_TYPE
//step 1-1., decide the chip_type via vid/pid
/* step 1-1., decide the chip_type via vid/pid */
padapter->interface_type = RTW_USB;
decide_chip_type_by_usb_device_id(padapter, pdid);
#endif
@ -1267,25 +1144,25 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
#endif
//step 2. hook HalFunc, allocate HalData
/* step 2. hook HalFunc, allocate HalData */
hal_set_hal_ops(padapter);
padapter->intf_start=&usb_intf_start;
padapter->intf_stop=&usb_intf_stop;
//step init_io_priv
/* step init_io_priv */
rtw_init_io_priv(padapter, usb_set_intf_ops);
//step read_chip_version
/* step read_chip_version */
rtw_hal_read_chip_version(padapter);
//step usb endpoint mapping
/* step usb endpoint mapping */
rtw_hal_chip_configure(padapter);
//step read efuse/eeprom data and get mac_addr
/* step read efuse/eeprom data and get mac_addr */
rtw_hal_read_chip_info(padapter);
//step 5.
/* step 5. */
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;
@ -1309,20 +1186,18 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
{
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
dvobj->pusbdev->dev.power.autosuspend_delay = 0 * HZ;/* 15 * HZ; idle-delay time */
#else
dvobj->pusbdev->autosuspend_delay = 0 * HZ;//15 * HZ; idle-delay time
dvobj->pusbdev->autosuspend_delay = 0 * HZ;/* 15 * HZ; idle-delay time */
#endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_enable_autosuspend(dvobj->pusbdev);
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,34))
padapter->bDisableAutosuspend = dvobj->pusbdev->autosuspend_disabled ;
dvobj->pusbdev->autosuspend_disabled = 0;//autosuspend disabled by the user
dvobj->pusbdev->autosuspend_disabled = 0;/* autosuspend disabled by the user */
#endif
//usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf );//init pm_usage_cnt ,let it start from 1
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32))
DBG_871X("%s...pm_usage_cnt(%d).....\n",__FUNCTION__,atomic_read(&(dvobj->pusbintf ->pm_usage_cnt)));
#else
@ -1331,7 +1206,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
}
}
#endif
//2012-07-11 Move here to prevent the 8723AS-VAU BT auto suspend influence
/* 2012-07-11 Move here to prevent the 8723AS-VAU BT auto suspend influence */
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(pusb_intf) < 0)
{
@ -1342,7 +1217,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
adapter_to_pwrctl(padapter)->autopm_cnt=1;
#endif
// set mac addr
/* set mac addr */
rtw_macaddr_cfg(padapter->eeprompriv.mac_addr);
rtw_init_wifidirect_addrs(padapter, padapter->eeprompriv.mac_addr, padapter->eeprompriv.mac_addr);
@ -1396,19 +1271,11 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
hostapd_mode_unload(if1);
#endif
#endif
/*
if(if1->DriverState != DRIVER_DISAPPEAR) {
if(pnetdev) {
unregister_netdev(pnetdev); //will call netdev_close()
rtw_proc_remove_one(pnetdev);
}
}
*/
rtw_cancel_all_timer(if1);
#ifdef CONFIG_WOWLAN
pwrctl->wowlan_mode=false;
#endif //CONFIG_WOWLAN
#endif /* CONFIG_WOWLAN */
rtw_dev_unload(if1);
@ -1419,7 +1286,7 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
#ifdef CONFIG_IOCTL_CFG80211
if(if1->rtw_wdev)
{
//rtw_wdev_unregister(if1->rtw_wdev);
/* rtw_wdev_unregister(if1->rtw_wdev); */
rtw_wdev_free(if1->rtw_wdev);
}
#endif
@ -1517,7 +1384,7 @@ static void dump_usb_interface(struct usb_interface *usb_intf)
#if 1
//DBG_871X("\ndump usb_endpoint_descriptor:\n");
/* DBG_871X("\ndump usb_endpoint_descriptor:\n"); */
for (i = 0; i < iface_desc->bNumEndpoints; i++)
{
@ -1534,29 +1401,29 @@ static void dump_usb_interface(struct usb_interface *usb_intf)
DBG_871X("wMaxPacketSize=%x\n",endp_desc->wMaxPacketSize);
DBG_871X("wMaxPacketSize=%x\n",le16_to_cpu(endp_desc->wMaxPacketSize));
DBG_871X("bInterval=%x\n",endp_desc->bInterval);
//DBG_871X("bRefresh=%x\n",pendp_desc->bRefresh);
//DBG_871X("bSynchAddress=%x\n",pendp_desc->bSynchAddress);
/* DBG_871X("bRefresh=%x\n",pendp_desc->bRefresh); */
/* DBG_871X("bSynchAddress=%x\n",pendp_desc->bSynchAddress); */
if (RT_usb_endpoint_is_bulk_in(endp_desc))
{
DBG_871X("RT_usb_endpoint_is_bulk_in = %x\n", RT_usb_endpoint_num(endp_desc));
//pdvobjpriv->RtNumInPipes++;
/* pdvobjpriv->RtNumInPipes++; */
}
else if (RT_usb_endpoint_is_int_in(endp_desc))
{
DBG_871X("RT_usb_endpoint_is_int_in = %x, Interval = %x\n", RT_usb_endpoint_num(endp_desc),endp_desc->bInterval);
//pdvobjpriv->RtNumInPipes++;
/* pdvobjpriv->RtNumInPipes++; */
}
else if (RT_usb_endpoint_is_bulk_out(endp_desc))
{
DBG_871X("RT_usb_endpoint_is_bulk_out = %x\n", RT_usb_endpoint_num(endp_desc));
//pdvobjpriv->RtNumOutPipes++;
/* pdvobjpriv->RtNumOutPipes++; */
}
//pdvobjpriv->ep_num[i] = RT_usb_endpoint_num(pendp_desc);
/* pdvobjpriv->ep_num[i] = RT_usb_endpoint_num(pendp_desc); */
}
}
//DBG_871X("nr_endpoint=%d, in_num=%d, out_num=%d\n\n", pdvobjpriv->nr_endpoint, pdvobjpriv->RtNumInPipes, pdvobjpriv->RtNumOutPipes);
/* DBG_871X("nr_endpoint=%d, in_num=%d, out_num=%d\n\n", pdvobjpriv->nr_endpoint, pdvobjpriv->RtNumInPipes, pdvobjpriv->RtNumOutPipes); */
#endif
if (udev->speed == USB_SPEED_HIGH)
@ -1575,9 +1442,9 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
struct dvobj_priv *dvobj;
RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("+rtw_drv_init\n"));
//DBG_871X("+rtw_drv_init\n");
/* DBG_871X("+rtw_drv_init\n"); */
//step 0.
/* step 0. */
process_spec_devid(pdid);
/* Initialize dvobj_priv */
@ -1606,7 +1473,7 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
}
#endif
//dev_alloc_name && register_netdev
/* dev_alloc_name && register_netdev */
if((status = rtw_drv_register_netdev(if1)) != _SUCCESS) {
goto free_if2;
}
@ -1642,7 +1509,7 @@ exit:
/*
* dev_remove() - our device is being removed
*/
//rmmod module & unplug(SurpriseRemoved) will call r871xu_dev_remove() => how to recognize both
/* rmmod module & unplug(SurpriseRemoved) will call r871xu_dev_remove() => how to recognize both */
static void rtw_dev_remove(struct usb_interface *pusb_intf)
{
struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
@ -1659,14 +1526,9 @@ static void rtw_dev_remove(struct usb_interface *pusb_intf)
if(usb_drv->drv_registered == true)
{
//DBG_871X("r871xu_dev_remove():padapter->bSurpriseRemoved == true\n");
/* DBG_871X("r871xu_dev_remove():padapter->bSurpriseRemoved == true\n"); */
padapter->bSurpriseRemoved = true;
}
/*else
{
//DBG_871X("r871xu_dev_remove():module removed\n");
padapter->hw_init_completed = false;
}*/
#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
rtw_unregister_early_suspend(dvobj_to_pwrctl(dvobj));
#endif
@ -1704,7 +1566,7 @@ static int __init rtw_drv_entry(void)
tmp=readl((volatile unsigned int*)0xb801a608);
tmp &= 0xffffff00;
tmp |= 0x55;
writel(tmp,(volatile unsigned int*)0xb801a608);//write dummy register for 1055
writel(tmp,(volatile unsigned int*)0xb801a608);/* write dummy register for 1055 */
#endif
#ifdef CONFIG_PLATFORM_ARM_SUNxI
int ret = 0;
@ -1717,7 +1579,7 @@ static int __init rtw_drv_entry(void)
}
DBG_8192C("sw_usb_enable_hcd: usbc_num = %d\n", usb_wifi_host);
sw_usb_enable_hcd(usb_wifi_host);
#endif //CONFIG_PLATFORM_ARM_SUNxI
#endif /* CONFIG_PLATFORM_ARM_SUNxI */
#if defined CONFIG_PLATFORM_ARM_SUN6I
script_item_value_type_e type;
@ -1733,7 +1595,7 @@ static int __init rtw_drv_entry(void)
mdelay(10);
sw_usb_enable_hcd(item.val);
#endif // defined CONFIG_PLATFORM_ARM_SUN6I
#endif /* defined CONFIG_PLATFORM_ARM_SUN6I */
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+rtw_drv_entry\n"));
@ -1741,7 +1603,7 @@ static int __init rtw_drv_entry(void)
DBG_871X("build time: %s %s\n", __DATE__, __TIME__);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
//console_suspend_enabled=0;
/* console_suspend_enabled=0; */
#endif
rtw_suspend_lock_init();
@ -1761,12 +1623,12 @@ static void __exit rtw_drv_halt(void)
#ifdef CONFIG_PLATFORM_ARM_SUNxI
DBG_8192C("sw_usb_disable_hcd: usbc_num = %d\n", usb_wifi_host);
sw_usb_disable_hcd(usb_wifi_host);
#endif //CONFIG_PLATFORM_ARM_SUNxI
#endif /* CONFIG_PLATFORM_ARM_SUNxI */
#if defined CONFIG_PLATFORM_ARM_SUN6I
sw_usb_disable_hcd(item.val);
wifi_pm_power(0);
#endif // defined CONFIG_PLATFORM_ARM_SUN6I
#endif /* defined CONFIG_PLATFORM_ARM_SUN6I */
rtw_suspend_lock_uninit();
DBG_871X("-rtw_drv_halt\n");
@ -1784,4 +1646,4 @@ struct adapter *rtw_usb_get_sw_pointer(void)
return rtw_sw_export;
}
EXPORT_SYMBOL(rtw_usb_get_sw_pointer);
#endif //CONFIG_INTEL_PROXIM
#endif /* CONFIG_INTEL_PROXIM */

View file

@ -48,11 +48,11 @@ static int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request,
if (requesttype == VENDOR_READ) {
pipe = usb_rcvctrlpipe(udev, 0);//read_in
pipe = usb_rcvctrlpipe(udev, 0);/* read_in */
reqtype = REALTEK_USB_VENQT_READ;
}
else {
pipe = usb_sndctrlpipe(udev, 0);//write_out
pipe = usb_sndctrlpipe(udev, 0);/* write_out */
reqtype = REALTEK_USB_VENQT_WRITE;
}
@ -101,9 +101,9 @@ int usb_write_async(struct usb_device *udev, u32 addr, void *pdata, u16 len)
int ret;
requesttype = VENDOR_WRITE;//write_out
requesttype = VENDOR_WRITE;/* write_out */
request = REALTEK_USB_VENQT_CMD_REQ;
index = REALTEK_USB_VENQT_CMD_IDX;//n/a
index = REALTEK_USB_VENQT_CMD_IDX;/* n/a */
wvalue = (u16)(addr&0x0000ffff);
@ -188,7 +188,7 @@ static void usb_bulkout_zero_complete(struct urb *purb, struct pt_regs *regs)
{
struct zero_bulkout_context *pcontext = (struct zero_bulkout_context *)purb->context;
//DBG_8192C("+usb_bulkout_zero_complete\n");
/* DBG_8192C("+usb_bulkout_zero_complete\n"); */
if(pcontext)
{
@ -220,7 +220,7 @@ static u32 usb_bulkout_zero(struct intf_hdl *pintfhdl, u32 addr)
struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
struct usb_device *pusbd = pdvobj->pusbdev;
//DBG_871X("%s\n", __func__);
/* DBG_871X("%s\n", __func__); */
if((padapter->bDriverStopped) || (padapter->bSurpriseRemoved) ||(dvobj_to_pwrctl(pdvobj)->pnp_bstop_trx))
@ -241,14 +241,14 @@ static u32 usb_bulkout_zero(struct intf_hdl *pintfhdl, u32 addr)
pcontext->padapter = padapter;
//translate DMA FIFO addr to pipehandle
//pipe = ffaddr2pipehdl(pdvobj, addr);
/* translate DMA FIFO addr to pipehandle */
/* pipe = ffaddr2pipehdl(pdvobj, addr); */
usb_fill_bulk_urb(purb, pusbd, pipe,
pbuf,
len,
usb_bulkout_zero_complete,
pcontext);//context is pcontext
pcontext);/* context is pcontext */
status = usb_submit_urb(purb, GFP_ATOMIC);
@ -292,7 +292,7 @@ void usb_read_port_cancel(struct intf_hdl *pintfhdl)
precvbuf->reuse = true;
if (precvbuf->purb) {
//DBG_8192C("usb_read_port_cancel : usb_kill_urb \n");
/* DBG_8192C("usb_read_port_cancel : usb_kill_urb \n"); */
usb_kill_urb(precvbuf->purb);
}
precvbuf++;
@ -308,11 +308,11 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
_irqL irqL;
int i;
struct xmit_buf *pxmitbuf = (struct xmit_buf *)purb->context;
//struct xmit_frame *pxmitframe = (struct xmit_frame *)pxmitbuf->priv_data;
//struct adapter *padapter = pxmitframe->padapter;
/* struct xmit_frame *pxmitframe = (struct xmit_frame *)pxmitbuf->priv_data; */
/* struct adapter *padapter = pxmitframe->padapter; */
struct adapter *padapter = pxmitbuf->padapter;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
//struct pkt_attrib *pattrib = &pxmitframe->attrib;
/* struct pkt_attrib *pattrib = &pxmitframe->attrib; */
;
@ -340,48 +340,6 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
}
/*
_enter_critical(&pxmitpriv->lock, &irqL);
pxmitpriv->txirp_cnt--;
switch(pattrib->priority)
{
case 1:
case 2:
pxmitpriv->bkq_cnt--;
//DBG_8192C("pxmitpriv->bkq_cnt=%d\n", pxmitpriv->bkq_cnt);
break;
case 4:
case 5:
pxmitpriv->viq_cnt--;
//DBG_8192C("pxmitpriv->viq_cnt=%d\n", pxmitpriv->viq_cnt);
break;
case 6:
case 7:
pxmitpriv->voq_cnt--;
//DBG_8192C("pxmitpriv->voq_cnt=%d\n", pxmitpriv->voq_cnt);
break;
case 0:
case 3:
default:
pxmitpriv->beq_cnt--;
//DBG_8192C("pxmitpriv->beq_cnt=%d\n", pxmitpriv->beq_cnt);
break;
}
_exit_critical(&pxmitpriv->lock, &irqL);
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));
}
*/
//rtw_free_xmitframe(pxmitpriv, pxmitframe);
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));
@ -399,8 +357,8 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
DBG_871X("###=> urb_write_port_complete status(%d)\n",purb->status);
if((purb->status==-EPIPE)||(purb->status==-EPROTO))
{
//usb_clear_halt(pusbdev, purb->pipe);
//msleep(10);
/* usb_clear_halt(pusbdev, purb->pipe); */
/* msleep(10); */
sreset_set_wifi_error_status(padapter, USB_WRITE_PORT_FAIL);
} else if (purb->status == -EINPROGRESS) {
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete: EINPROGESS\n"));
@ -425,7 +383,7 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
{
padapter->bSurpriseRemoved=true;
DBG_8192C("bSurpriseRemoved=TRUE\n");
//rtl8192cu_trigger_gpio_0(padapter);
/* rtl8192cu_trigger_gpio_0(padapter); */
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete:bSurpriseRemoved=TRUE\n"));
goto check_completion;
@ -447,7 +405,7 @@ check_completion:
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
//if(rtw_txframes_pending(padapter))
/* if(rtw_txframes_pending(padapter)) */
{
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
}
@ -558,7 +516,7 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
purb = pxmitbuf->pxmit_urb[0];
//translate DMA FIFO addr to pipehandle
/* translate DMA FIFO addr to pipehandle */
pipe = ffaddr2pipehdl(pdvobj, addr);
#ifdef CONFIG_REDUCE_USB_TX_INT
@ -568,22 +526,22 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
purb->transfer_flags &= (~URB_NO_INTERRUPT);
} else {
purb->transfer_flags |= URB_NO_INTERRUPT;
//DBG_8192C("URB_NO_INTERRUPT ");
/* DBG_8192C("URB_NO_INTERRUPT "); */
}
#endif
usb_fill_bulk_urb(purb, pusbd, pipe,
pxmitframe->buf_addr, //= pxmitbuf->pbuf
pxmitframe->buf_addr, /* pxmitbuf->pbuf */
cnt,
usb_write_port_complete,
pxmitbuf);//context is pxmitbuf
pxmitbuf);/* context is pxmitbuf */
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_TX
purb->transfer_dma = pxmitbuf->dma_transfer_addr;
purb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
purb->transfer_flags |= URB_ZERO_PACKET;
#endif // CONFIG_USE_USB_BUFFER_ALLOC_TX
#endif /* CONFIG_USE_USB_BUFFER_ALLOC_TX */
status = usb_submit_urb(purb, GFP_ATOMIC);
if (!status) {
@ -610,8 +568,8 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
ret= _SUCCESS;
// 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.
/* 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)
{

View file

@ -95,16 +95,16 @@ void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib)
{
const struct iphdr *ip = ip_hdr(skb);
if (ip->protocol == IPPROTO_TCP) {
// TCP checksum offload by HW
/* TCP checksum offload by HW */
DBG_871X("CHECKSUM_PARTIAL TCP\n");
pattrib->hw_tcp_csum = 1;
//skb_checksum_help(skb);
/* skb_checksum_help(skb); */
} else if (ip->protocol == IPPROTO_UDP) {
//DBG_871X("CHECKSUM_PARTIAL UDP\n");
/* DBG_871X("CHECKSUM_PARTIAL UDP\n"); */
#if 1
skb_checksum_help(skb);
#else
// Set UDP checksum = 0 to skip checksum check
/* Set UDP checksum = 0 to skip checksum check */
struct udphdr *udp = skb_transport_header(skb);
udp->check = 0;
#endif
@ -113,7 +113,7 @@ void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib)
WARN_ON(1); /* we need a WARN() */
}
}
else { // IP fragmentation case
else { /* IP fragmentation case */
DBG_871X("%s-%d nr_frags != 0, using skb_checksum_help(skb);!!\n", __FUNCTION__, __LINE__);
skb_checksum_help(skb);
}
@ -133,7 +133,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
pxmitbuf->pbuf = pxmitbuf->pallocated_buf;
if(pxmitbuf->pallocated_buf == NULL)
return _FAIL;
#else // CONFIG_USE_USB_BUFFER_ALLOC_TX
#else /* CONFIG_USE_USB_BUFFER_ALLOC_TX */
pxmitbuf->pallocated_buf = rtw_zmalloc(alloc_sz);
if (pxmitbuf->pallocated_buf == NULL)
@ -144,7 +144,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ);
pxmitbuf->dma_transfer_addr = 0;
#endif // CONFIG_USE_USB_BUFFER_ALLOC_TX
#endif /* CONFIG_USE_USB_BUFFER_ALLOC_TX */
for(i=0; i<8; i++)
{
@ -170,7 +170,7 @@ void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitb
{
if(pxmitbuf->pxmit_urb[i])
{
//usb_kill_urb(pxmitbuf->pxmit_urb[i]);
/* usb_kill_urb(pxmitbuf->pxmit_urb[i]); */
usb_free_urb(pxmitbuf->pxmit_urb[i]);
}
}
@ -179,10 +179,10 @@ void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitb
rtw_usb_buffer_free(pusbd, (size_t)free_sz, pxmitbuf->pallocated_buf, pxmitbuf->dma_transfer_addr);
pxmitbuf->pallocated_buf = NULL;
pxmitbuf->dma_transfer_addr = 0;
#else // CONFIG_USE_USB_BUFFER_ALLOC_TX
#else /* CONFIG_USE_USB_BUFFER_ALLOC_TX */
if(pxmitbuf->pallocated_buf)
rtw_mfree(pxmitbuf->pallocated_buf, free_sz);
#endif // CONFIG_USE_USB_BUFFER_ALLOC_TX
#endif /* CONFIG_USE_USB_BUFFER_ALLOC_TX */
}
#define WMM_XMIT_THRESHOLD (NR_XMITFRAME*2/5)
@ -252,7 +252,7 @@ static void rtw_check_xmit_resource(struct adapter *padapter, _pkt *pkt)
if (padapter->registrypriv.wifi_spec) {
/* No free space for Tx, tx_worker is too slow */
if (pxmitpriv->hwxmits[queue].accnt > WMM_XMIT_THRESHOLD) {
//DBG_871X("%s(): stop netif_subqueue[%d]\n", __FUNCTION__, queue);
/* DBG_871X("%s(): stop netif_subqueue[%d]\n", __FUNCTION__, queue); */
netif_stop_subqueue(padapter->pnetdev, queue);
}
} else {
@ -291,7 +291,7 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
phead = &pstapriv->asoc_list;
plist = get_next(phead);
//free sta asoc_queue
/* free sta asoc_queue */
while ((rtw_end_of_queue_search(phead, plist)) == false) {
int stainfo_offset;
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
@ -330,15 +330,15 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
} else {
DBG_871X("%s-%d: rtw_skb_copy() failed!\n", __FUNCTION__, __LINE__);
pxmitpriv->tx_drop++;
//rtw_skb_free(skb);
return false; // Caller shall tx this multicast frame via normal way.
/* rtw_skb_free(skb); */
return false; /* Caller shall tx this multicast frame via normal way. */
}
}
rtw_skb_free(skb);
return true;
}
#endif // CONFIG_TX_MCAST2UNI
#endif /* CONFIG_TX_MCAST2UNI */
int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
@ -347,7 +347,7 @@ int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
#ifdef CONFIG_TX_MCAST2UNI
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
#endif // CONFIG_TX_MCAST2UNI
#endif /* CONFIG_TX_MCAST2UNI */
s32 res = 0;
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
u16 queue;
@ -381,11 +381,11 @@ int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
goto exit;
}
} else {
//DBG_871X("Stop M2U(%d, %d)! ", pxmitpriv->free_xmitframe_cnt, pxmitpriv->free_xmitbuf_cnt);
//DBG_871X("!m2u );
/* DBG_871X("Stop M2U(%d, %d)! ", pxmitpriv->free_xmitframe_cnt, pxmitpriv->free_xmitbuf_cnt); */
/* DBG_871X("!m2u ); */
}
}
#endif // CONFIG_TX_MCAST2UNI
#endif /* CONFIG_TX_MCAST2UNI */
res = rtw_xmit(padapter, &pkt);
if (res < 0) {