From d2c90ee3046b6b0ee88835fe26b9634b008b2bd3 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Tue, 9 Jul 2013 17:38:46 -0500 Subject: [PATCH] rtl8188eu: Change C90 comments to kernel form for files in core/ This commit also includes some sparse fixes for endian issues. Signed-off-by: Larry Finger --- core/rtw_ap.c | 403 +++-- core/rtw_br_ext.c | 186 +-- core/rtw_cmd.c | 275 ++-- core/rtw_debug.c | 73 +- core/rtw_efuse.c | 184 ++- core/rtw_ieee80211.c | 131 +- core/rtw_io.c | 44 +- core/rtw_ioctl_query.c | 32 +- core/rtw_ioctl_set.c | 146 +- core/rtw_iol.c | 51 +- core/rtw_led.c | 155 +- core/rtw_mlme.c | 472 +++--- core/rtw_mlme_ext.c | 3180 ++++++++++++++++++++-------------------- core/rtw_mp.c | 275 ++-- core/rtw_mp_ioctl.c | 152 +- core/rtw_p2p.c | 1594 ++++++++++---------- core/rtw_pwrctrl.c | 145 +- core/rtw_recv.c | 688 ++++----- core/rtw_security.c | 181 ++- core/rtw_sreset.c | 2 +- core/rtw_sta_mgt.c | 90 +- core/rtw_tdls.c | 537 ++++--- core/rtw_wlan_util.c | 228 ++- core/rtw_xmit.c | 520 +++---- 24 files changed, 4667 insertions(+), 5077 deletions(-) diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 8e8adbe..f31adb4 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -43,7 +43,7 @@ void init_mlme_ap_info(_adapter *padapter) _rtw_spinlock_init(&pmlmepriv->bcn_update_lock); - //for ACL + /* for ACL */ _rtw_init_queue(&pacl_list->acl_node_q); start_ap_mode(padapter); @@ -65,10 +65,10 @@ void free_mlme_ap_info(_adapter *padapter) pmlmeinfo->state = _HW_STATE_NOLINK_; - //free_assoc_sta_resources + /* free_assoc_sta_resources */ rtw_free_all_stainfo(padapter); - //free bc/mc sta_info + /* free bc/mc sta_info */ psta = rtw_get_bcmc_stainfo(padapter); _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_free_stainfo(padapter, psta); @@ -85,7 +85,7 @@ static void update_BCNTIM(_adapter *padapter) WLAN_BSSID_EX *pnetwork_mlmeext = &(pmlmeinfo->network); unsigned char *pie = pnetwork_mlmeext->IEs; - //update TIM IE + /* update TIM IE */ if (true) { u8 *p, *dst_ie, *premainder_ie=NULL, *pbackup_remainder_ie=NULL; __le16 tim_bitmap_le; @@ -99,28 +99,28 @@ static void update_BCNTIM(_adapter *padapter) premainder_ie = p+tim_ielen; tim_ie_offset = (sint)(p -pie); remainder_ielen = pnetwork_mlmeext->IELength - tim_ie_offset - tim_ielen; - //append TIM IE from dst_ie offset + /* append TIM IE from dst_ie offset */ dst_ie = p; } else { tim_ielen = 0; - //calucate head_len + /* calucate head_len */ offset = _FIXED_IE_LENGTH_; offset += pnetwork_mlmeext->Ssid.SsidLength + 2; - // get supported rates len + /* get supported rates len */ p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_)); if (p != NULL) offset += tmp_len+2; - //DS Parameter Set IE, len=3 + /* DS Parameter Set IE, len=3 */ offset += 3; premainder_ie = pie + offset; remainder_ielen = pnetwork_mlmeext->IELength - offset - tim_ielen; - //append TIM IE from offset + /* append TIM IE from offset */ dst_ie = pie + offset; } @@ -138,11 +138,11 @@ static void update_BCNTIM(_adapter *padapter) *dst_ie++= tim_ielen; - *dst_ie++=0;//DTIM count - *dst_ie++=1;//DTIM peroid + *dst_ie++=0;/* DTIM count */ + *dst_ie++=1;/* DTIM peroid */ - if (pstapriv->tim_bitmap&BIT(0))//for bc/mc frames - *dst_ie++ = BIT(0);//bitmap ctrl + if (pstapriv->tim_bitmap&BIT(0))/* for bc/mc frames */ + *dst_ie++ = BIT(0);/* bitmap ctrl */ else *dst_ie++ = 0; @@ -153,7 +153,7 @@ static void update_BCNTIM(_adapter *padapter) dst_ie+=2; } - //copy remainder IE + /* copy remainder IE */ if (pbackup_remainder_ie) { _rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen); @@ -167,7 +167,7 @@ static void update_BCNTIM(_adapter *padapter) #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) set_tx_beacon_cmd(padapter); #endif -#endif //!CONFIG_INTERRUPT_BASED_TXBCN +#endif /* CONFIG_INTERRUPT_BASED_TXBCN */ } void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *data, u8 len) @@ -183,7 +183,7 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d if (pIE->ElementID > index) { break; - } else if (pIE->ElementID == index) { // already exist the same IE + } else if (pIE->ElementID == index) { /* already exist the same IE */ p = (u8 *)pIE; ielen = pIE->Length; bmatch = true; @@ -221,7 +221,7 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d _rtw_memcpy(dst_ie, data, len); dst_ie+=len; - //copy remainder IE + /* copy remainder IE */ if (pbackup_remainder_ie) { _rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen); @@ -257,7 +257,7 @@ void rtw_remove_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index) _rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen); } - //copy remainder IE + /* copy remainder IE */ if (pbackup_remainder_ie) { _rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen); @@ -307,7 +307,7 @@ void expire_timeout_chk(_adapter *padapter) phead = &pstapriv->auth_list; plist = get_next(phead); - //check auth_queue + /* check auth_queue */ #ifdef DBG_EXPIRATION_CHK if (rtw_end_of_queue_search(phead, plist) == false) { DBG_88E(FUNC_NDEV_FMT" auth_list, cnt:%u\n" @@ -348,7 +348,7 @@ void expire_timeout_chk(_adapter *padapter) phead = &pstapriv->asoc_list; plist = get_next(phead); - //check asoc_queue + /* check asoc_queue */ #ifdef DBG_EXPIRATION_CHK if (rtw_end_of_queue_search(phead, plist) == false) { DBG_88E(FUNC_NDEV_FMT" asoc_list, cnt:%u\n" @@ -364,7 +364,7 @@ void expire_timeout_chk(_adapter *padapter) psta->keep_alive_trycnt = 0; #ifdef CONFIG_TX_MCAST2UNI psta->under_exist_checking = 0; - #endif // CONFIG_TX_MCAST2UNI + #endif /* CONFIG_TX_MCAST2UNI */ } else { psta->expire_to--; } @@ -373,8 +373,8 @@ void expire_timeout_chk(_adapter *padapter) #ifdef CONFIG_TX_MCAST2UNI #ifdef CONFIG_80211N_HT if ( (psta->flags & WLAN_STA_HT) && (psta->htpriv.agg_enable_bitmap || psta->under_exist_checking) ) { - // check sta by delba(addba) for 11n STA - // ToDo: use CCX report to check for all STAs + /* check sta by delba(addba) for 11n STA */ + /* ToDo: use CCX report to check for all STAs */ if ( psta->expire_to <= (pstapriv->expire_to - 50 ) ) { DBG_88E("asoc expire by DELBA/ADDBA! (%d s)\n", (pstapriv->expire_to-psta->expire_to)*2); psta->under_exist_checking = 0; @@ -382,15 +382,15 @@ void expire_timeout_chk(_adapter *padapter) } else if ( psta->expire_to <= (pstapriv->expire_to - 3) && (psta->under_exist_checking==0)) { DBG_88E("asoc check by DELBA/ADDBA! (%d s)\n", (pstapriv->expire_to-psta->expire_to)*2); psta->under_exist_checking = 1; - //tear down TX AMPDU - send_delba(padapter, 1, psta->hwaddr);// // originator - psta->htpriv.agg_enable_bitmap = 0x0;//reset - psta->htpriv.candidate_tid_bitmap = 0x0;//reset + /* tear down TX AMPDU */ + send_delba(padapter, 1, psta->hwaddr);/* originator */ + psta->htpriv.agg_enable_bitmap = 0x0;/* reset */ + psta->htpriv.candidate_tid_bitmap = 0x0;/* reset */ } } -#endif //CONFIG_80211N_HT -#endif // CONFIG_TX_MCAST2UNI -#endif //CONFIG_ACTIVE_KEEP_ALIVE_CHECK +#endif /* CONFIG_80211N_HT */ +#endif /* CONFIG_TX_MCAST2UNI */ +#endif /* CONFIG_ACTIVE_KEEP_ALIVE_CHECK */ if (psta->expire_to <= 0) { #ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK @@ -403,11 +403,11 @@ void expire_timeout_chk(_adapter *padapter) if (psta->state & WIFI_SLEEP_STATE) { if (!(psta->state & WIFI_STA_ALIVE_CHK_STATE)) { - //to check if alive by another methods if staion is at ps mode. + /* to check if alive by another methods if staion is at ps mode. */ psta->expire_to = pstapriv->expire_to; psta->state |= WIFI_STA_ALIVE_CHK_STATE; - //to update bcn with tim_bitmap for this station + /* to update bcn with tim_bitmap for this station */ pstapriv->tim_bitmap |= BIT(psta->aid); update_beacon(padapter, _TIM_IE_, NULL, false); @@ -515,37 +515,37 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level) psta_ht = &psta->htpriv; else return; -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ if (!(psta->state & _FW_LINKED)) return; - //b/g mode ra_bitmap + /* b/g mode ra_bitmap */ for (i = 0; i < sizeof(psta->bssrateset); i++) { if (psta->bssrateset[i]) tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i]&0x7f); } #ifdef CONFIG_80211N_HT - //n mode ra_bitmap + /* n mode ra_bitmap */ if (psta_ht->ht_option) { rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); if (rf_type == RF_2T2R) - limit=16;// 2R + limit=16;/* 2R */ else - limit=8;// 1R + limit=8;/* 1R */ for (i = 0; i < limit; i++) { if (psta_ht->ht_cap.supp_mcs_set[i/8] & BIT(i%8)) tx_ra_bitmap |= BIT(i+12); } - //max short GI rate + /* max short GI rate */ shortGIrate = psta_ht->sgi; } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ if ( pcur_network->Configuration.DSConfig > 14 ) { - // 5G band + /* 5G band */ if (tx_ra_bitmap & 0xffff000) sta_band |= WIRELESS_11_5N | WIRELESS_11A; else @@ -569,7 +569,7 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level) arg = psta->mac_id&0x1f; - arg |= BIT(7);//support entry 2~31 + arg |= BIT(7);/* support entry 2~31 */ if (shortGIrate==true) arg |= BIT(5); @@ -579,16 +579,16 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level) DBG_88E("%s=> mac_id:%d , raid:%d , bitmap=0x%x, arg=0x%x\n", __func__ , psta->mac_id, raid ,tx_ra_bitmap, arg); - //bitmap[0:27] = tx_rate_bitmap - //bitmap[28:31]= Rate Adaptive id - //arg[0:4] = macid - //arg[5] = Short GI + /* bitmap[0:27] = tx_rate_bitmap */ + /* bitmap[28:31]= Rate Adaptive id */ + /* arg[0:4] = macid */ + /* arg[5] = Short GI */ rtw_hal_add_ra_tid(padapter, tx_ra_bitmap, arg, rssi_level); if (shortGIrate==true) init_rate |= BIT(6); - //set ra_id, init_rate + /* set ra_id, init_rate */ psta->raid = raid; psta->init_rate = init_rate; @@ -609,37 +609,37 @@ static void update_bmc_sta(_adapter *padapter) struct sta_info *psta = rtw_get_bcmc_stainfo(padapter); if (psta) { - psta->aid = 0;//default set to 0 + psta->aid = 0;/* default set to 0 */ psta->mac_id = psta->aid + 1; psta->qos_option = 0; #ifdef CONFIG_80211N_HT psta->htpriv.ht_option = false; -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ psta->ieee8021x_blocked = 0; _rtw_memset((void*)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); - //prepare for add_RATid + /* prepare for add_RATid */ supportRateNum = rtw_get_rateset_len((u8*)&pcur_network->SupportedRates); network_type = rtw_check_network_type((u8*)&pcur_network->SupportedRates, supportRateNum, 1); _rtw_memcpy(psta->bssrateset, &pcur_network->SupportedRates, supportRateNum); psta->bssratelen = supportRateNum; - //b/g mode ra_bitmap + /* b/g mode ra_bitmap */ for (i = 0; i < supportRateNum; i++) { if (psta->bssrateset[i]) tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i]&0x7f); } if ( pcur_network->Configuration.DSConfig > 14 ) { - //force to A mode. 5G doesn't support CCK rates + /* force to A mode. 5G doesn't support CCK rates */ network_type = WIRELESS_11A; - tx_ra_bitmap = 0x150; // 6, 12, 24 Mbps + tx_ra_bitmap = 0x150; /* 6, 12, 24 Mbps */ } else { - //force to b mode + /* force to b mode */ network_type = WIRELESS_11B; tx_ra_bitmap = 0xf; } @@ -647,7 +647,7 @@ static void update_bmc_sta(_adapter *padapter) raid = networktype_to_raid(network_type); init_rate = get_highest_rate_idx(tx_ra_bitmap&0x0fffffff)&0x3f; - //ap mode + /* ap mode */ rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, true); { @@ -658,13 +658,13 @@ static void update_bmc_sta(_adapter *padapter) tx_ra_bitmap |= ((raid<<28)&0xf0000000); DBG_88E("update_bmc_sta, mask=0x%x, arg=0x%x\n", tx_ra_bitmap, arg); - //bitmap[0:27] = tx_rate_bitmap - //bitmap[28:31]= Rate Adaptive id - //arg[0:4] = macid - //arg[5] = Short GI + /* bitmap[0:27] = tx_rate_bitmap */ + /* bitmap[28:31]= Rate Adaptive id */ + /* arg[0:4] = macid */ + /* arg[5] = Short GI */ rtw_hal_add_ra_tid(padapter, tx_ra_bitmap, arg, 0); } - //set ra_id, init_rate + /* set ra_id, init_rate */ psta->raid = raid; psta->init_rate = init_rate; @@ -679,12 +679,12 @@ static void update_bmc_sta(_adapter *padapter) } } -//notes: -//AID: 1~MAX for sta and 0 for bc/mc in ap/adhoc mode -//MAC_ID = AID+1 for sta in ap/adhoc mode -//MAC_ID = 1 for bc/mc for sta/ap/adhoc -//MAC_ID = 0 for bssid for sta/ap/adhoc -//CAM_ID = //0~3 for default key, cmd_id=macid + 3, macid=aid+1; +/* notes: */ +/* AID: 1~MAX for sta and 0 for bc/mc in ap/adhoc mode */ +/* MAC_ID = AID+1 for sta in ap/adhoc mode */ +/* MAC_ID = 1 for bc/mc for sta/ap/adhoc */ +/* MAC_ID = 0 for bssid for sta/ap/adhoc */ +/* CAM_ID = 0~3 for default key, cmd_id=macid + 3, macid=aid+1; */ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta) { @@ -695,11 +695,11 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta) #ifdef CONFIG_80211N_HT struct ht_priv *phtpriv_ap = &pmlmepriv->htpriv; struct ht_priv *phtpriv_sta = &psta->htpriv; -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ psta->mac_id = psta->aid+1; DBG_88E("%s\n",__func__); - //ap mode + /* ap mode */ rtw_hal_set_odm_var(padapter,HAL_ODM_STA_INFO,psta,true); if (psecuritypriv->dot11AuthAlgrthm==dot11AuthAlgrthm_8021X) @@ -708,22 +708,22 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta) psta->ieee8021x_blocked = false; - //update sta's cap + /* update sta's cap */ - //ERP + /* ERP */ VCS_update(padapter, psta); #ifdef CONFIG_80211N_HT - //HT related cap + /* HT related cap */ if (phtpriv_sta->ht_option) { - //check if sta supports rx ampdu + /* check if sta supports rx ampdu */ phtpriv_sta->ampdu_enable = phtpriv_ap->ampdu_enable; - //check if sta support s Short GI - if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40)) + /* check if sta support s Short GI */ + if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & (IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40)) phtpriv_sta->sgi = true; - // bwmode - if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH)) { + /* bwmode */ + if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & IEEE80211_HT_CAP_SUP_WIDTH) { phtpriv_sta->bwmode = pmlmeext->cur_bwmode; phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset; } @@ -735,16 +735,16 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta) phtpriv_sta->ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; } - //Rx AMPDU - send_delba(padapter, 0, psta->hwaddr);// recipient + /* Rx AMPDU */ + send_delba(padapter, 0, psta->hwaddr);/* recipient */ - //TX AMPDU - send_delba(padapter, 1, psta->hwaddr);// // originator - phtpriv_sta->agg_enable_bitmap = 0x0;//reset - phtpriv_sta->candidate_tid_bitmap = 0x0;//reset -#endif //CONFIG_80211N_HT + /* TX AMPDU */ + send_delba(padapter, 1, psta->hwaddr);/* originator */ + phtpriv_sta->agg_enable_bitmap = 0x0;/* reset */ + phtpriv_sta->candidate_tid_bitmap = 0x0;/* reset */ +#endif /* CONFIG_80211N_HT */ - //todo: init other variables + /* todo: init other variables */ _rtw_memset((void*)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); @@ -763,7 +763,7 @@ static void update_hw_ht_param(_adapter *padapter) DBG_88E("%s\n", __func__); - //handle A-MPDU parameter field + /* handle A-MPDU parameter field */ /* AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k AMPDU_para [4:2]:Min MPDU Start Spacing @@ -776,10 +776,10 @@ static void update_hw_ht_param(_adapter *padapter) rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, (u8 *)(&max_AMPDU_len)); - // - // Config SM Power Save setting - // - pmlmeinfo->SM_PS = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & 0x0C) >> 2; + /* */ + /* Config SM Power Save setting */ + /* */ + pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info) & 0x0C) >> 2; if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC) DBG_88E("%s(): WLAN_HT_CAP_SM_PS_STATIC\n",__func__); } @@ -801,7 +801,7 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf) struct HT_info_element *pht_info=NULL; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &(padapter->wdinfo); -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ bcn_interval = (u16)pnetwork->Configuration.BeaconPeriod; cur_channel = pnetwork->Configuration.DSConfig; @@ -809,15 +809,15 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf) cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; - //check if there is wps ie, - //if there is wpsie in beacon, the hostapd will update beacon twice when stating hostapd, - //and at first time the security ie ( RSN/WPA IE) will not include in beacon. + /* check if there is wps ie, */ + /* if there is wpsie in beacon, the hostapd will update beacon twice when stating hostapd, */ + /* and at first time the security ie ( RSN/WPA IE) will not include in beacon. */ if (NULL == rtw_get_wps_ie(pnetwork->IEs+_FIXED_IE_LENGTH_, pnetwork->IELength-_FIXED_IE_LENGTH_, NULL, NULL)) { pmlmeext->bstart_bss = true; } - //todo: update wmm, ht cap + /* todo: update wmm, ht cap */ if (pmlmepriv->qospriv.qos_option) pmlmeinfo->WMM_enable = true; #ifdef CONFIG_80211N_HT @@ -827,69 +827,69 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf) update_hw_ht_param(padapter); } -#endif //#CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ - if (pmlmepriv->cur_network.join_res != true) { //setting only at first time - //WEP Key will be set before this function, do not clear CAM. + if (pmlmepriv->cur_network.join_res != true) { /* setting only at first time */ + /* WEP Key will be set before this function, do not clear CAM. */ if ((psecuritypriv->dot11PrivacyAlgrthm != _WEP40_) && (psecuritypriv->dot11PrivacyAlgrthm != _WEP104_)) - flush_all_cam_entry(padapter); //clear CAM + flush_all_cam_entry(padapter); /* clear CAM */ } - //set MSR to AP_Mode + /* set MSR to AP_Mode */ Set_MSR(padapter, _HW_STATE_AP_); - //Set BSSID REG + /* Set BSSID REG */ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pnetwork->MacAddress); - //Set EDCA param reg + /* Set EDCA param reg */ #ifdef CONFIG_CONCURRENT_MODE acparm = 0x005ea42b; #else - acparm = 0x002F3217; // VO + acparm = 0x002F3217; /* VO */ #endif rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VO, (u8 *)(&acparm)); - acparm = 0x005E4317; // VI + acparm = 0x005E4317; /* VI */ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VI, (u8 *)(&acparm)); acparm = 0x005ea42b; rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acparm)); - acparm = 0x0000A444; // BK + acparm = 0x0000A444; /* BK */ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BK, (u8 *)(&acparm)); - //Set Security + /* Set Security */ val8 = (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)? 0xcc: 0xcf; rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); - //Beacon Control related register + /* Beacon Control related register */ rtw_hal_set_hwreg(padapter, HW_VAR_BEACON_INTERVAL, (u8 *)(&bcn_interval)); UpdateBrateTbl(padapter, pnetwork->SupportedRates); rtw_hal_set_hwreg(padapter, HW_VAR_BASIC_RATE, pnetwork->SupportedRates); - if (pmlmepriv->cur_network.join_res != true) { //setting only at first time + if (pmlmepriv->cur_network.join_res != true) { /* setting only at first time */ #ifdef CONFIG_CONCURRENT_MODE if (padapter->adapter_type > PRIMARY_ADAPTER) { if (rtw_buddy_adapter_up(padapter)) { _adapter *pbuddy_adapter = padapter->pbuddy_adapter; - //turn on all dynamic functions on PRIMARY_ADAPTER, dynamic functions only runs at PRIMARY_ADAPTER + /* turn on all dynamic functions on PRIMARY_ADAPTER, dynamic functions only runs at PRIMARY_ADAPTER */ Switch_DM_Func(pbuddy_adapter, DYNAMIC_ALL_FUNC_ENABLE, true); } } else #endif { - //turn on all dynamic functions + /* turn on all dynamic functions */ Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); } } #ifdef CONFIG_80211N_HT - //set channel, bwmode + /* set channel, bwmode */ p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs))); if ( p && ie_len) { pht_info = (struct HT_info_element *)(p+2); if ((pregpriv->cbw40_enable) && (pht_info->infos[0] & BIT(2))) { - //switch to the 40M Hz mode + /* switch to the 40M Hz mode */ cur_bwmode = HT_CHANNEL_WIDTH_40; switch (pht_info->infos[0] & 0x3) { case 1: @@ -904,19 +904,19 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf) } } } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ #ifdef CONFIG_DUALMAC_CONCURRENT dc_set_ap_channel_bandwidth(padapter, cur_channel, cur_ch_offset, cur_bwmode); #else - //TODO: need to judge the phy parameters on concurrent mode for single phy + /* TODO: need to judge the phy parameters on concurrent mode for single phy */ #ifdef CONFIG_CONCURRENT_MODE if (!check_buddy_fwstate(padapter, _FW_LINKED|_FW_UNDER_LINKING|_FW_UNDER_SURVEY)) { set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode); - } else if (check_buddy_fwstate(padapter, _FW_LINKED)==true) {//only second adapter can enter AP Mode + } else if (check_buddy_fwstate(padapter, _FW_LINKED)==true) {/* only second adapter can enter AP Mode */ _adapter *pbuddy_adapter = padapter->pbuddy_adapter; struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; - //To sync cur_channel/cur_bwmode/cur_ch_offset with primary adapter + /* To sync cur_channel/cur_bwmode/cur_ch_offset with primary adapter */ DBG_88E("primary iface is at linked state, sync cur_channel/cur_bwmode/cur_ch_offset\n"); DBG_88E("primary adapter, CH=%d, BW=%d, offset=%d\n", pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_bwmode, pbuddy_mlmeext->cur_ch_offset); DBG_88E("second adapter, CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset); @@ -929,7 +929,7 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf) if (pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40) { cur_ch_offset = pbuddy_mlmeext->cur_ch_offset; - //to update cur_ch_offset value in beacon + /* to update cur_ch_offset value in beacon */ if (pht_info) { switch (cur_ch_offset) { case HAL_PRIME_CHNL_OFFSET_LOWER: @@ -967,7 +967,7 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf) } } - // to update channel value in beacon + /* to update channel value in beacon */ pnetwork->Configuration.DSConfig = cur_channel; p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _DSSET_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs))); if (p && ie_len>0) @@ -978,53 +978,50 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf) } #else set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode); -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ DBG_88E("CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset); - // + /* */ pmlmeext->cur_channel = cur_channel; pmlmeext->cur_bwmode = cur_bwmode; pmlmeext->cur_ch_offset = cur_ch_offset; -#endif //CONFIG_DUALMAC_CONCURRENT +#endif /* CONFIG_DUALMAC_CONCURRENT */ pmlmeext->cur_wireless_mode = pmlmepriv->cur_network.network_type; - //update cur_wireless_mode + /* update cur_wireless_mode */ update_wireless_mode(padapter); - //udpate capability after cur_wireless_mode updated + /* udpate capability after cur_wireless_mode updated */ update_capinfo(padapter, rtw_get_capability((WLAN_BSSID_EX *)pnetwork)); - //let pnetwork_mlmeext == pnetwork_mlme. + /* let pnetwork_mlmeext == pnetwork_mlme. */ _rtw_memcpy(pnetwork_mlmeext, pnetwork, pnetwork->Length); #ifdef CONFIG_P2P _rtw_memcpy(pwdinfo->p2p_group_ssid, pnetwork->Ssid.Ssid, pnetwork->Ssid.SsidLength); pwdinfo->p2p_group_ssid_len = pnetwork->Ssid.SsidLength; -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ if (true == pmlmeext->bstart_bss) { update_beacon(padapter, _TIM_IE_, NULL, false); -#ifndef CONFIG_INTERRUPT_BASED_TXBCN //other case will tx beacon when bcn interrupt coming in. +#ifndef CONFIG_INTERRUPT_BASED_TXBCN /* other case will tx beacon when bcn interrupt coming in. */ #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - //issue beacon frame + /* issue beacon frame */ if (send_beacon(padapter)==_FAIL) { DBG_88E("issue_beacon, fail!\n"); } #endif -#endif //!CONFIG_INTERRUPT_BASED_TXBCN +#endif /* CONFIG_INTERRUPT_BASED_TXBCN */ } - //update bc/mc sta_info + /* update bc/mc sta_info */ update_bmc_sta(padapter); - - //pmlmeext->bstart_bss = true; - } int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) @@ -1084,17 +1081,14 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) _rtw_memcpy(pbss_network->MacAddress, myid(&(padapter->eeprompriv)), ETH_ALEN); - //beacon interval - p = rtw_get_beacon_interval_from_ie(ie);//ie + 8; // 8: TimeStamp, 2: Beacon Interval 2:Capability - //pbss_network->Configuration.BeaconPeriod = le16_to_cpu(*(unsigned short*)p); + /* beacon interval */ + p = rtw_get_beacon_interval_from_ie(ie);/* 8: TimeStamp, 2: Beacon Interval 2:Capability */ pbss_network->Configuration.BeaconPeriod = RTW_GET_LE16(p); - //capability - //cap = *(unsigned short *)rtw_get_capability_from_ie(ie); - //cap = le16_to_cpu(cap); + /* capability */ cap = RTW_GET_LE16(ie); - //SSID + /* SSID */ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SSID_IE_, &ie_len, (pbss_network->IELength -_BEACON_IE_OFFSET_)); if (p && ie_len>0) { @@ -1103,7 +1097,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) pbss_network->Ssid.SsidLength = ie_len; } - //chnnel + /* channel */ channel = 0; pbss_network->Configuration.Length = 0; p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _DSSET_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); @@ -1114,7 +1108,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) _rtw_memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX); - // get supported rates + /* get supported rates */ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p != NULL) { @@ -1122,7 +1116,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) supportRateNum = ie_len; } - //get ext_supported rates + /* get ext_supported rates */ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_SUPPORTEDRATES_IE_, &ie_len, pbss_network->IELength - _BEACON_IE_OFFSET_); if (p != NULL) { @@ -1136,14 +1130,14 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) rtw_set_supported_rate(pbss_network->SupportedRates, network_type); - //parsing ERP_IE + /* parsing ERP_IE */ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len>0) { ERP_IE_handler(padapter, (PNDIS_802_11_VARIABLE_IEs)p); } - //update privacy/security + /* update privacy/security */ if (cap & BIT(4)) pbss_network->Privacy = 1; else @@ -1151,7 +1145,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) psecuritypriv->wpa_psk = 0; - //wpa2 + /* wpa2 */ group_cipher = 0; pairwise_cipher = 0; psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_; psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_; @@ -1162,14 +1156,14 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) { psecuritypriv->dot11AuthAlgrthm= dot11AuthAlgrthm_8021X; - psecuritypriv->dot8021xalg = 1;//psk, todo:802.1x + psecuritypriv->dot8021xalg = 1;/* psk, todo:802.1x */ psecuritypriv->wpa_psk |= BIT(1); psecuritypriv->wpa2_group_cipher = group_cipher; psecuritypriv->wpa2_pairwise_cipher = pairwise_cipher; } } - //wpa + /* wpa */ ie_len = 0; group_cipher = 0; pairwise_cipher = 0; psecuritypriv->wpa_group_cipher = _NO_PRIVACY_; @@ -1183,7 +1177,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) { psecuritypriv->dot11AuthAlgrthm= dot11AuthAlgrthm_8021X; - psecuritypriv->dot8021xalg = 1;//psk, todo:802.1x + psecuritypriv->dot8021xalg = 1;/* psk, todo:802.1x */ psecuritypriv->wpa_psk |= BIT(0); @@ -1197,7 +1191,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) } - //wmm + /* wmm */ ie_len = 0; pmlmepriv->qospriv.qos_option = 0; if (pregistrypriv->wmm_enable) @@ -1209,7 +1203,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) { pmlmepriv->qospriv.qos_option = 1; - *(p+8) |= BIT(7);//QoS Info, support U-APSD + *(p+8) |= BIT(7);/* QoS Info, support U-APSD */ /* disable all ACM bits since the WMM admission control is not supported */ *(p + 10) &= ~BIT(4); /* BE */ @@ -1227,7 +1221,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) } } #ifdef CONFIG_80211N_HT - //parsing HT_CAP_IE + /* parsing HT_CAP_IE */ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len>0) { @@ -1254,7 +1248,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00); } - pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & 0x03); //set Max Rx AMPDU size to 64K + pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & 0x03); /* set Max Rx AMPDU size to 64K */ if (rf_type == RF_1T1R) { @@ -1266,13 +1260,13 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) } - //parsing HT_INFO_IE + /* parsing HT_INFO_IE */ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len>0) { pHT_info_ie=p; } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ switch (network_type) { case WIRELESS_11B: @@ -1300,11 +1294,11 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) if ( (psecuritypriv->wpa2_pairwise_cipher&WPA_CIPHER_TKIP) || (psecuritypriv->wpa_pairwise_cipher&WPA_CIPHER_TKIP)) { - //todo: - //ht_cap = false; + /* todo: */ + /* ht_cap = false; */ } - //ht_cap + /* ht_cap */ if (pregistrypriv->ht_enable && ht_cap==true) { pmlmepriv->htpriv.ht_option = true; @@ -1324,11 +1318,11 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) pbss_network->Length = get_WLAN_BSSID_EX_sz((WLAN_BSSID_EX *)pbss_network); - //issue beacon to start bss network + /* issue beacon to start bss network */ start_bss_network(padapter, (u8*)pbss_network); - //alloc sta_info for ap itself + /* alloc sta_info for ap itself */ psta = rtw_get_stainfo(&padapter->stapriv, pbss_network->MacAddress); if (!psta) { @@ -1338,13 +1332,13 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) return _FAIL; } } - psta->state |= WIFI_AP_STATE; //Aries, add,fix bug of flush_cam_entry at STOP AP mode , 0724 + psta->state |= WIFI_AP_STATE; /* Aries, add,fix bug of flush_cam_entry at STOP AP mode , 0724 */ rtw_indicate_connect( padapter); - pmlmepriv->cur_network.join_res = true;//for check if already set beacon + pmlmepriv->cur_network.join_res = true;/* for check if already set beacon */ - //update bc/mc sta_info - //update_bmc_sta(padapter); + /* update bc/mc sta_info */ + /* update_bmc_sta(padapter); */ return ret; @@ -1499,7 +1493,7 @@ static void update_bcn_erpinfo_ie(_adapter *padapter) if (!pmlmeinfo->ERP_enable) return; - //parsing ERP_IE + /* parsing ERP_IE */ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (p && len>0) { @@ -1588,7 +1582,7 @@ static void update_bcn_wps_ie(_adapter *padapter) return; - wps_ielen = (uint)pwps_ie_src[1];//to get ie data len + wps_ielen = (uint)pwps_ie_src[1];/* to get ie data len */ if ((wps_offset+wps_ielen+2+remainder_ielen)<=MAX_IE_SZ) { _rtw_memcpy(pwps_ie, pwps_ie_src, wps_ielen+2); @@ -1597,7 +1591,7 @@ static void update_bcn_wps_ie(_adapter *padapter) if (pbackup_remainder_ie) _rtw_memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen); - //update IELength + /* update IELength */ pnetwork->IELength = wps_offset + (wps_ielen+2) + remainder_ielen; } @@ -1644,16 +1638,12 @@ void update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx) _irqL irqL; struct mlme_priv *pmlmepriv; struct mlme_ext_priv *pmlmeext; - //struct mlme_ext_info *pmlmeinfo; - - //DBG_88E("%s\n", __func__); if (!padapter) return; pmlmepriv = &(padapter->mlmepriv); pmlmeext = &(padapter->mlmeextpriv); - //pmlmeinfo = &(pmlmeext->mlmext_info); if (false == pmlmeext->bstart_bss) return; @@ -1664,7 +1654,7 @@ void update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx) { case 0xFF: - update_bcn_fixed_ie(padapter);//8: TimeStamp, 2: Beacon Interval 2:Capability + update_bcn_fixed_ie(padapter);/* 8: TimeStamp, 2: Beacon Interval 2:Capability */ break; @@ -1715,16 +1705,9 @@ void update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx) #ifndef CONFIG_INTERRUPT_BASED_TXBCN #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) if (tx) - { - //send_beacon(padapter);//send_beacon must execute on TSR level set_tx_beacon_cmd(padapter); - } -#else - { - //PCI will issue beacon when BCN interrupt occurs. - } #endif -#endif //!CONFIG_INTERRUPT_BASED_TXBCN +#endif /* CONFIG_INTERRUPT_BASED_TXBCN */ } @@ -1752,8 +1735,6 @@ static int rtw_ht_operation_update(_adapter *padapter) if (pmlmepriv->htpriv.ht_option == true) return 0; - //if (!iface->conf->ieee80211n || iface->conf->ht_op_mode_fixed) - // return 0; DBG_88E("%s current operation mode=0x%X\n", __func__, pmlmepriv->ht_op_mode); @@ -1817,7 +1798,7 @@ static int rtw_ht_operation_update(_adapter *padapter) void associated_clients_update(_adapter *padapter, u8 updated) { - //update associcated stations cap. + /* update associcated stations cap. */ if (updated == true) { _irqL irqL; @@ -1830,7 +1811,7 @@ void associated_clients_update(_adapter *padapter, u8 updated) phead = &pstapriv->asoc_list; plist = get_next(phead); - //check asoc_queue + /* check asoc_queue */ while ((rtw_end_of_queue_search(phead, plist)) == false) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); @@ -1959,7 +1940,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta) if (psta->flags & WLAN_STA_HT) { - u16 ht_capab = le16_to_cpu(psta->htpriv.ht_cap.cap_info); + u16 ht_capab = psta->htpriv.ht_cap.cap_info; DBG_88E("HT: STA %pM HT Capabilities " "Info: 0x%04x\n", (psta->hwaddr), ht_capab); @@ -2013,7 +1994,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta) #endif /* CONFIG_80211N_HT */ - //update associcated stations cap. + /* update associcated stations cap. */ associated_clients_update(padapter, beacon_updated); DBG_88E("%s, updated=%d\n", __func__, beacon_updated); @@ -2086,8 +2067,7 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta) #endif /* CONFIG_80211N_HT */ - //update associcated stations cap. - //associated_clients_update(padapter, beacon_updated); //move it to avoid deadlock + /* update associcated stations cap. */ DBG_88E("%s, updated=%d\n", __func__, beacon_updated); @@ -2107,22 +2087,19 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso return beacon_updated; #ifdef CONFIG_80211N_HT - //tear down Rx AMPDU - send_delba(padapter, 0, psta->hwaddr);// recipient + /* tear down Rx AMPDU */ + send_delba(padapter, 0, psta->hwaddr);/* recipient */ - //tear down TX AMPDU - send_delba(padapter, 1, psta->hwaddr);// // originator - psta->htpriv.agg_enable_bitmap = 0x0;//reset - psta->htpriv.candidate_tid_bitmap = 0x0;//reset -#endif //CONFIG_80211N_HT + /* tear down TX AMPDU */ + send_delba(padapter, 1, psta->hwaddr);/* originator */ + psta->htpriv.agg_enable_bitmap = 0x0;/* reset */ + psta->htpriv.candidate_tid_bitmap = 0x0;/* reset */ +#endif /* CONFIG_80211N_HT */ if (active == true) issue_deauth(padapter, psta->hwaddr, reason); - //report_del_sta_event(padapter, psta->hwaddr, reason); - - //clear cam entry / key - //clear_cam_entry(padapter, (psta->mac_id + 3)); + /* clear cam entry / key */ rtw_clearstakey_cmd(padapter, (u8*)psta, (u8)(psta->mac_id + 3), true); @@ -2136,11 +2113,11 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso rtw_cfg80211_indicate_sta_disassoc(padapter, psta->hwaddr, reason); #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) && !defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) rtw_cfg80211_indicate_sta_disassoc(padapter, psta->hwaddr, reason); - #else //(LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) && !defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) + #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) && !defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) */ /* will call rtw_cfg80211_indicate_sta_disassoc() in cmd_thread for old API context */ - #endif //(LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) && !defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) + #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) && !defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) */ } else - #endif //CONFIG_IOCTL_CFG80211 + #endif /* CONFIG_IOCTL_CFG80211 */ { rtw_indicate_sta_disassoc_event(padapter, psta); } @@ -2216,7 +2193,7 @@ int rtw_sta_flush(_adapter *padapter) 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) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); @@ -2226,9 +2203,7 @@ int rtw_sta_flush(_adapter *padapter) rtw_list_delete(&psta->asoc_list); pstapriv->asoc_list_cnt--; - //_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING); - //_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); } _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); @@ -2248,7 +2223,7 @@ void sta_info_update(_adapter *padapter, struct sta_info *psta) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - //update wmm cap. + /* update wmm cap. */ if (WLAN_STA_WME&flags) psta->qos_option = 1; else @@ -2259,7 +2234,7 @@ void sta_info_update(_adapter *padapter, struct sta_info *psta) #ifdef CONFIG_80211N_HT - //update 802.11n ht cap. + /* update 802.11n ht cap. */ if (WLAN_STA_HT&flags) { psta->htpriv.ht_option = true; @@ -2285,8 +2260,8 @@ void ap_sta_info_defer_update(_adapter *padapter, struct sta_info *psta) { if (psta->state & _FW_LINKED) { - //add ratid - add_RATid(padapter, psta, 0);//DM_RATR_STA_INIT + /* add ratid */ + add_RATid(padapter, psta, 0);/* DM_RATR_STA_INIT */ } } @@ -2300,7 +2275,6 @@ void start_ap_mode(_adapter *padapter) pmlmepriv->update_bcn = false; - //init_mlme_ap_info(padapter); pmlmeext->bstart_bss = false; pmlmepriv->num_sta_non_erp = 0; @@ -2312,7 +2286,7 @@ void start_ap_mode(_adapter *padapter) pmlmepriv->num_sta_ht_no_gf = 0; #ifdef CONFIG_80211N_HT pmlmepriv->num_sta_no_ht = 0; -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ pmlmepriv->num_sta_ht_20mhz = 0; pmlmepriv->olbc = false; @@ -2334,7 +2308,7 @@ void start_ap_mode(_adapter *padapter) pmlmepriv->p2p_probe_resp_ie = NULL; - //for ACL + /* for ACL */ _rtw_init_listhead(&(pacl_list->acl_node_q.queue)); pacl_list->num = 0; pacl_list->mode = 0; @@ -2360,14 +2334,13 @@ void stop_ap_mode(_adapter *padapter) pmlmepriv->update_bcn = false; pmlmeext->bstart_bss = false; - //_rtw_spinlock_free(&pmlmepriv->bcn_update_lock); - //reset and init security priv , this can refine with rtw_reset_securitypriv + /* reset and init security priv , this can refine with rtw_reset_securitypriv */ _rtw_memset((unsigned char *)&padapter->securitypriv, 0, sizeof (struct security_priv)); padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen; padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled; - //for ACL + /* for ACL */ _enter_critical_bh(&(pacl_node_q->lock), &irqL); phead = get_list_head(pacl_node_q); plist = get_next(phead); @@ -2391,7 +2364,7 @@ void stop_ap_mode(_adapter *padapter) rtw_sta_flush(padapter); - //free_assoc_sta_resources + /* free_assoc_sta_resources */ rtw_free_all_stainfo(padapter); psta = rtw_get_bcmc_stainfo(padapter); @@ -2405,5 +2378,5 @@ void stop_ap_mode(_adapter *padapter) } -#endif //CONFIG_NATIVEAP_MLME -#endif //CONFIG_AP_MODE +#endif /* CONFIG_NATIVEAP_MLME */ +#endif /* CONFIG_AP_MODE */ diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c index 44985e0..b674016 100644 --- a/core/rtw_br_ext.c +++ b/core/rtw_br_ext.c @@ -49,7 +49,7 @@ #ifdef CONFIG_BR_EXT -//#define BR_EXT_DEBUG +/* define BR_EXT_DEBUG */ #define NAT25_IPV4 01 #define NAT25_IPV6 02 @@ -62,7 +62,7 @@ #define MAGIC_CODE 0x8186 #define MAGIC_CODE_LEN 2 -#define WAIT_TIME_PPPOE 5 // waiting time for pppoe server in sec +#define WAIT_TIME_PPPOE 5 /* waiting time for pppoe server in sec */ /*----------------------------------------------------------------- How database records network address: @@ -76,7 +76,7 @@ -----------------------------------------------------------------*/ -//Find a tag in pppoe frame and return the pointer +/* Find a tag in pppoe frame and return the pointer */ static __inline__ unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type) { unsigned char *cur_ptr, *start_ptr; @@ -84,7 +84,7 @@ static __inline__ unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, un start_ptr = cur_ptr = (unsigned char *)ph->tag; while ((cur_ptr - start_ptr) < ntohs(ph->length)) { - // prevent un-alignment access + /* prevent un-alignment access */ tagType = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]); tagLen = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]); if (tagType == type) @@ -107,7 +107,7 @@ static __inline__ int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_ta } skb_put(skb, data_len); - // have a room for new tag + /* have a room for new tag */ memmove(((unsigned char *)ph->tag + data_len), (unsigned char *)ph->tag, ntohs(ph->length)); ph->length = htons(ntohs(ph->length) + data_len); memcpy((unsigned char *)ph->tag, tag, data_len); @@ -307,8 +307,8 @@ static void convert_ipv6_mac_to_mc(struct sk_buff *skb) struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + ETH_HLEN); unsigned char *dst_mac = skb->data; - //dst_mac[0] = 0xff; - //dst_mac[1] = 0xff; + /* dst_mac[0] = 0xff; */ + /* dst_mac[1] = 0xff; */ /*modified by qinjunjie,ipv6 multicast address ix 0x33-33-xx-xx-xx-xx*/ dst_mac[0] = 0x33; dst_mac[1] = 0x33; @@ -385,9 +385,9 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr) static __inline__ void __network_hash_link(_adapter *priv, struct nat25_network_db_entry *ent, int hash) { - // Caller must _enter_critical_bh already! - //_irqL irqL; - //_enter_critical_bh(&priv->br_ext_lock, &irqL); + /* Caller must _enter_critical_bh already! */ + /* _irqL irqL; */ + /* _enter_critical_bh(&priv->br_ext_lock, &irqL); */ ent->next_hash = priv->nethash[hash]; if (ent->next_hash != NULL) @@ -395,15 +395,15 @@ static __inline__ void __network_hash_link(_adapter *priv, priv->nethash[hash] = ent; ent->pprev_hash = &priv->nethash[hash]; - //_exit_critical_bh(&priv->br_ext_lock, &irqL); + /* _exit_critical_bh(&priv->br_ext_lock, &irqL); */ } static __inline__ void __network_hash_unlink(struct nat25_network_db_entry *ent) { - // Caller must _enter_critical_bh already! - //_irqL irqL; - //_enter_critical_bh(&priv->br_ext_lock, &irqL); + /* Caller must _enter_critical_bh already! */ + /* _irqL irqL; */ + /* _enter_critical_bh(&priv->br_ext_lock, &irqL); */ *(ent->pprev_hash) = ent->next_hash; if (ent->next_hash != NULL) @@ -411,7 +411,7 @@ static __inline__ void __network_hash_unlink(struct nat25_network_db_entry *ent) ent->next_hash = NULL; ent->pprev_hash = NULL; - //_exit_critical_bh(&priv->br_ext_lock, &irqL); + /* _exit_critical_bh(&priv->br_ext_lock, &irqL); */ } @@ -429,7 +429,7 @@ static int __nat25_db_network_lookup_and_replace(_adapter *priv, { if (!__nat25_has_expired(priv, db)) { - // replace the destination mac address + /* replace the destination mac address */ memcpy(skb->data, db->macAddr, ETH_ALEN); atomic_inc(&db->use_count); @@ -658,7 +658,7 @@ void nat25_db_expire(_adapter *priv) _irqL irqL; _enter_critical_bh(&priv->br_ext_lock, &irqL); - //if (!priv->ethBrExtInfo.nat25_disable) + /* if (!priv->ethBrExtInfo.nat25_disable) */ { for (i=0; i= NAT25_MAX)) return -1; - protocol = *((unsigned short *)(skb->data + 2 * ETH_ALEN)); + protocol = be16_to_cpu(*((__be16 *)(skb->data + 2 * ETH_ALEN))); /*---------------------------------------------------*/ /* Handle IP frame */ /*---------------------------------------------------*/ - if (protocol == __constant_htons(ETH_P_IP)) + if (protocol == ETH_P_IP) { struct iphdr* iph = (struct iphdr *)(skb->data + ETH_HLEN); @@ -806,13 +807,14 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) case NAT25_INSERT: { - //some muticast with source IP is all zero, maybe other case is illegal - //in class A, B, C, host address is all zero or all one is illegal + /* some muticast with source IP is all zero, maybe other case is illegal */ + /* in class A, B, C, host address is all zero or all one is illegal */ if (iph->saddr == 0) return 0; - DEBUG_INFO("NAT25: Insert IP, SA=%08x, DA=%08x\n", iph->saddr, iph->daddr); - __nat25_generate_ipv4_network_addr(networkAddr, &iph->saddr); - //record source IP address and , source mac address into db + tmp = be32_to_cpu(iph->saddr); + DEBUG_INFO("NAT25: Insert IP, SA=%08x, DA=%08x\n", tmp, iph->daddr); + __nat25_generate_ipv4_network_addr(networkAddr, &tmp); + /* record source IP address and , source mac address into db */ __nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr); __nat25_db_print(priv); @@ -830,16 +832,17 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) (OPMODE & WIFI_ADHOC_STATE))) #endif { - __nat25_generate_ipv4_network_addr(networkAddr, &iph->daddr); + tmp = be32_to_cpu(iph->daddr); + __nat25_generate_ipv4_network_addr(networkAddr, &tmp); if (!__nat25_db_network_lookup_and_replace(priv, skb, networkAddr)) { if (*((unsigned char *)&iph->daddr + 3) == 0xff) { - // L2 is unicast but L3 is broadcast, make L2 bacome broadcast + /* L2 is unicast but L3 is broadcast, make L2 bacome broadcast */ DEBUG_INFO("NAT25: Set DA as boardcast\n"); memset(skb->data, 0xff, ETH_ALEN); } else { - // forward unknow IP packet to upper TCP/IP + /* forward unknow IP packet to upper TCP/IP */ DEBUG_INFO("NAT25: Replace DA with BR's MAC\n"); if ( (*(u32 *)priv->br_mac) == 0 && (*(u16 *)(priv->br_mac+4)) == 0 ) { printk("Re-init netdev_br_init() due to br_mac==0!\n"); @@ -860,7 +863,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) /*---------------------------------------------------*/ /* Handle ARP frame */ /*---------------------------------------------------*/ - else if (protocol == __constant_htons(ETH_P_ARP)) + else if (protocol == ETH_P_ARP) { struct arphdr *arp = (struct arphdr *)(skb->data + ETH_HLEN); unsigned char *arp_ptr = (unsigned char *)(arp + 1); @@ -868,21 +871,21 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) if (arp->ar_pro != __constant_htons(ETH_P_IP)) { - DEBUG_WARN("NAT25: arp protocol unknown (%4x)!\n", htons(arp->ar_pro)); + DEBUG_WARN("NAT25: arp protocol unknown (%4x)!\n", be16_to_cpu(arp->ar_pro)); return -1; } switch (method) { case NAT25_CHECK: - return 0; // skb_copy for all ARP frame + return 0; /* skb_copy for all ARP frame */ case NAT25_INSERT: { DEBUG_INFO("NAT25: Insert ARP, MAC=%02x%02x%02x%02x%02x%02x\n", arp_ptr[0], arp_ptr[1], arp_ptr[2], arp_ptr[3], arp_ptr[4], arp_ptr[5]); - // change to ARP sender mac address to wlan STA address + /* change to ARP sender mac address to wlan STA address */ memcpy(arp_ptr, GET_MY_HWADDR(priv), ETH_ALEN); arp_ptr += arp->ar_hln; @@ -909,7 +912,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) __nat25_db_network_lookup_and_replace(priv, skb, networkAddr); - // change to ARP target mac address to Lookup result + /* change to ARP target mac address to Lookup result */ arp_ptr = (unsigned char *)(arp + 1); arp_ptr += (arp->ar_hln + arp->ar_pln); memcpy(arp_ptr, skb->data, ETH_ALEN); @@ -924,8 +927,8 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) /*---------------------------------------------------*/ /* Handle IPX and Apple Talk frame */ /*---------------------------------------------------*/ - else if ((protocol == __constant_htons(ETH_P_IPX)) || - (protocol <= __constant_htons(ETH_FRAME_LEN))) + else if ((protocol == ETH_P_IPX) || + (protocol <= ETH_FRAME_LEN)) { unsigned char ipx_header[2] = {0xFF, 0xFF}; struct ipxhdr *ipx = NULL; @@ -933,12 +936,12 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) struct ddpehdr *ddp = NULL; unsigned char *framePtr = skb->data + ETH_HLEN; - if (protocol == __constant_htons(ETH_P_IPX)) + if (protocol == ETH_P_IPX) { DEBUG_INFO("NAT25: Protocol=IPX (Ethernet II)\n"); ipx = (struct ipxhdr *)framePtr; } - else if (protocol <= __constant_htons(ETH_FRAME_LEN)) + else if (protocol <= ETH_FRAME_LEN) { if (!memcmp(ipx_header, framePtr, 2)) { @@ -952,28 +955,28 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) if (*framePtr == snap_8022_type) { - unsigned char ipx_snap_id[5] = {0x0, 0x0, 0x0, 0x81, 0x37}; // IPX SNAP ID - unsigned char aarp_snap_id[5] = {0x00, 0x00, 0x00, 0x80, 0xF3}; // Apple Talk AARP SNAP ID - unsigned char ddp_snap_id[5] = {0x08, 0x00, 0x07, 0x80, 0x9B}; // Apple Talk DDP SNAP ID + unsigned char ipx_snap_id[5] = {0x0, 0x0, 0x0, 0x81, 0x37}; /* IPX SNAP ID */ + unsigned char aarp_snap_id[5] = {0x00, 0x00, 0x00, 0x80, 0xF3}; /* Apple Talk AARP SNAP ID */ + unsigned char ddp_snap_id[5] = {0x08, 0x00, 0x07, 0x80, 0x9B}; /* Apple Talk DDP SNAP ID */ - framePtr += 3; // eliminate the 802.2 header + framePtr += 3; /* eliminate the 802.2 header */ if (!memcmp(ipx_snap_id, framePtr, 5)) { - framePtr += 5; // eliminate the SNAP header + framePtr += 5; /* eliminate the SNAP header */ DEBUG_INFO("NAT25: Protocol=IPX (Ethernet SNAP)\n"); ipx = (struct ipxhdr *)framePtr; } else if (!memcmp(aarp_snap_id, framePtr, 5)) { - framePtr += 5; // eliminate the SNAP header + framePtr += 5; /* eliminate the SNAP header */ ea = (struct elapaarp *)framePtr; } else if (!memcmp(ddp_snap_id, framePtr, 5)) { - framePtr += 5; // eliminate the SNAP header + framePtr += 5; /* eliminate the SNAP header */ ddp = (struct ddpehdr *)framePtr; } @@ -986,7 +989,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) } else if (*framePtr == ipx_8022_type) { - framePtr += 3; // eliminate the 802.2 header + framePtr += 3; /* eliminate the 802.2 header */ if (!memcmp(ipx_header, framePtr, 2)) { @@ -1042,7 +1045,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) __nat25_generate_ipx_network_addr_with_socket(networkAddr, &ipx->ipx_source.net, &ipx->ipx_source.sock); - // change IPX source node addr to wlan STA address + /* change IPX source node addr to wlan STA address */ memcpy(ipx->ipx_source.node, GET_MY_HWADDR(priv), ETH_ALEN); } else @@ -1066,7 +1069,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) __nat25_db_network_lookup_and_replace(priv, skb, networkAddr); - // replace IPX destination node addr with Lookup destination MAC addr + /* replace IPX destination node addr with Lookup destination MAC addr */ memcpy(ipx->ipx_dest.node, skb->data, ETH_ALEN); } else @@ -1100,7 +1103,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) case NAT25_INSERT: { - // change to AARP source mac address to wlan STA address + /* change to AARP source mac address to wlan STA address */ memcpy(ea->hw_src, GET_MY_HWADDR(priv), ETH_ALEN); DEBUG_INFO("NAT25: Insert AARP, Source=%d,%d Destination=%d,%d\n", @@ -1129,7 +1132,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) __nat25_db_network_lookup_and_replace(priv, skb, networkAddr); - // change to AARP destination mac address to Lookup result + /* change to AARP destination mac address to Lookup result */ memcpy(ea->hw_dst, skb->data, ETH_ALEN); } return 0; @@ -1188,8 +1191,8 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) /*---------------------------------------------------*/ /* Handle PPPoE frame */ /*---------------------------------------------------*/ - else if ((protocol == __constant_htons(ETH_P_PPP_DISC)) || - (protocol == __constant_htons(ETH_P_PPP_SES))) + else if ((protocol == ETH_P_PPP_DISC) || + (protocol == ETH_P_PPP_SES)) { struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN); unsigned short *pMagic; @@ -1202,7 +1205,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) return 1; case NAT25_INSERT: - if (ph->sid == 0) // Discovery phase according to tag + if (ph->sid == 0) /* Discovery phase according to tag */ { if (ph->code == PADI_CODE || ph->code == PADR_CODE) { @@ -1213,7 +1216,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) tag = (struct pppoe_tag *)tag_buf; pOldTag = (struct pppoe_tag *)__nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID)); - if (pOldTag) { // if SID existed, copy old value and delete it + if (pOldTag) { /* if SID existed, copy old value and delete it */ old_tag_len = ntohs(pOldTag->tag_len); if (old_tag_len+TAG_HDR_LEN+MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN > sizeof(tag_buf)) { DEBUG_ERR("SID tag length too long!\n"); @@ -1233,19 +1236,19 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) tag->tag_type = PTT_RELAY_SID; tag->tag_len = htons(MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN+old_tag_len); - // insert the magic_code+client mac in relay tag + /* insert the magic_code+client mac in relay tag */ pMagic = (unsigned short *)tag->tag_data; *pMagic = htons(MAGIC_CODE); memcpy(tag->tag_data+MAGIC_CODE_LEN, skb->data+ETH_ALEN, ETH_ALEN); - //Add relay tag + /* Add relay tag */ if (__nat25_add_pppoe_tag(skb, tag) < 0) return -1; DEBUG_INFO("NAT25: Insert PPPoE, forward %s packet\n", (ph->code == PADI_CODE ? "PADI" : "PADR")); } - else { // not add relay tag + else { /* not add relay tag */ if (priv->pppoe_connection_in_progress && memcmp(skb->data+ETH_ALEN, priv->pppoe_addr, ETH_ALEN)) { DEBUG_ERR("Discard PPPoE packet due to another PPPoE connection is in progress!\n"); @@ -1261,7 +1264,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) else return -1; } - else // session phase + else /* session phase */ { DEBUG_INFO("NAT25: Insert PPPoE, insert session packet to %s\n", skb->dev->name); @@ -1324,7 +1327,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) DEBUG_INFO("NAT25: Lookup PPPoE, forward %s Packet from %s\n", (ph->code == PADO_CODE ? "PADO" : "PADS"), skb->dev->name); } - else { // not add relay tag + else { /* not add relay tag */ if (!priv->pppoe_connection_in_progress) { DEBUG_ERR("Discard PPPoE packet due to no connection in progresss!\n"); return -1; @@ -1357,7 +1360,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) /*---------------------------------------------------*/ /* Handle EAP frame */ /*---------------------------------------------------*/ - else if (protocol == __constant_htons(0x888e)) + else if (protocol == 0x888e) { switch (method) { @@ -1378,8 +1381,8 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) /*---------------------------------------------------*/ /* Handle C-Media proprietary frame */ /*---------------------------------------------------*/ - else if ((protocol == __constant_htons(0xe2ae)) || - (protocol == __constant_htons(0xe2af))) + else if ((protocol == 0xe2ae) || + (protocol == 0xe2af)) { switch (method) { @@ -1401,7 +1404,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) /* Handle IPV6 frame */ /*---------------------------------------------------*/ #ifdef CL_IPV6_PASS - else if (protocol == __constant_htons(ETH_P_IPV6)) + else if (protocol == ETH_P_IPV6) { struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + ETH_HLEN); @@ -1470,7 +1473,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) return -1; } } -#endif // CL_IPV6_PASS +#endif /* CL_IPV6_PASS */ return -1; } @@ -1501,8 +1504,10 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb) { int is_vlan_tag=0, i, retval=0; unsigned short vlan_hdr=0; + unsigned short protocol; - if (*((unsigned short *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_8021Q)) { + protocol = be16_to_cpu(*((__be16 *)(skb->data + 2 * ETH_ALEN))); + if (protocol == ETH_P_8021Q) { is_vlan_tag = 1; vlan_hdr = *((unsigned short *)(skb->data+ETH_ALEN*2+2)); for (i=0; i<6; i++) @@ -1520,24 +1525,22 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb) * corresponding network protocol is NOT support. */ if (!priv->ethBrExtInfo.nat25sc_disable && - (*((unsigned short *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_IP)) && - !memcmp(priv->scdb_ip, skb->data+ETH_HLEN+16, 4)) { + (be16_to_cpu(*((__be16 *)(skb->data+ETH_ALEN*2))) == ETH_P_IP) && + !memcmp(priv->scdb_ip, skb->data+ETH_HLEN+16, 4)) { memcpy(skb->data, priv->scdb_mac, ETH_ALEN); _exit_critical_bh(&priv->br_ext_lock, &irqL); - } - else { + } else { _exit_critical_bh(&priv->br_ext_lock, &irqL); retval = nat25_db_handle(priv, skb, NAT25_LOOKUP); } - } - else { - if (((*((unsigned short *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_IP)) && - !memcmp(priv->br_ip, skb->data+ETH_HLEN+16, 4)) || - ((*((unsigned short *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_ARP)) && - !memcmp(priv->br_ip, skb->data+ETH_HLEN+24, 4))) { - // for traffic to upper TCP/IP + } else { + if (((be16_to_cpu(*((__be16 *)(skb->data+ETH_ALEN*2))) == ETH_P_IP) && + !memcmp(priv->br_ip, skb->data+ETH_HLEN+16, 4)) || + ((be16_to_cpu(*((__be16 *)(skb->data+ETH_ALEN*2))) == ETH_P_ARP) && + !memcmp(priv->br_ip, skb->data+ETH_HLEN+24, 4))) { + /* for traffic to upper TCP/IP */ retval = nat25_db_handle(priv, skb, NAT25_LOOKUP); } } @@ -1551,7 +1554,7 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb) } if (retval == -1) { - //DEBUG_ERR("NAT25: Lookup fail!\n"); + /* DEBUG_ERR("NAT25: Lookup fail!\n"); */ return -1; } } @@ -1590,34 +1593,33 @@ void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb) if (!priv->ethBrExtInfo.dhcp_bcst_disable) { - unsigned short protocol = *((unsigned short *)(skb->data + 2 * ETH_ALEN)); + __be16 protocol = *((__be16 *)(skb->data + 2 * ETH_ALEN)); - if (protocol == __constant_htons(ETH_P_IP)) // IP + if (protocol == __constant_htons(ETH_P_IP)) /* IP */ { struct iphdr* iph = (struct iphdr *)(skb->data + ETH_HLEN); - if (iph->protocol == IPPROTO_UDP) // UDP + if (iph->protocol == IPPROTO_UDP) /* UDP */ { struct udphdr *udph = (struct udphdr *)((SIZE_PTR)iph + (iph->ihl << 2)); - if ((udph->source == __constant_htons(CLIENT_PORT)) - && (udph->dest == __constant_htons(SERVER_PORT))) // DHCP request - { + if ((udph->source == __constant_htons(CLIENT_PORT)) && + (udph->dest == __constant_htons(SERVER_PORT))) { /* DHCP request */ struct dhcpMessage *dhcph = (struct dhcpMessage *)((SIZE_PTR)udph + sizeof(struct udphdr)); + u32 cookie = be32_to_cpu((__be32)dhcph->cookie); - if (dhcph->cookie == __constant_htonl(DHCP_MAGIC)) // match magic word - { - if (!(dhcph->flags & htons(BROADCAST_FLAG))) // if not broadcast + if (cookie == DHCP_MAGIC) { /* match magic word */ + if (!(dhcph->flags & htons(BROADCAST_FLAG))) /* if not broadcast */ { register int sum = 0; DEBUG_INFO("DHCP: change flag of DHCP request to broadcast.\n"); - // or BROADCAST flag + /* or BROADCAST flag */ dhcph->flags |= htons(BROADCAST_FLAG); - // recalculate checksum + /* recalculate checksum */ sum = ~(udph->check) & 0xffff; - sum += dhcph->flags; + sum += be16_to_cpu(dhcph->flags); while (sum >> 16) sum = (sum & 0xffff) + (sum >> 16); udph->check = ~sum; @@ -1636,8 +1638,8 @@ void *scdb_findEntry(_adapter *priv, unsigned char *macAddr, unsigned char networkAddr[MAX_NETWORK_ADDR_LEN]; struct nat25_network_db_entry *db; int hash; - //_irqL irqL; - //_enter_critical_bh(&priv->br_ext_lock, &irqL); + /* _irqL irqL; */ + /* _enter_critical_bh(&priv->br_ext_lock, &irqL); */ __nat25_generate_ipv4_network_addr(networkAddr, (unsigned int *)ipAddr); hash = __nat25_network_hash(networkAddr); @@ -1645,15 +1647,15 @@ void *scdb_findEntry(_adapter *priv, unsigned char *macAddr, while (db != NULL) { if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) { - //_exit_critical_bh(&priv->br_ext_lock, &irqL); + /* _exit_critical_bh(&priv->br_ext_lock, &irqL); */ return (void *)db; } db = db->next_hash; } - //_exit_critical_bh(&priv->br_ext_lock, &irqL); + /* _exit_critical_bh(&priv->br_ext_lock, &irqL); */ return NULL; } -#endif // CONFIG_BR_EXT +#endif /* CONFIG_BR_EXT */ diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index 0441c34..e02a4fb 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -27,12 +27,12 @@ #include #ifdef CONFIG_BR_EXT #include -#endif //CONFIG_BR_EXT +#endif /* CONFIG_BR_EXT */ #include #ifdef CONFIG_BT_COEXIST #include -#endif // CONFIG_BT_COEXIST +#endif /* CONFIG_BT_COEXIST */ /* Caller and the rtw_cmd_thread can protect cmd_q by spin_lock. @@ -46,13 +46,13 @@ sint _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv) _func_enter_; _rtw_init_sema(&(pcmdpriv->cmd_queue_sema), 0); - //_rtw_init_sema(&(pcmdpriv->cmd_done_sema), 0); + /* _rtw_init_sema(&(pcmdpriv->cmd_done_sema), 0); */ _rtw_init_sema(&(pcmdpriv->terminate_cmdthread_sema), 0); _rtw_init_queue(&(pcmdpriv->cmd_queue)); - //allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf + /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ pcmdpriv->cmd_seq = 1; @@ -100,7 +100,7 @@ _func_enter_; pevtpriv->cmdevt_parm = NULL; #endif - //allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf + /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ ATOMIC_SET(&pevtpriv->event_seq, 0); pevtpriv->evt_done_cnt = 0; @@ -136,13 +136,13 @@ _func_enter_; } MmBuildMdlForNonPagedPool(pevtpriv->pc2h_mdl); #endif -#endif //end of CONFIG_SDIO_HCI +#endif /* end of CONFIG_SDIO_HCI */ _rtw_init_queue(&(pevtpriv->evt_queue)); exit: -#endif //end of CONFIG_EVENT_THREAD_MODE +#endif /* end of CONFIG_EVENT_THREAD_MODE */ #ifdef CONFIG_C2H_WK _init_workitem(&pevtpriv->c2h_wk, c2h_wk_callback, NULL); @@ -197,7 +197,7 @@ _func_enter_; if (pcmdpriv){ _rtw_spinlock_free(&(pcmdpriv->cmd_queue.lock)); _rtw_free_sema(&(pcmdpriv->cmd_queue_sema)); - //_rtw_free_sema(&(pcmdpriv->cmd_done_sema)); + /* _rtw_free_sema(&(pcmdpriv->cmd_done_sema)); */ _rtw_free_sema(&(pcmdpriv->terminate_cmdthread_sema)); if (pcmdpriv->cmd_allocated_buf) @@ -228,12 +228,12 @@ _func_enter_; if (obj == NULL) goto exit; - //_enter_critical_bh(&queue->lock, &irqL); + /* _enter_critical_bh(&queue->lock, &irqL); */ _enter_critical(&queue->lock, &irqL); rtw_list_insert_tail(&obj->list, &queue->queue); - //_exit_critical_bh(&queue->lock, &irqL); + /* _exit_critical_bh(&queue->lock, &irqL); */ _exit_critical(&queue->lock, &irqL); exit: @@ -250,7 +250,7 @@ struct cmd_obj *_rtw_dequeue_cmd(_queue *queue) _func_enter_; - //_enter_critical_bh(&(queue->lock), &irqL); + /* _enter_critical_bh(&(queue->lock), &irqL); */ _enter_critical(&queue->lock, &irqL); if (rtw_is_list_empty(&(queue->queue))) obj = NULL; @@ -260,7 +260,7 @@ _func_enter_; rtw_list_delete(&obj->list); } - //_exit_critical_bh(&(queue->lock), &irqL); + /* _exit_critical_bh(&(queue->lock), &irqL); */ _exit_critical(&queue->lock, &irqL); _func_exit_; @@ -305,10 +305,10 @@ _func_exit_; int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj); int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) { - u8 bAllow = false; //set to true to allow enqueuing cmd when hw_init_completed is false + u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */ #ifdef SUPPORT_HW_RFOFF_DETECTED - //To decide allow or not + /* To decide allow or not */ if ( (pcmdpriv->padapter->pwrctrlpriv.bHWPwrPindetect) &&(!pcmdpriv->padapter->registrypriv.usbss_enable) ) @@ -318,7 +318,7 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) struct drvextra_cmd_parm *pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)cmd_obj->parmbuf; if (pdrvextra_cmd_parm->ec_id == POWER_SAVING_CTRL_WK_CID) { - //DBG_88E("==>enqueue POWER_SAVING_CTRL_WK_CID\n"); + /* DBG_88E("==>enqueue POWER_SAVING_CTRL_WK_CID\n"); */ bAllow = true; } } @@ -329,14 +329,14 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) bAllow = true; if ( (pcmdpriv->padapter->hw_init_completed ==false && bAllow == false) - || pcmdpriv->cmdthd_running== false //com_thread not running + || pcmdpriv->cmdthd_running== false /* com_thread not running */ ) { - //DBG_88E("%s:%s: drop cmdcode:%u, hw_init_completed:%u, cmdthd_running:%u\n", caller_func, __func__, - // cmd_obj->cmdcode, - // pcmdpriv->padapter->hw_init_completed, - // pcmdpriv->cmdthd_running - //); + /* DBG_88E("%s:%s: drop cmdcode:%u, hw_init_completed:%u, cmdthd_running:%u\n", caller_func, __func__, */ + /* cmd_obj->cmdcode, */ + /* pcmdpriv->padapter->hw_init_completed, */ + /* pcmdpriv->cmdthd_running */ + /* */ return _FAIL; } @@ -396,7 +396,7 @@ void rtw_cmd_clr_isr(struct cmd_priv *pcmdpriv) { _func_enter_; pcmdpriv->cmd_done_cnt++; - //_rtw_up_sema(&(pcmdpriv->cmd_done_sema)); + /* _rtw_up_sema(&(pcmdpriv->cmd_done_sema)); */ _func_exit_; } @@ -406,7 +406,7 @@ _func_enter_; if ((pcmd->cmdcode!=_JoinBss_CMD_) &&(pcmd->cmdcode!= _CreateBss_CMD_)) { - //free parmbuf in cmd_obj + /* free parmbuf in cmd_obj */ rtw_mfree((unsigned char*)pcmd->parmbuf, pcmd->cmdsz); } @@ -414,12 +414,12 @@ _func_enter_; { if (pcmd->rspsz!= 0) { - //free rsp in cmd_obj + /* free rsp in cmd_obj */ rtw_mfree((unsigned char*)pcmd->rsp, pcmd->rspsz); } } - //free cmd_obj + /* free cmd_obj */ rtw_mfree((unsigned char*)pcmd, sizeof(struct cmd_obj)); _func_exit_; @@ -490,7 +490,7 @@ _next: pcmdpriv->cmd_issued_cnt++; - pcmd->cmdsz = _RND4((pcmd->cmdsz));//_RND4 + pcmd->cmdsz = _RND4((pcmd->cmdsz));/* _RND4 */ _rtw_memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz); @@ -515,7 +515,7 @@ _next: post_process: - //call callback function for post-processed + /* call callback function for post-processed */ if (pcmd->cmdcode <= (sizeof(rtw_cmd_callback) /sizeof(struct _cmd_callback))) { pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback; @@ -526,8 +526,8 @@ post_process: } else { - //todo: !!! fill rsp_buf to pcmd->rsp if (pcmd->rsp!=NULL) - pcmd_callback(pcmd->padapter, pcmd);//need conider that free cmd_obj in rtw_cmd_callback + /* todo: !!! fill rsp_buf to pcmd->rsp if (pcmd->rsp!=NULL) */ + pcmd_callback(pcmd->padapter, pcmd);/* need conider that free cmd_obj in rtw_cmd_callback */ } } else @@ -544,13 +544,13 @@ post_process: pcmdpriv->cmdthd_running=false; - // free all cmd_obj resources + /* free all cmd_obj resources */ do{ pcmd = rtw_dequeue_cmd(pcmdpriv); if (pcmd==NULL) break; - //DBG_88E("%s: leaving... drop cmdcode:%u\n", __func__, pcmd->cmdcode); + /* DBG_88E("%s: leaving... drop cmdcode:%u\n", __func__, pcmd->cmdcode); */ rtw_free_cmd_obj(pcmd); }while (1); @@ -586,7 +586,7 @@ _func_enter_; _exit_critical_bh(&queue->lock, &irqL); - //rtw_evt_notify_isr(pevtpriv); + /* rtw_evt_notify_isr(pevtpriv); */ exit: @@ -695,7 +695,7 @@ u8 rtw_sitesurvey_cmd(_adapter *padapter, NDIS_802_11_SSID *ssid, int ssid_num, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ _func_enter_; @@ -709,7 +709,7 @@ _func_enter_; if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { p2p_ps_wk_cmd(padapter, P2P_PS_SCAN, 1); } -#endif //CONFIG_P2P_PS +#endif /* CONFIG_P2P_PS */ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if (ph2c == NULL) @@ -770,12 +770,12 @@ _func_enter_; if ((padapter->pbuddy_adapter->mlmeextpriv.mlmext_info.state&0x03) == WIFI_FW_AP_STATE) _set_timer(&pmlmepriv->scan_to_timer, SURVEY_TO * ( 38 + ( 38 / RTW_SCAN_NUM_OF_CH ) * RTW_STAY_AP_CH_MILLISECOND ) + 1000 ); else -#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE +#endif /* CONFIG_STA_MODE_SCAN_UNDER_AP_MODE */ _set_timer(&pmlmepriv->scan_to_timer, SCANNING_TIMEOUT); rtw_led_control(padapter, LED_CTL_SITE_SURVEY); - pmlmepriv->scan_interval = SCAN_INTERVAL;// 30*2 sec = 60sec + pmlmepriv->scan_interval = SCAN_INTERVAL;/* 30*2 sec = 60sec */ } else { _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); } @@ -810,7 +810,7 @@ _func_enter_; init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara, GEN_CMD_CODE(_SetDataRate)); #ifdef MP_FIRMWARE_OFFLOAD pbsetdataratepara->curr_rateidx = *(u32*)rateset; -// _rtw_memcpy(pbsetdataratepara, rateset, sizeof(u32)); +/* _rtw_memcpy(pbsetdataratepara, rateset, sizeof(u32)); */ #else pbsetdataratepara->mac_id = 5; _rtw_memcpy(pbsetdataratepara->datarates, rateset, NumRates); @@ -870,8 +870,8 @@ u8 rtw_setphy_cmd(_adapter *padapter, u8 modem, u8 ch) struct cmd_obj* ph2c; struct setphy_parm* psetphypara; struct cmd_priv *pcmdpriv=&padapter->cmdpriv; -// struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -// struct registry_priv* pregistry_priv = &padapter->registrypriv; +/* struct mlme_priv *pmlmepriv = &padapter->mlmepriv; */ +/* struct registry_priv* pregistry_priv = &padapter->registrypriv; */ u8 res=_SUCCESS; _func_enter_; @@ -1102,7 +1102,7 @@ _func_enter_; pdev_network->Length = pcmd->cmdsz; #ifdef CONFIG_RTL8712 - //notes: translate IELength & Length after assign the Length to cmdsz; + /* notes: translate IELength & Length after assign the Length to cmdsz; */ pdev_network->Length = cpu_to_le32(pcmd->cmdsz); pdev_network->IELength = cpu_to_le32(pdev_network->IELength); pdev_network->Ssid.SsidLength = cpu_to_le32(pdev_network->Ssid.SsidLength); @@ -1160,7 +1160,7 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network* pnetwork) struct registry_priv *pregistrypriv = &padapter->registrypriv; #ifdef CONFIG_80211N_HT struct ht_priv *phtpriv = &pmlmepriv->htpriv; -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ NDIS_802_11_NETWORK_INFRASTRUCTURE ndis_network_mode = pnetwork->network.InfrastructureMode; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -1181,19 +1181,11 @@ _func_enter_; RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd: memory allocate for cmd_obj fail!!!\n")); goto exit; } - /* // for IEs is pointer - t_len = sizeof (ULONG) + sizeof (NDIS_802_11_MAC_ADDRESS) + 2 + - sizeof (NDIS_802_11_SSID) + sizeof (ULONG) + - sizeof (NDIS_802_11_RSSI) + sizeof (NDIS_802_11_NETWORK_TYPE) + - sizeof (NDIS_802_11_CONFIGURATION) + - sizeof (NDIS_802_11_NETWORK_INFRASTRUCTURE) + - sizeof (NDIS_802_11_RATES_EX)+ sizeof(WLAN_PHY_INFO)+ sizeof (ULONG) + MAX_IE_SZ; - */ - //for IEs is fix buf size + /* for IEs is fix buf size */ t_len = sizeof(WLAN_BSSID_EX); - //for hidden ap to set fw_state here + /* for hidden ap to set fw_state here */ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) != true) { switch (ndis_network_mode) @@ -1240,10 +1232,10 @@ _func_enter_; } psecnetwork->IELength = 0; - // Added by Albert 2009/02/18 - // If the the driver wants to use the bssid to create the connection. - // If not, we have to copy the connecting AP's MAC address to it so that - // the driver just has the bssid information for PMKIDList searching. + /* Added by Albert 2009/02/18 */ + /* If the the driver wants to use the bssid to create the connection. */ + /* If not, we have to copy the connecting AP's MAC address to it so that */ + /* the driver just has the bssid information for PMKIDList searching. */ if ( pmlmepriv->assoc_by_bssid == false ) { @@ -1264,11 +1256,11 @@ _func_enter_; if (psecnetwork->IELength != tmp_len) { psecnetwork->IELength = tmp_len; - pqospriv->qos_option = 1; //There is WMM IE in this corresp. beacon + pqospriv->qos_option = 1; /* There is WMM IE in this corresp. beacon */ } else { - pqospriv->qos_option = 0;//There is no WMM IE in this corresp. beacon + pqospriv->qos_option = 0;/* There is no WMM IE in this corresp. beacon */ } } @@ -1276,14 +1268,14 @@ _func_enter_; phtpriv->ht_option = false; if (pregistrypriv->ht_enable) { - // Added by Albert 2010/06/23 - // For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. - // Especially for Realtek 8192u SoftAP. + /* Added by Albert 2010/06/23 */ + /* For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. */ + /* Especially for Realtek 8192u SoftAP. */ if ( ( padapter->securitypriv.dot11PrivacyAlgrthm != _WEP40_ ) && ( padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_ ) && ( padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_ )) { - //rtw_restructure_ht_ie + /* rtw_restructure_ht_ie */ rtw_restructure_ht_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], pnetwork->network.IELength, &psecnetwork->IELength); } @@ -1300,10 +1292,10 @@ _func_enter_; DBG_88E("%s: smart_ps=%d\n", __func__, padapter->pwrctrlpriv.smart_ps); - pcmd->cmdsz = get_WLAN_BSSID_EX_sz(psecnetwork);//get cmdsz before endian conversion + pcmd->cmdsz = get_WLAN_BSSID_EX_sz(psecnetwork);/* get cmdsz before endian conversion */ #ifdef CONFIG_RTL8712 - //wlan_network endian conversion + /* wlan_network endian conversion */ psecnetwork->Length = cpu_to_le32(psecnetwork->Length); psecnetwork->Ssid.SsidLength= cpu_to_le32(psecnetwork->Ssid.SsidLength); psecnetwork->Privacy = cpu_to_le32(psecnetwork->Privacy); @@ -1322,7 +1314,7 @@ _func_enter_; #endif _rtw_init_listhead(&pcmd->list); - pcmd->cmdcode = _JoinBss_CMD_;//GEN_CMD_CODE(_JoinBss) + pcmd->cmdcode = _JoinBss_CMD_;/* GEN_CMD_CODE(_JoinBss) */ pcmd->parmbuf = (unsigned char *)psecnetwork; pcmd->rsp = NULL; pcmd->rspsz = 0; @@ -1460,7 +1452,7 @@ _func_enter_; if (sta->tdls_sta_state&TDLS_LINKED_STATE) psetstakey_para->algorithm=(u8)sta->dot118021XPrivacy; else -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ psetstakey_para->algorithm =(unsigned char) psecuritypriv->dot11PrivacyAlgrthm; }else{ GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false); @@ -1471,13 +1463,13 @@ _func_enter_; if ((sta->tdls_sta_state&TDLS_LINKED_STATE)==TDLS_LINKED_STATE) _rtw_memcpy(&psetstakey_para->key, sta->tpk.tk, 16); else -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ _rtw_memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16); } else { _rtw_memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16); } - //jeff: set this becasue at least sw key is ready + /* jeff: set this becasue at least sw key is ready */ padapter->securitypriv.busetkipkey=true; res = rtw_enqueue_cmd(pcmdpriv, ph2c); @@ -1603,7 +1595,7 @@ _func_enter_; goto exit; } -// init_h2fwcmd_w_parm_no_rsp(ph2c, psetrttblparm, GEN_CMD_CODE(_SetRaTable)); +/* init_h2fwcmd_w_parm_no_rsp(ph2c, psetrttblparm, GEN_CMD_CODE(_SetRaTable)); */ _rtw_init_listhead(&ph2c->list); ph2c->cmdcode =GEN_CMD_CODE(_GetRaTable); @@ -1695,9 +1687,9 @@ _func_enter_; init_h2fwcmd_w_parm_no_rsp(ph2c, paddbareq_parm, GEN_CMD_CODE(_AddBAReq)); - //DBG_88E("rtw_addbareq_cmd, tid=%d\n", tid); + /* DBG_88E("rtw_addbareq_cmd, tid=%d\n", tid); */ - //rtw_enqueue_cmd(pcmdpriv, ph2c); + /* rtw_enqueue_cmd(pcmdpriv, ph2c); */ res = rtw_enqueue_cmd(pcmdpriv, ph2c); exit: @@ -1741,7 +1733,7 @@ _func_enter_; init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); - //rtw_enqueue_cmd(pcmdpriv, ph2c); + /* rtw_enqueue_cmd(pcmdpriv, ph2c); */ res = rtw_enqueue_cmd(pcmdpriv, ph2c); exit: @@ -1819,13 +1811,13 @@ _func_enter_; RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_set_chplan_cmd\n")); - //check input parameter + /* check input parameter */ if (!rtw_is_channel_plan_valid(chplan)) { res = _FAIL; goto exit; } - //prepare cmd parameter + /* prepare cmd parameter */ setChannelPlan_param = (struct SetChannelPlan_param *)rtw_zmalloc(sizeof(struct SetChannelPlan_param)); if (setChannelPlan_param == NULL) { res= _FAIL; @@ -1835,7 +1827,7 @@ _func_enter_; if (enqueue) { - //need enqueue, prepare cmd_obj and enqueue + /* need enqueue, prepare cmd_obj and enqueue */ pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if (pcmdobj == NULL){ rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param)); @@ -1848,14 +1840,14 @@ _func_enter_; } else { - //no need to enqueue, do the cmd hdl directly and free cmd parameter + /* no need to enqueue, do the cmd hdl directly and free cmd parameter */ if ( H2C_SUCCESS !=set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param) ) res = _FAIL; rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param)); } - //do something based on res... + /* do something based on res... */ if (res == _SUCCESS) padapter->mlmepriv.ChannelPlan = chplan; @@ -1976,7 +1968,7 @@ _func_enter_; init_h2fwcmd_w_parm_no_rsp(pcmdobj, TDLSoption, GEN_CMD_CODE(_TDLS)); res = rtw_enqueue_cmd(pcmdpriv, pcmdobj); -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ exit: @@ -1999,11 +1991,11 @@ static void traffic_status_watchdog(_adapter *padapter) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &(padapter->tdlsinfo); -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ - // - // Determine if our traffic is busy now - // + /* */ + /* Determine if our traffic is busy now */ + /* */ if ((check_fwstate(pmlmepriv, _FW_LINKED)== true) /*&& !MgntInitAdapterInProgress(pMgntInfo)*/) { @@ -2011,10 +2003,10 @@ static void traffic_status_watchdog(_adapter *padapter) #ifdef CONFIG_BT_COEXIST if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 50 || pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 50 ) -#else // !CONFIG_BT_COEXIST +#else /* !CONFIG_BT_COEXIST */ if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 100 || pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 100 ) -#endif // !CONFIG_BT_COEXIST +#endif /* !CONFIG_BT_COEXIST */ { bBusyTraffic = true; @@ -2024,7 +2016,7 @@ static void traffic_status_watchdog(_adapter *padapter) bTxBusyTraffic = true; } - // Higher Tx/Rx data. + /* Higher Tx/Rx data. */ if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 || pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000 ) { @@ -2050,26 +2042,26 @@ static void traffic_status_watchdog(_adapter *padapter) pmlmepriv->ftp_lock_flag = 0; rtw_unlock_suspend(); } -#endif //CONFIG_KEEP_FTP_TRANSMIT +#endif /* CONFIG_KEEP_FTP_TRANSMIT */ #ifdef CONFIG_TDLS #ifdef CONFIG_TDLS_AUTOSETUP - if ( ( ptdlsinfo->watchdog_count % TDLS_WATCHDOG_PERIOD ) == 0 ) //10 * 2sec, periodically sending + if ( ( ptdlsinfo->watchdog_count % TDLS_WATCHDOG_PERIOD ) == 0 ) /* 10 * 2sec, periodically sending */ issue_tdls_dis_req( padapter, NULL ); ptdlsinfo->watchdog_count++; -#endif //CONFIG_TDLS_AUTOSETUP -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS_AUTOSETUP */ +#endif /* CONFIG_TDLS */ #ifdef CONFIG_LPS #ifdef CONFIG_BT_COEXIST if (BT_1Ant(padapter) == false) #endif { - // check traffic for powersaving. + /* check traffic for powersaving. */ if ( ((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8 ) || (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2) ) { - //DBG_88E("Tx = %d, Rx = %d\n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); + /* DBG_88E("Tx = %d, Rx = %d\n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); */ bEnterPS= false; } else @@ -2077,7 +2069,7 @@ static void traffic_status_watchdog(_adapter *padapter) bEnterPS= true; } - // LeisurePS only work in infra mode. + /* LeisurePS only work in infra mode. */ if (bEnterPS) { LPS_Enter(padapter); @@ -2087,7 +2079,7 @@ static void traffic_status_watchdog(_adapter *padapter) LPS_Leave(padapter); } } -#endif // CONFIG_LPS +#endif /* CONFIG_LPS */ } else { @@ -2122,13 +2114,13 @@ void dynamic_chk_wk_hdl(_adapter *padapter, u8 *pbuf, int sz) expire_timeout_chk(padapter); } #endif -#endif //CONFIG_ACTIVE_KEEP_ALIVE_CHECK +#endif /* CONFIG_ACTIVE_KEEP_ALIVE_CHECK */ #ifdef DBG_CONFIG_ERROR_DETECT rtw_hal_sreset_xmit_status_check(padapter); #endif - //if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)==false) + /* if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)==false) */ { linked_status_chk(padapter); traffic_status_watchdog(padapter); @@ -2136,12 +2128,12 @@ void dynamic_chk_wk_hdl(_adapter *padapter, u8 *pbuf, int sz) rtw_hal_dm_watchdog(padapter); - //check_hw_pbc(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size); + /* check_hw_pbc(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size); */ #ifdef CONFIG_BT_COEXIST - // - // BT-Coexist - // + /* */ + /* BT-Coexist */ + /* */ BT_CoexistMechanism(padapter); #endif } @@ -2166,26 +2158,26 @@ _func_enter_; switch (lps_ctrl_type) { case LPS_CTRL_SCAN: - //DBG_88E("LPS_CTRL_SCAN\n"); + /* DBG_88E("LPS_CTRL_SCAN\n"); */ #ifdef CONFIG_BT_COEXIST BT_WifiScanNotify(padapter, true); if (BT_1Ant(padapter) == false) #endif { if (check_fwstate(pmlmepriv, _FW_LINKED) == true) - { //connect + { /* connect */ LPS_Leave(padapter); } } break; case LPS_CTRL_JOINBSS: - //DBG_88E("LPS_CTRL_JOINBSS\n"); + /* DBG_88E("LPS_CTRL_JOINBSS\n"); */ LPS_Leave(padapter); break; case LPS_CTRL_CONNECT: - //DBG_88E("LPS_CTRL_CONNECT\n"); - mstatus = 1;//connect - // Reset LPS Setting + /* DBG_88E("LPS_CTRL_CONNECT\n"); */ + mstatus = 1;/* connect */ + /* Reset LPS Setting */ padapter->pwrctrlpriv.LpsIdleCount = 0; rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_JOINBSSRPT, (u8 *)(&mstatus)); #ifdef CONFIG_BT_COEXIST @@ -2193,8 +2185,8 @@ _func_enter_; #endif break; case LPS_CTRL_DISCONNECT: - //DBG_88E("LPS_CTRL_DISCONNECT\n"); - mstatus = 0;//disconnect + /* DBG_88E("LPS_CTRL_DISCONNECT\n"); */ + mstatus = 0;/* disconnect */ #ifdef CONFIG_BT_COEXIST BT_WifiMediaStatusNotify(padapter, mstatus); if (BT_1Ant(padapter) == false) @@ -2205,7 +2197,7 @@ _func_enter_; rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_JOINBSSRPT, (u8 *)(&mstatus)); break; case LPS_CTRL_SPECIAL_PACKET: - //DBG_88E("LPS_CTRL_SPECIAL_PACKET\n"); + /* DBG_88E("LPS_CTRL_SPECIAL_PACKET\n"); */ pwrpriv->DelayLPSLastTimeStamp = rtw_get_current_time(); #ifdef CONFIG_BT_COEXIST BT_SpecialPacketNotify(padapter); @@ -2216,7 +2208,7 @@ _func_enter_; } break; case LPS_CTRL_LEAVE: - //DBG_88E("LPS_CTRL_LEAVE\n"); + /* DBG_88E("LPS_CTRL_LEAVE\n"); */ #ifdef CONFIG_BT_COEXIST BT_LpsLeave(padapter); if (BT_1Ant(padapter) == false) @@ -2238,13 +2230,13 @@ u8 rtw_lps_ctrl_wk_cmd(_adapter*padapter, u8 lps_ctrl_type, u8 enqueue) struct cmd_obj *ph2c; struct drvextra_cmd_parm *pdrvextra_cmd_parm; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - //struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv; + /* struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv; */ u8 res = _SUCCESS; _func_enter_; - //if (!pwrctrlpriv->bLeisurePs) - // return res; + /* if (!pwrctrlpriv->bLeisurePs) */ + /* return res; */ if (enqueue) { @@ -2415,8 +2407,8 @@ _func_enter_; } pdrvextra_cmd_parm->ec_id = P2P_PROTO_WK_CID; - pdrvextra_cmd_parm->type_size = intCmdType; // As the command tppe. - pdrvextra_cmd_parm->pbuf = NULL; // Must be NULL here + pdrvextra_cmd_parm->type_size = intCmdType; /* As the command tppe. */ + pdrvextra_cmd_parm->pbuf = NULL; /* Must be NULL here */ init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); @@ -2429,7 +2421,7 @@ _func_exit_; return res; } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ u8 rtw_ps_cmd(_adapter*padapter) { @@ -2488,8 +2480,8 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter) { u8 val = 0; - //while ((rtw_read32(padapter, 0x414)&0x00ffff00)!=0) - //while ((rtw_read32(padapter, 0x414)&0x0000ff00)!=0) + /* while ((rtw_read32(padapter, 0x414)&0x00ffff00)!=0) */ + /* while ((rtw_read32(padapter, 0x414)&0x0000ff00)!=0) */ rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val); @@ -2512,7 +2504,7 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter) update_beacon(padapter, _TIM_IE_, NULL, false); } - else //re check again + else /* re check again */ { rtw_chk_hi_queue_cmd(padapter); } @@ -2694,22 +2686,22 @@ u8 rtw_drvextra_cmd_hdl(_adapter *padapter, unsigned char *pbuf) case P2P_PS_WK_CID: p2p_ps_wk_hdl(padapter, pdrvextra_cmd->type_size); break; -#endif // CONFIG_P2P_PS +#endif /* CONFIG_P2P_PS */ case P2P_PROTO_WK_CID: - // Commented by Albert 2011/07/01 - // I used the type_size as the type command + /* Commented by Albert 2011/07/01 */ + /* I used the type_size as the type command */ p2p_protocol_wk_hdl( padapter, pdrvextra_cmd->type_size ); break; #ifdef CONFIG_AP_MODE case CHECK_HIQ_WK_CID: rtw_chk_hi_queue_hdl(padapter); break; -#endif //CONFIG_AP_MODE +#endif /* CONFIG_AP_MODE */ #ifdef CONFIG_INTEL_WIDI case INTEl_WIDI_WK_CID: intel_widi_wk_hdl(padapter, pdrvextra_cmd->type_size, pdrvextra_cmd->pbuf); break; -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ case C2H_WK_CID: c2h_evt_hdl(padapter, (struct c2h_evt_hdr *)pdrvextra_cmd->pbuf, NULL); @@ -2735,8 +2727,8 @@ _func_enter_; if (pcmd->res == H2C_DROPPED) { - //TODO: cancel timer and do timeout handler directly... - //need to make timeout handlerOS independent + /* TODO: cancel timer and do timeout handler directly... */ + /* need to make timeout handlerOS independent */ _set_timer(&pmlmepriv->scan_to_timer, 1); } else if (pcmd->res != H2C_SUCCESS) { @@ -2744,7 +2736,7 @@ _func_enter_; RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n ********Error: MgntActrtw_set_802_11_bssid_LIST_SCAN Fail ************\n\n.")); } - // free cmd + /* free cmd */ rtw_free_cmd_obj(pcmd); _func_exit_; @@ -2767,11 +2759,11 @@ _func_enter_; goto exit; } #ifdef CONFIG_BR_EXT - else //clear bridge database + else /* clear bridge database */ nat25_db_cleanup(padapter); -#endif //CONFIG_BR_EXT +#endif /* CONFIG_BR_EXT */ - // free cmd + /* free cmd */ rtw_free_cmd_obj(pcmd); exit: @@ -2788,8 +2780,8 @@ _func_enter_; if (pcmd->res == H2C_DROPPED) { - //TODO: cancel timer and do timeout handler directly... - //need to make timeout handlerOS independent + /* TODO: cancel timer and do timeout handler directly... */ + /* need to make timeout handlerOS independent */ _set_timer(&pmlmepriv->assoc_timer, 1); } else if (pcmd->res != H2C_SUCCESS) @@ -2824,14 +2816,14 @@ _func_enter_; _cancel_timer(&pmlmepriv->assoc_timer, &timer_cancelled); #ifdef CONFIG_FW_MLMLE - //endian_convert + /* endian_convert */ pnetwork->Length = le32_to_cpu(pnetwork->Length); pnetwork->Ssid.SsidLength = le32_to_cpu(pnetwork->Ssid.SsidLength); pnetwork->Privacy =le32_to_cpu(pnetwork->Privacy); pnetwork->Rssi = le32_to_cpu(pnetwork->Rssi); pnetwork->NetworkTypeInUse =le32_to_cpu(pnetwork->NetworkTypeInUse); pnetwork->Configuration.ATIMWindow = le32_to_cpu(pnetwork->Configuration.ATIMWindow); - //pnetwork->Configuration.BeaconPeriod = le32_to_cpu(pnetwork->Configuration.BeaconPeriod); + /* pnetwork->Configuration.BeaconPeriod = le32_to_cpu(pnetwork->Configuration.BeaconPeriod); */ pnetwork->Configuration.DSConfig =le32_to_cpu(pnetwork->Configuration.DSConfig); pnetwork->Configuration.FHConfig.DwellTime=le32_to_cpu(pnetwork->Configuration.FHConfig.DwellTime); pnetwork->Configuration.FHConfig.HopPattern=le32_to_cpu(pnetwork->Configuration.FHConfig.HopPattern); @@ -2884,20 +2876,20 @@ _func_enter_; pnetwork->Length = get_WLAN_BSSID_EX_sz(pnetwork); _rtw_memcpy(&(pwlan->network), pnetwork, pnetwork->Length); - //pwlan->fixed = true; + /* pwlan->fixed = true; */ - //rtw_list_insert_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue); + /* rtw_list_insert_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue); */ - // copy pdev_network information to pmlmepriv->cur_network + /* copy pdev_network information to pmlmepriv->cur_network */ _rtw_memcpy(&tgt_network->network, pnetwork, (get_WLAN_BSSID_EX_sz(pnetwork))); - // reset DSConfig - //tgt_network->network.Configuration.DSConfig = (u32)rtw_ch2freq(pnetwork->Configuration.DSConfig); + /* reset DSConfig */ + /* tgt_network->network.Configuration.DSConfig = (u32)rtw_ch2freq(pnetwork->Configuration.DSConfig); */ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - // we will set _FW_LINKED when there is one more sat to join us (rtw_stassoc_event_callback) + /* we will set _FW_LINKED when there is one more sat to join us (rtw_stassoc_event_callback) */ } @@ -2927,16 +2919,11 @@ _func_enter_; RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nERROR: rtw_setstaKey_cmdrsp_callback => can't get sta_info\n\n")); goto exit; } - - //psta->aid = psta->mac_id = psetstakey_rsp->keyid; //CAM_ID(CAM_ENTRY) - exit: - rtw_free_cmd_obj(pcmd); - _func_exit_; - } + void rtw_setassocsta_cmdrsp_callback(_adapter* padapter, struct cmd_obj *pcmd) { _irqL irqL; diff --git a/core/rtw_debug.c b/core/rtw_debug.c index 1615a06..0074235 100644 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -277,7 +277,7 @@ int proc_get_ht_option(char *page, char **start, int len = 0; #ifdef CONFIG_80211N_HT len += snprintf(page + len, count - len, "ht_option=%d\n", pmlmepriv->htpriv.ht_option); -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ *eof = 1; return len; } @@ -329,7 +329,7 @@ int proc_get_ap_info(char *page, char **start, len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi); len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable); len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap); -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ for (i=0;i<16;i++) { @@ -532,7 +532,6 @@ int proc_get_rf_reg_dump1(char *page, char **start, len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path); for (i=0;i<0xC0;i++) { - //value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord); value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff); if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i); len += snprintf(page + len, count - len, " 0x%08x ",value); @@ -559,7 +558,6 @@ int proc_get_rf_reg_dump2(char *page, char **start, len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path); for (i=0xC0;i<0x100;i++) { - //value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord); value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff); if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i); len += snprintf(page + len, count - len, " 0x%08x ",value); @@ -585,7 +583,6 @@ int proc_get_rf_reg_dump3(char *page, char **start, len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path); for (i=0;i<0xC0;i++) { - //value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord); value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff); if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i); len += snprintf(page + len, count - len, " 0x%08x ",value); @@ -612,7 +609,6 @@ int proc_get_rf_reg_dump4(char *page, char **start, len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path); for (i=0xC0;i<0x100;i++) { - //value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord); value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff); if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i); len += snprintf(page + len, count - len, " 0x%08x ",value); @@ -825,7 +821,7 @@ int proc_set_ampdu_enable(struct file *file, const char __user *buffer, return count; } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ int proc_get_two_path_rssi(char *page, char **start, off_t offset, int count, @@ -893,7 +889,7 @@ int proc_set_rx_stbc(struct file *file, const char __user *buffer, return count; } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ int proc_get_rssi_disp(char *page, char **start, @@ -977,48 +973,39 @@ int proc_get_all_sta_info(char *page, char **start, plist = get_next(plist); - //if (extra_arg == psta->aid) - { - len += snprintf(page + len, count - len, "sta's macaddr: %pM\n", psta->hwaddr); - len += snprintf(page + len, count - len, "rtsen=%d, cts2slef=%d\n", psta->rtsen, psta->cts2self); - len += snprintf(page + len, count - len, "state=0x%x, aid=%d, macid=%d, raid=%d\n", psta->state, psta->aid, psta->mac_id, psta->raid); + len += snprintf(page + len, count - len, "sta's macaddr: %pM\n", psta->hwaddr); + len += snprintf(page + len, count - len, "rtsen=%d, cts2slef=%d\n", psta->rtsen, psta->cts2self); + len += snprintf(page + len, count - len, "state=0x%x, aid=%d, macid=%d, raid=%d\n", psta->state, psta->aid, psta->mac_id, psta->raid); #ifdef CONFIG_80211N_HT - len += snprintf(page + len, count - len, "qos_en=%d, ht_en=%d, init_rate=%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate); - len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi); - len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable); - len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap); -#endif //CONFIG_80211N_HT - len += snprintf(page + len, count - len, "sleepq_len=%d\n", psta->sleepq_len); - len += snprintf(page + len, count - len, "capability=0x%x\n", psta->capability); - len += snprintf(page + len, count - len, "flags=0x%x\n", psta->flags); - len += snprintf(page + len, count - len, "wpa_psk=0x%x\n", psta->wpa_psk); - len += snprintf(page + len, count - len, "wpa2_group_cipher=0x%x\n", psta->wpa2_group_cipher); - len += snprintf(page + len, count - len, "wpa2_pairwise_cipher=0x%x\n", psta->wpa2_pairwise_cipher); - len += snprintf(page + len, count - len, "qos_info=0x%x\n", psta->qos_info); - len += snprintf(page + len, count - len, "dot118021XPrivacy=0x%x\n", psta->dot118021XPrivacy); + len += snprintf(page + len, count - len, "qos_en=%d, ht_en=%d, init_rate=%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate); + len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi); + len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable); + len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap); +#endif /* CONFIG_80211N_HT */ + len += snprintf(page + len, count - len, "sleepq_len=%d\n", psta->sleepq_len); + len += snprintf(page + len, count - len, "capability=0x%x\n", psta->capability); + len += snprintf(page + len, count - len, "flags=0x%x\n", psta->flags); + len += snprintf(page + len, count - len, "wpa_psk=0x%x\n", psta->wpa_psk); + len += snprintf(page + len, count - len, "wpa2_group_cipher=0x%x\n", psta->wpa2_group_cipher); + len += snprintf(page + len, count - len, "wpa2_pairwise_cipher=0x%x\n", psta->wpa2_pairwise_cipher); + len += snprintf(page + len, count - len, "qos_info=0x%x\n", psta->qos_info); + len += snprintf(page + len, count - len, "dot118021XPrivacy=0x%x\n", psta->dot118021XPrivacy); - for (j=0;j<16;j++) + for (j=0;j<16;j++) + { + preorder_ctrl = &psta->recvreorder_ctrl[j]; + if (preorder_ctrl->enable) { - preorder_ctrl = &psta->recvreorder_ctrl[j]; - if (preorder_ctrl->enable) - { - len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", j, preorder_ctrl->indicate_seq); - } + len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", j, preorder_ctrl->indicate_seq); } - } - } - } - _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); *eof = 1; return len; - } - #endif #ifdef CONFIG_FIND_BEST_CHANNEL @@ -1040,7 +1027,7 @@ int proc_get_best_channel(char *page, char **start, } for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { - // 2.4G + /* 2.4G */ if ( pmlmeext->channel_set[i].ChannelNum == 6 ) { if ( pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_24G].rx_count ) { index_24G = i; @@ -1048,10 +1035,10 @@ int proc_get_best_channel(char *page, char **start, } } - // 5G + /* 5G */ if ( pmlmeext->channel_set[i].ChannelNum >= 36 && pmlmeext->channel_set[i].ChannelNum < 140 ) { - // Find primary channel + /* Find primary channel */ if ( (( pmlmeext->channel_set[i].ChannelNum - 36) % 8 == 0) && (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count) ) { index_5G = i; @@ -1061,14 +1048,14 @@ int proc_get_best_channel(char *page, char **start, if ( pmlmeext->channel_set[i].ChannelNum >= 149 && pmlmeext->channel_set[i].ChannelNum < 165) { - // find primary channel + /* find primary channel */ if ( (( pmlmeext->channel_set[i].ChannelNum - 149) % 8 == 0) && (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count) ) { index_5G = i; best_channel_5G = pmlmeext->channel_set[i].ChannelNum; } } -#if 1 // debug +#if 1 /* debug */ len += snprintf(page + len, count - len, "The rx cnt of channel %3d = %d\n", pmlmeext->channel_set[i].ChannelNum, pmlmeext->channel_set[i].rx_count); #endif diff --git a/core/rtw_efuse.c b/core/rtw_efuse.c index ea32154..1d7de4e 100644 --- a/core/rtw_efuse.c +++ b/core/rtw_efuse.c @@ -44,10 +44,10 @@ u8 fakeBTEfuseInitMap[EFUSE_BT_MAX_MAP_LEN]={0}; u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN]={0}; /*------------------------Define local variable------------------------------*/ -//------------------------------------------------------------------------------ +/* */ #define REG_EFUSE_CTRL 0x0030 -#define EFUSE_CTRL REG_EFUSE_CTRL // E-Fuse Control. -//------------------------------------------------------------------------------ +#define EFUSE_CTRL REG_EFUSE_CTRL /* E-Fuse Control. */ +/* */ bool Efuse_Read1ByteFromFakeContent( @@ -64,7 +64,6 @@ Efuse_Read1ByteFromFakeContent( { return false; } - //DbgPrint("Read fake content, offset = %d\n", Offset); if (fakeEfuseBank == 0) *Value = fakeEfuseContent[Offset]; else @@ -157,24 +156,24 @@ u8 Efuse_CalculateWordCnts(u8 word_en) { u8 word_cnts = 0; - if (!(word_en & BIT(0))) word_cnts++; // 0 : write enable + if (!(word_en & BIT(0))) word_cnts++; /* 0 : write enable */ if (!(word_en & BIT(1))) word_cnts++; if (!(word_en & BIT(2))) word_cnts++; if (!(word_en & BIT(3))) word_cnts++; return word_cnts; } -// -// Description: -// Execute E-Fuse read byte operation. -// Refered from SD1 Richard. -// -// Assumption: -// 1. Boot from E-Fuse and successfully auto-load. -// 2. PASSIVE_LEVEL (USB interface) -// -// Created by Roger, 2008.10.21. -// +/* */ +/* Description: */ +/* Execute E-Fuse read byte operation. */ +/* Refered from SD1 Richard. */ +/* */ +/* Assumption: */ +/* 1. Boot from E-Fuse and successfully auto-load. */ +/* 2. PASSIVE_LEVEL (USB interface) */ +/* */ +/* Created by Roger, 2008.10.21. */ +/* */ void ReadEFuseByte( PADAPTER Adapter, @@ -185,7 +184,6 @@ ReadEFuseByte( u32 value32; u8 readbyte; u16 retry; - //u32 start=rtw_get_current_time(); if (bPseudoTest) { @@ -193,55 +191,53 @@ ReadEFuseByte( return; } - //Write Address + /* Write Address */ rtw_write8(Adapter, EFUSE_CTRL+1, (_offset & 0xff)); readbyte = rtw_read8(Adapter, EFUSE_CTRL+2); rtw_write8(Adapter, EFUSE_CTRL+2, ((_offset >> 8) & 0x03) | (readbyte & 0xfc)); - //Write bit 32 0 + /* Write bit 32 0 */ readbyte = rtw_read8(Adapter, EFUSE_CTRL+3); rtw_write8(Adapter, EFUSE_CTRL+3, (readbyte & 0x7f)); - //Check bit 32 read-ready + /* Check bit 32 read-ready */ retry = 0; value32 = rtw_read32(Adapter, EFUSE_CTRL); - //while (!(((value32 >> 24) & 0xff) & 0x80) && (retry<10)) while (!(((value32 >> 24) & 0xff) & 0x80) && (retry<10000)) { value32 = rtw_read32(Adapter, EFUSE_CTRL); retry++; } - // 20100205 Joseph: Add delay suggested by SD1 Victor. - // This fix the problem that Efuse read error in high temperature condition. - // Designer says that there shall be some delay after ready bit is set, or the - // result will always stay on last data we read. + /* 20100205 Joseph: Add delay suggested by SD1 Victor. */ + /* This fix the problem that Efuse read error in high temperature condition. */ + /* Designer says that there shall be some delay after ready bit is set, or the */ + /* result will always stay on last data we read. */ rtw_udelay_os(50); value32 = rtw_read32(Adapter, EFUSE_CTRL); *pbuf = (u8)(value32 & 0xff); - //DBG_88E("ReadEFuseByte _offset:%08u, in %d ms\n",_offset ,rtw_get_passing_time_ms(start)); } -// -// Description: -// 1. Execute E-Fuse read byte operation according as map offset and -// save to E-Fuse table. -// 2. Refered from SD1 Richard. -// -// Assumption: -// 1. Boot from E-Fuse and successfully auto-load. -// 2. PASSIVE_LEVEL (USB interface) -// -// Created by Roger, 2008.10.21. -// -// 2008/12/12 MH 1. Reorganize code flow and reserve bytes. and add description. -// 2. Add efuse utilization collect. -// 2008/12/22 MH Read Efuse must check if we write section 1 data again!!! Sec1 -// write addr must be after sec5. -// +/* */ +/* Description: */ +/* 1. Execute E-Fuse read byte operation according as map offset and */ +/* save to E-Fuse table. */ +/* 2. Refered from SD1 Richard. */ +/* */ +/* Assumption: */ +/* 1. Boot from E-Fuse and successfully auto-load. */ +/* 2. PASSIVE_LEVEL (USB interface) */ +/* */ +/* Created by Roger, 2008.10.21. */ +/* */ +/* 2008/12/12 MH 1. Reorganize code flow and reserve bytes. and add description. */ +/* 2. Add efuse utilization collect. */ +/* 2008/12/22 MH Read Efuse must check if we write section 1 data again!!! Sec1 */ +/* write addr must be after sec5. */ +/* */ void efuse_ReadEFuse( @@ -306,22 +302,22 @@ EFUSE_Read1Byte( EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI , TYPE_EFUSE_REAL_CONTENT_LEN, (void *)&contentLen, false); - if (Address < contentLen) //E-fuse 512Byte + if (Address < contentLen) /* E-fuse 512Byte */ { - //Write E-fuse Register address bit0~7 + /* Write E-fuse Register address bit0~7 */ temp = Address & 0xFF; rtw_write8(Adapter, EFUSE_CTRL+1, temp); Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2); - //Write E-fuse Register address bit8~9 + /* Write E-fuse Register address bit8~9 */ temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC); rtw_write8(Adapter, EFUSE_CTRL+2, temp); - //Write 0x30[31]=0 + /* Write 0x30[31]=0 */ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3); temp = Bytetemp & 0x7F; rtw_write8(Adapter, EFUSE_CTRL+3, temp); - //Wait Write-ready (0x30[31]=1) + /* Wait Write-ready (0x30[31]=1) */ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3); while (!(Bytetemp & 0x80)) { @@ -374,28 +370,28 @@ EFUSE_Write1Byte( u32 k=0; u16 contentLen=0; - //RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr=%x Data =%x\n", Address, Value)); + /* RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr=%x Data =%x\n", Address, Value)); */ EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI , TYPE_EFUSE_REAL_CONTENT_LEN, (void *)&contentLen, false); - if ( Address < contentLen) //E-fuse 512Byte + if ( Address < contentLen) /* E-fuse 512Byte */ { rtw_write8(Adapter, EFUSE_CTRL, Value); - //Write E-fuse Register address bit0~7 + /* Write E-fuse Register address bit0~7 */ temp = Address & 0xFF; rtw_write8(Adapter, EFUSE_CTRL+1, temp); Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2); - //Write E-fuse Register address bit8~9 + /* Write E-fuse Register address bit8~9 */ temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC); rtw_write8(Adapter, EFUSE_CTRL+2, temp); - //Write 0x30[31]=1 + /* Write 0x30[31]=1 */ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3); temp = Bytetemp | 0x80; rtw_write8(Adapter, EFUSE_CTRL+3, temp); - //Wait Write-ready (0x30[31]=0) + /* Wait Write-ready (0x30[31]=0) */ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3); while (Bytetemp & 0x80) { @@ -426,13 +422,13 @@ efuse_OneByteRead( bResult = Efuse_Read1ByteFromFakeContent(pAdapter, addr, data); return bResult; } - // -----------------e-fuse reg ctrl --------------------------------- - //address + /* -----------------e-fuse reg ctrl --------------------------------- */ + /* address */ rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff)); rtw_write8(pAdapter, EFUSE_CTRL+2, ((u8)((addr>>8) &0x03) ) | (rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC )); - rtw_write8(pAdapter, EFUSE_CTRL+3, 0x72);//read cmd + rtw_write8(pAdapter, EFUSE_CTRL+3, 0x72);/* read cmd */ while (!(0x80 &rtw_read8(pAdapter, EFUSE_CTRL+3))&&(tmpidx<100)) { @@ -467,18 +463,18 @@ efuse_OneByteWrite( bResult = Efuse_Write1ByteToFakeContent(pAdapter, addr, data); return bResult; } - //RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr = %x Data=%x\n", addr, data)); + /* RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr = %x Data=%x\n", addr, data)); */ - //return 0; + /* return 0; */ - // -----------------e-fuse reg ctrl --------------------------------- - //address + /* -----------------e-fuse reg ctrl --------------------------------- */ + /* address */ rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff)); rtw_write8(pAdapter, EFUSE_CTRL+2, (rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC )|(u8)((addr>>8)&0x03) ); - rtw_write8(pAdapter, EFUSE_CTRL, data);//data + rtw_write8(pAdapter, EFUSE_CTRL, data);/* data */ - rtw_write8(pAdapter, EFUSE_CTRL+3, 0xF2);//write cmd + rtw_write8(pAdapter, EFUSE_CTRL+3, 0xF2);/* write cmd */ while ((0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx<100) ){ tmpidx++; @@ -632,7 +628,7 @@ u8 rtw_efuse_access(PADAPTER padapter, u8 bWrite, u16 start_addr, u16 cnts, u8 * Efuse_PowerSwitch(padapter, bWrite, true); - // e-fuse one byte read / write + /* e-fuse one byte read / write */ for (i = 0; i < cnts; i++) { if (start_addr >= real_content_len) { res = _FAIL; @@ -647,14 +643,14 @@ u8 rtw_efuse_access(PADAPTER padapter, u8 bWrite, u16 start_addr, u16 cnts, u8 * return res; } -//------------------------------------------------------------------------------ +/* */ u16 efuse_GetMaxSize(PADAPTER padapter) { u16 max_size; EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI , TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (void *)&max_size, false); return max_size; } -//------------------------------------------------------------------------------ +/* */ u8 efuse_GetCurrentSize(PADAPTER padapter, u16 *size) { Efuse_PowerSwitch(padapter, false, true); @@ -663,7 +659,7 @@ u8 efuse_GetCurrentSize(PADAPTER padapter, u16 *size) return _SUCCESS; } -//------------------------------------------------------------------------------ +/* */ u8 rtw_efuse_map_read(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) { u16 mapLen=0; @@ -699,7 +695,7 @@ u8 rtw_BT_efuse_map_read(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) return _SUCCESS; } -//------------------------------------------------------------------------------ +/* */ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) { u8 offset, word_en; @@ -727,11 +723,11 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) offset = (addr >> 3); word_en = 0xF; _rtw_memset(newdata, 0xFF, PGPKT_DATA_SIZE); - i = addr & 0x7; // index of one package - idx = 0; // data index + i = addr & 0x7; /* index of one package */ + idx = 0; /* data index */ if (i & 0x1) { - // odd start + /* odd start */ if (data[idx] != map[addr+idx]) { word_en &= ~BIT(i >> 1); newdata[i-1] = map[addr+idx-1]; @@ -791,7 +787,7 @@ exit: return ret; } -//------------------------------------------------------------------------------ +/* */ u8 rtw_BT_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) { u8 offset, word_en; @@ -818,11 +814,11 @@ u8 rtw_BT_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) offset = (addr >> 3); word_en = 0xF; _rtw_memset(newdata, 0xFF, PGPKT_DATA_SIZE); - i = addr & 0x7; // index of one package - idx = 0; // data index + i = addr & 0x7; /* index of one package */ + idx = 0; /* data index */ if (i & 0x1) { - // odd start + /* odd start */ if (data[idx] != map[addr+idx]) { word_en &= ~BIT(i >> 1); newdata[i-1] = map[addr+idx-1]; @@ -955,9 +951,9 @@ efuse_ShadowRead1Byte( *Value = pEEPROM->efuse_eeprom_data[Offset]; -} // EFUSE_ShadowRead1Byte +} /* EFUSE_ShadowRead1Byte */ -//---------------Read Two Bytes +/* Read Two Bytes */ static void efuse_ShadowRead2Byte( PADAPTER pAdapter, @@ -969,9 +965,9 @@ efuse_ShadowRead2Byte( *Value = pEEPROM->efuse_eeprom_data[Offset]; *Value |= pEEPROM->efuse_eeprom_data[Offset+1]<<8; -} // EFUSE_ShadowRead2Byte +} /* EFUSE_ShadowRead2Byte */ -//---------------Read Four Bytes +/* Read Four Bytes */ static void efuse_ShadowRead4Byte( PADAPTER pAdapter, @@ -985,7 +981,7 @@ efuse_ShadowRead4Byte( *Value |= pEEPROM->efuse_eeprom_data[Offset+2]<<16; *Value |= pEEPROM->efuse_eeprom_data[Offset+3]<<24; -} // efuse_ShadowRead4Byte +} /* efuse_ShadowRead4Byte */ /*----------------------------------------------------------------------------- @@ -1012,7 +1008,7 @@ efuse_ShadowWrite1Byte( PADAPTER pAdapter, u16 Offset, u8 Value); -#endif //PLATFORM +#endif /* PLATFORM */ static void efuse_ShadowWrite1Byte( PADAPTER pAdapter, @@ -1023,9 +1019,9 @@ efuse_ShadowWrite1Byte( pEEPROM->efuse_eeprom_data[Offset] = Value; -} // efuse_ShadowWrite1Byte +} /* efuse_ShadowWrite1Byte */ -//---------------Write Two Bytes +/* Write Two Bytes */ static void efuse_ShadowWrite2Byte( PADAPTER pAdapter, @@ -1037,9 +1033,9 @@ efuse_ShadowWrite2Byte( pEEPROM->efuse_eeprom_data[Offset] = Value&0x00FF; pEEPROM->efuse_eeprom_data[Offset+1] = Value>>8; -} // efuse_ShadowWrite1Byte +} /* efuse_ShadowWrite1Byte */ -//---------------Write Four Bytes +/* Write Four Bytes */ static void efuse_ShadowWrite4Byte( PADAPTER pAdapter, @@ -1053,7 +1049,7 @@ efuse_ShadowWrite4Byte( pEEPROM->efuse_eeprom_data[Offset+2] = (u8)((Value>>16)&0x00FF); pEEPROM->efuse_eeprom_data[Offset+3] = (u8)((Value>>24)&0xFF); -} // efuse_ShadowWrite1Byte +} /* efuse_ShadowWrite1Byte */ /*----------------------------------------------------------------------------- * Function: EFUSE_ShadowMapUpdate @@ -1099,9 +1095,9 @@ void EFUSE_ShadowMapUpdate( #endif } - //PlatformMoveMemory((void *)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0], - //(void *)&pHalData->EfuseMap[EFUSE_INIT_MAP][0], mapLen); -}// EFUSE_ShadowMapUpdate + /* PlatformMoveMemory((void *)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0], */ + /* void *)&pHalData->EfuseMap[EFUSE_INIT_MAP][0], mapLen); */ +}/* EFUSE_ShadowMapUpdate */ /*----------------------------------------------------------------------------- @@ -1134,7 +1130,7 @@ EFUSE_ShadowRead( else if (Type == 4) efuse_ShadowRead4Byte(pAdapter, Offset, (u32 *)Value); -} // EFUSE_ShadowRead +} /* EFUSE_ShadowRead */ /*----------------------------------------------------------------------------- * Function: EFUSE_ShadowWrite @@ -1179,7 +1175,7 @@ EFUSE_ShadowWrite( else if (Type == 4) efuse_ShadowWrite4Byte(pAdapter, Offset, (u32)Value); -} // EFUSE_ShadowWrite +} /* EFUSE_ShadowWrite */ void Efuse_InitSomeVar( @@ -1213,7 +1209,7 @@ Efuse_InitSomeVar( #ifdef PLATFORM_LINUX #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE -//#include +/* include */ int isAdaptorInfoFileValid(void) { @@ -1257,5 +1253,5 @@ int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv) } return ret; } -#endif //CONFIG_ADAPTOR_INFO_CACHING_FILE -#endif //PLATFORM_LINUX +#endif /* CONFIG_ADAPTOR_INFO_CACHING_FILE */ +#endif /* PLATFORM_LINUX */ diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 515f963..e18417c 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -47,9 +47,9 @@ u8 RSN_CIPHER_SUITE_TKIP[] = { 0x00, 0x0f, 0xac, 2 }; u8 RSN_CIPHER_SUITE_WRAP[] = { 0x00, 0x0f, 0xac, 3 }; u8 RSN_CIPHER_SUITE_CCMP[] = { 0x00, 0x0f, 0xac, 4 }; u8 RSN_CIPHER_SUITE_WEP104[] = { 0x00, 0x0f, 0xac, 5 }; -//----------------------------------------------------------- -// for adhoc-master to generate ie and provide supported-rate to fw -//----------------------------------------------------------- +/* */ +/* for adhoc-master to generate ie and provide supported-rate to fw */ +/* */ static u8 WIFI_CCKRATES[] = {(IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK), @@ -70,7 +70,7 @@ static u8 WIFI_OFDMRATES[] = int rtw_get_bit_value_from_ieee_value(u8 val) { - unsigned char dot11_rate_table[]={2,4,11,22,12,18,24,36,48,72,96,108,0}; // last element must be zero!! + unsigned char dot11_rate_table[]={2,4,11,22,12,18,24,36,48,72,96,108,0}; /* last element must be zero!! */ int i=0; while (dot11_rate_table[i] != 0) { @@ -124,7 +124,7 @@ int rtw_check_network_type(unsigned char *rate, int ratelen, int channel) else return WIRELESS_11A; } - else // could be pure B, pure G, or B/G + else /* could be pure B, pure G, or B/G */ { if ((rtw_is_cckratesonly_included(rate)) == true) return WIRELESS_11B; @@ -144,14 +144,14 @@ u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *sourc return (pbuf + len); } -// rtw_set_ie will update frame length +/* rtw_set_ie will update frame length */ u8 *rtw_set_ie ( u8 *pbuf, sint index, uint len, u8 *source, - uint *frlen //frame length + uint *frlen /* frame length */ ) { _func_enter_; @@ -300,7 +300,7 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u } else { - cnt+=in_ie[cnt+1]+2; //goto next + cnt+=in_ie[cnt+1]+2; /* goto next */ } } @@ -370,7 +370,7 @@ _func_enter_; case WIRELESS_11G: case WIRELESS_11A: case WIRELESS_11_5N: - case WIRELESS_11A_5N://Todo: no basic rate for ofdm ? + case WIRELESS_11A_5N:/* Todo: no basic rate for ofdm ? */ _rtw_memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN); break; @@ -413,16 +413,16 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv) _func_enter_; - //timestamp will be inserted by hardware + /* timestamp will be inserted by hardware */ sz += 8; ie += sz; - //beacon interval : 2bytes - *(__le16*)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);//BCN_INTERVAL; + /* beacon interval : 2bytes */ + *(__le16*)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);/* BCN_INTERVAL; */ sz += 2; ie += 2; - //capability info + /* capability info */ *(u16*)ie = 0; *(__le16*)ie |= cpu_to_le16(cap_IBSS); @@ -436,10 +436,10 @@ _func_enter_; sz += 2; ie += 2; - //SSID + /* SSID */ ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz); - //supported rates + /* supported rates */ if (pregistrypriv->wireless_mode == WIRELESS_11ABGN) { if (pdev_network->Configuration.DSConfig > 14) @@ -459,18 +459,18 @@ _func_enter_; if (rateLen > 8) { ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, 8, pdev_network->SupportedRates, &sz); - //ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz); + /* ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz); */ } else { ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, rateLen, pdev_network->SupportedRates, &sz); } - //DS parameter set + /* DS parameter set */ ie = rtw_set_ie(ie, _DSSET_IE_, 1, (u8 *)&(pdev_network->Configuration.DSConfig), &sz); - //IBSS Parameter Set + /* IBSS Parameter Set */ ie = rtw_set_ie(ie, _IBSS_PARA_IE_, 2, (u8 *)&(pdev_network->Configuration.ATIMWindow), &sz); @@ -480,22 +480,19 @@ _func_enter_; } #ifdef CONFIG_80211N_HT - //HT Cap. + /* HT Cap. */ if (((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N)) && (pregistrypriv->ht_enable==true)) { - //todo: + /* todo: */ } -#endif //CONFIG_80211N_HT - - //pdev_network->IELength = sz; //update IELength +#endif /* CONFIG_80211N_HT */ _func_exit_; - //return _SUCCESS; + /* return _SUCCESS; */ return sz; - } unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit) @@ -513,13 +510,13 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit) if (pbuf) { - //check if oui matches... + /* check if oui matches... */ if (_rtw_memcmp((pbuf + 2), wpa_oui_type, sizeof (wpa_oui_type)) == false) { goto check_next_ie; } - //check version... + /* check version... */ _rtw_memcpy((u8 *)&le_tmp, (pbuf + 6), sizeof(val16)); val16 = le16_to_cpu(le_tmp); @@ -619,7 +616,7 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis left = wpa_ie_len - 8; - //group_cipher + /* group_cipher */ if (left >= WPA_SELECTOR_LEN) { *group_cipher = rtw_get_wpa_cipher_suite(pos); @@ -636,10 +633,10 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis } - //pairwise_cipher + /* pairwise_cipher */ if (left >= 2) { - //count = le16_to_cpu(*(u16*)pos); + /* count = le16_to_cpu(*(u16*)pos); */ count = RTW_GET_LE16(pos); pos += 2; left -= 2; @@ -701,7 +698,7 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi pos += 4; left = rsn_ie_len - 4; - //group_cipher + /* group_cipher */ if (left >= RSN_SELECTOR_LEN) { *group_cipher = rtw_get_wpa2_cipher_suite(pos); @@ -714,10 +711,10 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi return _FAIL; } - //pairwise_cipher + /* pairwise_cipher */ if (left >= 2) { - //count = le16_to_cpu(*(u16*)pos); + /* count = le16_to_cpu(*(u16*)pos); */ count = RTW_GET_LE16(pos); pos += 2; left -= 2; @@ -772,7 +769,7 @@ _func_enter_; { authmode=in_ie[cnt]; - //if (authmode==_WAPI_IE_) + /* if (authmode==_WAPI_IE_) */ if (authmode==_WAPI_IE_ && (_rtw_memcmp(&in_ie[cnt+6], wapi_oui1,4)==true || _rtw_memcmp(&in_ie[cnt+6], wapi_oui2,4)==true)) { @@ -787,11 +784,11 @@ _func_enter_; } *wapi_len=in_ie[cnt+1]+2; - cnt+=in_ie[cnt+1]+2; //get next + cnt+=in_ie[cnt+1]+2; /* get next */ } else { - cnt+=in_ie[cnt+1]+2; //get next + cnt+=in_ie[cnt+1]+2; /* get next */ } } @@ -810,7 +807,7 @@ int rtw_get_sec_ie(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16 _func_enter_; - //Search required WPA or WPA2 IE and copy to sec_ie[ ] + /* Search required WPA or WPA2 IE and copy to sec_ie[ ] */ cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_); @@ -835,7 +832,7 @@ _func_enter_; } *wpa_len=in_ie[cnt+1]+2; - cnt+=in_ie[cnt+1]+2; //get next + cnt+=in_ie[cnt+1]+2; /* get next */ } else { @@ -854,11 +851,11 @@ _func_enter_; } *rsn_len=in_ie[cnt+1]+2; - cnt+=in_ie[cnt+1]+2; //get next + cnt+=in_ie[cnt+1]+2; /* get next */ } else { - cnt+=in_ie[cnt+1]+2; //get next + cnt+=in_ie[cnt+1]+2; /* get next */ } } @@ -881,7 +878,7 @@ u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen) if ((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&ie_ptr[2], wps_oui, 4)==true)) { - //DBG_88E("==> found WPS_IE.....\n"); + /* DBG_88E("==> found WPS_IE.....\n"); */ *wps_ielen = ie_ptr[1]+2; match=true; } @@ -931,7 +928,7 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen) } else { - cnt+=in_ie[cnt+1]+2; //goto next + cnt+=in_ie[cnt+1]+2; /* goto next */ } } @@ -964,17 +961,17 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att return attr_ptr; } - // 6 = 1(Element ID) + 1(Length) + 4(WPS OUI) - attr_ptr = wps_ie + 6; //goto first attr + /* 6 = 1(Element ID) + 1(Length) + 4(WPS OUI) */ + attr_ptr = wps_ie + 6; /* goto first attr */ while (attr_ptr - wps_ie < wps_ielen) { - // 4 = 2(Attribute ID) + 2(Length) + /* 4 = 2(Attribute ID) + 2(Length) */ u16 attr_id = RTW_GET_BE16(attr_ptr); u16 attr_data_len = RTW_GET_BE16(attr_ptr + 2); u16 attr_len = attr_data_len + 4; - //DBG_88E("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len); + /* DBG_88E("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len); */ if ( attr_id == target_attr_id ) { target_attr_ptr = attr_ptr; @@ -989,7 +986,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att } else { - attr_ptr += attr_len; //goto next + attr_ptr += attr_len; /* goto next */ } } @@ -1291,7 +1288,7 @@ void rtw_macaddr_cfg(u8 *mac_addr) if (mac_addr == NULL) return; if ( rtw_initmac ) - { // Users specify the mac address + { /* Users specify the mac address */ int jj,kk; for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) @@ -1301,7 +1298,7 @@ void rtw_macaddr_cfg(u8 *mac_addr) _rtw_memcpy(mac_addr, mac, ETH_ALEN); } else - { // Use the mac address stored in the Efuse + { /* Use the mac address stored in the Efuse */ _rtw_memcpy(mac, mac_addr, ETH_ALEN); } @@ -1316,7 +1313,7 @@ void rtw_macaddr_cfg(u8 *mac_addr) mac[3] = 0x87; mac[4] = 0x00; mac[5] = 0x00; - // use default mac addresss + /* use default mac addresss */ _rtw_memcpy(mac_addr, mac, ETH_ALEN); DBG_88E("MAC Address from efuse error, assign default one !!!\n"); } @@ -1436,7 +1433,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen) } else { - cnt += in_ie[ cnt + 1 ] +2; //goto next + cnt += in_ie[ cnt + 1 ] +2; /* goto next */ } } @@ -1470,17 +1467,17 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr return attr_ptr; } - // 6 = 1(Element ID) + 1(Length) + 3 (OUI) + 1(OUI Type) - attr_ptr = p2p_ie + 6; //goto first attr + /* 6 = 1(Element ID) + 1(Length) + 3 (OUI) + 1(OUI Type) */ + attr_ptr = p2p_ie + 6; /* goto first attr */ while (attr_ptr - p2p_ie < p2p_ielen) { - // 3 = 1(Attribute ID) + 2(Length) + /* 3 = 1(Attribute ID) + 2(Length) */ u8 attr_id = *attr_ptr; u16 attr_data_len = RTW_GET_LE16(attr_ptr + 1); u16 attr_len = attr_data_len + 3; - //DBG_88E("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len); + /* DBG_88E("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len); */ if ( attr_id == target_attr_id ) { target_attr_ptr = attr_ptr; @@ -1495,7 +1492,7 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr } else { - attr_ptr += attr_len; //goto next + attr_ptr += attr_len; /* goto next */ } } @@ -1543,7 +1540,7 @@ u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr) *pbuf = attr_id; - //*(u16*)(pbuf + 1) = cpu_to_le16(attr_len); + /* u16*)(pbuf + 1) = cpu_to_le16(attr_len); */ RTW_PUT_LE16(pbuf + 1, attr_len); if (pdata_attr) @@ -1605,7 +1602,7 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id) } } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ #ifdef CONFIG_WFD int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen) @@ -1653,7 +1650,7 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen) } else { - cnt += in_ie[ cnt + 1 ] +2; //goto next + cnt += in_ie[ cnt + 1 ] +2; /* goto next */ } } @@ -1667,8 +1664,8 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen) } -// attr_content: The output buffer, contains the "body field" of WFD attribute. -// attr_contentlen: The data length of the "body field" of WFD attribute. +/* attr_content: The output buffer, contains the "body field" of WFD attribute. */ +/* attr_contentlen: The data length of the "body field" of WFD attribute. */ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *attr_content, uint *attr_contentlen) { int match; @@ -1684,7 +1681,7 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 * return( match ); } - // 1 ( WFD IE ) + 1 ( Length ) + 3 ( OUI ) + 1 ( OUI Type ) + /* 1 ( WFD IE ) + 1 ( Length ) + 3 ( OUI ) + 1 ( OUI Type ) */ cnt = 6; while ( cnt < wfd_ielen ) { @@ -1693,7 +1690,7 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 * attr_id = wfd_ie[cnt]; if ( attr_id == target_attr_id ) { - // 3 -> 1 byte for attribute ID field, 2 bytes for length field + /* 3 -> 1 byte for attribute ID field, 2 bytes for length field */ if (attr_content) _rtw_memcpy( attr_content, &wfd_ie[ cnt + 3 ], attrlen ); @@ -1707,7 +1704,7 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 * } else { - cnt += attrlen + 3; //goto next + cnt += attrlen + 3; /* goto next */ } } @@ -1715,9 +1712,9 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 * return match; } -#endif // CONFIG_WFD +#endif /* CONFIG_WFD */ -//Baron adds to avoid FreeBSD warning +/* Baron adds to avoid FreeBSD warning */ int ieee80211_is_empty_essid(const char *essid, int essid_len) { /* Single white space is for Linksys APs */ @@ -1860,7 +1857,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork) } } -//show MCS rate, unit: 100Kbps +/* show MCS rate, unit: 100Kbps */ u16 rtw_mcs_rate(u8 rf_type, u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40, unsigned char * MCS_rate) { u16 max_rate = 0; diff --git a/core/rtw_io.c b/core/rtw_io.c index 9eaf92a..9671efd 100644 --- a/core/rtw_io.c +++ b/core/rtw_io.c @@ -90,7 +90,7 @@ jackson@realtek.com.tw u8 _rtw_read8(_adapter *adapter, u32 addr) { u8 r_val; - //struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; + /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = &(pio_priv->intf); u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr); @@ -104,30 +104,30 @@ u8 _rtw_read8(_adapter *adapter, u32 addr) u16 _rtw_read16(_adapter *adapter, u32 addr) { - __le16 r_val; + u16 r_val; struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = &(pio_priv->intf); - __le16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr); + u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr); _func_enter_; _read16 = pintfhdl->io_ops._read16; r_val = _read16(pintfhdl, addr); _func_exit_; - return rtw_le16_to_cpu(r_val); + return r_val; } u32 _rtw_read32(_adapter *adapter, u32 addr) { - __le32 r_val; + u32 r_val; struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = &(pio_priv->intf); - __le32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr); + u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr); _func_enter_; _read32 = pintfhdl->io_ops._read32; r_val = _read32(pintfhdl, addr); _func_exit_; - return rtw_le32_to_cpu(r_val); + return r_val; } int _rtw_write8(_adapter *adapter, u32 addr, u8 val) @@ -149,14 +149,12 @@ int _rtw_write16(_adapter *adapter, u32 addr, u16 val) { struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = &(pio_priv->intf); - int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, __le16 val); + int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val); int ret; - __le16 ival; _func_enter_; _write16 = pintfhdl->io_ops._write16; - ival = rtw_cpu_to_le16(val); - ret = _write16(pintfhdl, addr, ival); + ret = _write16(pintfhdl, addr, val); _func_exit_; return RTW_STATUS_CODE(ret); @@ -165,14 +163,12 @@ int _rtw_write32(_adapter *adapter, u32 addr, u32 val) { struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = &(pio_priv->intf); - int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, __le32 val); + int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val); int ret; - __le32 ival; _func_enter_; _write32 = pintfhdl->io_ops._write32; - ival = rtw_cpu_to_le32(val); - ret = _write32(pintfhdl, addr, ival); + ret = _write32(pintfhdl, addr, val); _func_exit_; return RTW_STATUS_CODE(ret); @@ -211,14 +207,12 @@ int _rtw_write16_async(_adapter *adapter, u32 addr, u16 val) { struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = &(pio_priv->intf); - int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, __le16 val); + int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, u16 val); int ret; - __le16 ival; _func_enter_; _write16_async = pintfhdl->io_ops._write16_async; - ival = rtw_cpu_to_le16(val); - ret = _write16_async(pintfhdl, addr, ival); + ret = _write16_async(pintfhdl, addr, val); _func_exit_; return RTW_STATUS_CODE(ret); @@ -228,14 +222,12 @@ int _rtw_write32_async(_adapter *adapter, u32 addr, u32 val) { struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = &(pio_priv->intf); - int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, __le32 val); + int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, u32 val); int ret; - __le32 ival; _func_enter_; _write32_async = pintfhdl->io_ops._write32_async; - ival = rtw_cpu_to_le32(val); - ret = _write32_async(pintfhdl, addr, ival); + ret = _write32_async(pintfhdl, addr, val); _func_exit_; return RTW_STATUS_CODE(ret); @@ -266,7 +258,6 @@ void _rtw_read_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) void _rtw_write_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) { void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); - //struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = &(pio_priv->intf); @@ -283,7 +274,6 @@ void _rtw_write_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) void _rtw_read_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) { u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); - //struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = &(pio_priv->intf); @@ -319,7 +309,6 @@ void _rtw_read_port_cancel(_adapter *adapter) u32 _rtw_write_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) { u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); - //struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = &(pio_priv->intf); u32 ret = _SUCCESS; @@ -385,12 +374,9 @@ int rtw_init_io_priv(_adapter *padapter, void (*set_intf_ops)(struct _io_ops *po #ifdef DBG_IO u16 read_sniff_ranges[][2] = { - //{0x550, 0x551}, }; u16 write_sniff_ranges[][2] = { - //{0x550, 0x551}, - //{0x4c, 0x4c}, }; int read_sniff_num = sizeof(read_sniff_ranges)/sizeof(u16)/2; diff --git a/core/rtw_ioctl_query.c b/core/rtw_ioctl_query.c index 1eec388..74ca4b4 100644 --- a/core/rtw_ioctl_query.c +++ b/core/rtw_ioctl_query.c @@ -27,9 +27,9 @@ #ifdef PLATFORM_WINDOWS -// -// Added for WPA2-PSK, by Annie, 2005-09-20. -// +/* */ +/* Added for WPA2-PSK, by Annie, 2005-09-20. */ +/* */ u8 query_802_11_capability( _adapter* Adapter, @@ -67,7 +67,7 @@ query_802_11_capability( pCap->NoOfPMKIDs = NUM_PMKID_CACHE; pCap->NoOfAuthEncryptPairsSupported = ulNumOfPairSupported; - if ( sizeof (szAuthEnc) <= 240 ) // 240 = 256 - 4*4 // SecurityInfo.szCapability: only 256 bytes in size. + if ( sizeof (szAuthEnc) <= 240 ) /* 240 = 256 - 4*4 SecurityInfo.szCapability: only 256 bytes in size. */ { _rtw_memcpy( pucAuthEncryptionSupported, (u8*)szAuthEnc, sizeof (szAuthEnc) ); *pulOutLen = pCap->Length; @@ -90,14 +90,12 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA u8 * pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION); unsigned char i,*auth_ie,*supp_ie; - //NdisZeroMemory(pAssocInfo, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)); _rtw_memset(pAssocInfo, 0, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)); - //pAssocInfo->Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION); - //------------------------------------------------------ - // Association Request related information - //------------------------------------------------------ - // Req_1. AvailableRequestFixedIEs + /* */ + /* Association Request related information */ + /* */ + /* Req_1. AvailableRequestFixedIEs */ if (psecnetwork!=NULL){ pAssocInfo->AvailableRequestFixedIEs |= NDIS_802_11_AI_REQFI_CAPABILITIES|NDIS_802_11_AI_REQFI_CURRENTAPADDRESS; @@ -111,9 +109,9 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA { if (psecuritypriv->ndisauthtype>=Ndis802_11AuthModeWPA2) - pDest[0] =48; //RSN Information Element + pDest[0] =48; /* RSN Information Element */ else - pDest[0] =221; //WPA(SSN) Information Element + pDest[0] =221; /* WPA(SSN) Information Element */ RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n Adapter->ndisauthtype==Ndis802_11AuthModeWPA)?0xdd:0x30 [%d]",pDest[0])); supp_ie=&psecuritypriv->supplicant_ie[0]; @@ -122,7 +120,7 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x\n\n", i,supp_ie[i])); } - i=13; //0~11 is fixed information element + i=13; /* 0~11 is fixed information element */ RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("i= %d tgt_network->network.IELength=%d\n\n", i,(int)psecnetwork->IELength)); while ((iRequestIELength += (2 + supp_ie[1+i]);// (2 + psecnetwork->IEs[1+i]+4); + pAssocInfo->RequestIELength += (2 + supp_ie[1+i]);/* (2 + psecnetwork->IEs[1+i]+4); */ } @@ -151,9 +149,9 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA } - //------------------------------------------------------ - // Association Response related information - //------------------------------------------------------ + /* */ + /* Association Response related information */ + /* */ if (check_fwstate( pmlmepriv, _FW_LINKED)==true) { diff --git a/core/rtw_ioctl_set.c b/core/rtw_ioctl_set.c index 758ae63..e5d6daf 100644 --- a/core/rtw_ioctl_set.c +++ b/core/rtw_ioctl_set.c @@ -62,7 +62,7 @@ _func_enter_; for (i = 0; i < ssid->SsidLength; i++) { - //wifi, printable ascii code must be supported + /* wifi, printable ascii code must be supported */ if (!( (ssid->Ssid[i] >= 0x20) && (ssid->Ssid[i] <= 0x7e) )){ RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("ssid has nonprintabl ascii\n")); ret= false; @@ -108,8 +108,8 @@ _func_enter_; _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); - //when set_ssid/set_bssid for rtw_do_join(), but scanning queue is empty - //we try to issue sitesurvey firstly + /* when set_ssid/set_bssid for rtw_do_join(), but scanning queue is empty */ + /* we try to issue sitesurvey firstly */ if (pmlmepriv->LinkDetectInfo.bBusyTraffic==false #ifdef CONFIG_LAYER2_ROAMING @@ -118,7 +118,7 @@ _func_enter_; ) { RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_do_join(): site survey if scanned_queue is empty\n.")); - // submit site_survey_cmd + /* submit site_survey_cmd */ if (_SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ) { pmlmepriv->to_join = false; RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_do_join(): site survey return error\n.")); @@ -145,9 +145,9 @@ _func_enter_; { if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==true) { - // submit createbss_cmd to change to a ADHOC_MASTER + /* submit createbss_cmd to change to a ADHOC_MASTER */ - //pmlmepriv->lock has been acquired by caller... + /* pmlmepriv->lock has been acquired by caller... */ WLAN_BSSID_EX *pdev_network = &(padapter->registrypriv.dev_network); pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE; @@ -175,11 +175,11 @@ _func_enter_; } else { - // can't associate ; reset under-linking + /* can't associate ; reset under-linking */ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); - //when set_ssid/set_bssid for rtw_do_join(), but there are no desired bss in scanning queue - //we try to issue sitesurvey firstly + /* when set_ssid/set_bssid for rtw_do_join(), but there are no desired bss in scanning queue */ + /* we try to issue sitesurvey firstly */ if (pmlmepriv->LinkDetectInfo.bBusyTraffic==false #ifdef CONFIG_LAYER2_ROAMING || pmlmepriv->to_roaming >0 @@ -234,7 +234,6 @@ u8 rtw_pnp_set_power_sleep(_adapter* padapter) _func_enter_; RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("==>rtw_pnp_set_power_sleep!!!\n")); - //DbgPrint("+rtw_pnp_set_power_sleep\n"); res = rtw_setstandby_cmd(padapter, 1); @@ -256,12 +255,11 @@ _func_enter_; break; } - // SecClearAllKeys(Adapter); - // 8711 CAM was not for En/Decrypt only - // so, we can't clear all keys. - // should we disable WPAcfg (ox0088) bit 1-2, instead of clear all CAM + /* 8711 CAM was not for En/Decrypt only */ + /* so, we can't clear all keys. */ + /* should we disable WPAcfg (ox0088) bit 1-2, instead of clear all CAM */ - //TO DO... + /* TO DO... */ _func_exit_; @@ -341,7 +339,7 @@ _func_enter_; if (_rtw_memcmp(&pmlmepriv->cur_network.network.MacAddress, bssid, ETH_ALEN) == true) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) - goto release_mlme_lock;//it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. + goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ } else { RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("Set BSSID not the same bssid\n")); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("set_bssid=%pM\n", (bssid) )); @@ -362,7 +360,7 @@ _func_enter_; } handle_tkip_countermeasure: - //should we add something here...? + /* should we add something here...? */ #ifdef PLATFORM_LINUX if (padapter->securitypriv.btkip_countermeasure == true) { @@ -449,7 +447,7 @@ _func_enter_; if (rtw_is_same_ibss(padapter, pnetwork) == false) { - //if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again + /* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */ rtw_disassoc_cmd(padapter, 0, true); if (check_fwstate(pmlmepriv, _FW_LINKED) == true) @@ -464,7 +462,7 @@ _func_enter_; } else { - goto release_mlme_lock;//it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. + goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ } } #ifdef CONFIG_LPS @@ -501,19 +499,19 @@ handle_tkip_countermeasure: u32 diff_time,cur_time ; RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid:padapter->securitypriv.btkip_countermeasure==true\n")); NdisGetCurrentSystemTime(&sys_time); - cur_time=(u32)(sys_time.QuadPart/10); // In micro-second. + cur_time=(u32)(sys_time.QuadPart/10); /* In micro-second. */ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid:cur_time=0x%x\n",cur_time)); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid:psecuritypriv->last_mic_err_time=0x%x\n",padapter->securitypriv.btkip_countermeasure_time)); - diff_time = cur_time -padapter->securitypriv.btkip_countermeasure_time; // In micro-second. + diff_time = cur_time -padapter->securitypriv.btkip_countermeasure_time; /* In micro-second. */ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid:diff_time=0x%x\n",diff_time)); if (diff_time > 60000000) { RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid(): countermeasure time >60s.\n")); padapter->securitypriv.btkip_countermeasure=false; - // Update MIC error time. + /* Update MIC error time. */ padapter->securitypriv.btkip_countermeasure_time=0; } else { - // can't join in 60 seconds. + /* can't join in 60 seconds. */ status = _FAIL; RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid(): countermeasure time <60s.\n")); goto release_mlme_lock; @@ -587,11 +585,11 @@ _func_enter_; _enter_critical_bh(&pmlmepriv->lock, &irqL); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,(" change mode!")); - //DBG_88E("change mode, old_mode=%d, new_mode=%d, fw_state=0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); + /* DBG_88E("change mode, old_mode=%d, new_mode=%d, fw_state=0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); */ if (*pold_state==Ndis802_11APMode) { - //change to other mode from Ndis802_11APMode + /* change to other mode from Ndis802_11APMode */ cur_network->join_res = -1; #ifdef CONFIG_NATIVEAP_MLME @@ -610,7 +608,7 @@ _func_enter_; { if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { - rtw_indicate_disconnect(padapter); //will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not + rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not */ } } @@ -632,7 +630,6 @@ _func_enter_; set_fwstate(pmlmepriv, WIFI_AP_STATE); #ifdef CONFIG_NATIVEAP_MLME start_ap_mode(padapter); - //rtw_indicate_connect(padapter); #endif break; @@ -641,12 +638,6 @@ _func_enter_; case Ndis802_11InfrastructureMax: break; } - - //SecClearAllKeys(adapter); - - //RT_TRACE(COMP_OID_SET, DBG_LOUD, ("set_infrastructure: fw_state:%x after changing mode\n", - // get_fwstate(pmlmepriv) )); - _exit_critical_bh(&pmlmepriv->lock, &irqL); } @@ -705,7 +696,7 @@ _func_enter_; if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true) || (pmlmepriv->LinkDetectInfo.bBusyTraffic == true)) { - // Scan or linking is in progress, do nothing. + /* Scan or linking is in progress, do nothing. */ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_bssid_list_scan fail since fw_state = %x\n", get_fwstate(pmlmepriv))); res = true; @@ -876,15 +867,15 @@ u8 rtw_set_802_11_add_key(_adapter* padapter, NDIS_802_11_KEY *key){ u8 * pbssid; struct sta_info *stainfo; u8 bgroup = false; - u8 bgrouptkey = false;//can be remove later + u8 bgrouptkey = false;/* can be remove later */ u8 ret=_SUCCESS; _func_enter_; if (((key->KeyIndex & 0x80000000) == 0) && ((key->KeyIndex & 0x40000000) > 0)){ - // It is invalid to clear bit 31 and set bit 30. If the miniport driver encounters this combination, - // it must fail the request and return NDIS_STATUS_INVALID_DATA. + /* It is invalid to clear bit 31 and set bit 30. If the miniport driver encounters this combination, */ + /* it must fail the request and return NDIS_STATUS_INVALID_DATA. */ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_key: ((key->KeyIndex & 0x80000000) == 0)[=%d] ",(int)(key->KeyIndex & 0x80000000) == 0)); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_key:((key->KeyIndex & 0x40000000) > 0)[=%d]" , (int)(key->KeyIndex & 0x40000000) > 0)); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_key: key->KeyIndex=%d\n" ,(int)key->KeyIndex)); @@ -894,7 +885,7 @@ _func_enter_; if (key->KeyIndex & 0x40000000) { - // Pairwise key + /* Pairwise key */ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ Pairwise key +++++\n")); @@ -919,15 +910,15 @@ _func_enter_; } if (key->KeyIndex & 0x000000FF){ - // The key index is specified in the lower 8 bits by values of zero to 255. - // The key index should be set to zero for a Pairwise key, and the driver should fail with - // NDIS_STATUS_INVALID_DATA if the lower 8 bits is not zero + /* The key index is specified in the lower 8 bits by values of zero to 255. */ + /* The key index should be set to zero for a Pairwise key, and the driver should fail with */ + /* NDIS_STATUS_INVALID_DATA if the lower 8 bits is not zero */ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" key->KeyIndex & 0x000000FF.\n")); ret= _FAIL; goto exit; } - // check BSSID + /* check BSSID */ if (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == true){ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("MacAddr_isBcst(key->BSSID)\n")); @@ -935,8 +926,7 @@ _func_enter_; goto exit; } - // Check key length for TKIP. - //if (encryptionAlgorithm == RT_ENC_TKIP_ENCRYPTION && key->KeyLength != 32) + /* Check key length for TKIP. */ if ((encryptionalgo== _TKIP_)&& (key->KeyLength != 32)){ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("TKIP KeyLength:0x%x != 32\n", key->KeyLength)); ret=_FAIL; @@ -944,9 +934,9 @@ _func_enter_; } - // Check key length for AES. + /* Check key length for AES. */ if ((encryptionalgo== _AES_)&& (key->KeyLength != 16)) { - // For our supplicant, EAPPkt9x.vxd, cannot differentiate TKIP and AES case. + /* For our supplicant, EAPPkt9x.vxd, cannot differentiate TKIP and AES case. */ if (key->KeyLength == 32) { key->KeyLength = 16; } else { @@ -955,7 +945,7 @@ _func_enter_; } } - // Check key length for WEP. For NDTEST, 2005.01.27, by rcnjko. + /* Check key length for WEP. For NDTEST, 2005.01.27, by rcnjko. */ if ( (encryptionalgo== _WEP40_|| encryptionalgo== _WEP104_) && (key->KeyLength != 5 || key->KeyLength != 13)) { RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("WEP KeyLength:0x%x != 5 or 13\n", key->KeyLength)); ret=_FAIL; @@ -964,7 +954,7 @@ _func_enter_; bgroup = false; - // Check the pairwise key. Added by Annie, 2005-07-06. + /* Check the pairwise key. Added by Annie, 2005-07-06. */ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n")); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("[Pairwise Key set]\n")); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n")); @@ -975,11 +965,11 @@ _func_enter_; } else { - // Group key - KeyIndex(BIT30==0) + /* Group key - KeyIndex(BIT30==0) */ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ Group key +++++\n")); - // when add wep key through add key and didn't assigned encryption type before + /* when add wep key through add key and didn't assigned encryption type before */ if ((padapter->securitypriv.ndisauthtype<=3)&&(padapter->securitypriv.dot118021XGrpPrivacy==0)) { RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("keylen=%d( Adapter->securitypriv.dot11PrivacyAlgrthm=%x )padapter->securitypriv.dot118021XGrpPrivacy(%x)\n", key->KeyLength,padapter->securitypriv.dot11PrivacyAlgrthm,padapter->securitypriv.dot118021XGrpPrivacy)); @@ -1018,7 +1008,7 @@ _func_enter_; goto exit; } - // Check key length for TKIP + /* Check key length for TKIP */ if ((encryptionalgo== _TKIP_) && (key->KeyLength != 32)) { RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" TKIP GTK KeyLength:%u != 32\n", key->KeyLength)); @@ -1027,20 +1017,20 @@ _func_enter_; } else if (encryptionalgo== _AES_ && (key->KeyLength != 16 && key->KeyLength != 32) ) { - // Check key length for AES - // For NDTEST, we allow keylen=32 in this case. 2005.01.27, by rcnjko. + /* Check key length for AES */ + /* For NDTEST, we allow keylen=32 in this case. 2005.01.27, by rcnjko. */ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("<=== SetInfo, OID_802_11_ADD_KEY: AES GTK KeyLength:%u != 16 or 32\n", key->KeyLength)); ret= _FAIL; goto exit; } - // Change the key length for EAPPkt9x.vxd. Added by Annie, 2005-11-03. + /* Change the key length for EAPPkt9x.vxd. Added by Annie, 2005-11-03. */ if ((encryptionalgo== _AES_) && (key->KeyLength == 32) ) { key->KeyLength = 16; RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("AES key length changed: %u\n", key->KeyLength) ); } - if (key->KeyIndex & 0x8000000) {//error ??? 0x8000_0000 + if (key->KeyIndex & 0x8000000) {/* error ??? 0x8000_0000 */ bgrouptkey = true; } @@ -1060,7 +1050,7 @@ _func_enter_; } - // If WEP encryption algorithm, just call rtw_set_802_11_add_wep(). + /* If WEP encryption algorithm, just call rtw_set_802_11_add_wep(). */ if ((padapter->securitypriv.dot11AuthAlgrthm !=dot11AuthAlgrthm_8021X)&&(encryptionalgo== _WEP40_ || encryptionalgo== _WEP104_)) { u32 keyindex; @@ -1089,7 +1079,7 @@ _func_enter_; } if (key->KeyIndex & 0x20000000){ - // SetRSC + /* SetRSC */ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ SetRSC+++++\n")); if (bgroup == true) { @@ -1104,9 +1094,9 @@ _func_enter_; } - // Indicate this key idx is used for TX - // Save the key in KeyMaterial - if (bgroup == true) // Group transmit key + /* Indicate this key idx is used for TX */ + /* Save the key in KeyMaterial */ + if (bgroup == true) /* Group transmit key */ { int res; @@ -1151,7 +1141,7 @@ _func_enter_; } - //set group key by index + /* set group key by index */ _rtw_memcpy(&padapter->securitypriv.dot118021XGrpKey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial, key->KeyLength); key->KeyIndex=key->KeyIndex & 0x03; @@ -1170,7 +1160,7 @@ _func_enter_; goto exit; } - else // Pairwise Key + else /* Pairwise Key */ { u8 res; @@ -1179,7 +1169,7 @@ _func_enter_; if (stainfo!=NULL) { - _rtw_memset( &stainfo->dot118021x_UncstKey, 0, 16);// clear keybuffer + _rtw_memset( &stainfo->dot118021x_UncstKey, 0, 16);/* clear keybuffer */ _rtw_memcpy(&stainfo->dot118021x_UncstKey, key->KeyMaterial, 16); @@ -1187,11 +1177,11 @@ _func_enter_; { padapter->securitypriv.busetkipkey=false; - //_set_timer(&padapter->securitypriv.tkip_timer, 50); + /* _set_timer(&padapter->securitypriv.tkip_timer, 50); */ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n ==========_set_timer\n")); - // if TKIP, save the Receive/Transmit MIC key in KeyMaterial[128-255] + /* if TKIP, save the Receive/Transmit MIC key in KeyMaterial[128-255] */ if ((key->KeyIndex & 0x10000000)){ _rtw_memcpy(&stainfo->dot11tkiptxmickey, key->KeyMaterial + 16, 8); _rtw_memcpy(&stainfo->dot11tkiprxmickey, key->KeyMaterial + 24, 8); @@ -1209,8 +1199,8 @@ _func_enter_; } - //Set key to CAM through H2C command - if (bgrouptkey)//never go to here + /* Set key to CAM through H2C command */ + if (bgrouptkey)/* never go to here */ { res=rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, false); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(group)\n")); @@ -1250,21 +1240,19 @@ _func_enter_; } if (bgroup == true) { - // clear group key by index - //NdisZeroMemory(Adapter->MgntInfo.SecurityInfo.KeyBuf[keyIndex], MAX_WEP_KEY_LEN); - //Adapter->MgntInfo.SecurityInfo.KeyLen[keyIndex] = 0; + /* clear group key by index */ _rtw_memset(&padapter->securitypriv.dot118021XGrpKey[keyIndex], 0, 16); - //! \todo Send a H2C Command to Firmware for removing this Key in CAM Entry. + /* \todo Send a H2C Command to Firmware for removing this Key in CAM Entry. */ } else { pbssid=get_bssid(&padapter->mlmepriv); stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid ); if (stainfo) { - // clear key by BSSID + /* clear key by BSSID */ _rtw_memset(&stainfo->dot118021x_UncstKey, 0, 16); - //! \todo Send a H2C Command to Firmware for disable this Key in CAM Entry. + /* \todo Send a H2C Command to Firmware for disable this Key in CAM Entry. */ } else { ret= _FAIL; goto exit; @@ -1321,11 +1309,9 @@ u16 rtw_get_cur_max_rate(_adapter *adapter) _rtw_memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2); - //bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH) ? 1:0; - //cur_bwmod is updated by beacon, pmlmeinfo is updated by association response + /* cur_bwmod is updated by beacon, pmlmeinfo is updated by association response */ bw_40MHz = (pmlmeext->cur_bwmode && (HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH & pmlmeinfo->HT_info.infos[0])) ? 1:0; - //short_GI = (pht_capie->cap_info&(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1:0; short_GI_20 = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info)&IEEE80211_HT_CAP_SGI_20) ? 1:0; short_GI_40 = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info)&IEEE80211_HT_CAP_SGI_40) ? 1:0; @@ -1340,7 +1326,7 @@ u16 rtw_get_cur_max_rate(_adapter *adapter) } } else -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ { while ( (pcur_bss->SupportedRates[i]!=0) && (pcur_bss->SupportedRates[i]!=0xFF)) { @@ -1385,7 +1371,7 @@ int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan) struct registry_priv *pregistrypriv = &adapter->registrypriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; - //handle by cmd_thread to sync with scan operation + /* handle by cmd_thread to sync with scan operation */ return rtw_set_chplan_cmd(adapter, channel_plan, 1); } @@ -1402,8 +1388,8 @@ int rtw_set_country(_adapter *adapter, const char *country_code) DBG_88E("%s country_code:%s\n", __func__, country_code); - //TODO: should have a table to match country code and RT_CHANNEL_DOMAIN - //TODO: should consider 2-character and 3-character country code + /* TODO: should have a table to match country code and RT_CHANNEL_DOMAIN */ + /* TODO: should consider 2-character and 3-character country code */ if (0 == strcmp(country_code, "US")) channel_plan = RT_CHANNEL_DOMAIN_FCC; else if (0 == strcmp(country_code, "EU")) diff --git a/core/rtw_iol.c b/core/rtw_iol.c index 98a9f3f..4ccfbef 100644 --- a/core/rtw_iol.c +++ b/core/rtw_iol.c @@ -50,7 +50,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter) pattrib = &xmit_frame->attrib; update_mgntframe_attrib(adapter, pattrib); - pattrib->qsel = 0x10;//Beacon + pattrib->qsel = 0x10;/* Beacon */ pattrib->subtype = WIFI_BEACON; pattrib->pktlen = pattrib->last_txcmdsz = 0; @@ -81,7 +81,7 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len buf_offset = TXDESC_OFFSET; ori_len = buf_offset+pattrib->pktlen; - //check if the io_buf can accommodate new cmds + /* check if the io_buf can accommodate new cmds */ if (ori_len + cmd_len + 8 > MAX_XMITBUF_SZ) { DBG_88E("%s %u is large than MAX_XMITBUF_SZ:%u, can't accommodate new cmds\n", __func__ , ori_len + cmd_len + 8, MAX_XMITBUF_SZ); @@ -92,10 +92,9 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len pattrib->pktlen += cmd_len; pattrib->last_txcmdsz += cmd_len; - //DBG_88E("%s ori:%u + cmd_len:%u = %u\n", __func__, ori_len, cmd_len, buf_offset+pattrib->pktlen); - return _SUCCESS; } + bool rtw_IOL_applied(ADAPTER *adapter) { if (1 == adapter->registrypriv.fw_iol) @@ -137,40 +136,31 @@ int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8 { struct ioreg_cfg cmd = {8,IOREG_CMD_WB_REG,0x0, 0x0,0x0}; - //RTW_PUT_LE16((u8*)&cmd.address, addr); - //RTW_PUT_LE32((u8*)&cmd.value, (u32)value); cmd.address = cpu_to_le16(addr); cmd.data = cpu_to_le32(value); if (mask!=0xFF) { cmd.length = 12; - //RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask); cmd.mask = cpu_to_le32(mask); } - //DBG_88E("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __func__, addr,value,mask); - return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length); - } + int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u16 mask) { struct ioreg_cfg cmd = {8,IOREG_CMD_WW_REG,0x0, 0x0,0x0}; - //RTW_PUT_LE16((u8*)&cmd.address, addr); - //RTW_PUT_LE32((u8*)&cmd.value, (u32)value); cmd.address = cpu_to_le16(addr); cmd.data = cpu_to_le32(value); if (mask!=0xFFFF) { cmd.length = 12; - //RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask); cmd.mask = cpu_to_le32(mask); } - //DBG_88E("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __func__, addr,value,mask); return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length); @@ -179,19 +169,15 @@ int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u { struct ioreg_cfg cmd = {8,IOREG_CMD_WD_REG,0x0, 0x0,0x0}; - //RTW_PUT_LE16((u8*)&cmd.address, addr); - //RTW_PUT_LE32((u8*)&cmd.value, (u32)value); cmd.address = cpu_to_le16(addr); cmd.data = cpu_to_le32(value); if (mask!=0xFFFFFFFF) { cmd.length = 12; - //RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask); cmd.mask = cpu_to_le32(mask); } - //DBG_88E("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__, addr,value,mask); return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length); @@ -201,33 +187,23 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, { struct ioreg_cfg cmd = {8,IOREG_CMD_W_RF,0x0, 0x0,0x0}; - //RTW_PUT_LE16((u8*)&cmd.address, addr); - //RTW_PUT_LE32((u8*)&cmd.value, (u32)value); - cmd.address = (rf_path<<8) |((addr) &0xFF); + cmd.address = cpu_to_le16((rf_path<<8) |((addr) &0xFF)); cmd.data = cpu_to_le32(value); - if (mask!=0x000FFFFF) - { + if (mask != 0x000FFFFF) { cmd.length = 12; - //RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask); cmd.mask = cpu_to_le32(mask); } - //DBG_88E("%s rf_path:0x%02x addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__,rf_path, addr,value,mask); return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length); - } - - int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us) { struct ioreg_cfg cmd = {4,IOREG_CMD_DELAY_US,0x0, 0x0,0x0}; - //RTW_PUT_LE16((u8*)&cmd.address, us); cmd.address = cpu_to_le16(us); - //DBG_88E("%s %u\n", __func__, us); return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4); } @@ -235,15 +211,13 @@ int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms) { struct ioreg_cfg cmd = {4,IOREG_CMD_DELAY_US,0x0, 0x0,0x0}; - //RTW_PUT_LE16((u8*)&cmd.address, ms); cmd.address = cpu_to_le16(ms); - //DBG_88E("%s %u\n", __func__, ms); return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4); } int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame) { - struct ioreg_cfg cmd = {4,IOREG_CMD_END,0xFFFF, 0xFF,0x0}; + struct ioreg_cfg cmd = {4, IOREG_CMD_END, cpu_to_le16(0xFFFF), cpu_to_le32(0xFF), 0x0}; return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4); } @@ -255,7 +229,6 @@ u8 rtw_IOL_cmd_boundary_handle(struct xmit_frame *pxmit_frame) rtw_IOL_append_END_cmd(pxmit_frame); pxmit_frame->attrib.pktlen = ((((pxmit_frame->attrib.pktlen+32)/256)+1)*256 ); - //printk("==> %s, pktlen(%d)\n",__func__,pxmit_frame->attrib.pktlen); pxmit_frame->attrib.last_txcmdsz = pxmit_frame->attrib.pktlen; is_cmd_bndy = true; } @@ -278,7 +251,7 @@ void rtw_IOL_cmd_buf_dump(ADAPTER *Adapter,int buf_len,u8 *pbuf) } -#else //CONFIG_IOL_NEW_GENERATION +#else /* CONFIG_IOL_NEW_GENERATION */ int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary) { IOL_CMD cmd = {0x0, IOL_CMD_LLT, 0x0, 0x0}; @@ -351,8 +324,6 @@ int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us) RTW_PUT_BE32((u8*)&cmd.value, (u32)us); - //DBG_88E("%s %u\n", __func__, us); - return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8); } @@ -362,8 +333,6 @@ int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms) RTW_PUT_BE32((u8*)&cmd.value, (u32)ms); - //DBG_88E("%s %u\n", __func__, ms); - return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8); } @@ -394,9 +363,9 @@ int rtw_IOL_exec_empty_cmds_sync(ADAPTER *adapter, u32 max_wating_ms) IOL_CMD end_cmd = {0x0, IOL_CMD_END, 0x0, 0x0}; return rtw_IOL_exec_cmd_array_sync(adapter, (u8*)&end_cmd, 1, max_wating_ms); } -#endif //CONFIG_IOL_NEW_GENERATION +#endif /* CONFIG_IOL_NEW_GENERATION */ -#endif //CONFIG_IOL +#endif /* CONFIG_IOL */ diff --git a/core/rtw_led.c b/core/rtw_led.c index d9e48e1..f256cbe 100644 --- a/core/rtw_led.c +++ b/core/rtw_led.c @@ -21,21 +21,18 @@ #include #include "rtw_led.h" -// -// Description: -// Callback function of LED BlinkTimer, -// it just schedules to corresponding BlinkWorkItem/led_blink_hdl -// +/* */ +/* Description: */ +/* Callback function of LED BlinkTimer, */ +/* it just schedules to corresponding BlinkWorkItem/led_blink_hdl */ +/* */ void BlinkTimerCallback(void *data) { PLED_871x pLed = (PLED_871x)data; _adapter *padapter = pLed->padapter; - //DBG_88E("%s\n", __func__); - if ( (padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true)) { - //DBG_88E("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __func__, padapter->bSurpriseRemoved, padapter->bDriverStopped); return; } @@ -52,11 +49,11 @@ void BlinkTimerCallback(void *data) } #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) -// -// Description: -// Callback function of LED BlinkWorkItem. -// We dispatch acture LED blink action according to LedStrategy. -// +/* */ +/* Description: */ +/* Callback function of LED BlinkWorkItem. */ +/* We dispatch acture LED blink action according to LedStrategy. */ +/* */ void BlinkWorkItemCallback(struct work_struct *work) { PLED_871x pLed = container_of(work, LED_871x, BlinkWorkItem); @@ -64,20 +61,20 @@ void BlinkWorkItemCallback(struct work_struct *work) } #endif -// -// Description: -// Reset status of LED_871x object. -// +/* */ +/* Description: */ +/* Reset status of LED_871x object. */ +/* */ void ResetLedStatus(PLED_871x pLed) { - pLed->CurrLedState = RTW_LED_OFF; // Current LED state. - pLed->bLedOn = false; // true if LED is ON, false if LED is OFF. + pLed->CurrLedState = RTW_LED_OFF; /* Current LED state. */ + pLed->bLedOn = false; /* true if LED is ON, false if LED is OFF. */ - pLed->bLedBlinkInProgress = false; // true if it is blinking, false o.w.. + pLed->bLedBlinkInProgress = false; /* true if it is blinking, false o.w.. */ pLed->bLedWPSBlinkInProgress = false; - pLed->BlinkTimes = 0; // Number of times to toggle led state for blinking. - pLed->BlinkingLedState = LED_UNKNOWN; // Next state for blinking, either RTW_LED_ON or RTW_LED_OFF are. + pLed->BlinkTimes = 0; /* Number of times to toggle led state for blinking. */ + pLed->BlinkingLedState = LED_UNKNOWN; /* Next state for blinking, either RTW_LED_ON or RTW_LED_OFF are. */ #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) pLed->bLedNoLinkBlinkInProgress = false; @@ -87,10 +84,10 @@ void ResetLedStatus(PLED_871x pLed) { #endif } - // -// Description: -// Initialize an LED_871x object. -// + /* */ +/* Description: */ +/* Initialize an LED_871x object. */ +/* */ void InitLed871x( _adapter *padapter, @@ -111,10 +108,10 @@ InitLed871x( } -// -// Description: -// DeInitialize an LED_871x object. -// +/* */ +/* Description: */ +/* DeInitialize an LED_871x object. */ +/* */ void DeInitLed871x( PLED_871x pLed @@ -128,11 +125,11 @@ DeInitLed871x( } -// -// Description: -// Implementation of LED blinking behavior. -// It toggle off LED and schedule corresponding timer if necessary. -// +/* */ +/* Description: */ +/* Implementation of LED blinking behavior. */ +/* It toggle off LED and schedule corresponding timer if necessary. */ +/* */ #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) void SwLedOn(_adapter *padapter, PLED_871x pLed); @@ -149,7 +146,7 @@ SwLedBlink( struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); u8 bStopBlinking = false; - // Change LED according to BlinkingLedState specified. + /* Change LED according to BlinkingLedState specified. */ if ( pLed->BlinkingLedState == RTW_LED_ON ) { SwLedOn(padapter, pLed); @@ -161,7 +158,7 @@ SwLedBlink( RT_TRACE(_module_rtl8712_led_c_,_drv_info_,( "Blinktimes (%d): turn off\n", pLed->BlinkTimes)); } - // Determine if we shall change LED state again. + /* Determine if we shall change LED state again. */ pLed->BlinkTimes--; switch (pLed->CurrLedState) { @@ -205,7 +202,7 @@ SwLedBlink( if (bStopBlinking) { - //if ( padapter->pwrctrlpriv.cpwm >= PS_STATE_S2) + /* if ( padapter->pwrctrlpriv.cpwm >= PS_STATE_S2) */ if (0) { SwLedOff(padapter, pLed); @@ -224,13 +221,13 @@ SwLedBlink( } else { - // Assign LED state to toggle. + /* Assign LED state to toggle. */ if ( pLed->BlinkingLedState == RTW_LED_ON ) pLed->BlinkingLedState = RTW_LED_OFF; else pLed->BlinkingLedState = RTW_LED_ON; - // Schedule a timer to toggle LED state. + /* Schedule a timer to toggle LED state. */ switch ( pLed->CurrLedState ) { case LED_BLINK_NORMAL: @@ -277,7 +274,7 @@ SwLedBlink1( pLed = &(ledpriv->SwLed1); #endif - // Change LED according to BlinkingLedState specified. + /* Change LED according to BlinkingLedState specified. */ if ( pLed->BlinkingLedState == RTW_LED_ON ) { SwLedOn(padapter, pLed); @@ -438,7 +435,7 @@ SwLedBlink1( _set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA); break; - case LED_BLINK_WPS_STOP: //WPS success + case LED_BLINK_WPS_STOP: /* WPS success */ if (pLed->BlinkingLedState == RTW_LED_ON) bStopBlinking = false; else @@ -479,7 +476,7 @@ SwLedBlink2( struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); u8 bStopBlinking = false; - // Change LED according to BlinkingLedState specified. + /* Change LED according to BlinkingLedState specified. */ if ( pLed->BlinkingLedState == RTW_LED_ON) { SwLedOn(padapter, pLed); @@ -601,7 +598,7 @@ SwLedBlink3( struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); u8 bStopBlinking = false; - // Change LED according to BlinkingLedState specified. + /* Change LED according to BlinkingLedState specified. */ if ( pLed->BlinkingLedState == RTW_LED_ON ) { SwLedOn(padapter, pLed); @@ -726,7 +723,7 @@ SwLedBlink3( _set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA); break; - case LED_BLINK_WPS_STOP: //WPS success + case LED_BLINK_WPS_STOP: /* WPS success */ if (pLed->BlinkingLedState == RTW_LED_ON) { pLed->BlinkingLedState = RTW_LED_OFF; @@ -774,7 +771,7 @@ SwLedBlink4( PLED_871x pLed1 = &(ledpriv->SwLed1); u8 bStopBlinking = false; - // Change LED according to BlinkingLedState specified. + /* Change LED according to BlinkingLedState specified. */ if ( pLed->BlinkingLedState == RTW_LED_ON ) { SwLedOn(padapter, pLed); @@ -912,7 +909,7 @@ SwLedBlink4( } break; - case LED_BLINK_WPS_STOP: //WPS authentication fail + case LED_BLINK_WPS_STOP: /* WPS authentication fail */ if ( pLed->bLedOn ) pLed->BlinkingLedState = RTW_LED_OFF; else @@ -921,7 +918,7 @@ SwLedBlink4( _set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL); break; - case LED_BLINK_WPS_STOP_OVERLAP: //WPS session overlap + case LED_BLINK_WPS_STOP_OVERLAP: /* WPS session overlap */ pLed->BlinkTimes--; if (pLed->BlinkTimes == 0) { @@ -971,7 +968,7 @@ SwLedBlink5( struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); u8 bStopBlinking = false; - // Change LED according to BlinkingLedState specified. + /* Change LED according to BlinkingLedState specified. */ if ( pLed->BlinkingLedState == RTW_LED_ON ) { SwLedOn(padapter, pLed); @@ -1089,7 +1086,7 @@ SwLedBlink6( struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); u8 bStopBlinking = false; - // Change LED according to BlinkingLedState specified. + /* Change LED according to BlinkingLedState specified. */ if ( pLed->BlinkingLedState == RTW_LED_ON ) { SwLedOn(padapter, pLed); @@ -1113,7 +1110,7 @@ SwLedControlMode0( struct led_priv *ledpriv = &(padapter->ledpriv); PLED_871x pLed = &(ledpriv->SwLed1); - // Decide led state + /* Decide led state */ switch (LedAction) { case LED_CTL_TX: @@ -1218,7 +1215,7 @@ SwLedControlMode0( } - //ALPHA, added by chiyoko, 20090106 + /* ALPHA, added by chiyoko, 20090106 */ static void SwLedControlMode1( _adapter *padapter, @@ -1359,7 +1356,7 @@ SwLedControlMode1( } break; - case LED_CTL_START_WPS: //wait until xinpin finish + case LED_CTL_START_WPS: /* wait until xinpin finish */ case LED_CTL_START_WPS_BOTTON: if (pLed->bLedWPSBlinkInProgress ==false) { @@ -1493,7 +1490,7 @@ SwLedControlMode1( RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Led %d\n", pLed->CurrLedState)); } - //Arcadyan/Sitecom , added by chiyoko, 20090216 + /* Arcadyan/Sitecom , added by chiyoko, 20090216 */ static void SwLedControlMode2( _adapter *padapter, @@ -1567,7 +1564,7 @@ SwLedControlMode2( _set_timer(&(pLed->BlinkTimer), 0); break; - case LED_CTL_START_WPS: //wait until xinpin finish + case LED_CTL_START_WPS: /* wait until xinpin finish */ case LED_CTL_START_WPS_BOTTON: if (pLed->bLedWPSBlinkInProgress ==false) { @@ -1658,7 +1655,7 @@ SwLedControlMode2( RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); } - //COREGA, added by chiyoko, 20090316 + /* COREGA, added by chiyoko, 20090316 */ static void SwLedControlMode3( _adapter *padapter, @@ -1735,7 +1732,7 @@ SwLedControlMode2( _set_timer(&(pLed->BlinkTimer), 0); break; - case LED_CTL_START_WPS: //wait until xinpin finish + case LED_CTL_START_WPS: /* wait until xinpin finish */ case LED_CTL_START_WPS_BOTTON: if (pLed->bLedWPSBlinkInProgress ==false) { @@ -1837,7 +1834,7 @@ SwLedControlMode2( } - //Edimax-Belkin, added by chiyoko, 20090413 + /* Edimax-Belkin, added by chiyoko, 20090413 */ static void SwLedControlMode4( _adapter *padapter, @@ -1898,7 +1895,7 @@ SwLedControlMode4( case LED_CTL_LINK: case LED_CTL_NO_LINK: - //LED1 settings + /* LED1 settings */ if (LedAction == LED_CTL_LINK) { if (pLed1->bLedWPSBlinkInProgress) @@ -1989,7 +1986,7 @@ SwLedControlMode4( } break; - case LED_CTL_START_WPS: //wait until xinpin finish + case LED_CTL_START_WPS: /* wait until xinpin finish */ case LED_CTL_START_WPS_BOTTON: if (pLed1->bLedWPSBlinkInProgress) { @@ -2035,7 +2032,7 @@ SwLedControlMode4( } break; - case LED_CTL_STOP_WPS: //WPS connect success + case LED_CTL_STOP_WPS: /* WPS connect success */ if (pLed->bLedWPSBlinkInProgress) { _cancel_timer_ex(&(pLed->BlinkTimer)); @@ -2052,7 +2049,7 @@ SwLedControlMode4( break; - case LED_CTL_STOP_WPS_FAIL: //WPS authentication fail + case LED_CTL_STOP_WPS_FAIL: /* WPS authentication fail */ if (pLed->bLedWPSBlinkInProgress) { _cancel_timer_ex(&(pLed->BlinkTimer)); @@ -2067,7 +2064,7 @@ SwLedControlMode4( pLed->BlinkingLedState = RTW_LED_ON; _set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA); - //LED1 settings + /* LED1 settings */ if (pLed1->bLedWPSBlinkInProgress) _cancel_timer_ex(&(pLed1->BlinkTimer)); else @@ -2082,7 +2079,7 @@ SwLedControlMode4( break; - case LED_CTL_STOP_WPS_FAIL_OVERLAP: //WPS session overlap + case LED_CTL_STOP_WPS_FAIL_OVERLAP: /* WPS session overlap */ if (pLed->bLedWPSBlinkInProgress) { _cancel_timer_ex(&(pLed->BlinkTimer)); @@ -2097,7 +2094,7 @@ SwLedControlMode4( pLed->BlinkingLedState = RTW_LED_ON; _set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA); - //LED1 settings + /* LED1 settings */ if (pLed1->bLedWPSBlinkInProgress) _cancel_timer_ex(&(pLed1->BlinkTimer)); else @@ -2169,7 +2166,7 @@ SwLedControlMode4( - //Sercomm-Belkin, added by chiyoko, 20090415 + /* Sercomm-Belkin, added by chiyoko, 20090415 */ static void SwLedControlMode5( _adapter *padapter, @@ -2192,7 +2189,7 @@ SwLedControlMode5( { case LED_CTL_POWER_ON: case LED_CTL_NO_LINK: - case LED_CTL_LINK: //solid blue + case LED_CTL_LINK: /* solid blue */ pLed->CurrLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON; @@ -2260,7 +2257,7 @@ SwLedControlMode5( RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Led %d\n", pLed->CurrLedState)); } - //WNC-Corega, added by chiyoko, 20090902 + /* WNC-Corega, added by chiyoko, 20090902 */ static void SwLedControlMode6( _adapter *padapter, @@ -2293,23 +2290,18 @@ SwLedControlMode6( RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("ledcontrol 6 Led %d\n", pLed0->CurrLedState)); } -// -// Description: -// Handler function of LED Blinking. -// We dispatch acture LED blink action according to LedStrategy. -// +/* */ +/* Description: */ +/* Handler function of LED Blinking. */ +/* We dispatch acture LED blink action according to LedStrategy. */ +/* */ void BlinkHandler(PLED_871x pLed) { _adapter *padapter = pLed->padapter; struct led_priv *ledpriv = &(padapter->ledpriv); - //DBG_88E("%s (%s:%d)\n",__func__, current->comm, current->pid); - if ( (padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true)) - { - //DBG_88E("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __func__, padapter->bSurpriseRemoved, padapter->bDriverStopped); return; - } switch (ledpriv->LedStrategy) { @@ -2342,8 +2334,6 @@ void BlinkHandler(PLED_871x pLed) break; default: - //RT_TRACE(COMP_LED, DBG_LOUD, ("BlinkWorkItemCallback 0x%x\n", pHalData->LedStrategy)); - //SwLedBlink(pLed); break; } } @@ -2366,11 +2356,7 @@ LedControl871x( if ( ledpriv->bRegUseLed == false) return; - //if (!priv->up) - // return; - //if (priv->bInHctTest) - // return; if ( (padapter->pwrctrlpriv.rf_pwrstate != rf_on && padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS) && @@ -2386,7 +2372,6 @@ LedControl871x( switch (ledpriv->LedStrategy) { case SW_LED_MODE0: - //SwLedControlMode0(padapter, LedAction); break; case SW_LED_MODE1: diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index cde8a63..f16365b 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -39,9 +39,9 @@ extern u8 rtw_do_join(_adapter * padapter); #ifdef CONFIG_DISABLE_MCS13TO15 extern unsigned char MCS_rate_2R_MCS13TO15_OFF[16]; extern unsigned char MCS_rate_2R[16]; -#else //CONFIG_DISABLE_MCS13TO15 +#else /* CONFIG_DISABLE_MCS13TO15 */ extern unsigned char MCS_rate_2R[16]; -#endif //CONFIG_DISABLE_MCS13TO15 +#endif /* CONFIG_DISABLE_MCS13TO15 */ extern unsigned char MCS_rate_1R[16]; sint _rtw_init_mlme_priv (_adapter* padapter) @@ -54,15 +54,14 @@ sint _rtw_init_mlme_priv (_adapter* padapter) _func_enter_; - // We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). - //_rtw_memset((u8 *)pmlmepriv, 0, sizeof(struct mlme_priv)); + /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ pmlmepriv->nic_hdl = (u8 *)padapter; pmlmepriv->pscanned = NULL; pmlmepriv->fw_state = 0; pmlmepriv->cur_network.network.InfrastructureMode = Ndis802_11AutoUnknown; - pmlmepriv->scan_mode=SCAN_ACTIVE;// 1: active, 0: pasive. Maybe someday we should rename this varable to "active_mode" (Jeff) + pmlmepriv->scan_mode=SCAN_ACTIVE;/* 1: active, 0: pasive. Maybe someday we should rename this varable to "active_mode" (Jeff) */ _rtw_spinlock_init(&(pmlmepriv->lock)); _rtw_init_queue(&(pmlmepriv->free_bss_pool)); @@ -91,13 +90,13 @@ _func_enter_; pnetwork++; } - //allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf + /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ rtw_clear_scan_deny(padapter); #ifdef CONFIG_FTP_PROTECT pmlmepriv->ftp_lock_flag = 0; - #endif //CONFIG_FTP_PROTECT + #endif /* CONFIG_FTP_PROTECT */ rtw_init_mlme_timer(padapter); @@ -219,7 +218,7 @@ _func_exit_; return pnetwork; } -struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv )//(_queue *free_queue) +struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv )/* _queue *free_queue) */ { _irqL irqL; struct wlan_network *pnetwork; @@ -284,7 +283,7 @@ _func_enter_; delta_time = (curr_time -pnetwork->last_scanned)/10; - if (delta_time < lifetime*1000000)// unit:usec + if (delta_time < lifetime*1000000)/* unit:usec */ { goto exit; } @@ -295,7 +294,7 @@ _func_enter_; delta_time = (curr_time -pnetwork->last_scanned)/HZ; - if (delta_time < lifetime)// unit:sec + if (delta_time < lifetime)/* unit:sec */ { goto exit; } @@ -303,10 +302,10 @@ _func_enter_; #endif #ifdef PLATFORM_FREEBSD - //i think needs to check again + /* i think needs to check again */ delta_time = (curr_time -pnetwork->last_scanned)/hz; - if (delta_time < lifetime)// unit:sec + if (delta_time < lifetime)/* unit:sec */ { goto exit; } @@ -323,8 +322,6 @@ _func_enter_; pmlmepriv->num_of_scanned --; - //DBG_88E("_rtw_free_network:SSID=%s\n", pnetwork->network.Ssid.Ssid); - _exit_critical_bh(&free_queue->lock, &irqL); exit: @@ -346,7 +343,6 @@ _func_enter_; if (pnetwork->fixed == true) goto exit; - //_enter_critical(&free_queue->lock, &irqL); rtw_list_delete(&(pnetwork->list)); @@ -354,7 +350,6 @@ _func_enter_; pmlmepriv->num_of_scanned --; - //_exit_critical(&free_queue->lock, &irqL); exit: @@ -371,7 +366,6 @@ _func_exit_; struct wlan_network *_rtw_find_network(_queue *scanned_queue, u8 *addr) { - //_irqL irqL; _list *phead, *plist; struct wlan_network *pnetwork = NULL; u8 zero_addr[ETH_ALEN] = {0,0,0,0,0,0}; @@ -383,8 +377,6 @@ _func_enter_; goto exit; } - //_enter_critical_bh(&scanned_queue->lock, &irqL); - phead = get_list_head(scanned_queue); plist = get_next(phead); @@ -401,8 +393,6 @@ _func_enter_; if (plist == phead) pnetwork = NULL; - //_exit_critical_bh(&scanned_queue->lock, &irqL); - exit: _func_exit_; @@ -471,12 +461,12 @@ void rtw_generate_random_ibss(u8* pibss) u32 curtime = rtw_get_current_time(); _func_enter_; - pibss[0] = 0x02; //in ad-hoc mode bit1 must set to 1 + pibss[0] = 0x02; /* in ad-hoc mode bit1 must set to 1 */ pibss[1] = 0x11; pibss[2] = 0x87; - pibss[3] = (u8)(curtime & 0xff) ;//p[0]; - pibss[4] = (u8)((curtime>>8) & 0xff) ;//p[1]; - pibss[5] = (u8)((curtime>>16) & 0xff) ;//p[2]; + pibss[3] = (u8)(curtime & 0xff) ;/* p[0]; */ + pibss[4] = (u8)((curtime>>8) & 0xff) ;/* p[1]; */ + pibss[5] = (u8)((curtime>>16) & 0xff) ;/* p[2]; */ _func_exit_; return; } @@ -509,11 +499,11 @@ u8 *rtw_get_beacon_interval_from_ie(u8 *ie) } -int rtw_init_mlme_priv (_adapter *padapter)//(struct mlme_priv *pmlmepriv) +int rtw_init_mlme_priv (_adapter *padapter)/* struct mlme_priv *pmlmepriv) */ { int res; _func_enter_; - res = _rtw_init_mlme_priv(padapter);// (pmlmepriv); + res = _rtw_init_mlme_priv(padapter);/* (pmlmepriv); */ _func_exit_; return res; } @@ -537,7 +527,7 @@ _func_exit_; } -#ifndef PLATFORM_FREEBSD //Baron +#ifndef PLATFORM_FREEBSD /* Baron */ static struct wlan_network *rtw_dequeue_network(_queue *queue) { struct wlan_network *pnetwork; @@ -546,10 +536,10 @@ _func_enter_; _func_exit_; return pnetwork; } -#endif //PLATFORM_FREEBSD +#endif /* PLATFORM_FREEBSD */ struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv ); -struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv )//(_queue *free_queue) +struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv )/* _queue *free_queue) */ { struct wlan_network *pnetwork; _func_enter_; @@ -559,7 +549,7 @@ _func_exit_; } void rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 is_freeall); -void rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 is_freeall)//(struct wlan_network *pnetwork, _queue *free_queue) +void rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 is_freeall)/* struct wlan_network *pnetwork, _queue *free_queue) */ { _func_enter_; RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_network==> ssid = %s\n\n" , pnetwork->network.Ssid.Ssid)); @@ -571,7 +561,7 @@ void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *p void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork ) { _func_enter_; - //RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_network==> ssid = %s\n\n" , pnetwork->network.Ssid.Ssid)); + /* RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_network==> ssid = %s\n\n" , pnetwork->network.Ssid.Ssid)); */ _rtw_free_network_nolock(pmlmepriv, pnetwork); _func_exit_; } @@ -623,8 +613,6 @@ int rtw_is_same_ibss(_adapter *adapter, struct wlan_network *pnetwork) inline int is_same_ess(WLAN_BSSID_EX *a, WLAN_BSSID_EX *b); inline int is_same_ess(WLAN_BSSID_EX *a, WLAN_BSSID_EX *b) { - //RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("(%s,%d)(%s,%d)\n", - // a->Ssid.Ssid,a->Ssid.SsidLength,b->Ssid.Ssid,b->Ssid.SsidLength)); return (a->Ssid.SsidLength == b->Ssid.SsidLength) && _rtw_memcmp(a->Ssid.Ssid, b->Ssid.Ssid, a->Ssid.SsidLength)==true; } @@ -705,7 +693,7 @@ void update_network(WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src, _func_enter_; #ifdef CONFIG_ANTENNA_DIVERSITY - rtw_hal_antdiv_rssi_compared(padapter, dst, src); //this will update src.Rssi, need consider again + rtw_hal_antdiv_rssi_compared(padapter, dst, src); /* this will update src.Rssi, need consider again */ #endif #if defined(DBG_RX_SIGNAL_DISPLAY_PROCESSING) && 1 @@ -836,16 +824,14 @@ _func_enter_; if (_rtw_queue_empty(&(pmlmepriv->free_bss_pool)) == true) { /* If there are no more slots, expire the oldest */ - //list_del_init(&oldest->list); + /* list_del_init(&oldest->list); */ pnetwork = oldest; #ifdef CONFIG_ANTENNA_DIVERSITY - //target->PhyInfo.Optimum_antenna = pHalData->CurAntenna;//optimum_antenna=>For antenna diversity rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(target->PhyInfo.Optimum_antenna)); #endif _rtw_memcpy(&(pnetwork->network), target, get_WLAN_BSSID_EX_sz(target)); - //pnetwork->last_scanned = rtw_get_current_time(); - // variable initialize + /* variable initialize */ pnetwork->fixed = false; pnetwork->last_scanned = rtw_get_current_time(); @@ -860,7 +846,7 @@ _func_enter_; else { /* Otherwise just pull from the free list */ - pnetwork = rtw_alloc_network(pmlmepriv); // will update scan_time + pnetwork = rtw_alloc_network(pmlmepriv); /* will update scan_time */ if (pnetwork==NULL){ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n\n\nsomething wrong here\n\n\n")); @@ -870,7 +856,7 @@ _func_enter_; bssid_ex_sz = get_WLAN_BSSID_EX_sz(target); target->Length = bssid_ex_sz; #ifdef CONFIG_ANTENNA_DIVERSITY - //target->PhyInfo.Optimum_antenna = pHalData->CurAntenna; + /* target->PhyInfo.Optimum_antenna = pHalData->CurAntenna; */ rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(target->PhyInfo.Optimum_antenna)); #endif _rtw_memcpy(&(pnetwork->network), target, bssid_ex_sz ); @@ -894,7 +880,7 @@ _func_enter_; pnetwork->last_scanned = rtw_get_current_time(); - //target.Reserved[0]==1, means that scaned network is a bcn frame. + /* target.Reserved[0]==1, means that scaned network is a bcn frame. */ if ((pnetwork->network.IELength>target->IELength) && (target->Reserved[0]==1)) update_ie = false; @@ -912,12 +898,10 @@ void rtw_add_network(_adapter *adapter, WLAN_BSSID_EX *pnetwork) { _irqL irqL; struct mlme_priv *pmlmepriv = &(((_adapter *)adapter)->mlmepriv); - //_queue *queue = &(pmlmepriv->scanned_queue); + /* _queue *queue = &(pmlmepriv->scanned_queue); */ _func_enter_; - //_enter_critical_bh(&queue->lock, &irqL); - #if defined(CONFIG_P2P) && defined(CONFIG_P2P_REMOVE_GROUP_INFO) rtw_WLAN_BSSID_EX_remove_p2p_attr(pnetwork, P2P_ATTR_GROUP_INFO); #endif @@ -926,18 +910,16 @@ _func_enter_; rtw_update_scanned_network(adapter, pnetwork); - //_exit_critical_bh(&queue->lock, &irqL); _func_exit_; } -//select the desired network based on the capability of the (i)bss. -// check items: (1) security -// (2) network_type -// (3) WMM -// (4) HT -// (5) others -int rtw_is_desired_network(_adapter *adapter, struct wlan_network *pnetwork); +/* select the desired network based on the capability of the (i)bss. */ +/* check items: (1) security */ +/* (2) network_type */ +/* (3) WMM */ +/* (4) HT */ +/* (5) others */ int rtw_is_desired_network(_adapter *adapter, struct wlan_network *pnetwork) { struct security_priv *psecuritypriv = &adapter->securitypriv; @@ -945,7 +927,7 @@ int rtw_is_desired_network(_adapter *adapter, struct wlan_network *pnetwork) u32 desired_encmode; u32 privacy; - //u8 wps_ie[512]; + /* u8 wps_ie[512]; */ uint wps_ielen; int bselected = true; @@ -964,7 +946,7 @@ int rtw_is_desired_network(_adapter *adapter, struct wlan_network *pnetwork) return false; } } - if (adapter->registrypriv.wifi_spec == 1) //for correct flow of 8021X to do.... + if (adapter->registrypriv.wifi_spec == 1) /* for correct flow of 8021X to do.... */ { if ((desired_encmode == Ndis802_11EncryptionDisabled) && (privacy != 0)) bselected = false; @@ -1011,7 +993,7 @@ _func_enter_; RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_survey_event_callback, ssid=%s\n", pnetwork->Ssid.Ssid)); #ifdef CONFIG_RTL8712 - //endian_convert + /* endian_convert */ pnetwork->Length = le32_to_cpu(pnetwork->Length); pnetwork->Ssid.SsidLength = le32_to_cpu(pnetwork->Ssid.SsidLength); pnetwork->Privacy =le32_to_cpu( pnetwork->Privacy); @@ -1039,10 +1021,9 @@ _func_enter_; _enter_critical_bh(&pmlmepriv->lock, &irqL); - // update IBSS_network 's timestamp + /* update IBSS_network 's timestamp */ if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) == true) { - //RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,"rtw_survey_event_callback : WIFI_ADHOC_MASTER_STATE\n\n"); if (_rtw_memcmp(&(pmlmepriv->cur_network.network.MacAddress), pnetwork->MacAddress, ETH_ALEN)) { struct wlan_network* ibss_wlan = NULL; @@ -1061,7 +1042,7 @@ _func_enter_; } } - // lock pmlmepriv->lock when you accessing network_q + /* lock pmlmepriv->lock when you accessing network_q */ if ((check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) == false) { if ( pnetwork->Ssid.Ssid[0] == 0 ) @@ -1141,7 +1122,6 @@ _func_enter_; WLAN_BSSID_EX *pdev_network = &(adapter->registrypriv.dev_network); u8 *pibss = adapter->registrypriv.dev_network.MacAddress; - //pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;//because don't set assoc_timer _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("switching to adhoc master\n")); @@ -1172,7 +1152,7 @@ _func_enter_; { _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT); } - else if (s_ret == 2)//there is no need to wait for join + else if (s_ret == 2)/* there is no need to wait for join */ { _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); rtw_indicate_connect(adapter); @@ -1204,7 +1184,6 @@ _func_enter_; } indicate_wx_scan_complete_event(adapter); - //DBG_88E("scan complete in %dms\n",rtw_get_passing_time_ms(pmlmepriv->scan_start_time)); _exit_critical_bh(&pmlmepriv->lock, &irqL); @@ -1212,7 +1191,7 @@ _func_enter_; if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { p2p_ps_wk_cmd(adapter, P2P_PS_SCAN_DONE, 0); } -#endif // CONFIG_P2P_PS +#endif /* CONFIG_P2P_PS */ rtw_os_xmit_schedule(adapter); #ifdef CONFIG_CONCURRENT_MODE @@ -1237,7 +1216,7 @@ _func_enter_; #ifdef CONFIG_IOCTL_CFG80211 rtw_cfg80211_surveydone_event_callback(adapter); -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ _func_exit_; @@ -1297,7 +1276,7 @@ void rtw_free_assoc_resources(_adapter *adapter, int lock_scanned_queue) #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &adapter->tdlsinfo; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ _func_enter_; RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+rtw_free_assoc_resources\n")); @@ -1315,7 +1294,7 @@ _func_enter_; rtw_reset_tdls_info(adapter); rtw_free_all_stainfo(adapter); } else -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ { _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_free_stainfo(adapter, psta); @@ -1421,7 +1400,6 @@ _func_enter_; _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING|WIFI_UNDER_WPS); - //DBG_88E("clear wps when %s\n", __func__); #ifdef CONFIG_LAYER2_ROAMING if (pmlmepriv->to_roaming > 0) @@ -1460,12 +1438,12 @@ _func_enter_; #ifdef CONFIG_P2P_PS p2p_ps_wk_cmd(padapter, P2P_PS_DISABLE, 1); -#endif // CONFIG_P2P_PS +#endif /* CONFIG_P2P_PS */ #ifdef CONFIG_LPS #ifdef CONFIG_WOWLAN if (padapter->pwrctrlpriv.wowlan_mode==false) -#endif //CONFIG_WOWLAN +#endif /* CONFIG_WOWLAN */ rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 1); #endif @@ -1500,7 +1478,6 @@ void rtw_scan_abort(_adapter *adapter) if (!adapter->bDriverStopped && !adapter->bSurpriseRemoved) DBG_88E(FUNC_NDEV_FMT"waiting for scan_abort time out!\n", FUNC_NDEV_ARG(adapter->pnetdev)); #ifdef CONFIG_PLATFORM_MSTAR_TITANIA12 - //_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); set_survey_timer(pmlmeext, 0); _set_timer(&pmlmepriv->scan_to_timer, 50); #endif @@ -1521,7 +1498,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl psta = rtw_alloc_stainfo(pstapriv, pnetwork->network.MacAddress); } - if (psta) //update ptarget_sta + if (psta) /* update ptarget_sta */ { DBG_88E("%s\n", __func__); @@ -1536,10 +1513,10 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl psta->mac_id=0; #endif - //sta mode + /* sta mode */ rtw_hal_set_odm_var(padapter,HAL_ODM_STA_INFO,psta,true); - //security related + /* security related */ if (padapter->securitypriv.dot11AuthAlgrthm== dot11AuthAlgrthm_8021X) { padapter->securitypriv.binstallGrpkey=false; @@ -1558,9 +1535,9 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl _rtw_memset((u8 *)&psta->dot11rxpn, 0, sizeof (union pn48)); } - // Commented by Albert 2012/07/21 - // When doing the WPS, the wps_ie_len won't equal to 0 - // And the Wi-Fi driver shouldn't allow the data packet to be tramsmitted. + /* Commented by Albert 2012/07/21 */ + /* When doing the WPS, the wps_ie_len won't equal to 0 */ + /* And the Wi-Fi driver shouldn't allow the data packet to be tramsmitted. */ if ( padapter->securitypriv.wps_ie_len != 0 ) { psta->ieee8021x_blocked=true; @@ -1568,12 +1545,12 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl } - //for A-MPDU Rx reordering buffer control for bmc_sta & sta_info - //if A-MPDU Rx is enabled, reseting rx_ordering_ctrl wstart_b(indicate_seq) to default value=0xffff - //todo: check if AP can send A-MPDU packets + /* for A-MPDU Rx reordering buffer control for bmc_sta & sta_info */ + /* if A-MPDU Rx is enabled, reseting rx_ordering_ctrl wstart_b(indicate_seq) to default value=0xffff */ + /* todo: check if AP can send A-MPDU packets */ for (i=0; i < 16 ; i++) { - //preorder_ctrl = &precvpriv->recvreorder_ctrl[i]; + /* preorder_ctrl = &precvpriv->recvreorder_ctrl[i]; */ preorder_ctrl = &psta->recvreorder_ctrl[i]; preorder_ctrl->enable = false; preorder_ctrl->indicate_seq = 0xffff; @@ -1582,7 +1559,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl preorder_ctrl->indicate_seq); #endif preorder_ctrl->wend_b= 0xffff; - preorder_ctrl->wsize_b = 64;//max_ampdu_sz;//ex. 32(kbytes) -> wsize_b=32 + preorder_ctrl->wsize_b = 64;/* max_ampdu_sz; ex. 32(kbytes) -> wsize_b=32 */ } @@ -1591,7 +1568,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl { for (i=0; i < 16 ; i++) { - //preorder_ctrl = &precvpriv->recvreorder_ctrl[i]; + /* preorder_ctrl = &precvpriv->recvreorder_ctrl[i]; */ preorder_ctrl = &bmc_sta->recvreorder_ctrl[i]; preorder_ctrl->enable = false; preorder_ctrl->indicate_seq = 0xffff; @@ -1600,12 +1577,12 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl preorder_ctrl->indicate_seq); #endif preorder_ctrl->wend_b= 0xffff; - preorder_ctrl->wsize_b = 64;//max_ampdu_sz;//ex. 32(kbytes) -> wsize_b=32 + preorder_ctrl->wsize_b = 64;/* max_ampdu_sz; ex. 32(kbytes) -> wsize_b=32 */ } } - //misc. + /* misc. */ update_sta_info(padapter, psta); } @@ -1614,8 +1591,8 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl } -//pnetwork : returns from rtw_joinbss_event_callback -//ptarget_wlan: found from scanned_queue +/* pnetwork : returns from rtw_joinbss_event_callback */ +/* ptarget_wlan: found from scanned_queue */ static void rtw_joinbss_update_network(_adapter *padapter, struct wlan_network *ptarget_wlan, struct wlan_network *pnetwork) { struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); @@ -1627,9 +1604,9 @@ static void rtw_joinbss_update_network(_adapter *padapter, struct wlan_network * get_fwstate(pmlmepriv), pnetwork->network.MacAddress)); - // why not use ptarget_wlan?? + /* why not use ptarget_wlan?? */ _rtw_memcpy(&cur_network->network, &pnetwork->network, pnetwork->network.Length); - // some IEs in pnetwork is wrong, so we should use ptarget_wlan IEs + /* some IEs in pnetwork is wrong, so we should use ptarget_wlan IEs */ cur_network->network.IELength = ptarget_wlan->network.IELength; _rtw_memcpy(&cur_network->network.IEs[0], &ptarget_wlan->network.IEs[0], MAX_IE_SZ); @@ -1641,7 +1618,7 @@ static void rtw_joinbss_update_network(_adapter *padapter, struct wlan_network * #endif padapter->recvpriv.signal_strength = ptarget_wlan->network.PhyInfo.SignalStrength; padapter->recvpriv.signal_qual = ptarget_wlan->network.PhyInfo.SignalQuality; - //the ptarget_wlan->network.Rssi is raw data, we use ptarget_wlan->network.PhyInfo.SignalStrength instead (has scaled) + /* the ptarget_wlan->network.Rssi is raw data, we use ptarget_wlan->network.PhyInfo.SignalStrength instead (has scaled) */ padapter->recvpriv.rssi = translate_percentage_to_dbm(ptarget_wlan->network.PhyInfo.SignalStrength); #if defined(DBG_RX_SIGNAL_DISPLAY_PROCESSING) && 1 DBG_88E("%s signal_strength:%3u, rssi:%3d, signal_qual:%3u" @@ -1656,7 +1633,7 @@ static void rtw_joinbss_update_network(_adapter *padapter, struct wlan_network * rtw_set_signal_stat_timer(&padapter->recvpriv); #endif - //update fw_state //will clr _FW_UNDER_LINKING here indirectly + /* update fw_state will clr _FW_UNDER_LINKING here indirectly */ switch (pnetwork->network.InfrastructureMode) { case Ndis802_11Infrastructure: @@ -1686,14 +1663,14 @@ static void rtw_joinbss_update_network(_adapter *padapter, struct wlan_network * } -//Notes: the fucntion could be > passive_level (the same context as Rx tasklet) -//pnetwork : returns from rtw_joinbss_event_callback -//ptarget_wlan: found from scanned_queue -//if join_res > 0, for (fw_state==WIFI_STATION_STATE), we check if "ptarget_sta" & "ptarget_wlan" exist. -//if join_res > 0, for (fw_state==WIFI_ADHOC_STATE), we only check if "ptarget_wlan" exist. -//if join_res > 0, update "cur_network->network" from "pnetwork->network" if (ptarget_wlan !=NULL). -// -//#define REJOIN +/* Notes: the fucntion could be > passive_level (the same context as Rx tasklet) */ +/* pnetwork : returns from rtw_joinbss_event_callback */ +/* ptarget_wlan: found from scanned_queue */ +/* if join_res > 0, for (fw_state==WIFI_STATION_STATE), we check if "ptarget_sta" & "ptarget_wlan" exist. */ +/* if join_res > 0, for (fw_state==WIFI_ADHOC_STATE), we only check if "ptarget_wlan" exist. */ +/* if join_res > 0, update "cur_network->network" from "pnetwork->network" if (ptarget_wlan !=NULL). */ +/* */ +/* define REJOIN */ void rtw_joinbss_event_prehandle(_adapter *adapter, u8 *pbuf) { _irqL irqL,irqL2; @@ -1739,7 +1716,7 @@ _func_enter_; retry = 0; #endif if (check_fwstate(pmlmepriv,_FW_UNDER_LINKING) ) { - //s1. find ptarget_wlan + /* s1. find ptarget_wlan */ if (check_fwstate(pmlmepriv, _FW_LINKED) ) { if (the_same_macaddr == true) { ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress); @@ -1769,7 +1746,7 @@ _func_enter_; } } - //s2. update cur_network + /* s2. update cur_network */ if (ptarget_wlan) { rtw_joinbss_update_network(adapter, ptarget_wlan, pnetwork); } else { @@ -1779,7 +1756,7 @@ _func_enter_; } - //s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode + /* s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode */ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork); if (ptarget_sta==NULL) { @@ -1789,15 +1766,15 @@ _func_enter_; } } - //s4. indicate connect + /* s4. indicate connect */ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { rtw_indicate_connect(adapter); } else { - //adhoc mode will rtw_indicate_connect when rtw_stassoc_event_callback + /* adhoc mode will rtw_indicate_connect when rtw_stassoc_event_callback */ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("adhoc mode, fw_state:%x", get_fwstate(pmlmepriv))); } - //s5. Cancle assoc_timer + /* s5. Cancle assoc_timer */ _cancel_timer(&pmlmepriv->assoc_timer, &timer_cancelled); RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("Cancle assoc_timer\n")); @@ -1818,7 +1795,7 @@ _func_enter_; RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("fail! clear _FW_UNDER_LINKING ^^^fw_state=%x\n", get_fwstate(pmlmepriv))); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); } - } else { //if join_res < 0 (join fails), then try again + } else { /* if join_res < 0 (join fails), then try again */ #ifdef REJOIN res = _FAIL; @@ -1828,10 +1805,10 @@ _func_enter_; } if (res == _SUCCESS) { - //extend time of assoc_timer + /* extend time of assoc_timer */ _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT); retry++; - } else if (res == 2) { //there is no need to wait for join + } else if (res == 2) { /* there is no need to wait for join */ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); rtw_indicate_connect(adapter); } else { @@ -1877,7 +1854,7 @@ _func_exit_; static u8 search_max_mac_id(_adapter *padapter) { u8 mac_id, aid; -#if (RATE_ADAPTIVE_SUPPORT==1) //for 88E RA +#if (RATE_ADAPTIVE_SUPPORT==1) /* for 88E RA */ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -1902,7 +1879,7 @@ static u8 search_max_mac_id(_adapter *padapter) } else #endif - {//adhoc id = 31~2 + {/* adhoc id = 31~2 */ for (mac_id = (NUM_STA-1); mac_id >= IBSS_START_MAC_ID ; mac_id--) { if (pmlmeinfo->FW_sta_info[mac_id].status == 1) @@ -1916,20 +1893,20 @@ static u8 search_max_mac_id(_adapter *padapter) } -//FOR AP ,AD-HOC mode +/* FOR AP ,AD-HOC mode */ void rtw_stassoc_hw_rpt(_adapter *adapter,struct sta_info *psta) { u16 media_status; if (psta==NULL) return; - #if (RATE_ADAPTIVE_SUPPORT==1) //for 88E RA + #if (RATE_ADAPTIVE_SUPPORT==1) /* for 88E RA */ { u8 macid = search_max_mac_id(adapter); rtw_hal_set_hwreg(adapter,HW_VAR_TX_RPT_MAX_MACID, (u8*)&macid); } #endif - media_status = (psta->mac_id<<8)|1; // MACID|OPMODE:1 connect + media_status = (psta->mac_id<<8)|1; /* MACID|OPMODE:1 connect */ rtw_hal_set_hwreg(adapter,HW_VAR_H2C_MEDIA_STATUS_RPT,(u8 *)&media_status); } @@ -1982,11 +1959,11 @@ _func_enter_; _rtw_mfree(passoc_req, assoc_req_len); } - #endif //(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) || defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) -#endif //CONFIG_IOCTL_CFG80211 + #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) || defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) */ +#endif /* CONFIG_IOCTL_CFG80211 */ - //bss_cap_update_on_sta_join(adapter, psta); - //sta_info_update(adapter, psta); + /* bss_cap_update_on_sta_join(adapter, psta); */ + /* sta_info_update(adapter, psta); */ ap_sta_info_defer_update(adapter, psta); rtw_stassoc_hw_rpt(adapter,psta); @@ -1996,15 +1973,15 @@ _func_enter_; goto exit; } #endif - //for AD-HOC mode + /* for AD-HOC mode */ psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr); if ( psta != NULL) { - //the sta have been in sta_info_queue => do nothing + /* the sta have been in sta_info_queue => do nothing */ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Error: rtw_stassoc_event_callback: sta has been in sta_hash_queue\n")); - goto exit; //(between drv has received this event before and fw have not yet to set key to CAM_ENTRY) + goto exit; /* between drv has received this event before and fw have not yet to set key to CAM_ENTRY) */ } psta = rtw_alloc_stainfo(&adapter->stapriv, pstassoc->macaddr); @@ -2013,12 +1990,12 @@ _func_enter_; goto exit; } - //to do : init sta_info variable + /* to do : init sta_info variable */ psta->qos_option = 0; psta->mac_id = (uint)pstassoc->cam_id; - //psta->aid = (uint)pstassoc->cam_id; + /* psta->aid = (uint)pstassoc->cam_id; */ DBG_88E("%s\n",__func__); - //for ad-hoc mode + /* for ad-hoc mode */ rtw_hal_set_odm_var(adapter,HAL_ODM_STA_INFO,psta,true); rtw_stassoc_hw_rpt(adapter,psta); @@ -2040,7 +2017,7 @@ _func_enter_; ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress); if (ptarget_wlan) ptarget_wlan->fixed = true; _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - // a sta + bc/mc_stainfo (not Ibss_stainfo) + /* a sta + bc/mc_stainfo (not Ibss_stainfo) */ rtw_indicate_connect(adapter); } } @@ -2051,7 +2028,7 @@ _func_enter_; mlmeext_sta_add_event_callback(adapter, psta); #ifdef CONFIG_RTL8711 - //submit SetStaKey_cmd to tell fw, fw will allocate an CAM entry for this sta + /* submit SetStaKey_cmd to tell fw, fw will allocate an CAM entry for this sta */ rtw_setstakey_cmd(adapter, (unsigned char*)psta, false); #endif @@ -2086,8 +2063,8 @@ _func_enter_; if (mac_id>=0){ u16 media_status; - media_status = (mac_id<<8)|0; // MACID|OPMODE:0 means disconnect - //for STA,AP,ADHOC mode, report disconnect stauts to FW + media_status = (mac_id<<8)|0; /* MACID|OPMODE:0 means disconnect */ + /* for STA,AP,ADHOC mode, report disconnect stauts to FW */ rtw_hal_set_hwreg(adapter, HW_VAR_H2C_MEDIA_STATUS_RPT, (u8 *)&media_status); } @@ -2098,8 +2075,8 @@ _func_enter_; #elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) || defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) rtw_cfg80211_indicate_sta_disassoc(adapter, pstadel->macaddr, *(u16*)pstadel->rsvd); - #endif //(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) || defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) -#endif //CONFIG_IOCTL_CFG80211 + #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) || defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) */ +#endif /* CONFIG_IOCTL_CFG80211 */ return; } @@ -2114,20 +2091,20 @@ _func_enter_; #ifdef CONFIG_LAYER2_ROAMING if (pmlmepriv->to_roaming > 0) - pmlmepriv->to_roaming--; // this stadel_event is caused by roaming, decrease to_roaming + pmlmepriv->to_roaming--; /* this stadel_event is caused by roaming, decrease to_roaming */ else if (pmlmepriv->to_roaming ==0) pmlmepriv->to_roaming= adapter->registrypriv.max_roaming_times; if (*((unsigned short *)(pstadel->rsvd)) != WLAN_REASON_EXPIRATION_CHK) - pmlmepriv->to_roaming=0; // don't roam - #endif //CONFIG_LAYER2_ROAMING + pmlmepriv->to_roaming=0; /* don't roam */ + #endif /* CONFIG_LAYER2_ROAMING */ rtw_free_uc_swdec_pending_queue(adapter); rtw_free_assoc_resources(adapter, 1); rtw_indicate_disconnect(adapter); _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - // remove the network entry in scanned_queue + /* remove the network entry in scanned_queue */ pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress); if (pwlan) { pwlan->fixed = false; @@ -2136,7 +2113,7 @@ _func_enter_; _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); #ifdef CONFIG_LAYER2_ROAMING _rtw_roaming(adapter, tgt_network); - #endif //CONFIG_LAYER2_ROAMING + #endif /* CONFIG_LAYER2_ROAMING */ } @@ -2148,12 +2125,10 @@ _func_enter_; rtw_free_stainfo(adapter, psta); _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); - if (adapter->stapriv.asoc_sta_count== 1) //a sta + bc/mc_stainfo (not Ibss_stainfo) + if (adapter->stapriv.asoc_sta_count== 1) /* a sta + bc/mc_stainfo (not Ibss_stainfo) */ { - //rtw_indicate_disconnect(adapter);//removed@20091105 _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - //free old ibss network - //pwlan = rtw_find_network(&pmlmepriv->scanned_queue, pstadel->macaddr); + /* free old ibss network */ pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress); if (pwlan) { @@ -2161,7 +2136,7 @@ _func_enter_; rtw_free_network_nolock(pmlmepriv, pwlan); } _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - //re-create ibss + /* re-create ibss */ pdev_network = &(adapter->registrypriv.dev_network); pibss = adapter->registrypriv.dev_network.MacAddress; @@ -2228,20 +2203,20 @@ void _rtw_join_timeout_handler (_adapter *adapter) struct mlme_priv *pmlmepriv = &adapter->mlmepriv; #ifdef CONFIG_LAYER2_ROAMING int do_join_r; -#endif //CONFIG_LAYER2_ROAMING +#endif /* CONFIG_LAYER2_ROAMING */ _func_enter_; #ifdef PLATFORM_FREEBSD rtw_mtx_lock(NULL); if (callout_pending(&adapter->mlmepriv.assoc_timer.callout)) { /* callout was reset */ - //mtx_unlock(&sc->sc_mtx); + /* mtx_unlock(&sc->sc_mtx); */ rtw_mtx_unlock(NULL); return; } if (!callout_active(&adapter->mlmepriv.assoc_timer.callout)) { /* callout was stopped */ - //mtx_unlock(&sc->sc_mtx); + /* mtx_unlock(&sc->sc_mtx); */ rtw_mtx_unlock(NULL); return; } @@ -2259,10 +2234,10 @@ _func_enter_; _enter_critical_bh(&pmlmepriv->lock, &irqL); #ifdef CONFIG_LAYER2_ROAMING - if (pmlmepriv->to_roaming>0) { // join timeout caused by roaming + if (pmlmepriv->to_roaming>0) { /* join timeout caused by roaming */ while (1) { pmlmepriv->to_roaming--; - if (pmlmepriv->to_roaming!=0) { //try another , + if (pmlmepriv->to_roaming!=0) { /* try another , */ DBG_88E("%s try another roaming\n", __func__); if ( _SUCCESS!=(do_join_r=rtw_do_join(adapter)) ) { DBG_88E("%s roaming do_join return %d\n", __func__ ,do_join_r); @@ -2280,7 +2255,7 @@ _func_enter_; #endif { rtw_indicate_disconnect(adapter); - free_scanqueue(pmlmepriv);//??? + free_scanqueue(pmlmepriv);/* */ } _exit_critical_bh(&pmlmepriv->lock, &irqL); @@ -2323,7 +2298,7 @@ static void rtw_auto_scan_handler(_adapter *padapter) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv; - //auto site survey per 60sec + /* auto site survey per 60sec */ if (pmlmepriv->scan_interval >0) { pmlmepriv->scan_interval--; @@ -2359,7 +2334,7 @@ static void rtw_auto_scan_handler(_adapter *padapter) rtw_set_802_11_bssid_list_scan(padapter, NULL, 0); - pmlmepriv->scan_interval = SCAN_INTERVAL;// 30*2 sec = 60sec + pmlmepriv->scan_interval = SCAN_INTERVAL;/* 30*2 sec = 60sec */ } @@ -2371,7 +2346,7 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter) { #ifdef CONFIG_AP_MODE struct mlme_priv *pmlmepriv = &adapter->mlmepriv; -#endif //CONFIG_AP_MODE +#endif /* CONFIG_AP_MODE */ struct registry_priv *pregistrypriv = &adapter->registrypriv; #ifdef CONFIG_CONCURRENT_MODE PADAPTER pbuddy_adapter = adapter->pbuddy_adapter; @@ -2399,7 +2374,7 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter) } } else -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ if (adapter->net_closed == true) { return; @@ -2414,7 +2389,7 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) #endif { - //auto site survey + /* auto site survey */ rtw_auto_scan_handler(adapter); } } @@ -2426,29 +2401,29 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter) expire_timeout_chk(adapter); } #endif -#endif //!CONFIG_ACTIVE_KEEP_ALIVE_CHECK +#endif /* CONFIG_ACTIVE_KEEP_ALIVE_CHECK */ #ifdef CONFIG_BR_EXT #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) rcu_read_lock(); -#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) +#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */ #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) if ( adapter->pnetdev->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)) */ && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) ) { - // expire NAT2.5 entry + /* expire NAT2.5 entry */ nat25_db_expire(adapter); if (adapter->pppoe_connection_in_progress > 0) { adapter->pppoe_connection_in_progress--; } - // due to rtw_dynamic_check_timer_handlder() is called every 2 seconds + /* due to rtw_dynamic_check_timer_handlder() is called every 2 seconds */ if (adapter->pppoe_connection_in_progress > 0) { adapter->pppoe_connection_in_progress--; } @@ -2456,9 +2431,9 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter) #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 */ } @@ -2510,7 +2485,7 @@ void rtw_set_scan_deny(_adapter *adapter, u32 ms) #endif #if defined(IEEE80211_SCAN_RESULT_EXPIRE) -#define RTW_SCAN_RESULT_EXPIRE IEEE80211_SCAN_RESULT_EXPIRE/HZ*1000 -1000 //3000 -1000 +#define RTW_SCAN_RESULT_EXPIRE IEEE80211_SCAN_RESULT_EXPIRE/HZ*1000 -1000 /* 3000 -1000 */ #else #define RTW_SCAN_RESULT_EXPIRE 2000 #endif @@ -2528,13 +2503,13 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv _adapter *adapter = container_of(pmlmepriv, _adapter, mlmepriv); - //check bssid, if needed + /* check bssid, if needed */ if (pmlmepriv->assoc_by_bssid==true) { if (_rtw_memcmp(competitor->network.MacAddress, pmlmepriv->assoc_bssid, ETH_ALEN) ==false) goto exit; } - //check ssid, if needed + /* check ssid, if needed */ if (pmlmepriv->assoc_ssid.Ssid && pmlmepriv->assoc_ssid.SsidLength) { if ( competitor->network.Ssid.SsidLength != pmlmepriv->assoc_ssid.SsidLength || _rtw_memcmp(competitor->network.Ssid.Ssid, pmlmepriv->assoc_ssid.Ssid, pmlmepriv->assoc_ssid.SsidLength) == false @@ -2631,7 +2606,7 @@ _func_enter_; } - // check for situation of _FW_LINKED + /* check for situation of _FW_LINKED */ if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { DBG_88E("%s: _FW_LINKED while ask_for_joinbss!!!\n", __func__); @@ -2705,13 +2680,13 @@ _func_enter_; { if (_rtw_memcmp(pnetwork->network.MacAddress, pmlmepriv->assoc_bssid, ETH_ALEN)==true) { - //remove the condition @ 20081125 + /* remove the condition @ 20081125 */ if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network)) { - rtw_indicate_connect(adapter);//rtw_indicate_connect again + rtw_indicate_connect(adapter);/* rtw_indicate_connect again */ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); return 2; } @@ -2734,18 +2709,18 @@ _func_enter_; } } else if (pmlmepriv->assoc_ssid.SsidLength == 0) { - goto ask_for_joinbss;//anyway, join first selected(dequeued) pnetwork if ssid_len=0 + goto ask_for_joinbss;/* anyway, join first selected(dequeued) pnetwork if ssid_len=0 */ #ifdef CONFIG_LAYER2_ROAMING } else if (pmlmepriv->to_roaming>0) { if ( (roaming_candidate == NULL ||roaming_candidate->network.Rssinetwork.Rssi ) && is_same_ess(&pnetwork->network, &pmlmepriv->cur_network.network) - //&&(!is_same_network(&pnetwork->network, &pmlmepriv->cur_network.network)) + /* is_same_network(&pnetwork->network, &pmlmepriv->cur_network.network)) */ && rtw_get_time_interval_ms((u32)pnetwork->last_scanned,cur_time) < 5000 ) { roaming_candidate = pnetwork; - //RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_, + /* RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_, */ DBG_88E("roaming_candidate???: %s(%pM\n", roaming_candidate->network.Ssid.Ssid, roaming_candidate->network.MacAddress); @@ -2764,15 +2739,15 @@ _func_enter_; (2==pnetwork->network.PhyInfo.Optimum_antenna)?"A":"B", (2==CurrentAntenna)?"A":"B"); #endif - //remove the condition @ 20081125 - //if ((pmlmepriv->cur_network.network.InfrastructureMode==Ndis802_11AutoUnknown)|| - // pmlmepriv->cur_network.network.InfrastructureMode == pnetwork->network.InfrastructureMode) - //{ - // _rtw_memcpy(pmlmepriv->assoc_bssid, pnetwork->network.MacAddress, ETH_ALEN); - // goto ask_for_joinbss; - //} + /* remove the condition @ 20081125 */ + /* if ((pmlmepriv->cur_network.network.InfrastructureMode==Ndis802_11AutoUnknown)|| */ + /* pmlmepriv->cur_network.network.InfrastructureMode == pnetwork->network.InfrastructureMode) */ + /* */ + /* _rtw_memcpy(pmlmepriv->assoc_bssid, pnetwork->network.MacAddress, ETH_ALEN); */ + /* goto ask_for_joinbss; */ + /* */ - if (pmlmepriv->assoc_by_rssi==true)//if the ssid is the same, select the bss which has the max rssi + if (pmlmepriv->assoc_by_rssi==true)/* if the ssid is the same, select the bss which has the max rssi */ { if ( NULL==pnetwork_max_rssi|| pnetwork->network.Rssi > pnetwork_max_rssi->network.Rssi) pnetwork_max_rssi = pnetwork; @@ -2827,7 +2802,7 @@ _func_exit_; return rtw_joinbss_cmd(adapter, pnetwork); } -#endif //PLATFORM_FREEBSD +#endif /* PLATFORM_FREEBSD */ sint rtw_set_auth(_adapter * adapter,struct security_priv *psecuritypriv) @@ -2841,7 +2816,7 @@ _func_enter_; pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if (pcmd==NULL){ - res= _FAIL; //try again + res= _FAIL; /* try again */ goto exit; } @@ -2890,7 +2865,7 @@ _func_enter_; pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if (pcmd==NULL){ - res= _FAIL; //try again + res= _FAIL; /* try again */ goto exit; } psetkeyparm=(struct setkey_parm*)rtw_zmalloc(sizeof(struct setkey_parm)); @@ -2911,7 +2886,7 @@ _func_enter_; RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n rtw_set_key: psetkeyparm->algorithm=(u8)psecuritypriv->dot11PrivacyAlgrthm=%d\n", psetkeyparm->algorithm)); } - psetkeyparm->keyid = (u8)keyid;//0~3 + psetkeyparm->keyid = (u8)keyid;/* 0~3 */ psetkeyparm->set_tx = set_tx; pmlmepriv->key_mask |= BIT(psetkeyparm->keyid); #ifdef CONFIG_AUTOSUSPEND @@ -2960,7 +2935,7 @@ _func_enter_; _rtw_init_listhead(&pcmd->list); - //_rtw_init_sema(&(pcmd->cmd_sem), 0); + /* _rtw_init_sema(&(pcmd->cmd_sem), 0); */ res = rtw_enqueue_cmd(pcmdpriv, pcmd); @@ -2971,21 +2946,21 @@ _func_exit_; } -//adjust IEs for rtw_joinbss_cmd in WMM +/* adjust IEs for rtw_joinbss_cmd in WMM */ int rtw_restruct_wmm_ie(_adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, uint initial_out_len) { unsigned int ielength=0; unsigned int i, j; - i = 12; //after the fixed IE + i = 12; /* after the fixed IE */ while (i=0 :if there is pre-auth key, and return the entry id -// -// +/* */ +/* Ported from 8185: IsInPreAuthKeyList(). (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.) */ +/* Added by Annie, 2006-05-07. */ +/* */ +/* Search by BSSID, */ +/* Return Value: */ +/* -1 :if there is no pre-auth key in the table */ +/* >=0 :if there is pre-auth key, and return the entry id */ +/* */ +/* */ static int SecIsInPMKIDList(_adapter *Adapter, u8 *bssid) { @@ -3032,46 +3007,46 @@ static int SecIsInPMKIDList(_adapter *Adapter, u8 *bssid) else { i++; - //continue; + /* continue; */ } }while (isecuritypriv; if (ie[13]<=20){ - // The RSN IE didn't include the PMK ID, append the PMK information + /* The RSN IE didn't include the PMK ID, append the PMK information */ ie[ie_len]=1; ie_len++; - ie[ie_len]=0; //PMKID count = 0x0100 + ie[ie_len]=0; /* PMKID count = 0x0100 */ ie_len++; _rtw_memcpy( &ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID, 16); ie_len+=16; - ie[13]+=18;//PMKID length = 2+16 + ie[13]+=18;/* PMKID length = 2+16 */ } return (ie_len); @@ -3096,7 +3071,7 @@ _func_enter_; ("+rtw_restruct_sec_ie: ndisauthmode=%d ndissecuritytype=%d\n", ndisauthmode, ndissecuritytype)); - //copy fixed ie only + /* copy fixed ie only */ _rtw_memcpy(out_ie, in_ie,12); ielength=12; if ((ndisauthmode==Ndis802_11AuthModeWPA)||(ndisauthmode==Ndis802_11AuthModeWPAPSK)) @@ -3112,7 +3087,7 @@ _func_enter_; } else if ((authmode==_WPA_IE_ID_)||(authmode==_WPA2_IE_ID_)) { - //copy RSN or SSN + /* copy RSN or SSN */ _rtw_memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0], psecuritypriv->supplicant_ie[1]+2); ielength+=psecuritypriv->supplicant_ie[1]+2; rtw_report_sec_ie(adapter, authmode, psecuritypriv->supplicant_ie); @@ -3172,11 +3147,11 @@ void rtw_update_registrypriv_dev_network(_adapter* adapter) WLAN_BSSID_EX *pdev_network = &pregistrypriv->dev_network; struct security_priv* psecuritypriv = &adapter->securitypriv; struct wlan_network *cur_network = &adapter->mlmepriv.cur_network; - //struct xmit_priv *pxmitpriv = &adapter->xmitpriv; + /* struct xmit_priv *pxmitpriv = &adapter->xmitpriv; */ _func_enter_; - pdev_network->Privacy = (psecuritypriv->dot11PrivacyAlgrthm > 0 ? 1 : 0) ; // adhoc no 802.1x + pdev_network->Privacy = (psecuritypriv->dot11PrivacyAlgrthm > 0 ? 1 : 0) ; /* adhoc no 802.1x */ pdev_network->Rssi = 0; @@ -3203,7 +3178,7 @@ _func_enter_; pdev_network->NetworkTypeInUse = (Ndis802_11OFDM24); break; default : - // TODO + /* TODO */ break; } @@ -3215,18 +3190,17 @@ _func_enter_; pdev_network->InfrastructureMode = (cur_network->network.InfrastructureMode); - // 1. Supported rates - // 2. IE + /* 1. Supported rates */ + /* 2. IE */ - //rtw_set_supported_rate(pdev_network->SupportedRates, pregistrypriv->wireless_mode) ; // will be called in rtw_generate_ie sz = rtw_generate_ie(pregistrypriv); pdev_network->IELength = sz; pdev_network->Length = get_WLAN_BSSID_EX_sz((WLAN_BSSID_EX *)pdev_network); - //notes: translate IELength & Length after assign the Length to cmdsz in createbss_cmd(); - //pdev_network->IELength = cpu_to_le32(sz); + /* notes: translate IELength & Length after assign the Length to cmdsz in createbss_cmd(); */ + /* pdev_network->IELength = cpu_to_le32(sz); */ _func_exit_; @@ -3241,7 +3215,7 @@ _func_exit_; } -//the fucntion is at passive_level +/* the fucntion is at passive_level */ void rtw_joinbss_reset(_adapter *padapter) { u8 threshold; @@ -3251,7 +3225,7 @@ void rtw_joinbss_reset(_adapter *padapter) struct ht_priv *phtpriv = &pmlmepriv->htpriv; #endif - //todo: if you want to do something io/reg/hw setting before join_bss, please add code here + /* todo: if you want to do something io/reg/hw setting before join_bss, please add code here */ @@ -3262,11 +3236,11 @@ void rtw_joinbss_reset(_adapter *padapter) pmlmepriv->num_sta_no_ht = 0; - phtpriv->ampdu_enable = false;//reset to disabled + phtpriv->ampdu_enable = false;/* reset to disabled */ #ifdef CONFIG_USB_HCI - // TH=1 => means that invalidate usb rx aggregation - // TH=0 => means that validate usb rx aggregation, use init value. + /* TH=1 => means that invalidate usb rx aggregation */ + /* TH=0 => means that validate usb rx aggregation, use init value. */ if (phtpriv->ht_option) { if (padapter->registrypriv.wifi_spec==1) @@ -3289,7 +3263,7 @@ void rtw_joinbss_reset(_adapter *padapter) #ifdef CONFIG_80211N_HT -//the fucntion is >= passive_level +/* the fucntion is >= passive_level */ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len) { u32 ielen; @@ -3322,10 +3296,10 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui u32 rx_packet_offset, max_recvbuf_sz; rtw_hal_get_def_var(padapter, HAL_DEF_RX_PACKET_OFFSET, &rx_packet_offset); rtw_hal_get_def_var(padapter, HAL_DEF_MAX_RECVBUF_SZ, &max_recvbuf_sz); - //if (max_recvbuf_sz-rx_packet_offset>(8191-256)) { - // DBG_88E("%s IEEE80211_HT_CAP_MAX_AMSDU is set\n", __func__); - // ht_capie.cap_info = ht_capie.cap_info |IEEE80211_HT_CAP_MAX_AMSDU; - //} + /* if (max_recvbuf_sz-rx_packet_offset>(8191-256)) { */ + /* DBG_88E("%s IEEE80211_HT_CAP_MAX_AMSDU is set\n", __func__); */ + /* ht_capie.cap_info = ht_capie.cap_info |IEEE80211_HT_CAP_MAX_AMSDU; */ + /* */ } /* AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k @@ -3354,19 +3328,19 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui return (phtpriv->ht_option); } -//the fucntion is > passive_level (in critical_section) +/* the fucntion is > passive_level (in critical_section) */ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) { u8 *p, max_ampdu_sz; int len; - //struct sta_info *bmc_sta, *psta; + /* struct sta_info *bmc_sta, *psta; */ struct rtw_ieee80211_ht_cap *pht_capie; - //struct recv_reorder_ctrl *preorder_ctrl; + /* struct recv_reorder_ctrl *preorder_ctrl; */ struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv; - //struct recv_priv *precvpriv = &padapter->recvpriv; + /* struct recv_priv *precvpriv = &padapter->recvpriv; */ struct registry_priv *pregistrypriv = &padapter->registrypriv; - //struct wlan_network *pcur_network = &(pmlmepriv->cur_network);; + /* struct wlan_network *pcur_network = &(pmlmepriv->cur_network);; */ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -3379,7 +3353,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) DBG_88E("+rtw_update_ht_cap()\n"); - //maybe needs check if ap supports rx ampdu. + /* maybe needs check if ap supports rx ampdu. */ if ((phtpriv->ampdu_enable==false) &&(pregistrypriv->ampdu_enable==1)) { if (pregistrypriv->wifi_spec==1) @@ -3397,16 +3371,16 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) } - //check Max Rx A-MPDU Size + /* check Max Rx A-MPDU Size */ len = 0; p = rtw_get_ie(pie+sizeof (NDIS_802_11_FIXED_IEs), _HT_CAPABILITY_IE_, &len, ie_len-sizeof (NDIS_802_11_FIXED_IEs)); if (p && len>0) { pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2); max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR); - max_ampdu_sz = 1 << (max_ampdu_sz+3); // max_ampdu_sz (kbytes); + max_ampdu_sz = 1 << (max_ampdu_sz+3); /* max_ampdu_sz (kbytes); */ - //DBG_88E("rtw_update_ht_cap(): max_ampdu_sz=%d\n", max_ampdu_sz); + /* DBG_88E("rtw_update_ht_cap(): max_ampdu_sz=%d\n", max_ampdu_sz); */ phtpriv->rx_ampdu_maxlen = max_ampdu_sz; } @@ -3415,11 +3389,11 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) len=0; p = rtw_get_ie(pie+sizeof (NDIS_802_11_FIXED_IEs), _HT_ADD_INFO_IE_, &len, ie_len-sizeof (NDIS_802_11_FIXED_IEs)); if (p && len>0) { - //todo: + /* todo: */ } - //update cur_bwmode & cur_ch_offset + /* update cur_bwmode & cur_ch_offset */ if ((pregistrypriv->cbw40_enable) && (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info) & BIT(1)) && (pmlmeinfo->HT_info.infos[0] & BIT(2))) { @@ -3428,7 +3402,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) padapter->HalFunc.GetHwRegHandler(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); - //update the MCS rates + /* update the MCS rates */ for (i = 0; i < 16; i++) { if ((rf_type == RF_1T1R) || (rf_type == RF_1T2R)) @@ -3446,7 +3420,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i]; #else pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i]; - #endif //CONFIG_DISABLE_MCS13TO15 + #endif /* CONFIG_DISABLE_MCS13TO15 */ } #ifdef RTL8192C_RECONFIG_TO_1T1R { @@ -3454,7 +3428,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) } #endif } - //switch to the 40M Hz mode accoring to the AP + /* switch to the 40M Hz mode accoring to the AP */ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; switch ((pmlmeinfo->HT_info.infos[0] & 0x3)) { @@ -3472,16 +3446,16 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) } } - // - // Config SM Power Save setting - // + /* */ + /* Config SM Power Save setting */ + /* */ pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info) & 0x0C) >> 2; if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC) DBG_88E("%s(): WLAN_HT_CAP_SM_PS_STATIC\n",__func__); - // - // Config current HT Protection mode. - // + /* */ + /* Config current HT Protection mode. */ + /* */ pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3; } @@ -3635,10 +3609,10 @@ sint check_buddy_fw_link(_adapter *padapter) return true; } else - { //Station mode + { /* Station mode */ if (check_buddy_fwstate(padapter, _FW_LINKED)== true) return true; } return false; } -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 60d8df2..45b3f5d 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -119,136 +119,112 @@ unsigned char MCS_rate_1R[16] = {0xff, 0x00, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, /******************************************************** ChannelPlan definitions *********************************************************/ -/*static RT_CHANNEL_PLAN DefaultChannelPlan[RT_CHANNEL_DOMAIN_MAX] = { - {{1,2,3,4,5,6,7,8,9,10,11,36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161,165},32}, // 0x00, RT_CHANNEL_DOMAIN_FCC - {{1,2,3,4,5,6,7,8,9,10,11,36,40,44,48,52,56,60,64,100,104,108,112,116,136,140,149,153,157,161,165},31}, // 0x01, RT_CHANNEL_DOMAIN_IC - {{1,2,3,4,5,6,7,8,9,10,11,12,13,36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140},32}, // 0x02, RT_CHANNEL_DOMAIN_ETSI - {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, // 0x03, RT_CHANNEL_DOMAIN_SPAIN - {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, // 0x04, RT_CHANNEL_DOMAIN_FRANCE - {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, // 0x05, RT_CHANNEL_DOMAIN_MKK - {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, // 0x06, RT_CHANNEL_DOMAIN_MKK1 - {{1,2,3,4,5,6,7,8,9,10,11,12,13,36,40,44,48,52,56,60,64},21}, // 0x07, RT_CHANNEL_DOMAIN_ISRAEL - {{1,2,3,4,5,6,7,8,9,10,11,12,13,14,36,40,44,48,52,56,60,64},22}, // 0x08, RT_CHANNEL_DOMAIN_TELEC - {{1,2,3,4,5,6,7,8,9,10,11,12,13,14},14}, // 0x09, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN - {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, // 0x0A, RT_CHANNEL_DOMAIN_WORLD_WIDE_13 - {{1,2,3,4,5,6,7,8,9,10,11,56,60,64,100,104,108,112,116,136,140,149,153,157,161,165},26}, // 0x0B, RT_CHANNEL_DOMAIN_TAIWAN - {{1,2,3,4,5,6,7,8,9,10,11,12,13,149,153,157,161,165},18}, // 0x0C, RT_CHANNEL_DOMAIN_CHINA - {{1,2,3,4,5,6,7,8,9,10,11,36,40,44,48,52,56,60,64,149,153,157,161,165},24}, // 0x0D, RT_CHANNEL_DOMAIN_SINGAPORE_INDIA_MEXICO - {{1,2,3,4,5,6,7,8,9,10,11,36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,149,153,157,161,165},31}, // 0x0E, RT_CHANNEL_DOMAIN_KOREA - {{1,2,3,4,5,6,7,8,9,10,11,36,40,44,48,52,56,60,64},19}, // 0x0F, RT_CHANNEL_DOMAIN_TURKEY - {{1,2,3,4,5,6,7,8,9,10,11,12,13,36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140},32}, // 0x10, RT_CHANNEL_DOMAIN_JAPAN - {{1,2,3,4,5,6,7,8,9,10,11,36,40,44,48,149,153,157,161,165},20}, // 0x11, RT_CHANNEL_DOMAIN_FCC_NO_DFS - {{1,2,3,4,5,6,7,8,9,10,11,12,13,36,40,44,48},17}, // 0x12, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS - {{1,2,3,4,5,6,7,8,9,10,11,12,13,36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,149,153,157,161,165},37}, // 0x13, RT_CHANNEL_DOMAIN_WORLD_WIDE_5G - {{1,2,3,4,5,6,7,8,9,10,11,56,60,64,149,153,157,161,165},19}, // 0x14, RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS -};*/ - static RT_CHANNEL_PLAN_2G RTW_ChannelPlan2G[RT_CHANNEL_DOMAIN_2G_MAX] = { - {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, // 0x00, RT_CHANNEL_DOMAIN_2G_WORLD , Passive scan CH 12, 13 - {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, // 0x01, RT_CHANNEL_DOMAIN_2G_ETSI1 - {{1,2,3,4,5,6,7,8,9,10,11},11}, // 0x02, RT_CHANNEL_DOMAIN_2G_FCC1 - {{1,2,3,4,5,6,7,8,9,10,11,12,13,14},14}, // 0x03, RT_CHANNEL_DOMAIN_2G_MIKK1 - {{10,11,12,13},4}, // 0x04, RT_CHANNEL_DOMAIN_2G_ETSI2 - {{},0}, // 0x05, RT_CHANNEL_DOMAIN_2G_NULL + {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, /* 0x00, RT_CHANNEL_DOMAIN_2G_WORLD , Passive scan CH 12, 13 */ + {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, /* 0x01, RT_CHANNEL_DOMAIN_2G_ETSI1 */ + {{1,2,3,4,5,6,7,8,9,10,11},11}, /* 0x02, RT_CHANNEL_DOMAIN_2G_FCC1 */ + {{1,2,3,4,5,6,7,8,9,10,11,12,13,14},14}, /* 0x03, RT_CHANNEL_DOMAIN_2G_MIKK1 */ + {{10,11,12,13},4}, /* 0x04, RT_CHANNEL_DOMAIN_2G_ETSI2 */ + {{},0}, /* 0x05, RT_CHANNEL_DOMAIN_2G_NULL */ }; static RT_CHANNEL_PLAN_5G RTW_ChannelPlan5G[RT_CHANNEL_DOMAIN_5G_MAX] = { - {{},0}, // 0x00, RT_CHANNEL_DOMAIN_5G_NULL - {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140},19}, // 0x01, RT_CHANNEL_DOMAIN_5G_ETSI1 - {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,149,153,157,161,165},24}, // 0x02, RT_CHANNEL_DOMAIN_5G_ETSI2 - {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,149,153,157,161,165},22}, // 0x03, RT_CHANNEL_DOMAIN_5G_ETSI3 - {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,149,153,157,161,165},24}, // 0x04, RT_CHANNEL_DOMAIN_5G_FCC1 - {{36,40,44,48,149,153,157,161,165},9}, // 0x05, RT_CHANNEL_DOMAIN_5G_FCC2 - {{36,40,44,48,52,56,60,64,149,153,157,161,165},13}, // 0x06, RT_CHANNEL_DOMAIN_5G_FCC3 - {{36,40,44,48,52,56,60,64,149,153,157,161},12}, // 0x07, RT_CHANNEL_DOMAIN_5G_FCC4 - {{149,153,157,161,165},5}, // 0x08, RT_CHANNEL_DOMAIN_5G_FCC5 - {{36,40,44,48,52,56,60,64},8}, // 0x09, RT_CHANNEL_DOMAIN_5G_FCC6 - {{36,40,44,48,52,56,60,64,100,104,108,112,116,136,140,149,153,157,161,165},20}, // 0x0A, RT_CHANNEL_DOMAIN_5G_FCC7_IC1 - {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,149,153,157,161,165},20}, // 0x0B, RT_CHANNEL_DOMAIN_5G_KCC1 - {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140},19}, // 0x0C, RT_CHANNEL_DOMAIN_5G_MKK1 - {{36,40,44,48,52,56,60,64},8}, // 0x0D, RT_CHANNEL_DOMAIN_5G_MKK2 - {{100,104,108,112,116,120,124,128,132,136,140},11}, // 0x0E, RT_CHANNEL_DOMAIN_5G_MKK3 - {{56,60,64,100,104,108,112,116,136,140,149,153,157,161,165},15}, // 0x0F, RT_CHANNEL_DOMAIN_5G_NCC1 - {{56,60,64,149,153,157,161,165},8}, // 0x10, RT_CHANNEL_DOMAIN_5G_NCC2 + {{},0}, /* 0x00, RT_CHANNEL_DOMAIN_5G_NULL */ + {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140},19}, /* 0x01, RT_CHANNEL_DOMAIN_5G_ETSI1 */ + {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,149,153,157,161,165},24}, /* 0x02, RT_CHANNEL_DOMAIN_5G_ETSI2 */ + {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,149,153,157,161,165},22}, /* 0x03, RT_CHANNEL_DOMAIN_5G_ETSI3 */ + {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,149,153,157,161,165},24}, /* 0x04, RT_CHANNEL_DOMAIN_5G_FCC1 */ + {{36,40,44,48,149,153,157,161,165},9}, /* 0x05, RT_CHANNEL_DOMAIN_5G_FCC2 */ + {{36,40,44,48,52,56,60,64,149,153,157,161,165},13}, /* 0x06, RT_CHANNEL_DOMAIN_5G_FCC3 */ + {{36,40,44,48,52,56,60,64,149,153,157,161},12}, /* 0x07, RT_CHANNEL_DOMAIN_5G_FCC4 */ + {{149,153,157,161,165},5}, /* 0x08, RT_CHANNEL_DOMAIN_5G_FCC5 */ + {{36,40,44,48,52,56,60,64},8}, /* 0x09, RT_CHANNEL_DOMAIN_5G_FCC6 */ + {{36,40,44,48,52,56,60,64,100,104,108,112,116,136,140,149,153,157,161,165},20}, /* 0x0A, RT_CHANNEL_DOMAIN_5G_FCC7_IC1 */ + {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,149,153,157,161,165},20}, /* 0x0B, RT_CHANNEL_DOMAIN_5G_KCC1 */ + {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140},19}, /* 0x0C, RT_CHANNEL_DOMAIN_5G_MKK1 */ + {{36,40,44,48,52,56,60,64},8}, /* 0x0D, RT_CHANNEL_DOMAIN_5G_MKK2 */ + {{100,104,108,112,116,120,124,128,132,136,140},11}, /* 0x0E, RT_CHANNEL_DOMAIN_5G_MKK3 */ + {{56,60,64,100,104,108,112,116,136,140,149,153,157,161,165},15}, /* 0x0F, RT_CHANNEL_DOMAIN_5G_NCC1 */ + {{56,60,64,149,153,157,161,165},8}, /* 0x10, RT_CHANNEL_DOMAIN_5G_NCC2 */ - //===== Driver self defined for old channel plan Compatible ,Remember to modify if have new channel plan definition ===== - {{36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161,165},21}, // 0x11, RT_CHANNEL_DOMAIN_5G_FCC - {{36,40,44,48},4}, // 0x12, RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS - {{36,40,44,48,149,153,157,161},8}, // 0x13, RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS + /* Driver self defined for old channel plan Compatible ,Remember to modify if have new channel plan definition ===== */ + {{36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161,165},21}, /* 0x11, RT_CHANNEL_DOMAIN_5G_FCC */ + {{36,40,44,48},4}, /* 0x12, RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS */ + {{36,40,44,48,149,153,157,161},8}, /* 0x13, RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS */ }; static RT_CHANNEL_PLAN_MAP RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { - //===== 0x00 ~ 0x1F , Old Define ===== - {0x02,0x11}, //0x00, RT_CHANNEL_DOMAIN_FCC - {0x02,0x0A}, //0x01, RT_CHANNEL_DOMAIN_IC - {0x01,0x01}, //0x02, RT_CHANNEL_DOMAIN_ETSI - {0x01,0x00}, //0x03, RT_CHANNEL_DOMAIN_SPAIN - {0x01,0x00}, //0x04, RT_CHANNEL_DOMAIN_FRANCE - {0x03,0x00}, //0x05, RT_CHANNEL_DOMAIN_MKK - {0x03,0x00}, //0x06, RT_CHANNEL_DOMAIN_MKK1 - {0x01,0x09}, //0x07, RT_CHANNEL_DOMAIN_ISRAEL - {0x03,0x09}, //0x08, RT_CHANNEL_DOMAIN_TELEC - {0x03,0x00}, //0x09, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN - {0x00,0x00}, //0x0A, RT_CHANNEL_DOMAIN_WORLD_WIDE_13 - {0x02,0x0F}, //0x0B, RT_CHANNEL_DOMAIN_TAIWAN - {0x01,0x08}, //0x0C, RT_CHANNEL_DOMAIN_CHINA - {0x02,0x06}, //0x0D, RT_CHANNEL_DOMAIN_SINGAPORE_INDIA_MEXICO - {0x02,0x0B}, //0x0E, RT_CHANNEL_DOMAIN_KOREA - {0x02,0x09}, //0x0F, RT_CHANNEL_DOMAIN_TURKEY - {0x01,0x01}, //0x10, RT_CHANNEL_DOMAIN_JAPAN - {0x02,0x05}, //0x11, RT_CHANNEL_DOMAIN_FCC_NO_DFS - {0x01,0x12}, //0x12, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS - {0x00,0x04}, //0x13, RT_CHANNEL_DOMAIN_WORLD_WIDE_5G - {0x02,0x10}, //0x14, RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS - {0x00,0x12}, //0x15, RT_CHANNEL_DOMAIN_ETSI_NO_DFS - {0x00,0x13}, //0x16, RT_CHANNEL_DOMAIN_KOREA_NO_DFS - {0x03,0x12}, //0x17, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS - {0x05,0x08}, //0x18, RT_CHANNEL_DOMAIN_PAKISTAN_NO_DFS - {0x02,0x08}, //0x19, RT_CHANNEL_DOMAIN_TAIWAN2_NO_DFS - {0x00,0x00}, //0x1A, - {0x00,0x00}, //0x1B, - {0x00,0x00}, //0x1C, - {0x00,0x00}, //0x1D, - {0x00,0x00}, //0x1E, - {0x05,0x04}, //0x1F, RT_CHANNEL_DOMAIN_WORLD_WIDE_ONLY_5G - //===== 0x20 ~ 0x7F ,New Define ===== - {0x00,0x00}, //0x20, RT_CHANNEL_DOMAIN_WORLD_NULL - {0x01,0x00}, //0x21, RT_CHANNEL_DOMAIN_ETSI1_NULL - {0x02,0x00}, //0x22, RT_CHANNEL_DOMAIN_FCC1_NULL - {0x03,0x00}, //0x23, RT_CHANNEL_DOMAIN_MKK1_NULL - {0x04,0x00}, //0x24, RT_CHANNEL_DOMAIN_ETSI2_NULL - {0x02,0x04}, //0x25, RT_CHANNEL_DOMAIN_FCC1_FCC1 - {0x00,0x01}, //0x26, RT_CHANNEL_DOMAIN_WORLD_ETSI1 - {0x03,0x0C}, //0x27, RT_CHANNEL_DOMAIN_MKK1_MKK1 - {0x00,0x0B}, //0x28, RT_CHANNEL_DOMAIN_WORLD_KCC1 - {0x00,0x05}, //0x29, RT_CHANNEL_DOMAIN_WORLD_FCC2 - {0x00,0x00}, //0x2A, - {0x00,0x00}, //0x2B, - {0x00,0x00}, //0x2C, - {0x00,0x00}, //0x2D, - {0x00,0x00}, //0x2E, - {0x00,0x00}, //0x2F, - {0x00,0x06}, //0x30, RT_CHANNEL_DOMAIN_WORLD_FCC3 - {0x00,0x07}, //0x31, RT_CHANNEL_DOMAIN_WORLD_FCC4 - {0x00,0x08}, //0x32, RT_CHANNEL_DOMAIN_WORLD_FCC5 - {0x00,0x09}, //0x33, RT_CHANNEL_DOMAIN_WORLD_FCC6 - {0x02,0x0A}, //0x34, RT_CHANNEL_DOMAIN_FCC1_FCC7 - {0x00,0x02}, //0x35, RT_CHANNEL_DOMAIN_WORLD_ETSI2 - {0x00,0x03}, //0x36, RT_CHANNEL_DOMAIN_WORLD_ETSI3 - {0x03,0x0D}, //0x37, RT_CHANNEL_DOMAIN_MKK1_MKK2 - {0x03,0x0E}, //0x38, RT_CHANNEL_DOMAIN_MKK1_MKK3 - {0x02,0x0F}, //0x39, RT_CHANNEL_DOMAIN_FCC1_NCC1 - {0x00,0x00}, //0x3A, - {0x00,0x00}, //0x3B, - {0x00,0x00}, //0x3C, - {0x00,0x00}, //0x3D, - {0x00,0x00}, //0x3E, - {0x00,0x00}, //0x3F, - {0x02,0x10}, //0x40, RT_CHANNEL_DOMAIN_FCC1_NCC2 - {0x03,0x00}, //0x41, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G + /* 0x00 ~ 0x1F , Old Define ===== */ + {0x02,0x11}, /* 0x00, RT_CHANNEL_DOMAIN_FCC */ + {0x02,0x0A}, /* 0x01, RT_CHANNEL_DOMAIN_IC */ + {0x01,0x01}, /* 0x02, RT_CHANNEL_DOMAIN_ETSI */ + {0x01,0x00}, /* 0x03, RT_CHANNEL_DOMAIN_SPAIN */ + {0x01,0x00}, /* 0x04, RT_CHANNEL_DOMAIN_FRANCE */ + {0x03,0x00}, /* 0x05, RT_CHANNEL_DOMAIN_MKK */ + {0x03,0x00}, /* 0x06, RT_CHANNEL_DOMAIN_MKK1 */ + {0x01,0x09}, /* 0x07, RT_CHANNEL_DOMAIN_ISRAEL */ + {0x03,0x09}, /* 0x08, RT_CHANNEL_DOMAIN_TELEC */ + {0x03,0x00}, /* 0x09, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN */ + {0x00,0x00}, /* 0x0A, RT_CHANNEL_DOMAIN_WORLD_WIDE_13 */ + {0x02,0x0F}, /* 0x0B, RT_CHANNEL_DOMAIN_TAIWAN */ + {0x01,0x08}, /* 0x0C, RT_CHANNEL_DOMAIN_CHINA */ + {0x02,0x06}, /* 0x0D, RT_CHANNEL_DOMAIN_SINGAPORE_INDIA_MEXICO */ + {0x02,0x0B}, /* 0x0E, RT_CHANNEL_DOMAIN_KOREA */ + {0x02,0x09}, /* 0x0F, RT_CHANNEL_DOMAIN_TURKEY */ + {0x01,0x01}, /* 0x10, RT_CHANNEL_DOMAIN_JAPAN */ + {0x02,0x05}, /* 0x11, RT_CHANNEL_DOMAIN_FCC_NO_DFS */ + {0x01,0x12}, /* 0x12, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS */ + {0x00,0x04}, /* 0x13, RT_CHANNEL_DOMAIN_WORLD_WIDE_5G */ + {0x02,0x10}, /* 0x14, RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS */ + {0x00,0x12}, /* 0x15, RT_CHANNEL_DOMAIN_ETSI_NO_DFS */ + {0x00,0x13}, /* 0x16, RT_CHANNEL_DOMAIN_KOREA_NO_DFS */ + {0x03,0x12}, /* 0x17, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS */ + {0x05,0x08}, /* 0x18, RT_CHANNEL_DOMAIN_PAKISTAN_NO_DFS */ + {0x02,0x08}, /* 0x19, RT_CHANNEL_DOMAIN_TAIWAN2_NO_DFS */ + {0x00,0x00}, /* 0x1A, */ + {0x00,0x00}, /* 0x1B, */ + {0x00,0x00}, /* 0x1C, */ + {0x00,0x00}, /* 0x1D, */ + {0x00,0x00}, /* 0x1E, */ + {0x05,0x04}, /* 0x1F, RT_CHANNEL_DOMAIN_WORLD_WIDE_ONLY_5G */ + /* 0x20 ~ 0x7F ,New Define ===== */ + {0x00,0x00}, /* 0x20, RT_CHANNEL_DOMAIN_WORLD_NULL */ + {0x01,0x00}, /* 0x21, RT_CHANNEL_DOMAIN_ETSI1_NULL */ + {0x02,0x00}, /* 0x22, RT_CHANNEL_DOMAIN_FCC1_NULL */ + {0x03,0x00}, /* 0x23, RT_CHANNEL_DOMAIN_MKK1_NULL */ + {0x04,0x00}, /* 0x24, RT_CHANNEL_DOMAIN_ETSI2_NULL */ + {0x02,0x04}, /* 0x25, RT_CHANNEL_DOMAIN_FCC1_FCC1 */ + {0x00,0x01}, /* 0x26, RT_CHANNEL_DOMAIN_WORLD_ETSI1 */ + {0x03,0x0C}, /* 0x27, RT_CHANNEL_DOMAIN_MKK1_MKK1 */ + {0x00,0x0B}, /* 0x28, RT_CHANNEL_DOMAIN_WORLD_KCC1 */ + {0x00,0x05}, /* 0x29, RT_CHANNEL_DOMAIN_WORLD_FCC2 */ + {0x00,0x00}, /* 0x2A, */ + {0x00,0x00}, /* 0x2B, */ + {0x00,0x00}, /* 0x2C, */ + {0x00,0x00}, /* 0x2D, */ + {0x00,0x00}, /* 0x2E, */ + {0x00,0x00}, /* 0x2F, */ + {0x00,0x06}, /* 0x30, RT_CHANNEL_DOMAIN_WORLD_FCC3 */ + {0x00,0x07}, /* 0x31, RT_CHANNEL_DOMAIN_WORLD_FCC4 */ + {0x00,0x08}, /* 0x32, RT_CHANNEL_DOMAIN_WORLD_FCC5 */ + {0x00,0x09}, /* 0x33, RT_CHANNEL_DOMAIN_WORLD_FCC6 */ + {0x02,0x0A}, /* 0x34, RT_CHANNEL_DOMAIN_FCC1_FCC7 */ + {0x00,0x02}, /* 0x35, RT_CHANNEL_DOMAIN_WORLD_ETSI2 */ + {0x00,0x03}, /* 0x36, RT_CHANNEL_DOMAIN_WORLD_ETSI3 */ + {0x03,0x0D}, /* 0x37, RT_CHANNEL_DOMAIN_MKK1_MKK2 */ + {0x03,0x0E}, /* 0x38, RT_CHANNEL_DOMAIN_MKK1_MKK3 */ + {0x02,0x0F}, /* 0x39, RT_CHANNEL_DOMAIN_FCC1_NCC1 */ + {0x00,0x00}, /* 0x3A, */ + {0x00,0x00}, /* 0x3B, */ + {0x00,0x00}, /* 0x3C, */ + {0x00,0x00}, /* 0x3D, */ + {0x00,0x00}, /* 0x3E, */ + {0x00,0x00}, /* 0x3F, */ + {0x02,0x10}, /* 0x40, RT_CHANNEL_DOMAIN_FCC1_NCC2 */ + {0x03,0x00}, /* 0x41, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G */ }; -static RT_CHANNEL_PLAN_MAP RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03,0x02}; //use the conbination for max channel numbers +static RT_CHANNEL_PLAN_MAP RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03,0x02}; /* use the conbination for max channel numbers */ /* * Search the @param channel_num in given @param channel_set @@ -280,10 +256,7 @@ int init_hw_mlme_ext(_adapter *padapter) { struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - //set_opmode_cmd(padapter, infra_client_with_mlme);//removed - set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); - return _SUCCESS; } @@ -296,12 +269,12 @@ static void init_mlme_ext_priv_value(_adapter* padapter) u8 i; #endif - //unsigned char default_channel_set[MAX_CHANNEL_NUM] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 0}; + /* unsigned char default_channel_set[MAX_CHANNEL_NUM] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 0}; */ unsigned char mixed_datarate[NumRates] = {_1M_RATE_, _2M_RATE_, _5M_RATE_, _11M_RATE_, _6M_RATE_,_9M_RATE_, _12M_RATE_, _18M_RATE_, _24M_RATE_, _36M_RATE_, _48M_RATE_, _54M_RATE_, 0xff}; unsigned char mixed_basicrate[NumRates] ={_1M_RATE_, _2M_RATE_, _5M_RATE_, _11M_RATE_, _6M_RATE_, _12M_RATE_, _24M_RATE_, 0xff,}; ATOMIC_SET(&pmlmeext->event_seq, 0); - pmlmeext->mgnt_seq = 0;//reset to zero when disconnect at client mode + pmlmeext->mgnt_seq = 0;/* reset to zero when disconnect at client mode */ pmlmeext->cur_channel = padapter->registrypriv.channel; pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; @@ -313,8 +286,8 @@ static void init_mlme_ext_priv_value(_adapter* padapter) pmlmeext->cur_wireless_mode = padapter->registrypriv.wireless_mode; - //_rtw_memcpy(pmlmeext->channel_set, DefaultChannelPlan[padapter->mlmepriv.ChannelPlan].Channel, DefaultChannelPlan[padapter->mlmepriv.ChannelPlan].Len); - //_rtw_memcpy(pmlmeext->channel_set, default_channel_set, MAX_CHANNEL_NUM); + /* _rtw_memcpy(pmlmeext->channel_set, DefaultChannelPlan[padapter->mlmepriv.ChannelPlan].Channel, DefaultChannelPlan[padapter->mlmepriv.ChannelPlan].Len); */ + /* _rtw_memcpy(pmlmeext->channel_set, default_channel_set, MAX_CHANNEL_NUM); */ _rtw_memcpy(pmlmeext->datarate, mixed_datarate, NumRates); _rtw_memcpy(pmlmeext->basicrate, mixed_basicrate, NumRates); @@ -455,7 +428,7 @@ static u8 init_channel_set(_adapter* padapter, u8 ChannelPlan, RT_CHANNEL_INFO * { channel_set[chanset_size].ChannelNum = RTW_ChannelPlan2G[Index2G].Channel[index]; - if ( (RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN == ChannelPlan) ||//Channel 1~11 is active, and 12~14 is passive + if ( (RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN == ChannelPlan) ||/* Channel 1~11 is active, and 12~14 is passive */ (RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G == ChannelPlan) ) { if (channel_set[chanset_size].ChannelNum >= 1 && channel_set[chanset_size].ChannelNum <= 11) @@ -465,7 +438,7 @@ static u8 init_channel_set(_adapter* padapter, u8 ChannelPlan, RT_CHANNEL_INFO * } else if (RT_CHANNEL_DOMAIN_WORLD_WIDE_13 == ChannelPlan || RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == ChannelPlan || - RT_CHANNEL_DOMAIN_2G_WORLD == Index2G)// channel 12~13, passive scan + RT_CHANNEL_DOMAIN_2G_WORLD == Index2G)/* channel 12~13, passive scan */ { if (channel_set[chanset_size].ChannelNum <= 11) channel_set[chanset_size].ScanType = SCAN_ACTIVE; @@ -490,7 +463,7 @@ static u8 init_channel_set(_adapter* padapter, u8 ChannelPlan, RT_CHANNEL_INFO * if ( channel_set[chanset_size].ChannelNum <= 48 || channel_set[chanset_size].ChannelNum >= 149 ) { - if (RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == ChannelPlan)//passive scan for all 5G channels + if (RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == ChannelPlan)/* passive scan for all 5G channels */ channel_set[chanset_size].ScanType = SCAN_PASSIVE; else channel_set[chanset_size].ScanType = SCAN_ACTIVE; @@ -504,7 +477,7 @@ static u8 init_channel_set(_adapter* padapter, u8 ChannelPlan, RT_CHANNEL_INFO * if ( RTW_ChannelPlan5G[Index5G].Channel[index] <= 48 || RTW_ChannelPlan5G[Index5G].Channel[index] >= 149 ) { channel_set[chanset_size].ChannelNum = RTW_ChannelPlan5G[Index5G].Channel[index]; - if (RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == ChannelPlan)//passive scan for all 5G channels + if (RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == ChannelPlan)/* passive scan for all 5G channels */ channel_set[chanset_size].ScanType = SCAN_PASSIVE; else channel_set[chanset_size].ScanType = SCAN_ACTIVE; @@ -526,12 +499,12 @@ int init_mlme_ext_priv(_adapter* padapter) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - // We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). - //_rtw_memset((u8 *)pmlmeext, 0, sizeof(struct mlme_ext_priv)); + /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ + /* _rtw_memset((u8 *)pmlmeext, 0, sizeof(struct mlme_ext_priv)); */ pmlmeext->padapter = padapter; - //fill_fwpriv(padapter, &(pmlmeext->fwpriv)); + /* fill_fwpriv(padapter, &(pmlmeext->fwpriv)); */ init_mlme_ext_priv_value(padapter); pmlmeinfo->bAcceptAddbaReq = pregistrypriv->bAcceptAddbaReq; @@ -568,12 +541,12 @@ void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext) { _cancel_timer_ex(&pmlmeext->survey_timer); _cancel_timer_ex(&pmlmeext->link_timer); - //_cancel_timer_ex(&pmlmeext->ADDBA_timer); + /* _cancel_timer_ex(&pmlmeext->ADDBA_timer); */ } } static u8 cmp_pkt_chnl_diff(_adapter *padapter,u8* pframe,uint packet_len) -{ // if the channel is same, return 0. else return channel differential +{ /* if the channel is same, return 0. else return channel differential */ uint len; u8 channel; u8 *p; @@ -603,7 +576,7 @@ static void _mgt_dispatcher(_adapter *padapter, struct mlme_handler *ptable, uni if (ptable->func) { - //receive the frames that ra(a1) is my address or ra(a1) is bc address. + /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ if (!_rtw_memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) && !_rtw_memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN)) { @@ -621,7 +594,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) struct mlme_handler *ptable; #ifdef CONFIG_AP_MODE struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -#endif //CONFIG_AP_MODE +#endif /* CONFIG_AP_MODE */ u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; u8 *pframe = precv_frame->u.hdr.rx_data; struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, GetAddr2Ptr(pframe)); @@ -636,7 +609,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) return; } - //receive the frames that ra(a1) is my address or ra(a1) is bc address. + /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ if (!_rtw_memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) && !_rtw_memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN)) { @@ -649,13 +622,13 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_TDLS if ((index << 4)==WIFI_ACTION){ - //category==public (4), action==TDLS_DISCOVERY_RESPONSE + /* category==public (4), action==TDLS_DISCOVERY_RESPONSE */ if (*(pframe+24)==0x04 && *(pframe+25)==TDLS_DISCOVERY_RESPONSE){ DBG_88E("recv tdls discovery response frame\n"); On_TDLS_Dis_Rsp(padapter, precv_frame); } } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ if (index > 13) { @@ -682,8 +655,8 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) if (GetRetry(pframe)) { - //RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("drop due to decache!\n")); - //return; + /* RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("drop due to decache!\n")); */ + /* return; */ } #endif @@ -695,7 +668,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) ptable->func = &OnAuth; else ptable->func = &OnAuthClient; - //pass through + /* pass through */ case WIFI_ASSOCREQ: case WIFI_REASSOCREQ: _mgt_dispatcher(padapter, ptable, precv_frame); @@ -720,7 +693,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) _mgt_dispatcher(padapter, ptable, precv_frame); break; case WIFI_ACTION: - //if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) + /* if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) */ _mgt_dispatcher(padapter, ptable, precv_frame); break; default: @@ -756,7 +729,7 @@ static u32 p2p_listen_state_process(_adapter *padapter, unsigned char *da) } #else - // do nothing if the device name is empty + /* do nothing if the device name is empty */ if ( !padapter->wdinfo.device_name_len ) { response = false; @@ -768,7 +741,7 @@ static u32 p2p_listen_state_process(_adapter *padapter, unsigned char *da) return _SUCCESS; } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ /**************************************************************************** @@ -801,21 +774,21 @@ unsigned int OnProbeReq(_adapter *padapter, union recv_frame *precv_frame) !rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) ) { - // Commented by Albert 2011/03/17 - // mcs_rate = 0 -> CCK 1M rate - // mcs_rate = 1 -> CCK 2M rate - // mcs_rate = 2 -> CCK 5.5M rate - // mcs_rate = 3 -> CCK 11M rate - // In the P2P mode, the driver should not support the CCK rate + /* Commented by Albert 2011/03/17 */ + /* mcs_rate = 0 -> CCK 1M rate */ + /* mcs_rate = 1 -> CCK 2M rate */ + /* mcs_rate = 2 -> CCK 5.5M rate */ + /* mcs_rate = 3 -> CCK 11M rate */ + /* In the P2P mode, the driver should not support the CCK rate */ - // Commented by Kurt 2012/10/16 - // IOT issue: Google Nexus7 use 1M rate to send p2p_probe_req after GO nego completed and Nexus7 is client + /* Commented by Kurt 2012/10/16 */ + /* IOT issue: Google Nexus7 use 1M rate to send p2p_probe_req after GO nego completed and Nexus7 is client */ #ifdef CONFIG_WIFI_TEST if ( pattrib->mcs_rate <= 3 ) { wifi_test_chk_rate = 0; } -#endif //CONFIG_WIFI_TEST +#endif /* CONFIG_WIFI_TEST */ if ( wifi_test_chk_rate == 1 ) { @@ -824,7 +797,7 @@ unsigned int OnProbeReq(_adapter *padapter, union recv_frame *precv_frame) if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE)) { #ifndef CONFIG_IOCTL_CFG80211 -// FIXME +/* FIXME */ report_survey_event(padapter, precv_frame); #endif p2p_listen_state_process( padapter, get_sa(pframe)); @@ -841,7 +814,7 @@ unsigned int OnProbeReq(_adapter *padapter, union recv_frame *precv_frame) } _continue: -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { @@ -855,13 +828,13 @@ _continue: } - //DBG_88E("+OnProbeReq\n"); + /* DBG_88E("+OnProbeReq\n"); */ #ifdef CONFIG_CONCURRENT_MODE if (((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) && check_buddy_fwstate(padapter, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)) { - //don't process probe req + /* don't process probe req */ return _SUCCESS; } #endif @@ -870,7 +843,7 @@ _continue: len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); - //check (wildcard) SSID + /* check (wildcard) SSID */ if (p != NULL) { if (is_valid_p2p_probereq == true) @@ -890,7 +863,7 @@ _issue_probersp: if (check_fwstate(pmlmepriv, _FW_LINKED) == true && pmlmepriv->cur_network.join_res == true) { - //DBG_88E("+issue_probersp during ap mode\n"); + /* DBG_88E("+issue_probersp during ap mode\n"); */ issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq); } @@ -1013,7 +986,7 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) { if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) { - //we should update current network before auth, or some IE is wrong + /* we should update current network before auth, or some IE is wrong */ pbss = (WLAN_BSSID_EX*)rtw_malloc(sizeof(WLAN_BSSID_EX)); if (pbss) { if (collect_bss_info(padapter, precv_frame, pbss) == _SUCCESS) { @@ -1023,13 +996,13 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) rtw_mfree((u8*)pbss, sizeof(WLAN_BSSID_EX)); } - //check the vendor of the assoc AP + /* check the vendor of the assoc AP */ pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe+sizeof(struct rtw_ieee80211_hdr_3addr), len-sizeof(struct rtw_ieee80211_hdr_3addr)); - //update TSF Value + /* update TSF Value */ update_TSF(pmlmeext, pframe, len); - //start auth + /* start auth */ start_clnt_auth(padapter); return _SUCCESS; @@ -1040,16 +1013,16 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) if ((psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe))) != NULL) { #ifdef CONFIG_PATCH_JOIN_WRONG_CHANNEL - //Merge from 8712 FW code + /* Merge from 8712 FW code */ if (cmp_pkt_chnl_diff(padapter,pframe,len) != 0) - { // join wrong channel, deauth and reconnect + { /* join wrong channel, deauth and reconnect */ issue_deauth(padapter, (&(pmlmeinfo->network))->MacAddress, WLAN_REASON_DEAUTH_LEAVING); report_del_sta_event(padapter,(&(pmlmeinfo->network))->MacAddress, WLAN_REASON_JOIN_WRONG_CHANNEL); pmlmeinfo->state &= (~WIFI_FW_ASSOC_SUCCESS); return _SUCCESS; } - #endif //CONFIG_PATCH_JOIN_WRONG_CHANNEL + #endif /* CONFIG_PATCH_JOIN_WRONG_CHANNEL */ ret = rtw_check_bcn_info(padapter, pframe, len); if (!ret) { @@ -1057,21 +1030,21 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) receive_disconnect(padapter, pmlmeinfo->network.MacAddress , 65535); return _SUCCESS; } - //update WMM, ERP in the beacon - //todo: the timer is used instead of the number of the beacon received + /* update WMM, ERP in the beacon */ + /* todo: the timer is used instead of the number of the beacon received */ if ((sta_rx_pkts(psta) & 0xf) == 0) { - //DBG_88E("update_bcn_info\n"); + /* DBG_88E("update_bcn_info\n"); */ update_beacon_info(padapter, pframe, len, psta); } #ifdef CONFIG_DFS - process_csa_ie(padapter, pframe, len); //channel switch announcement -#endif //CONFIG_DFS + process_csa_ie(padapter, pframe, len); /* channel switch announcement */ +#endif /* CONFIG_DFS */ #ifdef CONFIG_P2P_PS process_p2p_ps_ie(padapter, (pframe + WLAN_HDR_A3_LEN), (len - WLAN_HDR_A3_LEN)); -#endif //CONFIG_P2P_PS +#endif /* CONFIG_P2P_PS */ } } @@ -1079,34 +1052,34 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) { if ((psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe))) != NULL) { - //update WMM, ERP in the beacon - //todo: the timer is used instead of the number of the beacon received + /* update WMM, ERP in the beacon */ + /* todo: the timer is used instead of the number of the beacon received */ if ((sta_rx_pkts(psta) & 0xf) == 0) { - //DBG_88E("update_bcn_info\n"); + /* DBG_88E("update_bcn_info\n"); */ update_beacon_info(padapter, pframe, len, psta); } } else { - //allocate a new CAM entry for IBSS station + /* allocate a new CAM entry for IBSS station */ if ((cam_idx = allocate_fw_sta_entry(padapter)) == NUM_STA) { goto _END_ONBEACON_; } - //get supported rate + /* get supported rate */ if (update_sta_support_rate(padapter, (pframe + WLAN_HDR_A3_LEN + _BEACON_IE_OFFSET_), (len - WLAN_HDR_A3_LEN - _BEACON_IE_OFFSET_), cam_idx) == _FAIL) { pmlmeinfo->FW_sta_info[cam_idx].status = 0; goto _END_ONBEACON_; } - //update TSF Value + /* update TSF Value */ update_TSF(pmlmeext, pframe, len); - //report sta add event + /* report sta add event */ report_add_sta_event(padapter, GetAddr2Ptr(pframe), cam_idx); } } @@ -1141,10 +1114,10 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) if (((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) && check_buddy_fwstate(padapter, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)) { - //don't process auth request; + /* don't process auth request; */ return _SUCCESS; } -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) return _FAIL; @@ -1163,8 +1136,8 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) psecuritypriv->dot11PrivacyAlgrthm != _WEP104_) auth_mode = 0; - if ((algorithm > 0 && auth_mode == 0) || // rx a shared-key auth but shared not enabled - (algorithm == 0 && auth_mode == 1)) { // rx a open-system auth but shared-key is enabled + if ((algorithm > 0 && auth_mode == 0) || /* rx a shared-key auth but shared not enabled */ + (algorithm == 0 && auth_mode == 1)) { /* rx a open-system auth but shared-key is enabled */ DBG_88E("auth rejected due to bad alg [alg=%d, auth_mib=%d] %02X%02X%02X%02X%02X%02X\n", algorithm, auth_mode, sa[0], sa[1], sa[2], sa[3], sa[4], sa[5]); @@ -1180,7 +1153,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) pstat = rtw_get_stainfo(pstapriv, sa); if (pstat == NULL) { - // allocate a new one + /* allocate a new one */ DBG_88E("going to alloc stainfo for sa=%pM\n", sa); pstat = rtw_alloc_stainfo(pstapriv, sa); if (pstat == NULL) { @@ -1199,13 +1172,13 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) pstapriv->asoc_list_cnt--; if (pstat->expire_to > 0) { - //TODO: STA re_auth within expire_to + /* TODO: STA re_auth within expire_to */ } } _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); if (seq==1) { - //TODO: STA re_auth and auth timeout + /* TODO: STA re_auth and auth timeout */ } } @@ -1242,19 +1215,17 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) goto auth_fail; } } - else // shared system or auto authentication + else /* shared system or auto authentication */ { if (seq == 1) { - //prepare for the challenging txt... - - //get_random_bytes((void *)pstat->chg_txt, 128);//TODO: + /* prepare for the challenging txt... */ pstat->state &= ~WIFI_FW_AUTH_NULL; pstat->state |= WIFI_FW_AUTH_STATE; pstat->authalg = algorithm; pstat->auth_seq = 2; } else if (seq == 3) { - //checking for challenging txt... + /* checking for challenging txt... */ DBG_88E("checking for challenging txt...\n"); p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_ , _CHLGETXT_IE_, (int *)&ie_len, @@ -1269,7 +1240,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) if (_rtw_memcmp((void *)(p + 2), pstat->chg_txt, 128)) { pstat->state &= (~WIFI_FW_AUTH_STATE); pstat->state |= WIFI_FW_AUTH_SUCCESS; - // challenging txt is correct... + /* challenging txt is correct... */ pstat->expire_to = pstapriv->assoc_to; } else { DBG_88E("auth rejected because challenge failure!\n"); @@ -1284,7 +1255,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) } } - // Now, we are going to issue_auth... + /* Now, we are going to issue_auth... */ pstat->auth_seq = seq + 1; #ifdef CONFIG_NATIVEAP_MLME @@ -1327,7 +1298,7 @@ unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame) DBG_88E("%s\n", __func__); - //check A1 matches or not + /* check A1 matches or not */ if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), get_da(pframe), ETH_ALEN)) return _SUCCESS; @@ -1341,13 +1312,13 @@ unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame) if (status != 0) { DBG_88E("clnt auth fail, status: %d\n", status); - if (status == 13)//&& pmlmeinfo->auth_algo == dot11AuthAlgrthm_Auto) + if (status == 13)/* pmlmeinfo->auth_algo == dot11AuthAlgrthm_Auto) */ { if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared) pmlmeinfo->auth_algo = dot11AuthAlgrthm_Open; else pmlmeinfo->auth_algo = dot11AuthAlgrthm_Shared; - //pmlmeinfo->reauth_count = 0; + /* pmlmeinfo->reauth_count = 0; */ } set_link_timer(pmlmeext, 1); @@ -1358,13 +1329,13 @@ unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame) { if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared) { - // legendary shared system + /* legendary shared system */ p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _AUTH_IE_OFFSET_, _CHLGETXT_IE_, (int *)&len, pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_); if (p == NULL) { - //DBG_88E("marc: no challenge text?\n"); + /* DBG_88E("marc: no challenge text?\n"); */ goto authclnt_fail; } @@ -1377,7 +1348,7 @@ unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame) } else { - // open system + /* open system */ go2asoc = 1; } } @@ -1394,8 +1365,8 @@ unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame) } else { - // this is also illegal - //DBG_88E("marc: clnt auth failed due to illegal seq=%x\n", seq); + /* this is also illegal */ + /* DBG_88E("marc: clnt auth failed due to illegal seq=%x\n", seq); */ goto authclnt_fail; } @@ -1408,7 +1379,7 @@ unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame) authclnt_fail: - //pmlmeinfo->state &= ~(WIFI_FW_AUTH_STATE); + /* pmlmeinfo->state &= ~(WIFI_FW_AUTH_STATE); */ return _FAIL; @@ -1444,17 +1415,17 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_WFD u8 wfd_ie[ 128 ] = { 0x00 }; u32 wfd_ielen = 0; -#endif // CONFIG_WFD -#endif //CONFIG_P2P +#endif /* CONFIG_WFD */ +#endif /* CONFIG_P2P */ #ifdef CONFIG_CONCURRENT_MODE if (((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) && check_buddy_fwstate(padapter, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)) { - //don't process assoc request; + /* don't process assoc request; */ return _SUCCESS; } -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) return _FAIL; @@ -1465,7 +1436,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) reassoc = 0; ie_offset = _ASOCREQ_IE_OFFSET_; } - else // WIFI_REASSOCREQ + else /* WIFI_REASSOCREQ */ { reassoc = 1; ie_offset = _REASOCREQ_IE_OFFSET_; @@ -1493,7 +1464,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) DBG_88E("%s\n", __func__); - // check if this stat has been successfully authenticated/assocated + /* check if this stat has been successfully authenticated/assocated */ if (!((pstat->state) & WIFI_FW_AUTH_SUCCESS)) { if (!((pstat->state) & WIFI_FW_ASSOC_SUCCESS)) @@ -1513,7 +1484,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) pstat->state |= WIFI_FW_ASSOC_STATE; } pstat->capability = capab_info; - //now parse all ieee802_11 ie to point to elems + /* now parse all ieee802_11 ie to point to elems */ if (rtw_ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed || !elems.ssid) { DBG_88E("STA %pM sent invalid association request\n", @@ -1523,8 +1494,8 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) } - // now we should check all the fields... - // checking SSID + /* now we should check all the fields... */ + /* checking SSID */ p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SSID_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset); if (p == NULL) @@ -1532,11 +1503,11 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) status = _STATS_FAILURE_; } - if (ie_len == 0) // broadcast ssid, however it is not allowed in assocreq + if (ie_len == 0) /* broadcast ssid, however it is not allowed in assocreq */ status = _STATS_FAILURE_; else { - // check if ssid match + /* check if ssid match */ if (!_rtw_memcmp((void *)(p+2), cur->Ssid.Ssid, cur->Ssid.SsidLength)) status = _STATS_FAILURE_; @@ -1547,13 +1518,13 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) if (_STATS_SUCCESSFUL_ != status) goto OnAssocReqFail; - // check if the supported rate is ok + /* check if the supported rate is ok */ p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SUPPORTEDRATES_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset); if (p == NULL) { DBG_88E("Rx a sta assoc-req which supported rate is empty!\n"); - // use our own rate set as statoin used - //_rtw_memcpy(supportRate, AP_BSSRATE, AP_BSSRATE_LEN); - //supportRateNum = AP_BSSRATE_LEN; + /* use our own rate set as statoin used */ + /* _rtw_memcpy(supportRate, AP_BSSRATE, AP_BSSRATE_LEN); */ + /* supportRateNum = AP_BSSRATE_LEN; */ status = _STATS_FAILURE_; goto OnAssocReqFail; @@ -1574,15 +1545,15 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) } } - //todo: mask supportRate between AP & STA -> move to update raid - //get_matched_rate(pmlmeext, supportRate, &supportRateNum, 0); + /* todo: mask supportRate between AP & STA -> move to update raid */ + /* get_matched_rate(pmlmeext, supportRate, &supportRateNum, 0); */ - //update station supportRate + /* update station supportRate */ pstat->bssratelen = supportRateNum; _rtw_memcpy(pstat->bssrateset, supportRate, supportRateNum); UpdateBrateTblForSoftAP(pstat->bssrateset, pstat->bssratelen); - //check RSN/WPA/WPS + /* check RSN/WPA/WPS */ pstat->dot8021xalg = 0; pstat->wpa_psk = 0; pstat->wpa_group_cipher = 0; @@ -1599,7 +1570,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) if (rtw_parse_wpa2_ie(wpa_ie-2, wpa_ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { - pstat->dot8021xalg = 1;//psk, todo:802.1x + pstat->dot8021xalg = 1;/* psk, todo:802.1x */ pstat->wpa_psk |= BIT(1); pstat->wpa2_group_cipher = group_cipher&psecuritypriv->wpa2_group_cipher; @@ -1625,7 +1596,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) if (rtw_parse_wpa_ie(wpa_ie-2, wpa_ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { - pstat->dot8021xalg = 1;//psk, todo:802.1x + pstat->dot8021xalg = 1;/* psk, todo:802.1x */ pstat->wpa_psk |= BIT(0); pstat->wpa_group_cipher = group_cipher&psecuritypriv->wpa_group_cipher; @@ -1652,16 +1623,15 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) goto OnAssocReqFail; pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS); - //if (hapd->conf->wps_state && wpa_ie == NULL) { //todo: to check ap if supporting WPS if (wpa_ie == NULL) { if (elems.wps_ie) { DBG_88E("STA included WPS IE in " "(Re)Association Request - assume WPS is " "used\n"); pstat->flags |= WLAN_STA_WPS; - //wpabuf_free(sta->wps_ie); - //sta->wps_ie = wpabuf_alloc_copy(elems.wps_ie + 4, - // elems.wps_ie_len - 4); + /* wpabuf_free(sta->wps_ie); */ + /* sta->wps_ie = wpabuf_alloc_copy(elems.wps_ie + 4, */ + /* elems.wps_ie_len - 4); */ } else { DBG_88E("STA did not include WPA/RSN IE " "in (Re)Association Request - possible WPS " @@ -1670,8 +1640,8 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) } - // AP support WPA/RSN, and sta is going to do WPS, but AP is not ready - // that the selected registrar of AP is _FLASE + /* AP support WPA/RSN, and sta is going to do WPS, but AP is not ready */ + /* that the selected registrar of AP is _FLASE */ if ((psecuritypriv->wpa_psk >0) && (pstat->flags & (WLAN_STA_WPS|WLAN_STA_MAYBE_WPS))) { @@ -1727,7 +1697,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) } - // check if there is WMM IE & support WWM-PS + /* check if there is WMM IE & support WWM-PS */ pstat->flags &= ~WLAN_STA_WME; pstat->qos_option = 0; pstat->qos_info = 0; @@ -1821,13 +1791,11 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) DBG_88E("HT: %pM tried to " "use TKIP with HT association\n", pstat->hwaddr); - //status = WLAN_STATUS_CIPHER_REJECTED_PER_POLICY; - //goto OnAssocReqFail; + /* status = WLAN_STATUS_CIPHER_REJECTED_PER_POLICY; */ + /* goto OnAssocReqFail; */ } #endif /* CONFIG_80211N_HT */ - // - //if (hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G)//? pstat->flags |= WLAN_STA_NONERP; for (i = 0; i < pstat->bssratelen; i++) { if ((pstat->bssrateset[i] & 0x7f) > 22) { @@ -1877,13 +1845,13 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) #endif } pstat->p2p_status_code = p2p_status_code; -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ - //TODO: identify_proprietary_vendor_ie(); - // Realtek proprietary IE - // identify if this is Broadcom sta - // identify if this is ralink sta - // Customer proprietary IE + /* TODO: identify_proprietary_vendor_ie(); */ + /* Realtek proprietary IE */ + /* identify if this is Broadcom sta */ + /* identify if this is ralink sta */ + /* Customer proprietary IE */ @@ -1895,7 +1863,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) if (pstapriv->sta_aid[pstat->aid - 1] == NULL) break; - //if (pstat->aid > NUM_STA) { + /* if (pstat->aid > NUM_STA) { */ if (pstat->aid > pstapriv->max_num_sta) { pstat->aid = 0; @@ -1934,21 +1902,21 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) } _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); - // now the station is qualified to join our BSS... + /* now the station is qualified to join our BSS... */ if (pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (_STATS_SUCCESSFUL_==status)) { #ifdef CONFIG_NATIVEAP_MLME - //.1 bss_cap_update & sta_info_update + /* 1 bss_cap_update & sta_info_update */ bss_cap_update_on_sta_join(padapter, pstat); sta_info_update(padapter, pstat); - //issue assoc rsp before notify station join event. + /* issue assoc rsp before notify station join event. */ if (frame_type == WIFI_ASSOCREQ) issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP); else issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP); - //.2 - report to upper layer + /* 2 - report to upper layer */ DBG_88E("indicate_sta_join_event to upper layer - hostapd\n"); #ifdef CONFIG_IOCTL_CFG80211 if (1) { @@ -1956,7 +1924,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) rtw_cfg80211_indicate_sta_assoc(padapter, pframe, pkt_len); #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) && !defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) rtw_cfg80211_indicate_sta_assoc(padapter, pframe, pkt_len); - #else //(LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) && !defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) + #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) && !defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) */ _enter_critical_bh(&pstat->lock, &irqL); if (pstat->passoc_req) { @@ -1972,25 +1940,16 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) pstat->assoc_req_len = pkt_len; } _exit_critical_bh(&pstat->lock, &irqL); - #endif //(LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) && !defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) + #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) && !defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) */ } else - #endif //CONFIG_IOCTL_CFG80211 + #endif /* CONFIG_IOCTL_CFG80211 */ { rtw_indicate_sta_assoc_event(padapter, pstat); } - //.3-(1) report sta add event + /* 3-(1) report sta add event */ report_add_sta_event(padapter, pstat->hwaddr, pstat->aid); - -/* - //issue assoc rsp before notify station join event. - if (frame_type == WIFI_ASSOCREQ) - issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP); - else - issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP); -*/ - #endif } @@ -2031,14 +1990,14 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - //WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); + /* WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); */ u8 *pframe = precv_frame->u.hdr.rx_data; uint pkt_len = precv_frame->u.hdr.len; PNDIS_802_11_VARIABLE_IEs pWapiIE = NULL; DBG_88E("%s\n", __func__); - //check A1 matches or not + /* check A1 matches or not */ if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), get_da(pframe), ETH_ALEN)) return _SUCCESS; @@ -2050,7 +2009,7 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) _cancel_timer_ex(&pmlmeext->link_timer); - //status + /* status */ status = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN + 2)); if (status > 0) { DBG_88E("assoc reject, status code: %d\n", status); @@ -2059,27 +2018,27 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) goto report_assoc_result; } - //get capabilities + /* get capabilities */ pmlmeinfo->capability = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN)); - //set slot time + /* set slot time */ pmlmeinfo->slotTime = (pmlmeinfo->capability & BIT(10))? 9: 20; - //AID + /* AID */ res = pmlmeinfo->aid = (int)(le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN + 4))&0x3fff); - //following are moved to join event callback function - //to handle HT, WMM, rate adaptive, update MAC reg - //for not to handle the synchronous IO in the tasklet + /* following are moved to join event callback function */ + /* to handle HT, WMM, rate adaptive, update MAC reg */ + /* for not to handle the synchronous IO in the tasklet */ for (i = (6 + WLAN_HDR_A3_LEN); i < pkt_len;) { pIE = (PNDIS_802_11_VARIABLE_IEs)(pframe + i); switch (pIE->ElementID) { case _VENDOR_SPECIFIC_IE_: - if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6)) //WMM + if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6)) /* WMM */ WMM_param_handler(padapter, pIE); #if defined(CONFIG_P2P) && defined(CONFIG_WFD) - else if ( _rtw_memcmp(pIE->data, WFD_OUI, 4)) { //WFD + else if ( _rtw_memcmp(pIE->data, WFD_OUI, 4)) { /* WFD */ DBG_88E( "[%s] Found WFD IE\n", __func__ ); WFD_info_handler( padapter, pIE ); } @@ -2090,10 +2049,10 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) pWapiIE = pIE; break; #endif - case _HT_CAPABILITY_IE_: //HT caps + case _HT_CAPABILITY_IE_: /* HT caps */ HT_caps_handler(padapter, pIE); break; - case _HT_EXTRA_INFO_IE_: //HT info + case _HT_EXTRA_INFO_IE_: /* HT info */ HT_info_handler(padapter, pIE); break; case _ERPINFO_IE_: @@ -2112,7 +2071,7 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) pmlmeinfo->state &= (~WIFI_FW_ASSOC_STATE); pmlmeinfo->state |= WIFI_FW_ASSOC_SUCCESS; - //Update Basic Rate Table for spec, 2010-12-28 , by thomas + /* Update Basic Rate Table for spec, 2010-12-28 , by thomas */ UpdateBrateTbl(padapter, pmlmeinfo->network.SupportedRates); report_assoc_result: @@ -2136,9 +2095,9 @@ unsigned int OnDeAuth(_adapter *padapter, union recv_frame *precv_frame) u8 *pframe = precv_frame->u.hdr.rx_data; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ - //check A3 + /* check A3 */ if (!(_rtw_memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) return _SUCCESS; @@ -2148,7 +2107,7 @@ unsigned int OnDeAuth(_adapter *padapter, union recv_frame *precv_frame) _cancel_timer_ex( &pwdinfo->reset_ch_sitesurvey ); _set_timer( &pwdinfo->reset_ch_sitesurvey, 10 ); } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN)); @@ -2161,9 +2120,9 @@ unsigned int OnDeAuth(_adapter *padapter, union recv_frame *precv_frame) struct sta_info *psta; struct sta_priv *pstapriv = &padapter->stapriv; - //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); - //rtw_free_stainfo(padapter, psta); - //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + /* _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); */ + /* rtw_free_stainfo(padapter, psta); */ + /* _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); */ DBG_88E_LEVEL(_drv_always_, "ap recv deauth reason code(%d) sta:%pM\n", reason, GetAddr2Ptr(pframe)); @@ -2211,9 +2170,9 @@ unsigned int OnDisassoc(_adapter *padapter, union recv_frame *precv_frame) u8 *pframe = precv_frame->u.hdr.rx_data; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ - //check A3 + /* check A3 */ if (!(_rtw_memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) return _SUCCESS; @@ -2223,7 +2182,7 @@ unsigned int OnDisassoc(_adapter *padapter, union recv_frame *precv_frame) _cancel_timer_ex( &pwdinfo->reset_ch_sitesurvey ); _set_timer( &pwdinfo->reset_ch_sitesurvey, 10 ); } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN)); @@ -2236,9 +2195,9 @@ unsigned int OnDisassoc(_adapter *padapter, union recv_frame *precv_frame) struct sta_info *psta; struct sta_priv *pstapriv = &padapter->stapriv; - //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); - //rtw_free_stainfo(padapter, psta); - //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); + /* _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); */ + /* rtw_free_stainfo(padapter, psta); */ + /* _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); */ DBG_88E_LEVEL(_drv_always_, "ap recv disassoc reason code(%d) sta:%pM\n", reason, GetAddr2Ptr(pframe)); @@ -2406,15 +2365,10 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) u8 *pframe = precv_frame->u.hdr.rx_data; struct sta_priv *pstapriv = &padapter->stapriv; #ifdef CONFIG_80211N_HT - //check RA matches or not - if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe), ETH_ALEN))//for if1, sta/ap mode + /* check RA matches or not */ + if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe), ETH_ALEN))/* for if1, sta/ap mode */ return _SUCCESS; -/* - //check A1 matches or not - if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), get_da(pframe), ETH_ALEN)) - return _SUCCESS; -*/ DBG_88E("%s\n", __func__); if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) @@ -2430,17 +2384,17 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); category = frame_body[0]; - if (category == RTW_WLAN_CATEGORY_BACK)// representing Block Ack + if (category == RTW_WLAN_CATEGORY_BACK)/* representing Block Ack */ { #ifdef CONFIG_TDLS if ((psta->tdls_sta_state & TDLS_LINKED_STATE) && (psta->htpriv.ht_option==true) && (psta->htpriv.ampdu_enable==true) ) { - //do nothing; just don't want to return _SUCCESS; + /* do nothing; just don't want to return _SUCCESS; */ } else -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ if (!pmlmeinfo->HT_enable) { return _SUCCESS; @@ -2450,10 +2404,10 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) DBG_88E("%s, action=%d\n", __func__, action); switch (action) { - case RTW_WLAN_ACTION_ADDBA_REQ: //ADDBA request + case RTW_WLAN_ACTION_ADDBA_REQ: /* ADDBA request */ _rtw_memcpy(&(pmlmeinfo->ADDBA_req), &(frame_body[2]), sizeof(struct ADDBA_request)); - //process_addba_req(padapter, (u8*)&(pmlmeinfo->ADDBA_req), GetAddr3Ptr(pframe)); + /* process_addba_req(padapter, (u8*)&(pmlmeinfo->ADDBA_req), GetAddr3Ptr(pframe)); */ process_addba_req(padapter, (u8*)&(pmlmeinfo->ADDBA_req), addr); if (pmlmeinfo->bAcceptAddbaReq == true) @@ -2462,19 +2416,18 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) } else { - issue_action_BA(padapter, addr, RTW_WLAN_ACTION_ADDBA_RESP, 37);//reject ADDBA Req + issue_action_BA(padapter, addr, RTW_WLAN_ACTION_ADDBA_RESP, 37);/* reject ADDBA Req */ } break; - case RTW_WLAN_ACTION_ADDBA_RESP: //ADDBA response + case RTW_WLAN_ACTION_ADDBA_RESP: /* ADDBA response */ - //status = frame_body[3] | (frame_body[4] << 8); //endian issue status = RTW_GET_LE16(&frame_body[3]); tid = ((frame_body[5] >> 2) & 0x7); if (status == 0) - { //successful + { /* successful */ DBG_88E("agg_enable for TID=%d\n", tid); psta->htpriv.agg_enable_bitmap |= 1 << tid; psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); @@ -2484,16 +2437,16 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) psta->htpriv.agg_enable_bitmap &= ~BIT(tid); } - //DBG_88E("marc: ADDBA RSP: %x\n", pmlmeinfo->agg_enable_bitmap); + /* DBG_88E("marc: ADDBA RSP: %x\n", pmlmeinfo->agg_enable_bitmap); */ break; - case RTW_WLAN_ACTION_DELBA: //DELBA + case RTW_WLAN_ACTION_DELBA: /* DELBA */ if ((frame_body[3] & BIT(3)) == 0) { psta->htpriv.agg_enable_bitmap &= ~(1 << ((frame_body[3] >> 4) & 0xf)); psta->htpriv.candidate_tid_bitmap &= ~(1 << ((frame_body[3] >> 4) & 0xf)); - //reason_code = frame_body[4] | (frame_body[5] << 8); + /* reason_code = frame_body[4] | (frame_body[5] << 8); */ reason_code = RTW_GET_LE16(&frame_body[4]); } else if ((frame_body[3] & BIT(3)) == BIT(3)) @@ -2510,14 +2463,14 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) } DBG_88E("%s(): DELBA: %x(%x)\n", __func__,pmlmeinfo->agg_enable_bitmap, reason_code); - //todo: how to notify the host while receiving DELETE BA + /* todo: how to notify the host while receiving DELETE BA */ break; default: break; } } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ return _SUCCESS; } @@ -2550,12 +2503,12 @@ static void get_channel_cnt_24g_5gl_5gh( struct mlme_ext_priv *pmlmeext, u8* p2 } else if ( ( pmlmeext->channel_set[ i ].ChannelNum > 14 ) && ( pmlmeext->channel_set[ i ].ChannelNum <= 48 ) ) { - // Just include the channel 36, 40, 44, 48 channels for 5G low + /* Just include the channel 36, 40, 44, 48 channels for 5G low */ (*p5gl_cnt)++; } else if ( ( pmlmeext->channel_set[ i ].ChannelNum >= 149 ) && ( pmlmeext->channel_set[ i ].ChannelNum <= 161 ) ) { - // Just include the channel 149, 153, 157, 161 channels for 5G high + /* Just include the channel 149, 153, 157, 161 channels for 5G high */ (*p5gh_cnt)++; } } @@ -2574,7 +2527,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) u16 len_channellist_attr = 0; #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; @@ -2593,7 +2546,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) } DBG_88E( "[%s] In\n", __func__ ); - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -2620,39 +2573,39 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 4, (unsigned char *) &(p2poui), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(oui_subtype), &(pattrib->pktlen)); - pwdinfo->negotiation_dialog_token = 1; // Initialize the dialog value + pwdinfo->negotiation_dialog_token = 1; /* Initialize the dialog value */ pframe = rtw_set_fixed_ie(pframe, 1, &pwdinfo->negotiation_dialog_token, &(pattrib->pktlen)); - // WPS Section + /* WPS Section */ wpsielen = 0; - // WPS OUI + /* WPS OUI */ *(__be32 *) ( wpsie ) = cpu_to_be32( WPSOUI ); wpsielen += 4; - // WPS version - // Type: + /* WPS version */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_VER1 ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); wpsielen += 2; - // Value: - wpsie[wpsielen++] = WPS_VERSION_1; // Version 1.0 + /* Value: */ + wpsie[wpsielen++] = WPS_VERSION_1; /* Version 1.0 */ - // Device Password ID - // Type: + /* Device Password ID */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_DEVICE_PWID ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0002 ); wpsielen += 2; - // Value: + /* Value: */ if ( pwdinfo->ui_got_wps_info == P2P_GOT_WPSINFO_PEER_DISPLAY_PIN ) { @@ -2672,41 +2625,41 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen ); - // P2P IE Section. + /* P2P IE Section. */ - // P2P OUI + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - // Commented by Albert 20110306 - // According to the P2P Specification, the group negoitation request frame should contain 9 P2P attributes - // 1. P2P Capability - // 2. Group Owner Intent - // 3. Configuration Timeout - // 4. Listen Channel - // 5. Extended Listen Timing - // 6. Intended P2P Interface Address - // 7. Channel List - // 8. P2P Device Info - // 9. Operating Channel + /* Commented by Albert 20110306 */ + /* According to the P2P Specification, the group negoitation request frame should contain 9 P2P attributes */ + /* 1. P2P Capability */ + /* 2. Group Owner Intent */ + /* 3. Configuration Timeout */ + /* 4. Listen Channel */ + /* 5. Extended Listen Timing */ + /* 6. Intended P2P Interface Address */ + /* 7. Channel List */ + /* 8. P2P Device Info */ + /* 9. Operating Channel */ - // P2P Capability - // Type: + /* P2P Capability */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CAPABILITY; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); p2pielen += 2; - // Value: - // Device Capability Bitmap, 1 byte + /* Value: */ + /* Device Capability Bitmap, 1 byte */ p2pie[ p2pielen++ ] = DMP_P2P_DEVCAP_SUPPORT; - // Group Capability Bitmap, 1 byte + /* Group Capability Bitmap, 1 byte */ if ( pwdinfo->persistent_supported ) { p2pie[ p2pielen++ ] = P2P_GRPCAP_CROSS_CONN | P2P_GRPCAP_PERSISTENT_GROUP; @@ -2717,94 +2670,94 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) } - // Group Owner Intent - // Type: + /* Group Owner Intent */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_GO_INTENT; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 ); p2pielen += 2; - // Value: - // Todo the tie breaker bit. + /* Value: */ + /* Todo the tie breaker bit. */ p2pie[ p2pielen++ ] = ( ( pwdinfo->intent << 1 ) | BIT(0) ); - // Configuration Timeout - // Type: + /* Configuration Timeout */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CONF_TIMEOUT; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); p2pielen += 2; - // Value: - p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P GO - p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P Client + /* Value: */ + p2pie[ p2pielen++ ] = 200; /* 2 seconds needed to be the P2P GO */ + p2pie[ p2pielen++ ] = 200; /* 2 seconds needed to be the P2P Client */ - // Listen Channel - // Type: + /* Listen Channel */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_LISTEN_CH; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0005 ); p2pielen += 2; - // Value: - // Country String + /* Value: */ + /* Country String */ p2pie[ p2pielen++ ] = 'X'; p2pie[ p2pielen++ ] = 'X'; - // The third byte should be set to 0x04. - // Described in the "Operating Channel Attribute" section. + /* The third byte should be set to 0x04. */ + /* Described in the "Operating Channel Attribute" section. */ p2pie[ p2pielen++ ] = 0x04; - // Operating Class - p2pie[ p2pielen++ ] = 0x51; // Copy from SD7 + /* Operating Class */ + p2pie[ p2pielen++ ] = 0x51; /* Copy from SD7 */ - // Channel Number - p2pie[ p2pielen++ ] = pwdinfo->listen_channel; // listening channel number + /* Channel Number */ + p2pie[ p2pielen++ ] = pwdinfo->listen_channel; /* listening channel number */ - // Extended Listen Timing ATTR - // Type: + /* Extended Listen Timing ATTR */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_EX_LISTEN_TIMING; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0004 ); p2pielen += 2; - // Value: - // Availability Period + /* Value: */ + /* Availability Period */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); p2pielen += 2; - // Availability Interval + /* Availability Interval */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); p2pielen += 2; - // Intended P2P Interface Address - // Type: + /* Intended P2P Interface Address */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_INTENTED_IF_ADDR; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN ); p2pielen += 2; - // Value: + /* Value: */ _rtw_memcpy( p2pie + p2pielen, myid( &padapter->eeprompriv ), ETH_ALEN ); p2pielen += ETH_ALEN; - // Channel List - // Type: + /* Channel List */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CH_LIST; - // Length: - // Country String(3) - // + ( Operating Class (1) + Number of Channels(1) ) * Operation Classes (?) - // + number of channels in all classes + /* Length: */ + /* Country String(3) */ + /* + ( Operating Class (1) + Number of Channels(1) ) * Operation Classes (?) */ + /* + number of channels in all classes */ len_channellist_attr = 3 + (1 + 1) * (u16)(pmlmeext->channel_list.reg_classes) + get_reg_classes_full_count(pmlmeext->channel_list); @@ -2825,16 +2778,16 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) #endif p2pielen += 2; - // Value: - // Country String + /* Value: */ + /* Country String */ p2pie[ p2pielen++ ] = 'X'; p2pie[ p2pielen++ ] = 'X'; - // The third byte should be set to 0x04. - // Described in the "Operating Channel Attribute" section. + /* The third byte should be set to 0x04. */ + /* Described in the "Operating Channel Attribute" section. */ p2pie[ p2pielen++ ] = 0x04; - // Channel Entry List + /* Channel Entry List */ #ifdef CONFIG_CONCURRENT_MODE if ( check_buddy_fwstate(padapter, _FW_LINKED ) ) @@ -2842,7 +2795,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) _adapter *pbuddy_adapter = padapter->pbuddy_adapter; struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; - // Operating Class + /* Operating Class */ if ( pbuddy_mlmeext->cur_channel > 14 ) { if ( pbuddy_mlmeext->cur_channel >= 149 ) @@ -2859,135 +2812,135 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) p2pie[ p2pielen++ ] = 0x51; } - // Number of Channels - // Just support 1 channel and this channel is AP's channel + /* Number of Channels */ + /* Just support 1 channel and this channel is AP's channel */ p2pie[ p2pielen++ ] = 1; - // Channel List + /* Channel List */ p2pie[ p2pielen++ ] = pbuddy_mlmeext->cur_channel; } else { int i,j; for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { - // Operating Class + /* Operating Class */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; - // Number of Channels + /* Number of Channels */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; - // Channel List + /* Channel List */ for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) { p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; } } } -#else // CONFIG_CONCURRENT_MODE +#else /* CONFIG_CONCURRENT_MODE */ { int i,j; for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { - // Operating Class + /* Operating Class */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; - // Number of Channels + /* Number of Channels */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; - // Channel List + /* Channel List */ for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) { p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; } } } -#endif // CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ - // Device Info - // Type: + /* Device Info */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_DEVICE_INFO; - // Length: - // 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) - // + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) + /* Length: */ + /* 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */ + /* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); p2pielen += 2; - // Value: - // P2P Device Address + /* Value: */ + /* P2P Device Address */ _rtw_memcpy( p2pie + p2pielen, myid( &padapter->eeprompriv ), ETH_ALEN ); p2pielen += ETH_ALEN; - // Config Method - // This field should be big endian. Noted by P2P specification. + /* Config Method */ + /* This field should be big endian. Noted by P2P specification. */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->supported_wps_cm ); p2pielen += 2; - // Primary Device Type - // Category ID + /* Primary Device Type */ + /* Category ID */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); p2pielen += 2; - // OUI + /* OUI */ *(__be32 *) ( p2pie + p2pielen ) = cpu_to_be32( WPSOUI ); p2pielen += 4; - // Sub Category ID + /* Sub Category ID */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); p2pielen += 2; - // Number of Secondary Device Types - p2pie[ p2pielen++ ] = 0x00; // No Secondary Device Type List + /* Number of Secondary Device Types */ + p2pie[ p2pielen++ ] = 0x00; /* No Secondary Device Type List */ - // Device Name - // Type: + /* Device Name */ + /* Type: */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); p2pielen += 2; - // Length: + /* Length: */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->device_name_len ); p2pielen += 2; - // Value: + /* Value: */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_name , pwdinfo->device_name_len ); p2pielen += pwdinfo->device_name_len; - // Operating Channel - // Type: + /* Operating Channel */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_OPERATING_CH; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0005 ); p2pielen += 2; - // Value: - // Country String + /* Value: */ + /* Country String */ p2pie[ p2pielen++ ] = 'X'; p2pie[ p2pielen++ ] = 'X'; - // The third byte should be set to 0x04. - // Described in the "Operating Channel Attribute" section. + /* The third byte should be set to 0x04. */ + /* Described in the "Operating Channel Attribute" section. */ p2pie[ p2pielen++ ] = 0x04; - // Operating Class + /* Operating Class */ if ( pwdinfo->operating_channel <= 14 ) { - // Operating Class + /* Operating Class */ p2pie[ p2pielen++ ] = 0x51; } else if ( ( pwdinfo->operating_channel >= 36 ) && ( pwdinfo->operating_channel <= 48 ) ) { - // Operating Class + /* Operating Class */ p2pie[ p2pielen++ ] = 0x73; } else { - // Operating Class + /* Operating Class */ p2pie[ p2pielen++ ] = 0x7c; } - // Channel Number - p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // operating channel number + /* Channel Number */ + p2pie[ p2pielen++ ] = pwdinfo->operating_channel; /* operating channel number */ pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen ); @@ -2995,7 +2948,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) wfdielen = build_nego_req_wfd_ie(pwdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -3034,7 +2987,7 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body, #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { @@ -3042,7 +2995,7 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body, } DBG_88E( "[%s] In, result = %d\n", __func__, result ); - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -3069,12 +3022,12 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body, pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 4, (unsigned char *) &(p2poui), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(oui_subtype), &(pattrib->pktlen)); - pwdinfo->negotiation_dialog_token = frame_body[7]; // The Dialog Token of provisioning discovery request frame. + pwdinfo->negotiation_dialog_token = frame_body[7]; /* The Dialog Token of provisioning discovery request frame. */ pframe = rtw_set_fixed_ie(pframe, 1, &(pwdinfo->negotiation_dialog_token), &(pattrib->pktlen)); - // Commented by Albert 20110328 - // Try to get the device password ID from the WPS IE of group negotiation request frame - // WiFi Direct test plan 5.1.15 + /* Commented by Albert 20110328 */ + /* Try to get the device password ID from the WPS IE of group negotiation request frame */ + /* WiFi Direct test plan 5.1.15 */ rtw_get_wps_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, wpsie, &wpsielen); rtw_get_wps_attr_content( wpsie, wpsielen, WPS_ATTR_DEVICE_PWID, (u8 *)&be_tmp, &wps_devicepassword_id_len); wps_devicepassword_id = be16_to_cpu(be_tmp); @@ -3082,34 +3035,34 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body, _rtw_memset( wpsie, 0x00, 255 ); wpsielen = 0; - // WPS Section + /* WPS Section */ wpsielen = 0; - // WPS OUI + /* WPS OUI */ *(__be32 *) ( wpsie ) = cpu_to_be32( WPSOUI ); wpsielen += 4; - // WPS version - // Type: + /* WPS version */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_VER1 ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); wpsielen += 2; - // Value: - wpsie[wpsielen++] = WPS_VERSION_1; // Version 1.0 + /* Value: */ + wpsie[wpsielen++] = WPS_VERSION_1; /* Version 1.0 */ - // Device Password ID - // Type: + /* Device Password ID */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_DEVICE_PWID ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0002 ); wpsielen += 2; - // Value: + /* Value: */ if ( wps_devicepassword_id == WPS_DPID_USER_SPEC ) { *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_DPID_REGISTRAR_SPEC ); @@ -3124,9 +3077,9 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body, } wpsielen += 2; - // Commented by Kurt 20120113 - // If some device wants to do p2p handshake without sending prov_disc_req - // We have to get peer_req_cm from here. + /* Commented by Kurt 20120113 */ + /* If some device wants to do p2p handshake without sending prov_disc_req */ + /* We have to get peer_req_cm from here. */ if (_rtw_memcmp( pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "000", 3) ) { if ( wps_devicepassword_id == WPS_DPID_USER_SPEC ) @@ -3146,66 +3099,66 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body, pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen ); - // P2P IE Section. + /* P2P IE Section. */ - // P2P OUI + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - // Commented by Albert 20100908 - // According to the P2P Specification, the group negoitation response frame should contain 9 P2P attributes - // 1. Status - // 2. P2P Capability - // 3. Group Owner Intent - // 4. Configuration Timeout - // 5. Operating Channel - // 6. Intended P2P Interface Address - // 7. Channel List - // 8. Device Info - // 9. Group ID ( Only GO ) + /* Commented by Albert 20100908 */ + /* According to the P2P Specification, the group negoitation response frame should contain 9 P2P attributes */ + /* 1. Status */ + /* 2. P2P Capability */ + /* 3. Group Owner Intent */ + /* 4. Configuration Timeout */ + /* 5. Operating Channel */ + /* 6. Intended P2P Interface Address */ + /* 7. Channel List */ + /* 8. Device Info */ + /* 9. Group ID ( Only GO ) */ - // ToDo: + /* ToDo: */ - // P2P Status - // Type: + /* P2P Status */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_STATUS; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 ); p2pielen += 2; - // Value: + /* Value: */ p2pie[ p2pielen++ ] = result; - // P2P Capability - // Type: + /* P2P Capability */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CAPABILITY; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); p2pielen += 2; - // Value: - // Device Capability Bitmap, 1 byte + /* Value: */ + /* Device Capability Bitmap, 1 byte */ if ( rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT) ) { - // Commented by Albert 2011/03/08 - // According to the P2P specification - // if the sending device will be client, the P2P Capability should be reserved of group negotation response frame + /* Commented by Albert 2011/03/08 */ + /* According to the P2P specification */ + /* if the sending device will be client, the P2P Capability should be reserved of group negotation response frame */ p2pie[ p2pielen++ ] = 0; } else { - // Be group owner or meet the error case + /* Be group owner or meet the error case */ p2pie[ p2pielen++ ] = DMP_P2P_DEVCAP_SUPPORT; } - // Group Capability Bitmap, 1 byte + /* Group Capability Bitmap, 1 byte */ if ( pwdinfo->persistent_supported ) { p2pie[ p2pielen++ ] = P2P_GRPCAP_CROSS_CONN | P2P_GRPCAP_PERSISTENT_GROUP; @@ -3215,95 +3168,95 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body, p2pie[ p2pielen++ ] = P2P_GRPCAP_CROSS_CONN; } - // Group Owner Intent - // Type: + /* Group Owner Intent */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_GO_INTENT; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 ); p2pielen += 2; - // Value: + /* Value: */ if ( pwdinfo->peer_intent & 0x01 ) { - // Peer's tie breaker bit is 1, our tie breaker bit should be 0 + /* Peer's tie breaker bit is 1, our tie breaker bit should be 0 */ p2pie[ p2pielen++ ] = ( pwdinfo->intent << 1 ); } else { - // Peer's tie breaker bit is 0, our tie breaker bit should be 1 + /* Peer's tie breaker bit is 0, our tie breaker bit should be 1 */ p2pie[ p2pielen++ ] = ( ( pwdinfo->intent << 1 ) | BIT(0) ); } - // Configuration Timeout - // Type: + /* Configuration Timeout */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CONF_TIMEOUT; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); p2pielen += 2; - // Value: - p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P GO - p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P Client + /* Value: */ + p2pie[ p2pielen++ ] = 200; /* 2 seconds needed to be the P2P GO */ + p2pie[ p2pielen++ ] = 200; /* 2 seconds needed to be the P2P Client */ - // Operating Channel - // Type: + /* Operating Channel */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_OPERATING_CH; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0005 ); p2pielen += 2; - // Value: - // Country String + /* Value: */ + /* Country String */ p2pie[ p2pielen++ ] = 'X'; p2pie[ p2pielen++ ] = 'X'; - // The third byte should be set to 0x04. - // Described in the "Operating Channel Attribute" section. + /* The third byte should be set to 0x04. */ + /* Described in the "Operating Channel Attribute" section. */ p2pie[ p2pielen++ ] = 0x04; - // Operating Class + /* Operating Class */ if ( pwdinfo->operating_channel <= 14 ) { - // Operating Class + /* Operating Class */ p2pie[ p2pielen++ ] = 0x51; } else if ( ( pwdinfo->operating_channel >= 36 ) && ( pwdinfo->operating_channel <= 48 ) ) { - // Operating Class + /* Operating Class */ p2pie[ p2pielen++ ] = 0x73; } else { - // Operating Class + /* Operating Class */ p2pie[ p2pielen++ ] = 0x7c; } - // Channel Number - p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // operating channel number + /* Channel Number */ + p2pie[ p2pielen++ ] = pwdinfo->operating_channel; /* operating channel number */ - // Intended P2P Interface Address - // Type: + /* Intended P2P Interface Address */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_INTENTED_IF_ADDR; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN ); p2pielen += 2; - // Value: + /* Value: */ _rtw_memcpy( p2pie + p2pielen, myid( &padapter->eeprompriv ), ETH_ALEN ); p2pielen += ETH_ALEN; - // Channel List - // Type: + /* Channel List */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CH_LIST; - // Country String(3) - // + ( Operating Class (1) + Number of Channels(1) ) * Operation Classes (?) - // + number of channels in all classes + /* Country String(3) */ + /* + ( Operating Class (1) + Number of Channels(1) ) * Operation Classes (?) */ + /* + number of channels in all classes */ len_channellist_attr = 3 + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes + get_reg_classes_full_count(pmlmeext->channel_list); @@ -3324,16 +3277,16 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body, #endif p2pielen += 2; - // Value: - // Country String + /* Value: */ + /* Country String */ p2pie[ p2pielen++ ] = 'X'; p2pie[ p2pielen++ ] = 'X'; - // The third byte should be set to 0x04. - // Described in the "Operating Channel Attribute" section. + /* The third byte should be set to 0x04. */ + /* Described in the "Operating Channel Attribute" section. */ p2pie[ p2pielen++ ] = 0x04; - // Channel Entry List + /* Channel Entry List */ #ifdef CONFIG_CONCURRENT_MODE if ( check_buddy_fwstate(padapter, _FW_LINKED ) ) @@ -3341,7 +3294,7 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body, _adapter *pbuddy_adapter = padapter->pbuddy_adapter; struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; - // Operating Class + /* Operating Class */ if ( pbuddy_mlmeext->cur_channel > 14 ) { if ( pbuddy_mlmeext->cur_channel >= 149 ) @@ -3358,115 +3311,115 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body, p2pie[ p2pielen++ ] = 0x51; } - // Number of Channels - // Just support 1 channel and this channel is AP's channel + /* Number of Channels */ + /* Just support 1 channel and this channel is AP's channel */ p2pie[ p2pielen++ ] = 1; - // Channel List + /* Channel List */ p2pie[ p2pielen++ ] = pbuddy_mlmeext->cur_channel; } else { int i, j; for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { - // Operating Class + /* Operating Class */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; - // Number of Channels + /* Number of Channels */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; - // Channel List + /* Channel List */ for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) { p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; } } } -#else // CONFIG_CONCURRENT_MODE +#else /* CONFIG_CONCURRENT_MODE */ { int i, j; for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { - // Operating Class + /* Operating Class */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; - // Number of Channels + /* Number of Channels */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; - // Channel List + /* Channel List */ for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) { p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; } } } -#endif // CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ - // Device Info - // Type: + /* Device Info */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_DEVICE_INFO; - // Length: - // 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) - // + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) + /* Length: */ + /* 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */ + /* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); p2pielen += 2; - // Value: - // P2P Device Address + /* Value: */ + /* P2P Device Address */ _rtw_memcpy( p2pie + p2pielen, myid( &padapter->eeprompriv ), ETH_ALEN ); p2pielen += ETH_ALEN; - // Config Method - // This field should be big endian. Noted by P2P specification. + /* Config Method */ + /* This field should be big endian. Noted by P2P specification. */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->supported_wps_cm ); p2pielen += 2; - // Primary Device Type - // Category ID + /* Primary Device Type */ + /* Category ID */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); p2pielen += 2; - // OUI + /* OUI */ *(__be32 *) ( p2pie + p2pielen ) = cpu_to_be32( WPSOUI ); p2pielen += 4; - // Sub Category ID + /* Sub Category ID */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); p2pielen += 2; - // Number of Secondary Device Types - p2pie[ p2pielen++ ] = 0x00; // No Secondary Device Type List + /* Number of Secondary Device Types */ + p2pie[ p2pielen++ ] = 0x00; /* No Secondary Device Type List */ - // Device Name - // Type: + /* Device Name */ + /* Type: */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); p2pielen += 2; - // Length: + /* Length: */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->device_name_len ); p2pielen += 2; - // Value: + /* Value: */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_name , pwdinfo->device_name_len ); p2pielen += pwdinfo->device_name_len; if ( rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) ) { - // Group ID Attribute - // Type: + /* Group ID Attribute */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_GROUP_ID; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN + pwdinfo->nego_ssidlen ); p2pielen += 2; - // Value: - // p2P Device Address + /* Value: */ + /* p2P Device Address */ _rtw_memcpy( p2pie + p2pielen , pwdinfo->device_addr, ETH_ALEN ); p2pielen += ETH_ALEN; - // SSID + /* SSID */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->nego_ssid, pwdinfo->nego_ssidlen ); p2pielen += pwdinfo->nego_ssidlen; @@ -3478,7 +3431,7 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body, wfdielen = build_nego_resp_wfd_ie(pwdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -3507,7 +3460,7 @@ static void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) struct wifidirect_info *pwdinfo = &( padapter->wdinfo); #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { @@ -3515,7 +3468,7 @@ static void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) } DBG_88E( "[%s] In\n", __func__ ); - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -3546,47 +3499,47 @@ static void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) - // P2P IE Section. + /* P2P IE Section. */ - // P2P OUI + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - // Commented by Albert 20110306 - // According to the P2P Specification, the group negoitation request frame should contain 5 P2P attributes - // 1. Status - // 2. P2P Capability - // 3. Operating Channel - // 4. Channel List - // 5. Group ID ( if this WiFi is GO ) + /* Commented by Albert 20110306 */ + /* According to the P2P Specification, the group negoitation request frame should contain 5 P2P attributes */ + /* 1. Status */ + /* 2. P2P Capability */ + /* 3. Operating Channel */ + /* 4. Channel List */ + /* 5. Group ID ( if this WiFi is GO ) */ - // P2P Status - // Type: + /* P2P Status */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_STATUS; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 ); p2pielen += 2; - // Value: + /* Value: */ p2pie[ p2pielen++ ] = result; - // P2P Capability - // Type: + /* P2P Capability */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CAPABILITY; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); p2pielen += 2; - // Value: - // Device Capability Bitmap, 1 byte + /* Value: */ + /* Device Capability Bitmap, 1 byte */ p2pie[ p2pielen++ ] = DMP_P2P_DEVCAP_SUPPORT; - // Group Capability Bitmap, 1 byte + /* Group Capability Bitmap, 1 byte */ if ( pwdinfo->persistent_supported ) { p2pie[ p2pielen++ ] = P2P_GRPCAP_CROSS_CONN | P2P_GRPCAP_PERSISTENT_GROUP; @@ -3597,21 +3550,21 @@ static void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) } - // Operating Channel - // Type: + /* Operating Channel */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_OPERATING_CH; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0005 ); p2pielen += 2; - // Value: - // Country String + /* Value: */ + /* Country String */ p2pie[ p2pielen++ ] = 'X'; p2pie[ p2pielen++ ] = 'X'; - // The third byte should be set to 0x04. - // Described in the "Operating Channel Attribute" section. + /* The third byte should be set to 0x04. */ + /* Described in the "Operating Channel Attribute" section. */ p2pie[ p2pielen++ ] = 0x04; @@ -3619,17 +3572,17 @@ static void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) { if ( pwdinfo->peer_operating_ch <= 14 ) { - // Operating Class + /* Operating Class */ p2pie[ p2pielen++ ] = 0x51; } else if ( ( pwdinfo->peer_operating_ch >= 36 ) && ( pwdinfo->peer_operating_ch <= 48 ) ) { - // Operating Class + /* Operating Class */ p2pie[ p2pielen++ ] = 0x73; } else { - // Operating Class + /* Operating Class */ p2pie[ p2pielen++ ] = 0x7c; } @@ -3639,53 +3592,53 @@ static void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) { if ( pwdinfo->operating_channel <= 14 ) { - // Operating Class + /* Operating Class */ p2pie[ p2pielen++ ] = 0x51; } else if ( ( pwdinfo->operating_channel >= 36 ) && ( pwdinfo->operating_channel <= 48 ) ) { - // Operating Class + /* Operating Class */ p2pie[ p2pielen++ ] = 0x73; } else { - // Operating Class + /* Operating Class */ p2pie[ p2pielen++ ] = 0x7c; } - // Channel Number - p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // Use the listen channel as the operating channel + /* Channel Number */ + p2pie[ p2pielen++ ] = pwdinfo->operating_channel; /* Use the listen channel as the operating channel */ } - // Channel List - // Type: + /* Channel List */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CH_LIST; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( pwdinfo->channel_list_attr_len ); p2pielen += 2; - // Value: + /* Value: */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->channel_list_attr, pwdinfo->channel_list_attr_len ); p2pielen += pwdinfo->channel_list_attr_len; if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) ) { - // Group ID Attribute - // Type: + /* Group ID Attribute */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_GROUP_ID; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN + pwdinfo->nego_ssidlen ); p2pielen += 2; - // Value: - // p2P Device Address + /* Value: */ + /* p2P Device Address */ _rtw_memcpy( p2pie + p2pielen , pwdinfo->device_addr, ETH_ALEN ); p2pielen += ETH_ALEN; - // SSID + /* SSID */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->nego_ssid, pwdinfo->nego_ssidlen ); p2pielen += pwdinfo->nego_ssidlen; } @@ -3696,7 +3649,7 @@ static void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) wfdielen = build_nego_confirm_wfd_ie(pwdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -3720,7 +3673,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) u16 len_channellist_attr = 0; #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ #ifdef CONFIG_CONCURRENT_MODE _adapter *pbuddy_adapter = padapter->pbuddy_adapter; struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo; @@ -3744,7 +3697,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -3773,67 +3726,67 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) pframe = rtw_set_fixed_ie(pframe, 1, &(oui_subtype), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(dialogToken), &(pattrib->pktlen)); - // P2P IE Section. + /* P2P IE Section. */ - // P2P OUI + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - // Commented by Albert 20101011 - // According to the P2P Specification, the P2P Invitation request frame should contain 7 P2P attributes - // 1. Configuration Timeout - // 2. Invitation Flags - // 3. Operating Channel ( Only GO ) - // 4. P2P Group BSSID ( Should be included if I am the GO ) - // 5. Channel List - // 6. P2P Group ID - // 7. P2P Device Info + /* Commented by Albert 20101011 */ + /* According to the P2P Specification, the P2P Invitation request frame should contain 7 P2P attributes */ + /* 1. Configuration Timeout */ + /* 2. Invitation Flags */ + /* 3. Operating Channel ( Only GO ) */ + /* 4. P2P Group BSSID ( Should be included if I am the GO ) */ + /* 5. Channel List */ + /* 6. P2P Group ID */ + /* 7. P2P Device Info */ - // Configuration Timeout - // Type: + /* Configuration Timeout */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CONF_TIMEOUT; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); p2pielen += 2; - // Value: - p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P GO - p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P Client + /* Value: */ + p2pie[ p2pielen++ ] = 200; /* 2 seconds needed to be the P2P GO */ + p2pie[ p2pielen++ ] = 200; /* 2 seconds needed to be the P2P Client */ - // Invitation Flags - // Type: + /* Invitation Flags */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_INVITATION_FLAGS; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 ); p2pielen += 2; - // Value: + /* Value: */ p2pie[ p2pielen++ ] = P2P_INVITATION_FLAGS_PERSISTENT; - // Operating Channel - // Type: + /* Operating Channel */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_OPERATING_CH; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0005 ); p2pielen += 2; - // Value: - // Country String + /* Value: */ + /* Country String */ p2pie[ p2pielen++ ] = 'X'; p2pie[ p2pielen++ ] = 'X'; - // The third byte should be set to 0x04. - // Described in the "Operating Channel Attribute" section. + /* The third byte should be set to 0x04. */ + /* Described in the "Operating Channel Attribute" section. */ p2pie[ p2pielen++ ] = 0x04; - // Operating Class + /* Operating Class */ if ( pwdinfo->invitereq_info.operating_ch <= 14 ) p2pie[ p2pielen++ ] = 0x51; else if ( ( pwdinfo->invitereq_info.operating_ch >= 36 ) && ( pwdinfo->invitereq_info.operating_ch <= 48 ) ) @@ -3841,34 +3794,34 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) else p2pie[ p2pielen++ ] = 0x7c; - // Channel Number - p2pie[ p2pielen++ ] = pwdinfo->invitereq_info.operating_ch; // operating channel number + /* Channel Number */ + p2pie[ p2pielen++ ] = pwdinfo->invitereq_info.operating_ch; /* operating channel number */ if ( _rtw_memcmp( myid( &padapter->eeprompriv ), pwdinfo->invitereq_info.go_bssid, ETH_ALEN ) ) { - // P2P Group BSSID - // Type: + /* P2P Group BSSID */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_GROUP_BSSID; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN ); p2pielen += 2; - // Value: - // P2P Device Address for GO + /* Value: */ + /* P2P Device Address for GO */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->invitereq_info.go_bssid, ETH_ALEN ); p2pielen += ETH_ALEN; } - // Channel List - // Type: + /* Channel List */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CH_LIST; - // Length: - // Country String(3) - // + ( Operating Class (1) + Number of Channels(1) ) * Operation Classes (?) - // + number of channels in all classes + /* Length: */ + /* Country String(3) */ + /* + ( Operating Class (1) + Number of Channels(1) ) * Operation Classes (?) */ + /* + number of channels in all classes */ len_channellist_attr = 3 + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes + get_reg_classes_full_count(pmlmeext->channel_list); @@ -3885,23 +3838,23 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) #endif p2pielen += 2; - // Value: - // Country String + /* Value: */ + /* Country String */ p2pie[ p2pielen++ ] = 'X'; p2pie[ p2pielen++ ] = 'X'; - // The third byte should be set to 0x04. - // Described in the "Operating Channel Attribute" section. + /* The third byte should be set to 0x04. */ + /* Described in the "Operating Channel Attribute" section. */ p2pie[ p2pielen++ ] = 0x04; - // Channel Entry List + /* Channel Entry List */ #ifdef CONFIG_CONCURRENT_MODE if ( check_buddy_fwstate(padapter, _FW_LINKED ) ) { _adapter *pbuddy_adapter = padapter->pbuddy_adapter; struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; - // Operating Class + /* Operating Class */ if ( pbuddy_mlmeext->cur_channel > 14 ) { if ( pbuddy_mlmeext->cur_channel >= 149 ) @@ -3918,112 +3871,112 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) p2pie[ p2pielen++ ] = 0x51; } - // Number of Channels - // Just support 1 channel and this channel is AP's channel + /* Number of Channels */ + /* Just support 1 channel and this channel is AP's channel */ p2pie[ p2pielen++ ] = 1; - // Channel List + /* Channel List */ p2pie[ p2pielen++ ] = pbuddy_mlmeext->cur_channel; } else { int i, j; for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { - // Operating Class + /* Operating Class */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; - // Number of Channels + /* Number of Channels */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; - // Channel List + /* Channel List */ for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) { p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; } } } -#else // CONFIG_CONCURRENT_MODE +#else /* CONFIG_CONCURRENT_MODE */ { int i, j; for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { - // Operating Class + /* Operating Class */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; - // Number of Channels + /* Number of Channels */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; - // Channel List + /* Channel List */ for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) { p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; } } } -#endif // CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ - // P2P Group ID - // Type: + /* P2P Group ID */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_GROUP_ID; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 6 + pwdinfo->invitereq_info.ssidlen ); p2pielen += 2; - // Value: - // P2P Device Address for GO + /* Value: */ + /* P2P Device Address for GO */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->invitereq_info.go_bssid, ETH_ALEN ); p2pielen += ETH_ALEN; - // SSID + /* SSID */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->invitereq_info.go_ssid, pwdinfo->invitereq_info.ssidlen ); p2pielen += pwdinfo->invitereq_info.ssidlen; - // Device Info - // Type: + /* Device Info */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_DEVICE_INFO; - // Length: - // 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) - // + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) + /* Length: */ + /* 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */ + /* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); p2pielen += 2; - // Value: - // P2P Device Address + /* Value: */ + /* P2P Device Address */ _rtw_memcpy( p2pie + p2pielen, myid( &padapter->eeprompriv ), ETH_ALEN ); p2pielen += ETH_ALEN; - // Config Method - // This field should be big endian. Noted by P2P specification. + /* Config Method */ + /* This field should be big endian. Noted by P2P specification. */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_CONFIG_METHOD_DISPLAY ); p2pielen += 2; - // Primary Device Type - // Category ID + /* Primary Device Type */ + /* Category ID */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); p2pielen += 2; - // OUI + /* OUI */ *(__be32 *) ( p2pie + p2pielen ) = cpu_to_be32( WPSOUI ); p2pielen += 4; - // Sub Category ID + /* Sub Category ID */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); p2pielen += 2; - // Number of Secondary Device Types - p2pie[ p2pielen++ ] = 0x00; // No Secondary Device Type List + /* Number of Secondary Device Types */ + p2pie[ p2pielen++ ] = 0x00; /* No Secondary Device Type List */ - // Device Name - // Type: + /* Device Name */ + /* Type: */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); p2pielen += 2; - // Length: + /* Length: */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->device_name_len ); p2pielen += 2; - // Value: + /* Value: */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_name, pwdinfo->device_name_len ); p2pielen += pwdinfo->device_name_len; @@ -4033,7 +3986,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) wfdielen = build_invitation_req_wfd_ie(pwdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -4062,7 +4015,7 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken #endif #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; @@ -4080,7 +4033,7 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -4109,108 +4062,108 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken pframe = rtw_set_fixed_ie(pframe, 1, &(oui_subtype), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(dialogToken), &(pattrib->pktlen)); - // P2P IE Section. + /* P2P IE Section. */ - // P2P OUI + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - // Commented by Albert 20101005 - // According to the P2P Specification, the P2P Invitation response frame should contain 5 P2P attributes - // 1. Status - // 2. Configuration Timeout - // 3. Operating Channel ( Only GO ) - // 4. P2P Group BSSID ( Only GO ) - // 5. Channel List + /* Commented by Albert 20101005 */ + /* According to the P2P Specification, the P2P Invitation response frame should contain 5 P2P attributes */ + /* 1. Status */ + /* 2. Configuration Timeout */ + /* 3. Operating Channel ( Only GO ) */ + /* 4. P2P Group BSSID ( Only GO ) */ + /* 5. Channel List */ - // P2P Status - // Type: + /* P2P Status */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_STATUS; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 ); p2pielen += 2; - // Value: - // When status code is P2P_STATUS_FAIL_INFO_UNAVAILABLE. - // Sent the event receiving the P2P Invitation Req frame to DMP UI. - // DMP had to compare the MAC address to find out the profile. - // So, the WiFi driver will send the P2P_STATUS_FAIL_INFO_UNAVAILABLE to NB. - // If the UI found the corresponding profile, the WiFi driver sends the P2P Invitation Req - // to NB to rebuild the persistent group. + /* Value: */ + /* When status code is P2P_STATUS_FAIL_INFO_UNAVAILABLE. */ + /* Sent the event receiving the P2P Invitation Req frame to DMP UI. */ + /* DMP had to compare the MAC address to find out the profile. */ + /* So, the WiFi driver will send the P2P_STATUS_FAIL_INFO_UNAVAILABLE to NB. */ + /* If the UI found the corresponding profile, the WiFi driver sends the P2P Invitation Req */ + /* to NB to rebuild the persistent group. */ p2pie[ p2pielen++ ] = status_code; - // Configuration Timeout - // Type: + /* Configuration Timeout */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CONF_TIMEOUT; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); p2pielen += 2; - // Value: - p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P GO - p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P Client + /* Value: */ + p2pie[ p2pielen++ ] = 200; /* 2 seconds needed to be the P2P GO */ + p2pie[ p2pielen++ ] = 200; /* 2 seconds needed to be the P2P Client */ if ( status_code == P2P_STATUS_SUCCESS ) { if ( rtw_p2p_chk_role( pwdinfo, P2P_ROLE_GO ) ) { - // The P2P Invitation request frame asks this Wi-Fi device to be the P2P GO - // In this case, the P2P Invitation response frame should carry the two more P2P attributes. - // First one is operating channel attribute. - // Second one is P2P Group BSSID attribute. + /* The P2P Invitation request frame asks this Wi-Fi device to be the P2P GO */ + /* In this case, the P2P Invitation response frame should carry the two more P2P attributes. */ + /* First one is operating channel attribute. */ + /* Second one is P2P Group BSSID attribute. */ - // Operating Channel - // Type: + /* Operating Channel */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_OPERATING_CH; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0005 ); p2pielen += 2; - // Value: - // Country String + /* Value: */ + /* Country String */ p2pie[ p2pielen++ ] = 'X'; p2pie[ p2pielen++ ] = 'X'; - // The third byte should be set to 0x04. - // Described in the "Operating Channel Attribute" section. + /* The third byte should be set to 0x04. */ + /* Described in the "Operating Channel Attribute" section. */ p2pie[ p2pielen++ ] = 0x04; - // Operating Class - p2pie[ p2pielen++ ] = 0x51; // Copy from SD7 + /* Operating Class */ + p2pie[ p2pielen++ ] = 0x51; /* Copy from SD7 */ - // Channel Number - p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // operating channel number + /* Channel Number */ + p2pie[ p2pielen++ ] = pwdinfo->operating_channel; /* operating channel number */ - // P2P Group BSSID - // Type: + /* P2P Group BSSID */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_GROUP_BSSID; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN ); p2pielen += 2; - // Value: - // P2P Device Address for GO + /* Value: */ + /* P2P Device Address for GO */ _rtw_memcpy( p2pie + p2pielen, myid( &padapter->eeprompriv ), ETH_ALEN ); p2pielen += ETH_ALEN; } - // Channel List - // Type: + /* Channel List */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CH_LIST; - // Length: - // Country String(3) - // + ( Operating Class (1) + Number of Channels(1) ) * Operation Classes (?) - // + number of channels in all classes + /* Length: */ + /* Country String(3) */ + /* + ( Operating Class (1) + Number of Channels(1) ) * Operation Classes (?) */ + /* + number of channels in all classes */ len_channellist_attr = 3 + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes + get_reg_classes_full_count(pmlmeext->channel_list); @@ -4227,23 +4180,23 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken #endif p2pielen += 2; - // Value: - // Country String + /* Value: */ + /* Country String */ p2pie[ p2pielen++ ] = 'X'; p2pie[ p2pielen++ ] = 'X'; - // The third byte should be set to 0x04. - // Described in the "Operating Channel Attribute" section. + /* The third byte should be set to 0x04. */ + /* Described in the "Operating Channel Attribute" section. */ p2pie[ p2pielen++ ] = 0x04; - // Channel Entry List + /* Channel Entry List */ #ifdef CONFIG_CONCURRENT_MODE if ( check_buddy_fwstate(padapter, _FW_LINKED ) ) { _adapter *pbuddy_adapter = padapter->pbuddy_adapter; struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; - // Operating Class + /* Operating Class */ if ( pbuddy_mlmeext->cur_channel > 14 ) { if ( pbuddy_mlmeext->cur_channel >= 149 ) @@ -4260,46 +4213,46 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken p2pie[ p2pielen++ ] = 0x51; } - // Number of Channels - // Just support 1 channel and this channel is AP's channel + /* Number of Channels */ + /* Just support 1 channel and this channel is AP's channel */ p2pie[ p2pielen++ ] = 1; - // Channel List + /* Channel List */ p2pie[ p2pielen++ ] = pbuddy_mlmeext->cur_channel; } else { int i, j; for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { - // Operating Class + /* Operating Class */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; - // Number of Channels + /* Number of Channels */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; - // Channel List + /* Channel List */ for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) { p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; } } } -#else // CONFIG_CONCURRENT_MODE +#else /* CONFIG_CONCURRENT_MODE */ { int i, j; for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { - // Operating Class + /* Operating Class */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; - // Number of Channels + /* Number of Channels */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; - // Channel List + /* Channel List */ for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) { p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; } } } -#endif // CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ } pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen ); @@ -4308,7 +4261,7 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken wfdielen = build_invitation_resp_wfd_ie(pwdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -4330,7 +4283,7 @@ void issue_p2p_provision_request(_adapter *padapter, u8* pssid, u8 ussidlen, u8* u32 p2pielen = 0; #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; @@ -4349,7 +4302,7 @@ void issue_p2p_provision_request(_adapter *padapter, u8* pssid, u8 ussidlen, u8* } DBG_88E( "[%s] In\n", __func__ ); - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -4384,32 +4337,32 @@ void issue_p2p_provision_request(_adapter *padapter, u8* pssid, u8 ussidlen, u8* pattrib->pktlen += p2pielen; wpsielen = 0; - // WPS OUI + /* WPS OUI */ *(__be32 *) ( wpsie ) = cpu_to_be32( WPSOUI ); wpsielen += 4; - // WPS version - // Type: + /* WPS version */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_VER1 ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); wpsielen += 2; - // Value: - wpsie[wpsielen++] = WPS_VERSION_1; // Version 1.0 + /* Value: */ + wpsie[wpsielen++] = WPS_VERSION_1; /* Version 1.0 */ - // Config Method - // Type: + /* Config Method */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_CONF_METHOD ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0002 ); wpsielen += 2; - // Value: + /* Value: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( pwdinfo->tx_prov_disc_info.wps_config_method_request ); wpsielen += 2; @@ -4420,7 +4373,7 @@ void issue_p2p_provision_request(_adapter *padapter, u8* pssid, u8 ussidlen, u8* wfdielen = build_provdisc_req_wfd_ie(pwdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -4465,7 +4418,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - //WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); + /* WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); */ u16 beacon_interval = 100; u16 capInfo = 0; struct wifidirect_info *pwdinfo = &(padapter->wdinfo); @@ -4473,24 +4426,24 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) u32 wpsielen = 0, p2pielen = 0; #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ #ifdef CONFIG_IOCTL_CFG80211 struct cfg80211_wifidirect_info *pcfg80211_wdinfo = &padapter->cfg80211_wdinfo; struct ieee80211_channel *ieee_ch = &pcfg80211_wdinfo->remain_on_ch_channel; u8 listen_channel = (u8) ieee80211_frequency_to_channel(ieee_ch->center_freq); -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ #ifdef CONFIG_INTEL_WIDI u8 zero_array_check[L2SDTA_SERVICE_VE_LEN] = { 0x00 }; -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ - //DBG_88E("%s\n", __func__); + /* DBG_88E("%s\n", __func__); */ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -4506,7 +4459,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) _rtw_memcpy(pwlanhdr->addr1, da, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, mac, ETH_ALEN); - // Use the device address for BSSID field. + /* Use the device address for BSSID field. */ _rtw_memcpy(pwlanhdr->addr3, mac, ETH_ALEN); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); @@ -4517,17 +4470,17 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) pattrib->pktlen = pattrib->hdrlen; pframe += pattrib->hdrlen; - //timestamp will be inserted by hardware + /* timestamp will be inserted by hardware */ pframe += 8; pattrib->pktlen += 8; - // beacon interval: 2 bytes + /* beacon interval: 2 bytes */ _rtw_memcpy(pframe, (unsigned char *) &beacon_interval, 2); pframe += 2; pattrib->pktlen += 2; - // capability info: 2 bytes - // ESS and IBSS bits must be 0 (defined in the 3.1.2.1.1 of WiFi Direct Spec) + /* capability info: 2 bytes */ + /* ESS and IBSS bits must be 0 (defined in the 3.1.2.1.1 of WiFi Direct Spec) */ capInfo |= cap_ShortPremble; capInfo |= cap_ShortSlot; @@ -4536,21 +4489,21 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) pattrib->pktlen += 2; - // SSID + /* SSID */ pframe = rtw_set_ie(pframe, _SSID_IE_, 7, pwdinfo->p2p_wildcard_ssid, &pattrib->pktlen); - // supported rates... - // Use the OFDM rate in the P2P probe response frame. ( 6(B), 9(B), 12, 18, 24, 36, 48, 54 ) + /* supported rates... */ + /* Use the OFDM rate in the P2P probe response frame. ( 6(B), 9(B), 12, 18, 24, 36, 48, 54 ) */ pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pwdinfo->support_rate, &pattrib->pktlen); - // DS parameter set + /* DS parameter set */ #ifdef CONFIG_IOCTL_CFG80211 if (wdev_to_priv(padapter->rtw_wdev)->p2p_enabled && listen_channel !=0 ) { pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&listen_channel, &pattrib->pktlen); } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&pwdinfo->listen_channel, &pattrib->pktlen); } @@ -4561,209 +4514,209 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) { if ( pmlmepriv->wps_probe_resp_ie != NULL && pmlmepriv->p2p_probe_resp_ie != NULL ) { - //WPS IE + /* WPS IE */ _rtw_memcpy(pframe, pmlmepriv->wps_probe_resp_ie, pmlmepriv->wps_probe_resp_ie_len); pattrib->pktlen += pmlmepriv->wps_probe_resp_ie_len; pframe += pmlmepriv->wps_probe_resp_ie_len; - //P2P IE + /* P2P IE */ _rtw_memcpy(pframe, pmlmepriv->p2p_probe_resp_ie, pmlmepriv->p2p_probe_resp_ie_len); pattrib->pktlen += pmlmepriv->p2p_probe_resp_ie_len; pframe += pmlmepriv->p2p_probe_resp_ie_len; } } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { - // Todo: WPS IE - // Noted by Albert 20100907 - // According to the WPS specification, all the WPS attribute is presented by Big Endian. + /* Todo: WPS IE */ + /* Noted by Albert 20100907 */ + /* According to the WPS specification, all the WPS attribute is presented by Big Endian. */ wpsielen = 0; - // WPS OUI + /* WPS OUI */ *(__be32 *) ( wpsie ) = cpu_to_be32( WPSOUI ); wpsielen += 4; - // WPS version - // Type: + /* WPS version */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_VER1 ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); wpsielen += 2; - // Value: - wpsie[wpsielen++] = WPS_VERSION_1; // Version 1.0 + /* Value: */ + wpsie[wpsielen++] = WPS_VERSION_1; /* Version 1.0 */ #ifdef CONFIG_INTEL_WIDI - // Commented by Kurt - // Appended WiDi info. only if we did issued_probereq_widi(), and then we saved ven. ext. in pmlmepriv->sa_ext. + /* Commented by Kurt */ + /* Appended WiDi info. only if we did issued_probereq_widi(), and then we saved ven. ext. in pmlmepriv->sa_ext. */ if ( _rtw_memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == false ) { - //Sec dev type + /* Sec dev type */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_SEC_DEV_TYPE_LIST ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0008 ); wpsielen += 2; - // Value: - // Category ID + /* Value: */ + /* Category ID */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_PDT_CID_DISPLAYS ); wpsielen += 2; - // OUI + /* OUI */ *(__be32 *) ( wpsie + wpsielen ) = cpu_to_be32( INTEL_DEV_TYPE_OUI ); wpsielen += 4; *(_be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_PDT_SCID_WIDI_CONSUMER_SINK ); wpsielen += 2; - // Vendor Extension + /* Vendor Extension */ _rtw_memcpy( wpsie + wpsielen, pmlmepriv->sa_ext, L2SDTA_SERVICE_VE_LEN ); wpsielen += L2SDTA_SERVICE_VE_LEN; } -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ - // WiFi Simple Config State - // Type: + /* WiFi Simple Config State */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_SIMPLE_CONF_STATE ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); wpsielen += 2; - // Value: - wpsie[wpsielen++] = WPS_WSC_STATE_NOT_CONFIG; // Not Configured. + /* Value: */ + wpsie[wpsielen++] = WPS_WSC_STATE_NOT_CONFIG; /* Not Configured. */ - // Response Type - // Type: + /* Response Type */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_RESP_TYPE ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); wpsielen += 2; - // Value: + /* Value: */ wpsie[wpsielen++] = WPS_RESPONSE_TYPE_8021X; - // UUID-E - // Type: + /* UUID-E */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_UUID_E ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0010 ); wpsielen += 2; - // Value: + /* Value: */ _rtw_memcpy( wpsie + wpsielen, myid( &padapter->eeprompriv ), ETH_ALEN ); wpsielen += 0x10; - // Manufacturer - // Type: + /* Manufacturer */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_MANUFACTURER ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0007 ); wpsielen += 2; - // Value: + /* Value: */ _rtw_memcpy( wpsie + wpsielen, "Realtek", 7 ); wpsielen += 7; - // Model Name - // Type: + /* Model Name */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_MODEL_NAME ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0006 ); wpsielen += 2; - // Value: + /* Value: */ _rtw_memcpy( wpsie + wpsielen, "8192CU", 6 ); wpsielen += 6; - // Model Number - // Type: + /* Model Number */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_MODEL_NUMBER ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); wpsielen += 2; - // Value: - wpsie[ wpsielen++ ] = 0x31; // character 1 + /* Value: */ + wpsie[ wpsielen++ ] = 0x31; /* character 1 */ - // Serial Number - // Type: + /* Serial Number */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_SERIAL_NUMBER ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( ETH_ALEN ); wpsielen += 2; - // Value: + /* Value: */ _rtw_memcpy( wpsie + wpsielen, "123456" , ETH_ALEN ); wpsielen += ETH_ALEN; - // Primary Device Type - // Type: + /* Primary Device Type */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_PRIMARY_DEV_TYPE ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0008 ); wpsielen += 2; - // Value: - // Category ID + /* Value: */ + /* Category ID */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); wpsielen += 2; - // OUI + /* OUI */ *(__be32 *) ( wpsie + wpsielen ) = cpu_to_be32( WPSOUI ); wpsielen += 4; - // Sub Category ID + /* Sub Category ID */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); wpsielen += 2; - // Device Name - // Type: + /* Device Name */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( pwdinfo->device_name_len ); wpsielen += 2; - // Value: + /* Value: */ if (pwdinfo->device_name_len) { _rtw_memcpy( wpsie + wpsielen, pwdinfo->device_name, pwdinfo->device_name_len ); wpsielen += pwdinfo->device_name_len; } - // Config Method - // Type: + /* Config Method */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_CONF_METHOD ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0002 ); wpsielen += 2; - // Value: + /* Value: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( pwdinfo->supported_wps_cm ); wpsielen += 2; @@ -4779,7 +4732,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) #ifdef CONFIG_WFD #ifdef CONFIG_IOCTL_CFG80211 if ( true == pwdinfo->wfd_info->wfd_enable ) -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { wfdielen = build_probe_resp_wfd_ie(pwdinfo, pframe, 0); pframe += wfdielen; @@ -4788,13 +4741,13 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) #ifdef CONFIG_IOCTL_CFG80211 else if (pmlmepriv->wfd_probe_resp_ie != NULL && pmlmepriv->wfd_probe_resp_ie_len>0) { - //WFD IE + /* WFD IE */ _rtw_memcpy(pframe, pmlmepriv->wfd_probe_resp_ie, pmlmepriv->wfd_probe_resp_ie_len); pattrib->pktlen += pmlmepriv->wfd_probe_resp_ie_len; pframe += pmlmepriv->wfd_probe_resp_ie_len; } -#endif //CONFIG_IOCTL_CFG80211 -#endif //CONFIG_WFD +#endif /* CONFIG_IOCTL_CFG80211 */ +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -4825,7 +4778,7 @@ static int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) u16 wpsielen = 0, p2pielen = 0; #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); @@ -4835,7 +4788,7 @@ static int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) goto exit; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -4856,13 +4809,13 @@ static int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) } else { if ( ( pwdinfo->p2p_info.scan_op_ch_only ) || ( pwdinfo->rx_invitereq_info.scan_op_ch_only ) ) { - // This two flags will be set when this is only the P2P client mode. + /* This two flags will be set when this is only the P2P client mode. */ _rtw_memcpy(pwlanhdr->addr1, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); } else { - // broadcast probe request frame + /* broadcast probe request frame */ _rtw_memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, bc_addr, ETH_ALEN); } @@ -4884,7 +4837,7 @@ static int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) { pframe = rtw_set_ie(pframe, _SSID_IE_, P2P_WILDCARD_SSID_LEN, pwdinfo->p2p_wildcard_ssid, &(pattrib->pktlen)); } - // Use the OFDM rate in the P2P probe request frame. ( 6(B), 9(B), 12(B), 24(B), 36, 48, 54 ) + /* Use the OFDM rate in the P2P probe request frame. ( 6(B), 9(B), 12(B), 24(B), 36, 48, 54 ) */ pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pwdinfo->support_rate, &pattrib->pktlen); #ifdef CONFIG_IOCTL_CFG80211 @@ -4892,219 +4845,219 @@ static int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) { if ( pmlmepriv->wps_probe_req_ie != NULL && pmlmepriv->p2p_probe_req_ie != NULL ) { - //WPS IE + /* WPS IE */ _rtw_memcpy(pframe, pmlmepriv->wps_probe_req_ie, pmlmepriv->wps_probe_req_ie_len); pattrib->pktlen += pmlmepriv->wps_probe_req_ie_len; pframe += pmlmepriv->wps_probe_req_ie_len; - //P2P IE + /* P2P IE */ _rtw_memcpy(pframe, pmlmepriv->p2p_probe_req_ie, pmlmepriv->p2p_probe_req_ie_len); pattrib->pktlen += pmlmepriv->p2p_probe_req_ie_len; pframe += pmlmepriv->p2p_probe_req_ie_len; } } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { - // WPS IE - // Noted by Albert 20110221 - // According to the WPS specification, all the WPS attribute is presented by Big Endian. + /* WPS IE */ + /* Noted by Albert 20110221 */ + /* According to the WPS specification, all the WPS attribute is presented by Big Endian. */ wpsielen = 0; - // WPS OUI + /* WPS OUI */ *(__be32 *) ( wpsie ) = cpu_to_be32( WPSOUI ); wpsielen += 4; - // WPS version - // Type: + /* WPS version */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_VER1 ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0001 ); wpsielen += 2; - // Value: - wpsie[wpsielen++] = WPS_VERSION_1; // Version 1.0 + /* Value: */ + wpsie[wpsielen++] = WPS_VERSION_1; /* Version 1.0 */ if ( pmlmepriv->wps_probe_req_ie == NULL ) { - // UUID-E - // Type: + /* UUID-E */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_UUID_E ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0010 ); wpsielen += 2; - // Value: + /* Value: */ _rtw_memcpy( wpsie + wpsielen, myid( &padapter->eeprompriv ), ETH_ALEN ); wpsielen += 0x10; - // Config Method - // Type: + /* Config Method */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_CONF_METHOD ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0002 ); wpsielen += 2; - // Value: + /* Value: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( pwdinfo->supported_wps_cm ); wpsielen += 2; } - // Device Name - // Type: + /* Device Name */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( pwdinfo->device_name_len ); wpsielen += 2; - // Value: + /* Value: */ _rtw_memcpy( wpsie + wpsielen, pwdinfo->device_name, pwdinfo->device_name_len ); wpsielen += pwdinfo->device_name_len; - // Primary Device Type - // Type: + /* Primary Device Type */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_PRIMARY_DEV_TYPE ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0008 ); wpsielen += 2; - // Value: - // Category ID + /* Value: */ + /* Category ID */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_PDT_CID_RTK_WIDI ); wpsielen += 2; - // OUI + /* OUI */ *(__be32 *) ( wpsie + wpsielen ) = cpu_to_be32( WPSOUI ); wpsielen += 4; - // Sub Category ID + /* Sub Category ID */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_PDT_SCID_RTK_DMP ); wpsielen += 2; - // Device Password ID - // Type: + /* Device Password ID */ + /* Type: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_DEVICE_PWID ); wpsielen += 2; - // Length: + /* Length: */ *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( 0x0002 ); wpsielen += 2; - // Value: - *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_DPID_REGISTRAR_SPEC ); // Registrar-specified + /* Value: */ + *(__be16 *) ( wpsie + wpsielen ) = cpu_to_be16( WPS_DPID_REGISTRAR_SPEC ); /* Registrar-specified */ wpsielen += 2; pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen ); - // P2P OUI + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - // Commented by Albert 20110221 - // According to the P2P Specification, the probe request frame should contain 5 P2P attributes - // 1. P2P Capability - // 2. P2P Device ID if this probe request wants to find the specific P2P device - // 3. Listen Channel - // 4. Extended Listen Timing - // 5. Operating Channel if this WiFi is working as the group owner now + /* Commented by Albert 20110221 */ + /* According to the P2P Specification, the probe request frame should contain 5 P2P attributes */ + /* 1. P2P Capability */ + /* 2. P2P Device ID if this probe request wants to find the specific P2P device */ + /* 3. Listen Channel */ + /* 4. Extended Listen Timing */ + /* 5. Operating Channel if this WiFi is working as the group owner now */ - // P2P Capability - // Type: + /* P2P Capability */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CAPABILITY; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); p2pielen += 2; - // Value: - // Device Capability Bitmap, 1 byte + /* Value: */ + /* Device Capability Bitmap, 1 byte */ p2pie[ p2pielen++ ] = DMP_P2P_DEVCAP_SUPPORT; - // Group Capability Bitmap, 1 byte + /* Group Capability Bitmap, 1 byte */ if ( pwdinfo->persistent_supported ) p2pie[ p2pielen++ ] = P2P_GRPCAP_PERSISTENT_GROUP | DMP_P2P_GRPCAP_SUPPORT; else p2pie[ p2pielen++ ] = DMP_P2P_GRPCAP_SUPPORT; - // Listen Channel - // Type: + /* Listen Channel */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_LISTEN_CH; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0005 ); p2pielen += 2; - // Value: - // Country String + /* Value: */ + /* Country String */ p2pie[ p2pielen++ ] = 'X'; p2pie[ p2pielen++ ] = 'X'; - // The third byte should be set to 0x04. - // Described in the "Operating Channel Attribute" section. + /* The third byte should be set to 0x04. */ + /* Described in the "Operating Channel Attribute" section. */ p2pie[ p2pielen++ ] = 0x04; - // Operating Class - p2pie[ p2pielen++ ] = 0x51; // Copy from SD7 + /* Operating Class */ + p2pie[ p2pielen++ ] = 0x51; /* Copy from SD7 */ - // Channel Number - p2pie[ p2pielen++ ] = pwdinfo->listen_channel; // listen channel + /* Channel Number */ + p2pie[ p2pielen++ ] = pwdinfo->listen_channel; /* listen channel */ - // Extended Listen Timing - // Type: + /* Extended Listen Timing */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_EX_LISTEN_TIMING; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0004 ); p2pielen += 2; - // Value: - // Availability Period + /* Value: */ + /* Availability Period */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); p2pielen += 2; - // Availability Interval + /* Availability Interval */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); p2pielen += 2; if ( rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) ) { - // Operating Channel (if this WiFi is working as the group owner now) - // Type: + /* Operating Channel (if this WiFi is working as the group owner now) */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_OPERATING_CH; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0005 ); p2pielen += 2; - // Value: - // Country String + /* Value: */ + /* Country String */ p2pie[ p2pielen++ ] = 'X'; p2pie[ p2pielen++ ] = 'X'; - // The third byte should be set to 0x04. - // Described in the "Operating Channel Attribute" section. + /* The third byte should be set to 0x04. */ + /* Described in the "Operating Channel Attribute" section. */ p2pie[ p2pielen++ ] = 0x04; - // Operating Class - p2pie[ p2pielen++ ] = 0x51; // Copy from SD7 + /* Operating Class */ + p2pie[ p2pielen++ ] = 0x51; /* Copy from SD7 */ - // Channel Number - p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // operating channel number + /* Channel Number */ + p2pie[ p2pielen++ ] = pwdinfo->operating_channel; /* operating channel number */ } @@ -5112,7 +5065,7 @@ static int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) if ( pmlmepriv->wps_probe_req_ie != NULL ) { - //WPS IE + /* WPS IE */ _rtw_memcpy(pframe, pmlmepriv->wps_probe_req_ie, pmlmepriv->wps_probe_req_ie_len); pattrib->pktlen += pmlmepriv->wps_probe_req_ie_len; pframe += pmlmepriv->wps_probe_req_ie_len; @@ -5131,13 +5084,13 @@ static int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) #ifdef CONFIG_IOCTL_CFG80211 else if (pmlmepriv->wfd_probe_req_ie != NULL && pmlmepriv->wfd_probe_req_ie_len>0) { - //WFD IE + /* WFD IE */ _rtw_memcpy(pframe, pmlmepriv->wfd_probe_req_ie, pmlmepriv->wfd_probe_req_ie_len); pattrib->pktlen += pmlmepriv->wfd_probe_req_ie_len; pframe += pmlmepriv->wfd_probe_req_ie_len; } -#endif //CONFIG_IOCTL_CFG80211 -#endif //CONFIG_WFD +#endif /* CONFIG_IOCTL_CFG80211 */ +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -5200,7 +5153,7 @@ exit: return ret; } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ static s32 rtw_action_public_decache(union recv_frame *recv_frame, s32 token) { @@ -5249,7 +5202,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); u8 result = P2P_STATUS_SUCCESS; u8 empty_addr[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); @@ -5266,15 +5219,15 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) rtw_cfg80211_rx_p2p_action_public(padapter, pframe, len); } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { - // Do nothing if the driver doesn't enable the P2P function. + /* Do nothing if the driver doesn't enable the P2P function. */ if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE)) return _SUCCESS; len -= sizeof(struct rtw_ieee80211_hdr_3addr); - switch ( frame_body[ 6 ] )//OUI Subtype + switch ( frame_body[ 6 ] )/* OUI Subtype */ { case P2P_GO_NEGO_REQ: { @@ -5288,10 +5241,10 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_FAIL)) { - // Commented by Albert 20110526 - // In this case, this means the previous nego fail doesn't be reset yet. + /* Commented by Albert 20110526 */ + /* In this case, this means the previous nego fail doesn't be reset yet. */ _cancel_timer_ex( &pwdinfo->restore_p2p_state_timer ); - // Restore the previous p2p state + /* Restore the previous p2p state */ rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo)); DBG_88E( "[%s] Restore the previous p2p state to %d\n", __func__, rtw_p2p_state(pwdinfo) ); } @@ -5300,15 +5253,15 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) { _cancel_timer_ex( &pwdinfo->ap_p2p_switch_timer ); } -#endif // CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ - // Commented by Kurt 20110902 - //Add if statement to avoid receiving duplicate prov disc req. such that pre_p2p_state would be covered. + /* Commented by Kurt 20110902 */ + /* Add if statement to avoid receiving duplicate prov disc req. such that pre_p2p_state would be covered. */ if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo)); - // Commented by Kurt 20120113 - // Get peer_dev_addr here if peer doesn't issue prov_disc frame. + /* Commented by Kurt 20120113 */ + /* Get peer_dev_addr here if peer doesn't issue prov_disc frame. */ if (_rtw_memcmp(pwdinfo->rx_prov_disc_info.peerDevAddr, empty_addr, ETH_ALEN)) _rtw_memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN); @@ -5320,16 +5273,16 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) padapter->mlmepriv.widi_state = INTEL_WIDI_STATE_WFD_CONNECTION; intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_STOP_WK, NULL); } -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ - // Commented by Albert 20110718 - // No matter negotiating or negotiation failure, the driver should set up the restore P2P state timer. + /* Commented by Albert 20110718 */ + /* No matter negotiating or negotiation failure, the driver should set up the restore P2P state timer. */ #ifdef CONFIG_CONCURRENT_MODE - // Commented by Albert 20120107 + /* Commented by Albert 20120107 */ _set_timer( &pwdinfo->restore_p2p_state_timer, 3000 ); -#else // CONFIG_CONCURRENT_MODE +#else /* CONFIG_CONCURRENT_MODE */ _set_timer( &pwdinfo->restore_p2p_state_timer, 5000 ); -#endif // CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ break; } case P2P_GO_NEGO_RESP: @@ -5338,8 +5291,8 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) { - // Commented by Albert 20110425 - // The restore timer is enabled when issuing the nego request frame of rtw_p2p_connect function. + /* Commented by Albert 20110425 */ + /* The restore timer is enabled when issuing the nego request frame of rtw_p2p_connect function. */ _cancel_timer_ex( &pwdinfo->restore_p2p_state_timer ); pwdinfo->nego_req_info.benable = false; result = process_p2p_group_negotation_resp( pwdinfo, frame_body, len); @@ -5354,7 +5307,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) } } - // Reset the dialog token for group negotiation frames. + /* Reset the dialog token for group negotiation frames. */ pwdinfo->negotiation_dialog_token = 1; if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_FAIL)) @@ -5386,14 +5339,14 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) } case P2P_INVIT_REQ: { - // Added by Albert 2010/10/05 - // Received the P2P Invite Request frame. + /* Added by Albert 2010/10/05 */ + /* Received the P2P Invite Request frame. */ DBG_88E( "[%s] Got invite request frame!\n", __func__ ); if ( (p2p_ie=rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen)) ) { - // Parse the necessary information from the P2P Invitation Request frame. - // For example: The MAC address of sending this P2P Invitation Request frame. + /* Parse the necessary information from the P2P Invitation Request frame. */ + /* For example: The MAC address of sending this P2P Invitation Request frame. */ u32 attr_contentlen = 0; u8 status_code = P2P_STATUS_FAIL_INFO_UNAVAILABLE; struct group_id_info group_id; @@ -5404,11 +5357,11 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) { rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_BSSID, pwdinfo->p2p_peer_interface_addr, &attr_contentlen); - // Commented by Albert 20120510 - // Copy to the pwdinfo->p2p_peer_interface_addr. - // So that the WFD UI ( or Sigma ) can get the peer interface address by using the following command. - // #> iwpriv wlan0 p2p_get peer_ifa - // After having the peer interface address, the sigma can find the correct conf file for wpa_supplicant. + /* Commented by Albert 20120510 */ + /* Copy to the pwdinfo->p2p_peer_interface_addr. */ + /* So that the WFD UI ( or Sigma ) can get the peer interface address by using the following command. */ + /* #> iwpriv wlan0 p2p_get peer_ifa */ + /* After having the peer interface address, the sigma can find the correct conf file for wpa_supplicant. */ if ( attr_contentlen ) { @@ -5420,7 +5373,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) if ( invitation_flag & P2P_INVITATION_FLAGS_PERSISTENT ) { - // Re-invoke the persistent group. + /* Re-invoke the persistent group. */ _rtw_memset( &group_id, 0x00, sizeof( struct group_id_info ) ); rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, ( u8* ) &group_id, &attr_contentlen); @@ -5428,14 +5381,14 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) { if ( _rtw_memcmp( group_id.go_device_addr, myid( &padapter->eeprompriv ), ETH_ALEN ) ) { - // The p2p device sending this p2p invitation request wants this Wi-Fi device to be the persistent GO. + /* The p2p device sending this p2p invitation request wants this Wi-Fi device to be the persistent GO. */ rtw_p2p_set_state(pwdinfo, P2P_STATE_RECV_INVITE_REQ_GO ); rtw_p2p_set_role( pwdinfo, P2P_ROLE_GO ); status_code = P2P_STATUS_SUCCESS; } else { - // The p2p device sending this p2p invitation request wants to be the persistent GO. + /* The p2p device sending this p2p invitation request wants to be the persistent GO. */ if ( is_matched_in_profilelist( pwdinfo->p2p_peer_interface_addr, &pwdinfo->profileinfo[ 0 ] ) ) { u8 operatingch_info[5] = { 0x00 }; @@ -5443,7 +5396,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) { if ( rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, (u32)operatingch_info[4] ) ) { - // The operating channel is acceptable for this device. + /* The operating channel is acceptable for this device. */ pwdinfo->rx_invitereq_info.operation_ch[0]= operatingch_info[4]; pwdinfo->rx_invitereq_info.scan_op_ch_only = 1; _set_timer( &pwdinfo->reset_ch_sitesurvey, P2P_RESET_SCAN_CH ); @@ -5453,7 +5406,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) } else { - // The operating channel isn't supported by this device. + /* The operating channel isn't supported by this device. */ rtw_p2p_set_state(pwdinfo, P2P_STATE_RECV_INVITE_REQ_DISMATCH ); rtw_p2p_set_role( pwdinfo, P2P_ROLE_DEVICE ); status_code = P2P_STATUS_FAIL_NO_COMMON_CH; @@ -5462,9 +5415,9 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) } else { - // Commented by Albert 20121130 - // Intel will use the different P2P IE to store the operating channel information - // Workaround for Intel WiDi 3.5 + /* Commented by Albert 20121130 */ + /* Intel will use the different P2P IE to store the operating channel information */ + /* Workaround for Intel WiDi 3.5 */ rtw_p2p_set_state(pwdinfo, P2P_STATE_RECV_INVITE_REQ_MATCH ); rtw_p2p_set_role( pwdinfo, P2P_ROLE_CLIENT ); status_code = P2P_STATUS_SUCCESS; @@ -5476,7 +5429,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) #ifdef CONFIG_INTEL_WIDI _rtw_memcpy( pwdinfo->p2p_peer_device_addr, group_id.go_device_addr , ETH_ALEN ); rtw_p2p_set_role( pwdinfo, P2P_ROLE_CLIENT ); - #endif //CONFIG_INTEL_WIDI + #endif /* CONFIG_INTEL_WIDI */ status_code = P2P_STATUS_FAIL_UNKNOWN_P2PGROUP; } @@ -5490,7 +5443,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) } else { - // Received the invitation to join a P2P group. + /* Received the invitation to join a P2P group. */ _rtw_memset( &group_id, 0x00, sizeof( struct group_id_info ) ); rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, ( u8* ) &group_id, &attr_contentlen); @@ -5498,18 +5451,18 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) { if ( _rtw_memcmp( group_id.go_device_addr, myid( &padapter->eeprompriv ), ETH_ALEN ) ) { - // In this case, the GO can't be myself. + /* In this case, the GO can't be myself. */ rtw_p2p_set_state(pwdinfo, P2P_STATE_RECV_INVITE_REQ_DISMATCH ); status_code = P2P_STATUS_FAIL_INFO_UNAVAILABLE; } else { - // The p2p device sending this p2p invitation request wants to join an existing P2P group - // Commented by Albert 2012/06/28 - // In this case, this Wi-Fi device should use the iwpriv command to get the peer device address. - // The peer device address should be the destination address for the provisioning discovery request. - // Then, this Wi-Fi device should use the iwpriv command to get the peer interface address. - // The peer interface address should be the address for WPS mac address + /* The p2p device sending this p2p invitation request wants to join an existing P2P group */ + /* Commented by Albert 2012/06/28 */ + /* In this case, this Wi-Fi device should use the iwpriv command to get the peer device address. */ + /* The peer device address should be the destination address for the provisioning discovery request. */ + /* Then, this Wi-Fi device should use the iwpriv command to get the peer interface address. */ + /* The peer interface address should be the address for WPS mac address */ _rtw_memcpy( pwdinfo->p2p_peer_device_addr, group_id.go_device_addr , ETH_ALEN ); rtw_p2p_set_role( pwdinfo, P2P_ROLE_CLIENT ); rtw_p2p_set_state(pwdinfo, P2P_STATE_RECV_INVITE_REQ_JOIN ); @@ -5540,7 +5493,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) padapter->mlmepriv.widi_state = INTEL_WIDI_STATE_WFD_CONNECTION; intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_STOP_WK, NULL); } -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ break; } case P2P_INVIT_RESP: @@ -5612,8 +5565,8 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) process_p2p_provdisc_req(pwdinfo, pframe, len); _rtw_memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN); - //20110902 Kurt - //Add the following statement to avoid receiving duplicate prov disc req. such that pre_p2p_state would be covered. + /* 20110902 Kurt */ + /* Add the following statement to avoid receiving duplicate prov disc req. such that pre_p2p_state would be covered. */ if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_REQ)) rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo)); @@ -5625,15 +5578,15 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) padapter->mlmepriv.widi_state = INTEL_WIDI_STATE_WFD_CONNECTION; intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_STOP_WK, NULL); } -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ break; case P2P_PROVISION_DISC_RESP: - // Commented by Albert 20110707 - // Should we check the pwdinfo->tx_prov_disc_info.bsent flag here?? + /* Commented by Albert 20110707 */ + /* Should we check the pwdinfo->tx_prov_disc_info.bsent flag here?? */ DBG_88E( "[%s] Got Provisioning Discovery Response Frame\n", __func__ ); - // Commented by Albert 20110426 - // The restore timer is enabled when issuing the provisioing request frame in rtw_p2p_prov_disc function. + /* Commented by Albert 20110426 */ + /* The restore timer is enabled when issuing the provisioing request frame in rtw_p2p_prov_disc function. */ _cancel_timer_ex( &pwdinfo->restore_p2p_state_timer ); rtw_p2p_set_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_RSP); process_p2p_provdisc_resp(pwdinfo, pframe); @@ -5642,7 +5595,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) } } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ return _SUCCESS; } @@ -5740,8 +5693,8 @@ unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame) DBG_88E("%s\n", __func__); - //check RA matches or not - if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe), ETH_ALEN))//for if1, sta/ap mode + /* check RA matches or not */ + if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe), ETH_ALEN))/* for if1, sta/ap mode */ return _SUCCESS; frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); @@ -5758,7 +5711,7 @@ unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame) rtw_cfg80211_rx_action_p2p(padapter, pframe, len); return _SUCCESS; } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { len -= sizeof(struct rtw_ieee80211_hdr_3addr); OUI_Subtype = frame_body[5]; @@ -5777,7 +5730,7 @@ unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame) break; } } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ return _SUCCESS; } @@ -5810,7 +5763,7 @@ unsigned int OnAction(_adapter *padapter, union recv_frame *precv_frame) unsigned int DoReserved(_adapter *padapter, union recv_frame *precv_frame) { - //DBG_88E("rcvd mgt frame(%x, %x)\n", (GetFrameSubType(pframe) >> 4), *(unsigned int *)GetAddr1Ptr(pframe)); + /* DBG_88E("rcvd mgt frame(%x, %x)\n", (GetFrameSubType(pframe) >> 4), *(unsigned int *)GetAddr1Ptr(pframe)); */ return _SUCCESS; } @@ -5874,9 +5827,9 @@ void update_mgntframe_attrib(_adapter *padapter, struct pkt_attrib *pattrib) pattrib->pktlen = 0; if (pmlmeext->cur_wireless_mode & WIRELESS_11B) - pattrib->raid = 6;//b mode + pattrib->raid = 6;/* b mode */ else - pattrib->raid = 5;//a/g mode + pattrib->raid = 5;/* a/g mode */ pattrib->encrypt = _NO_PRIVACY_; pattrib->bswenc = false; @@ -5927,7 +5880,7 @@ s32 dump_mgntframe_and_wait_ack(_adapter *padapter, struct xmit_frame *pmgntfram { #ifdef CONFIG_XMIT_ACK s32 ret = _FAIL; - u32 timeout_ms = 500;// 500ms + u32 timeout_ms = 500;/* 500ms */ struct xmit_priv *pxmitpriv = &padapter->xmitpriv; #ifdef CONFIG_CONCURRENT_MODE if (padapter->pbuddy_adapter && !padapter->isprimary) @@ -5950,11 +5903,11 @@ s32 dump_mgntframe_and_wait_ack(_adapter *padapter, struct xmit_frame *pmgntfram _exit_critical_mutex(&pxmitpriv->ack_tx_mutex, NULL); return ret; -#else //!CONFIG_XMIT_ACK +#else /* CONFIG_XMIT_ACK */ dump_mgntframe(padapter, pmgntframe); rtw_msleep_os(50); return _SUCCESS; -#endif //!CONFIG_XMIT_ACK +#endif /* CONFIG_XMIT_ACK */ } static int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode) @@ -5965,7 +5918,7 @@ static int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode) ssid_ie = rtw_get_ie(ies, WLAN_EID_SSID, &ssid_len_ori, ies_len); - //DBG_88E("%s hidden_ssid_mode:%u, ssid_ie:%p, ssid_len_ori:%d\n", __func__, hidden_ssid_mode, ssid_ie, ssid_len_ori); + /* DBG_88E("%s hidden_ssid_mode:%u, ssid_ie:%p, ssid_len_ori:%d\n", __func__, hidden_ssid_mode, ssid_ie, ssid_len_ori); */ if (ssid_ie && ssid_len_ori>0) { @@ -6007,17 +5960,17 @@ void issue_beacon(_adapter *padapter, int timeout_ms) #if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) _irqL irqL; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); -#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#endif /* if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */ struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &(padapter->wdinfo); -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ - //DBG_88E("%s\n", __func__); + /* DBG_88E("%s\n", __func__); */ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { @@ -6026,9 +5979,9 @@ void issue_beacon(_adapter *padapter, int timeout_ms) } #if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); -#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#endif /* if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */ - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); pattrib->qsel = 0x10; @@ -6047,7 +6000,7 @@ void issue_beacon(_adapter *padapter, int timeout_ms) _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); - //pmlmeext->mgnt_seq++; + /* pmlmeext->mgnt_seq++; */ SetFrameSubType(pframe, WIFI_BEACON); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); @@ -6055,9 +6008,9 @@ void issue_beacon(_adapter *padapter, int timeout_ms) if ( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) { - //DBG_88E("ie len=%d\n", cur_network->IELength); + /* DBG_88E("ie len=%d\n", cur_network->IELength); */ #ifdef CONFIG_P2P - // for P2P : Primary Device Type & Device Name + /* for P2P : Primary Device Type & Device Name */ u32 wpsielen=0, insert_len=0; u8 *wpsie=NULL; wpsie = rtw_get_wps_ie(cur_network->IEs+_FIXED_IE_LENGTH_, cur_network->IELength-_FIXED_IE_LENGTH_, NULL, &wpsielen); @@ -6086,7 +6039,7 @@ void issue_beacon(_adapter *padapter, int timeout_ms) pframe += pmlmepriv->wps_beacon_ie_len; pattrib->pktlen += pmlmepriv->wps_beacon_ie_len; - //copy remainder_ie to pframe + /* copy remainder_ie to pframe */ _rtw_memcpy(pframe, premainder_ie, remainder_ielen); pframe += remainder_ielen; pattrib->pktlen += remainder_ielen; @@ -6099,66 +6052,66 @@ void issue_beacon(_adapter *padapter, int timeout_ms) } } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { pframe_wscie = pframe + wps_offset; _rtw_memcpy(pframe, cur_network->IEs, wps_offset+wpsielen); pframe += (wps_offset + wpsielen); pattrib->pktlen += (wps_offset + wpsielen); - //now pframe is end of wsc ie, insert Primary Device Type & Device Name - // Primary Device Type - // Type: + /* now pframe is end of wsc ie, insert Primary Device Type & Device Name */ + /* Primary Device Type */ + /* Type: */ *(__be16 *) ( pframe + insert_len) = cpu_to_be16( WPS_ATTR_PRIMARY_DEV_TYPE ); insert_len += 2; - // Length: + /* Length: */ *(__be16 *) ( pframe + insert_len ) = cpu_to_be16( 0x0008 ); insert_len += 2; - // Value: - // Category ID + /* Value: */ + /* Category ID */ *(__be16 *) ( pframe + insert_len ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); insert_len += 2; - // OUI + /* OUI */ *(__be32 *) ( pframe + insert_len ) = cpu_to_be32( WPSOUI ); insert_len += 4; - // Sub Category ID + /* Sub Category ID */ *(__be16 *) ( pframe + insert_len ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); insert_len += 2; - // Device Name - // Type: + /* Device Name */ + /* Type: */ *(__be16 *) ( pframe + insert_len ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); insert_len += 2; - // Length: + /* Length: */ *(__be16 *) ( pframe + insert_len ) = cpu_to_be16( pwdinfo->device_name_len ); insert_len += 2; - // Value: + /* Value: */ _rtw_memcpy( pframe + insert_len, pwdinfo->device_name, pwdinfo->device_name_len ); insert_len += pwdinfo->device_name_len; - //update wsc ie length + /* update wsc ie length */ *(pframe_wscie+1) = (wpsielen -2) + insert_len; - //pframe move to end + /* pframe move to end */ pframe+=insert_len; pattrib->pktlen += insert_len; - //copy remainder_ie to pframe + /* copy remainder_ie to pframe */ _rtw_memcpy(pframe, premainder_ie, remainder_ielen); pframe += remainder_ielen; pattrib->pktlen += remainder_ielen; } } else -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ { int len_diff; _rtw_memcpy(pframe, cur_network->IEs, cur_network->IELength); @@ -6198,7 +6151,7 @@ void issue_beacon(_adapter *padapter, int timeout_ms) _rtw_memcpy(pframe, pmlmepriv->p2p_beacon_ie, len); } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { len = build_beacon_p2p_ie(pwdinfo, pframe); } @@ -6208,7 +6161,7 @@ void issue_beacon(_adapter *padapter, int timeout_ms) #ifdef CONFIG_WFD #ifdef CONFIG_IOCTL_CFG80211 if (true == pwdinfo->wfd_info->wfd_enable) -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { len = build_beacon_wfd_ie( pwdinfo, pframe ); } @@ -6222,69 +6175,69 @@ void issue_beacon(_adapter *padapter, int timeout_ms) _rtw_memcpy(pframe, pmlmepriv->wfd_beacon_ie, len); } } -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ pframe += len; pattrib->pktlen += len; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ goto _issue_bcn; } - //below for ad-hoc mode + /* below for ad-hoc mode */ - //timestamp will be inserted by hardware + /* timestamp will be inserted by hardware */ pframe += 8; pattrib->pktlen += 8; - // beacon interval: 2 bytes + /* beacon interval: 2 bytes */ _rtw_memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2); pframe += 2; pattrib->pktlen += 2; - // capability info: 2 bytes + /* capability info: 2 bytes */ _rtw_memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2); pframe += 2; pattrib->pktlen += 2; - // SSID + /* SSID */ pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); - // supported rates... + /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8)? 8: rate_len), cur_network->SupportedRates, &pattrib->pktlen); - // DS parameter set + /* DS parameter set */ pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); - //if ( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) + /* if ( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) */ { u8 erpinfo=0; u32 ATIMWindow; - // IBSS Parameter Set... - //ATIMWindow = cur->Configuration.ATIMWindow; + /* IBSS Parameter Set... */ + /* ATIMWindow = cur->Configuration.ATIMWindow; */ ATIMWindow = 0; pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); - //ERP IE + /* ERP IE */ pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pattrib->pktlen); } - // EXTERNDED SUPPORTED RATE + /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) { pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); } - //todo:HT for adhoc + /* todo:HT for adhoc */ _issue_bcn: @@ -6292,7 +6245,7 @@ _issue_bcn: pmlmepriv->update_bcn = false; _exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); -#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#endif /* if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */ if ((pattrib->pktlen + TXDESC_SIZE) > 512) { @@ -6302,7 +6255,7 @@ _issue_bcn: pattrib->last_txcmdsz = pattrib->pktlen; - //DBG_88E("issue bcn_sz=%d\n", pattrib->last_txcmdsz); + /* DBG_88E("issue bcn_sz=%d\n", pattrib->last_txcmdsz); */ if (timeout_ms > 0) dump_mgntframe_and_wait(padapter, pmgntframe, timeout_ms); else @@ -6323,7 +6276,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe u8 *pwps_ie; uint wps_ielen; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#endif /* if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */ struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); @@ -6332,10 +6285,10 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD -#endif //CONFIG_P2P +#endif /* CONFIG_WFD */ +#endif /* CONFIG_P2P */ - //DBG_88E("%s\n", __func__); + /* DBG_88E("%s\n", __func__); */ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { @@ -6344,7 +6297,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -6379,7 +6332,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe { pwps_ie = rtw_get_wps_ie(cur_network->IEs+_FIXED_IE_LENGTH_, cur_network->IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen); - //inerset & update wps_probe_resp_ie + /* inerset & update wps_probe_resp_ie */ if ((pmlmepriv->wps_probe_resp_ie!=NULL) && pwps_ie && (wps_ielen>0)) { uint wps_offset, remainder_ielen; @@ -6395,7 +6348,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe pframe += wps_offset; pattrib->pktlen += wps_offset; - wps_ielen = (uint)pmlmepriv->wps_probe_resp_ie[1];//to get ie data len + wps_ielen = (uint)pmlmepriv->wps_probe_resp_ie[1];/* to get ie data len */ if ((wps_offset+wps_ielen+2)<=MAX_IE_SZ) { _rtw_memcpy(pframe, pmlmepriv->wps_probe_resp_ie, wps_ielen+2); @@ -6422,58 +6375,58 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe #endif { - //timestamp will be inserted by hardware + /* timestamp will be inserted by hardware */ pframe += 8; pattrib->pktlen += 8; - // beacon interval: 2 bytes + /* beacon interval: 2 bytes */ _rtw_memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2); pframe += 2; pattrib->pktlen += 2; - // capability info: 2 bytes + /* capability info: 2 bytes */ _rtw_memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2); pframe += 2; pattrib->pktlen += 2; - //below for ad-hoc mode + /* below for ad-hoc mode */ - // SSID + /* SSID */ pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); - // supported rates... + /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8)? 8: rate_len), cur_network->SupportedRates, &pattrib->pktlen); - // DS parameter set + /* DS parameter set */ pframe =rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); if ( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) { u8 erpinfo=0; u32 ATIMWindow; - // IBSS Parameter Set... - //ATIMWindow = cur->Configuration.ATIMWindow; + /* IBSS Parameter Set... */ + /* ATIMWindow = cur->Configuration.ATIMWindow; */ ATIMWindow = 0; pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); - //ERP IE + /* ERP IE */ pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pattrib->pktlen); } - // EXTERNDED SUPPORTED RATE + /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) { pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); } - //todo:HT for adhoc + /* todo:HT for adhoc */ } @@ -6484,13 +6437,13 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe #ifdef CONFIG_IOCTL_CFG80211 if (wdev_to_priv(padapter->rtw_wdev)->p2p_enabled) { - //if pwdinfo->role == P2P_ROLE_DEVICE will call issue_probersp_p2p() + /* if pwdinfo->role == P2P_ROLE_DEVICE will call issue_probersp_p2p() */ len = pmlmepriv->p2p_go_probe_resp_ie_len; if (pmlmepriv->p2p_go_probe_resp_ie && len>0) _rtw_memcpy(pframe, pmlmepriv->p2p_go_probe_resp_ie, len); } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { len = build_probe_resp_p2p_ie(pwdinfo, pframe); } @@ -6501,7 +6454,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe #ifdef CONFIG_WFD #ifdef CONFIG_IOCTL_CFG80211 if (true == pwdinfo->wfd_info->wfd_enable) -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { len = build_probe_resp_wfd_ie(pwdinfo, pframe, 0); } @@ -6515,13 +6468,13 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe _rtw_memcpy(pframe, pmlmepriv->wfd_probe_resp_ie, len); } } -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ pframe += len; pattrib->pktlen += len; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -6557,7 +6510,7 @@ static int _issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 *da, goto exit; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -6574,13 +6527,13 @@ static int _issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 *da, if (da) { - // unicast probe request frame + /* unicast probe request frame */ _rtw_memcpy(pwlanhdr->addr1, da, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, da, ETH_ALEN); } else { - // broadcast probe request frame + /* broadcast probe request frame */ _rtw_memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, bc_addr, ETH_ALEN); } @@ -6611,13 +6564,12 @@ static int _issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 *da, pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); } - //add wps_ie for wps2.0 + /* add wps_ie for wps2.0 */ if (pmlmepriv->wps_probe_req_ie_len>0 && pmlmepriv->wps_probe_req_ie) { _rtw_memcpy(pframe, pmlmepriv->wps_probe_req_ie, pmlmepriv->wps_probe_req_ie_len); pframe += pmlmepriv->wps_probe_req_ie_len; pattrib->pktlen += pmlmepriv->wps_probe_req_ie_len; - //pmlmepriv->wps_probe_req_ie_len = 0 ;//reset to zero } pattrib->last_txcmdsz = pattrib->pktlen; @@ -6682,7 +6634,7 @@ exit: return ret; } -// if psta == NULL, indiate we are station(client) now... +/* if psta == NULL, indiate we are station(client) now... */ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status) { struct xmit_frame *pmgntframe; @@ -6701,7 +6653,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) return; - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -6721,7 +6673,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); - if (psta)// for AP mode + if (psta)/* for AP mode */ { #ifdef CONFIG_NATIVEAP_MLME @@ -6730,7 +6682,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status _rtw_memcpy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)), ETH_ALEN); - // setting auth algo number + /* setting auth algo number */ val16 = (u16)psta->authalg; if (status != _STATS_SUCCESSFUL_) @@ -6745,17 +6697,17 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status pframe = rtw_set_fixed_ie(pframe, _AUTH_ALGM_NUM_, (unsigned char *)&le_val16, &(pattrib->pktlen)); - // setting auth seq number + /* setting auth seq number */ val16 =(u16)psta->auth_seq; le_val16 = cpu_to_le16(val16); pframe = rtw_set_fixed_ie(pframe, _AUTH_SEQ_NUM_, (unsigned char *)&le_val16, &(pattrib->pktlen)); - // setting status code... + /* setting status code... */ val16 = status; le_val16 = cpu_to_le16(val16); pframe = rtw_set_fixed_ie(pframe, _STATUS_CODE_, (unsigned char *)&le_val16, &(pattrib->pktlen)); - // added challenging text... + /* added challenging text... */ if ((psta->auth_seq == 2) && (psta->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) { pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, psta->chg_txt, &(pattrib->pktlen)); @@ -6768,12 +6720,12 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status _rtw_memcpy(pwlanhdr->addr2, myid(&padapter->eeprompriv), ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); - // setting auth algo number - val16 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared)? 1: 0;// 0:OPEN System, 1:Shared key + /* setting auth algo number */ + val16 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared)? 1: 0;/* 0:OPEN System, 1:Shared key */ if (val16) use_shared_key = 1; - //setting IV for auth seq #3 + /* setting IV for auth seq #3 */ if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) { val32 = ((pmlmeinfo->iv++) | (pmlmeinfo->key_index << 30)); @@ -6786,17 +6738,17 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status le_tmp16 = cpu_to_le16(val16); pframe = rtw_set_fixed_ie(pframe, _AUTH_ALGM_NUM_, (unsigned char *)&le_tmp16, &(pattrib->pktlen)); - // setting auth seq number + /* setting auth seq number */ val16 = pmlmeinfo->auth_seq; le_tmp16 = cpu_to_le16(val16); pframe = rtw_set_fixed_ie(pframe, _AUTH_SEQ_NUM_, (unsigned char *)&le_tmp16, &(pattrib->pktlen)); - // setting status code... + /* setting status code... */ le_tmp16 = cpu_to_le16(status); pframe = rtw_set_fixed_ie(pframe, _STATUS_CODE_, (unsigned char *)&le_tmp16, &(pattrib->pktlen)); - // then checking to see if sending challenging text... + /* then checking to see if sending challenging text... */ if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) { pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, pmlmeinfo->chg_txt, &(pattrib->pktlen)); @@ -6845,9 +6797,9 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ DBG_88E("%s\n", __func__); @@ -6856,7 +6808,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -6885,7 +6837,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p pattrib->pktlen += pattrib->hdrlen; pframe += pattrib->hdrlen; - //capability + /* capability */ val = *(unsigned short *)rtw_get_capability_from_ie(ie); pframe = rtw_set_fixed_ie(pframe, _CAPABILITY_ , (unsigned char *)&val, &(pattrib->pktlen)); @@ -6907,8 +6859,8 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p if ((pstat->flags & WLAN_STA_HT) && (pmlmepriv->htpriv.ht_option)) { uint ie_len=0; - //FILL HT CAP INFO IE - //p = hostapd_eid_ht_capabilities_info(hapd, p); + /* FILL HT CAP INFO IE */ + /* p = hostapd_eid_ht_capabilities_info(hapd, p); */ pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (pbuf && ie_len > 0) { _rtw_memcpy(pframe, pbuf, ie_len+2); @@ -6916,8 +6868,8 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p pattrib->pktlen +=(ie_len+2); } - //FILL HT ADD INFO IE - //p = hostapd_eid_ht_operation(hapd, p); + /* FILL HT ADD INFO IE */ + /* p = hostapd_eid_ht_operation(hapd, p); */ pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (pbuf && ie_len > 0) { _rtw_memcpy(pframe, pbuf, ie_len+2); @@ -6927,7 +6879,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p } #endif - //FILL WMM IE + /* FILL WMM IE */ if ((pstat->flags & WLAN_STA_WME) && (pmlmepriv->qospriv.qos_option)) { uint ie_len = 0; unsigned char WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01}; @@ -6949,7 +6901,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK) pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 6 , REALTEK_96B_IE, &(pattrib->pktlen)); - //add WPS IE ie for wps 2.0 + /* add WPS IE ie for wps 2.0 */ if (pmlmepriv->wps_assoc_resp_ie && pmlmepriv->wps_assoc_resp_ie_len>0) { _rtw_memcpy(pframe, pmlmepriv->wps_assoc_resp_ie, pmlmepriv->wps_assoc_resp_ie_len); @@ -6967,20 +6919,20 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p pframe += len; pattrib->pktlen += len; } -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ #ifdef CONFIG_WFD if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) #ifdef CONFIG_IOCTL_CFG80211 && (true == pwdinfo->wfd_info->wfd_enable) -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ ) { wfdielen = build_assoc_resp_wfd_ie(pwdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; } -#endif //CONFIG_WFD -#endif //CONFIG_P2P +#endif /* CONFIG_WFD */ +#endif /* CONFIG_P2P */ pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); #endif @@ -7011,17 +6963,17 @@ void issue_assocreq(_adapter *padapter) u16 p2pielen = 0; #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD -#endif //CONFIG_P2P +#endif /* CONFIG_WFD */ +#endif /* CONFIG_P2P */ #ifdef CONFIG_DFS u16 cap; -#endif //CONFIG_DFS +#endif /* CONFIG_DFS */ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) goto exit; - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -7042,7 +6994,7 @@ void issue_assocreq(_adapter *padapter) pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); - //caps + /* caps */ #ifdef CONFIG_DFS _rtw_memcpy(&cap, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); @@ -7050,27 +7002,27 @@ void issue_assocreq(_adapter *padapter) _rtw_memcpy(pframe, &cap, 2); #else _rtw_memcpy(pframe, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); -#endif //CONFIG_DFS +#endif /* CONFIG_DFS */ pframe += 2; pattrib->pktlen += 2; - //listen interval - //todo: listen interval for power saving + /* listen interval */ + /* todo: listen interval for power saving */ le_tmp = cpu_to_le16(3); _rtw_memcpy(pframe ,(unsigned char *)&le_tmp, 2); pframe += 2; pattrib->pktlen += 2; - //SSID + /* SSID */ pframe = rtw_set_ie(pframe, _SSID_IE_, pmlmeinfo->network.Ssid.SsidLength, pmlmeinfo->network.Ssid.Ssid, &(pattrib->pktlen)); - //supported rate & extended supported rate + /* supported rate & extended supported rate */ -#if 1 // Check if the AP's supported rates are also supported by STA. +#if 1 /* Check if the AP's supported rates are also supported by STA. */ get_rate_set(padapter, sta_bssrate, &sta_bssrate_len); - if (pmlmeext->cur_channel == 14)// for JAPAN, channel 14 can only uses B Mode(CCK) + if (pmlmeext->cur_channel == 14)/* for JAPAN, channel 14 can only uses B Mode(CCK) */ sta_bssrate_len = 4; for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) { @@ -7083,19 +7035,19 @@ void issue_assocreq(_adapter *padapter) if (pmlmeinfo->network.SupportedRates[i] == 0) break; - // Check if the AP's supported rates are also supported by STA. + /* Check if the AP's supported rates are also supported by STA. */ for (j=0; j < sta_bssrate_len; j++) { - // Avoid the proprietary data rate (22Mbps) of Handlink WSG-4000 AP + /* Avoid the proprietary data rate (22Mbps) of Handlink WSG-4000 AP */ if ( (pmlmeinfo->network.SupportedRates[i]|IEEE80211_BASIC_RATE_MASK) == (sta_bssrate[j]|IEEE80211_BASIC_RATE_MASK)) break; } if (j == sta_bssrate_len) { - // the rate is not supported by STA + /* the rate is not supported by STA */ DBG_88E("%s(): the rate[%d]=%02X is not supported by STA!\n",__func__, i, pmlmeinfo->network.SupportedRates[i]); } else { - // the rate is supported by STA + /* the rate is supported by STA */ bssrate[index++] = pmlmeinfo->network.SupportedRates[i]; } } @@ -7103,21 +7055,21 @@ void issue_assocreq(_adapter *padapter) bssrate_len = index; DBG_88E("bssrate_len = %d\n", bssrate_len); -#else // Check if the AP's supported rates are also supported by STA. +#else /* Check if the AP's supported rates are also supported by STA. */ for (bssrate_len = 0; bssrate_len < NumRates; bssrate_len++) { if (pmlmeinfo->network.SupportedRates[bssrate_len] == 0) break; - if (pmlmeinfo->network.SupportedRates[bssrate_len] == 0x2C) // Avoid the proprietary data rate (22Mbps) of Handlink WSG-4000 AP + if (pmlmeinfo->network.SupportedRates[bssrate_len] == 0x2C) /* Avoid the proprietary data rate (22Mbps) of Handlink WSG-4000 AP */ break; bssrate[bssrate_len] = pmlmeinfo->network.SupportedRates[bssrate_len]; } -#endif // Check if the AP's supported rates are also supported by STA. +#endif /* Check if the AP's supported rates are also supported by STA. */ if (bssrate_len == 0) { rtw_free_xmitbuf(pxmitpriv, pmgntframe->pxmitbuf); rtw_free_xmitframe(pxmitpriv, pmgntframe); - goto exit; //don't connect to AP if no joint supported rate + goto exit; /* don't connect to AP if no joint supported rate */ } @@ -7128,64 +7080,64 @@ void issue_assocreq(_adapter *padapter) pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); } - //RSN + /* RSN */ p = rtw_get_ie((pmlmeinfo->network.IEs + sizeof(NDIS_802_11_FIXED_IEs)), _RSN_IE_2_, &ie_len, (pmlmeinfo->network.IELength - sizeof(NDIS_802_11_FIXED_IEs))); if (p != NULL) pframe = rtw_set_ie(pframe, _RSN_IE_2_, ie_len, (p + 2), &(pattrib->pktlen)); #ifdef CONFIG_80211N_HT - //HT caps + /* HT caps */ if (padapter->mlmepriv.htpriv.ht_option==true) { p = rtw_get_ie((pmlmeinfo->network.IEs + sizeof(NDIS_802_11_FIXED_IEs)), _HT_CAPABILITY_IE_, &ie_len, (pmlmeinfo->network.IELength - sizeof(NDIS_802_11_FIXED_IEs))); if ((p != NULL) && (!(is_ap_in_tkip(padapter)))) { _rtw_memcpy(&(pmlmeinfo->HT_caps), (p + 2), sizeof(struct HT_caps_element)); - //to disable 40M Hz support while gd_bw_40MHz_en = 0 + /* to disable 40M Hz support while gd_bw_40MHz_en = 0 */ if (pregpriv->cbw40_enable == 0) pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info &= cpu_to_le16(~(BIT(6) | BIT(1))); else pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(BIT(1)); - //todo: disable SM power save mode + /* todo: disable SM power save mode */ pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(0x000c); rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); switch (rf_type) { case RF_1T1R: if (pregpriv->rx_stbc) - pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(0x0100);//RX STBC One spatial stream + pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(0x0100);/* RX STBC One spatial stream */ _rtw_memcpy(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_rate_1R, 16); break; case RF_2T2R: case RF_1T2R: default: - if ((pregpriv->rx_stbc == 0x3) ||//enable for 2.4/5 GHz - ((pmlmeext->cur_wireless_mode & WIRELESS_11_24N) && (pregpriv->rx_stbc == 0x1)) || //enable for 2.4GHz - ((pmlmeext->cur_wireless_mode & WIRELESS_11_5N) && (pregpriv->rx_stbc == 0x2)) || //enable for 5GHz + if ((pregpriv->rx_stbc == 0x3) ||/* enable for 2.4/5 GHz */ + ((pmlmeext->cur_wireless_mode & WIRELESS_11_24N) && (pregpriv->rx_stbc == 0x1)) || /* enable for 2.4GHz */ + ((pmlmeext->cur_wireless_mode & WIRELESS_11_5N) && (pregpriv->rx_stbc == 0x2)) || /* enable for 5GHz */ (pregpriv->wifi_spec==1)) { DBG_88E("declare supporting RX STBC\n"); - pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(0x0200);//RX STBC two spatial stream + pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(0x0200);/* RX STBC two spatial stream */ } #ifdef CONFIG_DISABLE_MCS13TO15 if (pmlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40 && (pregpriv->wifi_spec!=1)) _rtw_memcpy(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_rate_2R_MCS13TO15_OFF, 16); else _rtw_memcpy(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_rate_2R, 16); - #else //CONFIG_DISABLE_MCS13TO15 + #else /* CONFIG_DISABLE_MCS13TO15 */ _rtw_memcpy(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_rate_2R, 16); - #endif //CONFIG_DISABLE_MCS13TO15 + #endif /* CONFIG_DISABLE_MCS13TO15 */ break; } #ifdef RTL8192C_RECONFIG_TO_1T1R if (pregpriv->rx_stbc) - pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(0x0100);//RX STBC One spatial stream + pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(0x0100);/* RX STBC One spatial stream */ _rtw_memcpy(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_rate_1R, 16); #endif #ifdef CONFIG_BT_COEXIST if (BT_1Ant(padapter) == true) { - // set to 8K + /* set to 8K */ pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para &= (u8)~IEEE80211_HT_CAP_AMPDU_FACTOR; } #endif @@ -7195,7 +7147,7 @@ void issue_assocreq(_adapter *padapter) } #endif - //vendor specific IE, such as WPA, WMM, WPS + /* vendor specific IE, such as WPA, WMM, WPS */ for (i = sizeof(NDIS_802_11_FIXED_IEs); i < pmlmeinfo->network.IELength;) { pIE = (PNDIS_802_11_VARIABLE_IEs)(pmlmeinfo->network.IEs + i); @@ -7205,9 +7157,9 @@ void issue_assocreq(_adapter *padapter) (_rtw_memcmp(pIE->data, WMM_OUI, 4)) || (_rtw_memcmp(pIE->data, WPS_OUI, 4))) { if (!padapter->registrypriv.wifi_spec) { - //Commented by Kurt 20110629 - //In some older APs, WPS handshake - //would be fail if we append vender extensions informations to AP + /* Commented by Kurt 20110629 */ + /* In some older APs, WPS handshake */ + /* would be fail if we append vender extensions informations to AP */ if (_rtw_memcmp(pIE->data, WPS_OUI, 4)) pIE->Length=14; } @@ -7237,78 +7189,78 @@ void issue_assocreq(_adapter *padapter) pattrib->pktlen += pmlmepriv->p2p_assoc_req_ie_len; } } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) && !rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE)) { - // Should add the P2P IE in the association request frame. - // P2P OUI + /* Should add the P2P IE in the association request frame. */ + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - // Commented by Albert 20101109 - // According to the P2P Specification, the association request frame should contain 3 P2P attributes - // 1. P2P Capability - // 2. Extended Listen Timing - // 3. Device Info - // Commented by Albert 20110516 - // 4. P2P Interface + /* Commented by Albert 20101109 */ + /* According to the P2P Specification, the association request frame should contain 3 P2P attributes */ + /* 1. P2P Capability */ + /* 2. Extended Listen Timing */ + /* 3. Device Info */ + /* Commented by Albert 20110516 */ + /* 4. P2P Interface */ - // P2P Capability - // Type: + /* P2P Capability */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CAPABILITY; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); p2pielen += 2; - // Value: - // Device Capability Bitmap, 1 byte + /* Value: */ + /* Device Capability Bitmap, 1 byte */ p2pie[ p2pielen++ ] = DMP_P2P_DEVCAP_SUPPORT; - // Group Capability Bitmap, 1 byte + /* Group Capability Bitmap, 1 byte */ if ( pwdinfo->persistent_supported ) p2pie[ p2pielen++ ] = P2P_GRPCAP_PERSISTENT_GROUP | DMP_P2P_GRPCAP_SUPPORT; else p2pie[ p2pielen++ ] = DMP_P2P_GRPCAP_SUPPORT; - // Extended Listen Timing - // Type: + /* Extended Listen Timing */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_EX_LISTEN_TIMING; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x0004 ); p2pielen += 2; - // Value: - // Availability Period + /* Value: */ + /* Availability Period */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); p2pielen += 2; - // Availability Interval + /* Availability Interval */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); p2pielen += 2; - // Device Info - // Type: + /* Device Info */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_DEVICE_INFO; - // Length: - // 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) - // + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) + /* Length: */ + /* 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */ + /* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); p2pielen += 2; - // Value: - // P2P Device Address + /* Value: */ + /* P2P Device Address */ _rtw_memcpy( p2pie + p2pielen, myid( &padapter->eeprompriv ), ETH_ALEN ); p2pielen += ETH_ALEN; - // Config Method - // This field should be big endian. Noted by P2P specification. + /* Config Method */ + /* This field should be big endian. Noted by P2P specification. */ if ( ( pwdinfo->ui_got_wps_info == P2P_GOT_WPSINFO_PEER_DISPLAY_PIN ) || ( pwdinfo->ui_got_wps_info == P2P_GOT_WPSINFO_SELF_DISPLAY_PIN ) ) { @@ -7321,68 +7273,68 @@ void issue_assocreq(_adapter *padapter) p2pielen += 2; - // Primary Device Type - // Category ID + /* Primary Device Type */ + /* Category ID */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); p2pielen += 2; - // OUI + /* OUI */ *(__be32 *) ( p2pie + p2pielen ) = cpu_to_be32( WPSOUI ); p2pielen += 4; - // Sub Category ID + /* Sub Category ID */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); p2pielen += 2; - // Number of Secondary Device Types - p2pie[ p2pielen++ ] = 0x00; // No Secondary Device Type List + /* Number of Secondary Device Types */ + p2pie[ p2pielen++ ] = 0x00; /* No Secondary Device Type List */ - // Device Name - // Type: + /* Device Name */ + /* Type: */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); p2pielen += 2; - // Length: + /* Length: */ *(__be16 *) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->device_name_len ); p2pielen += 2; - // Value: + /* Value: */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_name, pwdinfo->device_name_len ); p2pielen += pwdinfo->device_name_len; - // P2P Interface - // Type: + /* P2P Interface */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_INTERFACE; - // Length: + /* Length: */ *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16( 0x000D ); p2pielen += 2; - // Value: - _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN ); // P2P Device Address + /* Value: */ + _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN ); /* P2P Device Address */ p2pielen += ETH_ALEN; - p2pie[ p2pielen++ ] = 1; // P2P Interface Address Count + p2pie[ p2pielen++ ] = 1; /* P2P Interface Address Count */ - _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN ); // P2P Interface Address List + _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN ); /* P2P Interface Address List */ p2pielen += ETH_ALEN; pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen ); #ifdef CONFIG_WFD - //wfdielen = build_assoc_req_wfd_ie(pwdinfo, pframe); - //pframe += wfdielen; - //pattrib->pktlen += wfdielen; -#endif //CONFIG_WFD + /* wfdielen = build_assoc_req_wfd_ie(pwdinfo, pframe); */ + /* pframe += wfdielen; */ + /* pattrib->pktlen += wfdielen; */ +#endif /* CONFIG_WFD */ } } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ #ifdef CONFIG_WFD #ifdef CONFIG_IOCTL_CFG80211 if ( true == pwdinfo->wfd_info->wfd_enable ) -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { wfdielen = build_assoc_req_wfd_ie(pwdinfo, pframe); pframe += wfdielen; @@ -7391,13 +7343,13 @@ void issue_assocreq(_adapter *padapter) #ifdef CONFIG_IOCTL_CFG80211 else if (pmlmepriv->wfd_assoc_req_ie != NULL && pmlmepriv->wfd_assoc_req_ie_len>0) { - //WFD IE + /* WFD IE */ _rtw_memcpy(pframe, pmlmepriv->wfd_assoc_req_ie, pmlmepriv->wfd_assoc_req_ie_len); pattrib->pktlen += pmlmepriv->wfd_assoc_req_ie_len; pframe += pmlmepriv->wfd_assoc_req_ie_len; } -#endif //CONFIG_IOCTL_CFG80211 -#endif //CONFIG_WFD +#endif /* CONFIG_IOCTL_CFG80211 */ +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); @@ -7413,7 +7365,7 @@ exit: return; } -//when wait_ack is ture, this function shoule be called at process context +/* when wait_ack is ture, this function shoule be called at process context */ static int _issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int power_mode, int wait_ack) { int ret = _FAIL; @@ -7426,7 +7378,7 @@ static int _issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int p struct mlme_ext_priv *pmlmeext; struct mlme_ext_info *pmlmeinfo; - //DBG_88E("%s:%d\n", __func__, power_mode); + /* DBG_88E("%s:%d\n", __func__, power_mode); */ if (!padapter) goto exit; @@ -7440,7 +7392,7 @@ static int _issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int p goto exit; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); pattrib->retry_ctrl = false; @@ -7495,8 +7447,8 @@ exit: } -//when wait_ms >0 , this function shoule be called at process context -//da == NULL for station mode +/* when wait_ms >0 , this function shoule be called at process context */ +/* da == NULL for station mode */ int issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms) { int ret; @@ -7544,7 +7496,7 @@ exit: return ret; } -//when wait_ack is ture, this function shoule be called at process context +/* when wait_ack is ture, this function shoule be called at process context */ static int _issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, int wait_ack) { int ret = _FAIL; @@ -7564,7 +7516,7 @@ static int _issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, i goto exit; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -7629,8 +7581,8 @@ exit: return ret; } -//when wait_ms >0 , this function shoule be called at process context -//da == NULL for station mode +/* when wait_ms >0 , this function shoule be called at process context */ +/* da == NULL for station mode */ int issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms) { int ret; @@ -7692,7 +7644,7 @@ static int _issue_deauth(_adapter *padapter, unsigned char *da, unsigned short r __le16 le_tmp; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ #ifdef CONFIG_P2P if ( !( rtw_p2p_chk_state( pwdinfo, P2P_STATE_NONE ) ) && ( pwdinfo->rx_invitereq_info.scan_op_ch_only ) ) @@ -7700,12 +7652,12 @@ static int _issue_deauth(_adapter *padapter, unsigned char *da, unsigned short r _cancel_timer_ex( &pwdinfo->reset_ch_sitesurvey ); _set_timer( &pwdinfo->reset_ch_sitesurvey, 10 ); } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) goto exit; - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); pattrib->retry_ctrl = false; @@ -7815,7 +7767,7 @@ void issue_action_spct_ch_switch (_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_o if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) return; - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -7891,7 +7843,7 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -7903,7 +7855,7 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; - //_rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + /* _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); */ _rtw_memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); @@ -7920,7 +7872,7 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act if (category == 3) { switch (action) { - case 0: //ADDBA req + case 0: /* ADDBA req */ do { pmlmeinfo->dialogToken++; } while (pmlmeinfo->dialogToken == 0); @@ -7931,34 +7883,32 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act ((pmlmeinfo->assoc_AP_vendor != broadcomAP) || (_rtw_memcmp(raddr, tendaAPMac, 3) == false))) { - // A-MSDU NOT Supported + /* A-MSDU NOT Supported */ BA_para_set = 0; - // immediate Block Ack + /* immediate Block Ack */ BA_para_set |= (1 << 1) & IEEE80211_ADDBA_PARAM_POLICY_MASK; - // TID + /* TID */ BA_para_set |= (status << 2) & IEEE80211_ADDBA_PARAM_TID_MASK; - // max buffer size is 8 MSDU + /* max buffer size is 8 MSDU */ BA_para_set |= (8 << 6) & RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK; } else #endif { #if defined(CONFIG_RTL8188E) && defined(CONFIG_SDIO_HCI) - BA_para_set = (0x0802 | ((status & 0xf) << 2)); //immediate ack & 16 buffer size + BA_para_set = (0x0802 | ((status & 0xf) << 2)); /* immediate ack & 16 buffer size */ #else - BA_para_set = (0x1002 | ((status & 0xf) << 2)); //immediate ack & 64 buffer size + BA_para_set = (0x1002 | ((status & 0xf) << 2)); /* immediate ack & 64 buffer size */ #endif } - //sys_mib.BA_para_set = 0x0802; //immediate ack & 32 buffer size le_tmp = cpu_to_le16(BA_para_set); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(le_tmp)), &(pattrib->pktlen)); - //BA_timeout_value = 0xffff;//max: 65535 TUs(~ 65 ms) - BA_timeout_value = 5000;//~ 5ms + BA_timeout_value = 5000;/* 5ms */ le_tmp = cpu_to_le16(BA_timeout_value); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(le_tmp)), &(pattrib->pktlen)); - //if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress)) != NULL) + /* if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress)) != NULL) */ if ((psta = rtw_get_stainfo(pstapriv, raddr)) != NULL) { start_seq = (psta->sta_xmitpriv.txseq_tid[status & 0x07]&0xfff) + 1; @@ -7971,48 +7921,47 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act le_tmp = cpu_to_le16(BA_starting_seqctrl); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(le_tmp)), &(pattrib->pktlen)); break; - case 1: //ADDBA rsp + case 1: /* ADDBA rsp */ pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->ADDBA_req.dialog_token), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&status), &(pattrib->pktlen)); rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); if (MAX_AMPDU_FACTOR_64K == max_rx_ampdu_factor) - BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); //64 buffer size + BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); /* 64 buffer size */ else if (MAX_AMPDU_FACTOR_32K == max_rx_ampdu_factor) - BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0800); //32 buffer size + BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0800); /* 32 buffer size */ else if (MAX_AMPDU_FACTOR_16K == max_rx_ampdu_factor) - BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0400); //16 buffer size + BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0400); /* 16 buffer size */ else if (MAX_AMPDU_FACTOR_8K == max_rx_ampdu_factor) - BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0200); //8 buffer size + BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0200); /* 8 buffer size */ else - BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); //64 buffer size + BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); /* 64 buffer size */ #ifdef CONFIG_BT_COEXIST if ((BT_1Ant(padapter) == true) && ((pmlmeinfo->assoc_AP_vendor != broadcomAP) || (_rtw_memcmp(raddr, tendaAPMac, 3) == false))) { - // max buffer size is 8 MSDU + /* max buffer size is 8 MSDU */ BA_para_set &= ~RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK; BA_para_set |= (8 << 6) & RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK; } #endif - if (pregpriv->ampdu_amsdu==0)//disabled - le_tmp = cpu_to_le16(BA_para_set & ~BIT(0)); - else if (pregpriv->ampdu_amsdu==1)//enabled - le_tmp = cpu_to_le16(BA_para_set | BIT(0)); - else //auto - le_tmp = cpu_to_le16(BA_para_set); + if (pregpriv->ampdu_amsdu==0)/* disabled */ + BA_para_set = BA_para_set & ~BIT(0); + else if (pregpriv->ampdu_amsdu==1)/* enabled */ + BA_para_set = BA_para_set | BIT(0); + le_tmp = cpu_to_le16(BA_para_set); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(le_tmp)), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(pmlmeinfo->ADDBA_req.BA_timeout_value)), &(pattrib->pktlen)); break; - case 2://DELBA + case 2:/* DELBA */ BA_para_set = (status & 0x1F) << 3; le_tmp = cpu_to_le16(BA_para_set); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(le_tmp)), &(pattrib->pktlen)); - reason_code = 37;//Requested from peer STA as it does not want to use the mechanism + reason_code = 37;/* Requested from peer STA as it does not want to use the mechanism */ le_tmp = cpu_to_le16(reason_code); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(le_tmp)), &(pattrib->pktlen)); break; @@ -8024,7 +7973,7 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ } static void issue_action_BSSCoexistPacket(_adapter *padapter) @@ -8064,7 +8013,7 @@ static void issue_action_BSSCoexistPacket(_adapter *padapter) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -8091,19 +8040,19 @@ static void issue_action_BSSCoexistPacket(_adapter *padapter) pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - // + /* */ if (pmlmepriv->num_FortyMHzIntolerant>0) { u8 iedata=0; - iedata |= BIT(2);//20 MHz BSS Width Request + iedata |= BIT(2);/* 20 MHz BSS Width Request */ pframe = rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); } - // + /* */ _rtw_memset(ICS, 0, sizeof(ICS)); if (pmlmepriv->num_sta_no_ht>0) { @@ -8130,7 +8079,7 @@ static void issue_action_BSSCoexistPacket(_adapter *padapter) pbss_network = (WLAN_BSSID_EX *)&pnetwork->network; p = rtw_get_ie(pbss_network->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pbss_network->IELength - _FIXED_IE_LENGTH_); - if ((p==NULL) || (len==0))//non-HT + if ((p==NULL) || (len==0))/* non-HT */ { if ((pbss_network->Configuration.DSConfig<=0) || (pbss_network->Configuration.DSConfig>14)) continue; @@ -8153,7 +8102,7 @@ static void issue_action_BSSCoexistPacket(_adapter *padapter) int j, k = 0; InfoContent[k] = i; - //SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent,i); + /* SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent,i); */ k++; for (j=1;j<=14;j++) @@ -8162,8 +8111,8 @@ static void issue_action_BSSCoexistPacket(_adapter *padapter) { if (k<16) { - InfoContent[k] = j; //channel number - //SET_BSS_INTOLERANT_ELE_CHANNEL(InfoContent+k, j); + InfoContent[k] = j; /* channel number */ + /* SET_BSS_INTOLERANT_ELE_CHANNEL(InfoContent+k, j); */ k++; } } @@ -8182,14 +8131,14 @@ static void issue_action_BSSCoexistPacket(_adapter *padapter) pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ } unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr) { struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *psta = NULL; - //struct recv_reorder_ctrl *preorder_ctrl; + /* struct recv_reorder_ctrl *preorder_ctrl; */ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u16 tid; @@ -8202,9 +8151,9 @@ unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr) if (psta==NULL) return _SUCCESS; - //DBG_88E("%s:%s\n", __func__, (initiator==0)?"RX_DIR":"TX_DIR"); + /* DBG_88E("%s:%s\n", __func__, (initiator==0)?"RX_DIR":"TX_DIR"); */ - if (initiator==0) // recipient + if (initiator==0) /* recipient */ { for (tid = 0;tidhtpriv.agg_enable_bitmap); + /* DBG_88E("tx agg_enable_bitmap(0x%08x)\n", psta->htpriv.agg_enable_bitmap); */ for (tid = 0;tidhtpriv.agg_enable_bitmap & BIT(tid)) @@ -8236,7 +8185,7 @@ unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr) } } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ } return _SUCCESS; @@ -8248,16 +8197,16 @@ unsigned int send_beacon(_adapter *padapter) u8 bxmitok = false; int issue=0; int poll = 0; -//#ifdef CONFIG_CONCURRENT_MODE - //struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - //struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - //_adapter *pbuddy_adapter = padapter->pbuddy_adapter; - //struct mlme_priv *pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv); -//#endif +/* ifdef CONFIG_CONCURRENT_MODE */ + /* struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); */ + /* struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); */ + /* _adapter *pbuddy_adapter = padapter->pbuddy_adapter; */ + /* struct mlme_priv *pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv); */ +/* endif */ #ifdef CONFIG_PCI_HCI - //DBG_88E("%s\n", __func__); + /* DBG_88E("%s\n", __func__); */ issue_beacon(padapter, 0); @@ -8295,8 +8244,8 @@ unsigned int send_beacon(_adapter *padapter) if (passing_time > 100 || issue > 3) DBG_88E("%s success, issue:%d, poll:%d, %u ms\n", __func__, issue, poll, rtw_get_passing_time_ms(start)); - //else - // DBG_88E("%s success, issue:%d, poll:%d, %u ms\n", __func__, issue, poll, rtw_get_passing_time_ms(start)); + /* else */ + /* DBG_88E("%s success, issue:%d, poll:%d, %u ms\n", __func__, issue, poll, rtw_get_passing_time_ms(start)); */ return _SUCCESS; } @@ -8338,13 +8287,13 @@ void site_survey(_adapter *padapter) #ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE u8 stay_buddy_ch = 0; -#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE +#endif /* CONFIG_STA_MODE_SCAN_UNDER_AP_MODE */ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); PADAPTER pbuddy_adapter = padapter->pbuddy_adapter; struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ struct wifidirect_info *pwdinfo= &(padapter->wdinfo); static unsigned char prev_survey_channel = 0; static unsigned int p2p_scan_count = 0; @@ -8363,8 +8312,8 @@ void site_survey(_adapter *padapter) } else if (rtw_p2p_findphase_ex_is_social(pwdinfo)) { - // Commented by Albert 2011/06/03 - // The driver is in the find phase, it should go through the social channel. + /* Commented by Albert 2011/06/03 */ + /* The driver is in the find phase, it should go through the social channel. */ int ch_set_idx; survey_channel = pwdinfo->social_chan[pmlmeext->sitesurvey_res.channel_idx]; ch_set_idx = rtw_ch_set_search_ch(pmlmeext->channel_set, survey_channel); @@ -8374,7 +8323,7 @@ void site_survey(_adapter *padapter) ScanType = SCAN_ACTIVE; } else -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ { struct rtw_ieee80211_channel *ch; if (pmlmeext->sitesurvey_res.channel_idx < pmlmeext->sitesurvey_res.ch_num) { @@ -8396,10 +8345,10 @@ void site_survey(_adapter *padapter) if (survey_channel != 0) { - //PAUSE 4-AC Queue when site_survey - //rtw_hal_get_hwreg(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); - //val8 |= 0x0f; - //rtw_hal_set_hwreg(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); + /* PAUSE 4-AC Queue when site_survey */ + /* rtw_hal_get_hwreg(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); */ + /* val8 |= 0x0f; */ + /* rtw_hal_set_hwreg(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); */ #ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE if ((padapter->pbuddy_adapter->mlmeextpriv.mlmext_info.state&0x03) == WIFI_FW_AP_STATE) @@ -8418,8 +8367,8 @@ void site_survey(_adapter *padapter) pmlmeinfo->scan_cnt++; } } -#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_STA_MODE_SCAN_UNDER_AP_MODE */ +#endif /* CONFIG_CONCURRENT_MODE */ if (pmlmeext->sitesurvey_res.channel_idx == 0) { set_channel_bwmode(padapter, survey_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); @@ -8432,7 +8381,7 @@ void site_survey(_adapter *padapter) #ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE if ( stay_buddy_ch == 1 ) { - val8 = 0; //survey done + val8 = 0; /* survey done */ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); if (check_buddy_mlmeinfo_state(padapter, WIFI_FW_AP_STATE) && @@ -8443,12 +8392,12 @@ void site_survey(_adapter *padapter) } else if ( stay_buddy_ch == 2 ) { - val8 = 1; //under site survey + val8 = 1; /* under site survey */ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); } -#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE +#endif /* CONFIG_STA_MODE_SCAN_UNDER_AP_MODE */ - if (ScanType == SCAN_ACTIVE) //obey the channel plan setting... + if (ScanType == SCAN_ACTIVE) /* obey the channel plan setting... */ { #ifdef CONFIG_P2P if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || @@ -8460,22 +8409,22 @@ void site_survey(_adapter *padapter) issue_probereq_p2p(padapter, NULL); } else - #endif //CONFIG_P2P + #endif /* CONFIG_P2P */ { int i; for (i=0;isitesurvey_res.ssid[i].SsidLength) { - //todo: to issue two probe req??? + /* todo: to issue two probe req??? */ issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL); - //rtw_msleep_os(SURVEY_TO>>1); + /* rtw_msleep_os(SURVEY_TO>>1); */ issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL); } } if (pmlmeext->sitesurvey_res.scan_mode == SCAN_ACTIVE) { - //todo: to issue two probe req??? + /* todo: to issue two probe req??? */ issue_probereq(padapter, NULL, NULL); - //rtw_msleep_os(SURVEY_TO>>1); + /* rtw_msleep_os(SURVEY_TO>>1); */ issue_probereq(padapter, NULL, NULL); } } @@ -8485,14 +8434,14 @@ void site_survey(_adapter *padapter) if ( stay_buddy_ch == 1 ) set_survey_timer(pmlmeext, pmlmeext->chan_scan_time * RTW_STAY_AP_CH_MILLISECOND ); else -#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE +#endif /* CONFIG_STA_MODE_SCAN_UNDER_AP_MODE */ set_survey_timer(pmlmeext, pmlmeext->chan_scan_time); } else { - // channel number is 0 or this channel is not valid. + /* channel number is 0 or this channel is not valid. */ #ifdef CONFIG_CONCURRENT_MODE u8 cur_channel; @@ -8505,8 +8454,8 @@ void site_survey(_adapter *padapter) cur_bwmode = pmlmeext->cur_bwmode; cur_ch_offset = pmlmeext->cur_ch_offset; } - //else if ((pbuddy_mlmeinfo->state&0x03) == WIFI_FW_AP_STATE) - else if (check_buddy_fwstate(padapter, _FW_LINKED)) // for AP or STA + /* else if ((pbuddy_mlmeinfo->state&0x03) == WIFI_FW_AP_STATE) */ + else if (check_buddy_fwstate(padapter, _FW_LINKED)) /* for AP or STA */ { cur_channel = pbuddy_mlmeext->cur_channel; cur_bwmode = pbuddy_mlmeext->cur_bwmode; @@ -8526,8 +8475,8 @@ void site_survey(_adapter *padapter) { if ( ( pwdinfo->rx_invitereq_info.scan_op_ch_only ) || ( pwdinfo->p2p_info.scan_op_ch_only ) ) { - // Set the find_phase_state_exchange_cnt to P2P_FINDPHASE_EX_CNT. - // This will let the following flow to run the scanning end. + /* Set the find_phase_state_exchange_cnt to P2P_FINDPHASE_EX_CNT. */ + /* This will let the following flow to run the scanning end. */ rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_MAX); } #ifdef CONFIG_DBG_P2P @@ -8537,31 +8486,31 @@ void site_survey(_adapter *padapter) if (rtw_p2p_findphase_ex_is_needed(pwdinfo)) { - // Set the P2P State to the listen state of find phase and set the current channel to the listen channel + /* Set the P2P State to the listen state of find phase and set the current channel to the listen channel */ set_channel_bwmode(padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_LISTEN); pmlmeext->sitesurvey_res.state = SCAN_DISABLE; - initialgain = 0xff; //restore RX GAIN + initialgain = 0xff; /* restore RX GAIN */ rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); - //turn on dynamic functions + /* turn on dynamic functions */ Restore_DM_Func_Flag(padapter); - //Switch_DM_Func(padapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, true); + /* Switch_DM_Func(padapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, true); */ _set_timer( &pwdinfo->find_phase_timer, ( u32 ) ( ( u32 ) ( pwdinfo->listen_dwell ) * 100 ) ); } else -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ { #ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE pmlmeinfo->scan_cnt = 0; -#endif //CONFIG_DMP_STA_NODE_SCAN_UNDER_AP_MODE +#endif /* CONFIG_DMP_STA_NODE_SCAN_UNDER_AP_MODE */ #ifdef CONFIG_ANTENNA_DIVERSITY - // 20100721:Interrupt scan operation here. - // For SW antenna diversity before link, it needs to switch to another antenna and scan again. - // It compares the scan result and select beter one to do connection. + /* 20100721:Interrupt scan operation here. */ + /* For SW antenna diversity before link, it needs to switch to another antenna and scan again. */ + /* It compares the scan result and select beter one to do connection. */ if (rtw_hal_antdiv_before_linked(padapter)) { pmlmeext->sitesurvey_res.bss_cnt = 0; @@ -8581,19 +8530,19 @@ void site_survey(_adapter *padapter) { _set_timer( &pwdinfo->ap_p2p_switch_timer, 500 ); } - #endif //CONFIG_IOCTL_CFG80211 + #endif /* CONFIG_IOCTL_CFG80211 */ rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo)); #else rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo)); #endif } rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ pmlmeext->sitesurvey_res.state = SCAN_COMPLETE; - //switch back to the original channel - //SelectChannel(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset); + /* switch back to the original channel */ + /* SelectChannel(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset); */ { #ifdef CONFIG_DUALMAC_CONCURRENT @@ -8605,27 +8554,27 @@ void site_survey(_adapter *padapter) set_channel_bwmode(padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ #ifdef CONFIG_CONCURRENT_MODE set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode); #else set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); -#endif //CONFIG_DUALMAC_CONCURRENT -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_DUALMAC_CONCURRENT */ +#endif /* CONFIG_CONCURRENT_MODE */ } - //flush 4-AC Queue after site_survey - //val8 = 0; - //rtw_hal_set_hwreg(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); + /* flush 4-AC Queue after site_survey */ + /* val8 = 0; */ + /* rtw_hal_set_hwreg(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); */ - //config MSR + /* config MSR */ Set_MSR(padapter, (pmlmeinfo->state & 0x3)); - initialgain = 0xff; //restore RX GAIN + initialgain = 0xff; /* restore RX GAIN */ rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); - //turn on dynamic functions + /* turn on dynamic functions */ Restore_DM_Func_Flag(padapter); - //Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); + /* Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); */ if (is_client_associated_to_ap(padapter) == true) { @@ -8647,7 +8596,7 @@ void site_survey(_adapter *padapter) } #endif - val8 = 0; //survey done + val8 = 0; /* survey done */ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); report_surveydone_event(padapter); @@ -8680,7 +8629,7 @@ void site_survey(_adapter *padapter) } -//collect bss info from Beacon and Probe request/response frames. +/* collect bss info from Beacon and Probe request/response frames. */ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSID_EX *bssid) { int i; @@ -8708,7 +8657,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI bssid->Reserved[0] = 1; ie_offset = _BEACON_IE_OFFSET_; } else { - // FIXME : more type + /* FIXME : more type */ if (subtype == WIFI_PROBEREQ) { ie_offset = _PROBEREQ_IE_OFFSET_; bssid->Reserved[0] = 2; @@ -8723,21 +8672,20 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI bssid->Length = sizeof(WLAN_BSSID_EX) - MAX_IE_SZ + len; - //below is to copy the information element + /* below is to copy the information element */ bssid->IELength = len; _rtw_memcpy(bssid->IEs, (pframe + sizeof(struct rtw_ieee80211_hdr_3addr)), bssid->IELength); - //get the signal strength - //bssid->Rssi = precv_frame->u.hdr.attrib.SignalStrength; // 0-100 index. - bssid->Rssi = precv_frame->u.hdr.attrib.phy_info.RecvSignalPower; // in dBM.raw data - bssid->PhyInfo.SignalQuality = precv_frame->u.hdr.attrib.phy_info.SignalQuality;//in percentage - bssid->PhyInfo.SignalStrength = precv_frame->u.hdr.attrib.phy_info.SignalStrength;//in percentage + /* get the signal strength */ + bssid->Rssi = precv_frame->u.hdr.attrib.phy_info.RecvSignalPower; /* in dBM.raw data */ + bssid->PhyInfo.SignalQuality = precv_frame->u.hdr.attrib.phy_info.SignalQuality;/* in percentage */ + bssid->PhyInfo.SignalStrength = precv_frame->u.hdr.attrib.phy_info.SignalStrength;/* in percentage */ #ifdef CONFIG_ANTENNA_DIVERSITY - //rtw_hal_get_hwreg(padapter, HW_VAR_CURRENT_ANTENNA, (u8 *)(&bssid->PhyInfo.Optimum_antenna)); + /* rtw_hal_get_hwreg(padapter, HW_VAR_CURRENT_ANTENNA, (u8 *)(&bssid->PhyInfo.Optimum_antenna)); */ rtw_hal_get_def_var(padapter, HAL_DEF_CURRENT_ANTENNA, &bssid->PhyInfo.Optimum_antenna); #endif - // checking SSID + /* checking SSID */ if ((p = rtw_get_ie(bssid->IEs + ie_offset, _SSID_IE_, &len, bssid->IELength - ie_offset)) == NULL) { DBG_88E("marc: cannot find SSID for survey event\n"); @@ -8761,7 +8709,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI _rtw_memset(bssid->SupportedRates, 0, NDIS_802_11_LENGTH_RATES_EX); - //checking rate info... + /* checking rate info... */ i = 0; p = rtw_get_ie(bssid->IEs + ie_offset, _SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset); if (p != NULL) @@ -8786,13 +8734,13 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI _rtw_memcpy(bssid->SupportedRates + i, (p + 2), len); } - //todo: + /* todo: */ bssid->NetworkTypeInUse = Ndis802_11OFDM24; if (bssid->IELength < 12) return _FAIL; - // Checking for DSConfig + /* Checking for DSConfig */ p = rtw_get_ie(bssid->IEs + ie_offset, _DSSET_IE_, &len, bssid->IELength - ie_offset); bssid->Configuration.DSConfig = 0; @@ -8803,8 +8751,8 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI bssid->Configuration.DSConfig = *(p + 2); } else - {// In 5G, some ap do not have DSSET IE - // checking HT info for channel + {/* In 5G, some ap do not have DSSET IE */ + /* checking HT info for channel */ p = rtw_get_ie(bssid->IEs + ie_offset, _HT_ADD_INFO_IE_, &len, bssid->IELength - ie_offset); if (p) { @@ -8812,14 +8760,14 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI bssid->Configuration.DSConfig = HT_info->primary_channel; } else - { // use current channel + { /* use current channel */ bssid->Configuration.DSConfig = rtw_get_oper_ch(padapter); } } if (subtype==WIFI_PROBEREQ) { - // FIXME + /* FIXME */ bssid->InfrastructureMode = Ndis802_11Infrastructure; _rtw_memcpy(bssid->MacAddress, GetAddr2Ptr(pframe), ETH_ALEN); bssid->Privacy = 1; @@ -8846,7 +8794,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI bssid->Configuration.ATIMWindow = 0; - //20/40 BSS Coexistence check + /* 20/40 BSS Coexistence check */ if ((pregistrypriv->wifi_spec==1) && (false == pmlmeinfo->bwmode_updated)) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -8861,17 +8809,17 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI } else { pmlmepriv->num_sta_no_ht++; } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ } #ifdef CONFIG_INTEL_WIDI - //process_intel_widi_query_or_tigger(padapter, bssid); + /* process_intel_widi_query_or_tigger(padapter, bssid); */ if (process_intel_widi_query_or_tigger(padapter, bssid)) { return _FAIL; } -#endif // CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ #if defined(DBG_RX_SIGNAL_DISPLAY_PROCESSING) & 1 if (strcmp(bssid->Ssid.Ssid, DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) == 0) { @@ -8883,7 +8831,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI } #endif - // mark bss info receving from nearby channel as SignalQuality 101 + /* mark bss info receving from nearby channel as SignalQuality 101 */ if (bssid->Configuration.DSConfig != rtw_get_oper_ch(padapter)) { bssid->PhyInfo.SignalQuality= 101; @@ -8903,30 +8851,28 @@ void start_create_ibss(_adapter* padapter) pmlmeext->cur_channel = (u8)pnetwork->Configuration.DSConfig; pmlmeinfo->bcn_interval = get_beacon_interval(pnetwork); - //update wireless mode + /* update wireless mode */ update_wireless_mode(padapter); - //udpate capability + /* udpate capability */ caps = rtw_get_capability((WLAN_BSSID_EX *)pnetwork); update_capinfo(padapter, caps); - if (caps&cap_IBSS)//adhoc master + if (caps&cap_IBSS)/* adhoc master */ { - //set_opmode_cmd(padapter, adhoc);//removed - val8 = 0xcf; rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); - //switch channel - //SelectChannel(padapter, pmlmeext->cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE); + /* switch channel */ + /* SelectChannel(padapter, pmlmeext->cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE); */ set_channel_bwmode(padapter, pmlmeext->cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); beacon_timing_control(padapter); - //set msr to WIFI_FW_ADHOC_STATE + /* set msr to WIFI_FW_ADHOC_STATE */ pmlmeinfo->state = WIFI_FW_ADHOC_STATE; Set_MSR(padapter, (pmlmeinfo->state & 0x3)); - //issue beacon + /* issue beacon */ if (send_beacon(padapter)==_FAIL) { RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("issuing beacon frame fail....\n")); @@ -8967,10 +8913,10 @@ void start_clnt_join(_adapter* padapter) pmlmeext->cur_channel = (u8)pnetwork->Configuration.DSConfig; pmlmeinfo->bcn_interval = get_beacon_interval(pnetwork); - //update wireless mode + /* update wireless mode */ update_wireless_mode(padapter); - //udpate capability + /* udpate capability */ caps = rtw_get_capability((WLAN_BSSID_EX *)pnetwork); update_capinfo(padapter, caps); if (caps&cap_ESS) @@ -8995,17 +8941,17 @@ void start_clnt_join(_adapter* padapter) #ifdef CONFIG_WAPI_SUPPORT if (padapter->wapiInfo.bWapiEnable && pmlmeinfo->auth_algo == dot11AuthAlgrthm_WAPI) { - //Disable TxUseDefaultKey, RxUseDefaultKey, RxBroadcastUseDefaultKey. + /* Disable TxUseDefaultKey, RxUseDefaultKey, RxBroadcastUseDefaultKey. */ val8 = 0x4c; } #endif rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); - //switch channel + /* switch channel */ set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); - //here wait for receiving the beacon to start auth - //and enable a timer + /* here wait for receiving the beacon to start auth */ + /* and enable a timer */ beacon_timeout = decide_wait_for_beacon_timeout(pmlmeinfo->bcn_interval); set_link_timer(pmlmeext, beacon_timeout); _set_timer( &padapter->mlmepriv.assoc_timer, @@ -9013,7 +8959,7 @@ void start_clnt_join(_adapter* padapter) pmlmeinfo->state = WIFI_FW_AUTH_NULL | WIFI_FW_STATION_STATE; } - else if (caps&cap_IBSS) //adhoc client + else if (caps&cap_IBSS) /* adhoc client */ { #ifdef CONFIG_DUALMAC_CONCURRENT dc_join_status = dc_handle_join_request(padapter); @@ -9029,7 +8975,7 @@ void start_clnt_join(_adapter* padapter) val8 = 0xcf; rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); - //switch channel + /* switch channel */ set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); beacon_timing_control(padapter); @@ -9040,7 +8986,7 @@ void start_clnt_join(_adapter* padapter) } else { - //DBG_88E("marc: invalid cap:%x\n", caps); + /* DBG_88E("marc: invalid cap:%x\n", caps); */ return; } @@ -9063,12 +9009,12 @@ void start_clnt_auth(_adapter* padapter) pmlmeext->retry = 0; - // Because of AP's not receiving deauth before - // AP may: 1)not response auth or 2)deauth us after link is complete - // issue deauth before issuing auth to deal with the situation + /* Because of AP's not receiving deauth before */ + /* AP may: 1)not response auth or 2)deauth us after link is complete */ + /* issue deauth before issuing auth to deal with the situation */ #ifndef CONFIG_PLATFORM_RTK_DMP - // Commented by Albert 2012/07/21 - // For the Win8 P2P connection, it will be hard to have a successful connection if this Wi-Fi doesn't connect to it. + /* Commented by Albert 2012/07/21 */ + /* For the Win8 P2P connection, it will be hard to have a successful connection if this Wi-Fi doesn't connect to it. */ issue_deauth(padapter, (&(pmlmeinfo->network))->MacAddress, WLAN_REASON_DEAUTH_LEAVING); #endif @@ -9100,7 +9046,7 @@ unsigned int receive_disconnect(_adapter *padapter, unsigned char *MacAddr, unsi struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - //check A3 + /* check A3 */ if (!(_rtw_memcmp(MacAddr, get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) return _SUCCESS; @@ -9114,7 +9060,7 @@ unsigned int receive_disconnect(_adapter *padapter, unsigned char *MacAddr, unsi report_del_sta_event(padapter, MacAddr, reason); #ifdef CONFIG_INTEL_WIDI process_intel_widi_disconnect(padapter, 1); -#endif // CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ } else if (pmlmeinfo->state & WIFI_FW_LINKING_STATE) { @@ -9139,7 +9085,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) pregistrypriv = &padapter->registrypriv; pmlmeext = &padapter->mlmeextpriv; - // Adjust channel plan by AP Country IE + /* Adjust channel plan by AP Country IE */ if (pregistrypriv->enable80211d && (!pmlmeext->update_channel_plan_by_ap_done)) { @@ -9148,8 +9094,8 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) RT_CHANNEL_PLAN chplan_ap; RT_CHANNEL_INFO chplan_sta[MAX_CHANNEL_NUM]; u8 country[4]; - u8 fcn; // first channel number - u8 noc; // number of channel + u8 fcn; /* first channel number */ + u8 noc; /* number of channel */ u8 j, k; ie = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _COUNTRY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); @@ -9175,8 +9121,8 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) for (j = 0; j < noc; j++) { - if (fcn <= 14) channel = fcn + j; // 2.4 GHz - else channel = fcn + j*4; // 5 GHz + if (fcn <= 14) channel = fcn + j; /* 2.4 GHz */ + else channel = fcn + j*4; /* 5 GHz */ chplan_ap.Channel[i++] = channel; } @@ -9236,7 +9182,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) else if (chplan_sta[i].ChannelNum < chplan_ap.Channel[j]) { chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; -// chplan_new[k].ScanType = chplan_sta[i].ScanType; +/* chplan_new[k].ScanType = chplan_sta[i].ScanType; */ chplan_new[k].ScanType = SCAN_PASSIVE; i++; k++; @@ -9250,19 +9196,19 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) } } while (1); - // change AP not support channel to Passive scan + /* change AP not support channel to Passive scan */ while ((i < MAX_CHANNEL_NUM) && (chplan_sta[i].ChannelNum != 0) && (chplan_sta[i].ChannelNum <= 14)) { chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; -// chplan_new[k].ScanType = chplan_sta[i].ScanType; +/* chplan_new[k].ScanType = chplan_sta[i].ScanType; */ chplan_new[k].ScanType = SCAN_PASSIVE; i++; k++; } - // add channel AP supported + /* add channel AP supported */ while ((j < chplan_ap.Len) && (chplan_ap.Channel[j] <= 14)) { chplan_new[k].ChannelNum = chplan_ap.Channel[j]; @@ -9273,7 +9219,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) } else { - // keep original STA 2.4G channel plan + /* keep original STA 2.4G channel plan */ while ((i < MAX_CHANNEL_NUM) && (chplan_sta[i].ChannelNum != 0) && (chplan_sta[i].ChannelNum <= 14)) @@ -9284,7 +9230,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) k++; } - // skip AP 2.4G channel plan + /* skip AP 2.4G channel plan */ while ((j < chplan_ap.Len) && (chplan_ap.Channel[j] <= 14)) { j++; @@ -9312,7 +9258,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) else if (chplan_sta[i].ChannelNum < chplan_ap.Channel[j]) { chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; -// chplan_new[k].ScanType = chplan_sta[i].ScanType; +/* chplan_new[k].ScanType = chplan_sta[i].ScanType; */ chplan_new[k].ScanType = SCAN_PASSIVE; i++; k++; @@ -9326,17 +9272,17 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) } } while (1); - // change AP not support channel to Passive scan + /* change AP not support channel to Passive scan */ while ((i < MAX_CHANNEL_NUM) && (chplan_sta[i].ChannelNum != 0)) { chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; -// chplan_new[k].ScanType = chplan_sta[i].ScanType; +/* chplan_new[k].ScanType = chplan_sta[i].ScanType; */ chplan_new[k].ScanType = SCAN_PASSIVE; i++; k++; } - // add channel AP supported + /* add channel AP supported */ while ((j < chplan_ap.Len) && (chplan_ap.Channel[j] != 0)) { chplan_new[k].ChannelNum = chplan_ap.Channel[j]; @@ -9347,7 +9293,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) } else { - // keep original STA 5G channel plan + /* keep original STA 5G channel plan */ while ((i < MAX_CHANNEL_NUM) && (chplan_sta[i].ChannelNum != 0)) { chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; @@ -9374,7 +9320,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) } - // If channel is used by AP, set channel scan type to active + /* If channel is used by AP, set channel scan type to active */ channel = bssid->Configuration.DSConfig; chplan_new = pmlmeext->channel_set; i = 0; @@ -9384,7 +9330,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) { if (chplan_new[i].ScanType == SCAN_PASSIVE) { - //5G Bnad 2, 3 (DFS) doesn't change to active scan + /* 5G Bnad 2, 3 (DFS) doesn't change to active scan */ if (channel >= 52 && channel <= 144) break; @@ -9415,8 +9361,8 @@ void report_survey_event(_adapter *padapter, union recv_frame *precv_frame) struct C2HEvent_Header *pc2h_evt_hdr; struct mlme_ext_priv *pmlmeext; struct cmd_priv *pcmdpriv; - //u8 *pframe = precv_frame->u.hdr.rx_data; - //uint len = precv_frame->u.hdr.len; + /* u8 *pframe = precv_frame->u.hdr.rx_data; */ + /* uint len = precv_frame->u.hdr.len; */ if (!padapter) return; @@ -9684,18 +9630,18 @@ Following are the event callback functions *****************************************************************************/ -//for sta/adhoc mode +/* for sta/adhoc mode */ void update_sta_info(_adapter *padapter, struct sta_info *psta) { struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - //ERP + /* ERP */ VCS_update(padapter, psta); #ifdef CONFIG_80211N_HT - //HT + /* HT */ if (pmlmepriv->htpriv.ht_option) { psta->htpriv.ht_option = true; @@ -9709,7 +9655,7 @@ void update_sta_info(_adapter *padapter, struct sta_info *psta) } else -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ { #ifdef CONFIG_80211N_HT psta->htpriv.ht_option = false; @@ -9717,7 +9663,7 @@ void update_sta_info(_adapter *padapter, struct sta_info *psta) psta->htpriv.ampdu_enable = false; psta->htpriv.sgi = false; -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ psta->qos_option = false; } @@ -9725,11 +9671,11 @@ void update_sta_info(_adapter *padapter, struct sta_info *psta) psta->htpriv.bwmode = pmlmeext->cur_bwmode; psta->htpriv.ch_offset = pmlmeext->cur_ch_offset; - psta->htpriv.agg_enable_bitmap = 0x0;//reset - psta->htpriv.candidate_tid_bitmap = 0x0;//reset -#endif //CONFIG_80211N_HT + psta->htpriv.agg_enable_bitmap = 0x0;/* reset */ + psta->htpriv.candidate_tid_bitmap = 0x0;/* reset */ +#endif /* CONFIG_80211N_HT */ - //QoS + /* QoS */ if (pmlmepriv->qospriv.qos_option) psta->qos_option = true; @@ -9754,7 +9700,7 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, null_addr); - //restore to initial setting. + /* restore to initial setting. */ update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode); goto exit_mlmeext_joinbss_event_callback; @@ -9762,7 +9708,7 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) { - //for bc/mc + /* for bc/mc */ psta_bmc = rtw_get_bcmc_stainfo(padapter); if (psta_bmc) { @@ -9773,48 +9719,48 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) } - //turn on dynamic functions + /* turn on dynamic functions */ Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); - // update IOT-releated issue + /* update IOT-releated issue */ update_IOT_info(padapter); rtw_hal_set_hwreg(padapter, HW_VAR_BASIC_RATE, cur_network->SupportedRates); - //BCN interval + /* BCN interval */ rtw_hal_set_hwreg(padapter, HW_VAR_BEACON_INTERVAL, (u8 *)(&pmlmeinfo->bcn_interval)); - //udpate capability + /* udpate capability */ update_capinfo(padapter, pmlmeinfo->capability); - //WMM, Update EDCA param + /* WMM, Update EDCA param */ WMMOnAssocRsp(padapter); - //HT + /* HT */ HTOnAssocRsp(padapter); #ifndef CONFIG_CONCURRENT_MODE - // Call set_channel_bwmode when the CONFIG_CONCURRENT_MODE doesn't be defined. - //Set cur_channel&cur_bwmode&cur_ch_offset + /* Call set_channel_bwmode when the CONFIG_CONCURRENT_MODE doesn't be defined. */ + /* Set cur_channel&cur_bwmode&cur_ch_offset */ set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); #endif psta = rtw_get_stainfo(pstapriv, cur_network->MacAddress); - if (psta) //only for infra. mode + if (psta) /* only for infra. mode */ { pmlmeinfo->FW_sta_info[psta->mac_id].psta = psta; - //DBG_88E("set_sta_rate\n"); + /* DBG_88E("set_sta_rate\n"); */ psta->wireless_mode = pmlmeext->cur_wireless_mode; - //set per sta rate after updating HT cap. + /* set per sta rate after updating HT cap. */ set_sta_rate(padapter, psta); - #if (RATE_ADAPTIVE_SUPPORT==1) //for 88E RA + #if (RATE_ADAPTIVE_SUPPORT==1) /* for 88E RA */ rtw_hal_set_hwreg(padapter,HW_VAR_TX_RPT_MAX_MACID, (u8*)&psta->mac_id); #endif - media_status = (psta->mac_id<<8)|1; // MACID|OPMODE: 1 means connect + media_status = (psta->mac_id<<8)|1; /* MACID|OPMODE: 1 means connect */ rtw_hal_set_hwreg(padapter,HW_VAR_H2C_MEDIA_STATUS_RPT,(u8 *)&media_status); } @@ -9823,10 +9769,10 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) { - // correcting TSF + /* correcting TSF */ correct_TSF(padapter, pmlmeext); - //set_link_timer(pmlmeext, DISCONNECT_TO); + /* set_link_timer(pmlmeext, DISCONNECT_TO); */ } #ifdef CONFIG_LPS @@ -9856,19 +9802,19 @@ void mlmeext_sta_add_event_callback(_adapter *padapter, struct sta_info *psta) if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) { - if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)//adhoc master or sta_count>1 + if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)/* adhoc master or sta_count>1 */ { - //nothing to do + /* nothing to do */ } - else//adhoc client + else/* adhoc client */ { - //update TSF Value - //update_TSF(pmlmeext, pframe, len); + /* update TSF Value */ + /* update_TSF(pmlmeext, pframe, len); */ - // correcting TSF + /* correcting TSF */ correct_TSF(padapter, pmlmeext); - //start beacon + /* start beacon */ if (send_beacon(padapter)==_FAIL) { pmlmeinfo->FW_sta_info[psta->mac_id].status = 0; @@ -9888,10 +9834,10 @@ void mlmeext_sta_add_event_callback(_adapter *padapter, struct sta_info *psta) pmlmeinfo->FW_sta_info[psta->mac_id].psta = psta; - //rate radaptive + /* rate radaptive */ Update_RA_Entry(padapter, psta->mac_id); - //update adhoc sta_info + /* update adhoc sta_info */ update_sta_info(padapter, psta); } @@ -9903,12 +9849,12 @@ void mlmeext_sta_del_event_callback(_adapter *padapter) if (is_client_associated_to_ap(padapter) || is_IBSS_empty(padapter)) { - //set_opmode_cmd(padapter, infra_client_with_mlme); + /* set_opmode_cmd(padapter, infra_client_with_mlme); */ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, NULL); rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, null_addr); - //restore to initial setting. + /* restore to initial setting. */ update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode); #ifdef CONFIG_DUALMAC_CONCURRENT @@ -9917,25 +9863,25 @@ void mlmeext_sta_del_event_callback(_adapter *padapter) #ifdef CONFIG_CONCURRENT_MODE if ((check_buddy_fwstate(padapter, _FW_LINKED)) != true) { -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ - //switch to the 20M Hz mode after disconnect + /* switch to the 20M Hz mode after disconnect */ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; - //SelectChannel(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset); + /* SelectChannel(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset); */ set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); #ifdef CONFIG_CONCURRENT_MODE } -#endif //CONFIG_CONCURRENT_MODE -#endif //CONFIG_DUALMAC_CONCURRENT +#endif /* CONFIG_CONCURRENT_MODE */ +#endif /* CONFIG_DUALMAC_CONCURRENT */ flush_all_cam_entry(padapter); pmlmeinfo->state = WIFI_FW_NULL_STATE; - //set MSR to no link state -> infra. mode + /* set MSR to no link state -> infra. mode */ Set_MSR(padapter, _HW_STATE_STATION_); _cancel_timer_ex(&pmlmeext->link_timer); @@ -10034,7 +9980,7 @@ void linked_status_chk(_adapter *padapter) if (is_client_associated_to_ap(padapter)) { - //linked infrastructure client mode + /* linked infrastructure client mode */ int tx_chk = _SUCCESS, rx_chk = _SUCCESS; int rx_chk_limit; @@ -10132,12 +10078,12 @@ void linked_status_chk(_adapter *padapter) pmlmeinfo->link_count = 0; } - } //end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) + } /* end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) */ } else if (is_client_associated_to_ibss(padapter)) { - //linked IBSS mode - //for each assoc list entry to check the rx pkt counter + /* linked IBSS mode */ + /* for each assoc list entry to check the rx pkt counter */ for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) { if (pmlmeinfo->FW_sta_info[i].status == 1) @@ -10158,7 +10104,7 @@ void linked_status_chk(_adapter *padapter) pmlmeinfo->FW_sta_info[i].retry = 0; pmlmeinfo->FW_sta_info[i].status = 0; report_del_sta_event(padapter, psta->hwaddr - , 65535// indicate disconnect caused by no rx + , 65535/* indicate disconnect caused by no rx */ ); } } @@ -10170,7 +10116,7 @@ void linked_status_chk(_adapter *padapter) } } - //set_link_timer(pmlmeext, DISCONNECT_TO); + /* set_link_timer(pmlmeext, DISCONNECT_TO); */ } @@ -10186,18 +10132,18 @@ void survey_timer_hdl(_adapter *padapter) struct wifidirect_info *pwdinfo= &(padapter->wdinfo); #endif - //DBG_88E("marc: survey timer\n"); + /* DBG_88E("marc: survey timer\n"); */ #ifdef PLATFORM_FREEBSD rtw_mtx_lock(NULL); if (callout_pending(&padapter->mlmeextpriv.survey_timer.callout)) { /* callout was reset */ - //mtx_unlock(&sc->sc_mtx); + /* mtx_unlock(&sc->sc_mtx); */ rtw_mtx_unlock(NULL); return; } if (!callout_active(&padapter->mlmeextpriv.survey_timer.callout)) { /* callout was stopped */ - //mtx_unlock(&sc->sc_mtx); + /* mtx_unlock(&sc->sc_mtx); */ rtw_mtx_unlock(NULL); return; } @@ -10206,14 +10152,14 @@ void survey_timer_hdl(_adapter *padapter) #endif - //issue rtw_sitesurvey_cmd + /* issue rtw_sitesurvey_cmd */ if (pmlmeext->sitesurvey_res.state > SCAN_START) { if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { #ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE if ( padapter->mlmeextpriv.mlmext_info.scan_cnt != RTW_SCAN_NUM_OF_CH ) -#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE +#endif /* CONFIG_STA_MODE_SCAN_UNDER_AP_MODE */ pmlmeext->sitesurvey_res.channel_idx++; } @@ -10238,7 +10184,7 @@ void survey_timer_hdl(_adapter *padapter) ); } - pmlmeext->scan_abort = false;//reset + pmlmeext->scan_abort = false;/* reset */ } if ((ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) @@ -10267,24 +10213,24 @@ exit_survey_timer_hdl: void link_timer_hdl(_adapter *padapter) { - //static unsigned int rx_pkt = 0; - //static u64 tx_cnt = 0; - //struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); + /* static unsigned int rx_pkt = 0; */ + /* static u64 tx_cnt = 0; */ + /* struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); */ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - //struct sta_priv *pstapriv = &padapter->stapriv; + /* struct sta_priv *pstapriv = &padapter->stapriv; */ #ifdef PLATFORM_FREEBSD rtw_mtx_lock(NULL); if (callout_pending(&padapter->mlmeextpriv.survey_timer.callout)) { /* callout was reset */ - //mtx_unlock(&sc->sc_mtx); + /* mtx_unlock(&sc->sc_mtx); */ rtw_mtx_unlock(NULL); return; } if (!callout_active(&padapter->mlmeextpriv.survey_timer.callout)) { /* callout was stopped */ - //mtx_unlock(&sc->sc_mtx); + /* mtx_unlock(&sc->sc_mtx); */ rtw_mtx_unlock(NULL); return; } @@ -10301,20 +10247,20 @@ void link_timer_hdl(_adapter *padapter) } else if (pmlmeinfo->state & WIFI_FW_AUTH_STATE) { - //re-auth timer + /* re-auth timer */ if (++pmlmeinfo->reauth_count > REAUTH_LIMIT) { - //if (pmlmeinfo->auth_algo != dot11AuthAlgrthm_Auto) - //{ + /* if (pmlmeinfo->auth_algo != dot11AuthAlgrthm_Auto) */ + /* */ pmlmeinfo->state = 0; report_join_res(padapter, -1); return; - //} - //else - //{ - // pmlmeinfo->auth_algo = dot11AuthAlgrthm_Shared; - // pmlmeinfo->reauth_count = 0; - //} + /* */ + /* else */ + /* */ + /* pmlmeinfo->auth_algo = dot11AuthAlgrthm_Shared; */ + /* pmlmeinfo->reauth_count = 0; */ + /* */ } DBG_88E("link_timer_hdl: auth timeout and try again\n"); @@ -10324,7 +10270,7 @@ void link_timer_hdl(_adapter *padapter) } else if (pmlmeinfo->state & WIFI_FW_ASSOC_STATE) { - //re-assoc timer + /* re-assoc timer */ if (++pmlmeinfo->reassoc_count > REASSOC_LIMIT) { pmlmeinfo->state = WIFI_FW_NULL_STATE; @@ -10359,7 +10305,7 @@ void addba_timer_hdl(struct sta_info *psta) phtpriv->candidate_tid_bitmap=0x0; } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ } u8 NULL_hdl(_adapter *padapter, u8 *pbuf) @@ -10379,13 +10325,13 @@ u8 setopmode_hdl(_adapter *padapter, u8 *pbuf) pmlmeinfo->state = WIFI_FW_AP_STATE; type = _HW_STATE_AP_; #ifdef CONFIG_NATIVEAP_MLME - //start_ap_mode(padapter); + /* start_ap_mode(padapter); */ #endif } else if (psetop->mode == Ndis802_11Infrastructure) { - pmlmeinfo->state &= ~(BIT(0)|BIT(1));// clear state - pmlmeinfo->state |= WIFI_FW_STATION_STATE;//set to STATION_STATE + pmlmeinfo->state &= ~(BIT(0)|BIT(1));/* clear state */ + pmlmeinfo->state |= WIFI_FW_STATION_STATE;/* set to STATION_STATE */ type = _HW_STATE_STATION_; } else if (psetop->mode == Ndis802_11IBSS) @@ -10398,7 +10344,7 @@ u8 setopmode_hdl(_adapter *padapter, u8 *pbuf) } rtw_hal_set_hwreg(padapter, HW_VAR_SET_OPMODE, (u8 *)(&type)); - //Set_NETYPE0_MSR(padapter, type); + /* Set_NETYPE0_MSR(padapter, type); */ return H2C_SUCCESS; @@ -10410,7 +10356,7 @@ u8 createbss_hdl(_adapter *padapter, u8 *pbuf) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; - //u32 initialgain; + /* u32 initialgain; */ if (pparm->network.InfrastructureMode == Ndis802_11APMode) @@ -10419,13 +10365,13 @@ u8 createbss_hdl(_adapter *padapter, u8 *pbuf) if (pmlmeinfo->state == WIFI_FW_AP_STATE) { - //todo: + /* todo: */ return H2C_SUCCESS; } #endif } - //below is for ad-hoc master + /* below is for ad-hoc master */ if (pparm->network.InfrastructureMode == Ndis802_11IBSS) { rtw_joinbss_reset(padapter); @@ -10440,24 +10386,24 @@ u8 createbss_hdl(_adapter *padapter, u8 *pbuf) pmlmeinfo->agg_enable_bitmap = 0; pmlmeinfo->candidate_tid_bitmap = 0; - //disable dynamic functions, such as high power, DIG + /* disable dynamic functions, such as high power, DIG */ Save_DM_Func_Flag(padapter); Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false); - //config the initial gain under linking, need to write the BB registers - //initialgain = 0x1E; - //rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); + /* config the initial gain under linking, need to write the BB registers */ + /* initialgain = 0x1E; */ + /* rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); */ - //cancel link timer + /* cancel link timer */ _cancel_timer_ex(&pmlmeext->link_timer); - //clear CAM + /* clear CAM */ flush_all_cam_entry(padapter); _rtw_memcpy(pnetwork, pbuf, FIELD_OFFSET(WLAN_BSSID_EX, IELength)); pnetwork->IELength = ((WLAN_BSSID_EX *)pbuf)->IELength; - if (pnetwork->IELength>MAX_IE_SZ)//Check pbuf->IELength + if (pnetwork->IELength>MAX_IE_SZ)/* Check pbuf->IELength */ return H2C_PARAMETERS_ERROR; _rtw_memcpy(pnetwork->IEs, ((WLAN_BSSID_EX *)pbuf)->IEs, pnetwork->IELength); @@ -10480,12 +10426,12 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); #ifdef CONFIG_ANTENNA_DIVERSITY struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; -#endif //CONFIG_ANTENNA_DIVERSITY +#endif /* CONFIG_ANTENNA_DIVERSITY */ u32 i; - //u32 initialgain; - //u32 acparm; + /* u32 initialgain; */ + /* u32 acparm; */ - //check already connecting to AP or not + /* check already connecting to AP or not */ if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) { if (pmlmeinfo->state & WIFI_FW_STATION_STATE) @@ -10495,13 +10441,13 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) pmlmeinfo->state = WIFI_FW_NULL_STATE; - //clear CAM + /* clear CAM */ flush_all_cam_entry(padapter); _cancel_timer_ex(&pmlmeext->link_timer); - //set MSR to nolink -> infra. mode - //Set_MSR(padapter, _HW_STATE_NOLINK_); + /* set MSR to nolink -> infra. mode */ + /* Set_MSR(padapter, _HW_STATE_NOLINK_); */ Set_MSR(padapter, _HW_STATE_STATION_); @@ -10528,18 +10474,18 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) pmlmeinfo->agg_enable_bitmap = 0; pmlmeinfo->candidate_tid_bitmap = 0; pmlmeinfo->bwmode_updated = false; - //pmlmeinfo->assoc_AP_vendor = HT_IOT_PEER_MAX; + /* pmlmeinfo->assoc_AP_vendor = HT_IOT_PEER_MAX; */ _rtw_memcpy(pnetwork, pbuf, FIELD_OFFSET(WLAN_BSSID_EX, IELength)); pnetwork->IELength = ((WLAN_BSSID_EX *)pbuf)->IELength; - if (pnetwork->IELength>MAX_IE_SZ)//Check pbuf->IELength + if (pnetwork->IELength>MAX_IE_SZ)/* Check pbuf->IELength */ return H2C_PARAMETERS_ERROR; _rtw_memcpy(pnetwork->IEs, ((WLAN_BSSID_EX *)pbuf)->IEs, pnetwork->IELength); - //Check AP vendor to move rtw_joinbss_cmd() - //pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pnetwork->IEs, pnetwork->IELength); + /* Check AP vendor to move rtw_joinbss_cmd() */ + /* pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pnetwork->IEs, pnetwork->IELength); */ for (i = sizeof(NDIS_802_11_FIXED_IEs); i < pnetwork->IELength;) { @@ -10547,28 +10493,28 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_://Get WMM IE. + case _VENDOR_SPECIFIC_IE_:/* Get WMM IE. */ if ( _rtw_memcmp(pIE->data, WMM_OUI, 4) ) { pmlmeinfo->WMM_enable = 1; } break; - case _HT_CAPABILITY_IE_: //Get HT Cap IE. + case _HT_CAPABILITY_IE_: /* Get HT Cap IE. */ pmlmeinfo->HT_caps_enable = 1; break; - case _HT_EXTRA_INFO_IE_: //Get HT Info IE. + case _HT_EXTRA_INFO_IE_: /* Get HT Info IE. */ #ifdef CONFIG_80211N_HT pmlmeinfo->HT_info_enable = 1; - //spec case only for cisco's ap because cisco's ap issue assoc rsp using mcs rate @40MHz or @20MHz + /* spec case only for cisco's ap because cisco's ap issue assoc rsp using mcs rate @40MHz or @20MHz */ { struct HT_info_element *pht_info = (struct HT_info_element *)(pIE->data); if ((pregpriv->cbw40_enable) && (pht_info->infos[0] & BIT(2))) { - //switch to the 40M Hz mode according to the AP + /* switch to the 40M Hz mode according to the AP */ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; switch (pht_info->infos[0] & 0x3) { @@ -10588,7 +10534,7 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) DBG_88E("set ch/bw before connected\n"); } } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ break; default: @@ -10597,15 +10543,15 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) i += (pIE->Length + 2); } - //disable dynamic functions, such as high power, DIG + /* disable dynamic functions, such as high power, DIG */ - //config the initial gain under linking, need to write the BB registers + /* config the initial gain under linking, need to write the BB registers */ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress); join_type = 0; rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); - //cancel link timer + /* cancel link timer */ _cancel_timer_ex(&pmlmeext->link_timer); start_clnt_join(padapter); @@ -10630,18 +10576,18 @@ u8 disconnect_hdl(_adapter *padapter, unsigned char *pbuf) rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, NULL); rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, null_addr); - //restore to initial setting. + /* restore to initial setting. */ update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode); if (((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) { - //Stop BCN + /* Stop BCN */ val8 = 0; rtw_hal_set_hwreg(padapter, HW_VAR_BCN_FUNC, (u8 *)(&val8)); } - //set MSR to no link state -> infra. mode + /* set MSR to no link state -> infra. mode */ Set_MSR(padapter, _HW_STATE_STATION_); pmlmeinfo->state = WIFI_FW_NULL_STATE; @@ -10652,16 +10598,16 @@ u8 disconnect_hdl(_adapter *padapter, unsigned char *pbuf) #ifdef CONFIG_CONCURRENT_MODE if ((check_buddy_fwstate(padapter, _FW_LINKED)) != true) { -#endif //CONFIG_CONCURRENT_MODE - //switch to the 20M Hz mode after disconnect +#endif /* CONFIG_CONCURRENT_MODE */ + /* switch to the 20M Hz mode after disconnect */ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); #ifdef CONFIG_CONCURRENT_MODE } -#endif //CONFIG_CONCURRENT_MODE -#endif //CONFIG_DUALMAC_CONCURRENT +#endif /* CONFIG_CONCURRENT_MODE */ +#endif /* CONFIG_DUALMAC_CONCURRENT */ flush_all_cam_entry(padapter); @@ -10732,7 +10678,7 @@ u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf) if (pmlmeext->sitesurvey_res.state == SCAN_DISABLE) { - //for first time sitesurvey_cmd + /* for first time sitesurvey_cmd */ rtw_hal_set_hwreg(padapter, HW_VAR_CHECK_TXBUF, NULL); pmlmeext->sitesurvey_res.state = SCAN_START; @@ -10759,7 +10705,7 @@ u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf) bdelayscan = dc_handle_site_survey(padapter); #endif - //issue null data if associating to the AP + /* issue null data if associating to the AP */ if (is_client_associated_to_ap(padapter) == true) { pmlmeext->sitesurvey_res.state = SCAN_TXNULL; @@ -10784,7 +10730,7 @@ u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf) { issue_tunneled_probe_req(padapter->pbuddy_adapter); } - #endif //CONFIG_TDLS + #endif /* CONFIG_TDLS */ pmlmeext->sitesurvey_res.state = SCAN_TXNULL; @@ -10795,7 +10741,7 @@ u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf) #endif if (bdelayscan) { - //delay 50ms to protect nulldata(1). + /* delay 50ms to protect nulldata(1). */ set_survey_timer(pmlmeext, 50); return H2C_SUCCESS; } @@ -10806,11 +10752,11 @@ u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf) #ifdef CONFIG_FIND_BEST_CHANNEL #endif /* CONFIG_FIND_BEST_CHANNEL */ - //disable dynamic functions, such as high power, DIG + /* disable dynamic functions, such as high power, DIG */ Save_DM_Func_Flag(padapter); Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false); - //config the initial gain under scaning, need to write the BB registers + /* config the initial gain under scaning, need to write the BB registers */ #ifdef CONFIG_IOCTL_CFG80211 if ((wdev_to_priv(padapter->rtw_wdev))->p2p_enabled == true) { @@ -10818,23 +10764,23 @@ u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf) } else initialgain = 0x1E; -#else // go through the WEXT interface //CONFIG_IOCTL_CFG80211 +#else /* go through the WEXT interface CONFIG_IOCTL_CFG80211 */ #ifdef CONFIG_P2P if ( rtw_p2p_chk_state( pwdinfo, P2P_STATE_NONE ) ) initialgain = 0x1E; else initialgain = 0x28; -#else // CONFIG_P2P +#else /* CONFIG_P2P */ initialgain = 0x1E; -#endif // CONFIG_P2P -#endif // CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_P2P */ +#endif /* CONFIG_IOCTL_CFG80211 */ rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); - //set MSR to no link state + /* set MSR to no link state */ Set_MSR(padapter, _HW_STATE_NOLINK_); - val8 = 1; //under site survey + val8 = 1; /* under site survey */ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); pmlmeext->sitesurvey_res.state = SCAN_PROCESS; @@ -10868,11 +10814,11 @@ u8 setkey_hdl(_adapter *padapter, u8 *pbuf) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - //main tx key for wep. + /* main tx key for wep. */ if (pparm->set_tx) pmlmeinfo->key_index = pparm->keyid; - //write cam + /* write cam */ ctrl = BIT(15) | ((pparm->algorithm) << 2) | pparm->keyid; DBG_88E_LEVEL(_drv_info_, "set group key to hw: alg:%d(WEP40-1 WEP104-5 TKIP-2 AES-4) " @@ -10885,7 +10831,7 @@ u8 setkey_hdl(_adapter *padapter, u8 *pbuf) u8 set_stakey_hdl(_adapter *padapter, u8 *pbuf) { u16 ctrl=0; - u8 cam_id;//cam_entry + u8 cam_id;/* cam_entry */ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct set_stakey_parm *pparm = (struct set_stakey_parm *)pbuf; @@ -10893,20 +10839,20 @@ u8 set_stakey_hdl(_adapter *padapter, u8 *pbuf) struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *psta; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ - //cam_entry: - //0~3 for default key + /* cam_entry: */ + /* 0~3 for default key */ - //for concurrent mode (ap+sta): - //default key is disable, using sw encrypt/decrypt - //cam_entry = 4 //for sta mode (macid=0) - //cam_entry(macid+3) = 5 ~ N//for ap mode (aid=1~N, macid=2 ~N) + /* for concurrent mode (ap+sta): */ + /* default key is disable, using sw encrypt/decrypt */ + /* cam_entry = 4 for sta mode (macid=0) */ + /* cam_entry(macid+3) = 5 ~ N for ap mode (aid=1~N, macid=2 ~N) */ - //for concurrent mode (sta+sta): - //default key is disable, using sw encrypt/decrypt - //cam_entry = 4 //mapping to macid=0 - //cam_entry = 5 //mapping to macid=2 + /* for concurrent mode (sta+sta): */ + /* default key is disable, using sw encrypt/decrypt */ + /* cam_entry = 4 mapping to macid=0 */ + /* cam_entry = 5 mapping to macid=2 */ #ifdef CONFIG_CONCURRENT_MODE if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) @@ -10947,7 +10893,7 @@ u8 set_stakey_hdl(_adapter *padapter, u8 *pbuf) struct sta_info *psta; struct sta_priv *pstapriv = &padapter->stapriv; - if (pparm->algorithm == _NO_PRIVACY_) // clear cam entry + if (pparm->algorithm == _NO_PRIVACY_) /* clear cam entry */ { clear_cam_entry(padapter, pparm->id); return H2C_SUCCESS_RSP; @@ -10966,7 +10912,7 @@ u8 set_stakey_hdl(_adapter *padapter, u8 *pbuf) return H2C_REJECTED; } - cam_id = (psta->mac_id + 3);//0~3 for default key, cmd_id=macid + 3, macid=aid+1; + cam_id = (psta->mac_id + 3);/* 0~3 for default key, cmd_id=macid + 3, macid=aid+1; */ DBG_88E("Write CAM, mac_addr=%x:%x:%x:%x:%x:%x, cam_entry=%d\n", pparm->addr[0], pparm->addr[1], pparm->addr[2], pparm->addr[3], pparm->addr[4], @@ -10985,9 +10931,9 @@ u8 set_stakey_hdl(_adapter *padapter, u8 *pbuf) } - //below for sta mode + /* below for sta mode */ - if (pparm->algorithm == _NO_PRIVACY_) // clear cam entry + if (pparm->algorithm == _NO_PRIVACY_) /* clear cam entry */ { clear_cam_entry(padapter, pparm->id); return H2C_SUCCESS; @@ -11003,12 +10949,12 @@ u8 set_stakey_hdl(_adapter *padapter, u8 *pbuf) return H2C_SUCCESS; } - psta = rtw_get_stainfo(pstapriv, pparm->addr);//Get TDLS Peer STA + psta = rtw_get_stainfo(pstapriv, pparm->addr);/* Get TDLS Peer STA */ if ( psta->tdls_sta_state&TDLS_LINKED_STATE ){ write_cam(padapter, psta->mac_id, ctrl, pparm->addr, pparm->key); } else -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key); pmlmeinfo->enc_algo = pparm->algorithm; @@ -11031,11 +10977,11 @@ u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf) if (((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && (pmlmeinfo->HT_enable)) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) { - //pmlmeinfo->ADDBA_retry_count = 0; - //pmlmeinfo->candidate_tid_bitmap |= (0x1 << pparm->tid); - //psta->htpriv.candidate_tid_bitmap |= BIT(pparm->tid); + /* pmlmeinfo->ADDBA_retry_count = 0; */ + /* pmlmeinfo->candidate_tid_bitmap |= (0x1 << pparm->tid); */ + /* psta->htpriv.candidate_tid_bitmap |= BIT(pparm->tid); */ issue_action_BA(padapter, pparm->addr, RTW_WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid); - //_set_timer(&pmlmeext->ADDBA_timer, ADDBA_TO); + /* _set_timer(&pmlmeext->ADDBA_timer, ADDBA_TO); */ _set_timer(&psta->addba_retry_timer, ADDBA_TO); } #ifdef CONFIG_TDLS @@ -11044,15 +10990,15 @@ u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf) (psta->htpriv.ampdu_enable==true) ) { issue_action_BA(padapter, pparm->addr, RTW_WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid); - //_set_timer(&pmlmeext->ADDBA_timer, ADDBA_TO); + /* _set_timer(&pmlmeext->ADDBA_timer, ADDBA_TO); */ _set_timer(&psta->addba_retry_timer, ADDBA_TO); } -#endif //CONFIG +#endif /* CONFIG */ else { psta->htpriv.candidate_tid_bitmap &= ~BIT(pparm->tid); } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ return H2C_SUCCESS; } @@ -11123,7 +11069,7 @@ u8 mlme_evt_hdl(_adapter *padapter, unsigned char *pbuf) #ifdef CHECK_EVENT_SEQ - // checking event sequence... + /* checking event sequence... */ if (evt_seq != (ATOMIC_READ(&pevt_priv->event_seq) & 0x7f) ) { RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("Evetn Seq Error! %d vs %d\n", (evt_seq & 0x7f), (ATOMIC_READ(&pevt_priv->event_seq) & 0x7f))); @@ -11134,14 +11080,14 @@ u8 mlme_evt_hdl(_adapter *padapter, unsigned char *pbuf) } #endif - // checking if event code is valid + /* checking if event code is valid */ if (evt_code >= MAX_C2HEVT) { RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nEvent Code(%d) mismatch!\n", evt_code)); goto _abort_event_; } - // checking if event size match the event parm size + /* checking if event size match the event parm size */ if ((wlanevents[evt_code].parmsize != 0) && (wlanevents[evt_code].parmsize != evt_sz)) { @@ -11188,7 +11134,7 @@ u8 tx_beacon_hdl(_adapter *padapter, unsigned char *pbuf) return H2C_PARAMETERS_ERROR; } #ifdef CONFIG_AP_MODE - else //tx bc/mc frames after update TIM + else /* tx bc/mc frames after update TIM */ { _irqL irqL; struct sta_info *psta_bmc; @@ -11196,7 +11142,7 @@ u8 tx_beacon_hdl(_adapter *padapter, unsigned char *pbuf) struct xmit_frame *pxmitframe=NULL; struct sta_priv *pstapriv = &padapter->stapriv; - //for BC/MC Frames + /* for BC/MC Frames */ psta_bmc = rtw_get_bcmc_stainfo(padapter); if (!psta_bmc) return H2C_SUCCESS; @@ -11204,7 +11150,7 @@ u8 tx_beacon_hdl(_adapter *padapter, unsigned char *pbuf) if ((pstapriv->tim_bitmap&BIT(0)) && (psta_bmc->sleepq_len>0)) { #ifndef CONFIG_PCI_HCI - rtw_msleep_os(10);// 10ms, ATIM(HIQ) Windows + rtw_msleep_os(10);/* 10ms, ATIM(HIQ) Windows */ #endif _enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); @@ -11227,7 +11173,7 @@ u8 tx_beacon_hdl(_adapter *padapter, unsigned char *pbuf) pxmitframe->attrib.triggered=1; - pxmitframe->attrib.qsel = 0x11;//HIQ + pxmitframe->attrib.qsel = 0x11;/* HIQ */ _exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); if (rtw_hal_xmit(padapter, pxmitframe) == true) @@ -11236,13 +11182,13 @@ u8 tx_beacon_hdl(_adapter *padapter, unsigned char *pbuf) } _enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); - //pstapriv->tim_bitmap &= ~BIT(0); + /* pstapriv->tim_bitmap &= ~BIT(0); */ } _exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); -//#if defined(CONFIG_PCI_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) +/* if defined(CONFIG_PCI_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) */ #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) rtw_chk_hi_queue_cmd(padapter); #endif @@ -11265,7 +11211,7 @@ void dc_SelectChannel(_adapter *padapter, unsigned char channel) (padapter->DualMacConcurrent == true) && (padapter->adapter_type == SECONDARY_ADAPTER)) { - // only mac0 could control BB&RF + /* only mac0 could control BB&RF */ ptarget_adapter = padapter->pbuddy_adapter; } else @@ -11288,7 +11234,7 @@ void dc_SetBWMode(_adapter *padapter, unsigned short bwmode, unsigned char chann (padapter->DualMacConcurrent == true) && (padapter->adapter_type == SECONDARY_ADAPTER)) { - // only mac0 could control BB&RF + /* only mac0 could control BB&RF */ ptarget_adapter = padapter->pbuddy_adapter; } else @@ -11310,7 +11256,7 @@ static void dc_change_band(_adapter *padapter, WLAN_BSSID_EX *pnetwork) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 erpinfo=0x4; - //DBG_88E("%s\n", __func__); + /* DBG_88E("%s\n", __func__); */ if (pmlmeext->cur_channel >= 36) { @@ -11367,7 +11313,7 @@ void dc_set_channel_bwmode_disconnect(_adapter *padapter) pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv); if ((check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) != true) { - //switch to the 20M Hz mode after disconnect + /* switch to the 20M Hz mode after disconnect */ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; @@ -11376,7 +11322,7 @@ void dc_set_channel_bwmode_disconnect(_adapter *padapter) } else { - //switch to the 20M Hz mode after disconnect + /* switch to the 20M Hz mode after disconnect */ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; @@ -11406,17 +11352,17 @@ u8 dc_handle_join_request(_adapter *padapter) { if ((check_fwstate(pbuddy_mlmepriv, WIFI_AP_STATE)) == true) { - //issue deauth to all stas if if2 is at ap mode + /* issue deauth to all stas if if2 is at ap mode */ rtw_sta_flush(pbuddy_adapter); - //rtw_hal_set_hwreg(padapter, HW_VAR_CHECK_TXBUF, 0); + /* rtw_hal_set_hwreg(padapter, HW_VAR_CHECK_TXBUF, 0); */ rtw_hal_set_hwreg(pbuddy_adapter, HW_VAR_CHECK_TXBUF, 0); } else if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED) == true) { if (pmlmeext->cur_channel == pbuddy_mlmeext->cur_channel) { - // HT_CHANNEL_WIDTH_40 or HT_CHANNEL_WIDTH_20 but channel offset is different + /* HT_CHANNEL_WIDTH_40 or HT_CHANNEL_WIDTH_20 but channel offset is different */ if ((pmlmeext->cur_bwmode == pbuddy_mlmeext->cur_bwmode) && (pmlmeext->cur_ch_offset != pbuddy_mlmeext->cur_ch_offset) ) { @@ -11463,7 +11409,7 @@ void dc_handle_join_done(_adapter *padapter, u8 join_res) if (((pbuddy_mlmeinfo->state&0x03) == WIFI_FW_AP_STATE) && check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) { - //restart and update beacon + /* restart and update beacon */ DBG_88E("after join, current adapter, CH=%d, BW=%d, offset=%d\n", pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset); if (join_res >= 0) @@ -11478,7 +11424,7 @@ void dc_handle_join_done(_adapter *padapter, u8 join_res) change_band = true; } - //sync channel/bwmode/ch_offset with another adapter + /* sync channel/bwmode/ch_offset with another adapter */ pbuddy_mlmeext->cur_channel = pmlmeext->cur_channel; if (pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40) @@ -11487,14 +11433,14 @@ void dc_handle_join_done(_adapter *padapter, u8 join_res) if ( p && ie_len) { pht_info = (struct HT_info_element *)(p+2); - pht_info->infos[0] &= ~(BIT(0)|BIT(1)); //no secondary channel is present + pht_info->infos[0] &= ~(BIT(0)|BIT(1)); /* no secondary channel is present */ } if (pmlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40) { pbuddy_mlmeext->cur_ch_offset = pmlmeext->cur_ch_offset; - //to update cur_ch_offset value in beacon + /* to update cur_ch_offset value in beacon */ if ( pht_info ) { switch (pmlmeext->cur_ch_offset) @@ -11538,7 +11484,7 @@ void dc_handle_join_done(_adapter *padapter, u8 join_res) } } - // to update channel value in beacon + /* to update channel value in beacon */ pbuddy_network_mlmeext->Configuration.DSConfig = pmlmeext->cur_channel; p = rtw_get_ie((pbuddy_network_mlmeext->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _DSSET_IE_, &ie_len, (pbuddy_network_mlmeext->IELength - sizeof(NDIS_802_11_FIXED_IEs))); if (p && ie_len>0) @@ -11551,12 +11497,12 @@ void dc_handle_join_done(_adapter *padapter, u8 join_res) pht_info->primary_channel = pmlmeext->cur_channel; } - // update mlmepriv's cur_network + /* update mlmepriv's cur_network */ _rtw_memcpy(&pbuddy_mlmepriv->cur_network.network, pbuddy_network_mlmeext, pbuddy_network_mlmeext->Length); } else { - // switch back to original channel/bwmode/ch_offset; + /* switch back to original channel/bwmode/ch_offset; */ set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); } @@ -11605,7 +11551,7 @@ u8 dc_handle_site_survey(_adapter *padapter) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); PADAPTER pbuddy_adapter = padapter->pbuddy_adapter; - // only mac0 can do scan request, help issue nulldata(1) for mac1 + /* only mac0 can do scan request, help issue nulldata(1) for mac1 */ if (pbuddy_adapter != NULL && padapter->DualMacConcurrent == true) { @@ -11677,7 +11623,7 @@ void dc_set_channel_bwmode_survey_done(_adapter *padapter) if (is_client_associated_to_ap(pbuddy_adapter) == true) { - //issue null data + /* issue null data */ issue_nulldata(pbuddy_adapter, NULL, 0, 0, 0); } @@ -11738,7 +11684,7 @@ void dc_set_ap_channel_bandwidth(_adapter *padapter, u8 channel, u8 channel_offs } else if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED)==true) { - //To sync cur_channel/cur_bwmode/cur_ch_offset with another adapter + /* To sync cur_channel/cur_bwmode/cur_ch_offset with another adapter */ DBG_88E("Another iface is at linked state, sync cur_channel/cur_bwmode/cur_ch_offset\n"); DBG_88E("Another adapter, CH=%d, BW=%d, offset=%d\n", pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_bwmode, pbuddy_mlmeext->cur_ch_offset); DBG_88E("Current adapter, CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset); @@ -11753,7 +11699,7 @@ void dc_set_ap_channel_bandwidth(_adapter *padapter, u8 channel, u8 channel_offs { cur_ch_offset = pbuddy_mlmeext->cur_ch_offset; - //to update cur_ch_offset value in beacon + /* to update cur_ch_offset value in beacon */ if (pht_info) { switch (cur_ch_offset) @@ -11797,7 +11743,7 @@ void dc_set_ap_channel_bandwidth(_adapter *padapter, u8 channel, u8 channel_offs } } - // to update channel value in beacon + /* to update channel value in beacon */ pnetwork->Configuration.DSConfig = cur_channel; p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _DSSET_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs))); if (p && ie_len>0) @@ -11909,7 +11855,7 @@ int concurrent_chk_start_clnt_join(_adapter *padapter) pbuddy_pmlmeinfo = &(pbuddy_mlmeext->mlmext_info); pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv); - if ((pbuddy_pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)//for AP MODE + if ((pbuddy_pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)/* for AP MODE */ { bool inform_ch_switch = false; if (pmlmeext->cur_channel != pbuddy_mlmeext->cur_channel) @@ -11930,20 +11876,20 @@ int concurrent_chk_start_clnt_join(_adapter *padapter) } else #endif { - //issue deauth to all stas if if2 is at ap mode + /* issue deauth to all stas if if2 is at ap mode */ rtw_sta_flush(pbuddy_adapter); } rtw_hal_set_hwreg(padapter, HW_VAR_CHECK_TXBUF, 0); } } else if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED) == true && - check_fwstate(pbuddy_mlmepriv, WIFI_STATION_STATE) == true) //for Client Mode/p2p client + check_fwstate(pbuddy_mlmepriv, WIFI_STATION_STATE) == true) /* for Client Mode/p2p client */ { #if defined(CONFIG_P2P) && defined(CONFIG_IOCTL_CFG80211) struct wifidirect_info *pbuddy_wdinfo = &(pbuddy_adapter->wdinfo); if (!rtw_p2p_chk_state(pbuddy_wdinfo, P2P_STATE_NONE)) - return _SUCCESS; //wlan0-sta mode has higher priority than p2p0-p2p client -#endif //CONFIG_P2P && CONFIG_IOCTL_CFG80211 + return _SUCCESS; /* wlan0-sta mode has higher priority than p2p0-p2p client */ +#endif /* CONFIG_P2P && CONFIG_IOCTL_CFG80211 */ if (pmlmeext->cur_channel != pbuddy_mlmeext->cur_channel) { @@ -11998,7 +11944,7 @@ void concurrent_chk_joinbss_done(_adapter *padapter, int join_res) if (((pbuddy_mlmeinfo->state&0x03) == WIFI_FW_AP_STATE) && check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) { - //restart and update beacon + /* restart and update beacon */ DBG_88E("after join,primary adapter, CH=%d, BW=%d, offset=%d\n" , pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset); @@ -12010,7 +11956,7 @@ void concurrent_chk_joinbss_done(_adapter *padapter, int join_res) int ie_len; struct HT_info_element *pht_info=NULL; - //sync channel/bwmode/ch_offset with primary adapter + /* sync channel/bwmode/ch_offset with primary adapter */ pbuddy_mlmeext->cur_channel = pmlmeext->cur_channel; if (pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40) { @@ -12018,14 +11964,14 @@ void concurrent_chk_joinbss_done(_adapter *padapter, int join_res) if ( p && ie_len) { pht_info = (struct HT_info_element *)(p+2); - pht_info->infos[0] &= ~(BIT(0)|BIT(1)); //no secondary channel is present + pht_info->infos[0] &= ~(BIT(0)|BIT(1)); /* no secondary channel is present */ } if (pmlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40) { pbuddy_mlmeext->cur_ch_offset = pmlmeext->cur_ch_offset; - //to update cur_ch_offset value in beacon + /* to update cur_ch_offset value in beacon */ if ( pht_info ) { switch (pmlmeext->cur_ch_offset) @@ -12120,7 +12066,7 @@ void concurrent_chk_joinbss_done(_adapter *padapter, int join_res) } - // to update channel value in beacon + /* to update channel value in beacon */ pbuddy_network_mlmeext->Configuration.DSConfig = pmlmeext->cur_channel; p = rtw_get_ie((pbuddy_network_mlmeext->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _DSSET_IE_, &ie_len, (pbuddy_network_mlmeext->IELength - sizeof(NDIS_802_11_FIXED_IEs))); if (p && ie_len>0) @@ -12136,7 +12082,7 @@ void concurrent_chk_joinbss_done(_adapter *padapter, int join_res) } else { - // switch back to original channel/bwmode/ch_offset; + /* switch back to original channel/bwmode/ch_offset; */ set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); } @@ -12162,13 +12108,13 @@ void concurrent_chk_joinbss_done(_adapter *padapter, int join_res) } else { - // switch back to original channel/bwmode/ch_offset; + /* switch back to original channel/bwmode/ch_offset; */ set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); } } } -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ u8 set_ch_hdl(_adapter *padapter, u8 *pbuf) { @@ -12263,23 +12209,23 @@ u8 set_csa_hdl(_adapter *padapter, unsigned char *pbuf) return H2C_SUCCESS; #else return H2C_REJECTED; -#endif //CONFIG_DFS +#endif /* CONFIG_DFS */ } -// TDLS_WRCR : write RCR DATA BIT -// TDLS_SD_PTI : issue peer traffic indication -// TDLS_CS_OFF : go back to the channel linked with AP, terminating channel switch procedure -// TDLS_INIT_CH_SEN : init channel sensing, receive all data and mgnt frame -// TDLS_DONE_CH_SEN: channel sensing and report candidate channel -// TDLS_OFF_CH : first time set channel to off channel -// TDLS_BASE_CH : go back tp the channel linked with AP when set base channel as target channel -// TDLS_P_OFF_CH : periodically go to off channel -// TDLS_P_BASE_CH : periodically go back to base channel -// TDLS_RS_RCR : restore RCR -// TDLS_CKALV_PH1 : check alive timer phase1 -// TDLS_CKALV_PH2 : check alive timer phase2 -// TDLS_FREE_STA : free tdls sta +/* TDLS_WRCR : write RCR DATA BIT */ +/* TDLS_SD_PTI : issue peer traffic indication */ +/* TDLS_CS_OFF : go back to the channel linked with AP, terminating channel switch procedure */ +/* TDLS_INIT_CH_SEN : init channel sensing, receive all data and mgnt frame */ +/* TDLS_DONE_CH_SEN: channel sensing and report candidate channel */ +/* TDLS_OFF_CH : first time set channel to off channel */ +/* TDLS_BASE_CH : go back tp the channel linked with AP when set base channel as target channel */ +/* TDLS_P_OFF_CH : periodically go to off channel */ +/* TDLS_P_BASE_CH : periodically go back to base channel */ +/* TDLS_RS_RCR : restore RCR */ +/* TDLS_CKALV_PH1 : check alive timer phase1 */ +/* TDLS_CKALV_PH2 : check alive timer phase2 */ +/* TDLS_FREE_STA : free tdls sta */ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) { #ifdef CONFIG_TDLS @@ -12305,18 +12251,18 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) return H2C_REJECTED; } - //_enter_critical_bh(&(ptdlsinfo->hdl_lock), &irqL); + /* _enter_critical_bh(&(ptdlsinfo->hdl_lock), &irqL); */ DBG_88E("[%s] option:%d\n", __func__, option); switch (option){ case TDLS_WRCR: - //As long as TDLS handshake success, we should set RCR_CBSSID_DATA bit to 0 - //such we can receive all kinds of data frames. + /* As long as TDLS handshake success, we should set RCR_CBSSID_DATA bit to 0 */ + /* such we can receive all kinds of data frames. */ rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_WRCR, 0); DBG_88E("TDLS with %pM\n", ptdls_sta->hwaddr); pmlmeinfo->FW_sta_info[ptdls_sta->mac_id].psta = ptdls_sta; - //set TDLS sta rate. + /* set TDLS sta rate. */ set_sta_rate(padapter, ptdls_sta); break; case TDLS_SD_PTI: @@ -12371,7 +12317,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) if (ptdls_sta->tdls_sta_state & TDLS_PEER_SLEEP_STATE){ ptdls_sta->tdls_sta_state |= TDLS_APSD_CHSW_STATE; }else{ - //send null data with pwrbit==1 before send ch_switching_req to peer STA. + /* send null data with pwrbit==1 before send ch_switching_req to peer STA. */ issue_nulldata(padapter, NULL, 1, 0, 0); ptdls_sta->tdls_sta_state |= TDLS_CH_SW_INITIATOR_STATE; @@ -12434,11 +12380,11 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) } - //_exit_critical_bh(&(ptdlsinfo->hdl_lock), &irqL); + /* _exit_critical_bh(&(ptdlsinfo->hdl_lock), &irqL); */ return H2C_SUCCESS; #else return H2C_REJECTED; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ } diff --git a/core/rtw_mp.c b/core/rtw_mp.c index 57ee3b8..0bbbc53 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -157,69 +157,6 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv) _rtw_memcpy(pnetwork->Ssid.Ssid, "mp_871x", pnetwork->Ssid.SsidLength); } -#ifdef PLATFORM_WINDOWS -/* -void mp_wi_callback( - IN NDIS_WORK_ITEM* pwk_item, - IN void * cntx - ) -{ - _adapter* padapter =(_adapter *)cntx; - struct mp_priv *pmppriv=&padapter->mppriv; - struct mp_wi_cntx *pmp_wi_cntx=&pmppriv->wi_cntx; - - // Execute specified action. - if (pmp_wi_cntx->curractfunc != NULL) - { - LARGE_INTEGER cur_time; - ULONGLONG start_time, end_time; - NdisGetCurrentSystemTime(&cur_time); // driver version - start_time = cur_time.QuadPart/10; // The return value is in microsecond - - pmp_wi_cntx->curractfunc(padapter); - - NdisGetCurrentSystemTime(&cur_time); // driver version - end_time = cur_time.QuadPart/10; // The return value is in microsecond - - RT_TRACE(_module_mp_, _drv_info_, - ("WorkItemActType: %d, time spent: %I64d us\n", - pmp_wi_cntx->param.act_type, (end_time-start_time))); - } - - NdisAcquireSpinLock(&(pmp_wi_cntx->mp_wi_lock)); - pmp_wi_cntx->bmp_wi_progress= false; - NdisReleaseSpinLock(&(pmp_wi_cntx->mp_wi_lock)); - - if (pmp_wi_cntx->bmpdrv_unload) - { - NdisSetEvent(&(pmp_wi_cntx->mp_wi_evt)); - } - -} -*/ - -static int init_mp_priv_by_os(struct mp_priv *pmp_priv) -{ - struct mp_wi_cntx *pmp_wi_cntx; - - if (pmp_priv == NULL) return _FAIL; - - pmp_priv->rx_testcnt = 0; - pmp_priv->rx_testcnt1 = 0; - pmp_priv->rx_testcnt2 = 0; - - pmp_priv->tx_testcnt = 0; - pmp_priv->tx_testcnt1 = 0; - - pmp_wi_cntx = &pmp_priv->wi_cntx - pmp_wi_cntx->bmpdrv_unload = false; - pmp_wi_cntx->bmp_wi_progress = false; - pmp_wi_cntx->curractfunc = NULL; - - return _SUCCESS; -} -#endif - #ifdef PLATFORM_LINUX static int init_mp_priv_by_os(struct mp_priv *pmp_priv) { @@ -268,26 +205,26 @@ static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter) struct pkt_attrib *pattrib; struct tx_desc *desc; - // init xmitframe attribute + /* init xmitframe attribute */ pattrib = &pmptx->attrib; _rtw_memset(pattrib, 0, sizeof(struct pkt_attrib)); desc = &pmptx->desc; _rtw_memset(desc, 0, TXDESC_SIZE); pattrib->ether_type = 0x8712; - //_rtw_memcpy(pattrib->src, padapter->eeprompriv.mac_addr, ETH_ALEN); -// _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); + /* _rtw_memcpy(pattrib->src, padapter->eeprompriv.mac_addr, ETH_ALEN); */ +/* _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); */ _rtw_memset(pattrib->dst, 0xFF, ETH_ALEN); -// pattrib->pctrl = 0; -// pattrib->dhcp_pkt = 0; -// pattrib->pktlen = 0; +/* pattrib->pctrl = 0; */ +/* pattrib->dhcp_pkt = 0; */ +/* pattrib->pktlen = 0; */ pattrib->ack_policy = 0; -// pattrib->pkt_hdrlen = ETH_HLEN; +/* pattrib->pkt_hdrlen = ETH_HLEN; */ pattrib->hdrlen = WLAN_HDR_A3_LEN; pattrib->subtype = WIFI_DATA; pattrib->priority = 0; pattrib->qsel = pattrib->priority; -// do_queue_select(padapter, pattrib); +/* do_queue_select(padapter, pattrib); */ pattrib->nr_frags = 1; pattrib->encrypt = 0; pattrib->bswenc = false; @@ -340,14 +277,14 @@ void free_mp_priv(struct mp_priv *pmp_priv) #if defined (CONFIG_RTL8192C) || defined (CONFIG_RTL8723A) #define PHY_IQCalibrate(a,b) rtl8192c_PHY_IQCalibrate(a,b) #define PHY_LCCalibrate(a) rtl8192c_PHY_LCCalibrate(a) -//#define dm_CheckTXPowerTracking(a) rtl8192c_odm_CheckTXPowerTracking(a) +/* define dm_CheckTXPowerTracking(a) rtl8192c_odm_CheckTXPowerTracking(a) */ #define PHY_SetRFPathSwitch(a,b) rtl8192c_PHY_SetRFPathSwitch(a,b) #endif #ifdef CONFIG_RTL8192D #define PHY_IQCalibrate(a,b) rtl8192d_PHY_IQCalibrate(a) #define PHY_LCCalibrate(a) rtl8192d_PHY_LCCalibrate(a) -//#define dm_CheckTXPowerTracking(a) rtl8192d_odm_CheckTXPowerTracking(a) +/* define dm_CheckTXPowerTracking(a) rtl8192d_odm_CheckTXPowerTracking(a) */ #define PHY_SetRFPathSwitch(a,b) rtl8192d_PHY_SetRFPathSwitch(a,b) #endif @@ -368,18 +305,18 @@ MPT_InitializeAdapter( PMPT_CONTEXT pMptCtx = &pAdapter->mppriv.MptCtx; struct mlme_priv *pmlmepriv = &pAdapter->mlmepriv; - //------------------------------------------------------------------------- - // HW Initialization for 8190 MPT. - //------------------------------------------------------------------------- - //------------------------------------------------------------------------- - // SW Initialization for 8190 MP. - //------------------------------------------------------------------------- + /* */ + /* HW Initialization for 8190 MPT. */ + /* */ + /* */ + /* SW Initialization for 8190 MP. */ + /* */ pMptCtx->bMptDrvUnload = false; pMptCtx->bMassProdTest = false; - pMptCtx->bMptIndexEven = true; //default gain index is -6.0db + pMptCtx->bMptIndexEven = true; /* default gain index is -6.0db */ pMptCtx->h2cReqNum = 0x0; /* Init mpt event. */ - //init for BT MP + /* init for BT MP */ #ifdef CONFIG_RTL8723A pMptCtx->bMPh2c_timeout = false; pMptCtx->MptH2cRspEvent = false; @@ -391,13 +328,13 @@ MPT_InitializeAdapter( pMptCtx->bMptWorkItemInProgress = false; pMptCtx->CurrMptAct = NULL; - //------------------------------------------------------------------------- + /* */ - // Don't accept any packets + /* Don't accept any packets */ rtw_write32(pAdapter, REG_RCR, 0); PHY_IQCalibrate(pAdapter, false); - dm_CheckTXPowerTracking(&pHalData->odmpriv); //trigger thermal meter + dm_CheckTXPowerTracking(&pHalData->odmpriv); /* trigger thermal meter */ PHY_LCCalibrate(pAdapter); pMptCtx->backup0xc50 = (u1Byte)PHY_QueryBBReg(pAdapter, rOFDM0_XAAGCCore1, bMaskByte0); @@ -406,7 +343,7 @@ MPT_InitializeAdapter( pMptCtx->backup0x52_RF_A = (u1Byte)PHY_QueryRFReg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0); pMptCtx->backup0x52_RF_B = (u1Byte)PHY_QueryRFReg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0); - //set ant to wifi side in mp mode + /* set ant to wifi side in mp mode */ rtw_write16(pAdapter, 0x870, 0x300); rtw_write16(pAdapter, 0x860, 0x110); @@ -486,8 +423,8 @@ static void disable_dm(PADAPTER padapter) struct dm_priv *pdmpriv = &pHalData->dmpriv; - //3 1. disable firmware dynamic mechanism - // disable Power Training, Rate Adaptive + /* 3 1. disable firmware dynamic mechanism */ + /* disable Power Training, Rate Adaptive */ #ifdef CONFIG_RTL8723A SetBcnCtrlReg(padapter, 0, EN_BCN_FUNCTION); #else @@ -496,20 +433,20 @@ static void disable_dm(PADAPTER padapter) rtw_write8(padapter, REG_BCN_CTRL, v8); #endif - //3 2. disable driver dynamic mechanism - // disable Dynamic Initial Gain - // disable High Power - // disable Power Tracking + /* 3 2. disable driver dynamic mechanism */ + /* disable Dynamic Initial Gain */ + /* disable High Power */ + /* disable Power Tracking */ Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false); - // enable APK, LCK and IQK but disable power tracking + /* enable APK, LCK and IQK but disable power tracking */ #ifndef CONFIG_RTL8188E pdmpriv->TxPowerTrackControl = false; #endif Switch_DM_Func(padapter, DYNAMIC_RF_CALIBRATION, true); } -//This function initializes the DUT to the MP test mode +/* This function initializes the DUT to the MP test mode */ s32 mp_start_test(PADAPTER padapter) { WLAN_BSSID_EX bssid; @@ -525,15 +462,15 @@ s32 mp_start_test(PADAPTER padapter) struct wlan_network *tgt_network = &pmlmepriv->cur_network; padapter->registrypriv.mp_mode = 1; - pmppriv->bSetTxPower=0; //for manually set tx power + pmppriv->bSetTxPower=0; /* for manually set tx power */ - //3 disable dynamic mechanism + /* 3 disable dynamic mechanism */ disable_dm(padapter); - //3 0. update mp_priv + /* 3 0. update mp_priv */ if (padapter->registrypriv.rf_config == RF_819X_MAX_TYPE) { -// switch (phal->rf_type) { +/* switch (phal->rf_type) { */ switch (GET_RF_TYPE(padapter)) { case RF_1T1R: pmppriv->antenna_tx = ANTENNA_A; @@ -558,8 +495,8 @@ s32 mp_start_test(PADAPTER padapter) mpt_ProStartTest(padapter); - //3 1. initialize a new WLAN_BSSID_EX -// _rtw_memset(&bssid, 0, sizeof(WLAN_BSSID_EX)); + /* 3 1. initialize a new WLAN_BSSID_EX */ +/* _rtw_memset(&bssid, 0, sizeof(WLAN_BSSID_EX)); */ _rtw_memcpy(bssid.MacAddress, pmppriv->network_macaddr, ETH_ALEN); bssid.Ssid.SsidLength = strlen("mp_pseudo_adhoc"); _rtw_memcpy(bssid.Ssid.Ssid, (u8*)"mp_pseudo_adhoc", bssid.Ssid.SsidLength); @@ -569,7 +506,7 @@ s32 mp_start_test(PADAPTER padapter) length = get_WLAN_BSSID_EX_sz(&bssid); if (length % 4) - bssid.Length = ((length >> 2) + 1) << 2; //round up to multiple of 4 bytes. + bssid.Length = ((length >> 2) + 1) << 2; /* round up to multiple of 4 bytes. */ else bssid.Length = length; @@ -578,7 +515,7 @@ s32 mp_start_test(PADAPTER padapter) if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) goto end_of_mp_start_test; - //init mp_start_test status + /* init mp_start_test status */ if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { rtw_disassoc_cmd(padapter, 500, true); rtw_indicate_disconnect(padapter); @@ -589,8 +526,8 @@ s32 mp_start_test(PADAPTER padapter) pmlmepriv->fw_state = WIFI_MP_STATE; set_fwstate(pmlmepriv, _FW_UNDER_LINKING); - //3 2. create a new psta for mp driver - //clear psta in the cur_network, if any + /* 3 2. create a new psta for mp driver */ + /* clear psta in the cur_network, if any */ psta = rtw_get_stainfo(&padapter->stapriv, tgt_network->network.MacAddress); if (psta) rtw_free_stainfo(padapter, psta); @@ -602,7 +539,7 @@ s32 mp_start_test(PADAPTER padapter) goto end_of_mp_start_test; } - //3 3. join psudo AdHoc + /* 3 3. join psudo AdHoc */ tgt_network->join_res = 1; tgt_network->aid = psta->aid = 1; _rtw_memcpy(&tgt_network->network, &bssid, length); @@ -616,31 +553,31 @@ end_of_mp_start_test: if (res == _SUCCESS) { - // set MSR to WIFI_FW_ADHOC_STATE + /* set MSR to WIFI_FW_ADHOC_STATE */ #if !defined (CONFIG_RTL8712) - val8 = rtw_read8(padapter, MSR) & 0xFC; // 0x0102 + val8 = rtw_read8(padapter, MSR) & 0xFC; /* 0x0102 */ val8 |= WIFI_FW_ADHOC_STATE; - rtw_write8(padapter, MSR, val8); // Link in ad hoc network + rtw_write8(padapter, MSR, val8); /* Link in ad hoc network */ #endif #if defined (CONFIG_RTL8712) - rtw_write8(padapter, MSR, 1); // Link in ad hoc network - rtw_write8(padapter, RCR, 0); // RCR : disable all pkt, 0x10250048 - rtw_write8(padapter, RCR+2, 0x57); // RCR disable Check BSSID, 0x1025004a + rtw_write8(padapter, MSR, 1); /* Link in ad hoc network */ + rtw_write8(padapter, RCR, 0); /* RCR : disable all pkt, 0x10250048 */ + rtw_write8(padapter, RCR+2, 0x57); /* RCR disable Check BSSID, 0x1025004a */ - // disable RX filter map , mgt frames will put in RX FIFO 0 - rtw_write16(padapter, RXFLTMAP0, 0x0); // 0x10250116 + /* disable RX filter map , mgt frames will put in RX FIFO 0 */ + rtw_write16(padapter, RXFLTMAP0, 0x0); /* 0x10250116 */ - val8 = rtw_read8(padapter, EE_9346CR); // 0x1025000A - if (!(val8 & _9356SEL))//boot from EFUSE + val8 = rtw_read8(padapter, EE_9346CR); /* 0x1025000A */ + if (!(val8 & _9356SEL))/* boot from EFUSE */ efuse_change_max_size(padapter); #endif } return res; } -//------------------------------------------------------------------------------ -//This function change the DUT from the MP test mode into normal mode +/* */ +/* This function change the DUT from the MP test mode into normal mode */ void mp_stop_test(PADAPTER padapter) { struct mp_priv *pmppriv = &padapter->mppriv; @@ -657,18 +594,18 @@ void mp_stop_test(PADAPTER padapter) if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false) goto end_of_mp_stop_test; - //3 1. disconnect psudo AdHoc + /* 3 1. disconnect psudo AdHoc */ rtw_indicate_disconnect(padapter); - //3 2. clear psta used in mp test mode. -// rtw_free_assoc_resources(padapter, 1); + /* 3 2. clear psta used in mp test mode. */ +/* rtw_free_assoc_resources(padapter, 1); */ psta = rtw_get_stainfo(&padapter->stapriv, tgt_network->network.MacAddress); if (psta) rtw_free_stainfo(padapter, psta); - //3 3. return to normal state (default:station mode) - pmlmepriv->fw_state = pmppriv->prev_fw_state; // WIFI_STATION_STATE; + /* 3 3. return to normal state (default:station mode) */ + pmlmepriv->fw_state = pmppriv->prev_fw_state; /* WIFI_STATION_STATE; */ - //flush the cur_network + /* flush the cur_network */ _rtw_memset(tgt_network, 0, sizeof(struct wlan_network)); _clr_fwstate_(pmlmepriv, WIFI_MP_STATE); @@ -870,7 +807,7 @@ void PhySetTxPowerLevel(PADAPTER pAdapter) { struct mp_priv *pmp_priv = &pAdapter->mppriv; - if (pmp_priv->bSetTxPower==0) // for NO manually set power index + if (pmp_priv->bSetTxPower==0) /* for NO manually set power index */ { #ifdef CONFIG_RTL8188E PHY_SetTxPowerLevel8188E(pAdapter,pmp_priv->channel); @@ -882,7 +819,7 @@ void PhySetTxPowerLevel(PADAPTER pAdapter) } } -//------------------------------------------------------------------------------ +/* */ static void dump_mpframe(PADAPTER padapter, struct xmit_frame *pmpframe) { rtw_hal_mgnt_xmit(padapter, pmpframe); @@ -931,7 +868,7 @@ static thread_return mp_xmit_packet_thread(thread_context context) thread_enter("RTW_MP_THREAD"); - //DBG_88E("%s:pkTx Start\n", __func__); + /* DBG_88E("%s:pkTx Start\n", __func__); */ while (1) { pxmitframe = alloc_mp_xmitframe(pxmitpriv); if (pxmitframe == NULL) { @@ -966,7 +903,7 @@ static thread_return mp_xmit_packet_thread(thread_context context) } exit: - //DBG_88E("%s:pkTx Exit\n", __func__); + /* DBG_88E("%s:pkTx Exit\n", __func__); */ rtw_mfree(pmptx->pallocated_buf, pmptx->buf_size); pmptx->pallocated_buf = NULL; pmptx->stop = 1; @@ -998,7 +935,7 @@ void SetPacketTx(PADAPTER padapter) pmp_priv->tx.stop = 0; pmp_priv->tx_pktcount = 0; - //3 1. update_attrib() + /* 3 1. update_attrib() */ pattrib = &pmp_priv->tx.attrib; _rtw_memcpy(pattrib->src, padapter->eeprompriv.mac_addr, ETH_ALEN); _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); @@ -1014,7 +951,7 @@ void SetPacketTx(PADAPTER padapter) pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->pktlen; - //3 2. allocate xmit buffer + /* 3 2. allocate xmit buffer */ pkt_size = pattrib->last_txcmdsz; if (pmp_priv->tx.pallocated_buf) @@ -1034,41 +971,37 @@ void SetPacketTx(PADAPTER padapter) pkt_start = ptr; pkt_end = pkt_start + pkt_size; - //3 3. init TX descriptor - // offset 0 + /* 3 3. init TX descriptor */ + /* offset 0 */ #if defined(CONFIG_RTL8188E) && !defined(CONFIG_RTL8188E_SDIO) desc->txdw0 |= cpu_to_le32(OWN | FSG | LSG); - desc->txdw0 |= cpu_to_le32(pkt_size & 0x0000FFFF); // packet size - desc->txdw0 |= cpu_to_le32(((TXDESC_SIZE + OFFSET_SZ) << OFFSET_SHT) & 0x00FF0000); //32 bytes for TX Desc - if (bmcast) desc->txdw0 |= cpu_to_le32(BMC); // broadcast packet + desc->txdw0 |= cpu_to_le32(pkt_size & 0x0000FFFF); /* packet size */ + desc->txdw0 |= cpu_to_le32(((TXDESC_SIZE + OFFSET_SZ) << OFFSET_SHT) & 0x00FF0000); /* 32 bytes for TX Desc */ + if (bmcast) desc->txdw0 |= cpu_to_le32(BMC); /* broadcast packet */ desc->txdw1 |= cpu_to_le32((0x01 << 26) & 0xff000000); #endif - // offset 4 + /* offset 4 */ #ifndef CONFIG_RTL8188E - desc->txdw1 |= cpu_to_le32(BK); // don't aggregate(AMPDU) - desc->txdw1 |= cpu_to_le32((pattrib->mac_id) & 0x1F); //CAM_ID(MAC_ID) + desc->txdw1 |= cpu_to_le32(BK); /* don't aggregate(AMPDU) */ + desc->txdw1 |= cpu_to_le32((pattrib->mac_id) & 0x1F); /* CAM_ID(MAC_ID) */ #else - desc->txdw1 |= cpu_to_le32((pattrib->mac_id) & 0x3F); //CAM_ID(MAC_ID) + desc->txdw1 |= cpu_to_le32((pattrib->mac_id) & 0x3F); /* CAM_ID(MAC_ID) */ #endif - desc->txdw1 |= cpu_to_le32((pattrib->qsel << QSEL_SHT) & 0x00001F00); // Queue Select, TID + desc->txdw1 |= cpu_to_le32((pattrib->qsel << QSEL_SHT) & 0x00001F00); /* Queue Select, TID */ #ifdef CONFIG_RTL8188E - desc->txdw1 |= cpu_to_le32((pattrib->raid << RATE_ID_SHT) & 0x000F0000); // Rate Adaptive ID + desc->txdw1 |= cpu_to_le32((pattrib->raid << RATE_ID_SHT) & 0x000F0000); /* Rate Adaptive ID */ #else - desc->txdw1 |= cpu_to_le32((pattrib->raid << Rate_ID_SHT) & 0x000F0000); // Rate Adaptive ID + desc->txdw1 |= cpu_to_le32((pattrib->raid << Rate_ID_SHT) & 0x000F0000); /* Rate Adaptive ID */ #endif - // offset 8 - // desc->txdw2 |= cpu_to_le32(AGG_BK);//AGG BK - // offset 12 + /* offset 8 */ + /* offset 12 */ desc->txdw3 |= cpu_to_le32((pattrib->seqnum<<16)&0x0fff0000); -// desc->txdw3 |= cpu_to_le32((pattrib->seqnum & 0xFFF) << SEQ_SHT); - //desc->txdw3 |= cpu_to_le32((pattrib->seqnum << SEQ_SHT) & 0xffff0000); - // offset 16 - //desc->txdw4 |= cpu_to_le32(QoS) + /* offset 16 */ #ifdef CONFIG_RTL8188E desc->txdw4 |= cpu_to_le32(HW_SSN); #else @@ -1079,33 +1012,33 @@ void SetPacketTx(PADAPTER padapter) if ( pmp_priv->preamble ){ if (pmp_priv->rateidx <= MPT_RATE_54M) - desc->txdw4 |= cpu_to_le32(DATA_SHORT); // CCK Short Preamble + desc->txdw4 |= cpu_to_le32(DATA_SHORT); /* CCK Short Preamble */ } if (pmp_priv->bandwidth == HT_CHANNEL_WIDTH_40) desc->txdw4 |= cpu_to_le32(DATA_BW); - // offset 20 + /* offset 20 */ desc->txdw5 |= cpu_to_le32(pmp_priv->rateidx & 0x0000001F); if ( pmp_priv->preamble ){ if (pmp_priv->rateidx > MPT_RATE_54M) - desc->txdw5 |= cpu_to_le32(SGI); // MCS Short Guard Interval + desc->txdw5 |= cpu_to_le32(SGI); /* MCS Short Guard Interval */ } #ifdef CONFIG_RTL8188E - desc->txdw5 |= cpu_to_le32(RTY_LMT_EN); // retry limit enable - desc->txdw5 |= cpu_to_le32(0x00180000); // DATA/RTS Rate Fallback Limit + desc->txdw5 |= cpu_to_le32(RTY_LMT_EN); /* retry limit enable */ + desc->txdw5 |= cpu_to_le32(0x00180000); /* DATA/RTS Rate Fallback Limit */ #else - desc->txdw5 |= cpu_to_le32(0x0001FF00); // DATA/RTS Rate Fallback Limit + desc->txdw5 |= cpu_to_le32(0x0001FF00); /* DATA/RTS Rate Fallback Limit */ #endif - //3 4. make wlan header, make_wlanhdr() + /* 3 4. make wlan header, make_wlanhdr() */ hdr = (struct rtw_ieee80211_hdr *)pkt_start; SetFrameSubType(&hdr->frame_ctl, pattrib->subtype); - _rtw_memcpy(hdr->addr1, pattrib->dst, ETH_ALEN); // DA - _rtw_memcpy(hdr->addr2, pattrib->src, ETH_ALEN); // SA - _rtw_memcpy(hdr->addr3, get_bssid(&padapter->mlmepriv), ETH_ALEN); // RA, BSSID + _rtw_memcpy(hdr->addr1, pattrib->dst, ETH_ALEN); /* DA */ + _rtw_memcpy(hdr->addr2, pattrib->src, ETH_ALEN); /* SA */ + _rtw_memcpy(hdr->addr3, get_bssid(&padapter->mlmepriv), ETH_ALEN); /* RA, BSSID */ - //3 5. make payload + /* 3 5. make payload */ ptr = pkt_start + pattrib->hdrlen; switch (pmp_priv->tx.payload) { @@ -1128,7 +1061,7 @@ void SetPacketTx(PADAPTER padapter) _rtw_memset(ptr, payload, pkt_end - ptr); - //3 6. start thread + /* 3 6. start thread */ #ifdef PLATFORM_LINUX pmp_priv->tx.PktTxThread = kthread_run(mp_xmit_packet_thread, pmp_priv, "RTW_MP_THREAD"); if (IS_ERR(pmp_priv->tx.PktTxThread)) @@ -1153,16 +1086,16 @@ void SetPacketRx(PADAPTER pAdapter, u8 bStartRx) if (bStartRx) { - // Accept CRC error and destination address + /* Accept CRC error and destination address */ #if 1 -//ndef CONFIG_RTL8723A +/* ndef CONFIG_RTL8723A */ pHalData->ReceiveConfig = AAP | APM | AM | AB | APP_ICV | ADF | AMF | HTC_LOC_CTRL | APP_MIC | APP_PHYSTS; pHalData->ReceiveConfig |= ACRC32; rtw_write32(pAdapter, REG_RCR, pHalData->ReceiveConfig); - // Accept all data frames + /* Accept all data frames */ rtw_write16(pAdapter, REG_RXFLTMAP2, 0xFFFF); #else rtw_write32(pAdapter, REG_RCR, 0x70000101); @@ -1180,21 +1113,21 @@ void ResetPhyRxPktCount(PADAPTER pAdapter) for (i = 0; i <= 0xF; i++) { phyrx_set = 0; - phyrx_set |= _RXERR_RPT_SEL(i); //select - phyrx_set |= RXERR_RPT_RST; // set counter to zero + phyrx_set |= _RXERR_RPT_SEL(i); /* select */ + phyrx_set |= RXERR_RPT_RST; /* set counter to zero */ rtw_write32(pAdapter, REG_RXERR_RPT, phyrx_set); } } static u32 GetPhyRxPktCounts(PADAPTER pAdapter, u32 selbit) { - //selection + /* selection */ u32 phyrx_set = 0, count = 0; phyrx_set = _RXERR_RPT_SEL(selbit & 0xF); rtw_write32(pAdapter, REG_RXERR_RPT, phyrx_set); - //Read packet count + /* Read packet count */ count = rtw_read32(pAdapter, REG_RXERR_RPT) & RXERR_COUNTER_MASK; return count; @@ -1222,9 +1155,9 @@ u32 GetPhyRxPktCRC32Error(PADAPTER pAdapter) return OFDM_cnt + CCK_cnt + HT_cnt; } -//reg 0x808[9:0]: FFT data x -//reg 0x808[22]: 0 --> 1 to get 1 FFT data y -//reg 0x8B4[15:0]: FFT data y report +/* reg 0x808[9:0]: FFT data x */ +/* reg 0x808[22]: 0 --> 1 to get 1 FFT data y */ +/* reg 0x8B4[15:0]: FFT data y report */ static u32 rtw_GetPSDData(PADAPTER pAdapter, u32 point) { int psd_val; @@ -1273,7 +1206,7 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data) return 0; } - if (strlen(data) == 0) { //default value + if (strlen(data) == 0) { /* default value */ psd_pts = 128; psd_start = 64; psd_stop = 128; @@ -1349,7 +1282,7 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv) num_xmit_extbuf = NR_XMIT_EXTBUFF; } - // Init xmit extension buff + /* Init xmit extension buff */ _rtw_init_queue(&pxmitpriv->free_xmit_extbuf_queue); pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4); diff --git a/core/rtw_mp_ioctl.c b/core/rtw_mp_ioctl.c index fd3151c..df5c536 100644 --- a/core/rtw_mp_ioctl.c +++ b/core/rtw_mp_ioctl.c @@ -24,11 +24,11 @@ #include #include -//#include +/* include */ #include -//**************** oid_rtl_seg_81_85 section start **************** +/* oid_rtl_seg_81_85 section start **************** */ NDIS_STATUS oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; @@ -53,7 +53,7 @@ _func_exit_; return status; } -//**************** oid_rtl_seg_81_87_80 section start **************** +/* oid_rtl_seg_81_87_80 section start **************** */ NDIS_STATUS oid_rt_pro_write_bb_reg_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -77,7 +77,7 @@ _func_enter_; pbbreg = (struct bb_reg_param *)(poid_par_priv->information_buf); - offset = (u16)(pbbreg->offset) & 0xFFF; //0ffset :0x800~0xfff + offset = (u16)(pbbreg->offset) & 0xFFF; /* 0ffset :0x800~0xfff */ if (offset < BB_REG_BASE_ADDR) offset |= BB_REG_BASE_ADDR; value = pbbreg->value; @@ -94,7 +94,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_read_bb_reg_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -118,7 +118,7 @@ _func_enter_; pbbreg = (struct bb_reg_param *)(poid_par_priv->information_buf); - offset = (u16)(pbbreg->offset) & 0xFFF; //0ffset :0x800~0xfff + offset = (u16)(pbbreg->offset) & 0xFFF; /* 0ffset :0x800~0xfff */ if (offset < BB_REG_BASE_ADDR) offset |= BB_REG_BASE_ADDR; _irqlevel_changed_(&oldirql, LOWER); @@ -135,7 +135,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -183,7 +183,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -232,17 +232,17 @@ _func_exit_; return status; } -//**************** oid_rtl_seg_81_87_00 section end**************** -//------------------------------------------------------------------------------ +/* oid_rtl_seg_81_87_00 section end**************** */ +/* */ -//**************** oid_rtl_seg_81_80_00 section start **************** -//------------------------------------------------------------------------------ +/* oid_rtl_seg_81_80_00 section start **************** */ +/* */ NDIS_STATUS oid_rt_pro_set_data_rate_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP _irqL oldirql; #endif - u32 ratevalue;//4 + u32 ratevalue;/* 4 */ NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); @@ -257,7 +257,7 @@ _func_enter_; if (poid_par_priv->information_buf_len != sizeof(u32)) return NDIS_STATUS_INVALID_LENGTH; - ratevalue = *((u32*)poid_par_priv->information_buf);//4 + ratevalue = *((u32*)poid_par_priv->information_buf);/* 4 */ RT_TRACE(_module_mp_, _drv_notice_, ("oid_rt_pro_set_data_rate_hdl: data rate idx=%d\n", ratevalue)); if (ratevalue >= MPT_RATE_LAST) @@ -273,7 +273,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_start_test_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -295,10 +295,10 @@ _func_enter_; _irqlevel_changed_(&oldirql, LOWER); - //IQCalibrateBcut(Adapter); + /* IQCalibrateBcut(Adapter); */ mode = *((u32*)poid_par_priv->information_buf); - Adapter->mppriv.mode = mode;// 1 for loopback + Adapter->mppriv.mode = mode;/* 1 for loopback */ if (mp_start_test(Adapter) == _FAIL) { status = NDIS_STATUS_NOT_ACCEPTED; @@ -314,7 +314,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_stop_test_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -340,7 +340,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_set_channel_direct_call_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -379,7 +379,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_set_bandwidth_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -401,7 +401,7 @@ _func_enter_; if (poid_par_priv->information_buf_len < sizeof(u32)) return NDIS_STATUS_INVALID_LENGTH; - bandwidth = *((u32*)poid_par_priv->information_buf);//4 + bandwidth = *((u32*)poid_par_priv->information_buf);/* 4 */ channel_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; if (bandwidth != HT_CHANNEL_WIDTH_40) @@ -421,7 +421,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_set_antenna_bb_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -499,9 +499,9 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ -//**************** oid_rtl_seg_81_80_20 section start **************** -//------------------------------------------------------------------------------ +/* */ +/* oid_rtl_seg_81_80_20 section start **************** */ +/* */ NDIS_STATUS oid_rt_pro_query_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; @@ -525,7 +525,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_query_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; @@ -550,7 +550,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_query_rx_packet_crc32_error_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; @@ -575,7 +575,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv) { @@ -596,7 +596,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; @@ -621,7 +621,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -645,7 +645,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_get_phy_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -676,7 +676,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_get_phy_rx_packet_crc32_error_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -708,7 +708,7 @@ _func_exit_; return status; } -//**************** oid_rtl_seg_81_80_20 section end **************** +/* oid_rtl_seg_81_80_20 section end **************** */ NDIS_STATUS oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -876,13 +876,13 @@ _func_exit_; return status; } -//**************** oid_rtl_seg_81_80_00 section end **************** -//------------------------------------------------------------------------------ +/* oid_rtl_seg_81_80_00 section end **************** */ +/* */ NDIS_STATUS oid_rt_pro8711_join_bss_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -934,7 +934,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -997,69 +997,69 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_burst_read_register_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_burst_write_register_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_write_txcmd_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_read16_eeprom_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_write16_eeprom_hdl (struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro8711_wi_poll_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro8711_pkt_loss_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_rd_attrib_mem_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_wr_attrib_mem_hdl (struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_set_rf_intfs_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_poll_rx_status_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_cfg_debug_message_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_set_data_rate_ex_hdl(struct oid_par_priv *poid_par_priv) { PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); @@ -1087,7 +1087,7 @@ _func_exit_; return status; } -//----------------------------------------------------------------------------- +/* */ NDIS_STATUS oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -1118,12 +1118,12 @@ _func_exit_; return status; } -//----------------------------------------------------------------------------- +/* */ NDIS_STATUS oid_rt_pro_read_tssi_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_set_power_tracking_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -1156,54 +1156,54 @@ _func_exit_; return status; } -//----------------------------------------------------------------------------- +/* */ NDIS_STATUS oid_rt_pro_set_basic_rate_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_qry_pwrstate_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_set_pwrstate_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_h2c_set_rate_table_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_h2c_get_rate_table_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//**************** oid_rtl_seg_87_12_00 section start **************** +/* oid_rtl_seg_87_12_00 section start **************** */ NDIS_STATUS oid_rt_pro_encryption_ctrl_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv *poid_par_priv) { return 0; } -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ +/* */ +/* */ NDIS_STATUS oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv) { return NDIS_STATUS_SUCCESS; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -1251,7 +1251,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -1294,7 +1294,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_rw_efuse_pgpkt_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -1306,7 +1306,7 @@ NDIS_STATUS oid_rt_pro_rw_efuse_pgpkt_hdl(struct oid_par_priv *poid_par_priv) _func_enter_; -// RT_TRACE(_module_mp_, _drv_info_, ("+oid_rt_pro_rw_efuse_pgpkt_hdl\n")); +/* RT_TRACE(_module_mp_, _drv_info_, ("+oid_rt_pro_rw_efuse_pgpkt_hdl\n")); */ *poid_par_priv->bytes_rw = 0; @@ -1351,7 +1351,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_get_efuse_current_size_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -1383,7 +1383,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_get_efuse_max_size_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; @@ -1408,7 +1408,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_efuse_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status; @@ -1428,7 +1428,7 @@ _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv) { #ifdef PLATFORM_OS_XP @@ -1467,7 +1467,7 @@ _func_enter_; status = NDIS_STATUS_FAILURE; } } else { - // SET_OID + /* SET_OID */ RT_TRACE(_module_mp_, _drv_info_, ("oid_rt_pro_efuse_map_hdl: WRITE\n")); @@ -1514,7 +1514,7 @@ _func_enter_; if (poid_par_priv->information_buf_len < sizeof(u8)) return NDIS_STATUS_INVALID_LENGTH; - rx_pkt_type = *((u8*)poid_par_priv->information_buf);//4 + rx_pkt_type = *((u8*)poid_par_priv->information_buf);/* 4 */ RT_TRACE(_module_mp_, _drv_info_, ("rx_pkt_type: %x\n",rx_pkt_type )); _func_exit_; @@ -1566,7 +1566,7 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) return NDIS_STATUS_SUCCESS; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; @@ -1583,14 +1583,14 @@ _func_enter_; _irqlevel_changed_(&oldirql, LOWER); - //CALL the power_down function + /* CALL the power_down function */ _irqlevel_changed_(&oldirql, RAISE); _func_exit_; return status; } -//------------------------------------------------------------------------------ +/* */ NDIS_STATUS oid_rt_get_power_mode_hdl(struct oid_par_priv *poid_par_priv) { return 0; diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index 3f16921..2ce91e5 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -95,7 +95,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) phead = &pstapriv->asoc_list; plist = get_next(phead); - //look up sta asoc_queue + /* look up sta asoc_queue */ while ((rtw_end_of_queue_search(phead, plist)) == false) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); @@ -109,18 +109,18 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) pcur++; - //P2P device address + /* P2P device address */ _rtw_memcpy(pcur, psta->dev_addr, ETH_ALEN); pcur += ETH_ALEN; - //P2P interface address + /* P2P interface address */ _rtw_memcpy(pcur, psta->hwaddr, ETH_ALEN); pcur += ETH_ALEN; *pcur = psta->dev_cap; pcur++; - //*(u16*)(pcur) = cpu_to_be16(psta->config_methods); + /* u16*)(pcur) = cpu_to_be16(psta->config_methods); */ RTW_PUT_BE16(pcur, psta->config_methods); pcur += 2; @@ -135,11 +135,11 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) if (psta->dev_name_len>0) { - //*(u16*)(pcur) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); + /* u16*)(pcur) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); */ RTW_PUT_BE16(pcur, WPS_ATTR_DEVICE_NAME); pcur += 2; - //*(u16*)(pcur) = cpu_to_be16( psta->dev_name_len ); + /* u16*)(pcur) = cpu_to_be16( psta->dev_name_len ); */ RTW_PUT_BE16(pcur, psta->dev_name_len); pcur += 2; @@ -154,7 +154,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) attr_len += tmplen; - //pstart += tmplen; + /* pstart += tmplen; */ pstart = pcur; } @@ -184,7 +184,7 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da) _adapter *padapter = pwdinfo->padapter; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - unsigned char category = RTW_WLAN_CATEGORY_P2P;//P2P action frame + unsigned char category = RTW_WLAN_CATEGORY_P2P;/* P2P action frame */ __be32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_GO_DISC_REQUEST; u8 dialogToken=0; @@ -196,7 +196,7 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -219,13 +219,13 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da) pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); - //Build P2P action frame header + /* Build P2P action frame header */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 4, (unsigned char *) &(p2poui), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(oui_subtype), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(dialogToken), &(pattrib->pktlen)); - //there is no IE in this P2P action frame + /* there is no IE in this P2P action frame */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -257,7 +257,7 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -280,7 +280,7 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); - //Build P2P public action frame header + /* Build P2P public action frame header */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 4, (unsigned char *) &(p2poui), &(pattrib->pktlen)); @@ -288,15 +288,15 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s pframe = rtw_set_fixed_ie(pframe, 1, &(dialogToken), &(pattrib->pktlen)); - //Build P2P IE - // P2P OUI + /* Build P2P IE */ + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - // P2P_ATTR_STATUS + /* P2P_ATTR_STATUS */ p2pielen += rtw_set_p2p_attr_content(&p2pie[p2pielen], P2P_ATTR_STATUS, 1, &status); pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, p2pie, &pattrib->pktlen); @@ -312,14 +312,14 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8* raddr, _adapter *padapter = pwdinfo->padapter; unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; - u8 dialogToken = frame_body[7]; // The Dialog Token of provisioning discovery request frame. + u8 dialogToken = frame_body[7]; /* The Dialog Token of provisioning discovery request frame. */ __be32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_PROVISION_DISC_RESP; u8 wpsie[ 100 ] = { 0x00 }; u8 wpsielen = 0; #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; @@ -336,7 +336,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8* raddr, return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -366,20 +366,20 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8* raddr, pframe = rtw_set_fixed_ie(pframe, 1, &(dialogToken), &(pattrib->pktlen)); wpsielen = 0; - // WPS OUI + /* WPS OUI */ RTW_PUT_BE32(wpsie, WPSOUI); wpsielen += 4; - // Config Method - // Type: + /* Config Method */ + /* Type: */ RTW_PUT_BE16(wpsie + wpsielen, WPS_ATTR_CONF_METHOD); wpsielen += 2; - // Length: + /* Length: */ RTW_PUT_BE16(wpsie + wpsielen, 0x0002); wpsielen += 2; - // Value: + /* Value: */ RTW_PUT_BE16(wpsie + wpsielen, config_method); wpsielen += 2; @@ -389,7 +389,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8* raddr, wfdielen = build_provdisc_resp_wfd_ie(pwdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -409,7 +409,7 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 _adapter *padapter = pwdinfo->padapter; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - unsigned char category = RTW_WLAN_CATEGORY_P2P;//P2P action frame + unsigned char category = RTW_WLAN_CATEGORY_P2P;/* P2P action frame */ __be32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_PRESENCE_RESPONSE; u8 p2pie[ MAX_P2P_IE_LEN] = { 0x00 }; @@ -423,7 +423,7 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -446,29 +446,29 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); - //Build P2P action frame header + /* Build P2P action frame header */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 4, (unsigned char *) &(p2poui), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(oui_subtype), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(dialogToken), &(pattrib->pktlen)); - //Add P2P IE header - // P2P OUI + /* Add P2P IE header */ + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - //Add Status attribute in P2P IE + /* Add Status attribute in P2P IE */ p2pielen += rtw_set_p2p_attr_content(&p2pie[p2pielen], P2P_ATTR_STATUS, 1, &status); - //Add NoA attribute in P2P IE - noa_attr_content[0] = 0x1;//index - noa_attr_content[1] = 0x0;//CTWindow and OppPS Parameters + /* Add NoA attribute in P2P IE */ + noa_attr_content[0] = 0x1;/* index */ + noa_attr_content[1] = 0x0;/* CTWindow and OppPS Parameters */ - //todo: Notice of Absence Descriptor(s) + /* todo: Notice of Absence Descriptor(s) */ p2pielen += rtw_set_p2p_attr_content(&p2pie[p2pielen], P2P_ATTR_NOA, 2, noa_attr_content); @@ -490,27 +490,27 @@ u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 len=0, p2pielen = 0; __le16 le_tmp; - // P2P OUI + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - // According to the P2P Specification, the beacon frame should contain 3 P2P attributes - // 1. P2P Capability - // 2. P2P Device ID - // 3. Notice of Absence ( NOA ) + /* According to the P2P Specification, the beacon frame should contain 3 P2P attributes */ + /* 1. P2P Capability */ + /* 2. P2P Device ID */ + /* 3. Notice of Absence ( NOA ) */ - // P2P Capability ATTR - // Type: - // Length: - // Value: - // Device Capability Bitmap, 1 byte - // Be able to participate in additional P2P Groups and - // support the P2P Invitation Procedure - // Group Capability Bitmap, 1 byte + /* P2P Capability ATTR */ + /* Type: */ + /* Length: */ + /* Value: */ + /* Device Capability Bitmap, 1 byte */ + /* Be able to participate in additional P2P Groups and */ + /* support the P2P Invitation Procedure */ + /* Group Capability Bitmap, 1 byte */ capability = P2P_DEVCAP_INVITATION_PROC|P2P_DEVCAP_CLIENT_DISCOVERABILITY; capability |= ((P2P_GRPCAP_GO | P2P_GRPCAP_INTRABSS) << 8); if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_PROVISIONING_ING)) @@ -519,13 +519,13 @@ u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) le_tmp = cpu_to_le16(capability); p2pielen += rtw_set_p2p_attr_content(&p2pie[p2pielen], P2P_ATTR_CAPABILITY, 2, (u8*)&le_tmp); - // P2P Device ID ATTR + /* P2P Device ID ATTR */ p2pielen += rtw_set_p2p_attr_content(&p2pie[p2pielen], P2P_ATTR_DEVICE_ID, ETH_ALEN, pwdinfo->device_addr); - // Notice of Absence ATTR - // Type: - // Length: - // Value: + /* Notice of Absence ATTR */ + /* Type: */ + /* Length: */ + /* Value: */ pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len); return len; @@ -540,77 +540,77 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110812 - // According to the WFD Specification, the beacon frame should contain 4 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID - // 3. Coupled Sink Information + /* Commented by Albert 20110812 */ + /* According to the WFD Specification, the beacon frame should contain 4 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID */ + /* 3. Coupled Sink Information */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information + /* Value1: */ + /* WFD device information */ if ( P2P_ROLE_GO == pwdinfo->role ) { if ( is_any_client_associated( pwdinfo->padapter ) ) { - // WFD primary sink + WiFi Direct mode + WSD (WFD Service Discovery) + /* WFD primary sink + WiFi Direct mode + WSD (WFD Service Discovery) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD ); } else { - // WFD primary sink + available for WFD session + WiFi Direct mode + WSD (WFD Service Discovery) + /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD (WFD Service Discovery) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); } } else { - // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); } wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -622,20 +622,20 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdielen += ETH_ALEN; - // Coupled Sink Information ATTR - // Type: + /* Coupled Sink Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0007); wfdielen += 2; - // Value: - // Coupled Sink Status bitmap - // Not coupled/available for Coupling + /* Value: */ + /* Coupled Sink Status bitmap */ + /* Not coupled/available for Coupling */ wfdie[ wfdielen++ ] = 0; - // MAC Addr. + /* MAC Addr. */ wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; @@ -657,35 +657,35 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110812 - // According to the WFD Specification, the probe request frame should contain 4 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID - // 3. Coupled Sink Information + /* Commented by Albert 20110812 */ + /* According to the WFD Specification, the probe request frame should contain 4 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID */ + /* 3. Coupled Sink Information */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information + /* Value1: */ + /* WFD device information */ if ( 1 == pwdinfo->wfd_tdls_enable ) { - // WFD primary sink + available for WFD session + WiFi TDLS mode + WSC ( WFD Service Discovery ) + /* WFD primary sink + available for WFD session + WiFi TDLS mode + WSC ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD | @@ -693,7 +693,7 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } else { - // WFD primary sink + available for WFD session + WiFi Direct mode + WSC ( WFD Service Discovery ) + /* WFD primary sink + available for WFD session + WiFi Direct mode + WSC ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); @@ -701,29 +701,29 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -735,20 +735,20 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdielen += ETH_ALEN; - // Coupled Sink Information ATTR - // Type: + /* Coupled Sink Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0007); wfdielen += 2; - // Value: - // Coupled Sink Status bitmap - // Not coupled/available for Coupling + /* Value: */ + /* Coupled Sink Status bitmap */ + /* Not coupled/available for Coupling */ wfdie[ wfdielen++ ] = 0; - // MAC Addr. + /* MAC Addr. */ wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; @@ -770,33 +770,33 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110812 - // According to the WFD Specification, the probe response frame should contain 4 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID - // 3. Coupled Sink Information - // 4. WFD Session Information + /* Commented by Albert 20110812 */ + /* According to the WFD Specification, the probe response frame should contain 4 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID */ + /* 3. Coupled Sink Information */ + /* 4. WFD Session Information */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information - // WFD primary sink + available for WFD session + WiFi Direct mode + /* Value1: */ + /* WFD device information */ + /* WFD primary sink + available for WFD session + WiFi Direct mode */ if ( true == pwdinfo->session_available ) { @@ -806,12 +806,12 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel { if ( pwdinfo->wfd_tdls_enable ) { - // WFD primary sink + TDLS mode + WSD ( WFD Service Discovery ) + /* WFD primary sink + TDLS mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_WSD | WFD_DEVINFO_PC_TDLS | WFD_DEVINFO_HDCP_SUPPORT); } else { - // WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_WSD | WFD_DEVINFO_HDCP_SUPPORT); } } @@ -819,12 +819,12 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel { if ( pwdinfo->wfd_tdls_enable ) { - // WFD primary sink + available for WFD session + TDLS mode + WSD ( WFD Service Discovery ) + /* WFD primary sink + available for WFD session + TDLS mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD | WFD_DEVINFO_PC_TDLS | WFD_DEVINFO_HDCP_SUPPORT); } else { - // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD | WFD_DEVINFO_HDCP_SUPPORT); } } @@ -833,13 +833,13 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel { if ( pwdinfo->wfd_tdls_enable ) { - // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD | WFD_DEVINFO_PC_TDLS | WFD_DEVINFO_HDCP_SUPPORT); } else { - // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD | WFD_DEVINFO_HDCP_SUPPORT); } } @@ -859,29 +859,29 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -893,20 +893,20 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel wfdielen += ETH_ALEN; - // Coupled Sink Information ATTR - // Type: + /* Coupled Sink Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0007); wfdielen += 2; - // Value: - // Coupled Sink Status bitmap - // Not coupled/available for Coupling + /* Value: */ + /* Coupled Sink Status bitmap */ + /* Not coupled/available for Coupling */ wfdie[ wfdielen++ ] = 0; - // MAC Addr. + /* MAC Addr. */ wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; @@ -916,40 +916,40 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { - // WFD Session Information ATTR - // Type: + /* WFD Session Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_SESSION_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0000); wfdielen += 2; - // Todo: to add the list of WFD device info descriptor in WFD group. + /* Todo: to add the list of WFD device info descriptor in WFD group. */ } #ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_TDLS if ( ( tunneled == 0 ) && ( padapter->pbuddy_adapter->wdinfo.wfd_tdls_enable == 1 ) ) { - // Alternative MAC Address ATTR - // Type: + /* Alternative MAC Address ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ALTER_MAC; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, ETH_ALEN ); wfdielen += 2; - // Value: - // Alternative MAC Address + /* Value: */ + /* Alternative MAC Address */ _rtw_memcpy( wfdie + wfdielen, &padapter->pbuddy_adapter->eeprompriv.mac_addr[ 0 ], ETH_ALEN ); - // This mac address is used to make the WFD session when TDLS is enable. + /* This mac address is used to make the WFD session when TDLS is enable. */ wfdielen += ETH_ALEN; } -#endif // CONFIG_TDLS -#endif // CONFIG_CONCURRENT_MODE +#endif /* CONFIG_TDLS */ +#endif /* CONFIG_CONCURRENT_MODE */ pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); @@ -965,7 +965,7 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) struct mlme_priv *pmlmepriv = NULL; struct wifi_display_info *pwfd_info = NULL; - // WFD OUI + /* WFD OUI */ if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE)) { return 0; @@ -979,53 +979,53 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110812 - // According to the WFD Specification, the probe request frame should contain 4 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID - // 3. Coupled Sink Information + /* Commented by Albert 20110812 */ + /* According to the WFD Specification, the probe request frame should contain 4 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID */ + /* 3. Coupled Sink Information */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information - // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* Value1: */ + /* WFD device information */ + /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1037,20 +1037,20 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdielen += ETH_ALEN; - // Coupled Sink Information ATTR - // Type: + /* Coupled Sink Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0007); wfdielen += 2; - // Value: - // Coupled Sink Status bitmap - // Not coupled/available for Coupling + /* Value: */ + /* Coupled Sink Status bitmap */ + /* Not coupled/available for Coupling */ wfdie[ wfdielen++ ] = 0; - // MAC Addr. + /* MAC Addr. */ wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; @@ -1072,58 +1072,58 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110812 - // According to the WFD Specification, the probe request frame should contain 4 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID - // 3. Coupled Sink Information + /* Commented by Albert 20110812 */ + /* According to the WFD Specification, the probe request frame should contain 4 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID */ + /* 3. Coupled Sink Information */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information - // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* Value1: */ + /* WFD device information */ + /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1135,20 +1135,20 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdielen += ETH_ALEN; - // Coupled Sink Information ATTR - // Type: + /* Coupled Sink Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0007); wfdielen += 2; - // Value: - // Coupled Sink Status bitmap - // Not coupled/available for Coupling + /* Value: */ + /* Coupled Sink Status bitmap */ + /* Not coupled/available for Coupling */ wfdie[ wfdielen++ ] = 0; - // MAC Addr. + /* MAC Addr. */ wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; @@ -1170,58 +1170,58 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110825 - // According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID ( Optional ) - // 3. Local IP Adress ( Optional ) + /* Commented by Albert 20110825 */ + /* According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID ( Optional ) */ + /* 3. Local IP Adress ( Optional ) */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information - // WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + WFD Session Available + /* Value1: */ + /* WFD device information */ + /* WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + WFD Session Available */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_SESSION_AVAIL); wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1233,20 +1233,20 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdielen += ETH_ALEN; - // Coupled Sink Information ATTR - // Type: + /* Coupled Sink Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0007); wfdielen += 2; - // Value: - // Coupled Sink Status bitmap - // Not coupled/available for Coupling + /* Value: */ + /* Coupled Sink Status bitmap */ + /* Not coupled/available for Coupling */ wfdie[ wfdielen++ ] = 0; - // MAC Addr. + /* MAC Addr. */ wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; @@ -1268,58 +1268,58 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110825 - // According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID ( Optional ) - // 3. Local IP Adress ( Optional ) + /* Commented by Albert 20110825 */ + /* According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID ( Optional ) */ + /* 3. Local IP Adress ( Optional ) */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information - // WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + WFD Session Available + /* Value1: */ + /* WFD device information */ + /* WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + WFD Session Available */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_SESSION_AVAIL); wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1331,20 +1331,20 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdielen += ETH_ALEN; - // Coupled Sink Information ATTR - // Type: + /* Coupled Sink Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0007); wfdielen += 2; - // Value: - // Coupled Sink Status bitmap - // Not coupled/available for Coupling + /* Value: */ + /* Coupled Sink Status bitmap */ + /* Not coupled/available for Coupling */ wfdie[ wfdielen++ ] = 0; - // MAC Addr. + /* MAC Addr. */ wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; @@ -1367,58 +1367,58 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110825 - // According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID ( Optional ) - // 3. Local IP Adress ( Optional ) + /* Commented by Albert 20110825 */ + /* According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID ( Optional ) */ + /* 3. Local IP Adress ( Optional ) */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information - // WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + WFD Session Available + /* Value1: */ + /* WFD device information */ + /* WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + WFD Session Available */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_SESSION_AVAIL); wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1430,20 +1430,20 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdielen += ETH_ALEN; - // Coupled Sink Information ATTR - // Type: + /* Coupled Sink Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0007); wfdielen += 2; - // Value: - // Coupled Sink Status bitmap - // Not coupled/available for Coupling + /* Value: */ + /* Coupled Sink Status bitmap */ + /* Not coupled/available for Coupling */ wfdie[ wfdielen++ ] = 0; - // MAC Addr. + /* MAC Addr. */ wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; @@ -1466,58 +1466,58 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110825 - // According to the WFD Specification, the provision discovery request frame should contain 3 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID ( Optional ) - // 3. Local IP Adress ( Optional ) + /* Commented by Albert 20110825 */ + /* According to the WFD Specification, the provision discovery request frame should contain 3 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID ( Optional ) */ + /* 3. Local IP Adress ( Optional ) */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information - // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* Value1: */ + /* WFD device information */ + /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1529,20 +1529,20 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdielen += ETH_ALEN; - // Coupled Sink Information ATTR - // Type: + /* Coupled Sink Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0007); wfdielen += 2; - // Value: - // Coupled Sink Status bitmap - // Not coupled/available for Coupling + /* Value: */ + /* Coupled Sink Status bitmap */ + /* Not coupled/available for Coupling */ wfdie[ wfdielen++ ] = 0; - // MAC Addr. + /* MAC Addr. */ wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; @@ -1552,16 +1552,16 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if ( P2P_ROLE_GO == pwdinfo->role ) { - // WFD Session Information ATTR - // Type: + /* WFD Session Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_SESSION_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0000); wfdielen += 2; - // Todo: to add the list of WFD device info descriptor in WFD group. + /* Todo: to add the list of WFD device info descriptor in WFD group. */ } @@ -1579,58 +1579,58 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110825 - // According to the WFD Specification, the provision discovery request frame should contain 3 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID ( Optional ) - // 3. Local IP Adress ( Optional ) + /* Commented by Albert 20110825 */ + /* According to the WFD Specification, the provision discovery request frame should contain 3 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID ( Optional ) */ + /* 3. Local IP Adress ( Optional ) */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information - // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* Value1: */ + /* WFD device information */ + /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1642,20 +1642,20 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdielen += ETH_ALEN; - // Coupled Sink Information ATTR - // Type: + /* Coupled Sink Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0007); wfdielen += 2; - // Value: - // Coupled Sink Status bitmap - // Not coupled/available for Coupling + /* Value: */ + /* Coupled Sink Status bitmap */ + /* Not coupled/available for Coupling */ wfdie[ wfdielen++ ] = 0; - // MAC Addr. + /* MAC Addr. */ wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; @@ -1665,16 +1665,16 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if ( P2P_ROLE_GO == pwdinfo->role ) { - // WFD Session Information ATTR - // Type: + /* WFD Session Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_SESSION_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0000); wfdielen += 2; - // Todo: to add the list of WFD device info descriptor in WFD group. + /* Todo: to add the list of WFD device info descriptor in WFD group. */ } @@ -1692,58 +1692,58 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110825 - // According to the WFD Specification, the provision discovery request frame should contain 3 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID ( Optional ) - // 3. Local IP Adress ( Optional ) + /* Commented by Albert 20110825 */ + /* According to the WFD Specification, the provision discovery request frame should contain 3 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID ( Optional ) */ + /* 3. Local IP Adress ( Optional ) */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information - // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* Value1: */ + /* WFD device information */ + /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1755,20 +1755,20 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdielen += ETH_ALEN; - // Coupled Sink Information ATTR - // Type: + /* Coupled Sink Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0007); wfdielen += 2; - // Value: - // Coupled Sink Status bitmap - // Not coupled/available for Coupling + /* Value: */ + /* Coupled Sink Status bitmap */ + /* Not coupled/available for Coupling */ wfdie[ wfdielen++ ] = 0; - // MAC Addr. + /* MAC Addr. */ wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; @@ -1791,58 +1791,58 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110825 - // According to the WFD Specification, the provision discovery response frame should contain 3 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID ( Optional ) - // 3. Local IP Adress ( Optional ) + /* Commented by Albert 20110825 */ + /* According to the WFD Specification, the provision discovery response frame should contain 3 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID ( Optional ) */ + /* 3. Local IP Adress ( Optional ) */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information - // WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* Value1: */ + /* WFD device information */ + /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1854,20 +1854,20 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdielen += ETH_ALEN; - // Coupled Sink Information ATTR - // Type: + /* Coupled Sink Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0007); wfdielen += 2; - // Value: - // Coupled Sink Status bitmap - // Not coupled/available for Coupling + /* Value: */ + /* Coupled Sink Status bitmap */ + /* Not coupled/available for Coupling */ wfdie[ wfdielen++ ] = 0; - // MAC Addr. + /* MAC Addr. */ wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; wfdie[ wfdielen++ ] = 0; @@ -1882,7 +1882,7 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { @@ -1890,37 +1890,37 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 len=0, p2pielen = 0; #ifdef CONFIG_INTEL_WIDI u8 zero_array_check[L2SDTA_SERVICE_VE_LEN] = { 0x00 }; -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ - // P2P OUI + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - // Commented by Albert 20100907 - // According to the P2P Specification, the probe response frame should contain 5 P2P attributes - // 1. P2P Capability - // 2. Extended Listen Timing - // 3. Notice of Absence ( NOA ) ( Only GO needs this ) - // 4. Device Info - // 5. Group Info ( Only GO need this ) + /* Commented by Albert 20100907 */ + /* According to the P2P Specification, the probe response frame should contain 5 P2P attributes */ + /* 1. P2P Capability */ + /* 2. Extended Listen Timing */ + /* 3. Notice of Absence ( NOA ) ( Only GO needs this ) */ + /* 4. Device Info */ + /* 5. Group Info ( Only GO need this ) */ - // P2P Capability ATTR - // Type: + /* P2P Capability ATTR */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CAPABILITY; - // Length: - //*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); + /* Length: */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); */ RTW_PUT_LE16(p2pie + p2pielen, 0x0002); p2pielen += 2; - // Value: - // Device Capability Bitmap, 1 byte + /* Value: */ + /* Device Capability Bitmap, 1 byte */ p2pie[ p2pielen++ ] = DMP_P2P_DEVCAP_SUPPORT; - // Group Capability Bitmap, 1 byte + /* Group Capability Bitmap, 1 byte */ if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { p2pie[ p2pielen ] = (P2P_GRPCAP_GO | P2P_GRPCAP_INTRABSS); @@ -1932,89 +1932,89 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } else if ( rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE) ) { - // Group Capability Bitmap, 1 byte + /* Group Capability Bitmap, 1 byte */ if ( pwdinfo->persistent_supported ) p2pie[ p2pielen++ ] = P2P_GRPCAP_PERSISTENT_GROUP | DMP_P2P_GRPCAP_SUPPORT; else p2pie[ p2pielen++ ] = DMP_P2P_GRPCAP_SUPPORT; } - // Extended Listen Timing ATTR - // Type: + /* Extended Listen Timing ATTR */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_EX_LISTEN_TIMING; - // Length: - //*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0004 ); + /* Length: */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0004 ); */ RTW_PUT_LE16(p2pie + p2pielen, 0x0004); p2pielen += 2; - // Value: - // Availability Period - //*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); + /* Value: */ + /* Availability Period */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); */ RTW_PUT_LE16(p2pie + p2pielen, 0xFFFF); p2pielen += 2; - // Availability Interval - //*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); + /* Availability Interval */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); */ RTW_PUT_LE16(p2pie + p2pielen, 0xFFFF); p2pielen += 2; - // Notice of Absence ATTR - // Type: - // Length: - // Value: + /* Notice of Absence ATTR */ + /* Type: */ + /* Length: */ + /* Value: */ if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { - //go_add_noa_attr(pwdinfo); + /* go_add_noa_attr(pwdinfo); */ } - // Device Info ATTR - // Type: + /* Device Info ATTR */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_DEVICE_INFO; - // Length: - // 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) - // + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) - //*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); + /* Length: */ + /* 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */ + /* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); */ #ifdef CONFIG_INTEL_WIDI if ( _rtw_memcmp( pwdinfo->padapter->mlmepriv.sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN ) == false ) { RTW_PUT_LE16(p2pie + p2pielen, 21 + 8 + pwdinfo->device_name_len); } else -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ RTW_PUT_LE16(p2pie + p2pielen, 21 + pwdinfo->device_name_len); p2pielen += 2; - // Value: - // P2P Device Address + /* Value: */ + /* P2P Device Address */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN ); p2pielen += ETH_ALEN; - // Config Method - // This field should be big endian. Noted by P2P specification. - //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->supported_wps_cm ); + /* Config Method */ + /* This field should be big endian. Noted by P2P specification. */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->supported_wps_cm ); */ RTW_PUT_BE16(p2pie + p2pielen, pwdinfo->supported_wps_cm); p2pielen += 2; - // Primary Device Type - // Category ID - //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); + /* Primary Device Type */ + /* Category ID */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); */ RTW_PUT_BE16(p2pie + p2pielen, WPS_PDT_CID_MULIT_MEDIA); p2pielen += 2; - // OUI - //*(u32*) ( p2pie + p2pielen ) = cpu_to_be32( WPSOUI ); + /* OUI */ + /* u32*) ( p2pie + p2pielen ) = cpu_to_be32( WPSOUI ); */ RTW_PUT_BE32(p2pie + p2pielen, WPSOUI); p2pielen += 4; - // Sub Category ID - //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); + /* Sub Category ID */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); */ RTW_PUT_BE16(p2pie + p2pielen, WPS_PDT_SCID_MEDIA_SERVER); p2pielen += 2; - // Number of Secondary Device Types + /* Number of Secondary Device Types */ #ifdef CONFIG_INTEL_WIDI if ( _rtw_memcmp( pwdinfo->padapter->mlmepriv.sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN ) == false ) { @@ -2030,28 +2030,28 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) p2pielen += 2; } else -#endif //CONFIG_INTEL_WIDI - p2pie[ p2pielen++ ] = 0x00; // No Secondary Device Type List +#endif /* CONFIG_INTEL_WIDI */ + p2pie[ p2pielen++ ] = 0x00; /* No Secondary Device Type List */ - // Device Name - // Type: - //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); + /* Device Name */ + /* Type: */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); */ RTW_PUT_BE16(p2pie + p2pielen, WPS_ATTR_DEVICE_NAME); p2pielen += 2; - // Length: - //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->device_name_len ); + /* Length: */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->device_name_len ); */ RTW_PUT_BE16(p2pie + p2pielen, pwdinfo->device_name_len); p2pielen += 2; - // Value: + /* Value: */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_name, pwdinfo->device_name_len ); p2pielen += pwdinfo->device_name_len; - // Group Info ATTR - // Type: - // Length: - // Value: + /* Group Info ATTR */ + /* Type: */ + /* Length: */ + /* Value: */ if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { p2pielen += go_add_group_info_attr(pwdinfo, p2pie + p2pielen); @@ -2070,119 +2070,119 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 u8 p2pie[ MAX_P2P_IE_LEN] = { 0x00 }; u32 len=0, p2pielen = 0; - // P2P OUI + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - // Commented by Albert 20110301 - // According to the P2P Specification, the provision discovery request frame should contain 3 P2P attributes - // 1. P2P Capability - // 2. Device Info - // 3. Group ID ( When joining an operating P2P Group ) + /* Commented by Albert 20110301 */ + /* According to the P2P Specification, the provision discovery request frame should contain 3 P2P attributes */ + /* 1. P2P Capability */ + /* 2. Device Info */ + /* 3. Group ID ( When joining an operating P2P Group ) */ - // P2P Capability ATTR - // Type: + /* P2P Capability ATTR */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_CAPABILITY; - // Length: - //*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); + /* Length: */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); */ RTW_PUT_LE16(p2pie + p2pielen, 0x0002); p2pielen += 2; - // Value: - // Device Capability Bitmap, 1 byte + /* Value: */ + /* Device Capability Bitmap, 1 byte */ p2pie[ p2pielen++ ] = DMP_P2P_DEVCAP_SUPPORT; - // Group Capability Bitmap, 1 byte + /* Group Capability Bitmap, 1 byte */ if ( pwdinfo->persistent_supported ) p2pie[ p2pielen++ ] = P2P_GRPCAP_PERSISTENT_GROUP | DMP_P2P_GRPCAP_SUPPORT; else p2pie[ p2pielen++ ] = DMP_P2P_GRPCAP_SUPPORT; - // Device Info ATTR - // Type: + /* Device Info ATTR */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_DEVICE_INFO; - // Length: - // 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) - // + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) - //*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); + /* Length: */ + /* 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */ + /* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); */ RTW_PUT_LE16(p2pie + p2pielen, 21 + pwdinfo->device_name_len); p2pielen += 2; - // Value: - // P2P Device Address + /* Value: */ + /* P2P Device Address */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN ); p2pielen += ETH_ALEN; - // Config Method - // This field should be big endian. Noted by P2P specification. + /* Config Method */ + /* This field should be big endian. Noted by P2P specification. */ if ( pwdinfo->ui_got_wps_info == P2P_GOT_WPSINFO_PBC ) { - //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_CONFIG_METHOD_PBC ); + /* u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_CONFIG_METHOD_PBC ); */ RTW_PUT_BE16(p2pie + p2pielen, WPS_CONFIG_METHOD_PBC); } else { - //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_CONFIG_METHOD_DISPLAY ); + /* u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_CONFIG_METHOD_DISPLAY ); */ RTW_PUT_BE16(p2pie + p2pielen, WPS_CONFIG_METHOD_DISPLAY); } p2pielen += 2; - // Primary Device Type - // Category ID - //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); + /* Primary Device Type */ + /* Category ID */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); */ RTW_PUT_BE16(p2pie + p2pielen, WPS_PDT_CID_MULIT_MEDIA); p2pielen += 2; - // OUI - //*(u32*) ( p2pie + p2pielen ) = cpu_to_be32( WPSOUI ); + /* OUI */ + /* u32*) ( p2pie + p2pielen ) = cpu_to_be32( WPSOUI ); */ RTW_PUT_BE32(p2pie + p2pielen, WPSOUI); p2pielen += 4; - // Sub Category ID - //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); + /* Sub Category ID */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); */ RTW_PUT_BE16(p2pie + p2pielen, WPS_PDT_SCID_MEDIA_SERVER); p2pielen += 2; - // Number of Secondary Device Types - p2pie[ p2pielen++ ] = 0x00; // No Secondary Device Type List + /* Number of Secondary Device Types */ + p2pie[ p2pielen++ ] = 0x00; /* No Secondary Device Type List */ - // Device Name - // Type: - //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); + /* Device Name */ + /* Type: */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); */ RTW_PUT_BE16(p2pie + p2pielen, WPS_ATTR_DEVICE_NAME); p2pielen += 2; - // Length: - //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->device_name_len ); + /* Length: */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_be16( pwdinfo->device_name_len ); */ RTW_PUT_BE16(p2pie + p2pielen, pwdinfo->device_name_len); p2pielen += 2; - // Value: + /* Value: */ _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_name, pwdinfo->device_name_len ); p2pielen += pwdinfo->device_name_len; if ( rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT) ) { - // Added by Albert 2011/05/19 - // In this case, the pdev_raddr is the device address of the group owner. + /* Added by Albert 2011/05/19 */ + /* In this case, the pdev_raddr is the device address of the group owner. */ - // P2P Group ID ATTR - // Type: + /* P2P Group ID ATTR */ + /* Type: */ p2pie[ p2pielen++ ] = P2P_ATTR_GROUP_ID; - // Length: - //*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN + ussidlen ); + /* Length: */ + /* u16*) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN + ussidlen ); */ RTW_PUT_LE16(p2pie + p2pielen, ETH_ALEN + ussidlen); p2pielen += 2; - // Value: + /* Value: */ _rtw_memcpy( p2pie + p2pielen, pdev_raddr, ETH_ALEN ); p2pielen += ETH_ALEN; @@ -2204,26 +2204,26 @@ u32 build_assoc_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 status u8 p2pie[ MAX_P2P_IE_LEN] = { 0x00 }; u32 len=0, p2pielen = 0; - // P2P OUI + /* P2P OUI */ p2pielen = 0; p2pie[ p2pielen++ ] = 0x50; p2pie[ p2pielen++ ] = 0x6F; p2pie[ p2pielen++ ] = 0x9A; - p2pie[ p2pielen++ ] = 0x09; // WFA P2P v1.0 + p2pie[ p2pielen++ ] = 0x09; /* WFA P2P v1.0 */ - // According to the P2P Specification, the Association response frame should contain 2 P2P attributes - // 1. Status - // 2. Extended Listen Timing (optional) + /* According to the P2P Specification, the Association response frame should contain 2 P2P attributes */ + /* 1. Status */ + /* 2. Extended Listen Timing (optional) */ - // Status ATTR + /* Status ATTR */ p2pielen += rtw_set_p2p_attr_content(&p2pie[p2pielen], P2P_ATTR_STATUS, 1, &status_code); - // Extended Listen Timing ATTR - // Type: - // Length: - // Value: + /* Extended Listen Timing ATTR */ + /* Type: */ + /* Length: */ + /* Value: */ pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len); @@ -2267,39 +2267,39 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l if ( g_rate == 0 ) { - // There is no OFDM rate included in SupportedRates IE of this probe request frame - // The driver should response this probe request. + /* There is no OFDM rate included in SupportedRates IE of this probe request frame */ + /* The driver should response this probe request. */ return ret; } } else { - // rate_cnt > 4 means the SupportRates IE contains the OFDM rate because the count of CCK rates are 4. - // We should proceed the following check for this probe request. + /* rate_cnt > 4 means the SupportRates IE contains the OFDM rate because the count of CCK rates are 4. */ + /* We should proceed the following check for this probe request. */ } - // Added comments by Albert 20100906 - // There are several items we should check here. - // 1. This probe request frame must contain the P2P IE. (Done) - // 2. This probe request frame must contain the wildcard SSID. (Done) - // 3. Wildcard BSSID. (Todo) - // 4. Destination Address. ( Done in mgt_dispatcher function ) - // 5. Requested Device Type in WSC IE. (Todo) - // 6. Device ID attribute in P2P IE. (Todo) + /* Added comments by Albert 20100906 */ + /* There are several items we should check here. */ + /* 1. This probe request frame must contain the P2P IE. (Done) */ + /* 2. This probe request frame must contain the wildcard SSID. (Done) */ + /* 3. Wildcard BSSID. (Todo) */ + /* 4. Destination Address. ( Done in mgt_dispatcher function ) */ + /* 5. Requested Device Type in WSC IE. (Todo) */ + /* 6. Device ID attribute in P2P IE. (Todo) */ p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SSID_IE_, (int *)&ssid_len, len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); - ssid_len &= 0xff; // Just last 1 byte is valid for ssid len of the probe request + ssid_len &= 0xff; /* Just last 1 byte is valid for ssid len of the probe request */ if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE) || rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { if ((p2pie=rtw_get_p2p_ie( pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_ , len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_ , NULL, &p2pielen))) { if ( (p != NULL) && _rtw_memcmp( ( void * ) ( p+2 ), ( void * ) pwdinfo->p2p_wildcard_ssid , 7 )) { - //todo: - //Check Requested Device Type attributes in WSC IE. - //Check Device ID attribute in P2P IE + /* todo: */ + /* Check Requested Device Type attributes in WSC IE. */ + /* Check Device ID attribute in P2P IE */ ret = true; } @@ -2310,7 +2310,7 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l } else { - //non -p2p device + /* non -p2p device */ } } @@ -2342,7 +2342,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l { ie_offset = _ASOCREQ_IE_OFFSET_; } - else // WIFI_REASSOCREQ + else /* WIFI_REASSOCREQ */ { ie_offset = _REASOCREQ_IE_OFFSET_; } @@ -2360,17 +2360,17 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l } while ( p2p_ie ) { - //Check P2P Capability ATTR + /* Check P2P Capability ATTR */ if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&le_tmp, (uint*) &attr_contentlen) ) { DBG_88E( "[%s] Got P2P Capability Attr!!\n", __func__ ); cap_attr = le16_to_cpu(le_tmp); psta->dev_cap = cap_attr&0xff; } - //Check Extended Listen Timing ATTR + /* Check Extended Listen Timing ATTR */ - //Check P2P Device Info ATTR + /* Check P2P Device Info ATTR */ if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_INFO, NULL, (uint*)&attr_contentlen)) { DBG_88E( "[%s] Got P2P DEVICE INFO Attr!!\n", __func__ ); pattr_content = rtw_zmalloc(attr_contentlen); @@ -2381,11 +2381,11 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_INFO , pattr_content, (uint*)&attr_contentlen); - _rtw_memcpy(psta->dev_addr, pattr_content, ETH_ALEN);//P2P Device Address + _rtw_memcpy(psta->dev_addr, pattr_content, ETH_ALEN);/* P2P Device Address */ pattr_content += ETH_ALEN; - _rtw_memcpy(&be_tmp, pattr_content, 2);//Config Methods + _rtw_memcpy(&be_tmp, pattr_content, 2);/* Config Methods */ psta->config_methods = be16_to_cpu(be_tmp); pattr_content += 2; @@ -2428,7 +2428,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l } - //Get the next P2P IE + /* Get the next P2P IE */ p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen); } @@ -2473,7 +2473,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le phead = &pstapriv->asoc_list; plist = get_next(phead); - //look up sta asoc_queue + /* look up sta asoc_queue */ while ((rtw_end_of_queue_search(phead, plist)) == false) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); @@ -2484,10 +2484,10 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le _rtw_memcmp(psta->dev_addr, dev_addr, ETH_ALEN)) { - //_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); - //issue GO Discoverability Request + /* _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); */ + /* issue GO Discoverability Request */ issue_group_disc_req(pwdinfo, psta->hwaddr); - //_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); + /* _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); */ status = P2P_STATUS_SUCCESS; @@ -2518,7 +2518,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le } - //issue Device Discoverability Response + /* issue Device Discoverability Response */ issue_p2p_devdisc_resp(pwdinfo, GetAddr2Ptr(pframe), status, dialogToken); @@ -2634,8 +2634,8 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe u32 wfd_ielen = 0; #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; -#endif // CONFIG_TDLS -#endif // CONFIG_WFD +#endif /* CONFIG_TDLS */ +#endif /* CONFIG_WFD */ #ifdef CONFIG_CONCURRENT_MODE _adapter *pbuddy_adapter = pwdinfo->padapter->pbuddy_adapter; struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo; @@ -2645,9 +2645,9 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe if ( (wpsie=rtw_get_wps_ie( pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &wps_ielen)) ) { - // Commented by Kurt 20120113 - // If some device wants to do p2p handshake without sending prov_disc_req - // We have to get peer_req_cm from here. + /* Commented by Kurt 20120113 */ + /* If some device wants to do p2p handshake without sending prov_disc_req */ + /* We have to get peer_req_cm from here. */ if (_rtw_memcmp( pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "000", 3) ) { rtw_get_wps_attr_content(wpsie, wps_ielen, WPS_ATTR_DEVICE_PWID, (u8 *)&be_tmp, &wps_devicepassword_id_len); wps_devicepassword_id = be16_to_cpu(be_tmp); @@ -2697,29 +2697,29 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe u8 ch_num_inclusioned = 0; #if defined(CONFIG_WFD) && defined(CONFIG_TDLS) u16 cap_attr; -#endif //defined(CONFIG_WFD) && defined(CONFIG_TDLS) +#endif /* defined(CONFIG_WFD) && defined(CONFIG_TDLS) */ __le16 le_tmp; rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_ING); - //Check P2P Capability ATTR + /* Check P2P Capability ATTR */ if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&le_tmp, (uint*)&attr_contentlen) ) { #if defined(CONFIG_WFD) && defined(CONFIG_TDLS) cap_attr = le16_to_cpu(le_tmp); if (!(cap_attr & P2P_GRPCAP_INTRABSS) ) ptdlsinfo->ap_prohibited = true; -#endif //defined(CONFIG_WFD) && defined(CONFIG_TDLS) +#endif /* defined(CONFIG_WFD) && defined(CONFIG_TDLS) */ } if ( rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GO_INTENT , &attr_content, &attr_contentlen) ) { DBG_88E( "[%s] GO Intent = %d, tie = %d\n", __func__, attr_content >> 1, attr_content & 0x01 ); - pwdinfo->peer_intent = attr_content; // include both intent and tie breaker values. + pwdinfo->peer_intent = attr_content; /* include both intent and tie breaker values. */ if ( pwdinfo->intent == ( pwdinfo->peer_intent >> 1 ) ) { - // Try to match the tie breaker value + /* Try to match the tie breaker value */ if ( pwdinfo->intent == P2P_MAX_INTENT ) { rtw_p2p_set_role(pwdinfo, P2P_ROLE_DEVICE); @@ -2748,7 +2748,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { - // Store the group id information. + /* Store the group id information. */ _rtw_memcpy( pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN ); _rtw_memcpy( pwdinfo->groupid_info.ssid, pwdinfo->nego_ssid, pwdinfo->nego_ssidlen ); } @@ -2791,7 +2791,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe break; } else -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ { u8 operatingch_info[5] = { 0x00 }, peer_operating_ch = 0; attr_contentlen = 0; @@ -2812,7 +2812,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe } else { - // Take first channel of ch_list_inclusioned as operating channel + /* Take first channel of ch_list_inclusioned as operating channel */ pwdinfo->operating_channel = ch_list_inclusioned[0]; DBG_88E( "[%s] Change op ch to %02x\n", __func__, pwdinfo->operating_channel); } @@ -2822,13 +2822,13 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe } } - //Get the next P2P IE + /* Get the next P2P IE */ p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen); } #ifdef CONFIG_WFD - // Added by Albert 20110823 - // Try to get the TCP port information when receiving the negotiation request. + /* Added by Albert 20110823 */ + /* Try to get the TCP port information when receiving the negotiation request. */ if ( rtw_get_wfd_ie( pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, wfd_ie, &wfd_ielen ) ) { u8 attr_content[ 10 ] = { 0x00 }; @@ -2842,7 +2842,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe DBG_88E( "[%s] Peer PORT NUM = %d\n", __func__, pwdinfo->wfd_info->peer_rtsp_ctrlport ); } } -#endif // CONFIG_WFD +#endif /* CONFIG_WFD */ return( result ); } @@ -2860,13 +2860,13 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram u32 wfd_ielen = 0; #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; -#endif // CONFIG_TDLS -#endif // CONFIG_WFD +#endif /* CONFIG_TDLS */ +#endif /* CONFIG_WFD */ ies = pframe + _PUBLIC_ACTION_IE_OFFSET_; ies_len = len - _PUBLIC_ACTION_IE_OFFSET_; - // Be able to know which one is the P2P GO and which one is P2P client. + /* Be able to know which one is the P2P GO and which one is P2P client. */ if ( rtw_get_wps_ie( ies, ies_len, NULL, &wps_ielen) ) { @@ -2897,28 +2897,28 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram u8 groupid[ 38 ]; #ifdef CONFIG_TDLS u16 cap_attr; -#endif // CONFIG_TDLS +#endif /* CONFIG_TDLS */ u8 peer_ch_list[50] = { 0x00 }; u8 peer_ch_num = 0; u8 ch_list_inclusioned[50] = { 0x00 }; u8 ch_num_inclusioned = 0; __le16 le_tmp; - while (p2p_ie) { // Found the P2P IE. - //Check P2P Capability ATTR + while (p2p_ie) { /* Found the P2P IE. */ + /* Check P2P Capability ATTR */ if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&le_tmp, (uint*)&attr_contentlen) ) { #ifdef CONFIG_TDLS cap_attr = le16_to_cpu(le_tmp); if (!(cap_attr & P2P_GRPCAP_INTRABSS) ) ptdlsinfo->ap_prohibited = true; -#endif // CONFIG_TDLS +#endif /* CONFIG_TDLS */ } rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, &attr_content, &attr_contentlen); if ( attr_contentlen == 1 ) { DBG_88E( "[%s] Status = %d\n", __func__, attr_content ); if ( attr_content == P2P_STATUS_SUCCESS ) { - // Do nothing. + /* Do nothing. */ } else { if ( P2P_STATUS_FAIL_INFO_UNAVAILABLE == attr_content ) { rtw_p2p_set_state(pwdinfo, P2P_STATE_RX_INFOR_NOREADY); @@ -2931,7 +2931,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram } } - // Try to get the peer's interface address + /* Try to get the peer's interface address */ attr_contentlen = 0; if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_INTENTED_IF_ADDR, pwdinfo->p2p_peer_interface_addr, &attr_contentlen ) ) { @@ -2941,17 +2941,17 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram } } - // Try to get the peer's intent and tie breaker value. + /* Try to get the peer's intent and tie breaker value. */ attr_content = 0x00; attr_contentlen = 0; if ( rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GO_INTENT , &attr_content, &attr_contentlen) ) { DBG_88E( "[%s] GO Intent = %d, tie = %d\n", __func__, attr_content >> 1, attr_content & 0x01 ); - pwdinfo->peer_intent = attr_content; // include both intent and tie breaker values. + pwdinfo->peer_intent = attr_content; /* include both intent and tie breaker values. */ if ( pwdinfo->intent == ( pwdinfo->peer_intent >> 1 ) ) { - // Try to match the tie breaker value + /* Try to match the tie breaker value */ if ( pwdinfo->intent == P2P_MAX_INTENT ) { rtw_p2p_set_role(pwdinfo, P2P_ROLE_DEVICE); @@ -2987,14 +2987,14 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { - // Store the group id information. + /* Store the group id information. */ _rtw_memcpy( pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN ); _rtw_memcpy( pwdinfo->groupid_info.ssid, pwdinfo->nego_ssid, pwdinfo->nego_ssidlen ); } } - // Try to get the operation channel information + /* Try to get the operation channel information */ attr_contentlen = 0; if ( rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, operatingch_info, &attr_contentlen)) @@ -3003,7 +3003,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram pwdinfo->peer_operating_ch = operatingch_info[4]; } - // Try to get the channel list information + /* Try to get the channel list information */ if ( rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, pwdinfo->channel_list_attr, &pwdinfo->channel_list_attr_len ) ) { DBG_88E( "[%s] channel list attribute found, len = %d\n", __func__, pwdinfo->channel_list_attr_len ); @@ -3033,7 +3033,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram break; } else -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ { u8 operatingch_info[5] = { 0x00 }, peer_operating_ch = 0; attr_contentlen = 0; @@ -3054,7 +3054,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram } else { - // Take first channel of ch_list_inclusioned as operating channel + /* Take first channel of ch_list_inclusioned as operating channel */ pwdinfo->operating_channel = ch_list_inclusioned[0]; DBG_88E( "[%s] Change op ch to %02x\n", __func__, pwdinfo->operating_channel); } @@ -3069,7 +3069,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram DBG_88E( "[%s] channel list attribute not found!\n", __func__); } - // Try to get the group id information if peer is GO + /* Try to get the group id information if peer is GO */ attr_contentlen = 0; _rtw_memset( groupid, 0x00, 38 ); if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen) ) @@ -3078,15 +3078,15 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram _rtw_memcpy( pwdinfo->groupid_info.ssid, &groupid[6], attr_contentlen - ETH_ALEN ); } - //Get the next P2P IE + /* Get the next P2P IE */ p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen); } } #ifdef CONFIG_WFD - // Added by Albert 20111122 - // Try to get the TCP port information when receiving the negotiation response. + /* Added by Albert 20111122 */ + /* Try to get the TCP port information when receiving the negotiation response. */ if ( rtw_get_wfd_ie( pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, wfd_ie, &wfd_ielen ) ) { u8 attr_content[ 10 ] = { 0x00 }; @@ -3100,7 +3100,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram DBG_88E( "[%s] Peer PORT NUM = %d\n", __func__, pwdinfo->wfd_info->peer_rtsp_ctrlport ); } } -#endif // CONFIG_WFD +#endif /* CONFIG_WFD */ return( result ); @@ -3117,7 +3117,7 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf ies_len = len - _PUBLIC_ACTION_IE_OFFSET_; p2p_ie = rtw_get_p2p_ie( ies, ies_len, NULL, &p2p_ielen ); - while ( p2p_ie ) // Found the P2P IE. + while ( p2p_ie ) /* Found the P2P IE. */ { u8 attr_content = 0x00, operatingch_info[5] = { 0x00 }; u8 groupid[ 38 ] = { 0x00 }; @@ -3136,8 +3136,8 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf _cancel_timer( &pwdinfo->restore_p2p_state_timer, &bcancelled ); - // Commented by Albert 20100911 - // Todo: Need to handle the case which both Intents are the same. + /* Commented by Albert 20100911 */ + /* Todo: Need to handle the case which both Intents are the same. */ rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_OK); rtw_p2p_set_pre_state(pwdinfo, P2P_STATE_GONEGO_OK); if ( ( pwdinfo->intent ) > ( pwdinfo->peer_intent >> 1 ) ) @@ -3150,7 +3150,7 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf } else { - // Have to compare the Tie Breaker + /* Have to compare the Tie Breaker */ if ( pwdinfo->peer_intent & 0x01 ) { rtw_p2p_set_role(pwdinfo, P2P_ROLE_CLIENT); @@ -3164,7 +3164,7 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf #ifdef CONFIG_CONCURRENT_MODE if ( check_buddy_fwstate(pwdinfo->padapter , _FW_LINKED ) ) { - // Switch back to the AP channel soon. + /* Switch back to the AP channel soon. */ _set_timer( &pwdinfo->ap_p2p_switch_timer, 100 ); } #endif @@ -3177,7 +3177,7 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf } } - // Try to get the group id information + /* Try to get the group id information */ attr_contentlen = 0; _rtw_memset( groupid, 0x00, 38 ); if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen) ) @@ -3194,7 +3194,7 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf pwdinfo->peer_operating_ch = operatingch_info[4]; } - //Get the next P2P IE + /* Get the next P2P IE */ p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen); } @@ -3212,7 +3212,7 @@ u8 process_p2p_presence_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le dialogToken = frame_body[6]; - //todo: check NoA attribute + /* todo: check NoA attribute */ issue_p2p_presence_resp(pwdinfo, GetAddr2Ptr(pframe), status, dialogToken); @@ -3278,8 +3278,8 @@ _func_enter_; #ifdef CONFIG_CONCURRENT_MODE p2p_concurrent_handler( padapter ); #else - // In the P2P client mode, the driver should not switch back to its listen channel - // because this P2P client should stay at the operating channel of P2P GO. + /* In the P2P client mode, the driver should not switch back to its listen channel */ + /* because this P2P client should stay at the operating channel of P2P GO. */ set_channel_bwmode( padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); #endif } @@ -3332,10 +3332,10 @@ _func_exit_; void p2p_concurrent_handler( _adapter* padapter ) { struct wifidirect_info *pwdinfo = &padapter->wdinfo; - //_adapter *pbuddy_adapter = padapter->pbuddy_adapter; - //struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo; - //struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv; - //struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; + /* _adapter *pbuddy_adapter = padapter->pbuddy_adapter; */ + /* struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo; */ + /* struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv; */ + /* struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; */ u8 val8; _func_enter_; @@ -3353,18 +3353,18 @@ _func_enter_; issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500); -#else //CONFIG_IOCTL_CFG80211 +#else /* CONFIG_IOCTL_CFG80211 */ if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE)) { - // Now, the driver stays on the AP's channel. - // If the pwdinfo->ext_listen_period = 0, that means the P2P listen state is not available on listen channel. + /* Now, the driver stays on the AP's channel. */ + /* If the pwdinfo->ext_listen_period = 0, that means the P2P listen state is not available on listen channel. */ if ( pwdinfo->ext_listen_period > 0 ) { DBG_88E( "[%s] P2P_STATE_IDLE, ext_listen_period = %d\n", __func__, pwdinfo->ext_listen_period ); if ( pbuddy_mlmeext->cur_channel != pwdinfo->listen_channel ) { - // Will switch to listen channel so that need to send the NULL data with PW bit to AP. + /* Will switch to listen channel so that need to send the NULL data with PW bit to AP. */ issue_nulldata(pbuddy_adapter, NULL, 1, 3, 500); set_channel_bwmode(padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); } @@ -3373,7 +3373,7 @@ _func_enter_; val8 = 1; rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); - // Todo: To check the value of pwdinfo->ext_listen_period is equal to 0 or not. + /* Todo: To check the value of pwdinfo->ext_listen_period is equal to 0 or not. */ _set_timer( &pwdinfo->ap_p2p_switch_timer, pwdinfo->ext_listen_period ); } } @@ -3382,13 +3382,13 @@ _func_enter_; ( rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) && pwdinfo->nego_req_info.benable == false ) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_REQ) ) { - // Now, the driver is in the listen state of P2P mode. + /* Now, the driver is in the listen state of P2P mode. */ DBG_88E( "[%s] P2P_STATE_IDLE, ext_listen_interval = %d\n", __func__, pwdinfo->ext_listen_interval ); - // Commented by Albert 2012/11/01 - // If the AP's channel is the same as the listen channel, we should still be in the listen state - // Other P2P device is still able to find this device out even this device is in the AP's channel. - // So, configure this device to be able to receive the probe request frame and set it to listen state. + /* Commented by Albert 2012/11/01 */ + /* If the AP's channel is the same as the listen channel, we should still be in the listen state */ + /* Other P2P device is still able to find this device out even this device is in the AP's channel. */ + /* So, configure this device to be able to receive the probe request frame and set it to listen state. */ if ( pbuddy_mlmeext->cur_channel != pwdinfo->listen_channel ) { set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); @@ -3398,12 +3398,12 @@ _func_enter_; issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500); } - // Todo: To check the value of pwdinfo->ext_listen_interval is equal to 0 or not. + /* Todo: To check the value of pwdinfo->ext_listen_interval is equal to 0 or not. */ _set_timer( &pwdinfo->ap_p2p_switch_timer, pwdinfo->ext_listen_interval ); } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_OK)) { - // The driver had finished the P2P handshake successfully. + /* The driver had finished the P2P handshake successfully. */ val8 = 0; rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); @@ -3435,7 +3435,7 @@ _func_enter_; _set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT ); */ } -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ } else { @@ -3470,7 +3470,7 @@ _func_enter_; pmlmeext->cur_channel = pbuddy_mlmeext->cur_channel; }else -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ if ( pcfg80211_wdinfo->restore_channel != pmlmeext->cur_channel ) { if ( !check_fwstate(&padapter->mlmepriv, _FW_LINKED ) ) @@ -3501,7 +3501,7 @@ static void ro_ch_timer_process (void *FunctionContext) _adapter *adapter = (_adapter *)FunctionContext; struct rtw_wdev_priv *pwdev_priv = wdev_to_priv(adapter->rtw_wdev); - //printk("%s\n", __func__); + /* printk("%s\n", __func__); */ #ifdef CONFIG_CONCURRENT_MODE ATOMIC_SET(&pwdev_priv->ro_ch_to, 1); @@ -3528,7 +3528,7 @@ static void rtw_cfg80211_adjust_p2pie_channel(_adapter *padapter, const u8 *fram u32 attr_contentlen = 0; u8 *pattr = NULL; - //Check P2P_ATTR_CH_LIST + /* Check P2P_ATTR_CH_LIST */ if ((pattr=rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, (uint*)&attr_contentlen))!=NULL) { int i; @@ -3542,22 +3542,22 @@ static void rtw_cfg80211_adjust_p2pie_channel(_adapter *padapter, const u8 *fram num_of_ch = *(pattr_temp+1); for (i=0; icur_channel;//forcing to the same channel + *(pattr_temp+2+i) = pbuddy_mlmeext->cur_channel;/* forcing to the same channel */ pattr_temp += (2+num_of_ch); attr_contentlen -= (2+num_of_ch); } } - //Check P2P_ATTR_OPERATING_CH + /* Check P2P_ATTR_OPERATING_CH */ attr_contentlen = 0; pattr = NULL; if ((pattr = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, (uint*)&attr_contentlen))!=NULL) { - *(pattr+4) = pbuddy_mlmeext->cur_channel;//forcing to the same channel + *(pattr+4) = pbuddy_mlmeext->cur_channel;/* forcing to the same channel */ } - //Get the next P2P IE + /* Get the next P2P IE */ p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen); } @@ -3585,7 +3585,7 @@ void rtw_append_wfd_ie(_adapter *padapter, u8 *buf, u32* len) { OUI_Subtype = frame_body[6]; dialogToken = frame_body[7]; - switch ( OUI_Subtype )//OUI Subtype + switch ( OUI_Subtype )/* OUI Subtype */ { case P2P_GO_NEGO_REQ: { @@ -3675,7 +3675,7 @@ void rtw_append_wfd_ie(_adapter *padapter, u8 *buf, u32* len) else { DBG_88E("%s, action frame category=%d\n", __func__, category); - //is_p2p_frame = (-1); + /* is_p2p_frame = (-1); */ } return; @@ -3693,7 +3693,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) frame_body = (unsigned char *)(buf + sizeof(struct rtw_ieee80211_hdr_3addr)); category = frame_body[0]; - //just for check + /* just for check */ if (category == RTW_WLAN_CATEGORY_PUBLIC) { action = frame_body[1]; @@ -3714,7 +3714,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) len-sizeof(struct rtw_ieee80211_hdr_3addr)-_PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen); - switch ( OUI_Subtype )//OUI Subtype + switch ( OUI_Subtype )/* OUI Subtype */ { u8 *cont; uint cont_len; @@ -3723,12 +3723,12 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) if (tx) { -#ifdef CONFIG_DRV_ISSUE_PROV_REQ // IOT FOR S2 +#ifdef CONFIG_DRV_ISSUE_PROV_REQ /* IOT FOR S2 */ if (pwdev_priv->provdisc_req_issued == false) rtw_cfg80211_issue_p2p_provision_request(padapter, buf, len); -#endif //CONFIG_DRV_ISSUE_PROV_REQ +#endif /* CONFIG_DRV_ISSUE_PROV_REQ */ - //pwdev_priv->provdisc_req_issued = false; + /* pwdev_priv->provdisc_req_issued = false; */ #ifdef CONFIG_CONCURRENT_MODE if (check_buddy_fwstate(padapter, _FW_LINKED)) @@ -3840,7 +3840,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) DBG_88E("RTW_%s:P2P_PROVISION_DISC_REQ, dialogToken=%d\n", (tx==true)?"Tx":"Rx", dialogToken); - //if (tx) + /* if (tx) */ { pwdev_priv->provdisc_req_issued = false; @@ -3849,14 +3849,14 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) if (rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, NULL, &contentlen)) { - pwdev_priv->provdisc_req_issued = false;//case: p2p_client join p2p GO + pwdev_priv->provdisc_req_issued = false;/* case: p2p_client join p2p GO */ } else { #ifdef CONFIG_DEBUG_CFG80211 DBG_88E("provdisc_req_issued is true\n"); - #endif //CONFIG_DEBUG_CFG80211 - pwdev_priv->provdisc_req_issued = true;//case: p2p_devices connection before Nego req. + #endif /* CONFIG_DEBUG_CFG80211 */ + pwdev_priv->provdisc_req_issued = true;/* case: p2p_devices connection before Nego req. */ } } @@ -3909,7 +3909,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx) else { DBG_88E("RTW_%s:action frame category=%d\n", (tx==true)?"TX":"RX", category); - //is_p2p_frame = (-1); + /* is_p2p_frame = (-1); */ } return is_p2p_frame; @@ -3923,7 +3923,7 @@ void rtw_init_cfg80211_wifidirect_info( _adapter* padapter) _init_timer( &pcfg80211_wdinfo->remain_on_ch_timer, padapter->pnetdev, ro_ch_timer_process, padapter ); } -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ void p2p_protocol_wk_hdl(_adapter *padapter, int intCmdType) { @@ -4006,7 +4006,7 @@ _func_enter_; ro_ch_handler( padapter ); break; } -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ } @@ -4020,7 +4020,7 @@ void process_p2p_ps_ie(PADAPTER padapter, u8 *IEs, u32 IELength) u32 ies_len; u8 * p2p_ie; u32 p2p_ielen = 0; - u8 noa_attr[MAX_P2P_IE_LEN] = { 0x00 };// NoA length should be n*(13) + 2 + u8 noa_attr[MAX_P2P_IE_LEN] = { 0x00 };/* NoA length should be n*(13) + 2 */ u32 attr_contentlen = 0; struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); @@ -4048,14 +4048,14 @@ _func_enter_; while (p2p_ie) { find_p2p = true; - // Get Notice of Absence IE. + /* Get Notice of Absence IE. */ if (rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_NOA, noa_attr, &attr_contentlen)) { find_p2p_ps = true; noa_index = noa_attr[0]; if ( (pwdinfo->p2p_ps_mode == P2P_PS_NONE) || - (noa_index != pwdinfo->noa_index) )// if index change, driver should reconfigure related setting. + (noa_index != pwdinfo->noa_index) )/* if index change, driver should reconfigure related setting. */ { pwdinfo->noa_index = noa_index; pwdinfo->opp_ps = noa_attr[1] >> 7; @@ -4063,12 +4063,12 @@ _func_enter_; noa_offset = 2; noa_num = 0; - // NoA length should be n*(13) + 2 + /* NoA length should be n*(13) + 2 */ if (attr_contentlen > 2) { while (noa_offset < attr_contentlen) { - //_rtw_memcpy(&wifidirect_info->noa_count[noa_num], &noa_attr[noa_offset], 1); + /* _rtw_memcpy(&wifidirect_info->noa_count[noa_num], &noa_attr[noa_offset], 1); */ pwdinfo->noa_count[noa_num] = noa_attr[noa_offset]; noa_offset += 1; @@ -4089,7 +4089,7 @@ _func_enter_; if ( pwdinfo->opp_ps == 1 ) { pwdinfo->p2p_ps_mode = P2P_PS_CTWINDOW; - // driver should wait LPS for entering CTWindow + /* driver should wait LPS for entering CTWindow */ if (padapter->pwrctrlpriv.bFwCurrentInPSMode == true) { p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 1); @@ -4106,10 +4106,10 @@ _func_enter_; } } - break; // find target, just break. + break; /* find target, just break. */ } - //Get the next P2P IE + /* Get the next P2P IE */ p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen); } @@ -4132,7 +4132,7 @@ void p2p_ps_wk_hdl(_adapter *padapter, u8 p2p_ps_state) _func_enter_; - // Pre action for p2p state + /* Pre action for p2p state */ switch (p2p_ps_state) { case P2P_PS_DISABLE: @@ -4239,7 +4239,7 @@ _func_exit_; return res; } -#endif // CONFIG_P2P_PS +#endif /* CONFIG_P2P_PS */ static void reset_ch_sitesurvey_timer_process (void *FunctionContext) { @@ -4250,7 +4250,7 @@ static void reset_ch_sitesurvey_timer_process (void *FunctionContext) return; DBG_88E( "[%s] In\n", __func__ ); - // Reset the operation channel information + /* Reset the operation channel information */ pwdinfo->rx_invitereq_info.operation_ch[0] = 0; pwdinfo->rx_invitereq_info.scan_op_ch_only = 0; } @@ -4264,7 +4264,7 @@ static void reset_ch_sitesurvey_timer_process2 (void *FunctionContext) return; DBG_88E( "[%s] In\n", __func__ ); - // Reset the operation channel information + /* Reset the operation channel information */ pwdinfo->p2p_info.operation_ch[0] = 0; pwdinfo->p2p_info.scan_op_ch_only = 0; } @@ -4296,11 +4296,11 @@ static void pre_tx_scan_timer_process (void *FunctionContext) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) { - if ( true == pwdinfo->tx_prov_disc_info.benable ) // the provision discovery request frame is trigger to send or not + if ( true == pwdinfo->tx_prov_disc_info.benable ) /* the provision discovery request frame is trigger to send or not */ { p2p_protocol_wk_cmd( adapter, P2P_PRE_TX_PROVDISC_PROCESS_WK ); - //issue_probereq_p2p(adapter, NULL); - //_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT ); + /* issue_probereq_p2p(adapter, NULL); */ + /* _set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT ); */ } } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) @@ -4375,24 +4375,24 @@ int rtw_init_wifi_display_info(_adapter* padapter) int res = _SUCCESS; struct wifi_display_info *pwfd_info = &padapter->wfd_info; - // Used in P2P and TDLS + /* Used in P2P and TDLS */ pwfd_info->rtsp_ctrlport = 554; - pwfd_info->peer_rtsp_ctrlport = 0; // Reset to 0 + pwfd_info->peer_rtsp_ctrlport = 0; /* Reset to 0 */ pwfd_info->wfd_enable = false; pwfd_info->wfd_device_type = WFD_DEVINFO_PSINK; pwfd_info->scan_result_type = SCAN_RESULT_P2P_ONLY; - // Used in P2P + /* Used in P2P */ pwfd_info->peer_session_avail = true; pwfd_info->wfd_pc = false; - // Used in TDLS + /* Used in TDLS */ _rtw_memset( pwfd_info->ip_address, 0x00, 4 ); _rtw_memset( pwfd_info->peer_ip_address, 0x00, 4 ); return res; } -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ void rtw_init_wifidirect_timers(_adapter* padapter) { @@ -4440,11 +4440,11 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) pwdinfo->padapter = padapter; - // 1, 6, 11 are the social channel defined in the WiFi Direct specification. + /* 1, 6, 11 are the social channel defined in the WiFi Direct specification. */ pwdinfo->social_chan[0] = 1; pwdinfo->social_chan[1] = 6; pwdinfo->social_chan[2] = 11; - pwdinfo->social_chan[3] = 0; // channel 0 for scanning ending in site survey function. + pwdinfo->social_chan[3] = 0; /* channel 0 for scanning ending in site survey function. */ #ifdef CONFIG_CONCURRENT_MODE if (pbuddy_adapter) { @@ -4457,14 +4457,14 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) ( ( pbuddy_mlmeext->cur_channel == 1) || ( pbuddy_mlmeext->cur_channel == 6 ) || ( pbuddy_mlmeext->cur_channel == 11 ) ) ) { - // Use the AP's channel as the listen channel - // This will avoid the channel switch between AP's channel and listen channel. + /* Use the AP's channel as the listen channel */ + /* This will avoid the channel switch between AP's channel and listen channel. */ pwdinfo->listen_channel = pbuddy_mlmeext->cur_channel; } else -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ { - // Use the channel 11 as the listen channel + /* Use the channel 11 as the listen channel */ pwdinfo->listen_channel = 11; } @@ -4499,15 +4499,15 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) rtw_p2p_set_pre_state(pwdinfo, P2P_STATE_GONEGO_OK); } -// Use the OFDM rate in the P2P probe response frame. ( 6(B), 9(B), 12, 18, 24, 36, 48, 54 ) - pwdinfo->support_rate[0] = 0x8c; // 6(B) - pwdinfo->support_rate[1] = 0x92; // 9(B) - pwdinfo->support_rate[2] = 0x18; // 12 - pwdinfo->support_rate[3] = 0x24; // 18 - pwdinfo->support_rate[4] = 0x30; // 24 - pwdinfo->support_rate[5] = 0x48; // 36 - pwdinfo->support_rate[6] = 0x60; // 48 - pwdinfo->support_rate[7] = 0x6c; // 54 +/* Use the OFDM rate in the P2P probe response frame. ( 6(B), 9(B), 12, 18, 24, 36, 48, 54 ) */ + pwdinfo->support_rate[0] = 0x8c; /* 6(B) */ + pwdinfo->support_rate[1] = 0x92; /* 9(B) */ + pwdinfo->support_rate[2] = 0x18; /* 12 */ + pwdinfo->support_rate[3] = 0x24; /* 18 */ + pwdinfo->support_rate[4] = 0x30; /* 24 */ + pwdinfo->support_rate[5] = 0x48; /* 36 */ + pwdinfo->support_rate[6] = 0x60; /* 48 */ + pwdinfo->support_rate[7] = 0x6c; /* 54 */ _rtw_memcpy( ( void* ) pwdinfo->p2p_wildcard_ssid, "DIRECT-", 7 ); @@ -4515,7 +4515,7 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) pwdinfo->device_name_len = 0; _rtw_memset( &pwdinfo->invitereq_info, 0x00, sizeof( struct tx_invite_req_info ) ); - pwdinfo->invitereq_info.token = 3; // Token used for P2P invitation request frame. + pwdinfo->invitereq_info.token = 3; /* Token used for P2P invitation request frame. */ _rtw_memset( &pwdinfo->inviteresp_info, 0x00, sizeof( struct tx_invite_resp_info ) ); pwdinfo->inviteresp_info.token = 0; @@ -4526,7 +4526,7 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); pwdinfo->listen_dwell = ( u8 ) (( rtw_get_current_time() % 3 ) + 1); - //DBG_88E( "[%s] listen_dwell time is %d00ms\n", __func__, pwdinfo->listen_dwell ); + /* DBG_88E( "[%s] listen_dwell time is %d00ms\n", __func__, pwdinfo->listen_dwell ); */ _rtw_memset( &pwdinfo->tx_prov_disc_info, 0x00, sizeof( struct tx_provdisc_req_info ) ); pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_NONE; @@ -4545,7 +4545,7 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) pwdinfo->wfd_info = pwfd_info; #else pwdinfo->supported_wps_cm = WPS_CONFIG_METHOD_DISPLAY | WPS_CONFIG_METHOD_PBC | WPS_CONFIG_METHOD_KEYPAD; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ pwdinfo->channel_list_attr_len = 0; _rtw_memset( pwdinfo->channel_list_attr, 0x00, 100 ); @@ -4554,24 +4554,24 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) _rtw_memset( &pwdinfo->groupid_info, 0x00, sizeof( struct group_id_info ) ); #ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_IOCTL_CFG80211 - pwdinfo->ext_listen_interval = 1000; //The interval to be available with legacy AP during p2p0-find/scan - pwdinfo->ext_listen_period = 3000; //The time period to be available for P2P during nego -#else //!CONFIG_IOCTL_CFG80211 - //pwdinfo->ext_listen_interval = 3000; - //pwdinfo->ext_listen_period = 400; + pwdinfo->ext_listen_interval = 1000; /* The interval to be available with legacy AP during p2p0-find/scan */ + pwdinfo->ext_listen_period = 3000; /* The time period to be available for P2P during nego */ +#else /* CONFIG_IOCTL_CFG80211 */ + /* pwdinfo->ext_listen_interval = 3000; */ + /* pwdinfo->ext_listen_period = 400; */ pwdinfo->ext_listen_interval = 1000; pwdinfo->ext_listen_period = 1000; -#endif //!CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ #endif pwdinfo->wfd_tdls_enable = 0; _rtw_memset( pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN ); _rtw_memset( pwdinfo->p2p_peer_device_addr, 0x00, ETH_ALEN ); pwdinfo->rx_invitereq_info.operation_ch[0] = 0; - pwdinfo->rx_invitereq_info.operation_ch[1] = 0; // Used to indicate the scan end in site survey function + pwdinfo->rx_invitereq_info.operation_ch[1] = 0; /* Used to indicate the scan end in site survey function */ pwdinfo->rx_invitereq_info.scan_op_ch_only = 0; pwdinfo->p2p_info.operation_ch[0] = 0; - pwdinfo->p2p_info.operation_ch[1] = 0; // Used to indicate the scan end in site survey function + pwdinfo->p2p_info.operation_ch[1] = 0; /* Used to indicate the scan end in site survey function */ pwdinfo->p2p_info.scan_op_ch_only = 0; } @@ -4646,7 +4646,7 @@ void dbg_rtw_p2p_set_role(struct wifidirect_info *wdinfo, enum P2P_ROLE role, co ); } } -#endif //CONFIG_DBG_P2P +#endif /* CONFIG_DBG_P2P */ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) { @@ -4662,28 +4662,28 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) #ifdef CONFIG_CONCURRENT_MODE _adapter *pbuddy_adapter = padapter->pbuddy_adapter; struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo; - // Commented by Albert 2011/12/30 - // The driver just supports 1 P2P group operation. - // So, this function will do nothing if the buddy adapter had enabled the P2P function. + /* Commented by Albert 2011/12/30 */ + /* The driver just supports 1 P2P group operation. */ + /* So, this function will do nothing if the buddy adapter had enabled the P2P function. */ if (!rtw_p2p_chk_state(pbuddy_wdinfo, P2P_STATE_NONE)) { - // The buddy adapter had enabled the P2P function. + /* The buddy adapter had enabled the P2P function. */ return ret; } -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ - //leave IPS/Autosuspend + /* leave IPS/Autosuspend */ if (_FAIL == rtw_pwr_wakeup(padapter)) { ret = _FAIL; goto exit; } - // Added by Albert 2011/03/22 - // In the P2P mode, the driver should not support the b mode. - // So, the Tx packet shouldn't use the CCK rate + /* Added by Albert 2011/03/22 */ + /* In the P2P mode, the driver should not support the b mode. */ + /* So, the Tx packet shouldn't use the CCK rate */ update_tx_basic_rate(padapter, WIRELESS_11AGN); - //Enable P2P function + /* Enable P2P function */ init_wifidirect_info(padapter, role); rtw_hal_set_odm_var(padapter,HAL_ODM_P2P_STATE,NULL,true); @@ -4699,7 +4699,7 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) goto exit; } - //Disable P2P function + /* Disable P2P function */ if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { _cancel_timer_ex( &pwdinfo->find_phase_timer ); @@ -4722,7 +4722,7 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) rtw_hal_set_odm_var(padapter,HAL_ODM_WIFI_DISPLAY_STATE,NULL,false); #endif - //Restore to initial setting. + /* Restore to initial setting. */ update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode); } @@ -4730,4 +4730,4 @@ exit: return ret; } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index 7e09f1b..dcb177f 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -53,7 +53,7 @@ void ips_enter(_adapter * padapter) pwrpriv->bips_processing = true; - // syn ips_mode with request + /* syn ips_mode with request */ pwrpriv->ips_mode = pwrpriv->ips_mode_req; pwrpriv->ips_enter_cnts++; @@ -149,7 +149,7 @@ static bool rtw_pwr_unassociated_idle(_adapter *adapter) bool ret = false; if (adapter->pwrctrlpriv.ips_deny_time >= rtw_get_current_time()) { - //DBG_88E("%s ips_deny_time\n", __func__); + /* DBG_88E("%s ips_deny_time\n", __func__); */ goto exit; } @@ -200,12 +200,12 @@ void rtw_ps_processor(_adapter*padapter) { #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); #ifdef SUPPORT_HW_RFOFF_DETECTED rt_rf_power_state rfpwrstate; -#endif //SUPPORT_HW_RFOFF_DETECTED +#endif /* SUPPORT_HW_RFOFF_DETECTED */ pwrpriv->ps_processing = true; @@ -213,7 +213,7 @@ void rtw_ps_processor(_adapter*padapter) if (pwrpriv->bips_processing == true) goto exit; - //DBG_88E("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca)); + /* DBG_88E("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca)); */ if (padapter->pwrctrlpriv.bHWPwrPindetect) { #ifdef CONFIG_AUTOSUSPEND @@ -241,7 +241,7 @@ void rtw_ps_processor(_adapter*padapter) } } else - #endif //CONFIG_AUTOSUSPEND + #endif /* CONFIG_AUTOSUSPEND */ { rfpwrstate = RfOnOffDetect(padapter); DBG_88E("@@@@- #2 %s==> rfstate:%s\n",__func__,(rfpwrstate==rf_on)?"rf_on":"rf_off"); @@ -265,7 +265,7 @@ void rtw_ps_processor(_adapter*padapter) } pwrpriv->pwr_state_check_cnts ++; } -#endif //SUPPORT_HW_RFOFF_DETECTED +#endif /* SUPPORT_HW_RFOFF_DETECTED */ if (pwrpriv->ips_mode_req == IPS_NONE #ifdef CONFIG_CONCURRENT_MODE @@ -305,17 +305,17 @@ void rtw_ps_processor(_adapter*padapter) #else padapter->bCardDisableWOHSM = true; autosuspend_enter(padapter); - #endif //if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) + #endif /* if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */ } else if (pwrpriv->bHWPwrPindetect) { } else - #endif //CONFIG_AUTOSUSPEND + #endif /* CONFIG_AUTOSUSPEND */ { #if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) pwrpriv->change_rfpwrstate = rf_off; - #endif //defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) + #endif /* defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */ #ifdef CONFIG_IPS ips_enter(padapter); @@ -368,7 +368,7 @@ _func_enter_; DBG_88E("%s: RPWM timeout, force to set RPWM(0x%02X) again!\n", __func__, pslv); } else -#endif // CONFIG_LPS_RPWM_TIMER +#endif /* CONFIG_LPS_RPWM_TIMER */ { if ( (pwrpriv->rpwm == pslv) #ifdef CONFIG_LPS_LCLK @@ -408,7 +408,7 @@ _func_enter_; rpwm = pslv | pwrpriv->tog; #ifdef CONFIG_LPS_LCLK - // only when from PS_STATE S0/S1 to S2 and higher needs ACK + /* only when from PS_STATE S0/S1 to S2 and higher needs ACK */ if ((pwrpriv->cpwm < PS_STATE_S2) && (pslv >= PS_STATE_S2)) rpwm |= PS_ACK; #endif @@ -420,13 +420,13 @@ _func_enter_; #ifdef CONFIG_LPS_RPWM_TIMER if (rpwm & PS_ACK) _set_timer(&pwrpriv->pwr_rpwm_timer, LPS_RPWM_WAIT_MS); -#endif // CONFIG_LPS_RPWM_TIMER +#endif /* CONFIG_LPS_RPWM_TIMER */ rtw_hal_set_hwreg(padapter, HW_VAR_SET_RPWM, (u8 *)(&rpwm)); pwrpriv->tog += 0x80; #ifdef CONFIG_LPS_LCLK - // No LPS 32K, No Ack + /* No LPS 32K, No Ack */ if (!(rpwm & PS_ACK)) #endif { @@ -485,14 +485,14 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ #ifdef CONFIG_TDLS struct sta_priv *pstapriv = &padapter->stapriv; _irqL irqL; int i, j; _list *plist, *phead; struct sta_info *ptdls_sta; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ _func_enter_; @@ -520,12 +520,12 @@ _func_enter_; _enter_pwrlock(&pwrpriv->lock); #endif - //if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) + /* if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) */ if (ps_mode == PS_MODE_ACTIVE) { #ifdef CONFIG_P2P_PS if (pwdinfo->opp_ps == 0) -#endif //CONFIG_P2P_PS +#endif /* CONFIG_P2P_PS */ { DBG_88E("rtw_set_ps_mode: Leave 802.11 power save\n"); @@ -548,7 +548,7 @@ _func_enter_; } _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ pwrpriv->pwr_mode = ps_mode; rtw_set_rpwm(padapter, PS_STATE_S4); @@ -585,7 +585,7 @@ _func_enter_; } _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ pwrpriv->bFwCurrentInPSMode = true; pwrpriv->pwr_mode = ps_mode; @@ -594,10 +594,10 @@ _func_enter_; rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode)); #ifdef CONFIG_P2P_PS - // Set CTWindow after LPS + /* Set CTWindow after LPS */ if (pwdinfo->opp_ps == 1) p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 0); -#endif //CONFIG_P2P_PS +#endif /* CONFIG_P2P_PS */ #ifdef CONFIG_LPS_LCLK if (pwrpriv->alives == 0) @@ -654,10 +654,10 @@ s32 LPS_RF_ON_check(PADAPTER padapter, u32 delay_ms) return err; } -// -// Description: -// Enter the leisure power save mode. -// +/* */ +/* Description: */ +/* Enter the leisure power save mode. */ +/* */ void LPS_Enter(PADAPTER padapter) { struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; @@ -666,7 +666,7 @@ void LPS_Enter(PADAPTER padapter) _func_enter_; -// DBG_88E("+LeisurePSEnter\n"); +/* DBG_88E("+LeisurePSEnter\n"); */ #ifdef CONFIG_CONCURRENT_MODE if (padapter->iface_type != IFACE_PORT0) @@ -703,14 +703,14 @@ _func_enter_; if (true == pwrpriv->bLeisurePs) { - // Idle for a while if we connect to AP a while ago. - if (pwrpriv->LpsIdleCount >= 2) // 4 Sec + /* Idle for a while if we connect to AP a while ago. */ + if (pwrpriv->LpsIdleCount >= 2) /* 4 Sec */ { if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) { pwrpriv->bpower_saving = true; DBG_88E("%s smart_ps:%d\n", __func__, pwrpriv->smart_ps); - //For Tenda W311R IOT issue + /* For Tenda W311R IOT issue */ rtw_set_ps_mode(padapter, pwrpriv->power_mgnt, pwrpriv->smart_ps, 0); } } @@ -718,15 +718,15 @@ _func_enter_; pwrpriv->LpsIdleCount++; } -// DBG_88E("-LeisurePSEnter\n"); +/* DBG_88E("-LeisurePSEnter\n"); */ _func_exit_; } -// -// Description: -// Leave the leisure power save mode. -// +/* */ +/* Description: */ +/* Leave the leisure power save mode. */ +/* */ void LPS_Leave(PADAPTER padapter) { #define LPS_LEAVE_TIMEOUT_MS 100 @@ -742,7 +742,7 @@ _func_enter_; return; /* Skip power saving for concurrent mode port 1*/ #endif -// DBG_88E("+LeisurePSLeave\n"); +/* DBG_88E("+LeisurePSLeave\n"); */ if (pwrpriv->bLeisurePs) { @@ -757,16 +757,16 @@ _func_enter_; pwrpriv->bpower_saving = false; -// DBG_88E("-LeisurePSLeave\n"); +/* DBG_88E("-LeisurePSLeave\n"); */ _func_exit_; } #endif -// -// Description: Leave all power save mode: LPS, FwLPS, IPS if needed. -// Move code to function by tynli. 2010.03.26. -// +/* */ +/* Description: Leave all power save mode: LPS, FwLPS, IPS if needed. */ +/* Move code to function by tynli. 2010.03.26. */ +/* */ void LeaveAllPowerSaveMode(PADAPTER Adapter) { struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); @@ -775,14 +775,14 @@ void LeaveAllPowerSaveMode(PADAPTER Adapter) _func_enter_; if (check_fwstate(pmlmepriv, _FW_LINKED) == true) - { //connect + { /* connect */ #ifdef CONFIG_LPS_LCLK enqueue = 1; #endif #ifdef CONFIG_P2P_PS p2p_ps_wk_cmd(Adapter, P2P_PS_DISABLE, enqueue); -#endif //CONFIG_P2P_PS +#endif /* CONFIG_P2P_PS */ #ifdef CONFIG_LPS rtw_lps_ctrl_wk_cmd(Adapter, LPS_CTRL_LEAVE, enqueue); @@ -802,7 +802,7 @@ _func_enter_; #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35)) usb_disable_autosuspend(adapter_to_dvobj(Adapter)->pusbdev); #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,34)) - adapter_to_dvobj(Adapter)->pusbdev->autosuspend_disabled = Adapter->bDisableAutosuspend;//autosuspend disabled by the user + adapter_to_dvobj(Adapter)->pusbdev->autosuspend_disabled = Adapter->bDisableAutosuspend;/* autosuspend disabled by the user */ #endif } else @@ -815,7 +815,7 @@ _func_enter_; DBG_88E("======> ips_leave fail.............\n"); } #endif -#endif //CONFIG_PLATFORM_SPRD && CONFIG_RTL8188E +#endif /* CONFIG_PLATFORM_SPRD && CONFIG_RTL8188E */ } } } @@ -896,7 +896,7 @@ _func_enter_; _exit_pwrlock(&pwrpriv->lock); goto exit; } -#endif // CONFIG_LPS_RPWM_TIMER +#endif /* CONFIG_LPS_RPWM_TIMER */ pwrpriv->cpwm = PS_STATE(preportpwrstate->state); pwrpriv->cpwm_tog = preportpwrstate->state & PS_TOGGLE; @@ -925,7 +925,7 @@ static void cpwm_event_callback(struct work_struct *work) _adapter *adapter = container_of(pwrpriv, _adapter, pwrctrlpriv); struct reportpwrstate_parm report; - //DBG_88E("%s\n",__func__); + /* DBG_88E("%s\n",__func__); */ report.state = PS_STATE_S2; cpwm_int_hdl(adapter, &report); @@ -940,7 +940,7 @@ static void rpwmtimeout_workitem_callback(struct work_struct *work) pwrpriv = container_of(work, struct pwrctrl_priv, rpwmtimeoutwi); padapter = container_of(pwrpriv, _adapter, pwrctrlpriv); -// DBG_88E("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); +/* DBG_88E("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); */ _enter_pwrlock(&pwrpriv->lock); if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) @@ -991,7 +991,7 @@ static void pwr_rpwm_timeout_handler(void *FunctionContext) padapter = (PADAPTER)FunctionContext; pwrpriv = &padapter->pwrctrlpriv; -// DBG_88E("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); +/* DBG_88E("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); */ if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) { @@ -1001,7 +1001,7 @@ static void pwr_rpwm_timeout_handler(void *FunctionContext) _set_workitem(&pwrpriv->rpwmtimeoutwi); } -#endif // CONFIG_LPS_RPWM_TIMER +#endif /* CONFIG_LPS_RPWM_TIMER */ __inline static void register_task_alive(struct pwrctrl_priv *pwrctrl, u32 tag) { @@ -1313,7 +1313,7 @@ _func_exit_; #ifdef CONFIG_RESUME_IN_WORKQUEUE static void resume_workitem_callback(struct work_struct *work); -#endif //CONFIG_RESUME_IN_WORKQUEUE +#endif /* CONFIG_RESUME_IN_WORKQUEUE */ void rtw_init_pwrctrl_priv(PADAPTER padapter) { @@ -1347,11 +1347,10 @@ _func_enter_; #endif pwrctrlpriv->LpsIdleCount = 0; - //pwrctrlpriv->FWCtrlPSMode =padapter->registrypriv.power_mgnt;// PS_MODE_MIN; if (padapter->registrypriv.mp_mode == 1) pwrctrlpriv->power_mgnt =PS_MODE_ACTIVE ; else - pwrctrlpriv->power_mgnt =padapter->registrypriv.power_mgnt;// PS_MODE_MIN; + pwrctrlpriv->power_mgnt =padapter->registrypriv.power_mgnt;/* PS_MODE_MIN; */ pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt)?true:false; pwrctrlpriv->bFwCurrentInPSMode = false; @@ -1376,8 +1375,8 @@ _func_enter_; pwrctrlpriv->brpwmtimeout = false; _init_workitem(&pwrctrlpriv->rpwmtimeoutwi, rpwmtimeout_workitem_callback, NULL); _init_timer(&pwrctrlpriv->pwr_rpwm_timer, padapter->pnetdev, pwr_rpwm_timeout_handler, padapter); -#endif // CONFIG_LPS_RPWM_TIMER -#endif // CONFIG_LPS_LCLK +#endif /* CONFIG_LPS_RPWM_TIMER */ +#endif /* CONFIG_LPS_LCLK */ #ifdef PLATFORM_LINUX _init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter); @@ -1386,12 +1385,12 @@ _func_enter_; #ifdef CONFIG_RESUME_IN_WORKQUEUE _init_workitem(&pwrctrlpriv->resume_work, resume_workitem_callback, NULL); pwrctrlpriv->rtw_workqueue = create_singlethread_workqueue("rtw_workqueue"); - #endif //CONFIG_RESUME_IN_WORKQUEUE + #endif /* CONFIG_RESUME_IN_WORKQUEUE */ #if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) pwrctrlpriv->early_suspend.suspend = NULL; rtw_register_early_suspend(pwrctrlpriv); - #endif //CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER + #endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */ _func_exit_; @@ -1405,7 +1404,7 @@ void rtw_free_pwrctrl_priv(PADAPTER adapter) _func_enter_; - //_rtw_memset((unsigned char *)pwrctrlpriv, 0, sizeof(struct pwrctrl_priv)); + /* _rtw_memset((unsigned char *)pwrctrlpriv, 0, sizeof(struct pwrctrl_priv)); */ #ifdef CONFIG_RESUME_IN_WORKQUEUE @@ -1418,7 +1417,7 @@ _func_enter_; #if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) rtw_unregister_early_suspend(pwrctrlpriv); - #endif //CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER + #endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */ _free_pwrlock(&pwrctrlpriv->lock); @@ -1444,7 +1443,7 @@ static void resume_workitem_callback(struct work_struct *work) void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv) { - // accquire system's suspend lock preventing from falliing asleep while resume in workqueue + /* accquire system's suspend lock preventing from falliing asleep while resume in workqueue */ rtw_lock_suspend(); #if 1 @@ -1453,7 +1452,7 @@ void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv) _set_workitem(&pwrpriv->resume_work); #endif } -#endif //CONFIG_RESUME_IN_WORKQUEUE +#endif /* CONFIG_RESUME_IN_WORKQUEUE */ #ifdef CONFIG_HAS_EARLYSUSPEND #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) @@ -1464,7 +1463,7 @@ static void rtw_early_suspend(struct early_suspend *h) struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend); DBG_88E("%s\n",__func__); - //jeff: do nothing but set do_late_resume to false + /* jeff: do nothing but set do_late_resume to false */ pwrpriv->do_late_resume = false; } @@ -1486,7 +1485,7 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv) { DBG_88E("%s\n", __func__); - //jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit + /* jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit */ pwrpriv->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20; pwrpriv->early_suspend.suspend = rtw_early_suspend; pwrpriv->early_suspend.resume = rtw_late_resume; @@ -1507,7 +1506,7 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) pwrpriv->early_suspend.suspend = NULL; pwrpriv->early_suspend.resume = NULL; } -#endif //CONFIG_HAS_EARLYSUSPEND +#endif /* CONFIG_HAS_EARLYSUSPEND */ #ifdef CONFIG_ANDROID_POWER #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) @@ -1518,7 +1517,7 @@ static void rtw_early_suspend(android_early_suspend_t *h) struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend); DBG_88E("%s\n",__func__); - //jeff: do nothing but set do_late_resume to false + /* jeff: do nothing but set do_late_resume to false */ pwrpriv->do_late_resume = false; } @@ -1540,7 +1539,7 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv) { DBG_88E("%s\n", __func__); - //jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit + /* jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit */ pwrpriv->early_suspend.level = ANDROID_EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20; pwrpriv->early_suspend.suspend = rtw_early_suspend; pwrpriv->early_suspend.resume = rtw_late_resume; @@ -1559,7 +1558,7 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) pwrpriv->early_suspend.suspend = NULL; pwrpriv->early_suspend.resume = NULL; } -#endif //CONFIG_ANDROID_POWER +#endif /* CONFIG_ANDROID_POWER */ u8 rtw_interface_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8* val) { @@ -1616,19 +1615,19 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) } } - //System suspend is not allowed to wakeup + /* System suspend is not allowed to wakeup */ if ((pwrpriv->bInternalAutoSuspend == false) && (true == pwrpriv->bInSuspend )){ ret = _FAIL; goto exit; } - //block??? + /* block??? */ if ((pwrpriv->bInternalAutoSuspend == true) && (padapter->net_closed == true)) { ret = _FAIL; goto exit; } - //I think this should be check in IPS, LPS, autosuspend functions... + /* I think this should be check in IPS, LPS, autosuspend functions... */ if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { #if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) @@ -1646,12 +1645,12 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) #endif pwrpriv->autopm_cnt++; } -#endif //#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) +#endif /* if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */ ret = _SUCCESS; goto exit; #if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) } -#endif //#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) +#endif /* if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */ } if (rf_off == pwrpriv->rf_pwrstate ) { @@ -1689,7 +1688,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) } } - //TODO: the following checking need to be merged... + /* TODO: the following checking need to be merged... */ if (padapter->bDriverStopped || !padapter->bup || !padapter->hw_init_completed diff --git a/core/rtw_recv.c b/core/rtw_recv.c index c2ba40a..8a2f375 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -32,7 +32,7 @@ #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS); -#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS +#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */ void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv) @@ -60,10 +60,6 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter) sint res=_SUCCESS; _func_enter_; - - // We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). - //_rtw_memset((unsigned char *)precvpriv, 0, sizeof (struct recv_priv)); - _rtw_spinlock_init(&precvpriv->lock); _rtw_init_queue(&precvpriv->free_recv_queue); @@ -82,11 +78,8 @@ _func_enter_; res= _FAIL; goto exit; } - //_rtw_memset(precvpriv->pallocated_frame_buf, 0, NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ); precvpriv->precv_frame_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv->pallocated_frame_buf), RXFRAME_ALIGN_SZ); - //precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf + RXFRAME_ALIGN_SZ - - // ((SIZE_PTR) (precvpriv->pallocated_frame_buf) &(RXFRAME_ALIGN_SZ-1)); precvframe = (union recv_frame*) precvpriv->precv_frame_buf; @@ -123,11 +116,10 @@ _func_enter_; _init_timer(&precvpriv->signal_stat_timer, padapter->hndis_adapter, RTW_TIMER_HDL_NAME(signal_stat), padapter); #endif - precvpriv->signal_stat_sampling_interval = 1000; //ms - //precvpriv->signal_stat_converging_constant = 5000; //ms + precvpriv->signal_stat_sampling_interval = 1000; /* ms */ rtw_set_signal_stat_timer(precvpriv); -#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS +#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */ exit: @@ -153,7 +145,7 @@ void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv) #ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX _rtw_spinlock_free(&precvpriv->recv_buf_pending_queue.lock); -#endif // CONFIG_USE_USB_BUFFER_ALLOC_RX +#endif /* CONFIG_USE_USB_BUFFER_ALLOC_RX */ } void _rtw_free_recv_priv (struct recv_priv *precvpriv) @@ -247,7 +239,7 @@ _func_enter_; #ifdef CONFIG_CONCURRENT_MODE if (padapter->adapter_type > PRIMARY_ADAPTER) { - padapter = padapter->pbuddy_adapter;//get primary_padapter + padapter = padapter->pbuddy_adapter;/* get primary_padapter */ precvpriv = &padapter->recvpriv; pfree_recv_queue = &precvpriv->free_recv_queue; precvframe->u.hdr.adapter = padapter; @@ -265,13 +257,13 @@ _func_enter_; { #ifdef CONFIG_BSD_RX_USE_MBUF m_freem(precvframe->u.hdr.pkt); -#else // CONFIG_BSD_RX_USE_MBUF - dev_kfree_skb_any(precvframe->u.hdr.pkt);//free skb by driver -#endif // CONFIG_BSD_RX_USE_MBUF +#else /* CONFIG_BSD_RX_USE_MBUF */ + dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */ +#endif /* CONFIG_BSD_RX_USE_MBUF */ precvframe->u.hdr.pkt = NULL; } -#endif //defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD) +#endif /* defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD) */ _enter_critical_bh(&pfree_recv_queue->lock, &irqL); @@ -305,7 +297,7 @@ sint _rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *queue) _func_enter_; - //_rtw_init_listhead(&(precvframe->u.hdr.list)); + /* _rtw_init_listhead(&(precvframe->u.hdr.list)); */ rtw_list_delete(&(precvframe->u.hdr.list)); @@ -326,10 +318,8 @@ sint rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *queue) sint ret; _irqL irqL; - //_spinlock(&pfree_recv_queue->lock); _enter_critical_bh(&queue->lock, &irqL); ret = _rtw_enqueue_recvframe(precvframe, queue); - //_rtw_spinunlock(&pfree_recv_queue->lock); _exit_critical_bh(&queue->lock, &irqL); return ret; @@ -370,8 +360,6 @@ _func_enter_; plist = get_next(plist); - //rtw_list_delete(&precvframe->u.hdr.list); // will do this in rtw_free_recvframe() - rtw_free_recvframe(precvframe, pfree_recv_queue); } @@ -477,7 +465,6 @@ sint recvframe_chkmic(_adapter *adapter, union recv_frame *precvframe){ u8 bmic_err=false,brpt_micerror = true; u8 *pframe, *payload,*pframemic; u8 *mickey; - //u8 *iv,rxdata_key_idx=0; struct sta_info *stainfo; struct rx_pkt_attrib *prxattrib=&precvframe->u.hdr.attrib; struct security_priv *psecuritypriv=&adapter->securitypriv; @@ -494,19 +481,14 @@ _func_enter_; RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n recvframe_chkmic:da=0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n", prxattrib->ra[0],prxattrib->ra[1],prxattrib->ra[2],prxattrib->ra[3],prxattrib->ra[4],prxattrib->ra[5])); - //calculate mic code + /* calculate mic code */ if (stainfo!= NULL) { if (IS_MCAST(prxattrib->ra)) { - //mickey=&psecuritypriv->dot118021XGrprxmickey.skey[0]; - //iv = precvframe->u.hdr.rx_data+prxattrib->hdrlen; - //rxdata_key_idx =( ((iv[3])>>6)&0x3) ; mickey=&psecuritypriv->dot118021XGrprxmickey[prxattrib->key_index].skey[0]; RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n recvframe_chkmic: bcmc key\n")); - //DBG_88E("\n recvframe_chkmic: bcmc key psecuritypriv->dot118021XGrpKeyid(%d),pmlmeinfo->key_index(%d) ,recv key_id(%d)\n", - // psecuritypriv->dot118021XGrpKeyid,pmlmeinfo->key_index,rxdata_key_idx); if (psecuritypriv->binstallGrpkey==false) { @@ -521,15 +503,12 @@ _func_enter_; RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("\n recvframe_chkmic: unicast key\n")); } - datalen=precvframe->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len-prxattrib->icv_len-8;//icv_len included the mic code + datalen=precvframe->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len-prxattrib->icv_len-8;/* icv_len included the mic code */ pframe=precvframe->u.hdr.rx_data; payload=pframe+prxattrib->hdrlen+prxattrib->iv_len; RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n prxattrib->iv_len=%d prxattrib->icv_len=%d\n",prxattrib->iv_len,prxattrib->icv_len)); - - //rtw_seccalctkipmic(&stainfo->dot11tkiprxmickey.skey[0],pframe,payload, datalen ,&miccode[0],(unsigned char)prxattrib->priority); //care the length of the data - - rtw_seccalctkipmic(mickey,pframe,payload, datalen ,&miccode[0],(unsigned char)prxattrib->priority); //care the length of the data + rtw_seccalctkipmic(mickey,pframe,payload, datalen ,&miccode[0],(unsigned char)prxattrib->priority); /* care the length of the data */ pframemic=payload+datalen; @@ -568,8 +547,8 @@ _func_enter_; prxattrib->ra[0],prxattrib->ra[1],prxattrib->ra[2], prxattrib->ra[3],prxattrib->ra[4],prxattrib->ra[5],psecuritypriv->binstallGrpkey)); - // double check key_index for some timing issue , - // cannot compare with psecuritypriv->dot118021XGrpKeyid also cause timing issue + /* double check key_index for some timing issue , */ + /* cannot compare with psecuritypriv->dot118021XGrpKeyid also cause timing issue */ if ((IS_MCAST(prxattrib->ra)==true) && (prxattrib->key_index != pmlmeinfo->key_index )) brpt_micerror = false; @@ -589,7 +568,7 @@ _func_enter_; } else{ - //mic checked ok + /* mic checked ok */ if ((psecuritypriv->bcheck_grpkey ==false)&&(IS_MCAST(prxattrib->ra)==true)){ psecuritypriv->bcheck_grpkey =true; RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("psecuritypriv->bcheck_grpkey =true")); @@ -614,7 +593,7 @@ _func_exit_; } -//decrypt and set the ivlen,icvlen of the recv_frame +/* decrypt and set the ivlen,icvlen of the recv_frame */ union recv_frame * decryptor(_adapter *padapter,union recv_frame *precv_frame); union recv_frame * decryptor(_adapter *padapter,union recv_frame *precv_frame) { @@ -654,7 +633,7 @@ _func_enter_; { #ifdef CONFIG_CONCURRENT_MODE - if (!IS_MCAST(prxattrib->ra))//bc/mc packets use sw decryption for concurrent mode + if (!IS_MCAST(prxattrib->ra))/* bc/mc packets use sw decryption for concurrent mode */ #endif psecuritypriv->hw_decrypted=false; @@ -714,7 +693,7 @@ _func_exit_; return return_packet; } -//###set the security information in the recv_frame +/* set the security information in the recv_frame */ union recv_frame * portctrl(_adapter *adapter,union recv_frame * precv_frame); union recv_frame * portctrl(_adapter *adapter,union recv_frame * precv_frame) { @@ -725,7 +704,7 @@ union recv_frame * portctrl(_adapter *adapter,union recv_frame * precv_frame) struct sta_priv *pstapriv ; union recv_frame *prtnframe; u16 ether_type=0; - u16 eapol_type = 0x888e;//for Funia BD's WPA issue + u16 eapol_type = 0x888e;/* for Funia BD's WPA issue */ struct rx_pkt_attrib *pattrib; __be16 be_tmp; @@ -749,13 +728,13 @@ _func_enter_; { if ((psta!=NULL) && (psta->ieee8021x_blocked)) { - //blocked - //only accept EAPOL frame + /* blocked */ + /* only accept EAPOL frame */ RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("########portctrl:psta->ieee8021x_blocked==1\n")); prtnframe=precv_frame; - //get ether_type + /* get ether_type */ ptr=ptr+pfhdr->attrib.hdrlen+pfhdr->attrib.iv_len+LLC_HEADER_SIZE; _rtw_memcpy(&be_tmp, ptr, 2); ether_type= ntohs(be_tmp); @@ -764,15 +743,15 @@ _func_enter_; prtnframe=precv_frame; } else { - //free this frame + /* free this frame */ rtw_free_recvframe(precv_frame, &adapter->recvpriv.free_recv_queue); prtnframe=NULL; } } else { - //allowed - //check decryption status, and decrypt the frame if needed + /* allowed */ + /* check decryption status, and decrypt the frame if needed */ RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("########portctrl:psta->ieee8021x_blocked==0\n")); RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("portctrl:precv_frame->hdr.attrib.privacy=%x\n",precv_frame->u.hdr.attrib.privacy)); @@ -782,11 +761,11 @@ _func_enter_; } prtnframe=precv_frame; - //check is the EAPOL frame or not (Rekey) + /* check is the EAPOL frame or not (Rekey) */ if (ether_type == eapol_type){ RT_TRACE(_module_rtl871x_recv_c_,_drv_notice_,("########portctrl:ether_type == 0x888e\n")); - //check Rekey + /* check Rekey */ prtnframe=precv_frame; } @@ -823,7 +802,7 @@ _func_enter_; return _FAIL; } - if (1)//if (bretry) + if (1)/* if (bretry) */ { if (seq_ctrl == prxcache->tid_rxseq[tid]) { @@ -861,24 +840,24 @@ void process_pwrbit_data(_adapter *padapter, union recv_frame *precv_frame) { if (!(psta->state & WIFI_SLEEP_STATE)) { - //psta->state |= WIFI_SLEEP_STATE; - //pstapriv->sta_dz_bitmap |= BIT(psta->aid); + /* psta->state |= WIFI_SLEEP_STATE; */ + /* pstapriv->sta_dz_bitmap |= BIT(psta->aid); */ stop_sta_xmit(padapter, psta); - //DBG_88E("to sleep, sta_dz_bitmap=%x\n", pstapriv->sta_dz_bitmap); + /* DBG_88E("to sleep, sta_dz_bitmap=%x\n", pstapriv->sta_dz_bitmap); */ } } else { if (psta->state & WIFI_SLEEP_STATE) { - //psta->state ^= WIFI_SLEEP_STATE; - //pstapriv->sta_dz_bitmap &= ~BIT(psta->aid); + /* psta->state ^= WIFI_SLEEP_STATE; */ + /* pstapriv->sta_dz_bitmap &= ~BIT(psta->aid); */ wakeup_sta_to_xmit(padapter, psta); - //DBG_88E("to wakeup, sta_dz_bitmap=%x\n", pstapriv->sta_dz_bitmap); + /* DBG_88E("to wakeup, sta_dz_bitmap=%x\n", pstapriv->sta_dz_bitmap); */ } } @@ -902,7 +881,7 @@ void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_TDLS if ( !(psta->tdls_sta_state & TDLS_LINKED_STATE ) ) { -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ if (!psta->qos_option) return; @@ -912,7 +891,7 @@ void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_TDLS } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ if (psta->state&WIFI_SLEEP_STATE) { @@ -943,12 +922,12 @@ void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame) { if (psta->sleepq_ac_len>0) { - //process received triggered frame + /* process received triggered frame */ xmit_delivery_enabled_frames(padapter, psta); } else { - //issue one qos null frame with More data bit = 0 and the EOSP bit set (=1) + /* issue one qos null frame with More data bit = 0 and the EOSP bit set (=1) */ issue_qos_nulldata(padapter, psta->hwaddr, (u16)pattrib->priority, 0, 0); } } @@ -969,10 +948,10 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame) u8 category_field = 1; #ifdef CONFIG_WFD u8 WFA_OUI[3] = { 0x50, 0x6f, 0x9a }; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ struct tdls_info *ptdlsinfo = &(adapter->tdlsinfo); - //point to action field + /* point to action field */ paction+=pattrib->hdrlen + pattrib->iv_len + SNAP_SIZE @@ -1022,25 +1001,25 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame) ret=On_TDLS_Ch_Switch_Rsp(adapter, precv_frame); break; #ifdef CONFIG_WFD - case 0x50: //First byte of WFA OUI + case 0x50: /* First byte of WFA OUI */ if ( _rtw_memcmp(WFA_OUI, (paction), 3) ) { - if ( *(paction + 3) == 0x04) //Probe request frame + if ( *(paction + 3) == 0x04) /* Probe request frame */ { - //WFDTDLS: for sigma test, do not setup direct link automatically + /* WFDTDLS: for sigma test, do not setup direct link automatically */ ptdlsinfo->dev_discovered = 1; DBG_88E("recv tunneled probe request frame\n"); issue_tunneled_probe_rsp(adapter, precv_frame); } - if ( *(paction + 3) == 0x05) //Probe response frame + if ( *(paction + 3) == 0x05) /* Probe response frame */ { - //WFDTDLS: for sigma test, do not setup direct link automatically + /* WFDTDLS: for sigma test, do not setup direct link automatically */ ptdlsinfo->dev_discovered = 1; DBG_88E("recv tunneled probe response frame\n"); } } break; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ default: DBG_88E("receive TDLS frame but not supported\n"); ret=_FAIL; @@ -1111,7 +1090,7 @@ sint sta2sta_data_frame( struct tdls_info *ptdlsinfo = &adapter->tdlsinfo; struct sta_info *ptdls_sta=NULL; u8 *psnap_type=ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE; - //frame body located after [+2]: ether-type, [+1]: payload type + /* frame body located after [+2]: ether-type, [+1]: payload type */ u8 *pframe_body = psnap_type+2+1; #endif @@ -1121,7 +1100,7 @@ _func_enter_; (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) { - // filter packets that SA is myself or multicast or broadcast + /* filter packets that SA is myself or multicast or broadcast */ if (_rtw_memcmp(myhwaddr, pattrib->src, ETH_ALEN)){ RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" SA==myself\n")); ret= _FAIL; @@ -1147,7 +1126,7 @@ _func_enter_; { #ifdef CONFIG_TDLS - //direct link data transfer + /* direct link data transfer */ if (ptdlsinfo->setup_state == TDLS_LINKED_STATE){ ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->src); if (ptdls_sta==NULL) @@ -1158,7 +1137,7 @@ _func_enter_; else if (ptdls_sta->tdls_sta_state&TDLS_LINKED_STATE) { - //drop QoS-SubType Data, including QoS NULL, excluding QoS-Data + /* drop QoS-SubType Data, including QoS NULL, excluding QoS-Data */ if ( (GetFrameSubType(ptr) & WIFI_QOS_DATA_TYPE )== WIFI_QOS_DATA_TYPE) { if (GetFrameSubType(ptr)&(BIT(4)|BIT(5)|BIT(6))) @@ -1168,18 +1147,18 @@ _func_enter_; goto exit; } } - // filter packets that SA is myself or multicast or broadcast + /* filter packets that SA is myself or multicast or broadcast */ if (_rtw_memcmp(myhwaddr, pattrib->src, ETH_ALEN)){ ret= _FAIL; goto exit; } - // da should be for me + /* da should be for me */ if ((!_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN))&& (!bmcast)) { ret= _FAIL; goto exit; } - // check BSSID + /* check BSSID */ if ( _rtw_memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || _rtw_memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || (!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN)) ) @@ -1188,19 +1167,19 @@ _func_enter_; goto exit; } - //process UAPSD tdls sta + /* process UAPSD tdls sta */ process_pwrbit_data(adapter, precv_frame); - // if NULL-frame, check pwrbit + /* if NULL-frame, check pwrbit */ if ((GetFrameSubType(ptr)) == WIFI_DATA_NULL) { - //NULL-frame with pwrbit=1, buffer_STA should buffer frames for sleep_STA + /* NULL-frame with pwrbit=1, buffer_STA should buffer frames for sleep_STA */ if (GetPwrMgt(ptr)) { DBG_88E("TDLS: recv peer null frame with pwr bit 1\n"); ptdls_sta->tdls_sta_state|=TDLS_PEER_SLEEP_STATE; - // it would be triggered when we are off channel and receiving NULL DATA - // we can confirm that peer STA is at off channel + /* it would be triggered when we are off channel and receiving NULL DATA */ + /* we can confirm that peer STA is at off channel */ } else if (ptdls_sta->tdls_sta_state&TDLS_CH_SWITCH_ON_STATE) { @@ -1215,7 +1194,7 @@ _func_enter_; ret= _FAIL; goto exit; } - //receive some of all TDLS management frames, process it at ON_TDLS + /* receive some of all TDLS management frames, process it at ON_TDLS */ if ((_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, 2))){ ret= OnTDLS(adapter, precv_frame); goto exit; @@ -1227,9 +1206,9 @@ _func_enter_; } else -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ { - // For Station mode, sa and bssid should always be BSSID, and DA is my mac-address + /* For Station mode, sa and bssid should always be BSSID, and DA is my mac-address */ if (!_rtw_memcmp(pattrib->bssid, pattrib->src, ETH_ALEN) ) { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("bssid != TA under STATION_MODE; drop pkt\n")); @@ -1245,15 +1224,15 @@ _func_enter_; { if (bmcast) { - // For AP mode, if DA == MCAST, then BSSID should be also MCAST + /* For AP mode, if DA == MCAST, then BSSID should be also MCAST */ if (!IS_MCAST(pattrib->bssid)){ ret= _FAIL; goto exit; } } - else // not mc-frame + else /* not mc-frame */ { - // For AP mode, if DA is non-MCAST, then it must be BSSID, and bssid == BSSID + /* For AP mode, if DA is non-MCAST, then it must be BSSID, and bssid == BSSID */ if (!_rtw_memcmp(pattrib->bssid, pattrib->dst, ETH_ALEN)) { ret= _FAIL; goto exit; @@ -1283,12 +1262,12 @@ _func_enter_; if (bmcast) *psta = rtw_get_bcmc_stainfo(adapter); else - *psta = rtw_get_stainfo(pstapriv, sta_addr); // get ap_info + *psta = rtw_get_stainfo(pstapriv, sta_addr); /* get ap_info */ #ifdef CONFIG_TDLS if (ptdls_sta != NULL) *psta = ptdls_sta; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ if (*psta == NULL) { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("can't get psta under sta2sta_data_frame ; drop pkt\n")); @@ -1335,7 +1314,7 @@ _func_enter_; ) { - // filter packets that SA is myself or multicast or broadcast + /* filter packets that SA is myself or multicast or broadcast */ if (_rtw_memcmp(myhwaddr, pattrib->src, ETH_ALEN)){ RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" SA==myself\n")); #ifdef DBG_RX_DROP_FRAME @@ -1346,7 +1325,7 @@ _func_enter_; goto exit; } - // da should be for me + /* da should be for me */ if ((!_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN))&& (!bmcast)) { RT_TRACE(_module_rtl871x_recv_c_,_drv_info_, @@ -1359,7 +1338,7 @@ _func_enter_; } - // check BSSID + /* check BSSID */ if ( _rtw_memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || _rtw_memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || (!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN)) ) @@ -1386,7 +1365,7 @@ _func_enter_; if (bmcast) *psta = rtw_get_bcmc_stainfo(adapter); else - *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); // get ap_info + *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get ap_info */ if (*psta == NULL) { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("ap2sta: can't get psta under STATION_MODE ; drop pkt\n")); @@ -1397,8 +1376,8 @@ _func_enter_; goto exit; } - //if ((GetFrameSubType(ptr) & WIFI_QOS_DATA_TYPE) == WIFI_QOS_DATA_TYPE) { - //} + /* if ((GetFrameSubType(ptr) & WIFI_QOS_DATA_TYPE) == WIFI_QOS_DATA_TYPE) { */ + /* */ if (GetFrameSubType(ptr) & BIT(6)) { /* No data, will not indicate to upper layer, temporily count it here */ @@ -1417,11 +1396,11 @@ _func_enter_; _rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); - // + /* */ _rtw_memcpy(pattrib->bssid, mybssid, ETH_ALEN); - *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); // get sta_info + *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get sta_info */ if (*psta == NULL) { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("can't get psta under MP_MODE ; drop pkt\n")); #ifdef DBG_RX_DROP_FRAME @@ -1443,7 +1422,7 @@ _func_enter_; { if (_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN)&& (!bmcast)) { - *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); // get sta_info + *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get sta_info */ if (*psta == NULL) { DBG_88E("issue_deauth to the ap=%pM for the reason(7)\n", (pattrib->bssid)); @@ -1486,7 +1465,7 @@ _func_enter_; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { - //For AP mode, RA=BSSID, TX=STA(SRC_ADDR), A3=DST_ADDR + /* For AP mode, RA=BSSID, TX=STA(SRC_ADDR), A3=DST_ADDR */ if (!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN)) { ret= _FAIL; @@ -1545,22 +1524,22 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; struct sta_priv *pstapriv = &padapter->stapriv; u8 *pframe = precv_frame->u.hdr.rx_data; - //uint len = precv_frame->u.hdr.len; + /* uint len = precv_frame->u.hdr.len; */ - //DBG_88E("+validate_recv_ctrl_frame\n"); + /* DBG_88E("+validate_recv_ctrl_frame\n"); */ if (GetFrameType(pframe) != WIFI_CTRL_TYPE) { return _FAIL; } - //receive the frames that ra(a1) is my address + /* receive the frames that ra(a1) is my address */ if (!_rtw_memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN)) { return _FAIL; } - //only handle ps-poll + /* only handle ps-poll */ if (GetFrameSubType(pframe) == WIFI_PSPOLL) { u16 aid; @@ -1575,7 +1554,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) return _FAIL; } - //for rx pkt statistics + /* for rx pkt statistics */ psta->sta_stats.rx_ctrl_pkts++; switch (pattrib->priority) @@ -1637,7 +1616,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) pxmitframe->attrib.triggered = 1; - //DBG_88E("handling ps-poll, q_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); + /* DBG_88E("handling ps-poll, q_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */ _exit_critical_bh(&psta->sleep_q.lock, &irqL); if (rtw_hal_xmit(padapter, pxmitframe) == true) @@ -1650,24 +1629,24 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) { pstapriv->tim_bitmap &= ~BIT(psta->aid); - //DBG_88E("after handling ps-poll, tim=%x\n", pstapriv->tim_bitmap); + /* DBG_88E("after handling ps-poll, tim=%x\n", pstapriv->tim_bitmap); */ - //upate BCN for TIM IE - //update_BCNTIM(padapter); + /* upate BCN for TIM IE */ + /* update_BCNTIM(padapter); */ update_beacon(padapter, _TIM_IE_, NULL, false); } } else { - //DBG_88E("no buffered packets to xmit\n"); + /* DBG_88E("no buffered packets to xmit\n"); */ if (pstapriv->tim_bitmap&BIT(psta->aid)) { if (psta->sleepq_len==0) { DBG_88E("no buffered packets to xmit\n"); - //issue nulldata with More data bit = 0 to indicate we have no buffered packets + /* issue nulldata with More data bit = 0 to indicate we have no buffered packets */ issue_nulldata(padapter, psta->hwaddr, 0, 0, 0); } else @@ -1678,8 +1657,8 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) pstapriv->tim_bitmap &= ~BIT(psta->aid); - //upate BCN for TIM IE - //update_BCNTIM(padapter); + /* upate BCN for TIM IE */ + /* update_BCNTIM(padapter); */ update_beacon(padapter, _TIM_IE_, NULL, false); } @@ -1701,7 +1680,7 @@ union recv_frame* recvframe_chk_defrag(PADAPTER padapter, union recv_frame *prec sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame); sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame) { - //struct mlme_priv *pmlmepriv = &adapter->mlmepriv; + /* struct mlme_priv *pmlmepriv = &adapter->mlmepriv; */ RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("+validate_recv_mgnt_frame\n")); @@ -1712,7 +1691,7 @@ sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame) } { - //for rx pkt statistics + /* for rx pkt statistics */ struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, GetAddr2Ptr(precv_frame->u.hdr.rx_data)); if (psta) { psta->sta_stats.rx_mgnt_pkts++; @@ -1801,7 +1780,7 @@ sint validate_recv_data_frame(_adapter *adapter, union recv_frame *precv_frame) sint ret = _SUCCESS; #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &adapter->tdlsinfo; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ _func_enter_; @@ -1875,14 +1854,14 @@ _func_enter_; goto exit; } - //psta->rssi = prxcmd->rssi; - //psta->signal_quality= prxcmd->sq; + /* psta->rssi = prxcmd->rssi; */ + /* psta->signal_quality= prxcmd->sq; */ precv_frame->u.hdr.psta = psta; pattrib->amsdu=0; pattrib->ack_policy = 0; - //parsing QC field + /* parsing QC field */ if (pattrib->qos == 1) { pattrib->priority = GetPriority((ptr + 24)); @@ -1902,14 +1881,14 @@ _func_enter_; } - if (pattrib->order)//HT-CTRL 11n + if (pattrib->order)/* HT-CTRL 11n */ { pattrib->hdrlen += 4; } precv_frame->u.hdr.preorder_ctrl = &psta->recvreorder_ctrl[pattrib->priority]; - // decache, drop duplicate recv packets + /* decache, drop duplicate recv packets */ if (recv_decache(precv_frame, bretry, &psta->sta_recvpriv.rxcache) == _FAIL) { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("decache : drop pkt\n")); @@ -1931,7 +1910,7 @@ _func_enter_; pattrib->encrypt=psta->dot118021XPrivacy; } else -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, IS_MCAST(pattrib->ra)); RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n pattrib->encrypt=%d\n",pattrib->encrypt)); @@ -1954,9 +1933,9 @@ _func_exit_; sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame); sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame) { - //shall check frame subtype, to / from ds, da, bssid + /* shall check frame subtype, to / from ds, da, bssid */ - //then call check if rx seq/frag. duplicated. + /* then call check if rx seq/frag. duplicated. */ u8 type; u8 subtype; @@ -1972,7 +1951,7 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame) #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &adapter->tdlsinfo; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ #ifdef CONFIG_WAPI_SUPPORT PRT_WAPI_T pWapiInfo = &adapter->wapiInfo; struct recv_frame_hdr *phdr = &precv_frame->u.hdr; @@ -1996,7 +1975,7 @@ _func_enter_; if (ptdlsinfo->ch_sensing==1 && ptdlsinfo->cur_channel !=0){ ptdlsinfo->collect_pkt_num[ptdlsinfo->cur_channel-1]++; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ #ifdef RTK_DMP_PLATFORM if ( 0 ) @@ -2011,9 +1990,9 @@ _func_enter_; } DBG_88E("--\n"); } -#endif //RTK_DMP_PLATFORM +#endif /* RTK_DMP_PLATFORM */ - //add version chk + /* add version chk */ if (ver!=0){ RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail! (ver!=0)\n")); retval= _FAIL; @@ -2021,7 +2000,7 @@ _func_enter_; } type = GetFrameType(ptr); - subtype = GetFrameSubType(ptr); //bit(7)~bit(2) + subtype = GetFrameSubType(ptr); /* bit(7)~bit(2) */ pattrib->to_fr_ds = get_tofr_ds(ptr); @@ -2037,11 +2016,11 @@ _func_enter_; sc = (pattrib->seq_num<<4) | pattrib->frag_num; #endif -#if 1 //Dump rx packets +#if 1 /* Dump rx packets */ { u8 bDumpRxPkt; rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt)); - if (bDumpRxPkt ==1){//dump all rx packets + if (bDumpRxPkt ==1){/* dump all rx packets */ int i; DBG_88E("#############################\n"); @@ -2076,23 +2055,23 @@ _func_enter_; #endif switch (type) { - case WIFI_MGT_TYPE: //mgnt + case WIFI_MGT_TYPE: /* mgnt */ retval = validate_recv_mgnt_frame(adapter, precv_frame); if (retval == _FAIL) { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_mgnt_frame fail\n")); } - retval = _FAIL; // only data frame return _SUCCESS + retval = _FAIL; /* only data frame return _SUCCESS */ break; - case WIFI_CTRL_TYPE: //ctrl + case WIFI_CTRL_TYPE: /* ctrl */ retval = validate_recv_ctrl_frame(adapter, precv_frame); if (retval == _FAIL) { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_ctrl_frame fail\n")); } - retval = _FAIL; // only data frame return _SUCCESS + retval = _FAIL; /* only data frame return _SUCCESS */ break; - case WIFI_DATA_TYPE: //data + case WIFI_DATA_TYPE: /* data */ #ifdef CONFIG_WAPI_SUPPORT if (pattrib->qos) external_len = 2; @@ -2131,7 +2110,7 @@ _func_enter_; if (retval == _FAIL) { struct recv_priv *precvpriv = &adapter->recvpriv; - //RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail\n")); + /* RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail\n")); */ precvpriv->rx_drop++; } break; @@ -2152,7 +2131,7 @@ _func_exit_; } -//remove the wlanhdr and add the eth_hdr +/* remove the wlanhdr and add the eth_hdr */ #if 1 sint wlanhdr_to_ethhdr ( union recv_frame *precvframe); @@ -2169,7 +2148,7 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) _adapter *adapter =precvframe->u.hdr.adapter; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; - u8 *ptr = get_recvframe_data(precvframe) ; // point to frame_ctrl field + u8 *ptr = get_recvframe_data(precvframe) ; /* point to frame_ctrl field */ struct rx_pkt_attrib *pattrib = & precvframe->u.hdr.attrib; _func_enter_; @@ -2181,11 +2160,11 @@ _func_enter_; psnap=(struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen + pattrib->iv_len); psnap_type=ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE; /* convert hdr + possible LLC headers into Ethernet header */ - //eth_type = (psnap_type[0] << 8) | psnap_type[1]; + /* eth_type = (psnap_type[0] << 8) | psnap_type[1]; */ if ((_rtw_memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) && (_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == false) && (_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2)==false) )|| - //eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || + /* eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || */ _rtw_memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE)){ /* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */ bsnaphdr = true; @@ -2200,7 +2179,7 @@ _func_enter_; RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n===pattrib->hdrlen: %x, pattrib->iv_len:%x ===\n\n", pattrib->hdrlen, pattrib->iv_len)); _rtw_memcpy(&be_tmp, ptr+rmv_len, 2); - eth_type = ntohs(be_tmp); //pattrib->ether_type + eth_type = ntohs(be_tmp); /* pattrib->ether_type */ pattrib->eth_type = eth_type; if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)) { @@ -2209,7 +2188,7 @@ _func_enter_; *(ptr+1) = 0x12; eth_type = 0x8712; - // append rx status for mp test packets + /* append rx status for mp test packets */ ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr)+2)-24); _rtw_memcpy(ptr, get_rxmem(precvframe), 24); ptr+=24; @@ -2244,7 +2223,7 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) sint ret=_SUCCESS; _adapter *adapter =precvframe->u.hdr.adapter; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; - u8 *ptr = get_recvframe_data(precvframe); // point to frame_ctrl field + u8 *ptr = get_recvframe_data(precvframe); /* point to frame_ctrl field */ struct rx_pkt_attrib *pattrib = & precvframe->u.hdr.attrib; struct _vlan *pvlan = NULL; @@ -2255,12 +2234,12 @@ _func_enter_; if (psnap->dsap==0xaa && psnap->ssap==0xaa && psnap->ctrl==0x03) { if (_rtw_memcmp(psnap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN)) - bsnaphdr=true;//wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_RFC1042; + bsnaphdr=true;/* wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_RFC1042; */ else if (_rtw_memcmp(psnap->oui, SNAP_HDR_APPLETALK_DDP, WLAN_IEEE_OUI_LEN) && _rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_DDP, 2) ) - bsnaphdr=true; //wlan_pkt_format = WLAN_PKT_FORMAT_APPLETALK; + bsnaphdr=true; /* wlan_pkt_format = WLAN_PKT_FORMAT_APPLETALK; */ else if (_rtw_memcmp( psnap->oui, oui_8021h, WLAN_IEEE_OUI_LEN)) - bsnaphdr=true; //wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_TUNNEL; + bsnaphdr=true; /* wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_TUNNEL; */ else { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("drop pkt due to invalid frame format!\n")); ret= _FAIL; @@ -2268,7 +2247,7 @@ _func_enter_; } } else - bsnaphdr=false;//wlan_pkt_format = WLAN_PKT_FORMAT_OTHERS; + bsnaphdr=false;/* wlan_pkt_format = WLAN_PKT_FORMAT_OTHERS; */ rmv_len = pattrib->hdrlen + pattrib->iv_len +(bsnaphdr?SNAP_SIZE:0); RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("===pattrib->hdrlen: %x, pattrib->iv_len:%x ===\n", pattrib->hdrlen, pattrib->iv_len)); @@ -2279,46 +2258,44 @@ _func_enter_; *ptr = 0x87; *(ptr+1) = 0x12; - //back to original pointer + /* back to original pointer */ ptr -= rmv_len; } ptr += rmv_len ; _rtw_memcpy(&be_tmp, ptr, 2); - eth_type= ntohs(be_tmp); //pattrib->ether_type + eth_type= ntohs(be_tmp); /* pattrib->ether_type */ ptr +=2; if (pattrib->encrypt){ recvframe_pull_tail(precvframe, pattrib->icv_len); } - if (eth_type == 0x8100) //vlan + if (eth_type == 0x8100) /* vlan */ { pvlan = (struct _vlan *) ptr; - //eth_type = get_vlan_encap_proto(pvlan); - //eth_type = pvlan->h_vlan_encapsulated_proto;//? rmv_len += 4; ptr+=4; } - if (eth_type==0x0800)//ip + if (eth_type==0x0800)/* ip */ { - //struct iphdr* piphdr = (struct iphdr*) ptr; - //__u8 tos = (unsigned char)(pattrib->priority & 0xff); + /* struct iphdr* piphdr = (struct iphdr*) ptr; */ + /* __u8 tos = (unsigned char)(pattrib->priority & 0xff); */ - //piphdr->tos = tos; + /* piphdr->tos = tos; */ - //if (piphdr->protocol == 0x06) - //{ - // RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("@@@===recv tcp len:%d @@@===\n", precvframe->u.hdr.len)); - //} + /* if (piphdr->protocol == 0x06) */ + /* */ + /* RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("@@@===recv tcp len:%d @@@===\n", precvframe->u.hdr.len)); */ + /* */ } - else if (eth_type==0x8712)// append rx status for mp test packets + else if (eth_type==0x8712)/* append rx status for mp test packets */ { - //ptr -= 16; - //_rtw_memcpy(ptr, get_rxmem(precvframe), 16); + /* ptr -= 16; */ + /* _rtw_memcpy(ptr, get_rxmem(precvframe), 16); */ } else { @@ -2327,19 +2304,19 @@ _func_enter_; UINT32 UserPriority = precvframe->u.hdr.attrib.priority; UINT32 VlanID = (pvlan!=NULL ? get_vlan_id(pvlan) : 0 ); - VlanPriInfo.Value = // Get current value. + VlanPriInfo.Value = /* Get current value. */ NDIS_PER_PACKET_INFO_FROM_PACKET(precvframe->u.hdr.pkt, Ieee8021QInfo); VlanPriInfo.TagHeader.UserPriority = UserPriority; VlanPriInfo.TagHeader.VlanId = VlanID ; - VlanPriInfo.TagHeader.CanonicalFormatId = 0; // Should be zero. - VlanPriInfo.TagHeader.Reserved = 0; // Should be zero. + VlanPriInfo.TagHeader.CanonicalFormatId = 0; /* Should be zero. */ + VlanPriInfo.TagHeader.Reserved = 0; /* Should be zero. */ NDIS_PER_PACKET_INFO_FROM_PACKET(precvframe->u.hdr.pkt, Ieee8021QInfo) = VlanPriInfo.Value; #endif } - if (eth_type==0x8712)// append rx status for mp test packets + if (eth_type==0x8712)/* append rx status for mp test packets */ { ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr)+2)-24); _rtw_memcpy(ptr, get_rxmem(precvframe), 24); @@ -2377,40 +2354,40 @@ static void recvframe_expand_pkt( pfhdr = &prframe->u.hdr; - // 6 is for IP header 8 bytes alignment in QoS packet case. + /* 6 is for IP header 8 bytes alignment in QoS packet case. */ if (pfhdr->attrib.qos) shift_sz = 6; else shift_sz = 0; - // for first fragment packet, need to allocate - // (1536 + RXDESC_SIZE + drvinfo_sz) to reassemble packet - // 8 is for skb->data 8 bytes alignment. -// alloc_sz = _RND(1536 + RXDESC_SIZE + pfhdr->attrib.drvinfosize + shift_sz + 8, 128); - alloc_sz = 1664; // round (1536 + 24 + 32 + shift_sz + 8) to 128 bytes alignment + /* for first fragment packet, need to allocate */ + /* (1536 + RXDESC_SIZE + drvinfo_sz) to reassemble packet */ + /* 8 is for skb->data 8 bytes alignment. */ +/* alloc_sz = _RND(1536 + RXDESC_SIZE + pfhdr->attrib.drvinfosize + shift_sz + 8, 128); */ + alloc_sz = 1664; /* round (1536 + 24 + 32 + shift_sz + 8) to 128 bytes alignment */ - //3 1. alloc new skb - // prepare extra space for 4 bytes alignment -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) // http://www.mail-archive.com/netdev@vger.kernel.org/msg17214.html + /* 3 1. alloc new skb */ + /* prepare extra space for 4 bytes alignment */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) /* www.mail-archive.com/netdev@vger.kernel.org/msg17214.html */ ppkt = dev_alloc_skb(alloc_sz); if (ppkt) ppkt->dev = padapter->pnetdev; #else ppkt = netdev_alloc_skb(padapter->pnetdev, alloc_sz); #endif - if (!ppkt) return; // no way to expand + if (!ppkt) return; /* no way to expand */ - //3 2. Prepare new skb to replace & release old skb - // force ppkt->data at 8-byte alignment address + /* 3 2. Prepare new skb to replace & release old skb */ + /* force ppkt->data at 8-byte alignment address */ skb_reserve(ppkt, 8 - ((SIZE_PTR)ppkt->data & 7)); - // force ip_hdr at 8-byte alignment address according to shift_sz + /* force ip_hdr at 8-byte alignment address according to shift_sz */ skb_reserve(ppkt, shift_sz); - // copy data to new pkt + /* copy data to new pkt */ _rtw_memcpy(skb_put(ppkt, pfhdr->len), pfhdr->rx_data, pfhdr->len); dev_kfree_skb_any(pfhdr->pkt); - // attach new pkt to recvframe + /* attach new pkt to recvframe */ pfhdr->pkt = ppkt; pfhdr->rx_head = ppkt->head; pfhdr->rx_data = ppkt->data; @@ -2422,7 +2399,7 @@ static void recvframe_expand_pkt( #endif #endif -//perform defrag +/* perform defrag */ union recv_frame * recvframe_defrag(_adapter *adapter,_queue *defrag_q); union recv_frame * recvframe_defrag(_adapter *adapter,_queue *defrag_q) { @@ -2446,8 +2423,8 @@ _func_enter_; if (curfragnum!=pfhdr->attrib.frag_num) { - //the first fragment number must be 0 - //free the whole queue + /* the first fragment number must be 0 */ + /* free the whole queue */ rtw_free_recvframe(prframe, pfree_recv_queue); rtw_free_recvframe_queue(defrag_q, pfree_recv_queue); @@ -2473,12 +2450,12 @@ _func_enter_; pnfhdr=&pnextrframe->u.hdr; - //check the fragment sequence (2nd ~n fragment frame) + /* check the fragment sequence (2nd ~n fragment frame) */ if (curfragnum!=pnfhdr->attrib.frag_num) { - //the fragment number must be increasing (after decache) - //release the defrag_q & prframe + /* the fragment number must be increasing (after decache) */ + /* release the defrag_q & prframe */ rtw_free_recvframe(prframe, pfree_recv_queue); rtw_free_recvframe_queue(defrag_q, pfree_recv_queue); return NULL; @@ -2486,17 +2463,17 @@ _func_enter_; curfragnum++; - //copy the 2nd~n fragment frame's payload to the first fragment - //get the 2nd~last fragment frame's payload + /* copy the 2nd~n fragment frame's payload to the first fragment */ + /* get the 2nd~last fragment frame's payload */ wlanhdr_offset = pnfhdr->attrib.hdrlen + pnfhdr->attrib.iv_len; recvframe_pull(pnextrframe, wlanhdr_offset); - //append to first fragment frame's tail (if privacy frame, pull the ICV) + /* append to first fragment frame's tail (if privacy frame, pull the ICV) */ recvframe_pull_tail(prframe, pfhdr->attrib.icv_len); - //memcpy + /* memcpy */ _rtw_memcpy(pfhdr->rx_tail, pnfhdr->rx_data, pnfhdr->len); recvframe_put(prframe, pnfhdr->len); @@ -2506,7 +2483,7 @@ _func_enter_; }; - //free the defrag_q queue and return the prframe + /* free the defrag_q queue and return the prframe */ rtw_free_recvframe_queue(defrag_q, pfree_recv_queue); RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("Performance defrag!!!!!\n")); @@ -2516,7 +2493,7 @@ _func_exit_; return prframe; } -//check if need to defrag, if needed queue the frame to defrag_q +/* check if need to defrag, if needed queue the frame to defrag_q */ union recv_frame* recvframe_chk_defrag(PADAPTER padapter, union recv_frame *precv_frame) { u8 ismfrag; @@ -2537,7 +2514,7 @@ _func_enter_; pfree_recv_queue = &padapter->recvpriv.free_recv_queue; - //need to define struct of wlan header frame ctrl + /* need to define struct of wlan header frame ctrl */ ismfrag = pfhdr->attrib.mfrag; fragnum = pfhdr->attrib.frag_num; @@ -2557,27 +2534,27 @@ _func_enter_; if ((ismfrag==0) && (fragnum==0)) { - prtnframe = precv_frame;//isn't a fragment frame + prtnframe = precv_frame;/* isn't a fragment frame */ } if (ismfrag==1) { - //0~(n-1) fragment frame - //enqueue to defraf_g + /* 0~(n-1) fragment frame */ + /* enqueue to defraf_g */ if (pdefrag_q != NULL) { if (fragnum==0) { - //the first fragment + /* the first fragment */ if (_rtw_queue_empty(pdefrag_q) == false) { - //free current defrag_q + /* free current defrag_q */ rtw_free_recvframe_queue(pdefrag_q, pfree_recv_queue); } } - //Then enqueue the 0~(n-1) fragment into the defrag_q + /* Then enqueue the 0~(n-1) fragment into the defrag_q */ phead = get_list_head(pdefrag_q); rtw_list_insert_tail(&pfhdr->list, phead); @@ -2589,7 +2566,7 @@ _func_enter_; } else { - //can't find this ta's defrag_queue, so free this recv_frame + /* can't find this ta's defrag_queue, so free this recv_frame */ rtw_free_recvframe(precv_frame, pfree_recv_queue); prtnframe=NULL; RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("Free because pdefrag_q ==NULL: ismfrag = %d, fragnum= %d\n", ismfrag, fragnum)); @@ -2599,14 +2576,14 @@ _func_enter_; if ((ismfrag==0)&&(fragnum!=0)) { - //the last fragment frame - //enqueue the last fragment + /* the last fragment frame */ + /* enqueue the last fragment */ if (pdefrag_q != NULL) { phead = get_list_head(pdefrag_q); rtw_list_insert_tail(&pfhdr->list,phead); - //call recvframe_defrag to defrag + /* call recvframe_defrag to defrag */ RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("defrag: ismfrag = %d, fragnum= %d\n", ismfrag, fragnum)); precv_frame = recvframe_defrag(padapter, pdefrag_q); prtnframe=precv_frame; @@ -2614,7 +2591,7 @@ _func_enter_; } else { - //can't find this ta's defrag_queue, so free this recv_frame + /* can't find this ta's defrag_queue, so free this recv_frame */ rtw_free_recvframe(precv_frame, pfree_recv_queue); prtnframe=NULL; RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("Free because pdefrag_q ==NULL: ismfrag = %d, fragnum= %d\n", ismfrag,fragnum)); @@ -2625,7 +2602,7 @@ _func_enter_; if ((prtnframe!=NULL)&&(prtnframe->u.hdr.attrib.privacy)) { - //after defrag we must check tkip mic code + /* after defrag we must check tkip mic code */ if (recvframe_chkmic(padapter, prtnframe)==_FAIL) { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("recvframe_chkmic(padapter, prtnframe)==_FAIL\n")); @@ -2642,7 +2619,7 @@ _func_exit_; static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) { -#if defined (PLATFORM_LINUX) || defined (PLATFORM_FREEBSD) //for amsdu TP improvement,Creator: Thomas +#if defined (PLATFORM_LINUX) || defined (PLATFORM_FREEBSD) /* for amsdu TP improvement,Creator: Thomas */ int a_len, padding_len; u16 eth_type, nSubframe_Length; u8 nr_subframes, i; @@ -2651,14 +2628,14 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) #ifndef PLATFORM_FREEBSD unsigned char *data_ptr; _pkt *sub_skb,*subframes[MAX_SUBFRAME_COUNT]; -#endif //PLATFORM_FREEBSD +#endif /* PLATFORM_FREEBSD */ struct recv_priv *precvpriv = &padapter->recvpriv; _queue *pfree_recv_queue = &(precvpriv->free_recv_queue); int ret = _SUCCESS; #ifdef PLATFORM_FREEBSD struct mbuf *sub_m=NULL, *subframes[MAX_SUBFRAME_COUNT]; u8 *ptr,offset; -#endif //PLATFORM_FREEBSD +#endif /* PLATFORM_FREEBSD */ nr_subframes = 0; pattrib = &prframe->u.hdr.attrib; @@ -2699,7 +2676,7 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) _rtw_memcpy(data_ptr, pdata, nSubframe_Length); } else -#endif // CONFIG_SKB_COPY +#endif /* CONFIG_SKB_COPY */ { sub_skb = skb_clone(prframe->u.hdr.pkt, GFP_ATOMIC); if (sub_skb) @@ -2715,24 +2692,24 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) } } -#else // PLATFORM_FREEBSD +#else /* PLATFORM_FREEBSD */ - //PLATFORM_FREEBSD - //Allocate a mbuff, - //sub_m =m_devget(pdata, nSubframe_Length+12, 12, padapter->pifp,NULL); + /* PLATFORM_FREEBSD */ + /* Allocate a mbuff, */ + /* sub_m =m_devget(pdata, nSubframe_Length+12, 12, padapter->pifp,NULL); */ sub_m =m_devget(pdata, nSubframe_Length+ETH_HLEN, ETHER_ALIGN, padapter->pifp,NULL); pdata += ETH_HLEN; a_len -= ETH_HLEN; -#endif // PLATFORM_FREEBSD +#endif /* PLATFORM_FREEBSD */ #ifndef PLATFORM_FREEBSD - //sub_skb->dev = padapter->pnetdev; + /* sub_skb->dev = padapter->pnetdev; */ subframes[nr_subframes++] = sub_skb; -#else //PLATFORM_FREEBSD - //PLATFORM_FREEBSD +#else /* PLATFORM_FREEBSD */ + /* PLATFORM_FREEBSD */ subframes[nr_subframes++] = sub_m; -#endif //PLATFORM_FREEBSD +#endif /* PLATFORM_FREEBSD */ if (nr_subframes >= MAX_SUBFRAME_COUNT) { DBG_88E("ParseSubframe(): Too many Subframes! Packets dropped!\n"); @@ -2779,18 +2756,18 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) /* Indicat the packets to upper layer */ if (sub_skb) { - //memset(sub_skb->cb, 0, sizeof(sub_skb->cb)); + /* memset(sub_skb->cb, 0, sizeof(sub_skb->cb)); */ #ifdef CONFIG_BR_EXT - // Insert NAT2.5 RX here! + /* Insert NAT2.5 RX here! */ struct mlme_priv *pmlmepriv = &padapter->mlmepriv; #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) rcu_read_lock(); 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 */ sub_skb->protocol = eth_type_trans(sub_skb, padapter->pnetdev); sub_skb->dev = padapter->pnetdev; @@ -2802,13 +2779,13 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) } #else /* !CONFIG_TCP_CSUM_OFFLOAD_RX */ sub_skb->ip_summed = CHECKSUM_NONE; -#endif //CONFIG_TCP_CSUM_OFFLOAD_RX +#endif /* CONFIG_TCP_CSUM_OFFLOAD_RX */ netif_rx(sub_skb); } -#else //PLATFORM_FREEBSD +#else /* PLATFORM_FREEBSD */ - //PLATFORM_FREEBSD + /* PLATFORM_FREEBSD */ sub_m = subframes[i]; ptr=mtod(sub_m, u8 *); offset=ETH_HLEN; @@ -2847,24 +2824,24 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) if (_IF_QLEN(&precvpriv->rx_indicate_queue) <= 1) { taskqueue_enqueue(taskqueue_thread, &precvpriv->rx_indicate_tasklet); } -#else // CONFIG_RX_INDICATE_QUEUE +#else /* CONFIG_RX_INDICATE_QUEUE */ (*padapter->pifp->if_input)(padapter->pifp, sub_m); -#endif // CONFIG_RX_INDICATE_QUEUE +#endif /* CONFIG_RX_INDICATE_QUEUE */ } -#endif //PLATFORM_FREEBSD +#endif /* PLATFORM_FREEBSD */ } exit: prframe->u.hdr.len=0; - rtw_free_recvframe(prframe, pfree_recv_queue);//free this recv_frame + rtw_free_recvframe(prframe, pfree_recv_queue);/* free this recv_frame */ return ret; -#else // || defined (PLATFORM_LINUX) || defined (PLATFORM_FREEBSD) +#else /* || defined (PLATFORM_LINUX) || defined (PLATFORM_FREEBSD) */ #ifdef PLATFORM_WINDOWS _irqL irql; -#endif //PLATFORM_WINDOWS +#endif /* PLATFORM_WINDOWS */ unsigned char *ptr, *pdata, *pbuf, *psnap_type; union recv_frame *pnrframe, *pnrframe_new; int a_len, mv_len, padding_len; @@ -2877,7 +2854,7 @@ exit: int ret = _SUCCESS; #ifdef PLATFORM_WINDOWS struct recv_buf *precvbuf = prframe->u.hdr.precvbuf; -#endif //PLATFORM_WINDOWS +#endif /* PLATFORM_WINDOWS */ a_len = prframe->u.hdr.len - prframe->u.hdr.attrib.hdrlen; recvframe_pull(prframe, prframe->u.hdr.attrib.hdrlen); @@ -2911,11 +2888,11 @@ exit: ptr +=2; mv_len += ETH_HLEN; - recvframe_put(pnrframe, type_len+ETH_HLEN);//update tail; + recvframe_put(pnrframe, type_len+ETH_HLEN);/* update tail; */ if (pnrframe->u.hdr.rx_data >= pnrframe->u.hdr.rx_tail || type_len<8) { - //panic("pnrframe->u.hdr.rx_data >= pnrframe->u.hdr.rx_tail || type_len<8\n"); + /* panic("pnrframe->u.hdr.rx_data >= pnrframe->u.hdr.rx_tail || type_len<8\n"); */ rtw_free_recvframe(pnrframe, pfree_recv_queue); @@ -2928,24 +2905,24 @@ exit: { if ( _rtw_memcmp(psnap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN)) { - bsnaphdr=true;//wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_RFC1042; + bsnaphdr=true;/* wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_RFC1042; */ } else if (_rtw_memcmp(psnap->oui, SNAP_HDR_APPLETALK_DDP, WLAN_IEEE_OUI_LEN) && _rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_DDP, 2) ) { - bsnaphdr=true; //wlan_pkt_format = WLAN_PKT_FORMAT_APPLETALK; + bsnaphdr=true; /* wlan_pkt_format = WLAN_PKT_FORMAT_APPLETALK; */ } else if (_rtw_memcmp( psnap->oui, oui_8021h, WLAN_IEEE_OUI_LEN)) { - bsnaphdr=true; //wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_TUNNEL; + bsnaphdr=true; /* wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_TUNNEL; */ } else { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("drop pkt due to invalid frame format!\n")); - //KeBugCheckEx(0x87123333, 0xe0, 0x4c, 0x87, 0xdd); + /* KeBugCheckEx(0x87123333, 0xe0, 0x4c, 0x87, 0xdd); */ - //panic("0x87123333, 0xe0, 0x4c, 0x87, 0xdd\n"); + /* panic("0x87123333, 0xe0, 0x4c, 0x87, 0xdd\n"); */ rtw_free_recvframe(pnrframe, pfree_recv_queue); @@ -2955,25 +2932,25 @@ exit: } else { - bsnaphdr=false;//wlan_pkt_format = WLAN_PKT_FORMAT_OTHERS; + bsnaphdr=false;/* wlan_pkt_format = WLAN_PKT_FORMAT_OTHERS; */ } ptr += (bsnaphdr?SNAP_SIZE:0); _rtw_memcpy(ð_type, ptr, 2); - eth_type= ntohs((unsigned short )eth_type); //pattrib->ether_type + eth_type= ntohs((unsigned short )eth_type); /* pattrib->ether_type */ mv_len+= 2+(bsnaphdr?SNAP_SIZE:0); - ptr += 2;//now move to iphdr; + ptr += 2;/* now move to iphdr; */ pvlan = NULL; - if (eth_type == 0x8100) //vlan + if (eth_type == 0x8100) /* vlan */ { pvlan = (struct _vlan *)ptr; ptr+=4; mv_len+=4; } - if (eth_type==0x0800)//ip + if (eth_type==0x0800)/* ip */ { struct iphdr* piphdr = (struct iphdr*)ptr; @@ -2990,18 +2967,18 @@ exit: UINT32 UserPriority = pnrframe->u.hdr.attrib.priority; UINT32 VlanID = (pvlan!=NULL ? get_vlan_id(pvlan) : 0 ); - VlanPriInfo.Value = // Get current value. + VlanPriInfo.Value = /* Get current value. */ NDIS_PER_PACKET_INFO_FROM_PACKET(pnrframe->u.hdr.pkt, Ieee8021QInfo); VlanPriInfo.TagHeader.UserPriority = UserPriority; VlanPriInfo.TagHeader.VlanId = VlanID; - VlanPriInfo.TagHeader.CanonicalFormatId = 0; // Should be zero. - VlanPriInfo.TagHeader.Reserved = 0; // Should be zero. + VlanPriInfo.TagHeader.CanonicalFormatId = 0; /* Should be zero. */ + VlanPriInfo.TagHeader.Reserved = 0; /* Should be zero. */ NDIS_PER_PACKET_INFO_FROM_PACKET(pnrframe->u.hdr.pkt, Ieee8021QInfo) = VlanPriInfo.Value; } -#endif //PLATFORM_OS_XP +#endif /* PLATFORM_OS_XP */ pbuf = recvframe_pull(pnrframe, (mv_len-sizeof(struct ethhdr))); @@ -3028,7 +3005,7 @@ exit: { #ifdef PLATFORM_LINUX _pkt *pskb = pnrframe->u.hdr.pkt; -#endif //PLATFORM_LINUX +#endif /* PLATFORM_LINUX */ _rtw_init_listhead(&pnrframe_new->u.hdr.list); pnrframe_new->u.hdr.len=0; @@ -3038,36 +3015,36 @@ exit: { pnrframe_new->u.hdr.pkt = skb_clone(pskb, GFP_ATOMIC); } -#endif //PLATFORM_LINUX +#endif /* PLATFORM_LINUX */ } pdata += (type_len + ETH_HLEN + padding_len); pnrframe_new->u.hdr.rx_head = pnrframe_new->u.hdr.rx_data = pnrframe_new->u.hdr.rx_tail = pdata; - pnrframe_new->u.hdr.rx_end = pdata + a_len + padding_len;// + pnrframe_new->u.hdr.rx_end = pdata + a_len + padding_len;/* */ #ifdef PLATFORM_WINDOWS pnrframe_new->u.hdr.precvbuf=precvbuf; _enter_critical_bh(&precvbuf->recvbuf_lock, &irql); precvbuf->ref_cnt++; _exit_critical_bh(&precvbuf->recvbuf_lock, &irql); -#endif //PLATFORM_WINDOWS +#endif /* PLATFORM_WINDOWS */ } else { - //panic("pnrframe_new=%x\n", pnrframe_new); + /* panic("pnrframe_new=%x\n", pnrframe_new); */ } } if ((padapter->bDriverStopped ==false)&&( padapter->bSurpriseRemoved==false) ) { - rtw_recv_indicatepkt(padapter, pnrframe);//indicate this recv_frame + rtw_recv_indicatepkt(padapter, pnrframe);/* indicate this recv_frame */ } else { - rtw_free_recvframe(pnrframe, pfree_recv_queue);//free this recv_frame + rtw_free_recvframe(pnrframe, pfree_recv_queue);/* free this recv_frame */ } @@ -3088,9 +3065,9 @@ exit: static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num) { u8 wsize = preorder_ctrl->wsize_b; - u16 wend = (preorder_ctrl->indicate_seq + wsize -1) & 0xFFF;//% 4096; + u16 wend = (preorder_ctrl->indicate_seq + wsize -1) & 0xFFF;/* 4096; */ - // Rx Reorder initialize condition. + /* Rx Reorder initialize condition. */ if (preorder_ctrl->indicate_seq == 0xFFFF) { preorder_ctrl->indicate_seq = seq_num; @@ -3099,16 +3076,16 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n preorder_ctrl->indicate_seq, seq_num); #endif - //DbgPrint("check_indicate_seq, 1st->indicate_seq=%d\n", precvpriv->indicate_seq); + /* DbgPrint("check_indicate_seq, 1st->indicate_seq=%d\n", precvpriv->indicate_seq); */ } - //DbgPrint("enter->check_indicate_seq(): IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); + /* DbgPrint("enter->check_indicate_seq(): IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */ - // Drop out the packet which SeqNum is smaller than WinStart + /* Drop out the packet which SeqNum is smaller than WinStart */ if ( SN_LESS(seq_num, preorder_ctrl->indicate_seq) ) { - //RT_TRACE(COMP_RX_REORDER, DBG_LOUD, ("CheckRxTsIndicateSeq(): Packet Drop! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, NewSeqNum)); - //DbgPrint("CheckRxTsIndicateSeq(): Packet Drop! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); + /* RT_TRACE(COMP_RX_REORDER, DBG_LOUD, ("CheckRxTsIndicateSeq(): Packet Drop! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, NewSeqNum)); */ + /* DbgPrint("CheckRxTsIndicateSeq(): Packet Drop! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */ #ifdef DBG_RX_DROP_FRAME DBG_88E("%s IndicateSeq: %d > NewSeq: %d\n", __func__, @@ -3119,11 +3096,11 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n return false; } - // - // Sliding window manipulation. Conditions includes: - // 1. Incoming SeqNum is equal to WinStart =>Window shift 1 - // 2. Incoming SeqNum is larger than the WinEnd => Window shift N - // + /* */ + /* Sliding window manipulation. Conditions includes: */ + /* 1. Incoming SeqNum is equal to WinStart =>Window shift 1 */ + /* 2. Incoming SeqNum is larger than the WinEnd => Window shift N */ + /* */ if ( SN_EQUAL(seq_num, preorder_ctrl->indicate_seq) ) { preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1) & 0xFFF; @@ -3134,10 +3111,10 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n } else if (SN_LESS(wend, seq_num)) { - //RT_TRACE(COMP_RX_REORDER, DBG_LOUD, ("CheckRxTsIndicateSeq(): Window Shift! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, NewSeqNum)); - //DbgPrint("CheckRxTsIndicateSeq(): Window Shift! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); + /* RT_TRACE(COMP_RX_REORDER, DBG_LOUD, ("CheckRxTsIndicateSeq(): Window Shift! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, NewSeqNum)); */ + /* DbgPrint("CheckRxTsIndicateSeq(): Window Shift! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */ - // boundary situation, when seq_num cross 0xFFF + /* boundary situation, when seq_num cross 0xFFF */ if (seq_num >= (wsize - 1)) preorder_ctrl->indicate_seq = seq_num + 1 -wsize; else @@ -3149,7 +3126,7 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n #endif } - //DbgPrint("exit->check_indicate_seq(): IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); + /* DbgPrint("exit->check_indicate_seq(): IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */ return true; } @@ -3196,7 +3173,7 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct phead = get_list_head(ppending_recvframe_queue); plist = get_next(phead); - // Handling some condition for forced indicate case. + /* Handling some condition for forced indicate case. */ if (bforced==true) { if (rtw_is_list_empty(phead)) return true; @@ -3210,8 +3187,8 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct #endif } - // Prepare indication list and indication. - // Check if there is any packet need indicate. + /* Prepare indication list and indication. */ + /* Check if there is any packet need indicate. */ while (!rtw_is_list_empty(phead)) { prframe = LIST_CONTAINOR(plist, union recv_frame, u); @@ -3234,16 +3211,16 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct } - //Set this as a lock to make sure that only one thread is indicating packet. + /* Set this as a lock to make sure that only one thread is indicating packet. */ - //indicate this recv_frame + /* indicate this recv_frame */ if (!pattrib->amsdu) { if ((padapter->bDriverStopped == false) && (padapter->bSurpriseRemoved == false)) { - rtw_recv_indicatepkt(padapter, prframe);//indicate this recv_frame + rtw_recv_indicatepkt(padapter, prframe);/* indicate this recv_frame */ } } @@ -3256,11 +3233,11 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct } else { - //error condition; + /* error condition; */ } - //Update local variables. + /* Update local variables. */ bPktInBuf = false; } @@ -3269,37 +3246,10 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct bPktInBuf = true; break; } - - //DbgPrint("recv_indicatepkts_in_order():while\n"); - } - - //_rtw_spinunlock_ex(&ppending_recvframe_queue->lock); - //_exit_critical_ex(&ppending_recvframe_queue->lock, &irql); - -/* - //Release the indication lock and set to new indication step. - if (bPktInBuf) - { - // Set new pending timer. - //pTS->RxIndicateState = RXTS_INDICATE_REORDER; - //PlatformSetTimer(Adapter, &pTS->RxPktPendingTimer, pHTInfo->RxReorderPendingTime); - //DBG_88E("_set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME)\n"); - _set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME); - } - else - { - //pTS->RxIndicateState = RXTS_INDICATE_IDLE; - } -*/ - //_exit_critical_ex(&ppending_recvframe_queue->lock, &irql); - - //return true; return bPktInBuf; - } -int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe); int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe) { _irqL irql; @@ -3310,7 +3260,7 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe) if (!pattrib->amsdu) { - //s1. + /* s1. */ wlanhdr_to_ethhdr(prframe); if ((pattrib->qos!=1) /*|| pattrib->priority!=0 || IS_MCAST(pattrib->ra)*/ @@ -3336,7 +3286,7 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe) if (preorder_ctrl->enable == false) { - //indicate this recv_frame + /* indicate this recv_frame */ preorder_ctrl->indicate_seq = pattrib->seq_num; #ifdef DBG_RX_SEQ DBG_88E("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __func__, __LINE__, @@ -3355,13 +3305,13 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe) } #ifndef CONFIG_RECV_REORDERING_CTRL - //indicate this recv_frame + /* indicate this recv_frame */ rtw_recv_indicatepkt(padapter, prframe); return _SUCCESS; #endif } - else if (pattrib->amsdu==1) //temp filter -> means didn't support A-MSDUs in a A-MPDU + else if (pattrib->amsdu==1) /* temp filter -> means didn't support A-MSDUs in a A-MPDU */ { if (preorder_ctrl->enable == false) { @@ -3399,14 +3349,14 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe) ("recv_indicatepkt_reorder: indicate=%d seq=%d\n", preorder_ctrl->indicate_seq, pattrib->seq_num)); - //s2. check if winstart_b(indicate_seq) needs to been updated + /* s2. check if winstart_b(indicate_seq) needs to been updated */ if (!check_indicate_seq(preorder_ctrl, pattrib->seq_num)) { - //pHTInfo->RxReorderDropCounter++; - //ReturnRFDList(Adapter, pRfd); - //RT_TRACE(COMP_RX_REORDER, DBG_TRACE, ("RxReorderIndicatePacket() ==> Packet Drop!!\n")); - //_exit_critical_ex(&ppending_recvframe_queue->lock, &irql); - //return _FAIL; + /* pHTInfo->RxReorderDropCounter++; */ + /* ReturnRFDList(Adapter, pRfd); */ + /* RT_TRACE(COMP_RX_REORDER, DBG_TRACE, ("RxReorderIndicatePacket() ==> Packet Drop!!\n")); */ + /* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */ + /* return _FAIL; */ #ifdef DBG_RX_DROP_FRAME DBG_88E("DBG_RX_DROP_FRAME %s check_indicate_seq fail\n", __func__); @@ -3420,12 +3370,12 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe) } - //s3. Insert all packet into Reorder Queue to maintain its ordering. + /* s3. Insert all packet into Reorder Queue to maintain its ordering. */ if (!enqueue_reorder_recvframe(preorder_ctrl, prframe)) { - //DbgPrint("recv_indicatepkt_reorder, enqueue_reorder_recvframe fail!\n"); - //_exit_critical_ex(&ppending_recvframe_queue->lock, &irql); - //return _FAIL; + /* DbgPrint("recv_indicatepkt_reorder, enqueue_reorder_recvframe fail!\n"); */ + /* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */ + /* return _FAIL; */ #ifdef DBG_RX_DROP_FRAME DBG_88E("DBG_RX_DROP_FRAME %s enqueue_reorder_recvframe fail\n", __func__); #endif @@ -3433,17 +3383,17 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe) } - //s4. - // Indication process. - // After Packet dropping and Sliding Window shifting as above, we can now just indicate the packets - // with the SeqNum smaller than latest WinStart and buffer other packets. - // - // For Rx Reorder condition: - // 1. All packets with SeqNum smaller than WinStart => Indicate - // 2. All packets with SeqNum larger than or equal to WinStart => Buffer it. - // + /* s4. */ + /* Indication process. */ + /* After Packet dropping and Sliding Window shifting as above, we can now just indicate the packets */ + /* with the SeqNum smaller than latest WinStart and buffer other packets. */ + /* */ + /* For Rx Reorder condition: */ + /* 1. All packets with SeqNum smaller than WinStart => Indicate */ + /* 2. All packets with SeqNum larger than or equal to WinStart => Buffer it. */ + /* */ - //recv_indicatepkts_in_order(padapter, preorder_ctrl, true); + /* recv_indicatepkts_in_order(padapter, preorder_ctrl, true); */ if (recv_indicatepkts_in_order(padapter, preorder_ctrl, false)==true) { _set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME); @@ -3481,7 +3431,7 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext) return; } - //DBG_88E("+rtw_reordering_ctrl_timeout_handler()=>\n"); + /* DBG_88E("+rtw_reordering_ctrl_timeout_handler()=>\n"); */ _enter_critical_bh(&ppending_recvframe_queue->lock, &irql); @@ -3498,12 +3448,12 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe); int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe) { int retval = _SUCCESS; - //struct recv_priv *precvpriv = &padapter->recvpriv; - //struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; + /* struct recv_priv *precvpriv = &padapter->recvpriv; */ + /* struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; */ struct mlme_priv *pmlmepriv = &padapter->mlmepriv; #ifdef CONFIG_TDLS struct sta_info *psta = prframe->u.hdr.psta; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ #ifdef CONFIG_80211N_HT @@ -3513,14 +3463,14 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe) if ( (phtpriv->ht_option==true) || ((psta->tdls_sta_state & TDLS_LINKED_STATE) && (psta->htpriv.ht_option==true) && - (psta->htpriv.ampdu_enable==true))) //B/G/N Mode + (psta->htpriv.ampdu_enable==true))) /* B/G/N Mode */ #else - if (phtpriv->ht_option==true) //B/G/N Mode -#endif //CONFIG_TDLS + if (phtpriv->ht_option==true) /* B/G/N Mode */ +#endif /* CONFIG_TDLS */ { - //prframe->u.hdr.preorder_ctrl = &precvpriv->recvreorder_ctrl[pattrib->priority]; + /* prframe->u.hdr.preorder_ctrl = &precvpriv->recvreorder_ctrl[pattrib->priority]; */ - if (recv_indicatepkt_reorder(padapter, prframe)!=_SUCCESS)// including perform A-MPDU Rx Ordering Buffer Control + if (recv_indicatepkt_reorder(padapter, prframe)!=_SUCCESS)/* including perform A-MPDU Rx Ordering Buffer Control */ { #ifdef DBG_RX_DROP_FRAME DBG_88E("DBG_RX_DROP_FRAME %s recv_indicatepkt_reorder error!\n", __func__); @@ -3534,7 +3484,7 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe) } } } - else //B/G mode + else /* B/G mode */ #endif { retval=wlanhdr_to_ethhdr (prframe); @@ -3549,7 +3499,7 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe) if ((padapter->bDriverStopped ==false)&&( padapter->bSurpriseRemoved==false)) { - //indicate this recv_frame + /* indicate this recv_frame */ RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("@@@@ process_recv_indicatepkts- recv_func recv_indicatepkt\n" )); rtw_recv_indicatepkt(padapter, prframe); @@ -3579,12 +3529,12 @@ static int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe) #ifdef CONFIG_MP_INCLUDED struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -#endif //CONFIG_MP_INCLUDED +#endif /* CONFIG_MP_INCLUDED */ #ifdef CONFIG_MP_INCLUDED if (padapter->registrypriv.mp_mode == 1) { - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true))//&&(padapter->mppriv.check_mp_pkt == 0)) + if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true))/* padapter->mppriv.check_mp_pkt == 0)) */ { if (pattrib->crc_err == 1) padapter->mppriv.rx_crcerrpktcount++; @@ -3594,19 +3544,19 @@ static int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe) if (check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE) == false) { RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("MP - Not in loopback mode , drop pkt\n")); ret = _FAIL; - rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame + rtw_free_recvframe(rframe, pfree_recv_queue);/* free this recv_frame */ goto exit; } } } #endif - //check the frame crtl field and decache + /* check the frame crtl field and decache */ ret = validate_recv_frame(padapter, rframe); if (ret != _SUCCESS) { RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("recv_func: validate_recv_frame fail! drop pkt\n")); - rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame + rtw_free_recvframe(rframe, pfree_recv_queue);/* free this recv_frame */ goto exit; } @@ -3626,10 +3576,10 @@ static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) #ifdef CONFIG_TDLS u8 *psnap_type, *pcategory; struct sta_info *ptdls_sta = NULL; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ - // DATA FRAME + /* DATA FRAME */ rtw_led_control(padapter, LED_CTL_RX); prframe = decryptor(padapter, prframe); @@ -3643,17 +3593,17 @@ static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) } #ifdef CONFIG_TDLS - //check TDLS frame + /* check TDLS frame */ psnap_type = get_recvframe_data(orig_prframe); psnap_type+=pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE; pcategory = psnap_type + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN; if ((_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, ETH_TYPE_LEN)) && ((*pcategory==RTW_WLAN_CATEGORY_TDLS) || (*pcategory==RTW_WLAN_CATEGORY_P2P))){ - ret = OnTDLS(padapter, prframe); //all of functions will return _FAIL + ret = OnTDLS(padapter, prframe); /* all of functions will return _FAIL */ goto _exit_recv_func; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ prframe = recvframe_chk_defrag(padapter, prframe); if (prframe==NULL) { @@ -3680,7 +3630,7 @@ static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) count_rx_stats(padapter, prframe, ptdls_sta); #else count_rx_stats(padapter, prframe, NULL); -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ #ifdef CONFIG_WAPI_SUPPORT rtw_wapi_update_info(padapter, prframe); @@ -3694,10 +3644,10 @@ static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) #ifdef DBG_RX_DROP_FRAME DBG_88E("DBG_RX_DROP_FRAME %s process_recv_indicatepkts fail!\n", __func__); #endif - rtw_free_recvframe(orig_prframe, pfree_recv_queue);//free this recv_frame + rtw_free_recvframe(orig_prframe, pfree_recv_queue);/* free this recv_frame */ goto _recv_data_drop; } -#else // CONFIG_80211N_HT +#else /* CONFIG_80211N_HT */ if (!pattrib->amsdu) { ret = wlanhdr_to_ethhdr (prframe); @@ -3707,14 +3657,14 @@ static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) #ifdef DBG_RX_DROP_FRAME DBG_88E("DBG_RX_DROP_FRAME %s wlanhdr_to_ethhdr: drop pkt\n", __func__); #endif - rtw_free_recvframe(orig_prframe, pfree_recv_queue);//free this recv_frame + rtw_free_recvframe(orig_prframe, pfree_recv_queue);/* free this recv_frame */ goto _recv_data_drop; } if ((padapter->bDriverStopped == false) && (padapter->bSurpriseRemoved == false)) { RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("@@@@ recv_func: recv_func rtw_recv_indicatepkt\n" )); - //indicate this recv_frame + /* indicate this recv_frame */ ret = rtw_recv_indicatepkt(padapter, prframe); if (ret != _SUCCESS) { @@ -3733,7 +3683,7 @@ static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) padapter->bDriverStopped, padapter->bSurpriseRemoved); #endif ret = _FAIL; - rtw_free_recvframe(orig_prframe, pfree_recv_queue); //free this recv_frame + rtw_free_recvframe(orig_prframe, pfree_recv_queue); /* free this recv_frame */ } } @@ -3757,7 +3707,7 @@ static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) #endif goto _recv_data_drop; } -#endif // CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ _exit_recv_func: return ret; @@ -3820,7 +3770,7 @@ s32 rtw_recv_entry(union recv_frame *precvframe) _func_enter_; -// RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("+rtw_recv_entry\n")); +/* RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("+rtw_recv_entry\n")); */ padapter = precvframe->u.hdr.adapter; @@ -3847,7 +3797,7 @@ _recv_entry_drop: padapter->mppriv.rx_pktloss = precvpriv->rx_drop; #endif - //RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("_recv_entry_drop\n")); + /* RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("_recv_entry_drop\n")); */ _func_exit_; @@ -3868,33 +3818,33 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){ #if defined(DBG_RX_SIGNAL_DISPLAY_PROCESSING) u32 num_signal_qual = 0; #endif - u8 _alpha = 3; // this value is based on converging_constant = 5000 and sampling_interval = 1000 + u8 _alpha = 3; /* this value is based on converging_constant = 5000 and sampling_interval = 1000 */ if (adapter->recvpriv.is_signal_dbg) { - //update the user specific value, signal_strength_dbg, to signal_strength, rssi + /* update the user specific value, signal_strength_dbg, to signal_strength, rssi */ adapter->recvpriv.signal_strength= adapter->recvpriv.signal_strength_dbg; adapter->recvpriv.rssi=(s8)translate_percentage_to_dbm((u8)adapter->recvpriv.signal_strength_dbg); } else { - if (recvpriv->signal_strength_data.update_req == 0) {// update_req is clear, means we got rx + if (recvpriv->signal_strength_data.update_req == 0) {/* update_req is clear, means we got rx */ avg_signal_strength = recvpriv->signal_strength_data.avg_val; #if defined(DBG_RX_SIGNAL_DISPLAY_PROCESSING) num_signal_strength = recvpriv->signal_strength_data.total_num; #endif - // after avg_vals are accquired, we can re-stat the signal values + /* after avg_vals are accquired, we can re-stat the signal values */ recvpriv->signal_strength_data.update_req = 1; } - if (recvpriv->signal_qual_data.update_req == 0) {// update_req is clear, means we got rx + if (recvpriv->signal_qual_data.update_req == 0) {/* update_req is clear, means we got rx */ avg_signal_qual = recvpriv->signal_qual_data.avg_val; #if defined(DBG_RX_SIGNAL_DISPLAY_PROCESSING) num_signal_qual = recvpriv->signal_qual_data.total_num; #endif - // after avg_vals are accquired, we can re-stat the signal values + /* after avg_vals are accquired, we can re-stat the signal values */ recvpriv->signal_qual_data.update_req = 1; } - //update value of signal_strength, rssi, signal_qual + /* update value of signal_strength, rssi, signal_qual */ if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == false) { tmp_s = (avg_signal_strength+(_alpha-1)*recvpriv->signal_strength); if (tmp_s %_alpha) @@ -3932,4 +3882,4 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){ rtw_set_signal_stat_timer(recvpriv); } -#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS +#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */ diff --git a/core/rtw_security.c b/core/rtw_security.c index 876bce0..95bdeb6 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -26,7 +26,7 @@ #include -//=====WEP related===== +/* WEP related===== */ #define CRC32_POLY 0x04c11db7 @@ -160,7 +160,7 @@ _func_exit_; Need to consider the fragment situation */ void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe) -{ // exclude ICV +{ /* exclude ICV */ unsigned char crc[4]; struct arc4context mycontext; @@ -168,7 +168,7 @@ void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe) sint curfragnum,length; u32 keylength; - u8 *pframe, *payload,*iv; //,*wepkey + u8 *pframe, *payload,*iv; /* wepkey */ u8 wepkey[16]; u8 hw_hdr_offset=0; struct pkt_attrib *pattrib = &((struct xmit_frame*)pxmitframe)->attrib; @@ -194,7 +194,7 @@ _func_enter_; pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset; - //start to encrypt each fragment + /* start to encrypt each fragment */ if ((pattrib->encrypt==_WEP40_)||(pattrib->encrypt==_WEP104_)) { keylength=psecuritypriv->dot11DefKeylen[psecuritypriv->dot11PrivacyKeyIndex]; @@ -207,7 +207,7 @@ _func_enter_; payload=pframe+pattrib->iv_len+pattrib->hdrlen; if ((curfragnum+1)==pattrib->nr_frags) - { //the last fragment + { /* the last fragment */ length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len; @@ -241,7 +241,7 @@ _func_exit_; void rtw_wep_decrypt(_adapter *padapter, u8 *precvframe) { - // exclude ICV + /* exclude ICV */ u8 crc[4]; struct arc4context mycontext; sint length; @@ -255,7 +255,7 @@ _func_enter_; pframe = (unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data; - //start to decrypt recvframe + /* start to decrypt recvframe */ if ((prxattrib->encrypt==_WEP40_)||(prxattrib->encrypt==_WEP104_)) { iv=pframe+prxattrib->hdrlen; keyindex = prxattrib->key_index; @@ -266,11 +266,11 @@ _func_enter_; payload=pframe+prxattrib->iv_len+prxattrib->hdrlen; - //decrypt payload include icv + /* decrypt payload include icv */ arcfour_init(&mycontext, wepkey,3+keylength); arcfour_encrypt(&mycontext, payload, payload, length); - //calculate icv and compare the icv + /* calculate icv and compare the icv */ *((__le32 *)crc) = getcrc32(payload, length - 4); if (crc[3] != payload[length-1] || @@ -286,10 +286,10 @@ _func_exit_; return; } -//3 =====TKIP related===== +/* 3 =====TKIP related===== */ static u32 secmicgetuint32( u8 * p ) -// Convert from Byte[] to Us4Byte32 in a portable way +/* Convert from Byte[] to Us4Byte32 in a portable way */ { s32 i; u32 res = 0; @@ -303,7 +303,7 @@ _func_exit_; } static void secmicputuint32( u8 * p, u32 val ) -// Convert from Us4Byte32 to Byte[] in a portable way +/* Convert from Us4Byte32 to Byte[] in a portable way */ { long i; _func_enter_; @@ -317,7 +317,7 @@ _func_exit_; static void secmicclear(struct mic_data *pmicdata) { -// Reset the state to the empty message. +/* Reset the state to the empty message. */ _func_enter_; pmicdata->L = pmicdata->K0; pmicdata->R = pmicdata->K1; @@ -328,11 +328,11 @@ _func_exit_; void rtw_secmicsetkey(struct mic_data *pmicdata, u8 * key ) { - // Set the key + /* Set the key */ _func_enter_; pmicdata->K0 = secmicgetuint32( key ); pmicdata->K1 = secmicgetuint32( key + 4 ); - // and reset the message + /* and reset the message */ secmicclear(pmicdata); _func_exit_; } @@ -340,10 +340,10 @@ _func_exit_; void rtw_secmicappendbyte(struct mic_data *pmicdata, u8 b ) { _func_enter_; - // Append the byte to our word-sized buffer + /* Append the byte to our word-sized buffer */ pmicdata->M |= ((unsigned long)b) << (8*pmicdata->nBytesInM); pmicdata->nBytesInM++; - // Process the word if it is full. + /* Process the word if it is full. */ if ( pmicdata->nBytesInM >= 4 ) { pmicdata->L ^= pmicdata->M; @@ -355,7 +355,7 @@ _func_enter_; pmicdata->L += pmicdata->R; pmicdata->R ^= ROR32( pmicdata->L, 2 ); pmicdata->L += pmicdata->R; - // Clear the buffer + /* Clear the buffer */ pmicdata->M = 0; pmicdata->nBytesInM = 0; } @@ -365,7 +365,7 @@ _func_exit_; void rtw_secmicappend(struct mic_data *pmicdata, u8 * src, u32 nbytes ) { _func_enter_; - // This is simple + /* This is simple */ while ( nbytes > 0 ) { rtw_secmicappendbyte(pmicdata, *src++ ); @@ -377,21 +377,21 @@ _func_exit_; void rtw_secgetmic(struct mic_data *pmicdata, u8 * dst ) { _func_enter_; - // Append the minimum padding + /* Append the minimum padding */ rtw_secmicappendbyte(pmicdata, 0x5a ); rtw_secmicappendbyte(pmicdata, 0 ); rtw_secmicappendbyte(pmicdata, 0 ); rtw_secmicappendbyte(pmicdata, 0 ); rtw_secmicappendbyte(pmicdata, 0 ); - // and then zeroes until the length is a multiple of 4 + /* and then zeroes until the length is a multiple of 4 */ while ( pmicdata->nBytesInM != 0 ) { rtw_secmicappendbyte(pmicdata, 0 ); } - // The appendByte function has already computed the result. + /* The appendByte function has already computed the result. */ secmicputuint32( dst, pmicdata->L ); secmicputuint32( dst+4, pmicdata->R ); - // Reset to the empty message. + /* Reset to the empty message. */ secmicclear(pmicdata); _func_exit_; } @@ -407,16 +407,16 @@ _func_enter_; priority[0]=pri; /* Michael MIC pseudo header: DA, SA, 3 x 0, Priority */ - if (header[1]&1){ //ToDS==1 - rtw_secmicappend(&micdata, &header[16], 6); //DA - if (header[1]&2) //From Ds==1 + if (header[1]&1){ /* ToDS==1 */ + rtw_secmicappend(&micdata, &header[16], 6); /* DA */ + if (header[1]&2) /* From Ds==1 */ rtw_secmicappend(&micdata, &header[24], 6); else rtw_secmicappend(&micdata, &header[10], 6); } - else{ //ToDS==0 - rtw_secmicappend(&micdata, &header[4], 6); //DA - if (header[1]&2) //From Ds==1 + else{ /* ToDS==0 */ + rtw_secmicappend(&micdata, &header[4], 6); /* DA */ + if (header[1]&2) /* From Ds==1 */ rtw_secmicappend(&micdata, &header[16], 6); else rtw_secmicappend(&micdata, &header[10], 6); @@ -642,9 +642,9 @@ _func_exit_; } -//The hlen isn't include the IV +/* The hlen isn't include the IV */ u32 rtw_tkip_encrypt(_adapter *padapter, u8 *pxmitframe) -{ // exclude ICV +{ /* exclude ICV */ u16 pnl; u32 pnh; u8 rc4key[16]; @@ -678,7 +678,7 @@ _func_enter_; #endif pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset; - //4 start to encrypt each fragment + /* 4 start to encrypt each fragment */ if (pattrib->encrypt==_TKIP_){ if (pattrib->psta) @@ -715,7 +715,7 @@ _func_enter_; phase2(&rc4key[0],prwskey,(u16 *)&ttkey[0],pnl); - if ((curfragnum+1)==pattrib->nr_frags){ //4 the last fragment + if ((curfragnum+1)==pattrib->nr_frags){ /* 4 the last fragment */ length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len; RT_TRACE(_module_rtl871x_security_c_, _drv_info_, ("pattrib->iv_len =%x, pattrib->icv_len =%x\n", @@ -754,9 +754,9 @@ _func_exit_; } -//The hlen isn't include the IV +/* The hlen isn't include the IV */ u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe) -{ // exclude ICV +{ /* exclude ICV */ u16 pnl; u32 pnh; u8 rc4key[16]; @@ -770,14 +770,14 @@ u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe) struct sta_info *stainfo; struct rx_pkt_attrib *prxattrib = &((union recv_frame *)precvframe)->u.hdr.attrib; struct security_priv *psecuritypriv=&padapter->securitypriv; -// struct recv_priv *precvpriv=&padapter->recvpriv; +/* struct recv_priv *precvpriv=&padapter->recvpriv; */ u32 res=_SUCCESS; _func_enter_; pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data; - //4 start to decrypt recvframe + /* 4 start to decrypt recvframe */ if (prxattrib->encrypt==_TKIP_){ stainfo=rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] ); @@ -791,8 +791,8 @@ _func_enter_; DBG_88E("%s:rx bc/mc packets,but didn't install group key!!!!!!!!!!\n",__func__); goto exit; } - //DBG_88E("rx bc/mc packets, to perform sw rtw_tkip_decrypt\n"); - //prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; + /* DBG_88E("rx bc/mc packets, to perform sw rtw_tkip_decrypt\n"); */ + /* prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; */ prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey; } else @@ -813,7 +813,7 @@ _func_enter_; phase1((u16 *)&ttkey[0],prwskey,&prxattrib->ta[0],pnh); phase2(&rc4key[0],prwskey,(unsigned short *)&ttkey[0],pnl); - //4 decrypt payload include icv + /* 4 decrypt payload include icv */ arcfour_init(&mycontext, rc4key,16); arcfour_encrypt(&mycontext, payload, payload, length); @@ -840,7 +840,7 @@ exit: } -//3 =====AES related===== +/* 3 =====AES related===== */ @@ -926,7 +926,7 @@ static void add_round_key( u8 *shiftrow_in, u8 *block_in, sint round, u8 *out); -#endif //PLATFORM_FREEBSD +#endif /* PLATFORM_FREEBSD */ static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext); @@ -1218,7 +1218,6 @@ _func_enter_; mic_header2[4] = mpdu[20]; mic_header2[5] = mpdu[21]; - //mic_header2[6] = mpdu[22] & 0xf0; /* SC */ mic_header2[6] = 0x00; mic_header2[7] = 0x00; /* mpdu[23]; */ @@ -1306,7 +1305,6 @@ _func_exit_; static sint aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) { -// /*static*/ unsigned char message[MAX_MSG_SIZE]; uint qc_exists, a4_exists, i, j, payload_remainder, num_blocks, payload_index; @@ -1321,7 +1319,6 @@ static sint aes_cipher(u8 *key, uint hdrlen, u8 aes_out[16]; u8 padded_buffer[16]; u8 mic[8]; -// uint offset = 0; uint frtype = GetFrameType(pframe); uint frsubtype = GetFrameSubType(pframe); @@ -1379,7 +1376,7 @@ _func_enter_; mic_iv, qc_exists, a4_exists, - pframe, //message, + pframe, /* message, */ plen, pn_vector ); @@ -1387,11 +1384,11 @@ _func_enter_; construct_mic_header1( mic_header1, hdrlen, - pframe //message + pframe /* message */ ); construct_mic_header2( mic_header2, - pframe, //message, + pframe, /* message, */ a4_exists, qc_exists ); @@ -1412,7 +1409,7 @@ _func_enter_; for (i = 0; i < num_blocks; i++) { - bitwise_xor(aes_out, &pframe[payload_index], chain_buffer);//bitwise_xor(aes_out, &message[payload_index], chain_buffer); + bitwise_xor(aes_out, &pframe[payload_index], chain_buffer);/* bitwise_xor(aes_out, &message[payload_index], chain_buffer); */ payload_index += 16; aes128k128d(key, chain_buffer, aes_out); @@ -1424,7 +1421,7 @@ _func_enter_; for (j = 0; j < 16; j++) padded_buffer[j] = 0x00; for (j = 0; j < payload_remainder; j++) { - padded_buffer[j] = pframe[payload_index++];//padded_buffer[j] = message[payload_index++]; + padded_buffer[j] = pframe[payload_index++];/* padded_buffer[j] = message[payload_index++]; */ } bitwise_xor(aes_out, padded_buffer, chain_buffer); aes128k128d(key, chain_buffer, aes_out); @@ -1435,7 +1432,7 @@ _func_enter_; /* Insert MIC into payload */ for (j = 0; j < 8; j++) - pframe[payload_index+j] = mic[j]; //message[payload_index+j] = mic[j]; + pframe[payload_index+j] = mic[j]; /* message[payload_index+j] = mic[j]; */ payload_index = hdrlen + 8; for (i=0; i< num_blocks; i++) @@ -1444,12 +1441,12 @@ _func_enter_; ctr_preload, a4_exists, qc_exists, - pframe, //message, + pframe, /* message, */ pn_vector, i+1); aes128k128d(key, ctr_preload, aes_out); - bitwise_xor(aes_out, &pframe[payload_index], chain_buffer);//bitwise_xor(aes_out, &message[payload_index], chain_buffer); - for (j=0; j<16;j++) pframe[payload_index++] = chain_buffer[j];//for (j=0; j<16;j++) message[payload_index++] = chain_buffer[j]; + bitwise_xor(aes_out, &pframe[payload_index], chain_buffer);/* bitwise_xor(aes_out, &message[payload_index], chain_buffer); */ + for (j=0; j<16;j++) pframe[payload_index++] = chain_buffer[j];/* for (j=0; j<16;j++) message[payload_index++] = chain_buffer[j]; */ } if (payload_remainder > 0) /* If there is a short final block, then pad it,*/ @@ -1458,18 +1455,18 @@ _func_enter_; ctr_preload, a4_exists, qc_exists, - pframe, //message, + pframe, /* message, */ pn_vector, num_blocks+1); for (j = 0; j < 16; j++) padded_buffer[j] = 0x00; for (j = 0; j < payload_remainder; j++) { - padded_buffer[j] = pframe[payload_index+j];//padded_buffer[j] = message[payload_index+j]; + padded_buffer[j] = pframe[payload_index+j];/* padded_buffer[j] = message[payload_index+j]; */ } aes128k128d(key, ctr_preload, aes_out); bitwise_xor(aes_out, padded_buffer, chain_buffer); - for (j=0; jattrib; struct security_priv *psecuritypriv=&padapter->securitypriv; struct xmit_priv *pxmitpriv=&padapter->xmitpriv; -// uint offset = 0; +/* uint offset = 0; */ u32 res=_SUCCESS; _func_enter_; @@ -1534,7 +1531,7 @@ _func_enter_; pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset; - //4 start to encrypt each fragment + /* 4 start to encrypt each fragment */ if ((pattrib->encrypt==_AES_)){ if (pattrib->psta) @@ -1558,7 +1555,7 @@ _func_enter_; prwskey=&stainfo->dot118021x_UncstKey.skey[0]; } -#ifdef CONFIG_TDLS //swencryption +#ifdef CONFIG_TDLS /* swencryption */ { struct sta_info *ptdls_sta; ptdls_sta=rtw_get_stainfo(&padapter->stapriv ,&pattrib->dst[0] ); @@ -1568,10 +1565,10 @@ _func_enter_; prwskey=&ptdls_sta->tpk.tk[0]; } } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ for (curfragnum=0;curfragnumnr_frags;curfragnum++){ - if ((curfragnum+1)==pattrib->nr_frags){ //4 the last fragment + if ((curfragnum+1)==pattrib->nr_frags){ /* 4 the last fragment */ length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len; aes_cipher(prwskey,pattrib->hdrlen,pframe, length); @@ -1621,7 +1618,7 @@ static sint aes_decipher(u8 *key, uint hdrlen, u8 mic[8]; -// uint offset = 0; +/* uint offset = 0; */ uint frtype = GetFrameType(pframe); uint frsubtype = GetFrameSubType(pframe); _func_enter_; @@ -1636,9 +1633,9 @@ _func_enter_; _rtw_memset((void *)aes_out, 0, 16); _rtw_memset((void *)padded_buffer, 0, 16); - //start to decrypt the payload + /* start to decrypt the payload */ - num_blocks = (plen-8) / 16; //(plen including llc, payload_length and mic ) + num_blocks = (plen-8) / 16; /* plen including llc, payload_length and mic ) */ payload_remainder = (plen-8) % 16; @@ -1681,9 +1678,9 @@ _func_enter_; qc_exists = 0; - // now, decrypt pframe with hdrlen offset and plen long + /* now, decrypt pframe with hdrlen offset and plen long */ - payload_index = hdrlen + 8; // 8 is for extiv + payload_index = hdrlen + 8; /* 8 is for extiv */ for (i=0; i< num_blocks; i++) { @@ -1723,9 +1720,9 @@ _func_enter_; for (j=0; ju.hdr.attrib; struct security_priv *psecuritypriv=&padapter->securitypriv; -// struct recv_priv *precvpriv=&padapter->recvpriv; +/* struct recv_priv *precvpriv=&padapter->recvpriv; */ u32 res=_SUCCESS; _func_enter_; pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data; - //4 start to encrypt each fragment + /* 4 start to encrypt each fragment */ if ((prxattrib->encrypt==_AES_)){ stainfo=rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] ); @@ -1897,9 +1894,9 @@ _func_enter_; if (IS_MCAST(prxattrib->ra)) { - //in concurrent we should use sw descrypt in group key, so we remove this message - //DBG_88E("rx bc/mc packets, to perform sw rtw_aes_decrypt\n"); - //prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; + /* in concurrent we should use sw descrypt in group key, so we remove this message */ + /* DBG_88E("rx bc/mc packets, to perform sw rtw_aes_decrypt\n"); */ + /* prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; */ if (psecuritypriv->binstallGrpkey==false) { res=_FAIL; @@ -2202,7 +2199,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem, _len[1] = 32; sha256_vector(2, _addr, _len, mac); } -#endif //PLATFORM_FREEBSD +#endif /* PLATFORM_FREEBSD */ /** * sha256_prf - SHA256-based Pseudo-Random Function (IEEE 802.11r, 8.5.1.5.2) * @key: Key for PRF @@ -2216,7 +2213,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem, * This function is used to derive new, cryptographically separate keys from a * given key. */ -#ifndef PLATFORM_FREEBSD //Baron +#ifndef PLATFORM_FREEBSD /* Baron */ static void sha256_prf(u8 *key, size_t key_len, char *label, u8 *data, size_t data_len, u8 *buf, size_t buf_len) { @@ -2253,7 +2250,7 @@ static void sha256_prf(u8 *key, size_t key_len, char *label, counter++; } } -#endif //PLATFORM_FREEBSD Baron +#endif /* PLATFORM_FREEBSD Baron */ /* AES tables*/ const u32 Te0[256] = { @@ -2432,7 +2429,7 @@ const u8 rcons[] = { * * @return the number of rounds for the given cipher key size. */ -#ifndef PLATFORM_FREEBSD //Baron +#ifndef PLATFORM_FREEBSD /* Baron */ static void rijndaelKeySetupEnc(u32 rk[/*44*/], const u8 cipherKey[]) { int i; @@ -2648,7 +2645,7 @@ static int omac1_aes_128(u8 *key, u8 *data, size_t data_len, u8 *mac) { return omac1_aes_128_vector(key, 1, &data, &data_len, mac); } -#endif //PLATFORM_FREEBSD Baron +#endif /* PLATFORM_FREEBSD Baron */ #ifdef CONFIG_TDLS void wpa_tdls_generate_tpk(_adapter *padapter, struct sta_info *psta) @@ -2809,16 +2806,16 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq, rx_ftie = ftie+4; if (os_memcmp(mic, rx_ftie, 16) == 0) { - //Valid MIC + /* Valid MIC */ return 1; } - //Invalid MIC + /* Invalid MIC */ DBG_88E( "[%s] Invalid MIC\n", __func__); return 0; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ #ifdef PLATFORM_WINDOWS void rtw_use_tkipkey_handler ( diff --git a/core/rtw_sreset.c b/core/rtw_sreset.c index fb88b42..53fa636 100644 --- a/core/rtw_sreset.c +++ b/core/rtw_sreset.c @@ -71,7 +71,7 @@ u8 sreset_get_wifi_status(_adapter *padapter) } DBG_88E("==> %s wifi_status(0x%x)\n",__func__,status); - //status restore + /* status restore */ psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS; return status; diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 4e8c3db..f478e5d 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -46,9 +46,9 @@ _func_enter_; _rtw_spinlock_init(&psta->lock); _rtw_init_listhead(&psta->list); _rtw_init_listhead(&psta->hash_list); - //_rtw_init_listhead(&psta->asoc_list); - //_rtw_init_listhead(&psta->sleep_list); - //_rtw_init_listhead(&psta->wakeup_list); + /* _rtw_init_listhead(&psta->asoc_list); */ + /* _rtw_init_listhead(&psta->sleep_list); */ + /* _rtw_init_listhead(&psta->wakeup_list); */ _rtw_init_queue(&psta->sleep_q); psta->sleepq_len = 0; @@ -82,11 +82,11 @@ _func_enter_; #ifdef CONFIG_TX_MCAST2UNI psta->under_exist_checking = 0; -#endif // CONFIG_TX_MCAST2UNI +#endif /* CONFIG_TX_MCAST2UNI */ psta->keep_alive_trycnt = 0; -#endif // CONFIG_AP_MODE +#endif /* CONFIG_AP_MODE */ _func_exit_; @@ -111,7 +111,7 @@ _func_enter_; _rtw_spinlock_init(&pstapriv->sta_hash_lock); - //_rtw_init_queue(&pstapriv->asoc_q); + /* _rtw_init_queue(&pstapriv->asoc_q); */ pstapriv->asoc_sta_count = 0; _rtw_init_queue(&pstapriv->sleep_q); _rtw_init_queue(&pstapriv->wakeup_q); @@ -144,14 +144,12 @@ _func_enter_; pstapriv->asoc_list_cnt = 0; pstapriv->auth_list_cnt = 0; - pstapriv->auth_to = 3; // 3*2 = 6 sec + pstapriv->auth_to = 3; /* 3*2 = 6 sec */ pstapriv->assoc_to = 3; - //pstapriv->expire_to = 900;// 900*2 = 1800 sec = 30 min, expire after no any traffic. - //pstapriv->expire_to = 30;// 30*2 = 60 sec = 1 min, expire after no any traffic. #ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK - pstapriv->expire_to = 3; // 3*2 = 6 sec + pstapriv->expire_to = 3; /* 3*2 = 6 sec */ #else - pstapriv->expire_to = 60;// 60*2 = 120 sec = 2 min, expire after no any traffic. + pstapriv->expire_to = 60;/* 60*2 = 120 sec = 2 min, expire after no any traffic. */ #endif pstapriv->max_num_sta = NUM_STA; @@ -222,7 +220,7 @@ _func_exit_; } -// this function is used to free the memory of lock || sema for all stainfos +/* this function is used to free the memory of lock || sema for all stainfos */ void rtw_mfree_all_stainfo(struct sta_priv *pstapriv ); void rtw_mfree_all_stainfo(struct sta_priv *pstapriv ) { @@ -258,7 +256,7 @@ void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv) struct wlan_acl_pool *pacl_list = &pstapriv->acl_list; #endif - rtw_mfree_all_stainfo(pstapriv); //be done before free sta_hash_lock + rtw_mfree_all_stainfo(pstapriv); /* be done before free sta_hash_lock */ _rtw_spinlock_free(&pstapriv->free_sta_queue.lock); @@ -362,10 +360,10 @@ _func_enter_; _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2); -// Commented by Albert 2009/08/13 -// For the SMC router, the sequence number of first packet of WPS handshake will be 0. -// In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable. -// So, we initialize the tid_rxseq variable as the 0xffff. +/* Commented by Albert 2009/08/13 */ +/* For the SMC router, the sequence number of first packet of WPS handshake will be 0. */ +/* In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable. */ +/* So, we initialize the tid_rxseq variable as the 0xffff. */ for ( i = 0; i < 16; i++ ) { @@ -385,9 +383,9 @@ _func_enter_; init_off_ch_timer(pstapriv->padapter, psta); init_handshake_timer(pstapriv->padapter, psta); init_tdls_alive_timer(pstapriv->padapter, psta); -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ - //for A-MPDU Rx reordering buffer control + /* for A-MPDU Rx reordering buffer control */ for (i=0; i < 16 ; i++) { preorder_ctrl = &psta->recvreorder_ctrl[i]; @@ -402,8 +400,8 @@ _func_enter_; preorder_ctrl->indicate_seq); #endif preorder_ctrl->wend_b= 0xffff; - //preorder_ctrl->wsize_b = (NR_RECVBUFF-2); - preorder_ctrl->wsize_b = 64;//64; + /* preorder_ctrl->wsize_b = (NR_RECVBUFF-2); */ + preorder_ctrl->wsize_b = 64;/* 64; */ _rtw_init_queue(&preorder_ctrl->pending_recvframe_queue); @@ -411,7 +409,7 @@ _func_enter_; } - //init for DM + /* init for DM */ psta->rssi_stat.UndecoratedSmoothedPWDB = (-1); psta->rssi_stat.UndecoratedSmoothedCCK = (-1); @@ -429,7 +427,7 @@ _func_exit_; } -// using pstapriv->sta_hash_lock to protect +/* using pstapriv->sta_hash_lock to protect */ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta) { int i; @@ -451,48 +449,48 @@ _func_enter_; pstaxmitpriv = &psta->sta_xmitpriv; - //rtw_list_delete(&psta->sleep_list); + /* rtw_list_delete(&psta->sleep_list); */ - //rtw_list_delete(&psta->wakeup_list); + /* rtw_list_delete(&psta->wakeup_list); */ _enter_critical_bh(&pxmitpriv->lock, &irqL0); rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q); psta->sleepq_len = 0; - //_enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0); + /* _enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0); */ rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vo_q.sta_pending); rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending)); - //_exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0); + /* _exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0); */ - //_enter_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0); + /* _enter_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0); */ rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vi_q.sta_pending); rtw_list_delete(&(pstaxmitpriv->vi_q.tx_pending)); - //_exit_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0); + /* _exit_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0); */ - //_enter_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0); + /* _enter_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0); */ rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->bk_q.sta_pending); rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending)); - //_exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0); + /* _exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0); */ - //_enter_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0); + /* _enter_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0); */ rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->be_q.sta_pending); rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending)); - //_exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0); + /* _exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0); */ _exit_critical_bh(&pxmitpriv->lock, &irqL0); @@ -501,7 +499,7 @@ _func_enter_; pstapriv->asoc_sta_count --; - // re-init sta_info; 20061114 + /* re-init sta_info; 20061114 */ _rtw_init_sta_xmit_priv(&psta->sta_xmitpriv); _rtw_init_sta_recv_priv(&psta->sta_recvpriv); @@ -514,9 +512,9 @@ _func_enter_; _cancel_timer_ex(&psta->off_ch_timer); _cancel_timer_ex(&psta->alive_timer1); _cancel_timer_ex(&psta->alive_timer2); -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ - //for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer + /* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */ for (i=0; i < 16 ; i++) { _irqL irqL; @@ -587,7 +585,7 @@ _func_enter_; pstapriv->sta_dz_bitmap &=~BIT(psta->aid); pstapriv->tim_bitmap &=~BIT(psta->aid); - //rtw_indicate_sta_disassoc_event(padapter, psta); + /* rtw_indicate_sta_disassoc_event(padapter, psta); */ if ((psta->aid >0)&&(pstapriv->sta_aid[psta->aid - 1] == psta)) { @@ -595,13 +593,13 @@ _func_enter_; psta->aid = 0; } -#endif // CONFIG_NATIVEAP_MLME +#endif /* CONFIG_NATIVEAP_MLME */ #ifdef CONFIG_TX_MCAST2UNI psta->under_exist_checking = 0; -#endif // CONFIG_TX_MCAST2UNI +#endif /* CONFIG_TX_MCAST2UNI */ -#endif // CONFIG_AP_MODE +#endif /* CONFIG_AP_MODE */ _enter_critical_bh(&(pfree_sta_queue->lock), &irqL0); rtw_list_insert_tail(&psta->list, get_list_head(pfree_sta_queue)); @@ -615,7 +613,7 @@ _func_exit_; } -// free all stainfo which in sta_hash[all] +/* free all stainfo which in sta_hash[all] */ void rtw_free_all_stainfo(_adapter *padapter) { _irqL irqL; @@ -701,7 +699,7 @@ _func_enter_; psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); if ((_rtw_memcmp(psta->hwaddr, addr, ETH_ALEN))== true) - { // if found the matched address + { /* if found the matched address */ break; } psta=NULL; @@ -722,7 +720,7 @@ u32 rtw_init_bcmc_stainfo(_adapter* padapter) NDIS_802_11_MAC_ADDRESS bcast_addr= {0xff,0xff,0xff,0xff,0xff,0xff}; struct sta_priv *pstapriv = &padapter->stapriv; - //_queue *pstapending = &padapter->xmitpriv.bm_pending; + /* _queue *pstapending = &padapter->xmitpriv.bm_pending; */ _func_enter_; @@ -734,7 +732,7 @@ _func_enter_; goto exit; } - // default broadcast & multicast use macid 1 + /* default broadcast & multicast use macid 1 */ psta->mac_id = 1; exit: @@ -786,11 +784,11 @@ u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr) _exit_critical_bh(&(pacl_node_q->lock), &irqL); - if (pacl_list->mode == 1)//accept unless in deny list + if (pacl_list->mode == 1)/* accept unless in deny list */ { res = (match == true) ? false:true; } - else if (pacl_list->mode == 2)//deny unless in accept list + else if (pacl_list->mode == 2)/* deny unless in accept list */ { res = (match == true) ? true:false; } diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 1d80616..f8d6755 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -42,13 +42,13 @@ void rtw_reset_tdls_info(_adapter* padapter) ptdlsinfo->clear_cam= 0; ptdlsinfo->ch_sensing = 0; ptdlsinfo->cur_channel = 0; - ptdlsinfo->candidate_ch = 1; //when inplement channel switching, default candidate channel is 1 + ptdlsinfo->candidate_ch = 1; /* when inplement channel switching, default candidate channel is 1 */ ptdlsinfo->watchdog_count = 0; ptdlsinfo->dev_discovered = 0; #ifdef CONFIG_WFD ptdlsinfo->wfd_info = &padapter->wfd_info; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ } int rtw_init_tdls_info(_adapter* padapter) @@ -91,7 +91,7 @@ void issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, struct sta_info *ptdls_ return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -102,7 +102,7 @@ void issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, struct sta_info *ptdls_ fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; -// SetToDs(fctrl); +/* SetToDs(fctrl); */ if (power_mode) { SetPwrMgt(fctrl); @@ -153,11 +153,11 @@ s32 update_tdls_attrib(_adapter *padapter, struct pkt_attrib *pattrib) pattrib->psta = psta; pattrib->ack_policy = 0; - // get ether_hdr_len - pattrib->pkt_hdrlen = ETH_HLEN;//(pattrib->ether_type == 0x8100) ? (14 + 4 ): 14; //vlan tag + /* get ether_hdr_len */ + pattrib->pkt_hdrlen = ETH_HLEN;/* pattrib->ether_type == 0x8100) ? (14 + 4 ): 14; vlan tag */ if (pqospriv->qos_option && psta->qos_option) { - pattrib->priority = 1; //tdls management frame should be AC_BK + pattrib->priority = 1; /* tdls management frame should be AC_BK */ pattrib->hdrlen = WLAN_HDR_A3_QOS_LEN; pattrib->subtype = WIFI_QOS_DATA_TYPE; } else { @@ -224,7 +224,7 @@ s32 update_tdls_attrib(_adapter *padapter, struct pkt_attrib *pattrib) pattrib->bswenc = false; } - //qos_en, ht_en, init rate, ,bw, ch_offset, sgi + /* qos_en, ht_en, init rate, ,bw, ch_offset, sgi */ pattrib->qos_en = psta->qos_option; pattrib->ht_en = psta->htpriv.ht_option; pattrib->raid = psta->raid; @@ -233,11 +233,11 @@ s32 update_tdls_attrib(_adapter *padapter, struct pkt_attrib *pattrib) pattrib->sgi= psta->htpriv.sgi; pattrib->ampdu_en = false; - //if (pattrib->ht_en && psta->htpriv.ampdu_enable) - //{ - // if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) - // pattrib->ampdu_en = true; - //} + /* if (pattrib->ht_en && psta->htpriv.ampdu_enable) */ + /* */ + /* if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) */ + /* pattrib->ampdu_en = true; */ + /* */ exit: @@ -250,17 +250,17 @@ void free_tdls_sta(_adapter *padapter, struct sta_info *ptdls_sta) struct sta_priv *pstapriv = &padapter->stapriv; _irqL irqL; - //free peer sta_info + /* free peer sta_info */ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); if (ptdlsinfo->sta_cnt != 0) ptdlsinfo->sta_cnt--; _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); - if ( ptdlsinfo->sta_cnt < (NUM_STA - 2) ) // -2: AP + BC/MC sta + if ( ptdlsinfo->sta_cnt < (NUM_STA - 2) ) /* -2: AP + BC/MC sta */ { ptdlsinfo->sta_maximum = false; _rtw_memset( &ptdlsinfo->ss_record, 0x00, sizeof(struct tdls_ss_record) ); } - //ready to clear cam + /* ready to clear cam */ if (ptdls_sta->mac_id!=0){ ptdlsinfo->clear_cam=ptdls_sta->mac_id; rtw_setstakey_cmd(padapter, (u8 *)ptdls_sta, true); @@ -277,7 +277,7 @@ void free_tdls_sta(_adapter *padapter, struct sta_info *ptdls_sta) } -// cam entry will be the same as mac_id +/* cam entry will be the same as mac_id */ void rtw_tdls_set_mac_id(struct tdls_info *ptdlsinfo, struct sta_info *ptdls_sta) { if (ptdls_sta->mac_id==0) @@ -288,7 +288,7 @@ void rtw_tdls_set_mac_id(struct tdls_info *ptdlsinfo, struct sta_info *ptdls_sta } } -//TDLS encryption(if needed) will always be CCMP +/* TDLS encryption(if needed) will always be CCMP */ void rtw_tdls_set_key(_adapter *adapter, struct rx_pkt_attrib *prx_pkt_attrib, struct sta_info *ptdls_sta) { if (prx_pkt_attrib->encrypt) @@ -326,20 +326,20 @@ void rtw_tdls_process_ht_cap(_adapter *adapter, struct sta_info *ptdls_sta, u8 * } } - //HT related cap + /* HT related cap */ if (ptdls_sta->htpriv.ht_option) { - //check if sta supports rx ampdu + /* check if sta supports rx ampdu */ if (adapter->registrypriv.ampdu_enable==1) ptdls_sta->htpriv.ampdu_enable = true; - //check if sta support s Short GI + /* check if sta support s Short GI */ if (ptdls_sta->htpriv.ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40)) { ptdls_sta->htpriv.sgi = true; } - // bwmode would still followed AP's setting + /* bwmode would still followed AP's setting */ if (ptdls_sta->htpriv.ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH)) { ptdls_sta->htpriv.bwmode = adapter->mlmeextpriv.cur_bwmode; @@ -353,7 +353,7 @@ u8 *rtw_tdls_set_ht_cap(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattr struct rtw_ieee80211_ht_cap ht_capie; u8 rf_type; - //HT capabilities + /* HT capabilities */ _rtw_memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap)); ht_capie.cap_info = IEEE80211_HT_CAP_SUP_WIDTH |IEEE80211_HT_CAP_SGI_20 |IEEE80211_HT_CAP_SM_PS | @@ -373,14 +373,14 @@ u8 *rtw_tdls_set_ht_cap(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattr switch (rf_type) { case RF_1T1R: - ht_capie.cap_info |= 0x0100;//RX STBC One spatial stream + ht_capie.cap_info |= 0x0100;/* RX STBC One spatial stream */ _rtw_memcpy(ht_capie.supp_mcs_set, MCS_rate_1R, 16); break; case RF_2T2R: case RF_1T2R: default: - ht_capie.cap_info|= 0x0200;//RX STBC two spatial stream + ht_capie.cap_info|= 0x0200;/* RX STBC two spatial stream */ _rtw_memcpy(ht_capie.supp_mcs_set, MCS_rate_2R, 16); break; } @@ -391,12 +391,12 @@ u8 *rtw_tdls_set_ht_cap(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattr u8 *rtw_tdls_set_sup_ch(struct mlme_ext_priv *pmlmeext, u8 *pframe, struct pkt_attrib *pattrib) { - u8 sup_ch[ 30 * 2 ] = { 0x00 }, sup_ch_idx = 0, idx_5g = 2; //For supported channel + u8 sup_ch[ 30 * 2 ] = { 0x00 }, sup_ch_idx = 0, idx_5g = 2; /* For supported channel */ do{ if ( pmlmeext->channel_set[sup_ch_idx].ChannelNum <= 14 ) { - sup_ch[0] = 1; //First channel number - sup_ch[1] = pmlmeext->channel_set[sup_ch_idx].ChannelNum; //Number of channel + sup_ch[0] = 1; /* First channel number */ + sup_ch[1] = pmlmeext->channel_set[sup_ch_idx].ChannelNum; /* Number of channel */ } else { @@ -416,8 +416,8 @@ void rtw_tdls_process_wfd_ie(struct tdls_info *ptdlsinfo, u8 *ptr, u8 length) u8 wfd_ie[ 128 ] = { 0x00 }; u32 wfd_ielen = 0; u32 wfd_offset = 0; - // Try to get the TCP port information when receiving the negotiation response. - // + /* Try to get the TCP port information when receiving the negotiation response. */ + /* */ wfd_offset = 0; wfd_offset = rtw_get_wfd_ie( ptr + wfd_offset, length - wfd_offset, wfd_ie, &wfd_ielen ); @@ -465,7 +465,7 @@ void issue_tunneled_probe_req(_adapter *padapter) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -508,7 +508,7 @@ void issue_tunneled_probe_rsp(_adapter *padapter, union recv_frame *precv_frame) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -535,7 +535,7 @@ exit: return; } -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ void issue_tdls_setup_req(_adapter *padapter, u8 *mac_addr) { @@ -548,7 +548,7 @@ void issue_tdls_setup_req(_adapter *padapter, u8 *mac_addr) struct sta_info *ptdls_sta= NULL; _irqL irqL; static u8 dialogtoken = 0; - u32 timeout_interval= TPK_RESEND_COUNT * 1000; //retry timer should set at least 301 sec, using TPK_count counting 301 times. + u32 timeout_interval= TPK_RESEND_COUNT * 1000; /* retry timer should set at least 301 sec, using TPK_count counting 301 times. */ if (ptdlsinfo->ap_prohibited == true) goto exit; @@ -558,7 +558,7 @@ void issue_tdls_setup_req(_adapter *padapter, u8 *mac_addr) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -573,7 +573,7 @@ void issue_tdls_setup_req(_adapter *padapter, u8 *mac_addr) update_tdls_attrib(padapter, pattrib); - //init peer sta_info + /* init peer sta_info */ ptdls_sta = rtw_get_stainfo(pstapriv, mac_addr); if (ptdls_sta==NULL) { @@ -584,7 +584,7 @@ void issue_tdls_setup_req(_adapter *padapter, u8 *mac_addr) if (!(ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)) ptdlsinfo->sta_cnt++; _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); - if ( ptdlsinfo->sta_cnt == (NUM_STA - 2) ) // -2: AP + BC/MC sta + if ( ptdlsinfo->sta_cnt == (NUM_STA - 2) ) /* -2: AP + BC/MC sta */ { ptdlsinfo->sta_maximum = true; } @@ -599,7 +599,7 @@ void issue_tdls_setup_req(_adapter *padapter, u8 *mac_addr) if (ptdls_sta){ ptdls_sta->tdls_sta_state |= TDLS_RESPONDER_STATE; - //for tdls; ptdls_sta->aid is used to fill dialogtoken + /* for tdls; ptdls_sta->aid is used to fill dialogtoken */ ptdls_sta->dialog = dialogtoken; dialogtoken = (dialogtoken+1)%256; ptdls_sta->TDLS_PeerKey_Lifetime = timeout_interval; @@ -642,7 +642,7 @@ void issue_tdls_teardown(_adapter *padapter, u8 *mac_addr) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -696,7 +696,7 @@ void issue_tdls_dis_req(_adapter *padapter, u8 *mac_addr) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -743,7 +743,7 @@ void issue_tdls_setup_rsp(_adapter *padapter, union recv_frame *precv_frame) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -787,7 +787,7 @@ void issue_tdls_setup_cfm(_adapter *padapter, union recv_frame *precv_frame) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -816,7 +816,7 @@ exit: } -//TDLS Discovery Response frame is a management action frame +/* TDLS Discovery Response frame is a management action frame */ void issue_tdls_dis_rsp(_adapter *padapter, union recv_frame *precv_frame, u8 dialog) { struct xmit_frame *pmgntframe; @@ -834,7 +834,7 @@ void issue_tdls_dis_rsp(_adapter *padapter, union recv_frame *precv_frame, u8 di return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -846,7 +846,7 @@ void issue_tdls_dis_rsp(_adapter *padapter, union recv_frame *precv_frame, u8 di fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; - // unicast probe request frame + /* unicast probe request frame */ _rtw_memcpy(pwlanhdr->addr1, rx_pkt_pattrib->src, ETH_ALEN); _rtw_memcpy(pattrib->dst, pwlanhdr->addr1, ETH_ALEN); @@ -887,7 +887,7 @@ void issue_tdls_peer_traffic_indication(_adapter *padapter, struct sta_info *ptd return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -900,10 +900,10 @@ void issue_tdls_peer_traffic_indication(_adapter *padapter, struct sta_info *ptd _rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN); _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); - //for tdls; pattrib->nr_frags is used to fill dialogtoken + /* for tdls; pattrib->nr_frags is used to fill dialogtoken */ ptdls_sta->dialog = dialogtoken; dialogtoken = (dialogtoken+1)%256; - //PTI frame's priority should be AC_VO + /* PTI frame's priority should be AC_VO */ pattrib->priority = 7; update_tdls_attrib(padapter, pattrib); @@ -932,7 +932,7 @@ void issue_tdls_ch_switch_req(_adapter *padapter, u8 *mac_addr) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -974,7 +974,7 @@ void issue_tdls_ch_switch_rsp(_adapter *padapter, u8 *mac_addr) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; pmgntframe->frame_tag = DATA_FRAMETAG; @@ -1020,7 +1020,7 @@ sint On_TDLS_Dis_Rsp(_adapter *adapter, union recv_frame *precv_frame) int UndecoratedSmoothedPWDB; - //WFDTDLS: for sigma test, not to setup direct link automatically + /* WFDTDLS: for sigma test, not to setup direct link automatically */ ptdlsinfo->dev_discovered = 1; #ifdef CONFIG_TDLS_AUTOSETUP @@ -1031,7 +1031,7 @@ sint On_TDLS_Dis_Rsp(_adapter *adapter, union recv_frame *precv_frame) { ptdls_sta->tdls_sta_state |= TDLS_ALIVE_STATE; - //Record the tdls sta with lowest signal strength + /* Record the tdls sta with lowest signal strength */ if ( (ptdlsinfo->sta_maximum == true) && (ptdls_sta->alive_count >= 1) ) { if ( _rtw_memcmp(ptdlsinfo->ss_record.macaddr, empty_addr, ETH_ALEN) ) @@ -1056,7 +1056,7 @@ sint On_TDLS_Dis_Rsp(_adapter *adapter, union recv_frame *precv_frame) { if ( _rtw_memcmp( ptdlsinfo->ss_record.macaddr, empty_addr, ETH_ALEN ) ) { - //All traffics are busy, do not set up another direct link. + /* All traffics are busy, do not set up another direct link. */ return _FAIL; } else @@ -1080,7 +1080,7 @@ sint On_TDLS_Dis_Rsp(_adapter *adapter, union recv_frame *precv_frame) issue_tdls_setup_req(adapter, psa); } } -#endif //CONFIG_TDLS_AUTOSETUP +#endif /* CONFIG_TDLS_AUTOSETUP */ return _SUCCESS; } @@ -1102,7 +1102,7 @@ sint On_TDLS_Setup_Req(_adapter *adapter, union recv_frame *precv_frame) u16 j; u8 SNonce[32]; u32 *timeout_interval; - sint parsing_length; //frame body length, without icv_len + sint parsing_length; /* frame body length, without icv_len */ PNDIS_802_11_VARIABLE_IEs pIE; u8 FIXED_IE = 5; unsigned char supportRate[16]; @@ -1131,17 +1131,17 @@ sint On_TDLS_Setup_Req(_adapter *adapter, union recv_frame *precv_frame) ptdls_sta = rtw_alloc_stainfo(pstapriv, psa); }else{ if (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE){ - //If the direct link is already set up - //Process as re-setup after tear down + /* If the direct link is already set up */ + /* Process as re-setup after tear down */ DBG_88E("re-setup a direct link\n"); } - //already receiving TDLS setup request + /* already receiving TDLS setup request */ else if (ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE){ DBG_88E("receive duplicated TDLS setup request frame in handshaking\n"); goto exit; } - //When receiving and sending setup_req to the same link at the same time, STA with higher MAC_addr would be initiator - //following is to check out MAC_addr + /* When receiving and sending setup_req to the same link at the same time, STA with higher MAC_addr would be initiator */ + /* following is to check out MAC_addr */ else if (ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE){ DBG_88E("receive setup_req after sending setup_req\n"); for (i=0;i<6;i++){ @@ -1159,10 +1159,10 @@ sint On_TDLS_Setup_Req(_adapter *adapter, union recv_frame *precv_frame) if (ptdls_sta) { - ptdls_sta->dialog = *(ptr+2); //copy dialog token + ptdls_sta->dialog = *(ptr+2); /* copy dialog token */ ptdls_sta->stat_code = 0; - //parsing information element + /* parsing information element */ for (j=FIXED_IE; jencrypt){ prsnie=(u8*)pIE; - //check whether initiator STA has CCMP pairwise_cipher. + /* check whether initiator STA has CCMP pairwise_cipher. */ ppairwise_cipher=prsnie+10; _rtw_memcpy(&pairwise_count, (u16*)(ppairwise_cipher-2), 1); for (k=0;kstat_code=72; } } @@ -1223,7 +1223,7 @@ sint On_TDLS_Setup_Req(_adapter *adapter, union recv_frame *precv_frame) case _LINK_ID_IE_: if (_rtw_memcmp(get_bssid(pmlmepriv), pIE->data, 6) == false) { - //not in the same BSS + /* not in the same BSS */ ptdls_sta->stat_code=7; } break; @@ -1235,25 +1235,25 @@ sint On_TDLS_Setup_Req(_adapter *adapter, union recv_frame *precv_frame) } - //update station supportRate + /* update station supportRate */ ptdls_sta->bssratelen = supportRateNum; _rtw_memcpy(ptdls_sta->bssrateset, supportRate, supportRateNum); - //check status code - //if responder STA has/hasn't security on AP, but request hasn't/has RSNIE, it should reject + /* check status code */ + /* if responder STA has/hasn't security on AP, but request hasn't/has RSNIE, it should reject */ if (ptdls_sta->stat_code == 0 ) { if (rsnie_have && (prx_pkt_attrib->encrypt==0)){ - //security disabled + /* security disabled */ ptdls_sta->stat_code = 5; }else if (rsnie_have==0 && (prx_pkt_attrib->encrypt)){ - //request haven't RSNIE + /* request haven't RSNIE */ ptdls_sta->stat_code = 38; } #ifdef CONFIG_WFD - //WFD test plan version 0.18.2 test item 5.1.5 - //SoUT does not use TDLS if AP uses weak security + /* WFD test plan version 0.18.2 test item 5.1.5 */ + /* SoUT does not use TDLS if AP uses weak security */ if ( adapter->wdinfo.wfd_tdls_enable ) { if (rsnie_have && (prx_pkt_attrib->encrypt != _AES_)) @@ -1261,7 +1261,7 @@ sint On_TDLS_Setup_Req(_adapter *adapter, union recv_frame *precv_frame) ptdls_sta->stat_code = 5; } } -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ } ptdls_sta->tdls_sta_state|= TDLS_INITIATOR_STATE; @@ -1273,14 +1273,14 @@ sint On_TDLS_Setup_Req(_adapter *adapter, union recv_frame *precv_frame) if (!(ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)) ptdlsinfo->sta_cnt++; _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); - if ( ptdlsinfo->sta_cnt == (NUM_STA - 2) ) // -2: AP + BC/MC sta + if ( ptdlsinfo->sta_cnt == (NUM_STA - 2) ) /* -2: AP + BC/MC sta */ { ptdlsinfo->sta_maximum = true; } #ifdef CONFIG_WFD rtw_tdls_process_wfd_ie(ptdlsinfo, ptr + FIXED_IE, parsing_length - FIXED_IE); -#endif // CONFIG_WFD +#endif /* CONFIG_WFD */ } else @@ -1294,7 +1294,7 @@ sint On_TDLS_Setup_Req(_adapter *adapter, union recv_frame *precv_frame) { _set_timer( &ptdls_sta->handshake_timer, TDLS_HANDSHAKE_TIME); } - else //status code!=0 ; setup unsuccess + else /* status code!=0 ; setup unsuccess */ { free_tdls_sta(adapter, ptdls_sta); } @@ -1314,7 +1314,7 @@ sint On_TDLS_Setup_Rsp(_adapter *adapter, union recv_frame *precv_frame) struct rx_pkt_attrib *prx_pkt_attrib = &precv_frame->u.hdr.attrib; u8 *psa; u16 stat_code; - sint parsing_length; //frame body length, without icv_len + sint parsing_length; /* frame body length, without icv_len */ PNDIS_802_11_VARIABLE_IEs pIE; u8 FIXED_IE =7; u8 *pftie, *ptimeout_ie, *plinkid_ie, *prsnie, *pftie_mic, *ppairwise_cipher; @@ -1352,7 +1352,7 @@ sint On_TDLS_Setup_Rsp(_adapter *adapter, union recv_frame *precv_frame) stat_code = 0; - //parsing information element + /* parsing information element */ for (j=FIXED_IE; jbssratelen = supportRateNum; _rtw_memcpy(ptdls_sta->bssrateset, supportRate, supportRateNum); #ifdef CONFIG_WFD rtw_tdls_process_wfd_ie(ptdlsinfo, ptr + FIXED_IE, parsing_length - FIXED_IE); -#endif // CONFIG_WFD +#endif /* CONFIG_WFD */ if (stat_code != 0) { @@ -1432,7 +1432,7 @@ sint On_TDLS_Setup_Rsp(_adapter *adapter, union recv_frame *precv_frame) { wpa_tdls_generate_tpk(adapter, ptdls_sta); ptdls_sta->stat_code=0; - if (tdls_verify_mic(ptdls_sta->tpk.kck, 2, plinkid_ie, prsnie, ptimeout_ie, pftie)==0) //0: Invalid, 1: valid + if (tdls_verify_mic(ptdls_sta->tpk.kck, 2, plinkid_ie, prsnie, ptimeout_ie, pftie)==0) /* 0: Invalid, 1: valid */ { free_tdls_sta(adapter, ptdls_sta); return _FAIL; @@ -1440,7 +1440,7 @@ sint On_TDLS_Setup_Rsp(_adapter *adapter, union recv_frame *precv_frame) } else { - ptdls_sta->stat_code=72; //invalide contents of RSNIE + ptdls_sta->stat_code=72; /* invalide contents of RSNIE */ } }else{ @@ -1461,7 +1461,7 @@ sint On_TDLS_Setup_Rsp(_adapter *adapter, union recv_frame *precv_frame) _cancel_timer_ex( &ptdls_sta->handshake_timer); #ifdef CONFIG_TDLS_AUTOCHECKALIVE _set_timer( &ptdls_sta->alive_timer1, TDLS_ALIVE_TIMER_PH1); -#endif //CONFIG_TDLS_AUTOSETUP +#endif /* CONFIG_TDLS_AUTOSETUP */ } rtw_tdls_set_mac_id(ptdlsinfo, ptdls_sta); @@ -1470,7 +1470,7 @@ sint On_TDLS_Setup_Rsp(_adapter *adapter, union recv_frame *precv_frame) rtw_tdls_cmd(adapter, ptdls_sta->hwaddr, TDLS_WRCR); } - else //status code!=0 ; setup unsuccessful + else /* status code!=0 ; setup unsuccessful */ { free_tdls_sta(adapter, ptdls_sta); } @@ -1516,7 +1516,7 @@ sint On_TDLS_Setup_Cfm(_adapter *adapter, union recv_frame *precv_frame) } if (prx_pkt_attrib->encrypt){ - //parsing information element + /* parsing information element */ for (j=FIXED_IE; jtpk.kck, 3, plinkid_ie, prsnie, ptimeout_ie, pftie)==0){ //0: Invalid, 1: Valid + /* verify mic in FTIE MIC field */ + if (tdls_verify_mic(ptdls_sta->tpk.kck, 3, plinkid_ie, prsnie, ptimeout_ie, pftie)==0){ /* 0: Invalid, 1: Valid */ free_tdls_sta(adapter, ptdls_sta); return _FAIL; } @@ -1562,7 +1562,7 @@ sint On_TDLS_Setup_Cfm(_adapter *adapter, union recv_frame *precv_frame) _cancel_timer_ex( &ptdls_sta->handshake_timer); #ifdef CONFIG_TDLS_AUTOCHECKALIVE _set_timer( &ptdls_sta->alive_timer1, TDLS_ALIVE_TIMER_PH1); -#endif //CONFIG_TDLS_AUTOCHECKALIVE +#endif /* CONFIG_TDLS_AUTOCHECKALIVE */ } rtw_tdls_set_mac_id(ptdlsinfo, ptdls_sta); @@ -1580,7 +1580,7 @@ sint On_TDLS_Dis_Req(_adapter *adapter, union recv_frame *precv_frame) struct sta_priv *pstapriv = &adapter->stapriv; struct sta_info *psta_ap; u8 *ptr = precv_frame->u.hdr.rx_data; - sint parsing_length; //frame body length, without icv_len + sint parsing_length; /* frame body length, without icv_len */ PNDIS_802_11_VARIABLE_IEs pIE; u8 FIXED_IE = 3, *dst, *pdialog = NULL; u16 j; @@ -1597,7 +1597,7 @@ sint On_TDLS_Dis_Req(_adapter *adapter, union recv_frame *precv_frame) -1 -FIXED_IE; - //parsing information element + /* parsing information element */ for (j=FIXED_IE; jtdlsinfo; struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib; struct sta_priv *pstapriv = &adapter->stapriv; - //get peer sta infomation + /* get peer sta infomation */ struct sta_info *ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->src); u8 wmmps_ac=0, state=TDLS_check_ch_state(ptdls_sta->tdls_sta_state); int i; ptdls_sta->sta_stats.rx_data_pkts++; - //receive peer traffic response frame, sleeping STA wakes up - //ptdls_sta->tdls_sta_state &= ~(TDLS_PEER_SLEEP_STATE); + /* receive peer traffic response frame, sleeping STA wakes up */ + /* ptdls_sta->tdls_sta_state &= ~(TDLS_PEER_SLEEP_STATE); */ process_wmmps_data( adapter, precv_frame); - // if noticed peer STA wakes up by receiving peer traffic response - // and we want to do channel swtiching, then we will transmit channel switch request first + /* if noticed peer STA wakes up by receiving peer traffic response */ + /* and we want to do channel swtiching, then we will transmit channel switch request first */ if (ptdls_sta->tdls_sta_state & TDLS_APSD_CHSW_STATE){ issue_tdls_ch_switch_req(adapter, pattrib->src); ptdls_sta->tdls_sta_state &= ~(TDLS_APSD_CHSW_STATE); return _FAIL; } - //check 4-AC queue bit + /* check 4-AC queue bit */ if (ptdls_sta->uapsd_vo || ptdls_sta->uapsd_vi || ptdls_sta->uapsd_be || ptdls_sta->uapsd_bk) wmmps_ac=1; - //if it's a direct link and have buffered frame + /* if it's a direct link and have buffered frame */ if (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE){ if (wmmps_ac && state) { @@ -1715,7 +1715,7 @@ sint On_TDLS_Peer_Traffic_Rsp(_adapter *adapter, union recv_frame *precv_frame) xmitframe_phead = get_list_head(&ptdls_sta->sleep_q); xmitframe_plist = get_next(xmitframe_phead); - //transmit buffered frames + /* transmit buffered frames */ while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == false) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); @@ -1730,7 +1730,6 @@ sint On_TDLS_Peer_Traffic_Rsp(_adapter *adapter, union recv_frame *precv_frame) pxmitframe->attrib.mdata = 0; pxmitframe->attrib.eosp = 1; } - //pxmitframe->attrib.triggered = 1; //maybe doesn't need in TDLS if (adapter->HalFunc.hal_xmit(adapter, pxmitframe) == true) { rtw_os_xmit_complete(adapter, pxmitframe); @@ -1741,8 +1740,8 @@ sint On_TDLS_Peer_Traffic_Rsp(_adapter *adapter, union recv_frame *precv_frame) if (ptdls_sta->sleepq_len==0) { DBG_88E("no buffered packets for tdls to xmit\n"); - //on U-APSD + CH. switch state, when there is no buffered date to xmit, - // we should go back to base channel + /* on U-APSD + CH. switch state, when there is no buffered date to xmit, */ + /* we should go back to base channel */ if (state==2){ rtw_tdls_cmd(adapter, ptdls_sta->hwaddr, TDLS_CS_OFF); }else if (ptdls_sta->tdls_sta_state&TDLS_SW_OFF_STATE){ @@ -1796,7 +1795,7 @@ sint On_TDLS_Ch_Switch_Req(_adapter *adapter, union recv_frame *precv_frame) ptdls_sta->off_ch = *(ptr+2); - //parsing information element + /* parsing information element */ for (j=FIXED_IE; jstat_code=0; ptdls_sta->tdls_sta_state |= TDLS_CH_SWITCH_ON_STATE; @@ -1857,8 +1856,8 @@ sint On_TDLS_Ch_Switch_Rsp(_adapter *adapter, union recv_frame *precv_frame) psa = get_sa(ptr); ptdls_sta = rtw_get_stainfo(pstapriv, psa); - //if channel switch is running and receiving Unsolicited TDLS Channel Switch Response, - //it will go back to base channel and terminate this channel switch procedure + /* if channel switch is running and receiving Unsolicited TDLS Channel Switch Response, */ + /* it will go back to base channel and terminate this channel switch procedure */ if (ptdls_sta->tdls_sta_state & TDLS_CH_SWITCH_ON_STATE ){ if (pmlmeext->cur_channel==ptdls_sta->off_ch){ DBG_88E("back to base channel %x\n", pmlmeext->cur_channel); @@ -1871,7 +1870,7 @@ sint On_TDLS_Ch_Switch_Rsp(_adapter *adapter, union recv_frame *precv_frame) return _FAIL; } - //avoiding duplicated or unconditional ch. switch. rsp + /* avoiding duplicated or unconditional ch. switch. rsp */ if ((ptdls_sta->tdls_sta_state & TDLS_CH_SW_INITIATOR_STATE) != TDLS_CH_SW_INITIATOR_STATE) return _FAIL; @@ -1891,7 +1890,7 @@ sint On_TDLS_Ch_Switch_Rsp(_adapter *adapter, union recv_frame *precv_frame) return _FAIL; } - //parsing information element + /* parsing information element */ for (j=FIXED_IE; jtdls_sta_state &= ~(TDLS_CH_SW_INITIATOR_STATE); ptdls_sta->tdls_sta_state |=TDLS_CH_SWITCH_ON_STATE; - //goto set_channel_workitem_callback() + /* goto set_channel_workitem_callback() */ ptdls_sta->option=6; rtw_tdls_cmd(adapter, ptdls_sta->hwaddr, TDLS_OFF_CH); @@ -1935,58 +1934,58 @@ void wfd_ie_tdls(_adapter * padapter, u8 *pframe, u32 *pktlen ) u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; u32 wfdielen = 0; - // WFD OUI + /* WFD OUI */ wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; wfdie[ wfdielen++ ] = 0x6F; wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 + wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - // Commented by Albert 20110825 - // According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes - // 1. WFD Device Information - // 2. Associated BSSID ( Optional ) - // 3. Local IP Adress ( Optional ) + /* Commented by Albert 20110825 */ + /* According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes */ + /* 1. WFD Device Information */ + /* 2. Associated BSSID ( Optional ) */ + /* 3. Local IP Adress ( Optional ) */ - // WFD Device Information ATTR - // Type: + /* WFD Device Information ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value1: - // WFD device information - // WFD primary sink + available for WFD session + Preferred TDLS + WSD ( WFD Service Discovery ) + /* Value1: */ + /* WFD device information */ + /* WFD primary sink + available for WFD session + Preferred TDLS + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_PC_TDLS | WFD_DEVINFO_WSD); wfdielen += 2; - // Value2: - // Session Management Control Port - // Default TCP port for RTSP messages is 554 + /* Value2: */ + /* Session Management Control Port */ + /* Default TCP port for RTSP messages is 554 */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); wfdielen += 2; - // Value3: - // WFD Device Maximum Throughput - // 300Mbps is the maximum throughput + /* Value3: */ + /* WFD Device Maximum Throughput */ + /* 300Mbps is the maximum throughput */ RTW_PUT_BE16(wfdie + wfdielen, 300); wfdielen += 2; - // Associated BSSID ATTR - // Type: + /* Associated BSSID ATTR */ + /* Type: */ wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0006); wfdielen += 2; - // Value: - // Associated BSSID + /* Value: */ + /* Associated BSSID */ if ( check_fwstate( pmlmepriv, _FW_LINKED) == true ) { _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1996,26 +1995,26 @@ void wfd_ie_tdls(_adapter * padapter, u8 *pframe, u32 *pktlen ) _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); } - // Local IP Address ATTR + /* Local IP Address ATTR */ wfdie[ wfdielen++ ] = WFD_ATTR_LOCAL_IP_ADDR; - // Length: - // Note: In the WFD specification, the size of length field is 2. + /* Length: */ + /* Note: In the WFD specification, the size of length field is 2. */ RTW_PUT_BE16(wfdie + wfdielen, 0x0005); wfdielen += 2; - // Version: - // 0x01: Version1;IPv4 + /* Version: */ + /* 0x01: Version1;IPv4 */ wfdie[ wfdielen++ ] = 0x01; - // IPv4 Address + /* IPv4 Address */ _rtw_memcpy( wfdie + wfdielen, pwfd_info->ip_address, 4 ); wfdielen += 4; pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, pktlen); } -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ void rtw_build_tdls_setup_req_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe) { @@ -2028,7 +2027,7 @@ void rtw_build_tdls_setup_req_ies(_adapter * padapter, struct xmit_frame * pxmit u8 payload_type = 0x02; u8 category = RTW_WLAN_CATEGORY_TDLS; u8 action = TDLS_SETUP_REQUEST; - u8 bssrate[NDIS_802_11_LENGTH_RATES_EX]; //Use NDIS_802_11_LENGTH_RATES_EX in order to call func.rtw_set_supported_rate + u8 bssrate[NDIS_802_11_LENGTH_RATES_EX]; /* Use NDIS_802_11_LENGTH_RATES_EX in order to call func.rtw_set_supported_rate */ int bssrate_len = 0, i = 0 ; u8 more_supportedrates = 0; unsigned int ie_len; @@ -2036,11 +2035,11 @@ void rtw_build_tdls_setup_req_ies(_adapter * padapter, struct xmit_frame * pxmit struct mlme_priv *pmlmepriv = &padapter->mlmepriv; u8 link_id_addr[18] = {0}; u8 iedata=0; - u8 sup_ch[ 30 * 2 ] = {0x00 }, sup_ch_idx = 0, idx_5g = 2; //For supported channel - u8 timeout_itvl[5]; //set timeout interval to maximum value + u8 sup_ch[ 30 * 2 ] = {0x00 }, sup_ch_idx = 0, idx_5g = 2; /* For supported channel */ + u8 timeout_itvl[5]; /* set timeout interval to maximum value */ u32 time; - //SNonce + /* SNonce */ if (pattrib->encrypt){ for (i=0;i<8;i++){ time=rtw_get_current_time(); @@ -2048,14 +2047,14 @@ void rtw_build_tdls_setup_req_ies(_adapter * padapter, struct xmit_frame * pxmit } } - //payload type + /* payload type */ pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, dialog token + /* category, action, dialog token */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(ptdls_sta->dialog), &(pattrib->pktlen)); - //capability + /* capability */ _rtw_memcpy(pframe, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); if (pattrib->encrypt) @@ -2063,7 +2062,7 @@ void rtw_build_tdls_setup_req_ies(_adapter * padapter, struct xmit_frame * pxmit pframe += 2; pattrib->pktlen += 2; - //supported rates + /* supported rates */ rtw_set_supported_rate(bssrate, WIRELESS_11BG_24N); bssrate_len = IEEE80211_CCK_RATE_LEN + IEEE80211_NUM_OFDM_RATESLEN; @@ -2077,54 +2076,54 @@ void rtw_build_tdls_setup_req_ies(_adapter * padapter, struct xmit_frame * pxmit pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); } - //country(optional) - //extended supported rates + /* country(optional) */ + /* extended supported rates */ if (more_supportedrates==1){ pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); } - //supported channels + /* supported channels */ pframe = rtw_tdls_set_sup_ch(pmlmeext, pframe, pattrib); - // SRC IE + /* SRC IE */ pframe = rtw_set_ie( pframe, _SRC_IE_, 16, TDLS_SRC, &(pattrib->pktlen)); - //RSNIE + /* RSNIE */ if (pattrib->encrypt) pframe = rtw_set_ie(pframe, _RSN_IE_2_, 20, TDLS_RSNIE, &(pattrib->pktlen)); - //extended capabilities + /* extended capabilities */ pframe = rtw_set_ie(pframe, _EXT_CAP_IE_ , 5, TDLS_EXT_CAPIE, &(pattrib->pktlen)); - //QoS capability(WMM_IE) + /* QoS capability(WMM_IE) */ pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 7, TDLS_WMMIE, &(pattrib->pktlen)); if (pattrib->encrypt){ - //FTIE - _rtw_memset(pframe, 0, 84); //All fields except SNonce shall be set to 0 - _rtw_memset(pframe, _FTIE_, 1); //version - _rtw_memset((pframe+1), 82, 1); //length + /* FTIE */ + _rtw_memset(pframe, 0, 84); /* All fields except SNonce shall be set to 0 */ + _rtw_memset(pframe, _FTIE_, 1); /* version */ + _rtw_memset((pframe+1), 82, 1); /* length */ _rtw_memcpy((pframe+52), ptdls_sta->SNonce, 32); pframe += 84; pattrib->pktlen += 84; - //Timeout interval + /* Timeout interval */ timeout_itvl[0]=0x02; _rtw_memcpy(timeout_itvl+1, (u8 *)(&ptdls_sta->TDLS_PeerKey_Lifetime), 4); pframe = rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); } - //Sup_reg_classes(optional) - //HT capabilities + /* Sup_reg_classes(optional) */ + /* HT capabilities */ pframe = rtw_tdls_set_ht_cap(padapter, pframe, pattrib); - //20/40 BSS coexistence + /* 20/40 BSS coexistence */ if (pmlmepriv->num_FortyMHzIntolerant>0) - iedata |= BIT(2);//20 MHz BSS Width Request + iedata |= BIT(2);/* 20 MHz BSS Width Request */ pframe = rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); - //Link identifier + /* Link identifier */ _rtw_memcpy(link_id_addr, pattrib->ra, 6); _rtw_memcpy((link_id_addr+6), pattrib->src, 6); _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); @@ -2132,7 +2131,7 @@ void rtw_build_tdls_setup_req_ies(_adapter * padapter, struct xmit_frame * pxmit #ifdef CONFIG_WFD wfd_ie_tdls( padapter, pframe, &(pattrib->pktlen) ); -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ } @@ -2155,9 +2154,9 @@ void rtw_build_tdls_setup_rsp_ies(_adapter * padapter, struct xmit_frame * pxmit struct mlme_priv *pmlmepriv = &padapter->mlmepriv; u8 link_id_addr[18] = {0}; u8 iedata=0; - u8 timeout_itvl[5]; //setup response timeout interval will copy from request - u8 ANonce[32]; //maybe it can put in ontdls_req - u8 k; //for random ANonce + u8 timeout_itvl[5]; /* setup response timeout interval will copy from request */ + u8 ANonce[32]; /* maybe it can put in ontdls_req */ + u8 k; /* for random ANonce */ u8 *pftie, *ptimeout_ie, *plinkid_ie, *prsnie, *pftie_mic; u32 time; @@ -2176,23 +2175,23 @@ void rtw_build_tdls_setup_rsp_ies(_adapter * padapter, struct xmit_frame * pxmit } } - //payload type + /* payload type */ pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, status code + /* category, action, status code */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 2, (u8 *)&ptdls_sta->stat_code, &(pattrib->pktlen)); - if (ptdls_sta->stat_code!=0) //invalid setup request + if (ptdls_sta->stat_code!=0) /* invalid setup request */ { DBG_88E("ptdls_sta->stat_code:%04x\n", ptdls_sta->stat_code); return; } - //dialog token + /* dialog token */ pframe = rtw_set_fixed_ie(pframe, 1, &(ptdls_sta->dialog), &(pattrib->pktlen)); - //capability + /* capability */ _rtw_memcpy(pframe, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); if (pattrib->encrypt ) @@ -2200,7 +2199,7 @@ void rtw_build_tdls_setup_rsp_ies(_adapter * padapter, struct xmit_frame * pxmit pframe += 2; pattrib->pktlen += 2; - //supported rates + /* supported rates */ rtw_set_supported_rate(bssrate, WIRELESS_11BG_24N); bssrate_len = IEEE80211_CCK_RATE_LEN + IEEE80211_NUM_OFDM_RATESLEN; @@ -2214,74 +2213,74 @@ void rtw_build_tdls_setup_rsp_ies(_adapter * padapter, struct xmit_frame * pxmit pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); } - //country(optional) - //extended supported rates + /* country(optional) */ + /* extended supported rates */ if (more_supportedrates==1){ pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); } - //supported channels + /* supported channels */ pframe = rtw_tdls_set_sup_ch(pmlmeext, pframe, pattrib); - // SRC IE + /* SRC IE */ pframe = rtw_set_ie(pframe, _SRC_IE_ , 16, TDLS_SRC, &(pattrib->pktlen)); - //RSNIE + /* RSNIE */ if (pattrib->encrypt){ prsnie = pframe; pframe = rtw_set_ie(pframe, _RSN_IE_2_, 20, TDLS_RSNIE, &(pattrib->pktlen)); } - //extended capabilities + /* extended capabilities */ pframe = rtw_set_ie(pframe, _EXT_CAP_IE_ , 5, TDLS_EXT_CAPIE, &(pattrib->pktlen)); - //QoS capability(WMM_IE) + /* QoS capability(WMM_IE) */ pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 7, TDLS_WMMIE, &(pattrib->pktlen)); if (pattrib->encrypt){ wpa_tdls_generate_tpk(padapter, ptdls_sta); - //FTIE + /* FTIE */ pftie = pframe; pftie_mic = pframe+4; - _rtw_memset(pframe, 0, 84); //All fields except SNonce shall be set to 0 - _rtw_memset(pframe, _FTIE_, 1); //version - _rtw_memset((pframe+1), 82, 1); //length + _rtw_memset(pframe, 0, 84); /* All fields except SNonce shall be set to 0 */ + _rtw_memset(pframe, _FTIE_, 1); /* version */ + _rtw_memset((pframe+1), 82, 1); /* length */ _rtw_memcpy((pframe+20), ptdls_sta->ANonce, 32); _rtw_memcpy((pframe+52), ptdls_sta->SNonce, 32); pframe += 84; pattrib->pktlen += 84; - //Timeout interval + /* Timeout interval */ ptimeout_ie = pframe; timeout_itvl[0]=0x02; _rtw_memcpy(timeout_itvl+1, (u8 *)(&ptdls_sta->TDLS_PeerKey_Lifetime), 4); pframe = rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); } - //Sup_reg_classes(optional) - //HT capabilities + /* Sup_reg_classes(optional) */ + /* HT capabilities */ pframe = rtw_tdls_set_ht_cap(padapter, pframe, pattrib); - //20/40 BSS coexistence + /* 20/40 BSS coexistence */ if (pmlmepriv->num_FortyMHzIntolerant>0) - iedata |= BIT(2);//20 MHz BSS Width Request + iedata |= BIT(2);/* 20 MHz BSS Width Request */ pframe = rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); - //Link identifier + /* Link identifier */ plinkid_ie = pframe; _rtw_memcpy(link_id_addr, pattrib->ra, 6); _rtw_memcpy((link_id_addr+6), pattrib->dst, 6); _rtw_memcpy((link_id_addr+12), pattrib->src, 6); pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); - //fill FTIE mic + /* fill FTIE mic */ if (pattrib->encrypt) wpa_tdls_ftie_mic(ptdls_sta->tpk.kck, 2, plinkid_ie, prsnie, ptimeout_ie, pftie, pftie_mic); #ifdef CONFIG_WFD wfd_ie_tdls( padapter, pframe, &(pattrib->pktlen) ); -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ } @@ -2299,42 +2298,42 @@ void rtw_build_tdls_setup_cfm_ies(_adapter * padapter, struct xmit_frame * pxmit u8 more_supportedrates = 0; unsigned int ie_len; unsigned char *p; - u8 timeout_itvl[5]; //set timeout interval to maximum value + u8 timeout_itvl[5]; /* set timeout interval to maximum value */ struct mlme_priv *pmlmepriv = &padapter->mlmepriv; u8 link_id_addr[18] = {0}; u8 *pftie, *ptimeout_ie, *plinkid_ie, *prsnie, *pftie_mic; - //payload type + /* payload type */ pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, status code, dialog token + /* category, action, status code, dialog token */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 2, (u8 *)&ptdls_sta->stat_code, &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(ptdls_sta->dialog), &(pattrib->pktlen)); - if (ptdls_sta->stat_code!=0) //invalid setup request + if (ptdls_sta->stat_code!=0) /* invalid setup request */ return; - //RSNIE + /* RSNIE */ if (pattrib->encrypt){ prsnie = pframe; pframe = rtw_set_ie(pframe, _RSN_IE_2_, 20, TDLS_RSNIE, &(pattrib->pktlen)); } - //EDCA param set; WMM param ele. + /* EDCA param set; WMM param ele. */ if (pattrib->encrypt){ - //FTIE + /* FTIE */ pftie = pframe; pftie_mic = pframe+4; - _rtw_memset(pframe, 0, 84); //All fields except SNonce shall be set to 0 - _rtw_memset(pframe, _FTIE_, 1); //version - _rtw_memset((pframe+1), 82, 1); //length + _rtw_memset(pframe, 0, 84); /* All fields except SNonce shall be set to 0 */ + _rtw_memset(pframe, _FTIE_, 1); /* version */ + _rtw_memset((pframe+1), 82, 1); /* length */ _rtw_memcpy((pframe+20), ptdls_sta->ANonce, 32); _rtw_memcpy((pframe+52), ptdls_sta->SNonce, 32); pframe += 84; pattrib->pktlen += 84; - //Timeout interval + /* Timeout interval */ ptimeout_ie = pframe; timeout_itvl[0]=0x02; _rtw_memcpy(timeout_itvl+1, (u8 *)(&ptdls_sta->TDLS_PeerKey_Lifetime), 4); @@ -2343,15 +2342,15 @@ void rtw_build_tdls_setup_cfm_ies(_adapter * padapter, struct xmit_frame * pxmit pframe = rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); } - //HT operation; todo - //Link identifier + /* HT operation; todo */ + /* Link identifier */ plinkid_ie = pframe; _rtw_memcpy(link_id_addr, pattrib->ra, 6); _rtw_memcpy((link_id_addr+6), pattrib->src, 6); _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); - //fill FTIE mic + /* fill FTIE mic */ if (pattrib->encrypt) wpa_tdls_ftie_mic(ptdls_sta->tpk.kck, 3, plinkid_ie, prsnie, ptimeout_ie, pftie, pftie_mic); @@ -2369,14 +2368,14 @@ void rtw_build_tdls_teardown_ies(_adapter * padapter, struct xmit_frame * pxmitf struct sta_info *ptdls_sta = rtw_get_stainfo( &(padapter->stapriv) , pattrib->dst); struct sta_priv *pstapriv = &padapter->stapriv; - //payload type + /* payload type */ pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, reason code + /* category, action, reason code */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, (u8 *)&ptdls_sta->stat_code, &(pattrib->pktlen)); - //Link identifier + /* Link identifier */ if (ptdls_sta->tdls_sta_state & TDLS_INITIATOR_STATE){ _rtw_memcpy(link_id_addr, pattrib->ra, 6); _rtw_memcpy((link_id_addr+6), pattrib->src, 6); @@ -2400,15 +2399,15 @@ void rtw_build_tdls_dis_req_ies(_adapter * padapter, struct xmit_frame * pxmitfr u8 link_id_addr[18] = {0}; static u8 dialogtoken=0; - //payload type + /* payload type */ pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, reason code + /* category, action, reason code */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(dialogtoken), &(pattrib->pktlen)); dialogtoken = (dialogtoken+1)%256; - //Link identifier + /* Link identifier */ _rtw_memcpy(link_id_addr, pattrib->ra, 6); _rtw_memcpy((link_id_addr+6), pattrib->src, 6); _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); @@ -2432,15 +2431,15 @@ void rtw_build_tdls_dis_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitfr struct mlme_priv *pmlmepriv = &padapter->mlmepriv; u8 link_id_addr[18] = {0}; u8 iedata=0; - u8 timeout_itvl[5]; //set timeout interval to maximum value + u8 timeout_itvl[5]; /* set timeout interval to maximum value */ u32 timeout_interval= TPK_RESEND_COUNT * 1000; - //category, action, dialog token + /* category, action, dialog token */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(dialog), &(pattrib->pktlen)); - //capability + /* capability */ _rtw_memcpy(pframe, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); if (pattrib->encrypt) @@ -2448,7 +2447,7 @@ void rtw_build_tdls_dis_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitfr pframe += 2; pattrib->pktlen += 2; - //supported rates + /* supported rates */ rtw_set_supported_rate(bssrate, WIRELESS_11BG_24N); bssrate_len = IEEE80211_CCK_RATE_LEN + IEEE80211_NUM_OFDM_RATESLEN; @@ -2462,45 +2461,45 @@ void rtw_build_tdls_dis_rsp_ies(_adapter * padapter, struct xmit_frame * pxmitfr pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); } - //extended supported rates + /* extended supported rates */ if (more_supportedrates==1){ pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); } - //supported channels + /* supported channels */ pframe = rtw_tdls_set_sup_ch(pmlmeext, pframe, pattrib); - //RSNIE + /* RSNIE */ if (pattrib->encrypt) pframe = rtw_set_ie(pframe, _RSN_IE_2_, 20, TDLS_RSNIE, &(pattrib->pktlen)); - //extended capability + /* extended capability */ pframe = rtw_set_ie(pframe, _EXT_CAP_IE_ , 5, TDLS_EXT_CAPIE, &(pattrib->pktlen)); if (pattrib->encrypt){ - //FTIE - _rtw_memset(pframe, 0, 84); //All fields shall be set to 0 - _rtw_memset(pframe, _FTIE_, 1); //version - _rtw_memset((pframe+1), 82, 1); //length + /* FTIE */ + _rtw_memset(pframe, 0, 84); /* All fields shall be set to 0 */ + _rtw_memset(pframe, _FTIE_, 1); /* version */ + _rtw_memset((pframe+1), 82, 1); /* length */ pframe += 84; pattrib->pktlen += 84; - //Timeout interval + /* Timeout interval */ timeout_itvl[0]=0x02; _rtw_memcpy(timeout_itvl+1, &timeout_interval, 4); pframe = rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); } - //Sup_reg_classes(optional) - //HT capabilities + /* Sup_reg_classes(optional) */ + /* HT capabilities */ pframe = rtw_tdls_set_ht_cap(padapter, pframe, pattrib); - //20/40 BSS coexistence + /* 20/40 BSS coexistence */ if (pmlmepriv->num_FortyMHzIntolerant>0) - iedata |= BIT(2);//20 MHz BSS Width Request + iedata |= BIT(2);/* 20 MHz BSS Width Request */ pframe = rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); - //Link identifier + /* Link identifier */ _rtw_memcpy(link_id_addr, pattrib->ra, 6); _rtw_memcpy((link_id_addr+6), pattrib->dst, 6); _rtw_memcpy((link_id_addr+12), pattrib->src, 6); @@ -2521,21 +2520,21 @@ void rtw_build_tdls_peer_traffic_indication_ies(_adapter * padapter, struct xmit struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->dst); - //payload type + /* payload type */ pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, reason code + /* category, action, reason code */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(ptdls_sta->dialog), &(pattrib->pktlen)); - //Link identifier + /* Link identifier */ _rtw_memcpy(link_id_addr, pattrib->ra, 6); _rtw_memcpy((link_id_addr+6), pattrib->src, 6); _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); - //PTI control - //PU buffer status + /* PTI control */ + /* PU buffer status */ if (ptdls_sta->uapsd_bk&BIT(1)) AC_queue=BIT(0); if (ptdls_sta->uapsd_be&BIT(1)) @@ -2562,25 +2561,25 @@ void rtw_build_tdls_ch_switch_req_ies(_adapter * padapter, struct xmit_frame * p u8 ch_switch_timing[4] = {0}; u16 switch_time= CH_SWITCH_TIME, switch_timeout=CH_SWITCH_TIMEOUT; - //payload type + /* payload type */ pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, target_ch + /* category, action, target_ch */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(ptdlsinfo->candidate_ch), &(pattrib->pktlen)); - //Link identifier + /* Link identifier */ _rtw_memcpy(link_id_addr, pattrib->ra, 6); _rtw_memcpy((link_id_addr+6), pattrib->src, 6); _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); - //ch switch timing + /* ch switch timing */ _rtw_memcpy(ch_switch_timing, &switch_time, 2); _rtw_memcpy(ch_switch_timing+2, &switch_timeout, 2); pframe = rtw_set_ie(pframe, _CH_SWITCH_TIMING_, 4, ch_switch_timing, &(pattrib->pktlen)); - //update ch switch attrib to sta_info + /* update ch switch attrib to sta_info */ ptdls_sta->off_ch=ptdlsinfo->candidate_ch; ptdls_sta->ch_switch_time=switch_time; ptdls_sta->ch_switch_timeout=switch_timeout; @@ -2601,20 +2600,20 @@ void rtw_build_tdls_ch_switch_rsp_ies(_adapter * padapter, struct xmit_frame * p struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; u8 ch_switch_timing[4] = {0}; - //payload type + /* payload type */ pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, action, status_code + /* category, action, status_code */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 2, (u8 *)&ptdls_sta->stat_code, &(pattrib->pktlen)); - //Link identifier + /* Link identifier */ _rtw_memcpy(link_id_addr, pattrib->ra, 6); _rtw_memcpy((link_id_addr+6), pattrib->src, 6); _rtw_memcpy((link_id_addr+12), pattrib->dst, 6); pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); - //ch switch timing + /* ch switch timing */ _rtw_memcpy(ch_switch_timing, &ptdls_sta->ch_switch_time, 2); _rtw_memcpy(ch_switch_timing+2, &ptdls_sta->ch_switch_timeout, 2); pframe = rtw_set_ie(pframe, _CH_SWITCH_TIMING_, 4, ch_switch_timing, &(pattrib->pktlen)); @@ -2634,9 +2633,9 @@ void rtw_build_tunneled_probe_req_ies(_adapter * padapter, struct xmit_frame * p u8 probe_req = 4; u8 wfdielen = 0; - //payload type + /* payload type */ pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, OUI, frame_body_type + /* category, OUI, frame_body_type */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 3, WFA_OUI, &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(probe_req), &(pattrib->pktlen)); @@ -2668,9 +2667,9 @@ void rtw_build_tunneled_probe_rsp_ies(_adapter * padapter, struct xmit_frame * p u8 probe_rsp = 5; u8 wfdielen = 0; - //payload type + /* payload type */ pframe = rtw_set_fixed_ie(pframe, 1, &(payload_type), &(pattrib->pktlen)); - //category, OUI, frame_body_type + /* category, OUI, frame_body_type */ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 3, WFA_OUI, &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(probe_rsp), &(pattrib->pktlen)); @@ -2689,15 +2688,15 @@ void rtw_build_tunneled_probe_rsp_ies(_adapter * padapter, struct xmit_frame * p } } -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ void _TPK_timer_hdl(void *FunctionContext) { struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext; ptdls_sta->TPK_count++; - //TPK_timer set 1000 as default - //retry timer should set at least 301 sec. + /* TPK_timer set 1000 as default */ + /* retry timer should set at least 301 sec. */ if (ptdls_sta->TPK_count==TPK_RESEND_COUNT){ ptdls_sta->TPK_count=0; issue_tdls_setup_req(ptdls_sta->padapter, ptdls_sta->hwaddr); @@ -2713,9 +2712,9 @@ void init_TPK_timer(_adapter *padapter, struct sta_info *psta) _init_timer(&psta->TPK_timer, padapter->pnetdev, _TPK_timer_hdl, psta); } -// TDLS_DONE_CH_SEN: channel sensing and report candidate channel -// TDLS_OFF_CH: first time set channel to off channel -// TDLS_BASE_CH: when go back to the channel linked with AP, send null data to peer STA as an indication +/* TDLS_DONE_CH_SEN: channel sensing and report candidate channel */ +/* TDLS_OFF_CH: first time set channel to off channel */ +/* TDLS_BASE_CH: when go back to the channel linked with AP, send null data to peer STA as an indication */ void _ch_switch_timer_hdl(void *FunctionContext) { @@ -2782,7 +2781,7 @@ void init_handshake_timer(_adapter *padapter, struct sta_info *psta) _init_timer(&psta->handshake_timer, padapter->pnetdev, _tdls_handshake_timer_hdl, psta); } -//Check tdls peer sta alive. +/* Check tdls peer sta alive. */ void _tdls_alive_timer_phase1_hdl(void *FunctionContext) { _irqL irqL; @@ -2895,21 +2894,21 @@ u32 update_mask_tdls(_adapter *padapter, struct sta_info *psta) WLAN_BSSID_EX *pcur_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network; psta_ht = &psta->htpriv; - //b/g mode ra_bitmap + /* b/g mode ra_bitmap */ for (i=0; ibssrateset); i++) { if (psta->bssrateset[i]) tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i]&0x7f); } - //n mode ra_bitmap + /* n mode ra_bitmap */ if (psta_ht->ht_option) { padapter->HalFunc.GetHwRegHandler(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); if (rf_type == RF_2T2R) - limit=16;// 2R + limit=16;/* 2R */ else - limit=8;// 1R + limit=8;/* 1R */ for (i=0; iht_cap.supp_mcs_set[i/8] & BIT(i%8)) @@ -2918,7 +2917,7 @@ u32 update_mask_tdls(_adapter *padapter, struct sta_info *psta) } if ( pcur_network->Configuration.DSConfig > 14 ) { - // 5G band + /* 5G band */ if (tx_ra_bitmap & 0xffff000) sta_band |= WIRELESS_11_5N | WIRELESS_11A; else @@ -2937,4 +2936,4 @@ u32 update_mask_tdls(_adapter *padapter, struct sta_info *psta) return tx_ra_bitmap; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index 8fca5b5..e74b324 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -44,7 +44,7 @@ unsigned char REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20}; extern unsigned char MCS_rate_2R[16]; #ifdef CONFIG_DISABLE_MCS13TO15 extern unsigned char MCS_rate_2R_MCS13TO15_OFF[16]; -#endif //CONFIG_DISABLE_MCS13TO15 +#endif /* CONFIG_DISABLE_MCS13TO15 */ extern unsigned char MCS_rate_1R[16]; extern unsigned char RTW_WPA_OUI[]; extern unsigned char WPA_TKIP_CIPHER[4]; @@ -52,7 +52,7 @@ extern unsigned char RSN_TKIP_CIPHER[4]; #define R2T_PHY_DELAY (0) -//#define WAIT_FOR_BCN_TO_M (3000) +/* define WAIT_FOR_BCN_TO_M (3000) */ #define WAIT_FOR_BCN_TO_MIN (6000) #define WAIT_FOR_BCN_TO_MAX (20000) @@ -314,7 +314,7 @@ void UpdateBrateTbl(PADAPTER Adapter, u8 *mBratesOS) u8 i; u8 rate; - // 1M, 2M, 5.5M, 11M, 6M, 12M, 24M are mandatory. + /* 1M, 2M, 5.5M, 11M, 6M, 12M, 24M are mandatory. */ for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) { rate = mBratesOS[i] & 0x7f; switch (rate) { @@ -487,17 +487,17 @@ void SelectChannel(_adapter *padapter, unsigned char channel) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; #ifdef CONFIG_DUALMAC_CONCURRENT - //saved channel info + /* saved channel info */ rtw_set_oper_ch(padapter, channel); dc_SelectChannel(padapter, channel); -#else //CONFIG_DUALMAC_CONCURRENT +#else /* CONFIG_DUALMAC_CONCURRENT */ #ifdef CONFIG_CONCURRENT_MODE _enter_critical_mutex(padapter->psetch_mutex, NULL); #endif - //saved channel info + /* saved channel info */ rtw_set_oper_ch(padapter, channel); rtw_hal_set_chan(padapter, channel); @@ -507,7 +507,7 @@ void SelectChannel(_adapter *padapter, unsigned char channel) _exit_critical_mutex(padapter->psetch_mutex, NULL); #endif -#endif // CONFIG_DUALMAC_CONCURRENT +#endif /* CONFIG_DUALMAC_CONCURRENT */ } void SetBWMode(_adapter *padapter, unsigned short bwmode, unsigned char channel_offset) @@ -515,17 +515,17 @@ void SetBWMode(_adapter *padapter, unsigned short bwmode, unsigned char channel_ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; #ifdef CONFIG_DUALMAC_CONCURRENT - //saved bw info + /* saved bw info */ rtw_set_oper_bw(padapter, bwmode); rtw_set_oper_choffset(padapter, channel_offset); dc_SetBWMode(padapter, bwmode, channel_offset); -#else //CONFIG_DUALMAC_CONCURRENT +#else /* CONFIG_DUALMAC_CONCURRENT */ #ifdef CONFIG_CONCURRENT_MODE _enter_critical_mutex(padapter->psetbw_mutex, NULL); #endif - //saved bw info + /* saved bw info */ rtw_set_oper_bw(padapter, bwmode); rtw_set_oper_choffset(padapter, channel_offset); @@ -535,7 +535,7 @@ void SetBWMode(_adapter *padapter, unsigned short bwmode, unsigned char channel_ _exit_critical_mutex(padapter->psetbw_mutex, NULL); #endif -#endif // CONFIG_DUALMAC_CONCURRENT +#endif /* CONFIG_DUALMAC_CONCURRENT */ } void set_channel_bwmode(_adapter *padapter, unsigned char channel, unsigned char channel_offset, unsigned short bwmode) @@ -550,50 +550,50 @@ void set_channel_bwmode(_adapter *padapter, unsigned char channel, unsigned char if ((bwmode == HT_CHANNEL_WIDTH_20)||(channel_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE)) { - //SelectChannel(padapter, channel); + /* SelectChannel(padapter, channel); */ center_ch = channel; } else { - //switch to the proper channel + /* switch to the proper channel */ if (channel_offset == HAL_PRIME_CHNL_OFFSET_LOWER) { - //SelectChannel(padapter, channel + 2); + /* SelectChannel(padapter, channel + 2); */ center_ch = channel + 2; } else { - //SelectChannel(padapter, channel - 2); + /* SelectChannel(padapter, channel - 2); */ center_ch = channel - 2; } } - //set Channel + /* set Channel */ #ifdef CONFIG_DUALMAC_CONCURRENT - //saved channel/bw info + /* saved channel/bw info */ rtw_set_oper_ch(padapter, channel); rtw_set_oper_bw(padapter, bwmode); rtw_set_oper_choffset(padapter, channel_offset); - dc_SelectChannel(padapter, center_ch);// set center channel -#else //CONFIG_DUALMAC_CONCURRENT + dc_SelectChannel(padapter, center_ch);/* set center channel */ +#else /* CONFIG_DUALMAC_CONCURRENT */ #ifdef CONFIG_CONCURRENT_MODE _enter_critical_mutex(padapter->psetch_mutex, NULL); #endif - //saved channel/bw info + /* saved channel/bw info */ rtw_set_oper_ch(padapter, channel); rtw_set_oper_bw(padapter, bwmode); rtw_set_oper_choffset(padapter, channel_offset); - rtw_hal_set_chan(padapter, center_ch); // set center channel + rtw_hal_set_chan(padapter, center_ch); /* set center channel */ #ifdef CONFIG_CONCURRENT_MODE _exit_critical_mutex(padapter->psetch_mutex, NULL); #endif -#endif // CONFIG_DUALMAC_CONCURRENT +#endif /* CONFIG_DUALMAC_CONCURRENT */ SetBWMode(padapter, bwmode, channel_offset); @@ -745,12 +745,12 @@ void write_cam(_adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key) rtw_hal_set_hwreg(padapter, HW_VAR_CAM_WRITE, (u8 *)cam_val); - //rtw_write32(padapter, WCAMI, val); + /* rtw_write32(padapter, WCAMI, val); */ - //cmd = CAM_POLLINIG | CAM_WRITE | (addr + j); - //rtw_write32(padapter, RWCAM, cmd); + /* cmd = CAM_POLLINIG | CAM_WRITE | (addr + j); */ + /* rtw_write32(padapter, RWCAM, cmd); */ - //DBG_88E("%s=> cam write: %x, %x\n",__func__, cmd, val); + /* DBG_88E("%s=> cam write: %x, %x\n",__func__, cmd, val); */ } @@ -792,7 +792,7 @@ void flush_all_cam_entry(_adapter *padapter) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - //if (check_buddy_mlmeinfo_state(padapter, _HW_STATE_NOLINK_)) + /* if (check_buddy_mlmeinfo_state(padapter, _HW_STATE_NOLINK_)) */ if (check_buddy_fwstate(padapter, _FW_LINKED) == false) { rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0); @@ -803,32 +803,32 @@ void flush_all_cam_entry(_adapter *padapter) { struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *psta; - u8 cam_id;//cam_entry + u8 cam_id;/* cam_entry */ psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress); if (psta) { if (psta->state & WIFI_AP_STATE) - {} //clear cam when ap free per sta_info + {} /* clear cam when ap free per sta_info */ else { if (psta->mac_id==2) cam_id = 5; else cam_id = 4; } - //clear_cam_entry(padapter, cam_id); + /* clear_cam_entry(padapter, cam_id); */ rtw_clearstakey_cmd(padapter, (u8*)psta, cam_id, false); } } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { - //clear cam when ap free per sta_info + /* clear cam when ap free per sta_info */ } } -#else //CONFIG_CONCURRENT_MODE +#else /* CONFIG_CONCURRENT_MODE */ rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, NULL); -#endif //CONFIG_CONCURRENT_MODE +#endif /* CONFIG_CONCURRENT_MODE */ _rtw_memset((u8 *)(pmlmeinfo->FW_sta_info), 0, sizeof(pmlmeinfo->FW_sta_info)); @@ -872,7 +872,7 @@ int WFD_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) { - //struct registry_priv *pregpriv = &padapter->registrypriv; + /* struct registry_priv *pregpriv = &padapter->registrypriv; */ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -886,27 +886,6 @@ int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) pmlmeinfo->WMM_enable = 1; _rtw_memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element)); return true; - - /*if (pregpriv->wifi_spec == 1) - { - if (pmlmeinfo->WMM_enable == 1) - { - //todo: compare the parameter set count & decide wheher to update or not - return _FAIL; - } - else - { - pmlmeinfo->WMM_enable = 1; - _rtw_rtw_memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element)); - return true; - } - } - else - { - pmlmeinfo->WMM_enable = 0; - return _FAIL; - }*/ - } void WMMOnAssocRsp(_adapter *padapter) @@ -937,7 +916,7 @@ void WMMOnAssocRsp(_adapter *padapter) ACI = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN >> 5) & 0x03; ACM = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN >> 4) & 0x01; - //AIFS = AIFSN * slot time + SIFS - r2t phy delay + /* AIFS = AIFSN * slot time + SIFS - r2t phy delay */ AIFS = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN & 0x0f) * pmlmeinfo->slotTime + aSifsTime; ECWMin = (pmlmeinfo->WMM_param.ac_param[i].CW & 0x0f); @@ -955,7 +934,7 @@ void WMMOnAssocRsp(_adapter *padapter) case 0x1: rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BK, (u8 *)(&acParm)); - //acm_mask |= (ACM? BIT(0):0); + /* acm_mask |= (ACM? BIT(0):0); */ edca[XMIT_BK_QUEUE] = acParm; break; @@ -986,19 +965,19 @@ void WMMOnAssocRsp(_adapter *padapter) { u32 j, tmp, change_inx; - //entry indx: 0->vo, 1->vi, 2->be, 3->bk. + /* entry indx: 0->vo, 1->vi, 2->be, 3->bk. */ for (i=0; i<4; i++) { for (j=i+1; j<4; j++) { - //compare CW and AIFS + /* compare CW and AIFS */ if ((edca[j] & 0xFFFF) < (edca[i] & 0xFFFF)) { change_inx = true; } else if ((edca[j] & 0xFFFF) == (edca[i] & 0xFFFF)) { - //compare TXOP + /* compare TXOP */ if ((edca[j] >> 16) > (edca[i] >> 16)) change_inx = true; } @@ -1082,7 +1061,7 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI pmlmeext->cur_bwmode = new_bwmode; pmlmeext->cur_ch_offset = new_ch_offset; - //update HT info also + /* update HT info also */ HT_info_handler(padapter, pIE); } else @@ -1097,10 +1076,10 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); struct sta_priv *pstapriv = &padapter->stapriv; - //set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); + /* set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); */ - //update ap's stainfo + /* update ap's stainfo */ psta = rtw_get_stainfo(pstapriv, cur_network->MacAddress); if (psta) { @@ -1108,7 +1087,7 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI if (phtpriv_sta->ht_option) { - // bwmode + /* bwmode */ phtpriv_sta->bwmode = pmlmeext->cur_bwmode; phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset; } @@ -1117,13 +1096,9 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_20; phtpriv_sta->ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; } - } - - //pmlmeinfo->bwmode_updated = false;//bwmode_updated done, reset it! - } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ } void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) @@ -1148,13 +1123,13 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) { if (i != 2) { - // Commented by Albert 2010/07/12 - // Got the endian issue here. + /* Commented by Albert 2010/07/12 */ + /* Got the endian issue here. */ pmlmeinfo->HT_caps.u.HT_cap[i] &= (pIE->data[i]); } else { - //modify from fw by Thomas 2010/11/17 + /* modify from fw by Thomas 2010/11/17 */ if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3) > (pIE->data[i] & 0x3)) { max_AMPDU_len = (pIE->data[i] & 0x3); @@ -1179,7 +1154,7 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); - //update the MCS rates + /* update the MCS rates */ for (i = 0; i < 16; i++) { if ((rf_type == RF_1T1R) || (rf_type == RF_1T2R)) { pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i]; @@ -1191,13 +1166,13 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i]; #else pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i]; - #endif //CONFIG_DISABLE_MCS13TO15 + #endif /* CONFIG_DISABLE_MCS13TO15 */ } #ifdef RTL8192C_RECONFIG_TO_1T1R pmlmeinfo->HT_caps.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i]; #endif } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ return; } @@ -1219,7 +1194,7 @@ void HT_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) pmlmeinfo->HT_info_enable = 1; _rtw_memcpy(&(pmlmeinfo->HT_info), pIE->data, pIE->Length); -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ return; } @@ -1227,7 +1202,7 @@ void HTOnAssocRsp(_adapter *padapter) { unsigned char max_AMPDU_len; unsigned char min_MPDU_spacing; - //struct registry_priv *pregpriv = &padapter->registrypriv; + /* struct registry_priv *pregpriv = &padapter->registrypriv; */ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -1240,11 +1215,11 @@ void HTOnAssocRsp(_adapter *padapter) else { pmlmeinfo->HT_enable = 0; - //set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); + /* set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); */ return; } - //handle A-MPDU parameter field + /* handle A-MPDU parameter field */ /* AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k AMPDU_para [4:2]:Min MPDU Start Spacing @@ -1278,12 +1253,12 @@ void VCS_update(_adapter *padapter, struct sta_info *psta) switch (pregpriv->vrtl_carrier_sense)/* 0:off 1:on 2:auto */ { - case 0: //off + case 0: /* off */ psta->rtsen = 0; psta->cts2self = 0; break; - case 1: //on + case 1: /* on */ if (pregpriv->vcs_type == 1) /* 1:RTS/CTS 2:CTS to self */ { psta->rtsen = 1; @@ -1296,7 +1271,7 @@ void VCS_update(_adapter *padapter, struct sta_info *psta) } break; - case 2: //auto + case 2: /* auto */ default: if ((pmlmeinfo->ERP_enable) && (pmlmeinfo->ERP_IE & BIT(1))) { @@ -1323,7 +1298,7 @@ void VCS_update(_adapter *padapter, struct sta_info *psta) #ifdef CONFIG_TDLS int check_ap_tdls_prohibited(u8 *pframe, u8 pkt_len) { - u8 tdls_prohibited_bit = 0x40; //bit(38); TDLS_prohibited + u8 tdls_prohibited_bit = 0x40; /* bit(38); TDLS_prohibited */ if (pkt_len < 5) { @@ -1336,7 +1311,7 @@ int check_ap_tdls_prohibited(u8 *pframe, u8 pkt_len) return false; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) { @@ -1344,7 +1319,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) unsigned char *p; unsigned short val16, subtype; struct wlan_network *cur_network = &(Adapter->mlmepriv.cur_network); - //u8 wpa_ie[255],rsn_ie[255]; + /* u8 wpa_ie[255],rsn_ie[255]; */ u16 wpa_len=0,rsn_len=0; u8 encryp_protocol = 0; WLAN_BSSID_EX *bssid; @@ -1414,12 +1389,12 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len) cur_network->BcnInfo.ht_cap_info, cur_network->BcnInfo.ht_info_infos_0); DBG_88E("%s bw mode change, disconnect\n", __func__); { - //bcn_info_update + /* bcn_info_update */ cur_network->BcnInfo.ht_cap_info = ht_cap_info; cur_network->BcnInfo.ht_info_infos_0 = ht_info_infos_0; - //to do : need to check that whether modify related register of BB or not + /* to do : need to check that whether modify related register of BB or not */ } - //goto _mismatch; + /* goto _mismatch; */ } /* Checking for channel */ @@ -1555,8 +1530,8 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; - u8 tdls_prohibited[] = { 0x00, 0x00, 0x00, 0x00, 0x10 }; //bit(38): TDLS_prohibited -#endif //CONFIG_TDLS + u8 tdls_prohibited[] = { 0x00, 0x00, 0x00, 0x00, 0x10 }; /* bit(38): TDLS_prohibited */ +#endif /* CONFIG_TDLS */ len = pkt_len - (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN); @@ -1566,8 +1541,8 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta switch (pIE->ElementID) { - case _HT_EXTRA_INFO_IE_: //HT info - //HT_info_handler(padapter, pIE); + case _HT_EXTRA_INFO_IE_: /* HT info */ + /* HT_info_handler(padapter, pIE); */ bwmode_update_check(padapter, pIE); break; @@ -1581,7 +1556,7 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta if ( check_ap_tdls_prohibited(pIE->data, pIE->Length) == true ) ptdlsinfo->ap_prohibited = true; break; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ default: break; } @@ -1618,7 +1593,7 @@ void process_csa_ie(_adapter *padapter, u8 *pframe, uint pkt_len) i += (pIE->Length + 2); } } -#endif //CONFIG_DFS +#endif /* CONFIG_DFS */ unsigned int is_ap_in_tkip(_adapter *padapter) { @@ -1917,27 +1892,27 @@ void enable_rate_adaptive(_adapter *padapter, u32 mac_id) void set_sta_rate(_adapter *padapter, struct sta_info *psta) { - //rate adaptive + /* rate adaptive */ enable_rate_adaptive(padapter, psta->mac_id); } -// Update RRSR and Rate for USERATE +/* Update RRSR and Rate for USERATE */ void update_tx_basic_rate(_adapter *padapter, u8 wirelessmode) { NDIS_802_11_RATES_EX supported_rates; #ifdef CONFIG_P2P struct wifidirect_info* pwdinfo = &padapter->wdinfo; - // Added by Albert 2011/03/22 - // In the P2P mode, the driver should not support the b mode. - // So, the Tx packet shouldn't use the CCK rate + /* Added by Albert 2011/03/22 */ + /* In the P2P mode, the driver should not support the b mode. */ + /* So, the Tx packet shouldn't use the CCK rate */ if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) return; -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ #ifdef CONFIG_INTEL_WIDI if (padapter->mlmepriv.widi_state != INTEL_WIDI_STATE_NONE) return; -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ _rtw_memset(supported_rates, 0, NDIS_802_11_LENGTH_RATES_EX); @@ -2063,13 +2038,13 @@ void update_IOT_info(_adapter *padapter) case HT_IOT_PEER_RALINK: pmlmeinfo->turboMode_cts2self = 0; pmlmeinfo->turboMode_rtsen = 1; - //disable high power + /* disable high power */ Switch_DM_Func(padapter, (~DYNAMIC_BB_DYNAMIC_TXPWR), false); break; case HT_IOT_PEER_REALTEK: - //rtw_write16(padapter, 0x4cc, 0xffff); - //rtw_write16(padapter, 0x546, 0x01c0); - //disable high power + /* rtw_write16(padapter, 0x4cc, 0xffff); */ + /* rtw_write16(padapter, 0x546, 0x01c0); */ + /* disable high power */ Switch_DM_Func(padapter, (~DYNAMIC_BB_DYNAMIC_TXPWR), false); break; default: @@ -2086,14 +2061,14 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); bool ShortPreamble; - // Check preamble mode, 2005.01.06, by rcnjko. - // Mark to update preamble value forever, 2008.03.18 by lanhsin - //if ( pMgntInfo->RegPreambleMode == PREAMBLE_AUTO ) + /* Check preamble mode, 2005.01.06, by rcnjko. */ + /* Mark to update preamble value forever, 2008.03.18 by lanhsin */ + /* if ( pMgntInfo->RegPreambleMode == PREAMBLE_AUTO ) */ { if (updateCap & cShortPreamble) - { // Short Preamble - if (pmlmeinfo->preamble_mode != PREAMBLE_SHORT) // PREAMBLE_LONG or PREAMBLE_AUTO + { /* Short Preamble */ + if (pmlmeinfo->preamble_mode != PREAMBLE_SHORT) /* PREAMBLE_LONG or PREAMBLE_AUTO */ { ShortPreamble = true; pmlmeinfo->preamble_mode = PREAMBLE_SHORT; @@ -2101,8 +2076,8 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap) } } else - { // Long Preamble - if (pmlmeinfo->preamble_mode != PREAMBLE_LONG) // PREAMBLE_SHORT or PREAMBLE_AUTO + { /* Long Preamble */ + if (pmlmeinfo->preamble_mode != PREAMBLE_LONG) /* PREAMBLE_SHORT or PREAMBLE_AUTO */ { ShortPreamble = false; pmlmeinfo->preamble_mode = PREAMBLE_LONG; @@ -2112,23 +2087,23 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap) } if ( updateCap & cIBSS ) { - //Filen: See 802.11-2007 p.91 + /* Filen: See 802.11-2007 p.91 */ pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME; } else { - //Filen: See 802.11-2007 p.90 + /* Filen: See 802.11-2007 p.90 */ if ( pmlmeext->cur_wireless_mode & (WIRELESS_11G | WIRELESS_11_24N)) { if ( (updateCap & cShortSlotTime) /* && (!(pMgntInfo->pHTInfo->RT2RT_HT_Mode & RT_HT_CAP_USE_LONG_PREAMBLE)) */) - { // Short Slot Time + { /* Short Slot Time */ if (pmlmeinfo->slotTime != SHORT_SLOT_TIME) { pmlmeinfo->slotTime = SHORT_SLOT_TIME; } } else - { // Long Slot Time + { /* Long Slot Time */ if (pmlmeinfo->slotTime != NON_SHORT_SLOT_TIME) { pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME; @@ -2141,7 +2116,7 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap) } else { - //B Mode + /* B Mode */ pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME; } } @@ -2197,16 +2172,9 @@ void update_wireless_mode(_adapter *padapter) } pmlmeext->cur_wireless_mode = network_type & padapter->registrypriv.wireless_mode; -/* - if ((pmlmeext->cur_wireless_mode==WIRELESS_11G) || - (pmlmeext->cur_wireless_mode==WIRELESS_11BG))//WIRELESS_MODE_G) - SIFS_Timer = 0x0a0a;//CCK - else - SIFS_Timer = 0x0e0e;//pHalData->SifsTime; //OFDM -*/ - SIFS_Timer = 0x0a0a0808; //0x0808 -> for CCK, 0x0a0a -> for OFDM - //change this value if having IOT issues. + SIFS_Timer = 0x0a0a0808; /* 0x0808 -> for CCK, 0x0a0a -> for OFDM */ + /* change this value if having IOT issues. */ padapter->HalFunc.SetHwRegHandler( padapter, HW_VAR_RESP_SIFS, (u8 *)&SIFS_Timer); @@ -2223,7 +2191,7 @@ void update_bmc_sta_support_rate(_adapter *padapter, u32 mac_id) if (pmlmeext->cur_wireless_mode & WIRELESS_11B) { - // Only B, B/G, and B/G/N AP could use CCK rate + /* Only B, B/G, and B/G/N AP could use CCK rate */ _rtw_memcpy((pmlmeinfo->FW_sta_info[mac_id].SupportedRates), rtw_basic_rate_cck, 4); } else @@ -2338,19 +2306,19 @@ int rtw_handle_dualmac(_adapter *adapter, bool init) } else { adapter->pbuddy_adapter = pbuddy_padapter; pbuddy_padapter->pbuddy_adapter = adapter; - // clear global value + /* clear global value */ pbuddy_padapter = NULL; DBG_88E("%s(): pbuddy_padapter exist, Exchange Information\n",__func__); } #ifdef CONFIG_DUALMAC_CONCURRENT if (dvobj->InterfaceNumber == 0) { - //set adapter_type/iface type + /* set adapter_type/iface type */ adapter->isprimary = true; adapter->adapter_type = PRIMARY_ADAPTER; adapter->iface_type = IFACE_PORT0; DBG_88E("%s(): PRIMARY_ADAPTER\n",__func__); } else { - //set adapter_type/iface type + /* set adapter_type/iface type */ adapter->isprimary = false; adapter->adapter_type = SECONDARY_ADAPTER; adapter->iface_type = IFACE_PORT1; diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index 4d168a9..b717d43 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -52,8 +52,8 @@ _func_enter_; _rtw_spinlock_init(&psta_xmitpriv->lock); - //for (i = 0 ; i < MAX_NUMBLKS; i++) - // _init_txservq(&(psta_xmitpriv->blk_q[i])); + /* for (i = 0 ; i < MAX_NUMBLKS; i++) */ + /* _init_txservq(&(psta_xmitpriv->blk_q[i])); */ _init_txservq(&psta_xmitpriv->be_q); _init_txservq(&psta_xmitpriv->bk_q); @@ -77,8 +77,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) _func_enter_; - // We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). - //_rtw_memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); + /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ + /* _rtw_memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); */ _rtw_spinlock_init(&pxmitpriv->lock); _rtw_init_sema(&pxmitpriv->xmit_sema, 0); @@ -90,8 +90,8 @@ _func_enter_; pxmitpriv->adapter = padapter; - //for (i = 0 ; i < MAX_NUMBLKS; i++) - // _rtw_init_queue(&pxmitpriv->blk_strms[i]); + /* for (i = 0 ; i < MAX_NUMBLKS; i++) */ + /* _rtw_init_queue(&pxmitpriv->blk_strms[i]); */ _rtw_init_queue(&pxmitpriv->be_pending); _rtw_init_queue(&pxmitpriv->bk_pending); @@ -99,8 +99,8 @@ _func_enter_; _rtw_init_queue(&pxmitpriv->vo_pending); _rtw_init_queue(&pxmitpriv->bm_pending); - //_rtw_init_queue(&pxmitpriv->legacy_dz_queue); - //_rtw_init_queue(&pxmitpriv->apsd_queue); + /* _rtw_init_queue(&pxmitpriv->legacy_dz_queue); */ + /* _rtw_init_queue(&pxmitpriv->apsd_queue); */ _rtw_init_queue(&pxmitpriv->free_xmit_queue); @@ -120,8 +120,8 @@ _func_enter_; goto exit; } pxmitpriv->pxmit_frame_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_frame_buf), 4); - //pxmitpriv->pxmit_frame_buf = pxmitpriv->pallocated_frame_buf + 4 - - // ((SIZE_PTR) (pxmitpriv->pallocated_frame_buf) &3); + /* pxmitpriv->pxmit_frame_buf = pxmitpriv->pallocated_frame_buf + 4 - */ + /* ((SIZE_PTR) (pxmitpriv->pallocated_frame_buf) &3); */ pxframe = (struct xmit_frame*) pxmitpriv->pxmit_frame_buf; @@ -147,7 +147,7 @@ _func_enter_; pxmitpriv->frag_len = MAX_FRAG_THRESHOLD; - //init xmit_buf + /* init xmit_buf */ _rtw_init_queue(&pxmitpriv->free_xmitbuf_queue); _rtw_init_queue(&pxmitpriv->pending_xmitbuf_queue); @@ -160,8 +160,8 @@ _func_enter_; } pxmitpriv->pxmitbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_xmitbuf), 4); - //pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 - - // ((SIZE_PTR) (pxmitpriv->pallocated_xmitbuf) &3); + /* pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 - */ + /* ((SIZE_PTR) (pxmitpriv->pallocated_xmitbuf) &3); */ pxmitbuf = (struct xmit_buf*)pxmitpriv->pxmitbuf; @@ -173,17 +173,6 @@ _func_enter_; pxmitbuf->padapter = padapter; pxmitbuf->ext_tag = false; -/* - pxmitbuf->pallocated_buf = rtw_zmalloc(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ); - if (pxmitbuf->pallocated_buf == NULL) - { - res = _FAIL; - goto exit; - } - - pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ); - //pxmitbuf->pbuf = pxmitbuf->pallocated_buf + XMITBUF_ALIGN_SZ -((SIZE_PTR) (pxmitbuf->pallocated_buf) &(XMITBUF_ALIGN_SZ-1)); -*/ /* Tx buf allocation may fail sometimes, so sleep and retry. */ if ((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) == _FAIL) { rtw_msleep_os(10); @@ -213,7 +202,7 @@ _func_enter_; pxmitpriv->free_xmitbuf_cnt = NR_XMITBUFF; - // Init xmit extension buff + /* Init xmit extension buff */ _rtw_init_queue(&pxmitpriv->free_xmit_extbuf_queue); pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4); @@ -282,7 +271,7 @@ _func_enter_; _rtw_init_sema(&(pxmitpriv->tx_retevt), 0); - //per AC pending irp + /* per AC pending irp */ pxmitpriv->beq_cnt = 0; pxmitpriv->bkq_cnt = 0; pxmitpriv->viq_cnt = 0; @@ -318,8 +307,8 @@ void rtw_mfree_xmit_priv_lock (struct xmit_priv *pxmitpriv) _rtw_spinlock_free(&pxmitpriv->vo_pending.lock); _rtw_spinlock_free(&pxmitpriv->bm_pending.lock); - //_rtw_spinlock_free(&pxmitpriv->legacy_dz_queue.lock); - //_rtw_spinlock_free(&pxmitpriv->apsd_queue.lock); + /* _rtw_spinlock_free(&pxmitpriv->legacy_dz_queue.lock); */ + /* _rtw_spinlock_free(&pxmitpriv->apsd_queue.lock); */ _rtw_spinlock_free(&pxmitpriv->free_xmit_queue.lock); _rtw_spinlock_free(&pxmitpriv->free_xmitbuf_queue.lock); @@ -362,8 +351,8 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv) { rtw_os_xmit_resource_free(padapter, pxmitbuf,(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ)); - //if (pxmitbuf->pallocated_buf) - // rtw_mfree(pxmitbuf->pallocated_buf, MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ); + /* if (pxmitbuf->pallocated_buf) */ + /* rtw_mfree(pxmitbuf->pallocated_buf, MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ); */ pxmitbuf++; } @@ -377,7 +366,7 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv) rtw_vmfree(pxmitpriv->pallocated_xmitbuf, NR_XMITBUFF * sizeof(struct xmit_buf) + 4); } - // free xmit extension buff + /* free xmit extension buff */ _rtw_spinlock_free(&pxmitpriv->free_xmit_extbuf_queue.lock); pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; @@ -385,8 +374,8 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv) { rtw_os_xmit_resource_free(padapter, pxmitbuf,(max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)); - //if (pxmitbuf->pallocated_buf) - // rtw_mfree(pxmitbuf->pallocated_buf, max_xmit_extbuf_size); + /* if (pxmitbuf->pallocated_buf) */ + /* rtw_mfree(pxmitbuf->pallocated_buf, max_xmit_extbuf_size); */ pxmitbuf++; } @@ -420,15 +409,15 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf { sz = padapter->xmitpriv.frag_len; } - else //no frag + else /* no frag */ { sz = pattrib->last_txcmdsz; } - // (1) RTS_Threshold is compared to the MPDU, not MSDU. - // (2) If there are more than one frag in this MSDU, only the first frag uses protection frame. - // Other fragments are protected by previous fragment. - // So we only need to check the length of first fragment. + /* (1) RTS_Threshold is compared to the MPDU, not MSDU. */ + /* (2) If there are more than one frag in this MSDU, only the first frag uses protection frame. */ + /* Other fragments are protected by previous fragment. */ + /* So we only need to check the length of first fragment. */ if (pmlmeext->cur_wireless_mode < WIRELESS_11_24N || padapter->registrypriv.wifi_spec) { if (sz > padapter->registrypriv.rts_thresh) @@ -449,7 +438,7 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf { while (true) { - //IOT action + /* IOT action */ if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) && (pattrib->ampdu_en==true) && (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_ )) { @@ -458,7 +447,7 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf } - //check ERP protection + /* check ERP protection */ if (psta->rtsen || psta->cts2self) { if (psta->rtsen) @@ -469,7 +458,7 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf break; } - //check HT op mode + /* check HT op mode */ if (pattrib->ht_en) { u8 HTOpMode = pmlmeinfo->HT_protection; @@ -481,16 +470,16 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf } } - //check rts + /* check rts */ if (sz > padapter->registrypriv.rts_thresh) { pattrib->vcs_mode = RTS_CTS; break; } - //to do list: check MIMO power save condition. + /* to do list: check MIMO power save condition. */ - //check AMPDU aggregation for TXOP + /* check AMPDU aggregation for TXOP */ if (pattrib->ampdu_en==true) { pattrib->vcs_mode = RTS_CTS; @@ -516,7 +505,7 @@ static void update_attrib_phy_info(struct pkt_attrib *pattrib, struct sta_info * pattrib->eosp = 0; pattrib->triggered=0; - //qos_en, ht_en, init rate, ,bw, ch_offset, sgi + /* qos_en, ht_en, init rate, ,bw, ch_offset, sgi */ pattrib->qos_en = psta->qos_option; pattrib->raid = psta->raid; @@ -526,12 +515,12 @@ static void update_attrib_phy_info(struct pkt_attrib *pattrib, struct sta_info * pattrib->ch_offset = psta->htpriv.ch_offset; pattrib->sgi= psta->htpriv.sgi; pattrib->ampdu_en = false; -#endif //CONFIG_80211N_HT - //if (pattrib->ht_en && psta->htpriv.ampdu_enable) - //{ - // if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) - // pattrib->ampdu_en = true; - //} +#endif /* CONFIG_80211N_HT */ + /* if (pattrib->ht_en && psta->htpriv.ampdu_enable) */ + /* */ + /* if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) */ + /* pattrib->ampdu_en = true; */ + /* */ pattrib->retry_ctrl = false; @@ -580,14 +569,14 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib) _rtw_open_pktfile(ppktfile->pkt, ppktfile); _rtw_pktfile_read(ppktfile, (unsigned char*)ðerhdr, ETH_HLEN); - // get UserPriority from IP hdr + /* get UserPriority from IP hdr */ if (pattrib->ether_type == 0x0800) { _rtw_pktfile_read(ppktfile, (u8*)&ip_hdr, sizeof(ip_hdr)); -// UserPriority = (ntohs(ip_hdr.tos) >> 5) & 0x3; +/* UserPriority = (ntohs(ip_hdr.tos) >> 5) & 0x3; */ UserPriority = ip_hdr.tos >> 5; } else if (pattrib->ether_type == 0x888e) { - // "When priority processing of data frames is supported, - // a STA's SME should send EAPOL-Key frames at the highest priority." + /* "When priority processing of data frames is supported, */ + /* a STA's SME should send EAPOL-Key frames at the highest priority." */ UserPriority = 7; } @@ -640,27 +629,19 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr if (ETH_P_IP == pattrib->ether_type) { - // The following is for DHCP and ARP packet, we use cck1M to tx these packets and let LPS awake some time - // to prevent DHCP protocol fail + /* The following is for DHCP and ARP packet, we use cck1M to tx these packets and let LPS awake some time */ + /* to prevent DHCP protocol fail */ u8 tmp[24]; _rtw_pktfile_read(&pktfile, &tmp[0], 24); pattrib->dhcp_pkt = 0; - if (pktfile.pkt_len > 282) {//MINIMUM_DHCP_PACKET_SIZE) { - if (ETH_P_IP == pattrib->ether_type) {// IP header + if (pktfile.pkt_len > 282) {/* MINIMUM_DHCP_PACKET_SIZE) { */ + if (ETH_P_IP == pattrib->ether_type) {/* IP header */ if (((tmp[21] == 68) && (tmp[23] == 67)) || ((tmp[21] == 67) && (tmp[23] == 68))) { - // 68 : UDP BOOTP client - // 67 : UDP BOOTP server + /* 68 : UDP BOOTP client */ + /* 67 : UDP BOOTP server */ RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("======================update_attrib: get DHCP Packet\n")); - // Use low rate to send DHCP packet. - //if (pMgntInfo->IOTAction & HT_IOT_ACT_WA_IOT_Broadcom) - //{ - // tcb_desc->DataRate = MgntQuery_TxRateExcludeCCKRates(ieee);//0xc;//ofdm 6m - // tcb_desc->bTxDisableRateFallBack = false; - //} - //else - // pTcb->DataRate = Adapter->MgntInfo.LowestBasicRate; - //RTPRINT(FDM, WA_IOT, ("DHCP TranslateHeader(), pTcb->DataRate = 0x%x\n", pTcb->DataRate)); + /* Use low rate to send DHCP packet. */ pattrib->dhcp_pkt = 1; } } @@ -675,7 +656,7 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr } #ifdef CONFIG_LPS - // If EAPOL , ARP , OR DHCP packet, driver must be in active mode. + /* If EAPOL , ARP , OR DHCP packet, driver must be in active mode. */ #ifdef CONFIG_WAPI_SUPPORT if ( (pattrib->ether_type == 0x88B4) || (pattrib->ether_type == 0x0806) || (pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1) ) #else @@ -688,12 +669,12 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr bmcast = IS_MCAST(pattrib->ra); - // get sta_info + /* get sta_info */ if (bmcast) { psta = rtw_get_bcmc_stainfo(padapter); } else { psta = rtw_get_stainfo(pstapriv, pattrib->ra); - if (psta == NULL) { // if we cannot get psta => drrp the pkt + if (psta == NULL) { /* if we cannot get psta => drrp the pkt */ RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra: %pM\n", (pattrib->ra))); #ifdef DBG_TX_DROP_FRAME DBG_88E("DBG_TX_DROP_FRAME %s get sta_info fail, ra: %pM\n", __func__, (pattrib->ra)); @@ -711,12 +692,12 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr if (psta) { pattrib->mac_id = psta->mac_id; - //DBG_88E("%s ==> mac_id(%d)\n",__func__,pattrib->mac_id ); + /* DBG_88E("%s ==> mac_id(%d)\n",__func__,pattrib->mac_id ); */ pattrib->psta = psta; } else { - // if we cannot get psta => drop the pkt + /* if we cannot get psta => drop the pkt */ RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra:%pM\n", (pattrib->ra))); #ifdef DBG_TX_DROP_FRAME DBG_88E("DBG_TX_DROP_FRAME %s get sta_info fail, ra:%pM\n", __func__, (pattrib->ra)); @@ -726,8 +707,8 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr } pattrib->ack_policy = 0; - // get ether_hdr_len - pattrib->pkt_hdrlen = ETH_HLEN;//(pattrib->ether_type == 0x8100) ? (14 + 4 ): 14; //vlan tag + /* get ether_hdr_len */ + pattrib->pkt_hdrlen = ETH_HLEN;/* pattrib->ether_type == 0x8100) ? (14 + 4 ): 14; vlan tag */ pattrib->hdrlen = WLAN_HDR_A3_LEN; pattrib->subtype = WIFI_DATA_TYPE; @@ -751,8 +732,6 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr } } - //pattrib->priority = 5; //force to used VI queue, for testing - if (psta->ieee8021x_blocked == true) { RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("\n psta->ieee8021x_blocked == true\n")); @@ -860,7 +839,7 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr #ifdef CONFIG_CONCURRENT_MODE if ((pattrib->encrypt && bmcast) || (pattrib->encrypt ==_WEP40_) || (pattrib->encrypt ==_WEP104_)) { - pattrib->bswenc = true;//force using sw enc. + pattrib->bswenc = true;/* force using sw enc. */ } #endif @@ -915,9 +894,9 @@ _func_enter_; #endif #endif - if (pattrib->encrypt ==_TKIP_)//if (psecuritypriv->dot11PrivacyAlgrthm==_TKIP_PRIVACY_) + if (pattrib->encrypt ==_TKIP_)/* if (psecuritypriv->dot11PrivacyAlgrthm==_TKIP_PRIVACY_) */ { - //encode mic code + /* encode mic code */ if (stainfo!= NULL){ u8 null_key[16]={0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; @@ -926,41 +905,41 @@ _func_enter_; if (bmcst) { if (_rtw_memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16)==true){ - //DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); - //rtw_msleep_os(10); + /* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */ + /* rtw_msleep_os(10); */ return _FAIL; } - //start to calculate the mic code + /* start to calculate the mic code */ rtw_secmicsetkey(&micdata, psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey); } else { if (_rtw_memcmp(&stainfo->dot11tkiptxmickey.skey[0],null_key, 16)==true){ - //DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); - //rtw_msleep_os(10); + /* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */ + /* rtw_msleep_os(10); */ return _FAIL; } - //start to calculate the mic code + /* start to calculate the mic code */ rtw_secmicsetkey(&micdata, &stainfo->dot11tkiptxmickey.skey[0]); } - if (pframe[1]&1){ //ToDS==1 - rtw_secmicappend(&micdata, &pframe[16], 6); //DA - if (pframe[1]&2) //From Ds==1 + if (pframe[1]&1){ /* ToDS==1 */ + rtw_secmicappend(&micdata, &pframe[16], 6); /* DA */ + if (pframe[1]&2) /* From Ds==1 */ rtw_secmicappend(&micdata, &pframe[24], 6); else rtw_secmicappend(&micdata, &pframe[10], 6); } - else{ //ToDS==0 - rtw_secmicappend(&micdata, &pframe[4], 6); //DA - if (pframe[1]&2) //From Ds==1 + else{ /* ToDS==0 */ + rtw_secmicappend(&micdata, &pframe[4], 6); /* DA */ + if (pframe[1]&2) /* From Ds==1 */ rtw_secmicappend(&micdata, &pframe[16], 6); else rtw_secmicappend(&micdata, &pframe[10], 6); } - //if (pqospriv->qos_option==1) + /* if (pqospriv->qos_option==1) */ if (pattrib->qos_en) priority[0]=(u8)pxmitframe->attrib.priority; @@ -994,7 +973,7 @@ _func_enter_; RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("xmitframe_addmic: mic[0]=0x%.2x ,mic[1]=0x%.2x ,mic[2]=0x%.2x ,mic[3]=0x%.2x\n\ mic[4]=0x%.2x ,mic[5]=0x%.2x ,mic[6]=0x%.2x ,mic[7]=0x%.2x !!!!\n", mic[0],mic[1],mic[2],mic[3],mic[4],mic[5],mic[6],mic[7])); - //add mic code and add the mic code length in last_txcmdsz + /* add mic code and add the mic code length in last_txcmdsz */ _rtw_memcpy(payload, &(mic[0]),8); pattrib->last_txcmdsz+=8; @@ -1019,14 +998,14 @@ _func_exit_; static s32 xmitframe_swencrypt(_adapter *padapter, struct xmit_frame *pxmitframe){ struct pkt_attrib *pattrib = &pxmitframe->attrib; - //struct security_priv *psecuritypriv=&padapter->securitypriv; + /* struct security_priv *psecuritypriv=&padapter->securitypriv; */ _func_enter_; - //if ((psecuritypriv->sw_encrypt)||(pattrib->bswenc)) + /* if ((psecuritypriv->sw_encrypt)||(pattrib->bswenc)) */ if (pattrib->bswenc) { - //DBG_88E("start xmitframe_swencrypt\n"); + /* DBG_88E("start xmitframe_swencrypt\n"); */ RT_TRACE(_module_rtl871x_xmit_c_,_drv_alert_,("### xmitframe_swencrypt\n")); switch (pattrib->encrypt){ case _WEP40_: @@ -1069,7 +1048,7 @@ s32 rtw_make_wlanhdr (_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib) struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *ptdls_sta=NULL, *psta_backup=NULL; u8 direct_link=0; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ sint res = _SUCCESS; u16 *fctrl = &pwlanhdr->frame_ctl; @@ -1096,28 +1075,28 @@ _func_enter_; if (pattrib->subtype & WIFI_DATA_TYPE) { if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)) { - //to_ds = 1, fr_ds = 0; + /* to_ds = 1, fr_ds = 0; */ #ifdef CONFIG_TDLS if ((ptdlsinfo->setup_state == TDLS_LINKED_STATE)){ ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->dst); if ((ptdls_sta!=NULL)&&(ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)&&(pattrib->ether_type!=0x0806)){ - //TDLS data transfer, ToDS=0, FrDs=0 + /* TDLS data transfer, ToDS=0, FrDs=0 */ _rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN); direct_link=1; }else{ - // 1.Data transfer to AP - // 2.Arp pkt will relayed by AP + /* 1.Data transfer to AP */ + /* 2.Arp pkt will relayed by AP */ SetToDs(fctrl); _rtw_memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN); } }else -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ { - //Data transfer to AP + /* Data transfer to AP */ SetToDs(fctrl); _rtw_memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); @@ -1129,7 +1108,7 @@ _func_enter_; } else if ((check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) ) { - //to_ds = 0, fr_ds = 1; + /* to_ds = 0, fr_ds = 1; */ SetFrDs(fctrl); _rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv), ETH_ALEN); @@ -1171,9 +1150,9 @@ _func_enter_; SetAckpolicy(qc, pattrib->ack_policy); } - //TODO: fill HT Control Field + /* TODO: fill HT Control Field */ - //Update Seq Num will be handled by f/w + /* Update Seq Num will be handled by f/w */ { if (psta){ #ifdef CONFIG_TDLS @@ -1182,7 +1161,7 @@ _func_enter_; psta_backup = psta; psta = ptdls_sta; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ psta->sta_xmitpriv.txseq_tid[pattrib->priority]++; psta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF; @@ -1192,41 +1171,41 @@ _func_enter_; SetSeqNum(hdr, pattrib->seqnum); #ifdef CONFIG_80211N_HT - //check if enable ampdu + /* check if enable ampdu */ if (pattrib->ht_en && psta->htpriv.ampdu_enable) { if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) pattrib->ampdu_en = true; } - //re-check if enable ampdu by BA_starting_seqctrl + /* re-check if enable ampdu by BA_starting_seqctrl */ if (pattrib->ampdu_en == true) { u16 tx_seq; tx_seq = psta->BA_starting_seqctrl[pattrib->priority & 0x0f]; - //check BA_starting_seqctrl + /* check BA_starting_seqctrl */ if (SN_LESS(pattrib->seqnum, tx_seq)) { - //DBG_88E("tx ampdu seqnum(%d) < tx_seq(%d)\n", pattrib->seqnum, tx_seq); - pattrib->ampdu_en = false;//AGG BK + /* DBG_88E("tx ampdu seqnum(%d) < tx_seq(%d)\n", pattrib->seqnum, tx_seq); */ + pattrib->ampdu_en = false;/* AGG BK */ } else if (SN_EQUAL(pattrib->seqnum, tx_seq)) { psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = (tx_seq+1)&0xfff; - pattrib->ampdu_en = true;//AGG EN + pattrib->ampdu_en = true;/* AGG EN */ } else { - //DBG_88E("tx ampdu over run\n"); + /* DBG_88E("tx ampdu over run\n"); */ psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = (pattrib->seqnum+1)&0xfff; - pattrib->ampdu_en = true;//AGG EN + pattrib->ampdu_en = true;/* AGG EN */ } } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ #ifdef CONFIG_TDLS if (direct_link==1) { @@ -1236,8 +1215,8 @@ _func_enter_; pattrib->icv_len=8; } - //qos_en, ht_en, init rate, ,bw, ch_offset, sgi - //pattrib->qos_en = ptdls_sta->qos_option; + /* qos_en, ht_en, init rate, ,bw, ch_offset, sgi */ + /* pattrib->qos_en = ptdls_sta->qos_option; */ pattrib->raid = ptdls_sta->raid; #ifdef CONFIG_80211N_HT @@ -1245,12 +1224,12 @@ _func_enter_; pattrib->ht_en = ptdls_sta->htpriv.ht_option; pattrib->ch_offset = ptdls_sta->htpriv.ch_offset; pattrib->sgi= ptdls_sta->htpriv.sgi; -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ pattrib->mac_id = ptdls_sta->mac_id; psta = psta_backup; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ } } @@ -1349,7 +1328,7 @@ int rtw_build_tdls_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 * case TUNNELED_PROBE_RSP: rtw_build_tunneled_probe_rsp_ies(padapter, pxmitframe, pframe); break; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ default: res=_FAIL; break; @@ -1381,9 +1360,9 @@ _func_enter_; case TDLS_SETUP_REQUEST: case TDLS_SETUP_RESPONSE: case TDLS_SETUP_CONFIRM: - case TDLS_TEARDOWN: //directly to peer STA or via AP + case TDLS_TEARDOWN: /* directly to peer STA or via AP */ case TDLS_PEER_TRAFFIC_INDICATION: - case TDLS_PEER_PSM_REQUEST: //directly to peer STA or via AP + case TDLS_PEER_PSM_REQUEST: /* directly to peer STA or via AP */ case TUNNELED_PROBE_REQ: case TUNNELED_PROBE_RSP: SetToDs(fctrl); @@ -1400,7 +1379,7 @@ _func_enter_; _rtw_memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN); tdls_seq=1; break; - case TDLS_DISCOVERY_REQUEST: //unicast: directly to peer sta, Bcast: via AP + case TDLS_DISCOVERY_REQUEST: /* unicast: directly to peer sta, Bcast: via AP */ if (_rtw_memcmp(pattrib->dst, baddr, ETH_ALEN) ) { SetToDs(fctrl); @@ -1431,8 +1410,8 @@ _func_enter_; psta = pattrib->psta; - // 1. update seq_num per link by sta_info - // 2. rewrite encrypt to _AES_, also rewrite iv_len, icv_len + /* 1. update seq_num per link by sta_info */ + /* 2. rewrite encrypt to _AES_, also rewrite iv_len, icv_len */ if (tdls_seq==1){ ptdls_sta=rtw_get_stainfo(pstapriv, pattrib->dst); if (ptdls_sta){ @@ -1508,7 +1487,7 @@ _func_enter_; pframe = mem_start; pframe += pattrib->hdrlen; - //adding icv, if necessary... + /* adding icv, if necessary... */ if (pattrib->iv_len) { if (psta != NULL) @@ -1542,7 +1521,7 @@ _func_enter_; llc_sz = rtw_put_snap(pframe, pattrib->ether_type); pframe += llc_sz; - //pattrib->pktlen will be counted in rtw_build_tdls_ies + /* pattrib->pktlen will be counted in rtw_build_tdls_ies */ pattrib->pktlen = 0; rtw_build_tdls_ies(padapter, pxmitframe, pframe, action); @@ -1572,7 +1551,7 @@ _func_exit_; return res; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ /* * Calculate wlan 802.11 packet MAX size from pkt_attrib @@ -1582,11 +1561,11 @@ u32 rtw_calculate_wlan_pkt_size_by_attribue(struct pkt_attrib *pattrib) { u32 len = 0; - len = pattrib->hdrlen + pattrib->iv_len; // WLAN Header and IV - len += SNAP_SIZE + sizeof(u16); // LLC + len = pattrib->hdrlen + pattrib->iv_len; /* WLAN Header and IV */ + len += SNAP_SIZE + sizeof(u16); /* LLC */ len += pattrib->pktlen; - if (pattrib->encrypt == _TKIP_) len += 8; // MIC - len += ((pattrib->bswenc) ? pattrib->icv_len : 0); // ICV + if (pattrib->encrypt == _TKIP_) len += 8; /* MIC */ + len += ((pattrib->bswenc) ? pattrib->icv_len : 0); /* ICV */ return len; } @@ -1615,8 +1594,8 @@ s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxm u8 hw_hdr_offset; struct sta_info *psta; - //struct sta_priv *pstapriv = &padapter->stapriv; - //struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + /* struct sta_priv *pstapriv = &padapter->stapriv; */ + /* struct mlme_priv *pmlmepriv = &padapter->mlmepriv; */ struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct pkt_attrib *pattrib = &pxmitframe->attrib; @@ -1628,9 +1607,9 @@ s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxm _func_enter_; - //if (pattrib->psta) { - // psta = pattrib->psta; - //} else + /* if (pattrib->psta) { */ + /* psta = pattrib->psta; */ + /* else */ { psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); } @@ -1648,7 +1627,7 @@ _func_enter_; #ifdef CONFIG_USB_TX_AGGREGATION hw_hdr_offset = TXDESC_SIZE + (pxmitframe->pkt_offset * PACKET_OFFSET_SZ); #else - #ifdef CONFIG_TX_EARLY_MODE //for SDIO && Tx Agg + #ifdef CONFIG_TX_EARLY_MODE /* for SDIO && Tx Agg */ hw_hdr_offset = TXDESC_OFFSET + EARLY_MODE_INFO_SIZE; #else hw_hdr_offset = TXDESC_OFFSET; @@ -1668,7 +1647,7 @@ _func_enter_; _rtw_pktfile_read(&pktfile, NULL, pattrib->pkt_hdrlen); frg_inx = 0; - frg_len = pxmitpriv->frag_len - 4;//2346-4 = 2342 + frg_len = pxmitpriv->frag_len - 4;/* 2346-4 = 2342 */ while (1) { @@ -1683,13 +1662,13 @@ _func_enter_; pframe += pattrib->hdrlen; mpdu_len -= pattrib->hdrlen; - //adding icv, if necessary... + /* adding icv, if necessary... */ if (pattrib->iv_len) { - //if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) - // psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv)); - //else - // psta = rtw_get_stainfo(pstapriv, pattrib->ra); + /* if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) */ + /* psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv)); */ + /* else */ + /* psta = rtw_get_stainfo(pstapriv, pattrib->ra); */ if (psta != NULL) { @@ -1742,7 +1721,7 @@ _func_enter_; if (bmcst) { - // don't do fragment to broadcat/multicast packets + /* don't do fragment to broadcat/multicast packets */ mem_sz = _rtw_pktfile_read(&pktfile, pframe, pattrib->pktlen); } else { mem_sz = _rtw_pktfile_read(&pktfile, pframe, mpdu_len); @@ -1947,7 +1926,7 @@ _func_enter_; pxmitbuf->priv_data = NULL; - //pxmitbuf->ext_tag = true; + /* pxmitbuf->ext_tag = true; */ #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) pxmitbuf->len = 0; @@ -2009,7 +1988,7 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) _func_enter_; - //DBG_88E("+rtw_alloc_xmitbuf\n"); + /* DBG_88E("+rtw_alloc_xmitbuf\n"); */ _enter_critical(&pfree_xmitbuf_queue->lock, &irqL); @@ -2032,10 +2011,10 @@ _func_enter_; #ifdef DBG_XMIT_BUF DBG_88E("DBG_XMIT_BUF ALLOC no=%d, free_xmitbuf_cnt=%d\n",pxmitbuf->no, pxmitpriv->free_xmitbuf_cnt); #endif - //DBG_88E("alloc, free_xmitbuf_cnt=%d\n", pxmitpriv->free_xmitbuf_cnt); + /* DBG_88E("alloc, free_xmitbuf_cnt=%d\n", pxmitpriv->free_xmitbuf_cnt); */ pxmitbuf->priv_data = NULL; - //pxmitbuf->ext_tag = false; + /* pxmitbuf->ext_tag = false; */ #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) pxmitbuf->len = 0; pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; @@ -2072,7 +2051,7 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) _func_enter_; - //DBG_88E("+rtw_free_xmitbuf\n"); + /* DBG_88E("+rtw_free_xmitbuf\n"); */ if (pxmitbuf==NULL) { @@ -2097,7 +2076,7 @@ _func_enter_; rtw_list_insert_tail(&(pxmitbuf->list), get_list_head(pfree_xmitbuf_queue)); pxmitpriv->free_xmitbuf_cnt++; - //DBG_88E("FREE, free_xmitbuf_cnt=%d\n", pxmitpriv->free_xmitbuf_cnt); + /* DBG_88E("FREE, free_xmitbuf_cnt=%d\n", pxmitpriv->free_xmitbuf_cnt); */ #ifdef DBG_XMIT_BUF DBG_88E("DBG_XMIT_BUF FREE no=%d, free_xmitbuf_cnt=%d\n",pxmitbuf->no ,pxmitpriv->free_xmitbuf_cnt); #endif @@ -2121,7 +2100,7 @@ Must be very very cautious... */ -struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)//(_queue *pfree_xmit_queue) +struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* _queue *pfree_xmit_queue) */ { /* Please remember to use all the osdep_service api, @@ -2135,7 +2114,7 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)//(_queue *pf _queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue; #ifdef PLATFORM_LINUX _adapter *padapter = pxmitpriv->adapter; -#endif //PLATFORM_LINUX +#endif /* PLATFORM_LINUX */ _func_enter_; @@ -2154,7 +2133,7 @@ _func_enter_; rtw_list_delete(&(pxframe->list)); } - if (pxframe != NULL)//default value setting + if (pxframe != NULL)/* default value setting */ { pxmitpriv->free_xmitframe_cnt--; @@ -2164,19 +2143,19 @@ _func_enter_; pxframe->pxmitbuf = NULL; _rtw_memset(&pxframe->attrib, 0, sizeof(struct pkt_attrib)); - //pxframe->attrib.psta = NULL; + /* pxframe->attrib.psta = NULL; */ pxframe->frame_tag = DATA_FRAMETAG; #ifdef CONFIG_USB_HCI pxframe->pkt = NULL; - pxframe->pkt_offset = 1;//default use pkt_offset to fill tx desc + pxframe->pkt_offset = 1;/* default use pkt_offset to fill tx desc */ #ifdef CONFIG_USB_TX_AGGREGATION pxframe->agg_num = 1; #endif -#endif //#ifdef CONFIG_USB_HCI +#endif /* ifdef CONFIG_USB_HCI */ #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) pxframe->pg_num = 1; @@ -2271,7 +2250,7 @@ s32 rtw_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe) { RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("rtw_xmitframe_enqueue: drop xmit pkt for classifier fail\n")); -// pxmitframe->pkt = NULL; +/* pxmitframe->pkt = NULL; */ return _FAIL; } @@ -2308,9 +2287,9 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str ptxservq->qcnt--; - //rtw_list_insert_tail(&pxmitframe->list, &phwxmit->pending); + /* rtw_list_insert_tail(&pxmitframe->list, &phwxmit->pending); */ - //ptxservq->qcnt--; + /* ptxservq->qcnt--; */ break; @@ -2333,7 +2312,7 @@ struct xmit_frame* rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi struct registry_priv *pregpriv = &padapter->registrypriv; int i, inx[4]; #ifdef CONFIG_USB_HCI -// int j, tmp, acirp_cnt[4]; +/* int j, tmp, acirp_cnt[4]; */ #endif _func_enter_; @@ -2356,7 +2335,7 @@ _func_enter_; { phwxmit = phwxmit_i + inx[i]; - //_enter_critical_ex(&phwxmit->sta_queue->lock, &irqL0); + /* _enter_critical_ex(&phwxmit->sta_queue->lock, &irqL0); */ sta_phead = get_list_head(phwxmit->sta_queue); sta_plist = get_next(sta_phead); @@ -2374,11 +2353,11 @@ _func_enter_; { phwxmit->accnt--; - //Remove sta node when there is no pending packets. - if (_rtw_queue_empty(pframe_queue)) //must be done after get_next and before break + /* Remove sta node when there is no pending packets. */ + if (_rtw_queue_empty(pframe_queue)) /* must be done after get_next and before break */ rtw_list_delete(&ptxservq->tx_pending); - //_exit_critical_ex(&phwxmit->sta_queue->lock, &irqL0); + /* _exit_critical_ex(&phwxmit->sta_queue->lock, &irqL0); */ goto exit; } @@ -2387,7 +2366,7 @@ _func_enter_; } - //_exit_critical_ex(&phwxmit->sta_queue->lock, &irqL0); + /* _exit_critical_ex(&phwxmit->sta_queue->lock, &irqL0); */ } @@ -2457,7 +2436,7 @@ _func_enter_; if (IS_MCAST(psta->hwaddr)) { - ptxservq = &(psta->sta_xmitpriv.be_q); // we will use be_q to queue bc/mc frames in BCMC_stainfo + ptxservq = &(psta->sta_xmitpriv.be_q); /* we will use be_q to queue bc/mc frames in BCMC_stainfo */ *ppstapending = &padapter->xmitpriv.bm_pending; } else @@ -2514,7 +2493,7 @@ _func_exit_; */ s32 rtw_xmit_classifier(_adapter *padapter, struct xmit_frame *pxmitframe) { - //_irqL irqL0; + /* _irqL irqL0; */ u8 ac_index; struct sta_info *psta; struct tx_servq *ptxservq; @@ -2540,21 +2519,21 @@ _func_enter_; ptxservq = rtw_get_sta_pending(padapter, psta, pattrib->priority, (u8 *)(&ac_index)); - //_enter_critical(&pstapending->lock, &irqL0); + /* _enter_critical(&pstapending->lock, &irqL0); */ if (rtw_is_list_empty(&ptxservq->tx_pending)) { rtw_list_insert_tail(&ptxservq->tx_pending, get_list_head(phwxmits[ac_index].sta_queue)); } - //_enter_critical(&ptxservq->sta_pending.lock, &irqL1); + /* _enter_critical(&ptxservq->sta_pending.lock, &irqL1); */ rtw_list_insert_tail(&pxmitframe->list, get_list_head(&ptxservq->sta_pending)); ptxservq->qcnt++; phwxmits[ac_index].accnt++; - //_exit_critical(&ptxservq->sta_pending.lock, &irqL1); + /* _exit_critical(&ptxservq->sta_pending.lock, &irqL1); */ - //_exit_critical(&pstapending->lock, &irqL0); + /* _exit_critical(&pstapending->lock, &irqL0); */ exit: @@ -2576,44 +2555,44 @@ void rtw_alloc_hwxmits(_adapter *padapter) if (pxmitpriv->hwxmit_entry == 5) { - //pxmitpriv->bmc_txqueue.head = 0; - //hwxmits[0] .phwtxqueue = &pxmitpriv->bmc_txqueue; + /* pxmitpriv->bmc_txqueue.head = 0; */ + /* hwxmits[0] .phwtxqueue = &pxmitpriv->bmc_txqueue; */ hwxmits[0] .sta_queue = &pxmitpriv->bm_pending; - //pxmitpriv->vo_txqueue.head = 0; - //hwxmits[1] .phwtxqueue = &pxmitpriv->vo_txqueue; + /* pxmitpriv->vo_txqueue.head = 0; */ + /* hwxmits[1] .phwtxqueue = &pxmitpriv->vo_txqueue; */ hwxmits[1] .sta_queue = &pxmitpriv->vo_pending; - //pxmitpriv->vi_txqueue.head = 0; - //hwxmits[2] .phwtxqueue = &pxmitpriv->vi_txqueue; + /* pxmitpriv->vi_txqueue.head = 0; */ + /* hwxmits[2] .phwtxqueue = &pxmitpriv->vi_txqueue; */ hwxmits[2] .sta_queue = &pxmitpriv->vi_pending; - //pxmitpriv->bk_txqueue.head = 0; - //hwxmits[3] .phwtxqueue = &pxmitpriv->bk_txqueue; + /* pxmitpriv->bk_txqueue.head = 0; */ + /* hwxmits[3] .phwtxqueue = &pxmitpriv->bk_txqueue; */ hwxmits[3] .sta_queue = &pxmitpriv->bk_pending; - //pxmitpriv->be_txqueue.head = 0; - //hwxmits[4] .phwtxqueue = &pxmitpriv->be_txqueue; + /* pxmitpriv->be_txqueue.head = 0; */ + /* hwxmits[4] .phwtxqueue = &pxmitpriv->be_txqueue; */ hwxmits[4] .sta_queue = &pxmitpriv->be_pending; } else if (pxmitpriv->hwxmit_entry == 4) { - //pxmitpriv->vo_txqueue.head = 0; - //hwxmits[0] .phwtxqueue = &pxmitpriv->vo_txqueue; + /* pxmitpriv->vo_txqueue.head = 0; */ + /* hwxmits[0] .phwtxqueue = &pxmitpriv->vo_txqueue; */ hwxmits[0] .sta_queue = &pxmitpriv->vo_pending; - //pxmitpriv->vi_txqueue.head = 0; - //hwxmits[1] .phwtxqueue = &pxmitpriv->vi_txqueue; + /* pxmitpriv->vi_txqueue.head = 0; */ + /* hwxmits[1] .phwtxqueue = &pxmitpriv->vi_txqueue; */ hwxmits[1] .sta_queue = &pxmitpriv->vi_pending; - //pxmitpriv->be_txqueue.head = 0; - //hwxmits[2] .phwtxqueue = &pxmitpriv->be_txqueue; + /* pxmitpriv->be_txqueue.head = 0; */ + /* hwxmits[2] .phwtxqueue = &pxmitpriv->be_txqueue; */ hwxmits[2] .sta_queue = &pxmitpriv->be_pending; - //pxmitpriv->bk_txqueue.head = 0; - //hwxmits[3] .phwtxqueue = &pxmitpriv->bk_txqueue; + /* pxmitpriv->bk_txqueue.head = 0; */ + /* hwxmits[3] .phwtxqueue = &pxmitpriv->bk_txqueue; */ hwxmits[3] .sta_queue = &pxmitpriv->bk_pending; } else @@ -2641,9 +2620,9 @@ void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry) _func_enter_; for (i = 0; i < entry; i++, phwxmit++) { - //_rtw_spinlock_init(&phwxmit->xmit_lock); - //_rtw_init_listhead(&phwxmit->pending); - //phwxmit->txcmdcnt = 0; + /* _rtw_spinlock_init(&phwxmit->xmit_lock); */ + /* _rtw_init_listhead(&phwxmit->pending); */ + /* phwxmit->txcmdcnt = 0; */ phwxmit->accnt = 0; } _func_exit_; @@ -2655,21 +2634,21 @@ static int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) struct sk_buff *skb = *pskb; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; _irqL irqL; - //if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) + /* if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) */ { int res, is_vlan_tag=0, i, do_nat25=1; unsigned short vlan_hdr=0; void *br_port = NULL; - //mac_clone_handle_frame(priv, skb); + /* mac_clone_handle_frame(priv, skb); */ #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)) */ _enter_critical_bh(&padapter->br_ext_lock, &irqL); if ( !(skb->data[0] & 1) && br_port && @@ -2726,9 +2705,9 @@ static int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) newskb = skb_copy(skb, GFP_ATOMIC); if (newskb == NULL) { - //priv->ext_stats.tx_drops++; + /* priv->ext_stats.tx_drops++; */ DEBUG_ERR("TX DROP: skb_copy fail!\n"); - //goto stop_proc; + /* goto stop_proc; */ return -1; } dev_kfree_skb_any(skb); @@ -2748,27 +2727,24 @@ static int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) res = skb_linearize(skb, GFP_ATOMIC); -#else // (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) +#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) */ res = skb_linearize(skb); -#endif // (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) +#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) */ if (res < 0) { DEBUG_ERR("TX DROP: skb_linearize fail!\n"); - //goto free_and_stop; + /* goto free_and_stop; */ return -1; } res = nat25_db_handle(padapter, skb, NAT25_INSERT); if (res < 0) { if (res == -2) { - //priv->ext_stats.tx_drops++; + /* priv->ext_stats.tx_drops++; */ DEBUG_ERR("TX DROP: nat25_db_handle fail!\n"); - //goto free_and_stop; + /* goto free_and_stop; */ return -1; } - // we just print warning message and let it go - //DEBUG_WARN("%s()-%d: nat25_db_handle INSERT Warning!\n", __func__, __LINE__); - //return -1; // return -1 will cause system crash on 2011/08/30! return 0; } } @@ -2786,18 +2762,18 @@ static int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) } } - // check if SA is equal to our MAC + /* check if SA is equal to our MAC */ if (memcmp(skb->data+MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN)) { - //priv->ext_stats.tx_drops++; + /* priv->ext_stats.tx_drops++; */ DEBUG_ERR("TX DROP: untransformed frame SA:%02X%02X%02X%02X%02X%02X!\n", skb->data[6],skb->data[7],skb->data[8],skb->data[9],skb->data[10],skb->data[11]); - //goto free_and_stop; + /* goto free_and_stop; */ return -1; } } return 0; } -#endif // CONFIG_BR_EXT +#endif /* CONFIG_BR_EXT */ u32 rtw_get_ff_hwaddr(struct xmit_frame *pxmitframe) { @@ -2825,7 +2801,7 @@ u32 rtw_get_ff_hwaddr(struct xmit_frame *pxmitframe) case 0x10: addr = BCN_QUEUE_INX; break; - case 0x11://BC/MC in PS (HIQ) + case 0x11:/* BC/MC in PS (HIQ) */ addr = HIGH_QUEUE_INX; break; case 0x12: @@ -2846,11 +2822,6 @@ static void do_queue_select(_adapter *padapter, struct pkt_attrib *pattrib) qsel = pattrib->priority; RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("### do_queue_select priority=%d ,qsel = %d\n",pattrib->priority ,qsel)); -#ifdef CONFIG_CONCURRENT_MODE -// if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true) -// qsel = 7;// -#endif - pattrib->qsel = qsel; } @@ -2872,16 +2843,16 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) #ifdef CONFIG_BR_EXT struct mlme_priv *pmlmepriv = &padapter->mlmepriv; void *br_port = NULL; -#endif // CONFIG_BR_EXT +#endif /* CONFIG_BR_EXT */ s32 res; pxmitframe = rtw_alloc_xmitframe(pxmitpriv); if (pxmitframe == NULL) { RT_TRACE(_module_xmit_osdep_c_, _drv_err_, ("rtw_xmit: no more pxmitframe\n")); - //#ifdef DBG_TX_DROP_FRAME + /* ifdef DBG_TX_DROP_FRAME */ DBG_88E("DBG_TX_DROP_FRAME %s no more pxmitframe\n", __func__); - //#endif + /* endif */ return -1; } @@ -2889,11 +2860,11 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) #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) { @@ -2905,7 +2876,7 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) } } -#endif // CONFIG_BR_EXT +#endif /* CONFIG_BR_EXT */ res = update_attrib(padapter, *ppkt, &pxmitframe->attrib); @@ -2978,14 +2949,14 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(_adapter *padapter, struct xmit_fra { rtw_list_delete(&pxmitframe->list); - //_enter_critical_bh(&psta->sleep_q.lock, &irqL); + /* _enter_critical_bh(&psta->sleep_q.lock, &irqL); */ rtw_list_insert_tail(&pxmitframe->list, get_list_head(&ptdls_sta->sleep_q)); ptdls_sta->sleepq_len++; ptdls_sta->sleepq_ac_len++; - //indicate 4-AC queue bit in TDLS peer traffic indication + /* indicate 4-AC queue bit in TDLS peer traffic indication */ switch (pattrib->priority) { case 1: @@ -3009,7 +2980,7 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(_adapter *padapter, struct xmit_fra if (ptdls_sta->sleepq_len==1) { - //transmit TDLS PTI via AP + /* transmit TDLS PTI via AP */ rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_SD_PTI); } ret = true; @@ -3022,7 +2993,7 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(_adapter *padapter, struct xmit_fra return ret; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ #if defined(CONFIG_AP_MODE) || defined(CONFIG_TDLS) @@ -3043,7 +3014,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p ret = xmitframe_enqueue_for_tdls_sleeping_sta(padapter, pxmitframe); return ret; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == false) return ret; @@ -3062,12 +3033,12 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p if (pattrib->triggered==1) { - //DBG_88E("directly xmit pspoll_triggered packet\n"); + /* DBG_88E("directly xmit pspoll_triggered packet\n"); */ - //pattrib->triggered=0; + /* pattrib->triggered=0; */ if (bmcst) - pattrib->qsel = 0x11;//HIQ + pattrib->qsel = 0x11;/* HIQ */ return ret; @@ -3078,38 +3049,27 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p { _enter_critical_bh(&psta->sleep_q.lock, &irqL); - if (pstapriv->sta_dz_bitmap)//if anyone sta is in ps mode + if (pstapriv->sta_dz_bitmap)/* if anyone sta is in ps mode */ { - //pattrib->qsel = 0x11;//HIQ - rtw_list_delete(&pxmitframe->list); - //_enter_critical_bh(&psta->sleep_q.lock, &irqL); - rtw_list_insert_tail(&pxmitframe->list, get_list_head(&psta->sleep_q)); psta->sleepq_len++; - pstapriv->tim_bitmap |= BIT(0);// + pstapriv->tim_bitmap |= BIT(0);/* */ pstapriv->sta_dz_bitmap |= BIT(0); - //DBG_88E("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); - - update_beacon(padapter, _TIM_IE_, NULL, false);//tx bc/mc packets after upate bcn - - //_exit_critical_bh(&psta->sleep_q.lock, &irqL); + update_beacon(padapter, _TIM_IE_, NULL, false);/* tx bc/mc packets after upate bcn */ ret = true; - } _exit_critical_bh(&psta->sleep_q.lock, &irqL); return ret; - } - _enter_critical_bh(&psta->sleep_q.lock, &irqL); if (psta->state&WIFI_SLEEP_STATE) @@ -3120,7 +3080,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p { rtw_list_delete(&pxmitframe->list); - //_enter_critical_bh(&psta->sleep_q.lock, &irqL); + /* _enter_critical_bh(&psta->sleep_q.lock, &irqL); */ rtw_list_insert_tail(&pxmitframe->list, get_list_head(&psta->sleep_q)); @@ -3154,22 +3114,22 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p { pstapriv->tim_bitmap |= BIT(psta->aid); - //DBG_88E("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); + /* DBG_88E("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */ if (psta->sleepq_len==1) { - //DBG_88E("sleepq_len==1, update BCNTIM\n"); - //upate BCN for TIM IE + /* DBG_88E("sleepq_len==1, update BCNTIM\n"); */ + /* upate BCN for TIM IE */ update_beacon(padapter, _TIM_IE_, NULL, false); } } - //_exit_critical_bh(&psta->sleep_q.lock, &irqL); + /* _exit_critical_bh(&psta->sleep_q.lock, &irqL); */ - //if (psta->sleepq_len > (NR_XMITFRAME>>3)) - //{ - // wakeup_sta_to_xmit(padapter, psta); - //} + /* if (psta->sleepq_len > (NR_XMITFRAME>>3)) */ + /* */ + /* wakeup_sta_to_xmit(padapter, psta); */ + /* */ ret = true; @@ -3223,7 +3183,7 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta) pstaxmitpriv = &psta->sta_xmitpriv; - //for BC/MC Frames + /* for BC/MC Frames */ psta_bmc = rtw_get_bcmc_stainfo(padapter); @@ -3233,7 +3193,7 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta) #ifdef CONFIG_TDLS if ( !(psta->tdls_sta_state & TDLS_LINKED_STATE) ) -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ pstapriv->sta_dz_bitmap |= BIT(psta->aid); @@ -3258,10 +3218,10 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta) { if ( psta_bmc != NULL ) { -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ - //for BC/MC Frames + /* for BC/MC Frames */ pstaxmitpriv = &psta_bmc->sta_xmitpriv; dequeue_xmitframes_to_sleeping_queue(padapter, psta_bmc, &pstaxmitpriv->be_q.sta_pending); rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending)); @@ -3270,7 +3230,7 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta) #ifdef CONFIG_TDLS } } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ _exit_critical_bh(&pxmitpriv->lock, &irqL0); @@ -3362,12 +3322,12 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) _exit_critical_bh(&psta->sleep_q.lock, &irqL); return; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ pstapriv->tim_bitmap &= ~BIT(psta->aid); - //DBG_88E("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); - //upate BCN for TIM IE - //update_BCNTIM(padapter); + /* DBG_88E("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); */ + /* upate BCN for TIM IE */ + /* update_BCNTIM(padapter); */ update_mask = BIT(0); if (psta->state&WIFI_SLEEP_STATE) @@ -3385,12 +3345,12 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) _exit_critical_bh(&psta->sleep_q.lock, &irqL); - //for BC/MC Frames + /* for BC/MC Frames */ psta_bmc = rtw_get_bcmc_stainfo(padapter); if (!psta_bmc) return; - if ((pstapriv->sta_dz_bitmap&0xfffe) == 0x0)//no any sta in ps mode + if ((pstapriv->sta_dz_bitmap&0xfffe) == 0x0)/* no any sta in ps mode */ { _enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); @@ -3429,9 +3389,9 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) pstapriv->tim_bitmap &= ~BIT(0); pstapriv->sta_dz_bitmap &= ~BIT(0); - //DBG_88E("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); - //upate BCN for TIM IE - //update_BCNTIM(padapter); + /* DBG_88E("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); */ + /* upate BCN for TIM IE */ + /* update_BCNTIM(padapter); */ update_mask |= BIT(1); } @@ -3442,7 +3402,7 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) if (update_mask) { - //update_BCNTIM(padapter); + /* update_BCNTIM(padapter); */ update_beacon(padapter, _TIM_IE_, NULL, false); } @@ -3522,14 +3482,14 @@ void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta) _exit_critical_bh(&psta->sleep_q.lock, &irqL); return; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ pstapriv->tim_bitmap &= ~BIT(psta->aid); - //DBG_88E("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); - //upate BCN for TIM IE - //update_BCNTIM(padapter); + /* DBG_88E("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); */ + /* upate BCN for TIM IE */ + /* update_BCNTIM(padapter); */ update_beacon(padapter, _TIM_IE_, NULL, false); - //update_mask = BIT(0); + /* update_mask = BIT(0); */ } } @@ -3561,7 +3521,7 @@ void enqueue_pending_xmitbuf( #if defined(CONFIG_SDIO_HCI) && defined(CONFIG_CONCURRENT_MODE) if (pri_adapter->adapter_type > PRIMARY_ADAPTER) pri_adapter = pri_adapter->pbuddy_adapter; -#endif //SDIO_HCI + CONCURRENT +#endif /* SDIO_HCI + CONCURRENT */ _rtw_up_sema(&(pri_adapter->xmitpriv.xmit_sema)); } @@ -3833,4 +3793,4 @@ void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status) DBG_88E("%s ack_tx not set\n", __func__); } } -#endif //CONFIG_XMIT_ACK +#endif /* CONFIG_XMIT_ACK */