From 54abf571c427503d0488ef62670732161a099207 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 19 Feb 2015 15:34:32 -0600 Subject: [PATCH] rtl8188eu: Change C90 comments to /* */ form Signed-off-by: Larry Finger --- core/rtw_ap.c | 470 +++---- core/rtw_br_ext.c | 116 +- core/rtw_cmd.c | 285 ++-- core/rtw_debug.c | 30 +- core/rtw_efuse.c | 190 +-- core/rtw_ieee80211.c | 160 ++- core/rtw_io.c | 16 +- core/rtw_ioctl_set.c | 140 +- core/rtw_iol.c | 58 +- core/rtw_led.c | 162 +-- core/rtw_mlme.c | 486 ++++--- core/rtw_mlme_ext.c | 3075 +++++++++++++++++++++--------------------- core/rtw_p2p.c | 1540 ++++++++++----------- core/rtw_pwrctrl.c | 147 +- core/rtw_recv.c | 691 +++++----- core/rtw_security.c | 249 ++-- core/rtw_sreset.c | 22 +- core/rtw_sta_mgt.c | 110 +- core/rtw_tdls.c | 540 ++++---- core/rtw_wlan_util.c | 194 ++- core/rtw_xmit.c | 609 ++++----- 21 files changed, 4526 insertions(+), 4764 deletions(-) diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 23c75b6..b7855c5 100755 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -43,10 +43,10 @@ void init_mlme_ap_info(struct adapter *padapter) _rtw_spinlock_init(&pmlmepriv->bcn_update_lock); - //for ACL + /* for ACL */ _rtw_init_queue(&pacl_list->acl_node_q); - //pmlmeext->bstart_bss = false; + /* pmlmeext->bstart_bss = false; */ start_ap_mode(padapter); } @@ -60,7 +60,7 @@ void free_mlme_ap_info(struct adapter *padapter) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - //stop_ap_mode(padapter); + /* stop_ap_mode(padapter); */ pmlmepriv->update_bcn = false; pmlmeext->bstart_bss = false; @@ -69,10 +69,10 @@ void free_mlme_ap_info(struct 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); @@ -89,10 +89,10 @@ static void update_BCNTIM(struct adapter *padapter) WLAN_BSSID_EX *pnetwork_mlmeext = &(pmlmeinfo->network); unsigned char *pie = pnetwork_mlmeext->IEs; - //DBG_871X("%s\n", __FUNCTION__); + /* DBG_871X("%s\n", __FUNCTION__); */ - //update TIM IE - //if(pstapriv->tim_bitmap) + /* update TIM IE */ + /* if(pstapriv->tim_bitmap) */ if(true) { u8 *p, *dst_ie, *premainder_ie=NULL, *pbackup_remainder_ie=NULL; @@ -112,14 +112,14 @@ static void update_BCNTIM(struct adapter *padapter) 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_; /* get ssid_ie len */ @@ -127,21 +127,21 @@ static void update_BCNTIM(struct adapter *padapter) if (p != NULL) offset += tmp_len+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; } @@ -163,11 +163,11 @@ static void update_BCNTIM(struct 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; @@ -181,7 +181,7 @@ static void update_BCNTIM(struct adapter *padapter) dst_ie+=2; } - //copy remainder IE + /* copy remainder IE */ if(pbackup_remainder_ie) { memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen); @@ -196,7 +196,7 @@ static void update_BCNTIM(struct adapter *padapter) #ifndef CONFIG_INTERRUPT_BASED_TXBCN set_tx_beacon_cmd(padapter); -#endif //!CONFIG_INTERRUPT_BASED_TXBCN +#endif /* CONFIG_INTERRUPT_BASED_TXBCN */ } void rtw_add_bcn_ie(struct adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *data, u8 len) @@ -215,7 +215,7 @@ void rtw_add_bcn_ie(struct adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 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; @@ -257,7 +257,7 @@ void rtw_add_bcn_ie(struct adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, memcpy(dst_ie, data, len); dst_ie+=len; - //copy remainder IE + /* copy remainder IE */ if(pbackup_remainder_ie) { memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen); @@ -299,7 +299,7 @@ void rtw_remove_bcn_ie(struct adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 ind memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen); } - //copy remainder IE + /* copy remainder IE */ if(pbackup_remainder_ie) { memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen); @@ -320,7 +320,7 @@ u8 chk_sta_is_alive(struct sta_info *psta) DBG_871X("sta:"MAC_FMT", rssi:%d, rx:"STA_PKTS_FMT", expire_to:%u, %s%ssq_len:%u\n" , MAC_ARG(psta->hwaddr) , psta->rssi_stat.UndecoratedSmoothedPWDB - //, STA_RX_PKTS_ARG(psta) + /* STA_RX_PKTS_ARG(psta) */ , STA_RX_PKTS_DIFF_ARG(psta) , psta->expire_to , psta->state&WIFI_SLEEP_STATE?"PS, ":"" @@ -329,7 +329,7 @@ u8 chk_sta_is_alive(struct sta_info *psta) ); #endif - //if(sta_last_rx_pkts(psta) == sta_rx_pkts(psta)) + /* if(sta_last_rx_pkts(psta) == sta_rx_pkts(psta)) */ if((psta->sta_stats.last_rx_data_pkts + psta->sta_stats.last_rx_ctrl_pkts) == (psta->sta_stats.rx_data_pkts + psta->sta_stats.rx_ctrl_pkts)) { } @@ -359,7 +359,7 @@ void expire_timeout_chk(struct 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_871X(FUNC_NDEV_FMT" auth_list, cnt:%u\n" @@ -411,7 +411,7 @@ void expire_timeout_chk(struct 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_871X(FUNC_NDEV_FMT" asoc_list, cnt:%u\n" @@ -436,7 +436,7 @@ void expire_timeout_chk(struct 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--; } @@ -445,9 +445,9 @@ void expire_timeout_chk(struct 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 - //DBG_871X("asoc check by DELBA/ADDBA! (pstapriv->expire_to=%d s)(psta->expire_to=%d s), [%02x, %d]\n", pstapriv->expire_to*2, psta->expire_to*2, 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 */ + /* DBG_871X("asoc check by DELBA/ADDBA! (pstapriv->expire_to=%d s)(psta->expire_to=%d s), [%02x, %d]\n", pstapriv->expire_to*2, psta->expire_to*2, psta->htpriv.agg_enable_bitmap, psta->under_exist_checking); */ if ( psta->expire_to <= (pstapriv->expire_to - 50 ) ) { DBG_871X("asoc expire by DELBA/ADDBA! (%d s)\n", (pstapriv->expire_to-psta->expire_to)*2); @@ -456,15 +456,15 @@ void expire_timeout_chk(struct adapter *padapter) } else if ( psta->expire_to <= (pstapriv->expire_to - 3) && (psta->under_exist_checking==0)) { DBG_871X("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) { @@ -479,13 +479,13 @@ void expire_timeout_chk(struct 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; - //DBG_871X("alive chk, sta:" MAC_FMT " is at ps mode!\n", MAC_ARG(psta->hwaddr)); + /* DBG_871X("alive chk, sta:" MAC_FMT " is at ps mode!\n", MAC_ARG(psta->hwaddr)); */ - //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); @@ -612,39 +612,39 @@ void add_RATid(struct 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; ibssrateset); 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; iht_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 ; @@ -673,7 +673,7 @@ void add_RATid(struct 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); @@ -683,17 +683,17 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level) DBG_871X("%s=> mac_id:%d , raid:%d , bitmap=0x%x, arg=0x%x\n", __FUNCTION__ , 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; @@ -718,31 +718,27 @@ void update_bmc_sta(struct adapter *padapter) if(psta) { - psta->aid = 0;//default set to 0 - //psta->mac_id = psta->aid+4; + psta->aid = 0;/* default set to 0 */ + /* psta->mac_id = psta->aid+4; */ 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; memset((void*)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); - //psta->dot118021XPrivacy = _NO_PRIVACY_;//!!! remove it, because it has been set before this. - - - - //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); memcpy(psta->bssrateset, &pcur_network->SupportedRates, supportRateNum); psta->bssratelen = supportRateNum; - //b/g mode ra_bitmap + /* b/g mode ra_bitmap */ for (i=0; ibssrateset[i]) @@ -750,25 +746,25 @@ void update_bmc_sta(struct adapter *padapter) } 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; } - //tx_ra_bitmap = update_basic_rate(pcur_network->SupportedRates, supportRateNum); + /* tx_ra_bitmap = update_basic_rate(pcur_network->SupportedRates, supportRateNum); */ raid = networktype_to_raid(network_type); init_rate = get_highest_rate_idx(tx_ra_bitmap&0x0fffffff)&0x3f; - //DBG_871X("Add id %d val %08x to ratr for bmc sta\n", psta->aid, tx_ra_bitmap); - //ap mode + /* DBG_871X("Add id %d val %08x to ratr for bmc sta\n", psta->aid, tx_ra_bitmap); */ + /* ap mode */ rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, true); - //if(pHalData->fw_ractrl == true) + /* if(pHalData->fw_ractrl == true) */ { u8 arg = 0; @@ -776,22 +772,22 @@ void update_bmc_sta(struct adapter *padapter) arg |= BIT(7); - //if (shortGIrate==true) - // arg |= BIT(5); + /* if (shortGIrate==true) */ + /* arg |= BIT(5); */ tx_ra_bitmap |= ((raid<<28)&0xf0000000); DBG_871X("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; @@ -809,12 +805,12 @@ void update_bmc_sta(struct 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(struct adapter *padapter, struct sta_info *psta) { @@ -825,15 +821,15 @@ void update_sta_info_apmode(struct 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 - //set intf_tag to if1 - //psta->intf_tag = 0; +#endif /* CONFIG_80211N_HT */ + /* set intf_tag to if1 */ + /* psta->intf_tag = 0; */ - //psta->mac_id = psta->aid+4; + /* psta->mac_id = psta->aid+4; */ psta->mac_id = psta->aid+1; DBG_871X("%s\n",__FUNCTION__); - //ap mode + /* ap mode */ rtw_hal_set_odm_var(padapter,HAL_ODM_STA_INFO,psta,true); if(psecuritypriv->dot11AuthAlgrthm==dot11AuthAlgrthm_8021X) @@ -842,27 +838,27 @@ void update_sta_info_apmode(struct 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 + /* 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)) { phtpriv_sta->sgi = true; } - // bwmode + /* bwmode */ if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH)) { - //phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_40; + /* phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_40; */ phtpriv_sta->bwmode = pmlmeext->cur_bwmode; phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset; @@ -880,29 +876,22 @@ void update_sta_info_apmode(struct 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 */ memset((void*)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); - - //add ratid - //add_RATid(padapter, psta);//move to ap_sta_info_defer_update() - - _enter_critical_bh(&psta->lock, &irqL); psta->state |= _FW_LINKED; _exit_critical_bh(&psta->lock, &irqL); - - } static void update_hw_ht_param(struct adapter *padapter) @@ -916,7 +905,7 @@ static void update_hw_ht_param(struct adapter *padapter) DBG_871X("%s\n", __FUNCTION__); - //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 @@ -929,25 +918,17 @@ static void update_hw_ht_param(struct adapter *padapter) rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, (u8 *)(&max_AMPDU_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) - { - /*u8 i; - //update the MCS rates - for (i = 0; i < 16; i++) - { - pmlmeinfo->HT_caps.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i]; - }*/ DBG_871X("%s(): WLAN_HT_CAP_SM_PS_STATIC\n",__FUNCTION__); - } - // - // Config current HT Protection mode. - // - //pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3; + /* */ + /* Config current HT Protection mode. */ + /* */ + /* pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3; */ } @@ -968,9 +949,9 @@ static void start_bss_network(struct 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 */ - //DBG_871X("%s\n", __FUNCTION__); + /* DBG_871X("%s\n", __FUNCTION__); */ bcn_interval = (u16)pnetwork->Configuration.BeaconPeriod; cur_channel = pnetwork->Configuration.DSConfig; @@ -978,17 +959,17 @@ static void start_bss_network(struct 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 - //pmlmeinfo->WMM_enable; - //pmlmeinfo->HT_enable; + /* todo: update wmm, ht cap */ + /* pmlmeinfo->WMM_enable; */ + /* pmlmeinfo->HT_enable; */ if(pmlmepriv->qospriv.qos_option) pmlmeinfo->WMM_enable = true; #ifdef CONFIG_80211N_HT @@ -996,56 +977,55 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf) { pmlmeinfo->WMM_enable = true; pmlmeinfo->HT_enable = true; - //pmlmeinfo->HT_info_enable = true; - //pmlmeinfo->HT_caps_enable = true; + /* pmlmeinfo->HT_info_enable = true; */ + /* pmlmeinfo->HT_caps_enable = true; */ 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 + if(pmlmepriv->cur_network.join_res != true) /* setting only at first time */ { - //WEP Key will be set before this function, do not clear CAM. + /* 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 - acparm = 0x002F3217; // VO + /* Set EDCA param reg */ + acparm = 0x002F3217; /* VO */ 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 = 0x00105320; // BE 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 */ { - //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) { @@ -1053,23 +1033,23 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf) if ((pregpriv->cbw40_enable) && (pht_info->infos[0] & BIT(2))) { - //switch to the 40M Hz mode - //pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; + /* switch to the 40M Hz mode */ + /* pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; */ cur_bwmode = HT_CHANNEL_WIDTH_40; switch (pht_info->infos[0] & 0x3) { case 1: - //pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; + /* pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; */ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; break; case 3: - //pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; + /* pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; */ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; break; default: - //pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + /* pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; */ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; break; } @@ -1077,50 +1057,50 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf) } } -#endif //CONFIG_80211N_HT - //TODO: need to judge the phy parameters on concurrent mode for single phy - //set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); +#endif /* CONFIG_80211N_HT */ + /* TODO: need to judge the phy parameters on concurrent mode for single phy */ + /* set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); */ set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode); DBG_871X("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; pmlmeext->cur_wireless_mode = pmlmepriv->cur_network.network_type; - //let pnetwork_mlmeext == pnetwork_mlme. + /* let pnetwork_mlmeext == pnetwork_mlme. */ memcpy(pnetwork_mlmeext, pnetwork, pnetwork->Length); - //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)); #ifdef CONFIG_P2P 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. - //issue beacon frame +#ifndef CONFIG_INTERRUPT_BASED_TXBCN /* other case will tx beacon when bcn interrupt coming in. */ + /* issue beacon frame */ if(send_beacon(padapter)==_FAIL) DBG_871X("issue_beacon, fail!\n"); -#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; + /* pmlmeext->bstart_bss = true; */ } @@ -1181,17 +1161,17 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) 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 = le16_to_cpu(*(unsigned short*)p); */ 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 = *(unsigned short *)rtw_get_capability_from_ie(ie); */ + /* cap = le16_to_cpu(cap); */ 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) { @@ -1200,7 +1180,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) pbss_network->Ssid.SsidLength = ie_len; } - //chnnel + /* chnnel */ 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_)); @@ -1211,7 +1191,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) 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) { @@ -1219,7 +1199,7 @@ int rtw_check_beacon_data(struct 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) { @@ -1233,14 +1213,14 @@ int rtw_check_beacon_data(struct 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 @@ -1248,7 +1228,7 @@ int rtw_check_beacon_data(struct 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_; @@ -1259,7 +1239,7 @@ int rtw_check_beacon_data(struct 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; @@ -1268,7 +1248,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) } - //wpa + /* wpa */ ie_len = 0; group_cipher = 0; pairwise_cipher = 0; psecuritypriv->wpa_group_cipher = _NO_PRIVACY_; @@ -1282,7 +1262,7 @@ int rtw_check_beacon_data(struct 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); @@ -1302,7 +1282,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) } - //wmm + /* wmm */ ie_len = 0; pmlmepriv->qospriv.qos_option = 0; if(pregistrypriv->wmm_enable) @@ -1314,7 +1294,7 @@ int rtw_check_beacon_data(struct 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 */ @@ -1332,7 +1312,7 @@ int rtw_check_beacon_data(struct 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) { @@ -1359,7 +1339,7 @@ int rtw_check_beacon_data(struct 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) { @@ -1371,13 +1351,13 @@ int rtw_check_beacon_data(struct 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: @@ -1405,11 +1385,11 @@ int rtw_check_beacon_data(struct 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; @@ -1429,11 +1409,11 @@ int rtw_check_beacon_data(struct 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) { @@ -1443,13 +1423,13 @@ int rtw_check_beacon_data(struct 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; @@ -1604,7 +1584,7 @@ static void update_bcn_erpinfo_ie(struct 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) { @@ -1693,7 +1673,7 @@ static void update_bcn_wps_ie(struct 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) { memcpy(pwps_ie, pwps_ie_src, wps_ielen+2); @@ -1702,7 +1682,7 @@ static void update_bcn_wps_ie(struct adapter *padapter) if(pbackup_remainder_ie) memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen); - //update IELength + /* update IELength */ pnetwork->IELength = wps_offset + (wps_ielen+2) + remainder_ielen; } @@ -1749,16 +1729,16 @@ void update_beacon(struct 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; + /* struct mlme_ext_info *pmlmeinfo; */ - //DBG_871X("%s\n", __FUNCTION__); + /* DBG_871X("%s\n", __FUNCTION__); */ if(!padapter) return; pmlmepriv = &(padapter->mlmepriv); pmlmeext = &(padapter->mlmeextpriv); - //pmlmeinfo = &(pmlmeext->mlmext_info); + /* pmlmeinfo = &(pmlmeext->mlmext_info); */ if(false == pmlmeext->bstart_bss) return; @@ -1769,7 +1749,7 @@ void update_beacon(struct 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; @@ -1818,12 +1798,9 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx) _exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); #ifndef CONFIG_INTERRUPT_BASED_TXBCN - if(tx) { - //send_beacon(padapter);//send_beacon must execute on TSR level + if(tx) set_tx_beacon_cmd(padapter); - } -#endif //!CONFIG_INTERRUPT_BASED_TXBCN - +#endif /* CONFIG_INTERRUPT_BASED_TXBCN */ } #ifdef CONFIG_80211N_HT @@ -1850,8 +1827,8 @@ static int rtw_ht_operation_update(struct adapter *padapter) if(pmlmepriv->htpriv.ht_option == true) return 0; - //if (!iface->conf->ieee80211n || iface->conf->ht_op_mode_fixed) - // return 0; + /* if (!iface->conf->ieee80211n || iface->conf->ht_op_mode_fixed) */ + /* return 0; */ DBG_871X("%s current operation mode=0x%X\n", __FUNCTION__, pmlmepriv->ht_op_mode); @@ -1915,7 +1892,7 @@ static int rtw_ht_operation_update(struct adapter *padapter) void associated_clients_update(struct adapter *padapter, u8 updated) { - //update associcated stations cap. + /* update associcated stations cap. */ if(updated == true) { _irqL irqL; @@ -1928,7 +1905,7 @@ void associated_clients_update(struct 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); @@ -2096,7 +2073,7 @@ void bss_cap_update_on_sta_join(struct 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_871X("%s, updated=%d\n", __func__, beacon_updated); @@ -2169,9 +2146,6 @@ u8 bss_cap_update_on_sta_leave(struct 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 - DBG_871X("%s, updated=%d\n", __func__, beacon_updated); return beacon_updated; @@ -2192,25 +2166,25 @@ u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta, bool active, u16 if (active == true) { #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 + /* tear down TX AMPDU */ + send_delba(padapter, 1, psta->hwaddr);/* originator */ -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ issue_deauth(padapter, psta->hwaddr, reason); } - psta->htpriv.agg_enable_bitmap = 0x0;//reset - psta->htpriv.candidate_tid_bitmap = 0x0;//reset + psta->htpriv.agg_enable_bitmap = 0x0;/* reset */ + psta->htpriv.candidate_tid_bitmap = 0x0;/* reset */ - //report_del_sta_event(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 */ + /* clear_cam_entry(padapter, (psta->mac_id + 3)); */ rtw_clearstakey_cmd(padapter, (u8*)psta, (u8)(psta->mac_id + 3), true); @@ -2224,11 +2198,11 @@ u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta, bool active, u16 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); } @@ -2346,7 +2320,7 @@ void sta_info_update(struct 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 @@ -2357,7 +2331,7 @@ void sta_info_update(struct 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; @@ -2383,8 +2357,8 @@ void ap_sta_info_defer_update(struct 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 */ } } /* restore hw setting from sw data structures */ @@ -2443,7 +2417,7 @@ void rtw_ap_restore_network(struct adapter *padapter) else if(psta->state &_FW_LINKED) { Update_RA_Entry(padapter, psta); - //pairwise key + /* pairwise key */ /* per sta pairwise key and settings */ if( (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) || (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) @@ -2465,7 +2439,7 @@ void start_ap_mode(struct adapter *padapter) pmlmepriv->update_bcn = false; - //init_mlme_ap_info(padapter); + /* init_mlme_ap_info(padapter); */ pmlmeext->bstart_bss = false; pmlmepriv->num_sta_non_erp = 0; @@ -2477,7 +2451,7 @@ void start_ap_mode(struct 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; @@ -2499,7 +2473,7 @@ void start_ap_mode(struct 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; @@ -2525,14 +2499,14 @@ void stop_ap_mode(struct adapter *padapter) pmlmepriv->update_bcn = false; pmlmeext->bstart_bss = false; - //_rtw_spinlock_free(&pmlmepriv->bcn_update_lock); + /* _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 */ 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); @@ -2556,7 +2530,7 @@ void stop_ap_mode(struct 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); @@ -2570,5 +2544,5 @@ void stop_ap_mode(struct 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 fa54a0c..faaf597 100755 --- a/core/rtw_br_ext.c +++ b/core/rtw_br_ext.c @@ -56,7 +56,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: @@ -70,7 +70,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; @@ -78,7 +78,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) @@ -101,7 +101,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); @@ -301,8 +301,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; @@ -379,9 +379,9 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr) static __inline__ void __network_hash_link(struct 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) @@ -389,15 +389,15 @@ static __inline__ void __network_hash_link(struct 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) @@ -405,7 +405,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); */ } @@ -423,7 +423,7 @@ static int __nat25_db_network_lookup_and_replace(struct 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); @@ -571,7 +571,7 @@ void nat25_db_expire(struct 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; isaddr); - //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, &tmp); - //record source IP address and , source mac address into db + /* record source IP address and , source mac address into db */ __nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr); __nat25_db_print(priv); @@ -697,11 +697,11 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) 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"); @@ -737,14 +737,14 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) 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; @@ -771,7 +771,7 @@ int nat25_db_handle(struct 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); @@ -814,28 +814,28 @@ int nat25_db_handle(struct 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; } @@ -848,7 +848,7 @@ int nat25_db_handle(struct 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)) { @@ -904,7 +904,7 @@ int nat25_db_handle(struct 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 @@ -928,7 +928,7 @@ int nat25_db_handle(struct 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 @@ -962,7 +962,7 @@ int nat25_db_handle(struct 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", @@ -991,7 +991,7 @@ int nat25_db_handle(struct 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; @@ -1064,7 +1064,7 @@ int nat25_db_handle(struct 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) { @@ -1075,7 +1075,7 @@ int nat25_db_handle(struct 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"); @@ -1095,19 +1095,19 @@ int nat25_db_handle(struct 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 = (__be16 *)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"); @@ -1123,7 +1123,7 @@ int nat25_db_handle(struct 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); @@ -1186,7 +1186,7 @@ int nat25_db_handle(struct 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; @@ -1332,7 +1332,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) return -1; } } -#endif // CL_IPV6_PASS +#endif /* CL_IPV6_PASS */ return -1; } @@ -1380,7 +1380,7 @@ int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb) !memcmp(priv->br_ip, skb->data+ETH_HLEN+16, 4)) || ((*((__be16 *)(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 + /* for traffic to upper TCP/IP */ retval = nat25_db_handle(priv, skb, NAT25_LOOKUP); } } @@ -1394,7 +1394,7 @@ int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb) } if(retval == -1) { - //DEBUG_ERR("NAT25: Lookup fail!\n"); + /* DEBUG_ERR("NAT25: Lookup fail!\n"); */ return -1; } } @@ -1435,30 +1435,30 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb) { __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 + && (udph->dest == __constant_htons(SERVER_PORT))) /* DHCP request */ { struct dhcpMessage *dhcph = (struct dhcpMessage *)((SIZE_PTR)udph + sizeof(struct udphdr)); - if(dhcph->cookie == DHCP_MAGIC) // match magic word + if(dhcph->cookie == DHCP_MAGIC) /* match magic word */ { - if(!(dhcph->flags & BROADCAST_FLAG)) // if not broadcast + if(!(dhcph->flags & 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 |= BROADCAST_FLAG; - // recalculate checksum + /* recalculate checksum */ sum = ~(udph->check) & 0xffff; sum += dhcph->flags; while(sum >> 16) @@ -1479,8 +1479,8 @@ void *scdb_findEntry(struct 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); @@ -1488,15 +1488,15 @@ void *scdb_findEntry(struct 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 a59a21c..1c5a6cf 100755 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -27,11 +27,11 @@ #include #ifdef CONFIG_BR_EXT #include -#endif //CONFIG_BR_EXT +#endif /* CONFIG_BR_EXT */ #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. @@ -45,13 +45,13 @@ sint _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv) ; _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; @@ -99,7 +99,7 @@ sint _rtw_init_evt_priv(struct evt_priv *pevtpriv) 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; @@ -119,7 +119,7 @@ sint _rtw_init_evt_priv(struct evt_priv *pevtpriv) 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); @@ -175,7 +175,7 @@ void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv) 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) @@ -206,12 +206,12 @@ sint _rtw_enqueue_cmd(_queue *queue, struct cmd_obj *obj) 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: @@ -228,7 +228,7 @@ struct cmd_obj *_rtw_dequeue_cmd(_queue *queue) ; - //_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; @@ -238,7 +238,7 @@ struct cmd_obj *_rtw_dequeue_cmd(_queue *queue) rtw_list_delete(&obj->list); } - //_exit_critical_bh(&(queue->lock), &irqL); + /* _exit_critical_bh(&(queue->lock), &irqL); */ _exit_critical(&queue->lock, &irqL); ; @@ -283,10 +283,10 @@ void rtw_free_cmd_priv (struct cmd_priv *pcmdpriv) 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( (adapter_to_pwrctl(pcmdpriv->padapter)->bHWPwrPindetect) &&(!pcmdpriv->padapter->registrypriv.usbss_enable) ) @@ -296,7 +296,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_871X("==>enqueue POWER_SAVING_CTRL_WK_CID\n"); + /* DBG_871X("==>enqueue POWER_SAVING_CTRL_WK_CID\n"); */ bAllow = true; } } @@ -307,14 +307,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_871X("%s:%s: drop cmdcode:%u, hw_init_completed:%u, cmdthd_running:%u\n", caller_func, __FUNCTION__, - // cmd_obj->cmdcode, - // pcmdpriv->padapter->hw_init_completed, - // pcmdpriv->cmdthd_running - //); + /* DBG_871X("%s:%s: drop cmdcode:%u, hw_init_completed:%u, cmdthd_running:%u\n", caller_func, __FUNCTION__, */ + /* cmd_obj->cmdcode, */ + /* pcmdpriv->padapter->hw_init_completed, */ + /* pcmdpriv->cmdthd_running */ + /* */ return _FAIL; } @@ -366,7 +366,7 @@ void rtw_cmd_clr_isr(struct cmd_priv *pcmdpriv) { ; pcmdpriv->cmd_done_cnt++; - //_rtw_up_sema(&(pcmdpriv->cmd_done_sema)); + /* _rtw_up_sema(&(pcmdpriv->cmd_done_sema)); */ ; } @@ -376,7 +376,7 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd) 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); } @@ -384,12 +384,12 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd) { 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)); ; @@ -451,7 +451,7 @@ thread_return rtw_cmd_thread(thread_context context) if(rtw_is_list_empty(&(pcmdpriv->cmd_queue.queue))) { - //DBG_871X("%s: cmd queue is empty!\n", __func__); + /* DBG_871X("%s: cmd queue is empty!\n", __func__); */ continue; } @@ -487,7 +487,7 @@ _next: pcmdpriv->cmd_issued_cnt++; - pcmd->cmdsz = _RND4((pcmd->cmdsz));//_RND4 + pcmd->cmdsz = _RND4((pcmd->cmdsz));/* _RND4 */ memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz); @@ -512,7 +512,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; @@ -523,8 +523,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 @@ -541,7 +541,7 @@ 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) { @@ -551,7 +551,7 @@ post_process: break; } - //DBG_871X("%s: leaving... drop cmdcode:%u\n", __FUNCTION__, pcmd->cmdcode); + /* DBG_871X("%s: leaving... drop cmdcode:%u\n", __FUNCTION__, pcmd->cmdcode); */ rtw_free_cmd_obj(pcmd); }while(1); @@ -587,7 +587,7 @@ u32 rtw_enqueue_evt(struct evt_priv *pevtpriv, struct evt_obj *obj) _exit_critical_bh(&queue->lock, &irqL); - //rtw_evt_notify_isr(pevtpriv); + /* rtw_evt_notify_isr(pevtpriv); */ exit: @@ -696,7 +696,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, NDIS_802_11_SSID *ssid, int ssi struct mlme_priv *pmlmepriv = &padapter->mlmepriv; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ ; @@ -710,7 +710,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, NDIS_802_11_SSID *ssid, int ssi 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) @@ -771,12 +771,12 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, NDIS_802_11_SSID *ssid, int ssi if((padapter->pbuddy_adapter->mlmeextpriv.mlmext_info.state&0x03) == WIFI_FW_AP_STATE) _set_timer(&pmlmepriv->scan_to_timer, SURVEY_TO * ( padapter->mlmeextpriv.max_chan_nums + ( padapter->mlmeextpriv.max_chan_nums / 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); } @@ -811,7 +811,7 @@ u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset) init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara, GEN_CMD_CODE(_SetDataRate)); #ifdef MP_FIRMWARE_OFFLOAD pbsetdataratepara->curr_rateidx = *(u32*)rateset; -// memcpy(pbsetdataratepara, rateset, sizeof(u32)); +/* memcpy(pbsetdataratepara, rateset, sizeof(u32)); */ #else pbsetdataratepara->mac_id = 5; memcpy(pbsetdataratepara->datarates, rateset, NumRates); @@ -871,8 +871,8 @@ u8 rtw_setphy_cmd(struct 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; ; @@ -1044,7 +1044,7 @@ void rtw_getbbrfreg_cmdrsp_callback(struct adapter* padapter, struct cmd_obj *p { ; - //rtw_free_cmd_obj(pcmd); + /* rtw_free_cmd_obj(pcmd); */ rtw_mfree((unsigned char*) pcmd->parmbuf, pcmd->cmdsz); rtw_mfree((unsigned char*) pcmd, sizeof(struct cmd_obj)); @@ -1146,7 +1146,7 @@ u8 rtw_joinbss_cmd(struct 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); @@ -1167,19 +1167,11 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork) 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) @@ -1227,10 +1219,10 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork) } 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 ) { @@ -1251,11 +1243,11 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork) 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 */ } } @@ -1263,14 +1255,14 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork) 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); } @@ -1287,10 +1279,10 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork) DBG_871X("%s: smart_ps=%d\n", __func__, adapter_to_pwrctl(padapter)->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 */ _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; @@ -1413,7 +1405,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key, bool en 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); @@ -1424,14 +1416,14 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key, bool en if((sta->tdls_sta_state&TDLS_LINKED_STATE)==TDLS_LINKED_STATE) memcpy(&psetstakey_para->key, sta->tpk.tk, 16); else -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16); } else { 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; if(enqueue) @@ -1581,7 +1573,7 @@ u8 rtw_getrttbl_cmd(struct adapter *padapter, struct getratable_rsp *pval) 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); @@ -1673,9 +1665,9 @@ u8 rtw_addbareq_cmd(struct adapter*padapter, u8 tid, u8 *addr) init_h2fwcmd_w_parm_no_rsp(ph2c, paddbareq_parm, GEN_CMD_CODE(_AddBAReq)); - //DBG_871X("rtw_addbareq_cmd, tid=%d\n", tid); + /* DBG_871X("rtw_addbareq_cmd, tid=%d\n", tid); */ - //rtw_enqueue_cmd(pcmdpriv, ph2c); + /* rtw_enqueue_cmd(pcmdpriv, ph2c); */ res = rtw_enqueue_cmd(pcmdpriv, ph2c); exit: @@ -1684,7 +1676,7 @@ exit: return res; } -//add for CONFIG_IEEE80211W, none 11w can use it +/* add for CONFIG_IEEE80211W, none 11w can use it */ u8 rtw_reset_securitypriv_cmd(struct adapter*padapter) { struct cmd_obj* ph2c; @@ -1714,7 +1706,7 @@ u8 rtw_reset_securitypriv_cmd(struct adapter*padapter) 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: @@ -1754,7 +1746,7 @@ u8 rtw_free_assoc_resources_cmd(struct adapter*padapter) 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: @@ -1792,7 +1784,7 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter*padapter) 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: @@ -1870,13 +1862,13 @@ u8 rtw_set_chplan_cmd(struct adapter*padapter, u8 chplan, u8 enqueue) 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; @@ -1886,7 +1878,7 @@ u8 rtw_set_chplan_cmd(struct adapter*padapter, u8 chplan, u8 enqueue) 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)); @@ -1899,14 +1891,14 @@ u8 rtw_set_chplan_cmd(struct adapter*padapter, u8 chplan, u8 enqueue) } 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; @@ -2027,7 +2019,7 @@ u8 rtw_tdls_cmd(struct adapter *padapter, u8 *addr, u8 option) 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: @@ -2065,7 +2057,7 @@ u8 rtw_event_polling_cmd(struct adapter*padapter) 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: @@ -2081,7 +2073,7 @@ static void traffic_status_watchdog(struct adapter *padapter) #ifdef CONFIG_LPS u8 bEnterPS; #endif - u16 BusyThreshold = 200;// 100; + u16 BusyThreshold = 200;/* 100; */ u8 bBusyTraffic = false, bTxBusyTraffic = false, bRxBusyTraffic = false; u8 bHigherBusyTraffic = false, bHigherBusyRxTraffic = false, bHigherBusyTxTraffic = false; #ifdef CONFIG_FTP_PROTECT @@ -2090,19 +2082,19 @@ static void traffic_status_watchdog(struct adapter *padapter) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &(padapter->tdlsinfo); -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ RT_LINK_DETECT_T * link_detect = &pmlmepriv->LinkDetectInfo; - // - // Determine if our traffic is busy now - // + /* */ + /* Determine if our traffic is busy now */ + /* */ if((check_fwstate(pmlmepriv, _FW_LINKED)== true) /*&& !MgntInitAdapterInProgress(pMgntInfo)*/) { - // if we raise bBusyTraffic in last watchdog, using lower threshold. + /* if we raise bBusyTraffic in last watchdog, using lower threshold. */ if (pmlmepriv->LinkDetectInfo.bBusyTraffic) - BusyThreshold =180; // 75; + BusyThreshold =180; /* 75; */ if( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > BusyThreshold || pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > BusyThreshold ) { @@ -2114,7 +2106,7 @@ static void traffic_status_watchdog(struct adapter *padapter) bTxBusyTraffic = true; } - // Higher Tx/Rx data. + /* Higher Tx/Rx data. */ if( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 || pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000 ) { @@ -2140,7 +2132,7 @@ static void traffic_status_watchdog(struct adapter *padapter) pmlmepriv->ftp_lock_flag = 0; rtw_unlock_suspend(); } -#endif //CONFIG_KEEP_FTP_TRANSMIT +#endif /* CONFIG_KEEP_FTP_TRANSMIT */ #ifdef CONFIG_TRAFFIC_PROTECT #define TX_ACTIVE_TH 2 @@ -2162,22 +2154,22 @@ static void traffic_status_watchdog(struct adapter *padapter) #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_871X("Tx = %d, Rx = %d \n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); + /* DBG_871X("Tx = %d, Rx = %d \n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); */ bEnterPS= false; } else @@ -2185,7 +2177,7 @@ static void traffic_status_watchdog(struct adapter *padapter) bEnterPS= true; } - // LeisurePS only work in infra mode. + /* LeisurePS only work in infra mode. */ if(bEnterPS) { LPS_Enter(padapter); @@ -2195,7 +2187,7 @@ static void traffic_status_watchdog(struct adapter *padapter) LPS_Leave(padapter); } } -#endif // CONFIG_LPS +#endif /* CONFIG_LPS */ } else { @@ -2230,13 +2222,13 @@ void dynamic_chk_wk_hdl(struct 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); @@ -2244,12 +2236,12 @@ void dynamic_chk_wk_hdl(struct 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 } @@ -2274,26 +2266,26 @@ void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) switch(lps_ctrl_type) { case LPS_CTRL_SCAN: - //DBG_871X("LPS_CTRL_SCAN \n"); + /* DBG_871X("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_871X("LPS_CTRL_JOINBSS \n"); + /* DBG_871X("LPS_CTRL_JOINBSS \n"); */ LPS_Leave(padapter); break; case LPS_CTRL_CONNECT: - //DBG_871X("LPS_CTRL_CONNECT \n"); - mstatus = 1;//connect - // Reset LPS Setting + /* DBG_871X("LPS_CTRL_CONNECT \n"); */ + mstatus = 1;/* connect */ + /* Reset LPS Setting */ pwrpriv->LpsIdleCount = 0; rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_JOINBSSRPT, (u8 *)(&mstatus)); #ifdef CONFIG_BT_COEXIST @@ -2301,8 +2293,8 @@ void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) #endif break; case LPS_CTRL_DISCONNECT: - //DBG_871X("LPS_CTRL_DISCONNECT \n"); - mstatus = 0;//disconnect + /* DBG_871X("LPS_CTRL_DISCONNECT \n"); */ + mstatus = 0;/* disconnect */ #ifdef CONFIG_BT_COEXIST BT_WifiMediaStatusNotify(padapter, mstatus); if (BT_1Ant(padapter) == false) @@ -2313,7 +2305,7 @@ void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_JOINBSSRPT, (u8 *)(&mstatus)); break; case LPS_CTRL_SPECIAL_PACKET: - //DBG_871X("LPS_CTRL_SPECIAL_PACKET \n"); + /* DBG_871X("LPS_CTRL_SPECIAL_PACKET \n"); */ pwrpriv->DelayLPSLastTimeStamp = rtw_get_current_time(); #ifdef CONFIG_BT_COEXIST BT_SpecialPacketNotify(padapter); @@ -2324,7 +2316,7 @@ void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) } break; case LPS_CTRL_LEAVE: - //DBG_871X("LPS_CTRL_LEAVE \n"); + /* DBG_871X("LPS_CTRL_LEAVE \n"); */ #ifdef CONFIG_BT_COEXIST BT_LpsLeave(padapter); if (BT_1Ant(padapter) == false) @@ -2486,7 +2478,7 @@ void power_saving_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) rtw_ps_processor(padapter); } -//add for CONFIG_IEEE80211W, none 11w can use it +/* add for CONFIG_IEEE80211W, none 11w can use it */ static void reset_securitypriv_hdl(struct adapter *padapter) { rtw_reset_securitypriv(padapter); @@ -2527,8 +2519,8 @@ u8 p2p_protocol_wk_cmd(struct adapter*padapter, int intCmdType ) } 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)); @@ -2541,7 +2533,7 @@ exit: return res; } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ u8 rtw_ps_cmd(struct adapter*padapter) { @@ -2594,8 +2586,8 @@ static void rtw_chk_hi_queue_hdl(struct 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); @@ -2618,7 +2610,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter) update_beacon(padapter, _TIM_IE_, NULL, false); } - else //re check again + else /* re check again */ { rtw_chk_hi_queue_cmd(padapter); } @@ -2770,8 +2762,8 @@ void event_polling_hdl(struct adapter *padapter, u8 *pbuf, int sz) c2h_id_filter ccx_id_filter = rtw_hal_c2h_id_filter_ccx(padapter); u8 check_c2hcmd, check_ccx; - //check_c2hcmd = rtw_read8(padapter, REG_C2HEVT_CLEAR); - //check_ccx= rtw_read8(padapter, REG_C2HEVT_MSG_NORMAL); + /* check_c2hcmd = rtw_read8(padapter, REG_C2HEVT_CLEAR); */ + /* check_ccx= rtw_read8(padapter, REG_C2HEVT_MSG_NORMAL); */ rtw_hal_get_hwreg(padapter, HW_VAR_C2HEVT_CLEAR, (u8 *)(&check_c2hcmd)); rtw_hal_get_hwreg(padapter, HW_VAR_C2HEVT_MSG_NORMAL, (u8 *)(&check_ccx)); @@ -2845,23 +2837,23 @@ u8 rtw_drvextra_cmd_hdl(struct 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 - //add for CONFIG_IEEE80211W, none 11w can use it +#endif /* CONFIG_INTEL_WIDI */ + /* add for CONFIG_IEEE80211W, none 11w can use it */ case RESET_SECURITYPRIV: reset_securitypriv_hdl(padapter); break; @@ -2896,8 +2888,8 @@ void rtw_survey_cmd_callback(struct adapter* padapter , struct cmd_obj *pcmd) 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) { @@ -2905,7 +2897,7 @@ void rtw_survey_cmd_callback(struct adapter* padapter , struct cmd_obj *pcmd) 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); ; @@ -2928,11 +2920,11 @@ void rtw_disassoc_cmd_callback(struct adapter* padapter, struct cmd_obj *pcmd) 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: @@ -2949,8 +2941,8 @@ void rtw_joinbss_cmd_callback(struct adapter* padapter, struct cmd_obj *pcmd) 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) @@ -2985,14 +2977,14 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) _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); @@ -3045,20 +3037,20 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) pnetwork->Length = get_WLAN_BSSID_EX_sz(pnetwork); 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 */ 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) */ } @@ -3089,15 +3081,10 @@ void rtw_setstaKey_cmdrsp_callback(struct adapter* padapter , struct cmd_obj *p goto exit; } - //psta->aid = psta->mac_id = psetstakey_rsp->keyid; //CAM_ID(CAM_ENTRY) - exit: - rtw_free_cmd_obj(pcmd); - -; - } + void rtw_setassocsta_cmdrsp_callback(struct adapter* padapter, struct cmd_obj *pcmd) { _irqL irqL; diff --git a/core/rtw_debug.c b/core/rtw_debug.c index d4e5bd7..6863932 100755 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -291,7 +291,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; } @@ -343,7 +343,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++) { @@ -556,7 +556,7 @@ 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 = 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); @@ -583,7 +583,7 @@ 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 = 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); @@ -609,7 +609,7 @@ 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 = 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); @@ -636,7 +636,7 @@ 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 = 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); @@ -856,7 +856,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, @@ -924,7 +924,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, @@ -1008,7 +1008,7 @@ int proc_get_all_sta_info(char *page, char **start, plist = get_next(plist); - //if(extra_arg == psta->aid) + /* if(extra_arg == psta->aid) */ { len += snprintf(page + len, count - len, "sta's macaddr:" MAC_FMT "\n", MAC_ARG(psta->hwaddr)); len += snprintf(page + len, count - len, "rtsen=%d, cts2slef=%d\n", psta->rtsen, psta->cts2self); @@ -1018,7 +1018,7 @@ int proc_get_all_sta_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 */ 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); @@ -1071,7 +1071,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; @@ -1079,10 +1079,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; @@ -1092,14 +1092,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 da4991b..08756a5 100755 --- a/core/rtw_efuse.c +++ b/core/rtw_efuse.c @@ -45,10 +45,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. */ +/* */ BOOLEAN Efuse_Read1ByteFromFakeContent( @@ -65,7 +65,7 @@ Efuse_Read1ByteFromFakeContent( { return false; } - //DbgPrint("Read fake content, offset = %d\n", Offset); + /* DbgPrint("Read fake content, offset = %d\n", Offset); */ if(fakeEfuseBank == 0) *Value = fakeEfuseContent[Offset]; else @@ -158,24 +158,24 @@ u8 Efuse_CalculateWordCnts(IN 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( struct adapter *Adapter, @@ -186,7 +186,7 @@ ReadEFuseByte( u32 value32; u8 readbyte; u16 retry; - //u32 start=rtw_get_current_time(); + /* u32 start=rtw_get_current_time(); */ if(bPseudoTest) { @@ -194,55 +194,55 @@ 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<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_871X("ReadEFuseByte _offset:%08u, in %d ms\n",_offset ,rtw_get_passing_time_ms(start)); + /* DBG_871X("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( @@ -307,22 +307,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)) { @@ -375,28 +375,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) { @@ -427,13 +427,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)) { @@ -468,18 +468,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++; @@ -633,7 +633,7 @@ u8 rtw_efuse_access(struct adapter *padapter, u8 bWrite, u16 start_addr, u16 cnt 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; @@ -648,14 +648,14 @@ u8 rtw_efuse_access(struct adapter *padapter, u8 bWrite, u16 start_addr, u16 cnt return res; } -//------------------------------------------------------------------------------ +/* */ u16 efuse_GetMaxSize(struct adapter *padapter) { u16 max_size; EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI , TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (void *)&max_size, false); return max_size; } -//------------------------------------------------------------------------------ +/* */ u8 efuse_GetCurrentSize(struct adapter *padapter, u16 *size) { Efuse_PowerSwitch(padapter, false, true); @@ -664,7 +664,7 @@ u8 efuse_GetCurrentSize(struct adapter *padapter, u16 *size) return _SUCCESS; } -//------------------------------------------------------------------------------ +/* */ u8 rtw_efuse_map_read(struct adapter *padapter, u16 addr, u16 cnts, u8 *data) { u16 mapLen=0; @@ -700,7 +700,7 @@ u8 rtw_BT_efuse_map_read(struct adapter *padapter, u16 addr, u16 cnts, u8 *data) return _SUCCESS; } -//------------------------------------------------------------------------------ +/* */ u8 rtw_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data) { u8 offset, word_en; @@ -728,12 +728,12 @@ u8 rtw_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data) offset = (addr >> 3); word_en = 0xF; memset(newdata, 0xFF, PGPKT_DATA_SIZE); - i = addr & 0x7; // index of one package - j = 0; // index of new package - idx = 0; // data index + i = addr & 0x7; /* index of one package */ + j = 0; /* index of new 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]; @@ -798,7 +798,7 @@ exit: } -//------------------------------------------------------------------------------ +/* */ u8 rtw_BT_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data) { u8 offset, word_en; @@ -826,12 +826,12 @@ u8 rtw_BT_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data offset = (addr >> 3); word_en = 0xF; memset(newdata, 0xFF, PGPKT_DATA_SIZE); - i = addr & 0x7; // index of one package - j = 0; // index of new package - idx = 0; // data index + i = addr & 0x7; /* index of one package */ + j = 0; /* index of new 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]; @@ -966,9 +966,9 @@ efuse_ShadowRead1Byte( *Value = pEEPROM->efuse_eeprom_data[Offset]; -} // EFUSE_ShadowRead1Byte +} /* EFUSE_ShadowRead1Byte */ -//---------------Read Two Bytes +/* Read Two Bytes */ static void efuse_ShadowRead2Byte( IN struct adapter *pAdapter, @@ -980,9 +980,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( IN struct adapter *pAdapter, @@ -996,7 +996,7 @@ efuse_ShadowRead4Byte( *Value |= pEEPROM->efuse_eeprom_data[Offset+2]<<16; *Value |= pEEPROM->efuse_eeprom_data[Offset+3]<<24; -} // efuse_ShadowRead4Byte +} /* efuse_ShadowRead4Byte */ /*----------------------------------------------------------------------------- @@ -1023,7 +1023,7 @@ efuse_ShadowWrite1Byte( IN struct adapter *pAdapter, IN u16 Offset, IN u8 Value); -#endif //PLATFORM +#endif /* PLATFORM */ static void efuse_ShadowWrite1Byte( IN struct adapter *pAdapter, @@ -1034,9 +1034,9 @@ efuse_ShadowWrite1Byte( pEEPROM->efuse_eeprom_data[Offset] = Value; -} // efuse_ShadowWrite1Byte +} /* efuse_ShadowWrite1Byte */ -//---------------Write Two Bytes +/* Write Two Bytes */ static void efuse_ShadowWrite2Byte( IN struct adapter *pAdapter, @@ -1048,9 +1048,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( IN struct adapter *pAdapter, @@ -1064,7 +1064,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 @@ -1110,9 +1110,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 */ /*----------------------------------------------------------------------------- @@ -1145,7 +1145,7 @@ EFUSE_ShadowRead( else if (Type == 4) efuse_ShadowRead4Byte(pAdapter, Offset, (u32 *)Value); -} // EFUSE_ShadowRead +} /* EFUSE_ShadowRead */ /*----------------------------------------------------------------------------- * Function: EFUSE_ShadowWrite @@ -1190,7 +1190,7 @@ EFUSE_ShadowWrite( else if (Type == 4) efuse_ShadowWrite4Byte(pAdapter, Offset, (u32)Value); -} // EFUSE_ShadowWrite +} /* EFUSE_ShadowWrite */ void Efuse_InitSomeVar( @@ -1223,7 +1223,7 @@ Efuse_InitSomeVar( } #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE -//#include +/* include */ int isAdaptorInfoFileValid(void) { @@ -1267,4 +1267,4 @@ int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv) } return ret; } -#endif //CONFIG_ADAPTOR_INFO_CACHING_FILE +#endif /* CONFIG_ADAPTOR_INFO_CACHING_FILE */ diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 2c6b85c..b900b02 100755 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -46,9 +46,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), @@ -69,7 +69,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) { @@ -123,7 +123,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; @@ -143,14 +143,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 */ ) { ; @@ -299,7 +299,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 */ } } @@ -369,7 +369,7 @@ void rtw_set_supported_rate(u8* SupportedRates, uint mode) 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 ? */ memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN); break; @@ -412,16 +412,16 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv) ; - //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); @@ -435,10 +435,10 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv) 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) @@ -458,18 +458,18 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv) 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); @@ -479,22 +479,16 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv) } #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 - -; - - //return _SUCCESS; +#endif /* CONFIG_80211N_HT */ + /* return _SUCCESS; */ return sz; - } unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit) @@ -512,13 +506,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... */ memcpy((u8 *)&le_tmp, (pbuf + 6), sizeof(val16)); val16 = le16_to_cpu(le_tmp); @@ -618,7 +612,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); @@ -635,10 +629,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; @@ -700,7 +694,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); @@ -713,10 +707,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; @@ -771,7 +765,7 @@ int rtw_get_wapi_ie(u8 *in_ie,uint in_len,u8 *wapi_ie,u16 *wapi_len) { 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)) { @@ -786,11 +780,11 @@ int rtw_get_wapi_ie(u8 *in_ie,uint in_len,u8 *wapi_ie,u16 *wapi_len) } *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 */ } } @@ -809,7 +803,7 @@ int rtw_get_sec_ie(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16 ; - //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_); @@ -834,7 +828,7 @@ int rtw_get_sec_ie(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16 } *wpa_len=in_ie[cnt+1]+2; - cnt+=in_ie[cnt+1]+2; //get next + cnt+=in_ie[cnt+1]+2; /* get next */ } else { @@ -853,11 +847,11 @@ int rtw_get_sec_ie(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16 } *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 */ } } @@ -880,7 +874,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_8192C("==> found WPS_IE.....\n"); + /* DBG_8192C("==> found WPS_IE.....\n"); */ *wps_ielen = ie_ptr[1]+2; match=true; } @@ -896,12 +890,12 @@ u8 *rtw_get_wps_ie_from_scan_queue(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps { case 1: case 3: - { // Beacon or Probe Response + { /* Beacon or Probe Response */ wps = rtw_get_wps_ie(in_ie + _PROBERSP_IE_OFFSET_, in_len - _PROBERSP_IE_OFFSET_, wps_ie, wps_ielen); break; } case 2: - { // Probe Request + { /* Probe Request */ wps = rtw_get_wps_ie(in_ie + _PROBEREQ_IE_OFFSET_ , in_len - _PROBEREQ_IE_OFFSET_ , wps_ie, wps_ielen); break; } @@ -952,7 +946,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 */ } } @@ -985,17 +979,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_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len); + /* DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len); */ if( attr_id == target_attr_id ) { target_attr_ptr = attr_ptr; @@ -1010,7 +1004,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 */ } } @@ -1320,7 +1314,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 ) @@ -1330,7 +1324,7 @@ void rtw_macaddr_cfg(u8 *mac_addr) memcpy(mac_addr, mac, ETH_ALEN); } else - { // Use the mac address stored in the Efuse + { /* Use the mac address stored in the Efuse */ memcpy(mac, mac_addr, ETH_ALEN); } @@ -1345,7 +1339,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 */ memcpy(mac_addr, mac, ETH_ALEN); DBG_871X("MAC Address from efuse error, assign default one !!!\n"); } @@ -1419,13 +1413,13 @@ u32 rtw_get_p2p_merged_ies_len(u8 *in_ie, u32 in_len) if( pIE->ElementID == _VENDOR_SPECIFIC_IE_ && _rtw_memcmp(pIE->data, OUI, 4) ) { - len += pIE->Length-4; // 4 is P2P OUI length, don't count it in this loop + len += pIE->Length-4; /* 4 is P2P OUI length, don't count it in this loop */ } i += (pIE->Length + 2); } - return len + 4; // Append P2P OUI length at last. + return len + 4; /* Append P2P OUI length at last. */ } /** @@ -1440,12 +1434,12 @@ int rtw_p2p_merge_ies(u8 *in_ie, u32 in_len, u8 *merge_ie) PNDIS_802_11_VARIABLE_IEs pIE; u8 len = 0; u8 OUI[4] = { 0x50, 0x6f, 0x9a, 0x09 }; - u8 ELOUI[6] = { 0xDD, 0x00, 0x50, 0x6f, 0x9a, 0x09 }; //EID;Len;OUI, Len would copy at the end of function + u8 ELOUI[6] = { 0xDD, 0x00, 0x50, 0x6f, 0x9a, 0x09 }; /* EID;Len;OUI, Len would copy at the end of function */ int i=0; if( merge_ie != NULL) { - //Set first P2P OUI + /* Set first P2P OUI */ memcpy(merge_ie, ELOUI, 6); merge_ie += 6; @@ -1453,7 +1447,7 @@ int rtw_p2p_merge_ies(u8 *in_ie, u32 in_len, u8 *merge_ie) { pIE = (PNDIS_802_11_VARIABLE_IEs)(in_ie+ i); - // Take out the rest of P2P OUIs + /* Take out the rest of P2P OUIs */ if( pIE->ElementID == _VENDOR_SPECIFIC_IE_ && _rtw_memcmp(pIE->data, OUI, 4) ) { memcpy( merge_ie, pIE->data +4, pIE->Length -4); @@ -1464,7 +1458,7 @@ int rtw_p2p_merge_ies(u8 *in_ie, u32 in_len, u8 *merge_ie) i += (pIE->Length + 2); } - return len + 4; // 4 is for P2P OUI + return len + 4; /* 4 is for P2P OUI */ } @@ -1503,12 +1497,12 @@ u8 *rtw_get_p2p_ie_from_scan_queue(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ { case 1: case 3: - { // Beacon or Probe Response + { /* Beacon or Probe Response */ p2p = rtw_get_p2p_ie(in_ie + _PROBERSP_IE_OFFSET_, in_len - _PROBERSP_IE_OFFSET_, p2p_ie, p2p_ielen); break; } case 2: - { // Probe Request + { /* Probe Request */ p2p = rtw_get_p2p_ie(in_ie + _PROBEREQ_IE_OFFSET_ , in_len - _PROBEREQ_IE_OFFSET_ , p2p_ie, p2p_ielen); break; } @@ -1561,7 +1555,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 */ } } @@ -1595,17 +1589,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_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len); + /* DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len); */ if( attr_id == target_attr_id ) { target_attr_ptr = attr_ptr; @@ -1620,7 +1614,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 */ } } @@ -1668,7 +1662,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) @@ -1730,7 +1724,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 void dump_wfd_ie(u8 *ie, u32 ie_len) @@ -1801,7 +1795,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 */ } } @@ -1826,12 +1820,12 @@ int rtw_get_wfd_ie_from_scan_queue(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ { case 1: case 3: - { // Beacon or Probe Response + { /* Beacon or Probe Response */ match = rtw_get_wfd_ie(in_ie + _PROBERSP_IE_OFFSET_, in_len - _PROBERSP_IE_OFFSET_, wfd_ie, wfd_ielen); break; } case 2: - { // Probe Request + { /* Probe Request */ match = rtw_get_wfd_ie(in_ie + _PROBEREQ_IE_OFFSET_ , in_len - _PROBEREQ_IE_OFFSET_ , wfd_ie, wfd_ielen); break; } @@ -1839,8 +1833,8 @@ int rtw_get_wfd_ie_from_scan_queue(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ return match; } -// 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; @@ -1856,7 +1850,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 ) { @@ -1865,7 +1859,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) memcpy( attr_content, &wfd_ie[ cnt + 3 ], attrlen ); @@ -1879,7 +1873,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 */ } } @@ -1887,9 +1881,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 */ @@ -1978,7 +1972,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork) { unsigned short cap = 0; u8 bencrypt = 0; - //u8 wpa_ie[255],rsn_ie[255]; + /* u8 wpa_ie[255],rsn_ie[255]; */ u16 wpa_len=0,rsn_len=0; struct HT_info_element *pht_info = NULL; struct rtw_ieee80211_ht_cap *pht_cap = NULL; @@ -2033,7 +2027,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 7a70307..79db313 100755 --- a/core/rtw_io.c +++ b/core/rtw_io.c @@ -49,7 +49,7 @@ jackson@realtek.com.tw u8 _rtw_read8(struct 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); @@ -85,7 +85,7 @@ u32 _rtw_read32(struct adapter *adapter, u32 addr) int _rtw_write8(struct adapter *adapter, u32 addr, u8 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); int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val); @@ -112,7 +112,7 @@ int _rtw_write16(struct adapter *adapter, u32 addr, u16 val) } int _rtw_write32(struct adapter *adapter, u32 addr, u32 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); int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val); @@ -126,7 +126,7 @@ int _rtw_write32(struct adapter *adapter, u32 addr, u32 val) int _rtw_writeN(struct adapter *adapter, u32 addr ,u32 length , u8 *pdata) { - //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 = (struct intf_hdl*)(&(pio_priv->intf)); int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr,u32 length, u8 *pdata); @@ -309,7 +309,7 @@ int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj) DBG_871X("[dvobj:%p][ERROR] continual_io_error:%d > %d\n", dvobj, value, MAX_CONTINUAL_IO_ERR); ret = true; } else { - //DBG_871X("[dvobj:%p] continual_io_error:%d\n", dvobj, value); + /* DBG_871X("[dvobj:%p] continual_io_error:%d\n", dvobj, value); */ } return ret; } @@ -325,12 +325,12 @@ void rtw_reset_continual_io_error(struct dvobj_priv *dvobj) #ifdef DBG_IO u16 read_sniff_ranges[][2] = { - //{0x550, 0x551}, + /* 0x550, 0x551}, */ }; u16 write_sniff_ranges[][2] = { - //{0x550, 0x551}, - //{0x4c, 0x4c}, + /* 0x550, 0x551}, */ + /* 0x4c, 0x4c}, */ }; int read_sniff_num = sizeof(read_sniff_ranges)/sizeof(u16)/2; diff --git a/core/rtw_ioctl_set.c b/core/rtw_ioctl_set.c index 04e3da3..3d66e43 100755 --- a/core/rtw_ioctl_set.c +++ b/core/rtw_ioctl_set.c @@ -67,7 +67,7 @@ u8 rtw_validate_ssid(NDIS_802_11_SSID *ssid) #ifdef CONFIG_VALIDATE_SSID 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; @@ -114,15 +114,15 @@ u8 rtw_do_join(struct adapter * padapter) _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 || rtw_to_roaming(padapter) > 0 ) { 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.")); @@ -149,9 +149,9 @@ u8 rtw_do_join(struct adapter * padapter) { 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; @@ -177,16 +177,16 @@ u8 rtw_do_join(struct adapter * padapter) RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("***Error=> rtw_select_and_join_from_scanned_queue FAIL under STA_Mode*** \n ")); } 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 || rtw_to_roaming(padapter) > 0 ) { - //DBG_871X("rtw_do_join() when no desired bss in scanning queue \n"); + /* DBG_871X("rtw_do_join() when no desired bss in scanning queue \n"); */ 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_,("do_join(): site survey return error\n.")); @@ -246,7 +246,7 @@ u8 rtw_set_802_11_bssid(struct adapter* padapter, u8 *bssid) 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="MAC_FMT"\n", MAC_ARG(bssid) )); @@ -340,7 +340,7 @@ u8 rtw_set_802_11_ssid(struct adapter* padapter, NDIS_802_11_SSID *ssid) 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) @@ -355,7 +355,7 @@ u8 rtw_set_802_11_ssid(struct adapter* padapter, NDIS_802_11_SSID *ssid) } 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 @@ -510,11 +510,11 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter* padapter, _enter_critical_bh(&pmlmepriv->lock, &irqL); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,(" change mode!")); - //DBG_871X("change mode, old_mode=%d, new_mode=%d, fw_state=0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); + /* DBG_871X("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 @@ -533,7 +533,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter* padapter, { 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 */ } } @@ -555,7 +555,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter* padapter, set_fwstate(pmlmepriv, WIFI_AP_STATE); #ifdef CONFIG_NATIVEAP_MLME start_ap_mode(padapter); - //rtw_indicate_connect(padapter); + /* rtw_indicate_connect(padapter); */ #endif break; @@ -565,10 +565,10 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter* padapter, break; } - //SecClearAllKeys(adapter); + /* SecClearAllKeys(adapter); */ - //RT_TRACE(COMP_OID_SET, DBG_LOUD, ("set_infrastructure: fw_state:%x after changing mode\n", - // get_fwstate(pmlmepriv) )); + /* 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); } @@ -594,7 +594,7 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter) rtw_disassoc_cmd(padapter, 0, true); rtw_indicate_disconnect(padapter); - //modify for CONFIG_IEEE80211W, none 11w can use it + /* modify for CONFIG_IEEE80211W, none 11w can use it */ rtw_free_assoc_resources_cmd(padapter); rtw_pwr_wakeup(padapter); } @@ -629,7 +629,7 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter* padapter, NDIS_802_11_SSID *ps 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; @@ -702,8 +702,8 @@ u8 rtw_set_802_11_add_wep(struct adapter* padapter, NDIS_802_11_WEP *wep){ ; - bdefaultkey=(wep->KeyIndex & 0x40000000) > 0 ? false : true; //for ??? - btransmitkey= (wep->KeyIndex & 0x80000000) > 0 ? true : false; //for ??? + bdefaultkey=(wep->KeyIndex & 0x40000000) > 0 ? false : true; /* for ??? */ + btransmitkey= (wep->KeyIndex & 0x80000000) > 0 ? true : false; /* for ??? */ keyid=wep->KeyIndex & 0x3fffffff; if(keyid>4) @@ -805,15 +805,15 @@ u8 rtw_set_802_11_add_key(struct 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; ; 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)); @@ -823,7 +823,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ 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")); @@ -848,15 +848,15 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ } 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")); @@ -864,8 +864,8 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ goto exit; } - // Check key length for TKIP. - //if(encryptionAlgorithm == RT_ENC_TKIP_ENCRYPTION && key->KeyLength != 32) + /* Check key length for TKIP. */ + /* if(encryptionAlgorithm == RT_ENC_TKIP_ENCRYPTION && key->KeyLength != 32) */ 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; @@ -873,9 +873,9 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ } - // 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 { @@ -884,7 +884,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ } } - // 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; @@ -893,7 +893,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ 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")); @@ -904,11 +904,11 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ } 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)); @@ -947,7 +947,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ 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)); @@ -956,20 +956,20 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ } 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; } @@ -989,7 +989,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ } - // 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_)) { u8 ret; @@ -1019,7 +1019,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ } 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) { @@ -1034,9 +1034,9 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ } - // 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; @@ -1081,7 +1081,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ } - //set group key by index + /* set group key by index */ memcpy(&padapter->securitypriv.dot118021XGrpKey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial, key->KeyLength); key->KeyIndex=key->KeyIndex & 0x03; @@ -1100,7 +1100,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ goto exit; } - else // Pairwise Key + else /* Pairwise Key */ { u8 res; @@ -1109,7 +1109,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ if(stainfo!=NULL) { - memset( &stainfo->dot118021x_UncstKey, 0, 16);// clear keybuffer + memset( &stainfo->dot118021x_UncstKey, 0, 16);/* clear keybuffer */ memcpy(&stainfo->dot118021x_UncstKey, key->KeyMaterial, 16); @@ -1117,11 +1117,11 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ { 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)){ memcpy(&stainfo->dot11tkiptxmickey, key->KeyMaterial + 16, 8); memcpy(&stainfo->dot11tkiprxmickey, key->KeyMaterial + 24, 8); @@ -1139,8 +1139,8 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){ } - //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, true); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(group)\n")); @@ -1182,13 +1182,13 @@ u8 rtw_set_802_11_remove_key(struct adapter* padapter, NDIS_802_11_REMOVE_KEY *k if (bgroup == true) { encryptionalgo= padapter->securitypriv.dot118021XGrpPrivacy; - // 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 */ + /* NdisZeroMemory(Adapter->MgntInfo.SecurityInfo.KeyBuf[keyIndex], MAX_WEP_KEY_LEN); */ + /* Adapter->MgntInfo.SecurityInfo.KeyLen[keyIndex] = 0; */ 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 { @@ -1197,10 +1197,10 @@ u8 rtw_set_802_11_remove_key(struct adapter* padapter, NDIS_802_11_REMOVE_KEY *k if(stainfo !=NULL){ encryptionalgo=stainfo->dot118021XPrivacy; - // clear key by BSSID + /* clear key by BSSID */ 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{ @@ -1254,11 +1254,11 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter) 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 + /* 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 */ 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 = (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; @@ -1273,7 +1273,7 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter) } } else -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ { while( (pcur_bss->SupportedRates[i]!=0) && (pcur_bss->SupportedRates[i]!=0xFF)) { @@ -1318,7 +1318,7 @@ int rtw_set_channel_plan(struct 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); } @@ -1335,8 +1335,8 @@ int rtw_set_country(struct adapter *adapter, const char *country_code) DBG_871X("%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 e50ebda..4144c0d 100755 --- a/core/rtw_iol.c +++ b/core/rtw_iol.c @@ -50,7 +50,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct 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_871X("%s %u is large than MAX_XMITBUF_SZ:%u, can't accommodate new cmds\n", __FUNCTION__ , ori_len + cmd_len + 8, MAX_XMITBUF_SZ); @@ -92,7 +92,7 @@ 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_871X("%s ori:%u + cmd_len:%u = %u\n", __FUNCTION__, ori_len, cmd_len, buf_offset+pattrib->pktlen); + /* DBG_871X("%s ori:%u + cmd_len:%u = %u\n", __FUNCTION__, ori_len, cmd_len, buf_offset+pattrib->pktlen); */ return _SUCCESS; } @@ -120,19 +120,19 @@ 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); + /* 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); + /* RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask); */ cmd.mask = cpu_to_le32(mask); } - //DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask); + /* DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask); */ return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length); @@ -141,19 +141,19 @@ int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u { 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); + /* 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); + /* RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask); */ cmd.mask = cpu_to_le32(mask); } - //DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask); + /* DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask); */ return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length); @@ -162,19 +162,19 @@ 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); + /* 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); + /* RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask); */ cmd.mask = cpu_to_le32(mask); } - //DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__, addr,value,mask); + /* DBG_871X("%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); @@ -184,19 +184,19 @@ 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); + /* RTW_PUT_LE16((u8*)&cmd.address, addr); */ + /* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */ cmd.address = cpu_to_le16((rf_path<<8) |((addr) &0xFF)); cmd.data = cpu_to_le32(value); if(mask!=0x000FFFFF) { cmd.length = 12; - //RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask); + /* RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask); */ cmd.mask = cpu_to_le32(mask); } - //DBG_871X("%s rf_path:0x%02x addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__,rf_path, addr,value,mask); + /* DBG_871X("%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); @@ -207,10 +207,10 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, 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); + /* RTW_PUT_LE16((u8*)&cmd.address, us); */ cmd.address = cpu_to_le16(us); - //DBG_871X("%s %u\n", __FUNCTION__, us); + /* DBG_871X("%s %u\n", __FUNCTION__, us); */ return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4); } @@ -218,10 +218,10 @@ 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); + /* RTW_PUT_LE16((u8*)&cmd.address, ms); */ cmd.address = cpu_to_le16(ms); - //DBG_871X("%s %u\n", __FUNCTION__, ms); + /* DBG_871X("%s %u\n", __FUNCTION__, ms); */ return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4); } int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame) @@ -239,7 +239,7 @@ 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",__FUNCTION__,pxmit_frame->attrib.pktlen); + /* printk("==> %s, pktlen(%d)\n",__FUNCTION__,pxmit_frame->attrib.pktlen); */ pxmit_frame->attrib.last_txcmdsz = pxmit_frame->attrib.pktlen; is_cmd_bndy = true; } @@ -262,7 +262,7 @@ void rtw_IOL_cmd_buf_dump(struct 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}; @@ -335,7 +335,7 @@ int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us) RTW_PUT_BE32((u8*)&cmd.value, (u32)us); - //DBG_871X("%s %u\n", __FUNCTION__, us); + /* DBG_871X("%s %u\n", __FUNCTION__, us); */ return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8); } @@ -346,7 +346,7 @@ int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms) RTW_PUT_BE32((u8*)&cmd.value, (u32)ms); - //DBG_871X("%s %u\n", __FUNCTION__, ms); + /* DBG_871X("%s %u\n", __FUNCTION__, ms); */ return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8); } @@ -378,9 +378,9 @@ int rtw_IOL_exec_empty_cmds_sync(struct 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 3cb84b4..e9b2adc 100755 --- a/core/rtw_led.c +++ b/core/rtw_led.c @@ -20,21 +20,21 @@ #include -// -// 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; struct adapter *padapter = pLed->padapter; - //DBG_871X("%s\n", __FUNCTION__); + /* DBG_871X("%s\n", __FUNCTION__); */ if( (padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true)) { - //DBG_871X("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __FUNCTION__, padapter->bSurpriseRemoved, padapter->bDriverStopped); + /* DBG_871X("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __FUNCTION__, padapter->bSurpriseRemoved, padapter->bDriverStopped); */ return; } @@ -45,31 +45,31 @@ void BlinkTimerCallback(void *data) #endif } -// -// 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); BlinkHandler(pLed); } -// -// 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. */ pLed->bLedNoLinkBlinkInProgress = false; pLed->bLedLinkBlinkInProgress = false; @@ -77,10 +77,10 @@ void ResetLedStatus(PLED_871x pLed) { pLed->bLedScanBlinkInProgress = false; } - // -// Description: -// Initialize an LED_871x object. -// + /* */ +/* Description: */ +/* Initialize an LED_871x object. */ +/* */ void InitLed871x( struct adapter *padapter, @@ -99,10 +99,10 @@ InitLed871x( } -// -// Description: -// DeInitialize an LED_871x object. -// +/* */ +/* Description: */ +/* DeInitialize an LED_871x object. */ +/* */ void DeInitLed871x( PLED_871x pLed @@ -114,11 +114,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. */ +/* */ #define CONFIG_LED_REMOVE_HAL @@ -128,7 +128,7 @@ static void SwLedBlink(PLED_871x pLed) 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); @@ -140,7 +140,7 @@ static void SwLedBlink(PLED_871x pLed) 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) { @@ -184,7 +184,7 @@ static void SwLedBlink(PLED_871x pLed) if(bStopBlinking) { - //if(adapter_to_pwrctl(padapter)->cpwm >= PS_STATE_S2) + /* if(adapter_to_pwrctl(padapter)->cpwm >= PS_STATE_S2) */ if(0) { SwLedOff(padapter, pLed); @@ -203,13 +203,13 @@ static void SwLedBlink(PLED_871x pLed) } 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: @@ -253,7 +253,7 @@ static void SwLedBlink1(PLED_871x pLed) 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); @@ -414,7 +414,7 @@ static void SwLedBlink1(PLED_871x pLed) _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 @@ -451,7 +451,7 @@ static void SwLedBlink2(PLED_871x pLed) 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); @@ -570,7 +570,7 @@ static void SwLedBlink3(PLED_871x pLed) 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); @@ -695,7 +695,7 @@ static void SwLedBlink3(PLED_871x pLed) _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; @@ -738,7 +738,7 @@ static void SwLedBlink4(PLED_871x pLed) 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); @@ -876,7 +876,7 @@ static void SwLedBlink4(PLED_871x pLed) } 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 @@ -885,7 +885,7 @@ static void SwLedBlink4(PLED_871x pLed) _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) { @@ -930,7 +930,7 @@ static void SwLedBlink5(PLED_871x pLed) 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); @@ -1043,7 +1043,7 @@ static void SwLedBlink6(PLED_871x pLed) 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); @@ -1067,7 +1067,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: @@ -1172,7 +1172,7 @@ SwLedControlMode0( } - //ALPHA, added by chiyoko, 20090106 + /* ALPHA, added by chiyoko, 20090106 */ static void SwLedControlMode1( struct adapter *padapter, @@ -1313,7 +1313,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) { @@ -1447,7 +1447,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( struct adapter *padapter, @@ -1521,7 +1521,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) { @@ -1612,7 +1612,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( struct adapter *padapter, @@ -1689,7 +1689,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) { @@ -1791,7 +1791,7 @@ SwLedControlMode2( } - //Edimax-Belkin, added by chiyoko, 20090413 + /* Edimax-Belkin, added by chiyoko, 20090413 */ static void SwLedControlMode4( struct adapter *padapter, @@ -1852,7 +1852,7 @@ SwLedControlMode4( case LED_CTL_LINK: case LED_CTL_NO_LINK: - //LED1 settings + /* LED1 settings */ if(LedAction == LED_CTL_LINK) { if(pLed1->bLedWPSBlinkInProgress) @@ -1943,7 +1943,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) { @@ -1989,7 +1989,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)); @@ -2006,7 +2006,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)); @@ -2021,7 +2021,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 @@ -2036,7 +2036,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)); @@ -2051,7 +2051,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 @@ -2123,7 +2123,7 @@ SwLedControlMode4( - //Sercomm-Belkin, added by chiyoko, 20090415 + /* Sercomm-Belkin, added by chiyoko, 20090415 */ static void SwLedControlMode5( struct adapter *padapter, @@ -2146,7 +2146,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; @@ -2214,7 +2214,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( struct adapter *padapter, @@ -2247,21 +2247,21 @@ 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) { struct adapter *padapter = pLed->padapter; struct led_priv *ledpriv = &(padapter->ledpriv); - //DBG_871X("%s (%s:%d)\n",__FUNCTION__, current->comm, current->pid); + /* DBG_871X("%s (%s:%d)\n",__FUNCTION__, current->comm, current->pid); */ if( (padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true)) { - //DBG_871X("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __FUNCTION__, padapter->bSurpriseRemoved, padapter->bDriverStopped); + /* DBG_871X("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __FUNCTION__, padapter->bSurpriseRemoved, padapter->bDriverStopped); */ return; } @@ -2296,8 +2296,8 @@ void BlinkHandler(PLED_871x pLed) break; default: - //RT_TRACE(COMP_LED, DBG_LOUD, ("BlinkWorkItemCallback 0x%x \n", pHalData->LedStrategy)); - //SwLedBlink(pLed); + /* RT_TRACE(COMP_LED, DBG_LOUD, ("BlinkWorkItemCallback 0x%x \n", pHalData->LedStrategy)); */ + /* SwLedBlink(pLed); */ break; } } @@ -2320,11 +2320,11 @@ LedControl871x( if( ledpriv->bRegUseLed == false) return; - //if (!priv->up) - // return; + /* if (!priv->up) */ + /* return; */ - //if(priv->bInHctTest) - // return; + /* if(priv->bInHctTest) */ + /* return; */ if( (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS) && @@ -2340,7 +2340,7 @@ LedControl871x( switch(ledpriv->LedStrategy) { case SW_LED_MODE0: - //SwLedControlMode0(padapter, LedAction); + /* SwLedControlMode0(padapter, LedAction); */ break; case SW_LED_MODE1: diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 080e108..a99eda8 100755 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -39,9 +39,9 @@ extern u8 rtw_do_join(struct 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 (struct adapter* padapter) @@ -54,15 +54,15 @@ sint _rtw_init_mlme_priv (struct adapter* padapter) ; - // We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). - //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(). */ + /* memset((u8 *)pmlmepriv, 0, sizeof(struct mlme_priv)); */ 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 +91,13 @@ sint _rtw_init_mlme_priv (struct adapter* padapter) 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 +219,7 @@ struct wlan_network *_rtw_dequeue_network(_queue *queue) 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; @@ -281,7 +281,7 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv ,struct wlan_network *pnetwor if (!isfreeall) { delta_time = (curr_time -pnetwork->last_scanned)/HZ; - if (delta_time < lifetime)// unit:sec + if (delta_time < lifetime)/* unit:sec */ goto exit; } @@ -294,7 +294,7 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv ,struct wlan_network *pnetwor pmlmepriv->num_of_scanned --; - //DBG_871X("_rtw_free_network:SSID=%s\n", pnetwork->network.Ssid.Ssid); + /* DBG_871X("_rtw_free_network:SSID=%s\n", pnetwork->network.Ssid.Ssid); */ _exit_critical_bh(&free_queue->lock, &irqL); @@ -317,7 +317,7 @@ void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network * if (pnetwork->fixed == true) goto exit; - //_enter_critical(&free_queue->lock, &irqL); + /* _enter_critical(&free_queue->lock, &irqL); */ rtw_list_delete(&(pnetwork->list)); @@ -325,7 +325,7 @@ void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network * pmlmepriv->num_of_scanned --; - //_exit_critical(&free_queue->lock, &irqL); + /* _exit_critical(&free_queue->lock, &irqL); */ exit: @@ -342,7 +342,7 @@ exit: struct wlan_network *_rtw_find_network(_queue *scanned_queue, u8 *addr) { - //_irqL irqL; + /* _irqL irqL; */ _list *phead, *plist; struct wlan_network *pnetwork = NULL; u8 zero_addr[ETH_ALEN] = {0,0,0,0,0,0}; @@ -354,7 +354,7 @@ struct wlan_network *_rtw_find_network(_queue *scanned_queue, u8 *addr) goto exit; } - //_enter_critical_bh(&scanned_queue->lock, &irqL); + /* _enter_critical_bh(&scanned_queue->lock, &irqL); */ phead = get_list_head(scanned_queue); plist = get_next(phead); @@ -372,7 +372,7 @@ struct wlan_network *_rtw_find_network(_queue *scanned_queue, u8 *addr) if(plist == phead) pnetwork = NULL; - //_exit_critical_bh(&scanned_queue->lock, &irqL); + /* _exit_critical_bh(&scanned_queue->lock, &irqL); */ exit: @@ -442,12 +442,12 @@ void rtw_generate_random_ibss(u8* pibss) u32 curtime = rtw_get_current_time(); ; - 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]; */ ; return; } @@ -477,11 +477,11 @@ u8 *rtw_get_beacon_interval_from_ie(u8 *ie) } -int rtw_init_mlme_priv (struct adapter *padapter)//(struct mlme_priv *pmlmepriv) +int rtw_init_mlme_priv (struct adapter *padapter)/* struct mlme_priv *pmlmepriv) */ { int res; ; - res = _rtw_init_mlme_priv(padapter);// (pmlmepriv); + res = _rtw_init_mlme_priv(padapter);/* (pmlmepriv); */ ; return res; } @@ -515,7 +515,7 @@ static struct wlan_network *rtw_dequeue_network(_queue *queue) } 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; ; @@ -525,7 +525,7 @@ struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv )//(_queue *f } 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) */ { ; RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_network==> ssid = %s \n\n" , pnetwork->network.Ssid.Ssid)); @@ -537,7 +537,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 ) { ; - //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); ; } @@ -588,8 +588,8 @@ int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork) 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)); + /* 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; } @@ -607,7 +607,7 @@ int is_same_network(WLAN_BSSID_EX *src, WLAN_BSSID_EX *dst, u8 feature) d_cap = le16_to_cpu(ld_cap); #ifdef CONFIG_P2P - if ((feature == 1) && // 1: P2P supported + if ((feature == 1) && /* 1: P2P supported */ (_rtw_memcmp(src->MacAddress, dst->MacAddress, ETH_ALEN) == true) ) { return true; @@ -615,7 +615,7 @@ int is_same_network(WLAN_BSSID_EX *src, WLAN_BSSID_EX *dst, u8 feature) #endif return ((src->Ssid.SsidLength == dst->Ssid.SsidLength) && - // (src->Configuration.DSConfig == dst->Configuration.DSConfig) && + /* (src->Configuration.DSConfig == dst->Configuration.DSConfig) && */ ( (_rtw_memcmp(src->MacAddress, dst->MacAddress, ETH_ALEN)) == true) && ( (_rtw_memcmp(src->Ssid.Ssid, dst->Ssid.Ssid, src->Ssid.SsidLength)) == true) && ((s_cap & WLAN_CAPABILITY_IBSS) == @@ -676,7 +676,7 @@ void update_network(WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src, ; #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_SSID_MONITORED) && 1 @@ -782,7 +782,7 @@ void rtw_update_scanned_network(struct adapter *adapter, WLAN_BSSID_EX *target) #ifdef CONFIG_P2P if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) - feature = 1; // p2p enable + feature = 1; /* p2p enable */ #endif while(1) @@ -815,21 +815,20 @@ void rtw_update_scanned_network(struct adapter *adapter, WLAN_BSSID_EX *target) /* If we didn't find a match, then get a new network slot to initialize * with this beacon's information */ - //if (rtw_end_of_queue_search(phead,plist)== true) { + /* if (rtw_end_of_queue_search(phead,plist)== true) { */ if (!target_find) { 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 memcpy(&(pnetwork->network), target, get_WLAN_BSSID_EX_sz(target)); - //pnetwork->last_scanned = rtw_get_current_time(); - // variable initialize + /* pnetwork->last_scanned = rtw_get_current_time(); */ + /* variable initialize */ pnetwork->fixed = false; pnetwork->last_scanned = rtw_get_current_time(); @@ -844,7 +843,7 @@ void rtw_update_scanned_network(struct adapter *adapter, WLAN_BSSID_EX *target) 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")); @@ -854,7 +853,7 @@ void rtw_update_scanned_network(struct adapter *adapter, WLAN_BSSID_EX *target) 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 memcpy(&(pnetwork->network), target, bssid_ex_sz ); @@ -878,8 +877,8 @@ void rtw_update_scanned_network(struct adapter *adapter, WLAN_BSSID_EX *target) pnetwork->last_scanned = rtw_get_current_time(); - //target.Reserved[0]==1, means that scaned network is a bcn frame. - // probe resp(3) > beacon(1) > probe req(2) + /* target.Reserved[0]==1, means that scaned network is a bcn frame. */ + /* probe resp(3) > beacon(1) > probe req(2) */ if ((target->Reserved[0] != 2) && (target->Reserved[0] >= pnetwork->network.Reserved[0]) ) { @@ -903,11 +902,11 @@ void rtw_add_network(struct adapter *adapter, WLAN_BSSID_EX *pnetwork) { _irqL irqL; struct mlme_priv *pmlmepriv = &(((struct adapter *)adapter)->mlmepriv); - //_queue *queue = &(pmlmepriv->scanned_queue); + /* _queue *queue = &(pmlmepriv->scanned_queue); */ ; - //_enter_critical_bh(&queue->lock, &irqL); + /* _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); @@ -917,17 +916,17 @@ void rtw_add_network(struct adapter *adapter, WLAN_BSSID_EX *pnetwork) rtw_update_scanned_network(adapter, pnetwork); - //_exit_critical_bh(&queue->lock, &irqL); + /* _exit_critical_bh(&queue->lock, &irqL); */ ; } -//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 +/* 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(struct adapter *adapter, struct wlan_network *pnetwork); int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwork) { @@ -936,7 +935,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor u32 desired_encmode; u32 privacy; - //u8 wps_ie[512]; + /* u8 wps_ie[512]; */ uint wps_ielen; int bselected = true; @@ -955,7 +954,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor 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.... */ { u8 *p=NULL; uint ie_len=0; @@ -1023,10 +1022,10 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf) _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"); + /* 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; @@ -1045,7 +1044,7 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf) } } - // 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 ) @@ -1093,10 +1092,10 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) if (check_fwstate(pmlmepriv,_FW_UNDER_SURVEY)) { - //u8 timer_cancelled; + /* u8 timer_cancelled; */ timer_cancelled = true; - //_cancel_timer(&pmlmepriv->scan_to_timer, &timer_cancelled); + /* _cancel_timer(&pmlmepriv->scan_to_timer, &timer_cancelled); */ _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); } @@ -1133,7 +1132,6 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) 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")); @@ -1164,7 +1162,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) { _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); @@ -1185,7 +1183,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL); DBG_871X("change to widi listen\n"); } -#endif // CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ rtw_free_assoc_resources(adapter, 1); rtw_indicate_disconnect(adapter); } else { @@ -1203,7 +1201,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) } indicate_wx_scan_complete_event(adapter); - //DBG_871X("scan complete in %dms\n",rtw_get_passing_time_ms(pmlmepriv->scan_start_time)); + /* DBG_871X("scan complete in %dms\n",rtw_get_passing_time_ms(pmlmepriv->scan_start_time)); */ _exit_critical_bh(&pmlmepriv->lock, &irqL); @@ -1211,7 +1209,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) 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); @@ -1223,14 +1221,14 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) { struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; if(pmlmeext->sitesurvey_res.bss_cnt == 0){ - //rtw_hal_sreset_reset(adapter); + /* rtw_hal_sreset_reset(adapter); */ } } #endif #ifdef CONFIG_IOCTL_CFG80211 rtw_cfg80211_surveydone_event_callback(adapter); -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ ; @@ -1290,7 +1288,7 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue) #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &adapter->tdlsinfo; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ ; RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+rtw_free_assoc_resources\n")); @@ -1309,7 +1307,7 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue) rtw_free_all_stainfo(adapter); _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); } else -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ { _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_free_stainfo(adapter, psta); @@ -1343,26 +1341,26 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue) if(!rtw_p2p_chk_state(&adapter->wdinfo, P2P_STATE_NONE)) { u32 p2p_ielen=0; u8 *p2p_ie; - //u16 capability; + /* u16 capability; */ u8 *pcap = NULL; u32 capability_len=0; - //DBG_871X("free disconnecting network\n"); - //rtw_free_network_nolock(pmlmepriv, pwlan); + /* DBG_871X("free disconnecting network\n"); */ + /* rtw_free_network_nolock(pmlmepriv, pwlan); */ if((p2p_ie=rtw_get_p2p_ie(pwlan->network.IEs+_FIXED_IE_LENGTH_, pwlan->network.IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen))) { pcap = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, NULL, &capability_len); if(pcap && capability_len==2) { u16 cap = *(u16*)pcap ; - *(u16*)pcap = cap&0x00ff;//clear group capability when free this network + *(u16*)pcap = cap&0x00ff;/* clear group capability when free this network */ } } rtw_set_scan_deny(adapter, 2000); - //rtw_clear_scan_deny(adapter); + /* rtw_clear_scan_deny(adapter); */ } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ } else { RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_assoc_resources : pwlan== NULL \n\n")); } @@ -1427,7 +1425,7 @@ void rtw_indicate_connect(struct adapter *padapter) intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_WK, NULL); DBG_871X("change to widi listen\n"); } -#endif // CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ rtw_set_scan_deny(padapter, 3000); @@ -1456,7 +1454,7 @@ void rtw_indicate_disconnect( struct adapter *padapter ) _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING|WIFI_UNDER_WPS); - //DBG_871X("clear wps when %s\n", __func__); + /* DBG_871X("clear wps when %s\n", __func__); */ if(rtw_to_roaming(padapter) > 0) _clr_fwstate_(pmlmepriv, _FW_LINKED); @@ -1480,7 +1478,7 @@ void rtw_indicate_disconnect( struct adapter *padapter ) { rtw_os_indicate_disconnect(padapter); - //set ips_deny_time to avoid enter IPS before LPS leave + /* set ips_deny_time to avoid enter IPS before LPS leave */ adapter_to_pwrctl(padapter)->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(3000); _clr_fwstate_(pmlmepriv, _FW_LINKED); @@ -1493,7 +1491,7 @@ void rtw_indicate_disconnect( struct adapter *padapter ) #ifdef CONFIG_P2P_PS p2p_ps_wk_cmd(padapter, P2P_PS_DISABLE, 1); -#endif // CONFIG_P2P_PS +#endif /* CONFIG_P2P_PS */ #ifdef CONFIG_LPS rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 1); @@ -1530,7 +1528,7 @@ void rtw_scan_abort(struct adapter *adapter) if (!adapter->bDriverStopped && !adapter->bSurpriseRemoved) DBG_871X(FUNC_NDEV_FMT"waiting for scan_abort time out!\n", FUNC_NDEV_ARG(adapter->pnetdev)); #ifdef CONFIG_PLATFORM_MSTAR - //_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); + /* _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); */ set_survey_timer(pmlmeext, 0); _set_timer(&pmlmepriv->scan_to_timer, 50); #endif @@ -1551,17 +1549,17 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str psta = rtw_alloc_stainfo(pstapriv, pnetwork->network.MacAddress); } - if(psta) //update ptarget_sta + if(psta) /* update ptarget_sta */ { DBG_871X("%s\n", __FUNCTION__); psta->aid = pnetwork->join_res; psta->mac_id=0; - //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; @@ -1579,13 +1577,13 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str memset((u8 *)&psta->dot11txpn, 0, sizeof (union pn48)); #ifdef CONFIG_IEEE80211W memset((u8 *)&psta->dot11wtxpn, 0, sizeof (union pn48)); -#endif //CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ 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; @@ -1593,12 +1591,12 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str } - //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; @@ -1607,7 +1605,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str 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 */ } @@ -1616,7 +1614,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str { 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; @@ -1625,12 +1623,12 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str 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); } @@ -1639,8 +1637,8 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str } -//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(struct adapter *padapter, struct wlan_network *ptarget_wlan, struct wlan_network *pnetwork) { struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); @@ -1652,9 +1650,9 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net ,get_fwstate(pmlmepriv), MAC_ARG(pnetwork->network.MacAddress))); - // why not use ptarget_wlan?? + /* why not use ptarget_wlan?? */ 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; memcpy(&cur_network->network.IEs[0], &ptarget_wlan->network.IEs[0], MAX_IE_SZ); @@ -1666,7 +1664,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net #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_871X(FUNC_ADPT_FMT" signal_strength:%3u, rssi:%3d, signal_qual:%3u" @@ -1681,7 +1679,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net 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: @@ -1711,14 +1709,14 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net } -//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(struct adapter *adapter, u8 *pbuf) { _irqL irqL,irqL2; @@ -1758,7 +1756,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); retry = 0; 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); @@ -1788,7 +1786,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) } } - //s2. update cur_network + /* s2. update cur_network */ if(ptarget_wlan) { rtw_joinbss_update_network(adapter, ptarget_wlan, pnetwork); } else { @@ -1798,7 +1796,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) } - //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)) { ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork); if(ptarget_sta==NULL) { @@ -1808,16 +1806,16 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) } } - //s4. indicate connect + /* s4. indicate connect */ if(check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { pmlmepriv->cur_network_scanned = ptarget_wlan; 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")); @@ -1835,7 +1833,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) 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; if(retry < 2) { @@ -1843,10 +1841,10 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_select_and_join_from_scanned_queue again! res:%d\n",res)); } 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 { @@ -1878,7 +1876,7 @@ void rtw_joinbss_event_callback(struct adapter *adapter, u8 *pbuf) static u8 search_max_mac_id(struct 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); @@ -1903,7 +1901,7 @@ static u8 search_max_mac_id(struct 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) @@ -1917,20 +1915,20 @@ static u8 search_max_mac_id(struct adapter *padapter) } -//FOR STA, AP ,AD-HOC mode +/* FOR STA, AP ,AD-HOC mode */ void rtw_sta_media_status_rpt(struct adapter *adapter,struct sta_info *psta, u32 mstatus) { u16 media_status_rpt; 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_rpt = (u16)((psta->mac_id<<8)|mstatus); // MACID|OPMODE:1 connect + media_status_rpt = (u16)((psta->mac_id<<8)|mstatus); /* MACID|OPMODE:1 connect */ rtw_hal_set_hwreg(adapter,HW_VAR_H2C_MEDIA_STATUS_RPT,(u8 *)&media_status_rpt); } @@ -1963,7 +1961,7 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf) ap_sta_info_defer_update(adapter, psta); - //report to upper layer + /* report to upper layer */ DBG_871X("indicate_sta_assoc_event to upper layer - hostapd\n"); #ifdef CONFIG_IOCTL_CFG80211 _enter_critical_bh(&psta->lock, &irqL); @@ -1988,24 +1986,24 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf) rtw_mfree(passoc_req, assoc_req_len); } -#else //!CONFIG_IOCTL_CFG80211 +#else /* CONFIG_IOCTL_CFG80211 */ rtw_indicate_sta_assoc_event(adapter, psta); -#endif //!CONFIG_IOCTL_CFG80211 -#endif //!CONFIG_AUTO_AP_MODE +#endif /* CONFIG_IOCTL_CFG80211 */ +#endif /* CONFIG_AUTO_AP_MODE */ } goto exit; } -#endif //defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#endif /* defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */ - //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); @@ -2014,12 +2012,12 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf) 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_871X("%s\n",__FUNCTION__); - //for ad-hoc mode + /* for ad-hoc mode */ rtw_hal_set_odm_var(adapter,HAL_ODM_STA_INFO,psta,true); rtw_sta_media_status_rpt(adapter, psta, 1); @@ -2042,7 +2040,7 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf) pmlmepriv->cur_network_scanned = ptarget_wlan; 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); } } @@ -2082,8 +2080,8 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) 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); } @@ -2094,8 +2092,8 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) #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; } @@ -2116,7 +2114,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) rtw_set_roaming(adapter, adapter->registrypriv.max_roaming_times); #ifdef CONFIG_INTEL_WIDI if(adapter->mlmepriv.widi_state != INTEL_WIDI_STATE_CONNECTED) -#endif // CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ if(*((unsigned short *)(pstadel->rsvd)) != WLAN_REASON_EXPIRATION_CHK) rtw_set_roaming(adapter, 0); /* don't roam */ #endif @@ -2126,7 +2124,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) 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; @@ -2139,8 +2137,8 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) #else #ifdef CONFIG_INTEL_WIDI process_intel_widi_disconnect(adapter, 1); -#endif // CONFIG_INTEL_WIDI - #endif //CONFIG_LAYER2_ROAMING +#endif /* CONFIG_INTEL_WIDI */ + #endif /* CONFIG_LAYER2_ROAMING */ } @@ -2152,12 +2150,10 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) 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) { @@ -2165,7 +2161,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) 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; @@ -2232,7 +2228,7 @@ void _rtw_join_timeout_handler (struct adapter *adapter) struct mlme_priv *pmlmepriv = &adapter->mlmepriv; #ifdef CONFIG_LAYER2_ROAMING int do_join_r; -#endif //CONFIG_LAYER2_ROAMING +#endif /* CONFIG_LAYER2_ROAMING */ ; DBG_871X("%s, fw_state=%x\n", __FUNCTION__, get_fwstate(pmlmepriv)); @@ -2262,7 +2258,7 @@ void _rtw_join_timeout_handler (struct adapter *adapter) intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL); DBG_871X("change to widi listen\n"); } -#endif // CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ DBG_871X("%s We've try roaming but fail\n", __FUNCTION__); rtw_indicate_disconnect(adapter); break; @@ -2273,12 +2269,12 @@ void _rtw_join_timeout_handler (struct adapter *adapter) #endif { rtw_indicate_disconnect(adapter); - free_scanqueue(pmlmepriv);//??? + free_scanqueue(pmlmepriv);/* */ #ifdef CONFIG_IOCTL_CFG80211 - //indicate disconnect for the case that join_timeout and check_fwstate != FW_LINKED + /* indicate disconnect for the case that join_timeout and check_fwstate != FW_LINKED */ rtw_cfg80211_indicate_disconnect(adapter); -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ } @@ -2319,7 +2315,7 @@ static void rtw_auto_scan_handler(struct adapter *padapter) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter); - //auto site survey per 60sec + /* auto site survey per 60sec */ if(pmlmepriv->scan_interval >0) { pmlmepriv->scan_interval--; @@ -2329,7 +2325,7 @@ static void rtw_auto_scan_handler(struct 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 */ } @@ -2341,7 +2337,7 @@ void rtw_dynamic_check_timer_handlder(struct 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; if(!adapter) @@ -2368,7 +2364,7 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter) if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) #endif { - //auto site survey + /* auto site survey */ rtw_auto_scan_handler(adapter); } } @@ -2380,29 +2376,29 @@ void rtw_dynamic_check_timer_handlder(struct 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--; } @@ -2410,9 +2406,9 @@ void rtw_dynamic_check_timer_handlder(struct 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 */ } @@ -2455,7 +2451,7 @@ void rtw_event_polling_timer_hdl(struct adapter *adapter) #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 @@ -2472,13 +2468,13 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv struct adapter *adapter = container_of(pmlmepriv, struct 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 @@ -2591,7 +2587,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv ) } - // check for situation of _FW_LINKED + /* check for situation of _FW_LINKED */ if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { DBG_871X("%s: _FW_LINKED while ask_for_joinbss!!!\n", __FUNCTION__); @@ -2634,7 +2630,7 @@ sint rtw_set_auth(struct adapter * adapter,struct security_priv *psecuritypriv) pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if(pcmd==NULL){ - res= _FAIL; //try again + res= _FAIL; /* try again */ goto exit; } @@ -2697,7 +2693,7 @@ sint rtw_set_key(struct adapter * adapter,struct security_priv *psecuritypriv,si 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; if (is_wep_enc(psetkeyparm->algorithm)) psecuritypriv->key_mask |= BIT(psetkeyparm->keyid); @@ -2737,7 +2733,7 @@ sint rtw_set_key(struct adapter * adapter,struct security_priv *psecuritypriv,si pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if(pcmd==NULL){ rtw_mfree((unsigned char *)psetkeyparm, sizeof(struct setkey_parm)); - res= _FAIL; //try again + res= _FAIL; /* try again */ goto exit; } @@ -2749,7 +2745,7 @@ sint rtw_set_key(struct adapter * adapter,struct security_priv *psecuritypriv,si _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); } @@ -2764,30 +2760,20 @@ exit: } -//adjust IEs for rtw_joinbss_cmd in WMM +/* adjust IEs for rtw_joinbss_cmd in WMM */ int rtw_restruct_wmm_ie(struct 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(struct adapter *Adapter, u8 *bssid) { @@ -2834,46 +2820,46 @@ static int SecIsInPMKIDList(struct 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++; 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); @@ -2898,7 +2884,7 @@ sint rtw_restruct_sec_ie(struct adapter *adapter,u8 *in_ie, u8 *out_ie, uint in_ ("+rtw_restruct_sec_ie: ndisauthmode=%d ndissecuritytype=%d\n", ndisauthmode, ndissecuritytype)); - //copy fixed ie only + /* copy fixed ie only */ memcpy(out_ie, in_ie,12); ielength=12; if((ndisauthmode==Ndis802_11AuthModeWPA)||(ndisauthmode==Ndis802_11AuthModeWPAPSK)) @@ -2914,7 +2900,7 @@ sint rtw_restruct_sec_ie(struct adapter *adapter,u8 *in_ie, u8 *out_ie, uint in_ } else if((authmode==_WPA_IE_ID_)||(authmode==_WPA2_IE_ID_)) { - //copy RSN or SSN + /* copy RSN or SSN */ memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0], psecuritypriv->supplicant_ie[1]+2); /* debug for CONFIG_IEEE80211W { @@ -2982,11 +2968,11 @@ void rtw_update_registrypriv_dev_network(struct 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; */ ; - 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; @@ -3012,7 +2998,7 @@ void rtw_update_registrypriv_dev_network(struct adapter* adapter) pdev_network->NetworkTypeInUse = (Ndis802_11OFDM24); break; default : - // TODO + /* TODO */ break; } @@ -3024,33 +3010,21 @@ void rtw_update_registrypriv_dev_network(struct adapter* adapter) 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); - -; - } void rtw_get_encrypt_decrypt_from_registrypriv(struct adapter* adapter) { -; - - -; - } -//the fucntion is at passive_level +/* the fucntion is at passive_level */ void rtw_joinbss_reset(struct adapter *padapter) { u8 threshold; @@ -3060,7 +3034,7 @@ void rtw_joinbss_reset(struct 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 */ @@ -3071,10 +3045,10 @@ void rtw_joinbss_reset(struct adapter *padapter) pmlmepriv->num_sta_no_ht = 0; - phtpriv->ampdu_enable = false;//reset to disabled + phtpriv->ampdu_enable = false;/* reset to disabled */ - // 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) @@ -3094,7 +3068,7 @@ void rtw_joinbss_reset(struct adapter *padapter) #ifdef CONFIG_80211N_HT -//the fucntion is >= passive_level +/* the fucntion is >= passive_level */ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len) { u32 ielen, out_len; @@ -3164,20 +3138,20 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ } -//the fucntion is > passive_level (in critical_section) +/* the fucntion is > passive_level (in critical_section) */ void rtw_update_ht_cap(struct 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 ieee80211_ht_addt_info *pht_addtinfo; - //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); @@ -3190,7 +3164,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len) DBG_871X("+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) @@ -3208,16 +3182,16 @@ void rtw_update_ht_cap(struct 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_871X("rtw_update_ht_cap(): max_ampdu_sz=%d\n", max_ampdu_sz); + /* DBG_871X("rtw_update_ht_cap(): max_ampdu_sz=%d\n", max_ampdu_sz); */ phtpriv->rx_ampdu_maxlen = max_ampdu_sz; } @@ -3228,11 +3202,11 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len) if(p && len>0) { pht_addtinfo = (struct ieee80211_ht_addt_info *)(p+2); - //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))) @@ -3242,7 +3216,7 @@ void rtw_update_ht_cap(struct 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)) @@ -3260,7 +3234,7 @@ void rtw_update_ht_cap(struct 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 { @@ -3268,7 +3242,7 @@ void rtw_update_ht_cap(struct 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)) { @@ -3286,23 +3260,17 @@ void rtw_update_ht_cap(struct 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) { - /*u8 i; - //update the MCS rates - for (i = 0; i < 16; i++) - { - pmlmeinfo->HT_caps.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i]; - }*/ DBG_871X("%s(): WLAN_HT_CAP_SM_PS_STATIC\n",__FUNCTION__); } - // - // Config current HT Protection mode. - // + /* */ + /* Config current HT Protection mode. */ + /* */ pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3; } @@ -3315,7 +3283,7 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr struct pkt_attrib *pattrib =&pxmitframe->attrib; s32 bmcst = IS_MCAST(pattrib->ra); - //if(bmcst || (padapter->mlmepriv.LinkDetectInfo.bTxBusyTraffic == false)) + /* if(bmcst || (padapter->mlmepriv.LinkDetectInfo.bTxBusyTraffic == false)) */ if(bmcst || (padapter->mlmepriv.LinkDetectInfo.NumTxOkInPeriod<100)) return; @@ -3437,7 +3405,7 @@ sint rtw_linked_check(struct adapter *padapter) return true; } else - { //Station mode + { /* Station mode */ if(check_fwstate(&padapter->mlmepriv, _FW_LINKED)== true) return true; } diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 70bc506..f3c15e3 100755 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -92,8 +92,8 @@ static struct action_handler OnAction_tbl[]={ {RTW_WLAN_CATEGORY_SA_QUERY, "ACTION_SA_QUERY", &OnAction_sa_query}, #else {RTW_WLAN_CATEGORY_SA_QUERY, "ACTION_SA_QUERY", &DoReserved}, -#endif //CONFIG_IEEE80211W - //add for CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ + /* add for CONFIG_IEEE80211W */ {RTW_WLAN_CATEGORY_UNPROTECTED_WNM, "ACTION_UNPROTECTED_WNM", &DoReserved}, {RTW_WLAN_CATEGORY_SELF_PROTECTED, "ACTION_SELF_PROTECTED", &DoReserved}, {RTW_WLAN_CATEGORY_WMM, "ACTION_WMM", &OnAction_wmm}, @@ -124,144 +124,121 @@ MCS rate definitions #ifdef CONFIG_DISABLE_MCS13TO15 unsigned char MCS_rate_2R_MCS13TO15_OFF[16] = {0xff, 0x1f, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; unsigned char MCS_rate_2R[16] = {0xff, 0xff, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; -#else //CONFIG_DISABLE_MCS13TO15 +#else /* CONFIG_DISABLE_MCS13TO15 */ unsigned char MCS_rate_2R[16] = {0xff, 0xff, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; -#endif //CONFIG_DISABLE_MCS13TO15 +#endif /* CONFIG_DISABLE_MCS13TO15 */ unsigned char MCS_rate_1R[16] = {0xff, 0x00, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 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 @@ -293,10 +270,7 @@ int init_hw_mlme_ext(struct 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; } @@ -309,17 +283,17 @@ static void init_mlme_ext_priv_value(struct 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 */ #ifdef CONFIG_IEEE80211W pmlmeext->sa_query_seq = 0; pmlmeext->mgnt_80211w_IPN=0; pmlmeext->mgnt_80211w_IPN_rx=0; -#endif //CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ pmlmeext->cur_channel = padapter->registrypriv.channel; pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; @@ -328,8 +302,8 @@ static void init_mlme_ext_priv_value(struct adapter* padapter) pmlmeext->cur_wireless_mode = padapter->registrypriv.wireless_mode; - //memcpy(pmlmeext->channel_set, DefaultChannelPlan[padapter->mlmepriv.ChannelPlan].Channel, DefaultChannelPlan[padapter->mlmepriv.ChannelPlan].Len); - //memcpy(pmlmeext->channel_set, default_channel_set, MAX_CHANNEL_NUM); + /* memcpy(pmlmeext->channel_set, DefaultChannelPlan[padapter->mlmepriv.ChannelPlan].Channel, DefaultChannelPlan[padapter->mlmepriv.ChannelPlan].Len); */ + /* memcpy(pmlmeext->channel_set, default_channel_set, MAX_CHANNEL_NUM); */ memcpy(pmlmeext->datarate, mixed_datarate, NumRates); memcpy(pmlmeext->basicrate, mixed_basicrate, NumRates); @@ -470,7 +444,7 @@ static u8 init_channel_set(struct adapter* padapter, u8 ChannelPlan, RT_CHANNEL_ { 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) @@ -480,7 +454,7 @@ static u8 init_channel_set(struct adapter* padapter, u8 ChannelPlan, RT_CHANNEL_ } 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; @@ -505,7 +479,7 @@ static u8 init_channel_set(struct adapter* padapter, u8 ChannelPlan, RT_CHANNEL_ 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; @@ -519,7 +493,7 @@ static u8 init_channel_set(struct adapter* padapter, u8 ChannelPlan, RT_CHANNEL_ 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; @@ -541,12 +515,12 @@ int init_mlme_ext_priv(struct 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(). - //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(). */ + /* 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; @@ -587,12 +561,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(struct 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; @@ -622,7 +596,7 @@ static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptabl 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)) { @@ -640,7 +614,7 @@ void mgt_dispatcher(struct 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)); @@ -655,7 +629,7 @@ void mgt_dispatcher(struct 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)) { @@ -668,13 +642,13 @@ void mgt_dispatcher(struct 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_871X("recv tdls discovery response frame\n"); On_TDLS_Dis_Rsp(padapter, precv_frame); } } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ if (index > 13) { @@ -701,8 +675,8 @@ void mgt_dispatcher(struct 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 @@ -714,7 +688,7 @@ void mgt_dispatcher(struct 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); @@ -739,7 +713,7 @@ void mgt_dispatcher(struct 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: @@ -785,10 +759,10 @@ static u32 p2p_listen_state_process(struct adapter *padapter, unsigned char *da) } } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ if( padapter->wdinfo.driver_interface == DRIVER_WEXT ) { - // do nothing if the device name is empty + /* do nothing if the device name is empty */ if ( !padapter->wdinfo.device_name_len ) { response = false; @@ -800,7 +774,7 @@ static u32 p2p_listen_state_process(struct adapter *padapter, unsigned char *da) return _SUCCESS; } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ /**************************************************************************** @@ -842,21 +816,21 @@ unsigned int OnProbeReq(struct 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 ) { @@ -865,7 +839,7 @@ unsigned int OnProbeReq(struct 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)); @@ -882,7 +856,7 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame) } _continue: -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ if(check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { @@ -896,7 +870,7 @@ _continue: } - //DBG_871X("+OnProbeReq\n"); + /* DBG_871X("+OnProbeReq\n"); */ #ifdef CONFIG_ATMEL_RC_PATCH @@ -908,7 +882,7 @@ _continue: target_ie = rtw_get_wps_attr_content( wps_ie, wps_ielen, WPS_ATTR_MANUFACTURER, NULL, &target_ielen); } if ((target_ie && (target_ielen == 4)) && (true ==_rtw_memcmp((void *)target_ie, "Ozmo",4 ))) { - //psta->flag_atmel_rc = 1; + /* psta->flag_atmel_rc = 1; */ unsigned char *sa_addr = get_sa(pframe); DBG_871X("%s: Find Ozmo RC -- %02x:%02x:%02x:%02x:%02x:%02x \n\n", __func__, *sa_addr, *(sa_addr+1), *(sa_addr+2), *(sa_addr+3), *(sa_addr+4), *(sa_addr+5)); @@ -919,7 +893,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) @@ -939,7 +913,7 @@ _issue_probersp: if(((check_fwstate(pmlmepriv, _FW_LINKED) == true && pmlmepriv->cur_network.join_res == true)) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { - //DBG_871X("+issue_probersp during ap mode\n"); + /* DBG_871X("+issue_probersp during ap mode\n"); */ issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq); } @@ -1012,7 +986,7 @@ unsigned int OnProbeRsp(struct adapter *padapter, union recv_frame *precv_frame) } } } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) @@ -1062,7 +1036,7 @@ unsigned int OnBeacon(struct 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) { @@ -1072,13 +1046,13 @@ unsigned int OnBeacon(struct 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; @@ -1089,16 +1063,16 @@ unsigned int OnBeacon(struct 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) { @@ -1106,21 +1080,21 @@ unsigned int OnBeacon(struct adapter *padapter, union recv_frame *precv_frame) receive_disconnect(padapter, pmlmeinfo->network.MacAddress , 0); 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_871X("update_bcn_info\n"); + /* DBG_871X("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 */ } } @@ -1128,34 +1102,34 @@ unsigned int OnBeacon(struct 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_871X("update_bcn_info\n"); + /* DBG_871X("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); } } @@ -1202,8 +1176,8 @@ unsigned int OnAuth(struct 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_871X("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]); @@ -1221,7 +1195,7 @@ unsigned int OnAuth(struct 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_871X("going to alloc stainfo for sa="MAC_FMT"\n", MAC_ARG(sa)); pstat = rtw_alloc_stainfo(pstapriv, sa); if (pstat == NULL) @@ -1234,8 +1208,8 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) pstat->state = WIFI_FW_AUTH_NULL; pstat->auth_seq = 0; - //pstat->flags = 0; - //pstat->capability = 0; + /* pstat->flags = 0; */ + /* pstat->capability = 0; */ } else { @@ -1246,13 +1220,13 @@ unsigned int OnAuth(struct 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 */ } } @@ -1292,13 +1266,11 @@ unsigned int OnAuth(struct 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; @@ -1307,7 +1279,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) } else if (seq == 3) { - //checking for challenging txt... + /* checking for challenging txt... */ DBG_871X("checking for challenging txt...\n"); p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_ , _CHLGETXT_IE_, (int *)&ie_len, @@ -1324,7 +1296,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) { 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 @@ -1344,7 +1316,7 @@ unsigned int OnAuth(struct 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 @@ -1388,7 +1360,7 @@ unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_fram DBG_871X("%s\n", __FUNCTION__); - //check A1 matches or not + /* check A1 matches or not */ if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), get_da(pframe), ETH_ALEN)) return _SUCCESS; @@ -1404,13 +1376,13 @@ unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_fram if (status != 0) { DBG_871X("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); @@ -1421,13 +1393,13 @@ unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_fram { 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_871X("marc: no challenge text?\n"); + /* DBG_871X("marc: no challenge text?\n"); */ goto authclnt_fail; } @@ -1440,7 +1412,7 @@ unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_fram } else { - // open system + /* open system */ go2asoc = 1; } } @@ -1457,8 +1429,8 @@ unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_fram } else { - // this is also illegal - //DBG_871X("marc: clnt auth failed due to illegal seq=%x\n", seq); + /* this is also illegal */ + /* DBG_871X("marc: clnt auth failed due to illegal seq=%x\n", seq); */ goto authclnt_fail; } @@ -1471,7 +1443,7 @@ unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_fram authclnt_fail: - //pmlmeinfo->state &= ~(WIFI_FW_AUTH_STATE); + /* pmlmeinfo->state &= ~(WIFI_FW_AUTH_STATE); */ return _FAIL; @@ -1507,8 +1479,8 @@ unsigned int OnAssocReq(struct 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 */ if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) return _FAIL; @@ -1519,7 +1491,7 @@ unsigned int OnAssocReq(struct 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_; @@ -1540,8 +1512,8 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) } capab_info = RTW_GET_LE16(pframe + WLAN_HDR_A3_LEN); - //capab_info = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN)); - //listen_interval = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN+2)); + /* capab_info = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN)); */ + /* listen_interval = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN+2)); */ listen_interval = RTW_GET_LE16(pframe + WLAN_HDR_A3_LEN+2); left = pkt_len - (IEEE80211_3ADDR_LEN + ie_offset); @@ -1550,7 +1522,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) DBG_871X("%s\n", __FUNCTION__); - // 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)) @@ -1572,7 +1544,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) 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_871X("STA " MAC_FMT " sent invalid association request\n", @@ -1581,8 +1553,8 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) goto OnAssocReqFail; } - // 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) @@ -1590,11 +1562,11 @@ unsigned int OnAssocReq(struct 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_; @@ -1605,13 +1577,13 @@ unsigned int OnAssocReq(struct 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_871X("Rx a sta assoc-req which supported rate is empty!\n"); - // use our own rate set as statoin used - //memcpy(supportRate, AP_BSSRATE, AP_BSSRATE_LEN); - //supportRateNum = AP_BSSRATE_LEN; + /* use our own rate set as statoin used */ + /* memcpy(supportRate, AP_BSSRATE, AP_BSSRATE_LEN); */ + /* supportRateNum = AP_BSSRATE_LEN; */ status = _STATS_FAILURE_; goto OnAssocReqFail; @@ -1632,15 +1604,15 @@ unsigned int OnAssocReq(struct 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; 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; @@ -1657,7 +1629,7 @@ unsigned int OnAssocReq(struct 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; @@ -1683,7 +1655,7 @@ unsigned int OnAssocReq(struct 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; @@ -1710,16 +1682,15 @@ unsigned int OnAssocReq(struct 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_871X("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_871X("STA did not include WPA/RSN IE " "in (Re)Association Request - possible WPS " @@ -1728,8 +1699,8 @@ unsigned int OnAssocReq(struct 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))) { @@ -1785,7 +1756,7 @@ unsigned int OnAssocReq(struct 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; @@ -1879,13 +1850,12 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) DBG_871X("HT: " MAC_FMT " tried to " "use TKIP with HT association\n", MAC_ARG(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) { @@ -1935,13 +1905,13 @@ unsigned int OnAssocReq(struct 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 */ @@ -1953,7 +1923,7 @@ unsigned int OnAssocReq(struct 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; @@ -1992,15 +1962,15 @@ unsigned int OnAssocReq(struct 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); - //.2 issue assoc rsp before notify station join event. + /* 2 issue assoc rsp before notify station join event. */ if (frame_type == WIFI_ASSOCREQ) issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP); else @@ -2022,12 +1992,12 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) pstat->assoc_req_len = pkt_len; } _exit_critical_bh(&pstat->lock, &irqL); -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ - //.3-(1) report sta add event + /* 3-(1) report sta add event */ report_add_sta_event(padapter, pstat->hwaddr, pstat->aid); -#endif //CONFIG_NATIVEAP_MLME +#endif /* CONFIG_NATIVEAP_MLME */ } return _SUCCESS; @@ -2067,14 +2037,14 @@ unsigned int OnAssocRsp(struct 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_871X("%s\n", __FUNCTION__); - //check A1 matches or not + /* check A1 matches or not */ if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), get_da(pframe), ETH_ALEN)) return _SUCCESS; @@ -2086,7 +2056,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, union recv_frame *precv_frame) _cancel_timer_ex(&pmlmeext->link_timer); - //status + /* status */ if ((status = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN + 2))) > 0) { DBG_871X("assoc reject, status code: %d\n", status); @@ -2095,18 +2065,18 @@ unsigned int OnAssocRsp(struct 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); @@ -2114,12 +2084,12 @@ unsigned int OnAssocRsp(struct adapter *padapter, union recv_frame *precv_frame) 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_871X( "[%s] Found WFD IE\n", __FUNCTION__ ); WFD_info_handler( padapter, pIE ); @@ -2133,11 +2103,11 @@ unsigned int OnAssocRsp(struct adapter *padapter, union recv_frame *precv_frame) 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; @@ -2158,7 +2128,7 @@ unsigned int OnAssocRsp(struct 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: @@ -2182,9 +2152,9 @@ unsigned int OnDeAuth(struct 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; @@ -2194,7 +2164,7 @@ unsigned int OnDeAuth(struct 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)); @@ -2207,9 +2177,9 @@ unsigned int OnDeAuth(struct 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_871X_LEVEL(_drv_always_, "ap recv deauth reason code(%d) sta:%pM\n", reason, GetAddr2Ptr(pframe)); @@ -2240,11 +2210,11 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame) { int ignore_received_deauth = 0; - // Commented by Albert 20130604 - // Before sending the auth frame to start the STA/GC mode connection with AP/GO, - // we will send the deauth first. - // However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. - // Added the following code to avoid this case. + /* Commented by Albert 20130604 */ + /* Before sending the auth frame to start the STA/GC mode connection with AP/GO, */ + /* we will send the deauth first. */ + /* However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. */ + /* Added the following code to avoid this case. */ if ( ( pmlmeinfo->state & WIFI_FW_AUTH_STATE ) || ( pmlmeinfo->state & WIFI_FW_ASSOC_STATE ) ) { @@ -2252,7 +2222,7 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame) { ignore_received_deauth = 1; } else if (WLAN_REASON_PREV_AUTH_NOT_VALID == reason) { - // TODO: 802.11r + /* TODO: 802.11r */ ignore_received_deauth = 1; } } @@ -2279,9 +2249,9 @@ unsigned int OnDisassoc(struct 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; @@ -2290,7 +2260,7 @@ unsigned int OnDisassoc(struct 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)); @@ -2302,9 +2272,9 @@ unsigned int OnDisassoc(struct 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_871X_LEVEL(_drv_always_, "ap recv disassoc reason code(%d) sta:%pM\n", reason, GetAddr2Ptr(pframe)); @@ -2472,15 +2442,10 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra 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_871X("%s\n", __FUNCTION__); if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) @@ -2496,17 +2461,17 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra 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; @@ -2516,10 +2481,10 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra DBG_871X("%s, action=%d\n", __FUNCTION__, action); switch (action) { - case RTW_WLAN_ACTION_ADDBA_REQ: //ADDBA request + case RTW_WLAN_ACTION_ADDBA_REQ: /* ADDBA request */ 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) { @@ -2527,19 +2492,17 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra } else { issue_action_BA(padapter, addr, RTW_WLAN_ACTION_ADDBA_RESP, - 37);//reject ADDBA Req + 37);/* reject ADDBA Req */ } break; - case RTW_WLAN_ACTION_ADDBA_RESP: //ADDBA response - - //status = frame_body[3] | (frame_body[4] << 8); //endian issue + case RTW_WLAN_ACTION_ADDBA_RESP: /* ADDBA response */ status = RTW_GET_LE16(&frame_body[3]); tid = ((frame_body[5] >> 2) & 0x7); if (status == 0) - { //successful + { /* successful */ DBG_871X("agg_enable for TID=%d\n", tid); psta->htpriv.agg_enable_bitmap |= 1 << tid; psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); @@ -2549,16 +2512,16 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra psta->htpriv.agg_enable_bitmap &= ~BIT(tid); } - //DBG_871X("marc: ADDBA RSP: %x\n", pmlmeinfo->agg_enable_bitmap); + /* DBG_871X("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)) @@ -2575,14 +2538,14 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra } DBG_871X("%s(): DELBA: %x(%x)\n", __FUNCTION__,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; } @@ -2615,12 +2578,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)++; } } @@ -2638,7 +2601,7 @@ void issue_p2p_GO_request(struct 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; @@ -2657,7 +2620,7 @@ void issue_p2p_GO_request(struct adapter *padapter, u8* raddr) } DBG_871X( "[%s] In\n", __FUNCTION__ ); - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -2684,39 +2647,39 @@ void issue_p2p_GO_request(struct 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 ) { @@ -2736,41 +2699,41 @@ void issue_p2p_GO_request(struct 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; @@ -2781,94 +2744,94 @@ void issue_p2p_GO_request(struct 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: */ 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); @@ -2877,121 +2840,121 @@ void issue_p2p_GO_request(struct adapter *padapter, u8* raddr) 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 */ { 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]; } } } - // 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 */ 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: */ 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 ); @@ -2999,7 +2962,7 @@ void issue_p2p_GO_request(struct 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; @@ -3037,7 +3000,7 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { @@ -3045,7 +3008,7 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame } DBG_871X( "[%s] In, result = %d\n", __FUNCTION__, result ); - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -3072,12 +3035,12 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame 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); @@ -3085,34 +3048,34 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame 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 ); @@ -3127,9 +3090,9 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame } 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 ) @@ -3149,66 +3112,66 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame 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; @@ -3218,95 +3181,95 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame 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: */ 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); @@ -3315,99 +3278,99 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame 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 */ { 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]; } } } - // 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 */ 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: */ 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 */ memcpy( p2pie + p2pielen , pwdinfo->device_addr, ETH_ALEN ); p2pielen += ETH_ALEN; - // SSID + /* SSID */ memcpy( p2pie + p2pielen, pwdinfo->nego_ssid, pwdinfo->nego_ssidlen ); p2pielen += pwdinfo->nego_ssidlen; @@ -3419,7 +3382,7 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame wfdielen = build_nego_resp_wfd_ie(pwdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -3450,7 +3413,7 @@ static void issue_p2p_GO_confirm(struct 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) { @@ -3458,7 +3421,7 @@ static void issue_p2p_GO_confirm(struct adapter *padapter, u8* raddr, u8 result) } DBG_871X( "[%s] In\n", __FUNCTION__ ); - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -3489,47 +3452,47 @@ static void issue_p2p_GO_confirm(struct 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; @@ -3540,21 +3503,21 @@ static void issue_p2p_GO_confirm(struct 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; @@ -3562,17 +3525,17 @@ static void issue_p2p_GO_confirm(struct 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; } @@ -3582,56 +3545,56 @@ static void issue_p2p_GO_confirm(struct 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; *(__le16 *) ( p2pie + p2pielen ) = cpu_to_le16(6); p2pielen += 2; - // Country String + /* 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; - // Value: + /* Value: */ if ( rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT) ) { 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; } p2pie[ p2pielen++ ] = 1; @@ -3641,41 +3604,41 @@ static void issue_p2p_GO_confirm(struct 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 + /* Channel Number */ p2pie[ p2pielen++ ] = 1; - p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // Use the listen channel as the operating channel + p2pie[ p2pielen++ ] = pwdinfo->operating_channel; /* Use the listen channel as the operating channel */ } 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 */ memcpy( p2pie + p2pielen , pwdinfo->device_addr, ETH_ALEN ); p2pielen += ETH_ALEN; - // SSID + /* SSID */ memcpy( p2pie + p2pielen, pwdinfo->nego_ssid, pwdinfo->nego_ssidlen ); p2pielen += pwdinfo->nego_ssidlen; } @@ -3686,7 +3649,7 @@ static void issue_p2p_GO_confirm(struct 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; @@ -3710,7 +3673,7 @@ void issue_p2p_invitation_request(struct 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; unsigned char *pframe; @@ -3725,7 +3688,7 @@ void issue_p2p_invitation_request(struct adapter *padapter, u8* raddr ) if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) return; - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -3754,67 +3717,67 @@ void issue_p2p_invitation_request(struct 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 ) ) @@ -3822,34 +3785,34 @@ void issue_p2p_invitation_request(struct 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 */ 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); @@ -3858,95 +3821,95 @@ void issue_p2p_invitation_request(struct adapter *padapter, u8* raddr ) 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 */ { 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]; } } } - // 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 */ memcpy( p2pie + p2pielen, pwdinfo->invitereq_info.go_bssid, ETH_ALEN ); p2pielen += ETH_ALEN; - // SSID + /* SSID */ 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 */ 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: */ memcpy( p2pie + p2pielen, pwdinfo->device_name, pwdinfo->device_name_len ); p2pielen += pwdinfo->device_name_len; @@ -3956,7 +3919,7 @@ void issue_p2p_invitation_request(struct 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; @@ -3979,7 +3942,7 @@ void issue_p2p_invitation_response(struct adapter *padapter, u8* raddr, u8 dialo 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; @@ -3997,7 +3960,7 @@ void issue_p2p_invitation_response(struct adapter *padapter, u8* raddr, u8 dialo return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -4026,108 +3989,108 @@ void issue_p2p_invitation_response(struct adapter *padapter, u8* raddr, u8 dialo 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 */ 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); @@ -4135,26 +4098,26 @@ void issue_p2p_invitation_response(struct adapter *padapter, u8* raddr, u8 dialo *(__le16*) ( p2pie + p2pielen ) = cpu_to_le16( len_channellist_attr ); 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 */ { 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]; } @@ -4168,7 +4131,7 @@ void issue_p2p_invitation_response(struct adapter *padapter, u8* raddr, u8 dialo wfdielen = build_invitation_resp_wfd_ie(pwdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -4190,7 +4153,7 @@ void issue_p2p_provision_request(struct adapter *padapter, u8* pssid, u8 ussidle u32 p2pielen = 0; #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; @@ -4209,7 +4172,7 @@ void issue_p2p_provision_request(struct adapter *padapter, u8* pssid, u8 ussidle } DBG_871X( "[%s] In\n", __FUNCTION__ ); - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -4244,32 +4207,32 @@ void issue_p2p_provision_request(struct adapter *padapter, u8* pssid, u8 ussidle 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; @@ -4280,7 +4243,7 @@ void issue_p2p_provision_request(struct adapter *padapter, u8* pssid, u8 ussidle wfdielen = build_provdisc_req_wfd_ie(pwdinfo, pframe); pframe += wfdielen; pattrib->pktlen += wfdielen; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ pattrib->last_txcmdsz = pattrib->pktlen; @@ -4325,7 +4288,7 @@ void issue_probersp_p2p(struct 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); @@ -4333,19 +4296,19 @@ void issue_probersp_p2p(struct adapter *padapter, unsigned char *da) u32 wpsielen = 0, p2pielen = 0; #ifdef CONFIG_WFD u32 wfdielen = 0; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ #ifdef CONFIG_INTEL_WIDI u8 zero_array_check[L2SDTA_SERVICE_VE_LEN] = { 0x00 }; -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ - //DBG_871X("%s\n", __FUNCTION__); + /* DBG_871X("%s\n", __FUNCTION__); */ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -4361,7 +4324,7 @@ void issue_probersp_p2p(struct adapter *padapter, unsigned char *da) memcpy(pwlanhdr->addr1, da, ETH_ALEN); memcpy(pwlanhdr->addr2, mac, ETH_ALEN); - // Use the device address for BSSID field. + /* Use the device address for BSSID field. */ memcpy(pwlanhdr->addr3, mac, ETH_ALEN); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); @@ -4372,17 +4335,17 @@ void issue_probersp_p2p(struct 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 */ 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; @@ -4391,14 +4354,14 @@ void issue_probersp_p2p(struct 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 */ pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&pwdinfo->listen_channel, &pattrib->pktlen); #ifdef CONFIG_IOCTL_CFG80211 @@ -4406,62 +4369,62 @@ void issue_probersp_p2p(struct adapter *padapter, unsigned char *da) { if( pmlmepriv->wps_probe_resp_ie != NULL && pmlmepriv->p2p_probe_resp_ie != NULL ) { - //WPS IE + /* WPS IE */ 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 */ 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 || pmlmepriv->num_p2p_sdt != 0 ) { - //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; @@ -4470,47 +4433,47 @@ void issue_probersp_p2p(struct adapter *padapter, unsigned char *da) if( _rtw_memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == false ) { - // Vendor Extension + /* Vendor Extension */ 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: */ if (pwdinfo->external_uuid == 0) { memset( wpsie + wpsielen, 0x0, 16 ); memcpy( wpsie + wpsielen, myid( &padapter->eeprompriv ), ETH_ALEN ); @@ -4519,105 +4482,105 @@ void issue_probersp_p2p(struct adapter *padapter, unsigned char *da) } 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: */ 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: */ 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: */ 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) { 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; @@ -4633,7 +4596,7 @@ void issue_probersp_p2p(struct 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; @@ -4642,13 +4605,13 @@ void issue_probersp_p2p(struct 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 */ 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; @@ -4679,7 +4642,7 @@ static int _issue_probereq_p2p(struct 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); @@ -4689,7 +4652,7 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) goto exit; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -4710,13 +4673,13 @@ static int _issue_probereq_p2p(struct 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. */ memcpy(pwlanhdr->addr1, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); memcpy(pwlanhdr->addr3, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); } else { - // broadcast probe request frame + /* broadcast probe request frame */ memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); memcpy(pwlanhdr->addr3, bc_addr, ETH_ALEN); } @@ -4738,7 +4701,7 @@ static int _issue_probereq_p2p(struct 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 @@ -4746,54 +4709,54 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) { if( pmlmepriv->wps_probe_req_ie != NULL && pmlmepriv->p2p_probe_req_ie != NULL ) { - //WPS IE + /* WPS IE */ 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 */ 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: */ if (pwdinfo->external_uuid == 0) { memset( wpsie + wpsielen, 0x0, 16 ); memcpy( wpsie + wpsielen, myid( &padapter->eeprompriv ), ETH_ALEN ); @@ -4802,168 +4765,168 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) } 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: */ 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 */ } @@ -4971,7 +4934,7 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) if( pmlmepriv->wps_probe_req_ie != NULL ) { - //WPS IE + /* WPS IE */ 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; @@ -4990,13 +4953,13 @@ static int _issue_probereq_p2p(struct 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 */ 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; @@ -5059,7 +5022,7 @@ exit: return ret; } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ static s32 rtw_action_public_decache(union recv_frame *recv_frame, s32 token) { @@ -5110,7 +5073,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) u8 empty_addr[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; u8 *merged_p2pie = NULL; u32 merged_p2p_ielen = 0; -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); @@ -5127,15 +5090,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: { @@ -5149,20 +5112,20 @@ 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_871X( "[%s] Restore the previous p2p state to %d\n", __FUNCTION__, rtw_p2p_state(pwdinfo) ); } - // 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) ); memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN); @@ -5175,10 +5138,10 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) _cancel_timer_ex(&(padapter->mlmepriv.listen_timer)); 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. */ _set_timer( &pwdinfo->restore_p2p_state_timer, 5000 ); break; } @@ -5188,8 +5151,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); @@ -5200,16 +5163,16 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) { pwdinfo->p2p_info.operation_ch[ 0 ] = pwdinfo->peer_operating_ch; #ifdef P2P_OP_CHECK_SOCIAL_CH - pwdinfo->p2p_info.operation_ch[ 1 ] = 1; //Check whether GO is operating in channel 1; - pwdinfo->p2p_info.operation_ch[ 2 ] = 6; //Check whether GO is operating in channel 6; - pwdinfo->p2p_info.operation_ch[ 3 ] = 11; //Check whether GO is operating in channel 11; - #endif //P2P_OP_CHECK_SOCIAL_CH + pwdinfo->p2p_info.operation_ch[ 1 ] = 1; /* Check whether GO is operating in channel 1; */ + pwdinfo->p2p_info.operation_ch[ 2 ] = 6; /* Check whether GO is operating in channel 6; */ + pwdinfo->p2p_info.operation_ch[ 3 ] = 11; /* Check whether GO is operating in channel 11; */ + #endif /* P2P_OP_CHECK_SOCIAL_CH */ pwdinfo->p2p_info.scan_op_ch_only = 1; _set_timer( &pwdinfo->reset_ch_sitesurvey2, P2P_RESET_SCAN_CH ); } } - // 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)) @@ -5234,10 +5197,10 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) { pwdinfo->p2p_info.operation_ch[ 0 ] = pwdinfo->peer_operating_ch; #ifdef P2P_OP_CHECK_SOCIAL_CH - pwdinfo->p2p_info.operation_ch[ 1 ] = 1; //Check whether GO is operating in channel 1; - pwdinfo->p2p_info.operation_ch[ 2 ] = 6; //Check whether GO is operating in channel 6; - pwdinfo->p2p_info.operation_ch[ 3 ] = 11; //Check whether GO is operating in channel 11; - #endif //P2P_OP_CHECK_SOCIAL_CH + pwdinfo->p2p_info.operation_ch[ 1 ] = 1; /* Check whether GO is operating in channel 1; */ + pwdinfo->p2p_info.operation_ch[ 2 ] = 6; /* Check whether GO is operating in channel 6; */ + pwdinfo->p2p_info.operation_ch[ 3 ] = 11; /* Check whether GO is operating in channel 11; */ + #endif /* P2P_OP_CHECK_SOCIAL_CH */ pwdinfo->p2p_info.scan_op_ch_only = 1; _set_timer( &pwdinfo->reset_ch_sitesurvey2, P2P_RESET_SCAN_CH ); } @@ -5246,14 +5209,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_871X( "[%s] Got invite request frame!\n", __FUNCTION__ ); 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; @@ -5262,7 +5225,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) merged_p2p_ielen = rtw_get_p2p_merged_ies_len(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_); - merged_p2pie = rtw_zmalloc(merged_p2p_ielen + 2); // 2 is for EID and Length + merged_p2pie = rtw_zmalloc(merged_p2p_ielen + 2); /* 2 is for EID and Length */ if (merged_p2pie == NULL) { DBG_871X( "[%s] Malloc p2p ie fail\n", __FUNCTION__); @@ -5277,11 +5240,11 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) { rtw_get_p2p_attr_content( merged_p2pie, merged_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 ) { @@ -5293,7 +5256,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. */ memset( &group_id, 0x00, sizeof( struct group_id_info ) ); rtw_get_p2p_attr_content( merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_ID, ( u8* ) &group_id, &attr_contentlen); @@ -5301,14 +5264,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 }; @@ -5317,13 +5280,13 @@ 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]; #ifdef P2P_OP_CHECK_SOCIAL_CH - pwdinfo->rx_invitereq_info.operation_ch[1]= 1; //Check whether GO is operating in channel 1; - pwdinfo->rx_invitereq_info.operation_ch[2]= 6; //Check whether GO is operating in channel 6; - pwdinfo->rx_invitereq_info.operation_ch[3]= 11; //Check whether GO is operating in channel 11; - #endif //P2P_OP_CHECK_SOCIAL_CH + pwdinfo->rx_invitereq_info.operation_ch[1]= 1; /* Check whether GO is operating in channel 1; */ + pwdinfo->rx_invitereq_info.operation_ch[2]= 6; /* Check whether GO is operating in channel 6; */ + pwdinfo->rx_invitereq_info.operation_ch[3]= 11; /* Check whether GO is operating in channel 11; */ + #endif /* P2P_OP_CHECK_SOCIAL_CH */ pwdinfo->rx_invitereq_info.scan_op_ch_only = 1; _set_timer( &pwdinfo->reset_ch_sitesurvey, P2P_RESET_SCAN_CH ); rtw_p2p_set_state(pwdinfo, P2P_STATE_RECV_INVITE_REQ_MATCH ); @@ -5332,7 +5295,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; @@ -5341,9 +5304,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; @@ -5355,7 +5318,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) #ifdef CONFIG_INTEL_WIDI 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; } @@ -5369,7 +5332,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. */ memset( &group_id, 0x00, sizeof( struct group_id_info ) ); rtw_get_p2p_attr_content( merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_ID, ( u8* ) &group_id, &attr_contentlen); @@ -5377,18 +5340,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 */ 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 ); @@ -5421,7 +5384,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) _cancel_timer_ex(&(padapter->mlmepriv.listen_timer)); intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_STOP_WK, NULL); } -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ break; } case P2P_INVIT_RESP: @@ -5493,8 +5456,8 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) process_p2p_provdisc_req(pwdinfo, pframe, len); 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)); @@ -5507,15 +5470,15 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) _cancel_timer_ex(&(padapter->mlmepriv.listen_timer)); 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_871X( "[%s] Got Provisioning Discovery Response Frame\n", __FUNCTION__ ); - // 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); @@ -5524,7 +5487,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) } } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ exit: @@ -5619,19 +5582,19 @@ unsigned int OnAction_sa_query(struct adapter *padapter, union recv_frame *precv struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); unsigned short tid; - //Baron + /* Baron */ DBG_871X("OnAction_sa_query\n"); switch (pframe[WLAN_HDR_A3_LEN+1]) { - case 0: //SA Query req + case 0: /* SA Query req */ memcpy(&tid, &pframe[WLAN_HDR_A3_LEN+2], sizeof(unsigned short)); DBG_871X("OnAction_sa_query request,action=%d, tid=%04x\n", pframe[WLAN_HDR_A3_LEN+1], tid); issue_action_SA_Query(padapter, GetAddr2Ptr(pframe), 1, tid); break; - case 1: //SA Query rsp + case 1: /* SA Query rsp */ _cancel_timer_ex(&pmlmeext->sa_query_timer); DBG_871X("OnAction_sa_query response,action=%d, tid=%04x, cahcel timer\n", pframe[WLAN_HDR_A3_LEN+1], pframe[WLAN_HDR_A3_LEN+2]); break; @@ -5649,7 +5612,7 @@ unsigned int OnAction_sa_query(struct adapter *padapter, union recv_frame *precv return _SUCCESS; } -#endif //CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ unsigned int OnAction_wmm(struct adapter *padapter, union recv_frame *precv_frame) { @@ -5668,8 +5631,8 @@ unsigned int OnAction_p2p(struct adapter *padapter, union recv_frame *precv_fram DBG_871X("%s\n", __FUNCTION__); - //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)); @@ -5688,7 +5651,7 @@ unsigned int OnAction_p2p(struct adapter *padapter, union recv_frame *precv_fram return _SUCCESS; } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { len -= sizeof(struct rtw_ieee80211_hdr_3addr); OUI_Subtype = frame_body[5]; @@ -5719,7 +5682,7 @@ unsigned int OnAction_p2p(struct adapter *padapter, union recv_frame *precv_fram } } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ return _SUCCESS; @@ -5753,7 +5716,7 @@ unsigned int OnAction(struct adapter *padapter, union recv_frame *precv_frame) unsigned int DoReserved(struct adapter *padapter, union recv_frame *precv_frame) { - //DBG_871X("rcvd mgt frame(%x, %x)\n", (GetFrameSubType(pframe) >> 4), *(unsigned int *)GetAddr1Ptr(pframe)); + /* DBG_871X("rcvd mgt frame(%x, %x)\n", (GetFrameSubType(pframe) >> 4), *(unsigned int *)GetAddr1Ptr(pframe)); */ return _SUCCESS; } @@ -5829,9 +5792,9 @@ void update_mgntframe_attrib(struct adapter *padapter, struct pkt_attrib *pattri 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; @@ -5896,7 +5859,7 @@ s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmg { #ifdef CONFIG_XMIT_ACK s32 ret = _FAIL; - u32 timeout_ms = 500;// 500ms + u32 timeout_ms = 500;/* 500ms */ struct xmit_priv *pxmitpriv = &padapter->xmitpriv; if(padapter->bSurpriseRemoved == true || @@ -5919,11 +5882,11 @@ s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmg _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) @@ -5934,7 +5897,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_871X("%s hidden_ssid_mode:%u, ssid_ie:%p, ssid_len_ori:%d\n", __FUNCTION__, hidden_ssid_mode, ssid_ie, ssid_len_ori); + /* DBG_871X("%s hidden_ssid_mode:%u, ssid_ie:%p, ssid_len_ori:%d\n", __FUNCTION__, hidden_ssid_mode, ssid_ie, ssid_len_ori); */ if(ssid_ie && ssid_len_ori>0) { @@ -5976,17 +5939,17 @@ void issue_beacon(struct 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_871X("%s\n", __FUNCTION__); + /* DBG_871X("%s\n", __FUNCTION__); */ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { @@ -5995,9 +5958,9 @@ void issue_beacon(struct 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; @@ -6016,7 +5979,7 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) 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); @@ -6024,9 +5987,9 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) if( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) { - //DBG_871X("ie len=%d\n", cur_network->IELength); + /* DBG_871X("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); @@ -6055,7 +6018,7 @@ void issue_beacon(struct 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 */ memcpy(pframe, premainder_ie, remainder_ielen); pframe += remainder_ielen; pattrib->pktlen += remainder_ielen; @@ -6068,66 +6031,66 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) } } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { pframe_wscie = pframe + wps_offset; 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: */ 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 */ memcpy(pframe, premainder_ie, remainder_ielen); pframe += remainder_ielen; pattrib->pktlen += remainder_ielen; } } else -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ { int len_diff; memcpy(pframe, cur_network->IEs, cur_network->IELength); @@ -6167,7 +6130,7 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) memcpy(pframe, pmlmepriv->p2p_beacon_ie, len); } else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ { len = build_beacon_p2p_ie(pwdinfo, pframe); } @@ -6177,7 +6140,7 @@ void issue_beacon(struct 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 ); } @@ -6191,69 +6154,69 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) 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 */ 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 */ 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: @@ -6261,7 +6224,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) { @@ -6271,7 +6234,7 @@ _issue_bcn: pattrib->last_txcmdsz = pattrib->pktlen; - //DBG_871X("issue bcn_sz=%d\n", pattrib->last_txcmdsz); + /* DBG_871X("issue bcn_sz=%d\n", pattrib->last_txcmdsz); */ if(timeout_ms > 0) dump_mgntframe_and_wait(padapter, pmgntframe, timeout_ms); else @@ -6292,7 +6255,7 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p 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); @@ -6301,10 +6264,10 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p 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_871X("%s\n", __FUNCTION__); + /* DBG_871X("%s\n", __FUNCTION__); */ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { @@ -6313,7 +6276,7 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -6348,7 +6311,7 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p { 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; @@ -6364,7 +6327,7 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p 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) { memcpy(pframe, pmlmepriv->wps_probe_resp_ie, wps_ielen+2); @@ -6424,58 +6387,58 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p #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 */ 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 */ 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 */ } @@ -6486,13 +6449,13 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p #ifdef CONFIG_IOCTL_CFG80211 if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211 ) { - //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) 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); } @@ -6503,7 +6466,7 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p #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); } @@ -6517,13 +6480,13 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p 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; @@ -6559,7 +6522,7 @@ static int _issue_probereq(struct adapter *padapter, NDIS_802_11_SSID *pssid, u8 goto exit; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -6576,13 +6539,13 @@ static int _issue_probereq(struct adapter *padapter, NDIS_802_11_SSID *pssid, u8 if (da) { - // unicast probe request frame + /* unicast probe request frame */ memcpy(pwlanhdr->addr1, da, ETH_ALEN); memcpy(pwlanhdr->addr3, da, ETH_ALEN); } else { - // broadcast probe request frame + /* broadcast probe request frame */ memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); memcpy(pwlanhdr->addr3, bc_addr, ETH_ALEN); } @@ -6613,13 +6576,12 @@ static int _issue_probereq(struct adapter *padapter, NDIS_802_11_SSID *pssid, u8 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) { 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; @@ -6684,7 +6646,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(struct adapter *padapter, struct sta_info *psta, unsigned short status) { struct xmit_frame *pmgntframe; @@ -6704,7 +6666,7 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short if (pmgntframe == NULL) return; - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -6724,14 +6686,14 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); - if(psta) { // for AP mode + if(psta) { /* for AP mode */ #ifdef CONFIG_NATIVEAP_MLME memcpy(pwlanhdr->addr1, psta->hwaddr, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); 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 +6707,17 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short } 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)); #endif @@ -6766,7 +6728,7 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short memcpy(pwlanhdr->addr2, myid(&padapter->eeprompriv), ETH_ALEN); memcpy(pwlanhdr->addr3, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); - // setting auth algo number + /* setting auth algo number */ val16 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared) ? 1 : 0;/* 0:OPEN System, 1:Shared key */ if (val16) use_shared_key = 1; @@ -6791,7 +6753,7 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short 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)); @@ -6836,9 +6798,9 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i 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_871X("%s\n", __FUNCTION__); @@ -6897,8 +6859,8 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i 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) { memcpy(pframe, pbuf, ie_len+2); @@ -6906,8 +6868,8 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i 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) { memcpy(pframe, pbuf, ie_len+2); @@ -6918,7 +6880,7 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i } #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}; @@ -6941,7 +6903,7 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i 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) { memcpy(pframe, pmlmepriv->wps_assoc_resp_ie, pmlmepriv->wps_assoc_resp_ie_len); @@ -6964,15 +6926,15 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i 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; @@ -7005,17 +6967,17 @@ void issue_assocreq(struct 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); @@ -7038,7 +7000,7 @@ void issue_assocreq(struct adapter *padapter) pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); - //caps + /* caps */ #ifdef CONFIG_DFS memcpy(&cap, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); @@ -7046,35 +7008,35 @@ void issue_assocreq(struct adapter *padapter) memcpy(pframe, &cap, 2); #else 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 */ val16 = cpu_to_le16(3); memcpy(pframe ,(unsigned char *)&val16, 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 */ get_rate_set(padapter, sta_bssrate, &sta_bssrate_len); - //DBG_871X("sta_bssrate_len=%d\n", sta_bssrate_len); + /* DBG_871X("sta_bssrate_len=%d\n", 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 < sta_bssrate_len; i++) { - // DBG_871X("sta_bssrate[%d]=%02X\n", i, sta_bssrate[i]); - //} + /* for (i = 0; i < sta_bssrate_len; i++) { */ + /* DBG_871X("sta_bssrate[%d]=%02X\n", i, sta_bssrate[i]); */ + /* */ for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) { if (pmlmeinfo->network.SupportedRates[i] == 0) break; @@ -7086,23 +7048,23 @@ void issue_assocreq(struct 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)) { - //DBG_871X("match i = %d, j=%d\n", i, j); + /* DBG_871X("match i = %d, j=%d\n", i, j); */ break; } else { - //DBG_871X("not match: %02X != %02X\n", (pmlmeinfo->network.SupportedRates[i]|IEEE80211_BASIC_RATE_MASK), (sta_bssrate[j]|IEEE80211_BASIC_RATE_MASK)); + /* DBG_871X("not match: %02X != %02X\n", (pmlmeinfo->network.SupportedRates[i]|IEEE80211_BASIC_RATE_MASK), (sta_bssrate[j]|IEEE80211_BASIC_RATE_MASK)); */ } } if (j == sta_bssrate_len) { - // the rate is not supported by STA + /* the rate is not supported by STA */ DBG_871X("%s(): the rate[%d]=%02X is not supported by STA!\n",__FUNCTION__, i, pmlmeinfo->network.SupportedRates[i]); } else { - // the rate is supported by STA + /* the rate is supported by STA */ bssrate[index++] = pmlmeinfo->network.SupportedRates[i]; } } @@ -7113,7 +7075,7 @@ void issue_assocreq(struct adapter *padapter) 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 */ } @@ -7124,60 +7086,60 @@ void issue_assocreq(struct 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 && (!is_ap_in_tkip(padapter))) { 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 (pregpriv->rf_config) + /* switch (pregpriv->rf_config) */ 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 */ 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_871X("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)) memcpy(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_rate_2R_MCS13TO15_OFF, 16); else memcpy(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_rate_2R, 16); - #else //CONFIG_DISABLE_MCS13TO15 + #else /* CONFIG_DISABLE_MCS13TO15 */ 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 */ memcpy(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_rate_1R, 16); } @@ -7186,9 +7148,9 @@ void issue_assocreq(struct adapter *padapter) #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; -// pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para |= MAX_AMPDU_FACTOR_8K +/* pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para |= MAX_AMPDU_FACTOR_8K */ } #endif @@ -7198,7 +7160,7 @@ void issue_assocreq(struct 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); @@ -7212,9 +7174,9 @@ void issue_assocreq(struct adapter *padapter) { 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; } @@ -7254,79 +7216,79 @@ void issue_assocreq(struct adapter *padapter) } } 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 */ 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 ) ) { @@ -7339,68 +7301,68 @@ void issue_assocreq(struct 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: */ 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: - memcpy( p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN ); // P2P Device Address + /* Value: */ + 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 */ - memcpy( p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN ); // P2P Interface Address List + 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; @@ -7409,13 +7371,13 @@ void issue_assocreq(struct 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 */ 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); @@ -7431,7 +7393,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(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int wait_ack) { int ret = _FAIL; @@ -7444,7 +7406,7 @@ static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned struct mlme_ext_priv *pmlmeext; struct mlme_ext_info *pmlmeinfo; - //DBG_871X("%s:%d\n", __FUNCTION__, power_mode); + /* DBG_871X("%s:%d\n", __FUNCTION__, power_mode); */ if(!padapter) goto exit; @@ -7458,7 +7420,7 @@ static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned goto exit; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); pattrib->retry_ctrl = false; @@ -7513,8 +7475,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(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms) { int ret; @@ -7562,7 +7524,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(struct adapter *padapter, unsigned char *da, u16 tid, int wait_ack) { int ret = _FAIL; @@ -7583,7 +7545,7 @@ static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 goto exit; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -7648,8 +7610,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(struct adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms) { int ret; @@ -7711,9 +7673,9 @@ static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned s __le16 le_tmp; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ - //DBG_871X("%s to "MAC_FMT"\n", __func__, MAC_ARG(da)); + /* DBG_871X("%s to "MAC_FMT"\n", __func__, MAC_ARG(da)); */ #ifdef CONFIG_P2P if ( !( rtw_p2p_chk_state( pwdinfo, P2P_STATE_NONE ) ) && ( pwdinfo->rx_invitereq_info.scan_op_ch_only ) ) @@ -7721,14 +7683,14 @@ static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned s _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; @@ -7841,7 +7803,7 @@ void issue_action_spct_ch_switch(struct adapter *padapter, u8 *ra, u8 new_ch, u8 if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) return; - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -7910,7 +7872,7 @@ void issue_action_SA_Query(struct adapter *padapter, unsigned char *raddr, unsig return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -7941,14 +7903,14 @@ void issue_action_SA_Query(struct adapter *padapter, unsigned char *raddr, unsig switch (action) { - case 0: //SA Query req + case 0: /* SA Query req */ pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&pmlmeext->sa_query_seq, &pattrib->pktlen); pmlmeext->sa_query_seq++; - //send sa query request to AP, AP should reply sa query response in 1 second + /* send sa query request to AP, AP should reply sa query response in 1 second */ set_sa_query_timer(pmlmeext, 1000); break; - case 1: //SA Query rsp + case 1: /* SA Query rsp */ tid = cpu_to_le16(tid); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&tid, &pattrib->pktlen); break; @@ -7960,7 +7922,7 @@ void issue_action_SA_Query(struct adapter *padapter, unsigned char *raddr, unsig dump_mgntframe(padapter, pmgntframe); } -#endif //CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned char action, u16 status) @@ -7996,7 +7958,7 @@ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr, return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -8008,7 +7970,7 @@ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr, fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; - //memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + /* memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); */ memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); @@ -8025,7 +7987,7 @@ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr, if (category == 3) { switch (action) { - case 0: //ADDBA req + case 0: /* ADDBA req */ do { pmlmeinfo->dialogToken++; } while (pmlmeinfo->dialogToken == 0); @@ -8035,29 +7997,27 @@ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr, if ((BT_1Ant(padapter) == true) && ((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 { - BA_para_set = (0x1002 | ((status & 0xf) << 2)); //immediate ack & 64 buffer size + BA_para_set = (0x1002 | ((status & 0xf) << 2)); /* immediate ack & 64 buffer size */ } - //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; @@ -8072,47 +8032,47 @@ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr, 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 = ((le16_to_cpu(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 = ((le16_to_cpu(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 = ((le16_to_cpu(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 = ((le16_to_cpu(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 = ((le16_to_cpu(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 + if(pregpriv->ampdu_amsdu==0)/* disabled */ le_tmp = cpu_to_le16(BA_para_set & ~BIT(0)); - else if(pregpriv->ampdu_amsdu==1)//enabled + else if(pregpriv->ampdu_amsdu==1)/* enabled */ le_tmp = cpu_to_le16(BA_para_set | BIT(0)); - else //auto + else /* auto */ 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; @@ -8124,7 +8084,7 @@ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr, pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ } static void issue_action_BSSCoexistPacket(struct adapter *padapter) @@ -8164,7 +8124,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) return; } - //update attribute + /* update attribute */ pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); @@ -8191,19 +8151,19 @@ static void issue_action_BSSCoexistPacket(struct 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)); } - // + /* */ memset(ICS, 0, sizeof(ICS)); if(pmlmepriv->num_sta_no_ht>0) { @@ -8230,7 +8190,7 @@ static void issue_action_BSSCoexistPacket(struct 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; @@ -8253,7 +8213,7 @@ static void issue_action_BSSCoexistPacket(struct 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++) @@ -8262,8 +8222,8 @@ static void issue_action_BSSCoexistPacket(struct 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++; } } @@ -8282,14 +8242,14 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ } unsigned int send_delba(struct 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; @@ -8302,9 +8262,9 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr) if(psta==NULL) return _SUCCESS; - //DBG_871X("%s:%s\n", __FUNCTION__, (initiator==0)?"RX_DIR":"TX_DIR"); + /* DBG_871X("%s:%s\n", __FUNCTION__, (initiator==0)?"RX_DIR":"TX_DIR"); */ - if(initiator==0) // recipient + if(initiator==0) /* recipient */ { for(tid = 0;tidhtpriv.agg_enable_bitmap); + /* DBG_871X("tx agg_enable_bitmap(0x%08x)\n", psta->htpriv.agg_enable_bitmap); */ for(tid = 0;tidhtpriv.agg_enable_bitmap & BIT(tid)) @@ -8338,7 +8298,7 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr) } } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ } return _SUCCESS; @@ -8381,8 +8341,8 @@ unsigned int send_beacon(struct adapter *padapter) if(passing_time > 100 || issue > 3) DBG_871X("%s success, issue:%d, poll:%d, %u ms\n", __FUNCTION__, issue, poll, rtw_get_passing_time_ms(start)); - //else - // DBG_871X("%s success, issue:%d, poll:%d, %u ms\n", __FUNCTION__, issue, poll, rtw_get_passing_time_ms(start)); + /* else */ + /* DBG_871X("%s success, issue:%d, poll:%d, %u ms\n", __FUNCTION__, issue, poll, rtw_get_passing_time_ms(start)); */ return _SUCCESS; } @@ -8436,8 +8396,8 @@ void site_survey(struct 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); @@ -8447,7 +8407,7 @@ void site_survey(struct 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) { @@ -8473,10 +8433,10 @@ void site_survey(struct 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)); */ if(pmlmeext->sitesurvey_res.channel_idx == 0) { #ifdef DBG_FIXED_CHAN @@ -8499,7 +8459,7 @@ void site_survey(struct 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) && @@ -8510,12 +8470,12 @@ void site_survey(struct 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) || @@ -8527,22 +8487,22 @@ void site_survey(struct 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); } } @@ -8552,7 +8512,7 @@ void site_survey(struct adapter *padapter) if( !rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) && !rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH) ) - #endif//CONFIG_P2P + #endif/* CONFIG_P2P */ { if(ScanType == SCAN_ACTIVE){ if( check_fwstate(pmlmepriv, _FW_LINKED) == true){ @@ -8565,29 +8525,29 @@ void site_survey(struct adapter *padapter) set_survey_timer(pmlmeext, 40); } } - else{//SCAN_PASSIVE + else{/* SCAN_PASSIVE */ set_survey_timer(pmlmeext, pmlmeext->chan_scan_time); } } else -#endif //CONFIG_ATMEL_RC_PATCH +#endif /* CONFIG_ATMEL_RC_PATCH */ { #ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE 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_P2P if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) { 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 @@ -8597,31 +8557,31 @@ void site_survey(struct 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; @@ -8636,12 +8596,12 @@ void site_survey(struct adapter *padapter) if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo)); 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); */ { if( pwdinfo->driver_interface == DRIVER_WEXT ) @@ -8659,22 +8619,22 @@ void site_survey(struct adapter *padapter) } } - //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) issue_nulldata(padapter, NULL, 0, 3, 500); - val8 = 0; //survey done + val8 = 0; /* survey done */ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); report_surveydone_event(padapter); @@ -8692,7 +8652,7 @@ void site_survey(struct adapter *padapter) return; } -//collect bss info from Beacon and Probe request/response frames. +/* collect bss info from Beacon and Probe request/response frames. */ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLAN_BSSID_EX *bssid) { int i; @@ -8711,7 +8671,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLA if (len > MAX_IE_SZ) { - //DBG_871X("IE too long for survey event\n"); + /* DBG_871X("IE too long for survey event\n"); */ return _FAIL; } @@ -8723,7 +8683,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLA bssid->Reserved[0] = 1; ie_offset = _BEACON_IE_OFFSET_; } else { - // FIXME : more type + /* FIXME : more type */ if (subtype == WIFI_PROBERSP) { ie_offset = _PROBERSP_IE_OFFSET_; bssid->Reserved[0] = 3; @@ -8738,21 +8698,20 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLA 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; 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_871X("marc: cannot find SSID for survey event\n"); @@ -8776,7 +8735,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLA 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) @@ -8801,7 +8760,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLA memcpy(bssid->SupportedRates + i, (p + 2), len); } - //todo: + /* todo: */ bssid->NetworkTypeInUse = Ndis802_11OFDM24; if (bssid->IELength < 12) @@ -8811,7 +8770,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLA if (subtype == WIFI_PROBEREQ) { u8 *p2p_ie; u32 p2p_ielen; - // Set Listion Channel + /* Set Listion Channel */ if ((p2p_ie = rtw_get_p2p_ie(bssid->IEs, bssid->IELength, NULL, &p2p_ielen))) { u32 attr_contentlen = 0; u8 listen_ch[5] = { 0x00 }; @@ -8819,20 +8778,20 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLA rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_LISTEN_CH, listen_ch, &attr_contentlen); bssid->Configuration.DSConfig = listen_ch[4]; } - else { // use current channel + else { /* use current channel */ bssid->Configuration.DSConfig = rtw_get_oper_ch(padapter); DBG_871X("%s()-%d: Cannot get p2p_ie. set DSconfig to op_ch(%d)\n", __FUNCTION__, __LINE__, bssid->Configuration.DSConfig); } - // FIXME + /* FIXME */ bssid->InfrastructureMode = Ndis802_11Infrastructure; memcpy(bssid->MacAddress, GetAddr2Ptr(pframe), ETH_ALEN); bssid->Privacy = 1; return _SUCCESS; } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ - // 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; @@ -8843,8 +8802,8 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLA 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) { @@ -8852,7 +8811,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLA bssid->Configuration.DSConfig = HT_info->primary_channel; } else - { // use current channel + { /* use current channel */ bssid->Configuration.DSConfig = rtw_get_oper_ch(padapter); } } @@ -8877,7 +8836,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLA 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; @@ -8892,17 +8851,17 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLA } 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_SSID_MONITORED) & 1 if(strcmp(bssid->Ssid.Ssid, DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) == 0) { @@ -8914,7 +8873,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, WLA } #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; @@ -8934,30 +8893,28 @@ void start_create_ibss(struct 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")); @@ -8981,7 +8938,7 @@ void start_create_ibss(struct adapter* padapter) DBG_871X("start_create_ibss, invalid cap:%x\n", caps); return; } - //update bc/mc sta_info + /* update bc/mc sta_info */ update_bmc_sta(padapter); } @@ -8995,10 +8952,10 @@ void start_clnt_join(struct adapter* padapter) WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); int beacon_timeout; - //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) @@ -9010,19 +8967,19 @@ void start_clnt_join(struct 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)); #ifdef CONFIG_DEAUTH_BEFORE_CONNECT - // 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 */ - // 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. */ { #ifdef CONFIG_P2P _queue *queue = &(padapter->mlmepriv.scanned_queue); @@ -9059,8 +9016,8 @@ void start_clnt_join(struct adapter* padapter) } #endif /* CONFIG_DEAUTH_BEFORE_CONNECT */ - //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, @@ -9068,15 +9025,15 @@ void start_clnt_join(struct adapter* padapter) pmlmeinfo->state = WIFI_FW_AUTH_NULL | WIFI_FW_STATION_STATE; - {//only for STA mode + {/* only for STA mode */ u16 media_status; u8 mac_id = 0; - media_status = (mac_id<<8)|1; // MACID|OPMODE:1 connect + media_status = (mac_id<<8)|1; /* MACID|OPMODE:1 connect */ rtw_hal_set_hwreg(padapter,HW_VAR_H2C_MEDIA_STATUS_RPT,(u8 *)&media_status); } } - else if (caps&cap_IBSS) //adhoc client + else if (caps&cap_IBSS) /* adhoc client */ { Set_MSR(padapter, WIFI_FW_ADHOC_STATE); @@ -9091,7 +9048,7 @@ void start_clnt_join(struct adapter* padapter) } else { - //DBG_871X("marc: invalid cap:%x\n", caps); + /* DBG_871X("marc: invalid cap:%x\n", caps); */ return; } @@ -9142,7 +9099,7 @@ unsigned int receive_disconnect(struct adapter *padapter, unsigned char *MacAddr 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; @@ -9179,7 +9136,7 @@ static void process_80211d(struct adapter *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)) { @@ -9188,8 +9145,8 @@ static void process_80211d(struct adapter *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_); @@ -9215,8 +9172,8 @@ static void process_80211d(struct adapter *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; } @@ -9272,7 +9229,7 @@ static void process_80211d(struct adapter *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++; @@ -9286,19 +9243,19 @@ static void process_80211d(struct adapter *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]; @@ -9309,7 +9266,7 @@ static void process_80211d(struct adapter *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)) @@ -9320,7 +9277,7 @@ static void process_80211d(struct adapter *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++; @@ -9348,7 +9305,7 @@ static void process_80211d(struct adapter *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++; @@ -9362,17 +9319,17 @@ static void process_80211d(struct adapter *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]; @@ -9383,7 +9340,7 @@ static void process_80211d(struct adapter *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; @@ -9407,7 +9364,7 @@ static void process_80211d(struct adapter *padapter, WLAN_BSSID_EX *bssid) #endif } - // 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; @@ -9417,7 +9374,7 @@ static void process_80211d(struct adapter *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; @@ -9448,8 +9405,8 @@ void report_survey_event(struct 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; @@ -9717,18 +9674,18 @@ Following are the event callback functions *****************************************************************************/ -//for sta/adhoc mode +/* for sta/adhoc mode */ void update_sta_info(struct 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; @@ -9742,7 +9699,7 @@ void update_sta_info(struct adapter *padapter, struct sta_info *psta) } else -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ { #ifdef CONFIG_80211N_HT psta->htpriv.ht_option = false; @@ -9750,7 +9707,7 @@ void update_sta_info(struct 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; } @@ -9758,11 +9715,11 @@ void update_sta_info(struct 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; @@ -9789,11 +9746,11 @@ void mlmeext_joinbss_event_callback(struct 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); - if (psta){//only for STA mode - media_status = (psta->mac_id<<8)|0; // MACID|OPMODE:1 connect + if (psta){/* only for STA mode */ + media_status = (psta->mac_id<<8)|0; /* MACID|OPMODE:1 connect */ rtw_hal_set_hwreg(padapter,HW_VAR_H2C_MEDIA_STATUS_RPT,(u8 *)&media_status); } @@ -9802,7 +9759,7 @@ void mlmeext_joinbss_event_callback(struct 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) { @@ -9810,43 +9767,43 @@ void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res) update_bmc_sta_support_rate(padapter, psta_bmc->mac_id); Update_RA_Entry(padapter, psta_bmc); } - //update bc/mc sta_info + /* update bc/mc sta_info */ update_bmc_sta(padapter); } - //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); set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); - if (psta) //only for infra. mode + if (psta) /* only for infra. mode */ { pmlmeinfo->FW_sta_info[psta->mac_id].psta = psta; - //DBG_871X("set_sta_rate\n"); + /* DBG_871X("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); rtw_sta_media_status_rpt(padapter, psta, 1); @@ -9857,10 +9814,10 @@ void mlmeext_joinbss_event_callback(struct 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 @@ -9882,19 +9839,19 @@ void mlmeext_sta_add_event_callback(struct adapter *padapter, struct sta_info *p 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; @@ -9914,10 +9871,10 @@ void mlmeext_sta_add_event_callback(struct adapter *padapter, struct sta_info *p pmlmeinfo->FW_sta_info[psta->mac_id].psta = psta; - //rate radaptive + /* rate radaptive */ Update_RA_Entry(padapter, psta); - //update adhoc sta_info + /* update adhoc sta_info */ update_sta_info(padapter, psta); } @@ -9929,26 +9886,26 @@ void mlmeext_sta_del_event_callback(struct 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); - //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); 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); @@ -10043,7 +10000,7 @@ void linked_status_chk(struct 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; @@ -10056,13 +10013,13 @@ void linked_status_chk(struct adapter *padapter) rx_chk_limit = 8; #endif - // Marked by Kurt 20130715 - // For WiDi 3.5 and latered on, they don't ask WiDi sink to do roaming, so we could not check rx limit that strictly. - // todo: To check why we under miracast session, rx_chk would be false - //#ifdef CONFIG_INTEL_WIDI - //if (padapter->mlmepriv.widi_state != INTEL_WIDI_STATE_NONE) - // rx_chk_limit = 1; - //#endif + /* Marked by Kurt 20130715 */ + /* For WiDi 3.5 and latered on, they don't ask WiDi sink to do roaming, so we could not check rx limit that strictly. */ + /* todo: To check why we under miracast session, rx_chk would be false */ + /* ifdef CONFIG_INTEL_WIDI */ + /* if (padapter->mlmepriv.widi_state != INTEL_WIDI_STATE_NONE) */ + /* rx_chk_limit = 1; */ + /* endif */ if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress)) != NULL) { @@ -10144,12 +10101,12 @@ void linked_status_chk(struct 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) @@ -10170,7 +10127,7 @@ void linked_status_chk(struct 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 */ ); } } @@ -10182,7 +10139,7 @@ void linked_status_chk(struct adapter *padapter) } } - //set_link_timer(pmlmeext, DISCONNECT_TO); + /* set_link_timer(pmlmeext, DISCONNECT_TO); */ } @@ -10198,14 +10155,14 @@ void survey_timer_hdl(struct adapter *padapter) struct wifidirect_info *pwdinfo= &(padapter->wdinfo); #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++; } @@ -10230,7 +10187,7 @@ void survey_timer_hdl(struct adapter *padapter) ); } - pmlmeext->scan_abort = false;//reset + pmlmeext->scan_abort = false;/* reset */ } if ((ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) @@ -10255,12 +10212,12 @@ exit_survey_timer_hdl: void link_timer_hdl(struct 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; */ if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) { @@ -10270,20 +10227,20 @@ void link_timer_hdl(struct 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_871X("link_timer_hdl: auth timeout and try again\n"); @@ -10293,7 +10250,7 @@ void link_timer_hdl(struct 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; @@ -10324,7 +10281,7 @@ void addba_timer_hdl(struct sta_info *psta) phtpriv->candidate_tid_bitmap=0x0; } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ } #ifdef CONFIG_IEEE80211W @@ -10333,7 +10290,7 @@ void sa_query_timer_hdl(struct adapter *padapter) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_priv * pmlmepriv = &padapter->mlmepriv; _irqL irqL; - //disconnect + /* disconnect */ _enter_critical_bh(&pmlmepriv->lock, &irqL); if (check_fwstate(pmlmepriv, _FW_LINKED) == true) @@ -10346,7 +10303,7 @@ void sa_query_timer_hdl(struct adapter *padapter) _exit_critical_bh(&pmlmepriv->lock, &irqL); DBG_871X("SA query timeout disconnect\n"); } -#endif //CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ u8 NULL_hdl(struct adapter *padapter, u8 *pbuf) { @@ -10365,13 +10322,13 @@ u8 setopmode_hdl(struct 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) @@ -10384,7 +10341,7 @@ u8 setopmode_hdl(struct 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; @@ -10396,7 +10353,7 @@ u8 createbss_hdl(struct 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) @@ -10405,13 +10362,13 @@ u8 createbss_hdl(struct 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); @@ -10426,24 +10383,24 @@ u8 createbss_hdl(struct 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); 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; memcpy(pnetwork->IEs, ((WLAN_BSSID_EX *)pbuf)->IEs, pnetwork->IELength); @@ -10466,13 +10423,13 @@ u8 join_cmd_hdl(struct 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; */ u8 ch, bw, offset; - //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) @@ -10482,13 +10439,13 @@ u8 join_cmd_hdl(struct 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_); @@ -10515,12 +10472,12 @@ u8 join_cmd_hdl(struct 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; */ 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; memcpy(pnetwork->IEs, ((WLAN_BSSID_EX *)pbuf)->IEs, pnetwork->IELength); @@ -10528,8 +10485,8 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf) pmlmeext->cur_channel = (u8)pnetwork->Configuration.DSConfig; pmlmeinfo->bcn_interval = get_beacon_interval(pnetwork); - //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;) { @@ -10537,28 +10494,28 @@ u8 join_cmd_hdl(struct 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) { @@ -10579,7 +10536,7 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf) DBG_871X("set ch/bw before connected\n"); } } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ break; default: @@ -10595,12 +10552,12 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf) return H2C_SUCCESS; } - //disable dynamic functions, such as high power, DIG - //Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false); + /* disable dynamic functions, such as high power, DIG */ + /* 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)); */ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress); join_type = 0; @@ -10608,7 +10565,7 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf) set_channel_bwmode(padapter, ch, offset, bw); - //cancel link timer + /* cancel link timer */ _cancel_timer_ex(&pmlmeext->link_timer); start_clnt_join(padapter); @@ -10630,31 +10587,31 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf) issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms/100, 100); } - //set_opmode_cmd(padapter, infra_client_with_mlme); + /* set_opmode_cmd(padapter, infra_client_with_mlme); */ - //pmlmeinfo->state = WIFI_FW_NULL_STATE; + /* pmlmeinfo->state = WIFI_FW_NULL_STATE; */ 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; - //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; @@ -10712,7 +10669,7 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c } } - if (padapter->setband == GHZ_24) { // 2.4G + if (padapter->setband == GHZ_24) { /* 2.4G */ for (i=0; i < j ; i++) { if (out[i].hw_value > 35) memset(&out[i], 0 , sizeof(struct rtw_ieee80211_channel)); @@ -10720,7 +10677,7 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c scan_ch_num++; } j = scan_ch_num; - } else if (padapter->setband == GHZ_50) { // 5G + } else if (padapter->setband == GHZ_50) { /* 5G */ for (i=0; i < j ; i++) { if (out[i].hw_value > 35) { memcpy(&out[scan_ch_num++], &out[i], sizeof(struct rtw_ieee80211_channel)); @@ -10768,7 +10725,7 @@ u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf) pmlmeext->sitesurvey_res.scan_mode = pparm->scan_mode; - //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 +10741,7 @@ u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf) } if(bdelayscan) { - //delay 50ms to protect nulldata(1). + /* delay 50ms to protect nulldata(1). */ set_survey_timer(pmlmeext, 50); return H2C_SUCCESS; } @@ -10792,29 +10749,29 @@ u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf) if ((pmlmeext->sitesurvey_res.state == SCAN_START) || (pmlmeext->sitesurvey_res.state == SCAN_TXNULL)) { - //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_P2P #ifdef CONFIG_IOCTL_CFG80211 if((wdev_to_priv(padapter->rtw_wdev))->p2p_enabled == true && pwdinfo->driver_interface == DRIVER_CFG80211 ) initialgain = 0x30; else -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ if ( !rtw_p2p_chk_state( pwdinfo, P2P_STATE_NONE ) ) initialgain = 0x28; else -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ initialgain = 0x1e; 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; @@ -10848,18 +10805,18 @@ u8 setkey_hdl(struct 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_871X_LEVEL(_drv_always_, "set group key to hw: alg:%d(WEP40-1 WEP104-5 TKIP-2 AES-4) " "keyid:%d\n", pparm->algorithm, pparm->keyid); write_cam(padapter, pparm->keyid, ctrl, null_sta, pparm->key); - //allow multicast packets to driver + /* allow multicast packets to driver */ padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_ON_RCR_AM, null_addr); return H2C_SUCCESS; @@ -10868,7 +10825,7 @@ u8 setkey_hdl(struct adapter *padapter, u8 *pbuf) u8 set_stakey_hdl(struct 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; @@ -10876,20 +10833,20 @@ u8 set_stakey_hdl(struct 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 */ cam_id = 4; @@ -10901,7 +10858,7 @@ u8 set_stakey_hdl(struct 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; @@ -10920,7 +10877,7 @@ u8 set_stakey_hdl(struct 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_871X("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], @@ -10939,9 +10896,9 @@ u8 set_stakey_hdl(struct 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; @@ -10957,12 +10914,12 @@ u8 set_stakey_hdl(struct 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; @@ -10985,12 +10942,12 @@ u8 add_ba_hdl(struct 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, 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 @@ -11000,15 +10957,15 @@ u8 add_ba_hdl(struct adapter *padapter, unsigned char *pbuf) { issue_action_BA(padapter, pparm->addr, RTW_WLAN_ACTION_ADDBA_REQ, 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; } @@ -11074,7 +11031,7 @@ u8 mlme_evt_hdl(struct 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))); @@ -11085,14 +11042,14 @@ u8 mlme_evt_hdl(struct 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)) { @@ -11139,7 +11096,7 @@ u8 tx_beacon_hdl(struct 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; @@ -11148,14 +11105,14 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf) struct xmit_priv *pxmitpriv = &padapter->xmitpriv; 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; if((pstapriv->tim_bitmap&BIT(0)) && (psta_bmc->sleepq_len>0)) { - rtw_msleep_os(10);// 10ms, ATIM(HIQ) Windows + rtw_msleep_os(10);/* 10ms, ATIM(HIQ) Windows */ _enter_critical_bh(&pxmitpriv->lock, &irqL); xmitframe_phead = get_list_head(&psta_bmc->sleep_q); @@ -11177,7 +11134,7 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf) pxmitframe->attrib.triggered=1; - pxmitframe->attrib.qsel = 0x11;//HIQ + pxmitframe->attrib.qsel = 0x11;/* HIQ */ rtw_hal_xmitframe_enqueue(padapter, pxmitframe); } @@ -11365,23 +11322,23 @@ u8 set_csa_hdl(struct 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(struct adapter *padapter, unsigned char *pbuf) { #ifdef CONFIG_TDLS @@ -11407,18 +11364,18 @@ u8 tdls_hdl(struct adapter *padapter, unsigned char *pbuf) return H2C_REJECTED; } - //_enter_critical_bh(&(ptdlsinfo->hdl_lock), &irqL); + /* _enter_critical_bh(&(ptdlsinfo->hdl_lock), &irqL); */ DBG_871X("[%s] option:%d\n", __FUNCTION__, 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_871X("TDLS with "MAC_FMT"\n", MAC_ARG(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: @@ -11473,7 +11430,7 @@ u8 tdls_hdl(struct 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; @@ -11536,11 +11493,11 @@ u8 tdls_hdl(struct 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_p2p.c b/core/rtw_p2p.c index 240f189..95e2278 100755 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -67,7 +67,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); @@ -81,18 +81,18 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) pcur++; - //P2P device address + /* P2P device address */ memcpy(pcur, psta->dev_addr, ETH_ALEN); pcur += ETH_ALEN; - //P2P interface address + /* P2P interface address */ 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; @@ -107,11 +107,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; @@ -126,7 +126,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) attr_len += tmplen; - //pstart += tmplen; + /* pstart += tmplen; */ pstart = pcur; } @@ -156,7 +156,7 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da) struct 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; @@ -168,7 +168,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); @@ -191,13 +191,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; @@ -229,7 +229,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); @@ -252,7 +252,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)); @@ -260,15 +260,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); @@ -284,14 +284,14 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8* raddr, struct 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; @@ -308,7 +308,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); @@ -338,24 +338,24 @@ 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 - //*(u32*) ( wpsie ) = cpu_to_be32( WPSOUI ); + /* WPS OUI */ + /* u32*) ( wpsie ) = cpu_to_be32( WPSOUI ); */ RTW_PUT_BE32(wpsie, WPSOUI); wpsielen += 4; - // Config Method - // Type: - //*(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_CONF_METHOD ); + /* Config Method */ + /* Type: */ + /* u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_CONF_METHOD ); */ RTW_PUT_BE16(wpsie + wpsielen, WPS_ATTR_CONF_METHOD); wpsielen += 2; - // Length: - //*(u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0002 ); + /* Length: */ + /* u16*) ( wpsie + wpsielen ) = cpu_to_be16( 0x0002 ); */ RTW_PUT_BE16(wpsie + wpsielen, 0x0002); wpsielen += 2; - // Value: - //*(u16*) ( wpsie + wpsielen ) = cpu_to_be16( config_method ); + /* Value: */ + /* u16*) ( wpsie + wpsielen ) = cpu_to_be16( config_method ); */ RTW_PUT_BE16(wpsie + wpsielen, config_method); wpsielen += 2; @@ -365,7 +365,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; @@ -385,7 +385,7 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 struct 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 }; @@ -399,7 +399,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); @@ -422,29 +422,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); @@ -466,27 +466,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)) @@ -496,7 +496,7 @@ u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) 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); pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len); return len; @@ -511,77 +511,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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -593,20 +593,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; @@ -628,35 +628,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 | @@ -664,7 +664,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 ); @@ -672,29 +672,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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -706,20 +706,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; @@ -741,33 +741,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 ) { @@ -777,12 +777,12 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel { if ( pwdinfo->wfd_tdls_enable ) { - // TDLS mode + WSD ( WFD Service Discovery ) + /* TDLS mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_PC_TDLS | WFD_DEVINFO_HDCP_SUPPORT); } else { - // WiFi Direct mode + WSD ( WFD Service Discovery ) + /* WiFi Direct mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_HDCP_SUPPORT); } } @@ -790,12 +790,12 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel { if ( pwdinfo->wfd_tdls_enable ) { - // available for WFD session + TDLS mode + WSD ( WFD Service Discovery ) + /* available for WFD session + TDLS mode + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD | WFD_DEVINFO_PC_TDLS | WFD_DEVINFO_HDCP_SUPPORT); } else { - // available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* 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 | WFD_DEVINFO_HDCP_SUPPORT); } } @@ -804,13 +804,13 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel { if ( pwdinfo->wfd_tdls_enable ) { - // available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* 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 | WFD_DEVINFO_PC_TDLS | WFD_DEVINFO_HDCP_SUPPORT); } else { - // available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) + /* 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 | WFD_DEVINFO_HDCP_SUPPORT); } } @@ -830,29 +830,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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -864,20 +864,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; @@ -887,16 +887,16 @@ 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. */ } @@ -914,7 +914,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; @@ -928,53 +928,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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -986,20 +986,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; @@ -1021,58 +1021,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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1084,20 +1084,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; @@ -1119,58 +1119,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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1182,20 +1182,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; @@ -1217,58 +1217,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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1280,20 +1280,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; @@ -1316,58 +1316,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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1379,20 +1379,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; @@ -1415,58 +1415,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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1478,20 +1478,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; @@ -1501,16 +1501,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. */ } @@ -1528,58 +1528,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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1591,20 +1591,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; @@ -1614,16 +1614,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. */ } @@ -1641,58 +1641,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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1704,20 +1704,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; @@ -1740,58 +1740,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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1803,20 +1803,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; @@ -1831,7 +1831,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) { @@ -1850,37 +1850,37 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { widi_version = 40; } -#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); @@ -1892,51 +1892,51 @@ 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( widi_version == 35 ) { @@ -1947,61 +1947,61 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) RTW_PUT_LE16(p2pie + p2pielen, 21 + 8 * pmlmepriv->num_p2p_sdt + 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 */ 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; #ifdef CONFIG_INTEL_WIDI if( widi_version == 40 ) { - // 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, pmlmepriv->p2p_pdt_cid ); 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, pmlmepriv->p2p_pdt_scid); p2pielen += 2; } else -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ { - // 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( widi_version == 35 ) { @@ -2032,28 +2032,28 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } } 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: */ 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); @@ -2072,119 +2072,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 */ 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: */ 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: */ memcpy( p2pie + p2pielen, pdev_raddr, ETH_ALEN ); p2pielen += ETH_ALEN; @@ -2206,26 +2206,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); @@ -2269,39 +2269,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; } @@ -2312,7 +2312,7 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l } else { - //non -p2p device + /* non -p2p device */ } } @@ -2344,7 +2344,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_; } @@ -2366,7 +2366,7 @@ 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_8192C( "[%s] Got P2P Capability Attr!!\n", __FUNCTION__ ); @@ -2374,10 +2374,10 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l 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_8192C( "[%s] Got P2P DEVICE INFO Attr!!\n", __FUNCTION__ ); @@ -2388,11 +2388,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); - memcpy(psta->dev_addr, pattr_content, ETH_ALEN);//P2P Device Address + memcpy(psta->dev_addr, pattr_content, ETH_ALEN);/* P2P Device Address */ pattr_content += ETH_ALEN; - memcpy(&be_tmp, pattr_content, 2);//Config Methods + memcpy(&be_tmp, pattr_content, 2);/* Config Methods */ psta->config_methods = be16_to_cpu(be_tmp); pattr_content += 2; @@ -2422,7 +2422,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l } - //dev_name_len = attr_contentlen - ETH_ALEN - 2 - 8 - 1 - (num_of_secdev_type*8); + /* dev_name_len = attr_contentlen - ETH_ALEN - 2 - 8 - 1 - (num_of_secdev_type*8); */ psta->dev_name_len=0; if(WPS_ATTR_DEVICE_NAME == be16_to_cpu(*(__be16*)pattr_content)) { @@ -2439,7 +2439,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); } @@ -2484,7 +2484,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); @@ -2495,10 +2495,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; @@ -2529,7 +2529,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); @@ -2671,15 +2671,15 @@ 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 */ __be16 be_tmp; 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); @@ -2741,7 +2741,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe 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) ) { cap_attr = le16_to_cpu(le_tmp); @@ -2749,17 +2749,17 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe #if defined(CONFIG_WFD) && defined(CONFIG_TDLS) 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_871X( "[%s] GO Intent = %d, tie = %d\n", __FUNCTION__, 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); @@ -2788,7 +2788,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. */ memcpy( pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN ); memcpy( pwdinfo->groupid_info.ssid, pwdinfo->nego_ssid, pwdinfo->nego_ssidlen ); } @@ -2842,7 +2842,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_871X( "[%s] Change op ch to %02x\n", __FUNCTION__, pwdinfo->operating_channel); } @@ -2852,13 +2852,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 }; @@ -2872,7 +2872,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe DBG_871X( "[%s] Peer PORT NUM = %d\n", __FUNCTION__, pwdinfo->wfd_info->peer_rtsp_ctrlport ); } } -#endif // CONFIG_WFD +#endif /* CONFIG_WFD */ return( result ); } @@ -2890,13 +2890,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) ) { @@ -2931,17 +2931,17 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram u8 ch_num_inclusioned = 0; __le16 le_tmp; - while ( p2p_ie ) // Found the P2P IE. + while ( p2p_ie ) /* Found the 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) ) { cap_attr = le16_to_cpu(le_tmp); #ifdef CONFIG_TDLS 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); @@ -2950,7 +2950,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram DBG_871X( "[%s] Status = %d\n", __FUNCTION__, attr_content ); if ( attr_content == P2P_STATUS_SUCCESS ) { - // Do nothing. + /* Do nothing. */ } else { @@ -2965,7 +2965,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 ) ) { @@ -2975,17 +2975,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_871X( "[%s] GO Intent = %d, tie = %d\n", __FUNCTION__, 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); @@ -3021,14 +3021,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. */ memcpy( pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN ); 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)) @@ -3037,7 +3037,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_871X( "[%s] channel list attribute found, len = %d\n", __FUNCTION__, pwdinfo->channel_list_attr_len ); @@ -3078,7 +3078,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_871X( "[%s] Change op ch to %02x\n", __FUNCTION__, pwdinfo->operating_channel); } @@ -3093,7 +3093,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram DBG_871X( "[%s] channel list attribute not found!\n", __FUNCTION__); } - // 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; memset( groupid, 0x00, 38 ); if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen) ) @@ -3102,15 +3102,15 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram 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 }; @@ -3124,7 +3124,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram DBG_8192C( "[%s] Peer PORT NUM = %d\n", __FUNCTION__, pwdinfo->wfd_info->peer_rtsp_ctrlport ); } } -#endif // CONFIG_WFD +#endif /* CONFIG_WFD */ return( result ); @@ -3141,7 +3141,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 }; @@ -3160,8 +3160,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 ) ) @@ -3174,7 +3174,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); @@ -3191,7 +3191,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; memset( groupid, 0x00, 38 ); if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen) ) @@ -3208,7 +3208,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); } @@ -3226,7 +3226,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); @@ -3272,8 +3272,8 @@ static void restore_p2p_state_handler( struct adapter* padapter ) if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE)) { - // 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); } } @@ -3383,7 +3383,7 @@ static void rtw_change_p2pie_op_ch(struct adapter *padapter, const u8 *frame_bod u32 attr_contentlen = 0; u8 *pattr = NULL; - //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) @@ -3391,7 +3391,7 @@ static void rtw_change_p2pie_op_ch(struct adapter *padapter, const u8 *frame_bod *(pattr+4) = ch; } - //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); } } @@ -3412,7 +3412,7 @@ static void rtw_change_p2pie_ch_list(struct adapter *padapter, const u8 *frame_b 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; u32 num_of_ch; @@ -3431,7 +3431,7 @@ static void rtw_change_p2pie_ch_list(struct adapter *padapter, const u8 *frame_b } } - //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); } } @@ -3472,7 +3472,7 @@ void rtw_append_wfd_ie(struct 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: { @@ -3562,7 +3562,7 @@ void rtw_append_wfd_ie(struct adapter *padapter, u8 *buf, u32* len) else { DBG_871X("%s, action frame category=%d\n", __func__, category); - //is_p2p_frame = (-1); + /* is_p2p_frame = (-1); */ } return; @@ -3648,7 +3648,7 @@ int rtw_p2p_check_frames(struct 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]; @@ -3669,7 +3669,7 @@ int rtw_p2p_check_frames(struct 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; @@ -3678,10 +3678,10 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx struct rtw_wdev_nego_info* nego_info = &pwdev_priv->nego_info; 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 */ } if ((cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, &cont_len))) @@ -3805,9 +3805,9 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx if(tx && *cont==7) { DBG_871X("TX_P2P_INVITE_RESP, status is no common channel, change to unknown group\n"); - *cont = 8; //unknow group status + *cont = 8; /* unknow group status */ } -#endif //CONFIG_P2P_INVITE_IOT +#endif /* CONFIG_P2P_INVITE_IOT */ status = *cont; } if ((cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, &cont_len))) @@ -3847,7 +3847,7 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx DBG_871X("RTW_%s:P2P_PROVISION_DISC_REQ, dialogToken=%d\n", (tx==true)?"Tx":"Rx", dialogToken); - //if(tx) + /* if(tx) */ { pwdev_priv->provdisc_req_issued = false; @@ -3856,14 +3856,14 @@ int rtw_p2p_check_frames(struct 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_871X("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. */ } } @@ -3929,7 +3929,7 @@ void rtw_init_cfg80211_wifidirect_info( struct 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(struct adapter *padapter, int intCmdType) { @@ -3963,7 +3963,7 @@ void p2p_protocol_wk_hdl(struct adapter *padapter, int intCmdType) ro_ch_handler( padapter ); break; } -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ } @@ -3976,7 +3976,7 @@ void process_p2p_ps_ie(struct adapter *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 ); @@ -3999,14 +3999,14 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength) 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; @@ -4014,12 +4014,12 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength) 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) { - //memcpy(&wifidirect_info->noa_count[noa_num], &noa_attr[noa_offset], 1); + /* memcpy(&wifidirect_info->noa_count[noa_num], &noa_attr[noa_offset], 1); */ pwdinfo->noa_count[noa_num] = noa_attr[noa_offset]; noa_offset += 1; @@ -4040,7 +4040,7 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength) 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(adapter_to_pwrctl(padapter)->bFwCurrentInPSMode == true) { p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 1); @@ -4057,10 +4057,10 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength) } } - 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); } @@ -4081,7 +4081,7 @@ void p2p_ps_wk_hdl(struct adapter *padapter, u8 p2p_ps_state) struct wifidirect_info *pwdinfo= &(padapter->wdinfo); - // Pre action for p2p state + /* Pre action for p2p state */ switch(p2p_ps_state) { case P2P_PS_DISABLE: @@ -4177,7 +4177,7 @@ exit: return res; } -#endif // CONFIG_P2P_PS +#endif /* CONFIG_P2P_PS */ static void reset_ch_sitesurvey_timer_process (void *FunctionContext) { @@ -4188,13 +4188,13 @@ static void reset_ch_sitesurvey_timer_process (void *FunctionContext) return; DBG_871X( "[%s] In\n", __FUNCTION__ ); - // Reset the operation channel information + /* Reset the operation channel information */ pwdinfo->rx_invitereq_info.operation_ch[0] = 0; #ifdef P2P_OP_CHECK_SOCIAL_CH pwdinfo->rx_invitereq_info.operation_ch[1] = 0; pwdinfo->rx_invitereq_info.operation_ch[2] = 0; pwdinfo->rx_invitereq_info.operation_ch[3] = 0; -#endif //P2P_OP_CHECK_SOCIAL_CH +#endif /* P2P_OP_CHECK_SOCIAL_CH */ pwdinfo->rx_invitereq_info.scan_op_ch_only = 0; } @@ -4207,13 +4207,13 @@ static void reset_ch_sitesurvey_timer_process2 (void *FunctionContext) return; DBG_871X( "[%s] In\n", __FUNCTION__ ); - // Reset the operation channel information + /* Reset the operation channel information */ pwdinfo->p2p_info.operation_ch[0] = 0; #ifdef P2P_OP_CHECK_SOCIAL_CH pwdinfo->p2p_info.operation_ch[1] = 0; pwdinfo->p2p_info.operation_ch[2] = 0; pwdinfo->p2p_info.operation_ch[3] = 0; -#endif //P2P_OP_CHECK_SOCIAL_CH +#endif /* P2P_OP_CHECK_SOCIAL_CH */ pwdinfo->p2p_info.scan_op_ch_only = 0; } @@ -4244,11 +4244,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)) @@ -4303,24 +4303,24 @@ int rtw_init_wifi_display_info(struct 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 */ memset( pwfd_info->ip_address, 0x00, 4 ); memset( pwfd_info->peer_ip_address, 0x00, 4 ); return res; } -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ void rtw_init_wifidirect_timers(struct adapter* padapter) { @@ -4359,13 +4359,13 @@ void init_wifidirect_info( struct 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. */ - // Use the channel 11 as the listen channel + /* Use the channel 11 as the listen channel */ pwdinfo->listen_channel = 11; if (role == P2P_ROLE_DEVICE) { @@ -4385,15 +4385,15 @@ void init_wifidirect_info( struct 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 */ memcpy( ( void* ) pwdinfo->p2p_wildcard_ssid, "DIRECT-", 7 ); @@ -4401,7 +4401,7 @@ void init_wifidirect_info( struct adapter* padapter, enum P2P_ROLE role) pwdinfo->device_name_len = 0; 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. */ memset( &pwdinfo->inviteresp_info, 0x00, sizeof( struct tx_invite_resp_info ) ); pwdinfo->inviteresp_info.token = 0; @@ -4412,7 +4412,7 @@ void init_wifidirect_info( struct 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_8192C( "[%s] listen_dwell time is %d00ms\n", __FUNCTION__, pwdinfo->listen_dwell ); + /* DBG_8192C( "[%s] listen_dwell time is %d00ms\n", __FUNCTION__, pwdinfo->listen_dwell ); */ 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; @@ -4431,7 +4431,7 @@ void init_wifidirect_info( struct 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; memset( pwdinfo->channel_list_attr, 0x00, 100 ); @@ -4439,33 +4439,33 @@ void init_wifidirect_info( struct adapter* padapter, enum P2P_ROLE role) memset( pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, '0', 3 ); memset( &pwdinfo->groupid_info, 0x00, sizeof( struct group_id_info ) ); -// Commented by Kurt 20130319 -// For WiDi purpose: Use CFG80211 interface but controled WFD/RDS frame by driver itself. +/* Commented by Kurt 20130319 */ +/* For WiDi purpose: Use CFG80211 interface but controled WFD/RDS frame by driver itself. */ #ifdef CONFIG_IOCTL_CFG80211 pwdinfo->driver_interface = DRIVER_CFG80211; #else pwdinfo->driver_interface = DRIVER_WEXT; -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ pwdinfo->wfd_tdls_enable = 0; memset( pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN ); 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 */ #ifdef P2P_OP_CHECK_SOCIAL_CH pwdinfo->rx_invitereq_info.operation_ch[2] = 0; pwdinfo->rx_invitereq_info.operation_ch[3] = 0; pwdinfo->rx_invitereq_info.operation_ch[4] = 0; -#endif //P2P_OP_CHECK_SOCIAL_CH +#endif /* P2P_OP_CHECK_SOCIAL_CH */ 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 */ #ifdef P2P_OP_CHECK_SOCIAL_CH pwdinfo->p2p_info.operation_ch[2] = 0; pwdinfo->p2p_info.operation_ch[3] = 0; pwdinfo->p2p_info.operation_ch[4] = 0; -#endif //P2P_OP_CHECK_SOCIAL_CH +#endif /* P2P_OP_CHECK_SOCIAL_CH */ pwdinfo->p2p_info.scan_op_ch_only = 0; } @@ -4594,7 +4594,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(struct adapter *padapter, enum P2P_ROLE role) @@ -4607,18 +4607,18 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role) u8 channel, ch_offset; u16 bwmode; - //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); @@ -4632,19 +4632,19 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role) #ifdef CONFIG_INTEL_WIDI if( padapter->mlmepriv.p2p_reject_disable == true ) return ret; -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ #ifdef CONFIG_IOCTL_CFG80211 if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 ) wdev_to_priv(padapter->rtw_wdev)->p2p_enabled = false; -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ if (_FAIL == rtw_pwr_wakeup(padapter)) { ret = _FAIL; goto exit; } - //Disable P2P function + /* Disable P2P function */ if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { _cancel_timer_ex( &pwdinfo->find_phase_timer ); @@ -4665,19 +4665,19 @@ int rtw_p2p_enable(struct 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); #ifdef CONFIG_INTEL_WIDI rtw_reset_widi_info(padapter); -#endif //CONFIG_INTEL_WIDI +#endif /* CONFIG_INTEL_WIDI */ - //For WiDi purpose. + /* For WiDi purpose. */ #ifdef CONFIG_IOCTL_CFG80211 pwdinfo->driver_interface = DRIVER_CFG80211; #else pwdinfo->driver_interface = DRIVER_WEXT; -#endif //CONFIG_IOCTL_CFG80211 +#endif /* CONFIG_IOCTL_CFG80211 */ } @@ -4685,4 +4685,4 @@ exit: return ret; } -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index 12807e0..b146b13 100755 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -42,7 +42,7 @@ void _ips_enter(struct 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++; @@ -134,7 +134,7 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter) bool ret = false; if (adapter_to_pwrctl(adapter)->ips_deny_time >= rtw_get_current_time()) { - //DBG_871X("%s ips_deny_time\n", __func__); + /* DBG_871X("%s ips_deny_time\n", __func__); */ goto exit; } @@ -204,12 +204,12 @@ void rtw_ps_processor(struct adapter*padapter) { #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); -#endif //CONFIG_P2P +#endif /* CONFIG_P2P */ struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); 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; @@ -217,7 +217,7 @@ void rtw_ps_processor(struct adapter*padapter) if(pwrpriv->bips_processing == true) goto exit; - //DBG_871X("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca)); + /* DBG_871X("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca)); */ if(pwrpriv->bHWPwrPindetect) { #ifdef CONFIG_AUTOSUSPEND @@ -245,7 +245,7 @@ void rtw_ps_processor(struct adapter*padapter) } } else - #endif //CONFIG_AUTOSUSPEND + #endif /* CONFIG_AUTOSUSPEND */ { rfpwrstate = RfOnOffDetect(padapter); DBG_871X("@@@@- #2 %s==> rfstate:%s \n",__FUNCTION__,(rfpwrstate==rf_on)?"rf_on":"rf_off"); @@ -269,7 +269,7 @@ void rtw_ps_processor(struct adapter*padapter) } pwrpriv->pwr_state_check_cnts ++; } -#endif //SUPPORT_HW_RFOFF_DETECTED +#endif /* SUPPORT_HW_RFOFF_DETECTED */ if (pwrpriv->ips_mode_req == IPS_NONE) goto exit; @@ -305,17 +305,17 @@ void rtw_ps_processor(struct 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); @@ -370,7 +370,7 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv) DBG_871X("%s: RPWM timeout, force to set RPWM(0x%02X) again!\n", __FUNCTION__, pslv); } else -#endif // CONFIG_LPS_RPWM_TIMER +#endif /* CONFIG_LPS_RPWM_TIMER */ { if ((pwrpriv->rpwm == pslv)) { RT_TRACE(_module_rtl871x_pwrctrl_c_,_drv_err_, @@ -405,7 +405,7 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv) 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 @@ -417,7 +417,7 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv) #ifdef CONFIG_DETECT_CPWM_BY_POLLING if (rpwm & PS_ACK) { - //cpwm_orig = rtw_read8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HCPWM1); + /* cpwm_orig = rtw_read8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HCPWM1); */ rtw_hal_get_hwreg(padapter, HW_VAR_GET_CPWM, (u8 *)(&cpwm_orig)); } #endif @@ -425,13 +425,13 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv) #if defined(CONFIG_LPS_RPWM_TIMER) && !defined(CONFIG_DETECT_CPWM_BY_POLLING) if (rpwm & PS_ACK) _set_timer(&pwrpriv->pwr_rpwm_timer, LPS_RPWM_WAIT_MS); -#endif // CONFIG_LPS_RPWM_TIMER && !CONFIG_DETECT_CPWM_BY_POLLING +#endif /* CONFIG_LPS_RPWM_TIMER && !CONFIG_DETECT_CPWM_BY_POLLING */ 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 { @@ -443,11 +443,11 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv) { cpwm_polling_start_time = rtw_get_current_time(); - //polling cpwm + /* polling cpwm */ do{ rtw_mdelay_os(1); - //cpwm_now = rtw_read8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HCPWM1); + /* cpwm_now = rtw_read8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HCPWM1); */ rtw_hal_get_hwreg(padapter, HW_VAR_GET_CPWM, (u8 *)(&cpwm_now)); if ((cpwm_orig ^ cpwm_now) & 0x80) { @@ -525,14 +525,14 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); #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 */ ; @@ -560,12 +560,12 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a _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_871X("rtw_set_ps_mode: Leave 802.11 power save\n"); @@ -588,7 +588,7 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a } _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); @@ -601,7 +601,7 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a start_time = rtw_get_current_time(); do { rtw_hal_get_hwreg(padapter, HW_VAR_SYS_CLKR, &val8); - if (!(val8 & BIT(4))){ //0x08 bit4 =1 --> in 32k, bit4 = 0 --> leave 32k + if (!(val8 & BIT(4))){ /* 0x08 bit4 =1 --> in 32k, bit4 = 0 --> leave 32k */ pwrpriv->cpwm = PS_STATE_S4; break; } @@ -647,7 +647,7 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a } _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ pwrpriv->bFwCurrentInPSMode = true; pwrpriv->pwr_mode = ps_mode; @@ -656,10 +656,10 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a 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 DBG_871X("%s: alives: %d\n", __FUNCTION__, pwrpriv->alives); @@ -717,10 +717,10 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms) return err; } -// -// Description: -// Enter the leisure power save mode. -// +/* */ +/* Description: */ +/* Enter the leisure power save mode. */ +/* */ void LPS_Enter(struct adapter *padapter) { struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); @@ -731,14 +731,14 @@ void LPS_Enter(struct adapter *padapter) return; if (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_871X("%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, 0x40); } } @@ -747,10 +747,10 @@ void LPS_Enter(struct adapter *padapter) } } -// -// Description: -// Leave the leisure power save mode. -// +/* */ +/* Description: */ +/* Leave the leisure power save mode. */ +/* */ void LPS_Leave(struct adapter *padapter) { #define LPS_LEAVE_TIMEOUT_MS 100 @@ -770,16 +770,16 @@ void LPS_Leave(struct adapter *padapter) pwrpriv->bpower_saving = false; -// DBG_871X("-LeisurePSLeave\n"); +/* DBG_871X("-LeisurePSLeave\n"); */ ; } #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(IN struct adapter *Adapter) { struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); @@ -787,16 +787,16 @@ void LeaveAllPowerSaveMode(IN struct adapter *Adapter) ; - //DBG_871X("%s.....\n",__FUNCTION__); + /* DBG_871X("%s.....\n",__FUNCTION__); */ 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); @@ -816,7 +816,7 @@ void LeaveAllPowerSaveMode(IN struct adapter *Adapter) #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 @@ -829,7 +829,7 @@ void LeaveAllPowerSaveMode(IN struct adapter *Adapter) DBG_871X("======> ips_leave fail.............\n"); } #endif -#endif //CONFIG_PLATFORM_SPRD +#endif /* CONFIG_PLATFORM_SPRD */ } } } @@ -908,7 +908,7 @@ void cpwm_int_hdl( _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; @@ -938,7 +938,7 @@ static void cpwm_event_callback(struct work_struct *work) struct adapter *adapter = dvobj->if1; struct reportpwrstate_parm report; - //DBG_871X("%s\n",__FUNCTION__); + /* DBG_871X("%s\n",__FUNCTION__); */ report.state = PS_STATE_S2; cpwm_int_hdl(adapter, &report); @@ -955,7 +955,7 @@ static void rpwmtimeout_workitem_callback(struct work_struct *work) pwrpriv = container_of(work, struct pwrctrl_priv, rpwmtimeoutwi); dvobj = pwrctl_to_dvobj(pwrpriv); padapter = dvobj->if1; -// DBG_871X("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); +/* DBG_871X("+%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)) @@ -1006,7 +1006,7 @@ static void pwr_rpwm_timeout_handler(void *FunctionContext) padapter = (PADAPTER)FunctionContext; pwrpriv = adapter_to_pwrctl(padapter); -// DBG_871X("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); +/* DBG_871X("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); */ if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) { @@ -1016,7 +1016,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) { @@ -1087,7 +1087,7 @@ s32 rtw_register_tx_alive(struct adapter *padapter) if (pwrctrl->cpwm >= PS_STATE_S2) res = _SUCCESS; } -#endif // CONFIG_DETECT_CPWM_BY_POLLING +#endif /* CONFIG_DETECT_CPWM_BY_POLLING */ ; @@ -1153,7 +1153,7 @@ s32 rtw_register_cmd_alive(struct adapter *padapter) if (pwrctrl->cpwm >= PS_STATE_S2) res = _SUCCESS; } -#endif // CONFIG_DETECT_CPWM_BY_POLLING +#endif /* CONFIG_DETECT_CPWM_BY_POLLING */ ; @@ -1344,7 +1344,7 @@ void rtw_unregister_evt_alive(struct adapter *padapter) #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(struct adapter *padapter) { @@ -1372,11 +1372,10 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter) #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; @@ -1401,20 +1400,20 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter) 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 */ _init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter); #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 */ ; @@ -1436,7 +1435,7 @@ void rtw_free_pwrctrl_priv(struct adapter *adapter) #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); } @@ -1456,7 +1455,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 @@ -1465,7 +1464,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 */ #if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) inline bool rtw_is_earlysuspend_registered(struct pwrctrl_priv *pwrpriv) @@ -1511,7 +1510,7 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv) { DBG_871X("%s\n", __FUNCTION__); - //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; @@ -1530,7 +1529,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 extern int rtw_resume_process(struct adapter *padapter); @@ -1559,7 +1558,7 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv) { DBG_871X("%s\n", __FUNCTION__); - //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; @@ -1578,7 +1577,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(struct adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8* val) { @@ -1649,19 +1648,19 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal DBG_871X("%s wait bInSuspend done\n", __func__); } - //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) @@ -1679,12 +1678,12 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal #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 ) @@ -1721,7 +1720,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal } } - //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 85613ae..18b3fb3 100755 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -38,7 +38,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) @@ -51,8 +51,8 @@ void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv) _rtw_spinlock_init(&psta_recvpriv->lock); - //for(i=0; iblk_strms[i]); + /* for(i=0; iblk_strms[i]); */ _rtw_init_queue(&psta_recvpriv->defrag_q); @@ -70,8 +70,8 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) ; - // We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). - //memset((unsigned char *)precvpriv, 0, sizeof (struct recv_priv)); + /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ + /* memset((unsigned char *)precvpriv, 0, sizeof (struct recv_priv)); */ _rtw_spinlock_init(&precvpriv->lock); @@ -91,11 +91,11 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) res= _FAIL; goto exit; } - //memset(precvpriv->pallocated_frame_buf, 0, NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ); + /* 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)); + /* 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; @@ -122,11 +122,10 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS _init_timer(&precvpriv->signal_stat_timer, padapter->pnetdev, RTW_TIMER_HDL_NAME(signal_stat), padapter); - 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: @@ -152,7 +151,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) @@ -245,9 +244,9 @@ int rtw_free_recvframe(union recv_frame *precvframe, _queue *pfree_recv_queue) { #ifdef CONFIG_BSD_RX_USE_MBUF m_freem(precvframe->u.hdr.pkt); -#else // CONFIG_BSD_RX_USE_MBUF - rtw_skb_free(precvframe->u.hdr.pkt);//free skb by driver -#endif // CONFIG_BSD_RX_USE_MBUF +#else /* CONFIG_BSD_RX_USE_MBUF */ + rtw_skb_free(precvframe->u.hdr.pkt);/* free skb by driver */ +#endif /* CONFIG_BSD_RX_USE_MBUF */ precvframe->u.hdr.pkt = NULL; } @@ -283,7 +282,7 @@ sint _rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *queue) ; - //_rtw_init_listhead(&(precvframe->u.hdr.list)); + /* _rtw_init_listhead(&(precvframe->u.hdr.list)); */ rtw_list_delete(&(precvframe->u.hdr.list)); @@ -304,10 +303,10 @@ sint rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *queue) sint ret; _irqL irqL; - //_spinlock(&pfree_recv_queue->lock); + /* _spinlock(&pfree_recv_queue->lock); */ _enter_critical_bh(&queue->lock, &irqL); ret = _rtw_enqueue_recvframe(precvframe, queue); - //_rtw_spinunlock(&pfree_recv_queue->lock); + /* _rtw_spinunlock(&pfree_recv_queue->lock); */ _exit_critical_bh(&queue->lock, &irqL); return ret; @@ -348,8 +347,6 @@ void rtw_free_recvframe_queue(_queue *pframequeue, _queue *pfree_recv_queue) 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); } @@ -441,7 +438,7 @@ sint recvframe_chkmic(struct 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; + /* 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; @@ -458,19 +455,19 @@ sint recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe){ 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.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_871X("\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); + /* DBG_871X("\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) { @@ -485,15 +482,13 @@ sint recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe){ 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; @@ -532,8 +527,8 @@ sint recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe){ 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; @@ -553,7 +548,7 @@ sint recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe){ } 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")); @@ -578,7 +573,7 @@ exit: } -//decrypt and set the ivlen,icvlen of the recv_frame +/* decrypt and set the ivlen,icvlen of the recv_frame */ static union recv_frame *decryptor(struct adapter *padapter,union recv_frame *precv_frame) { struct rx_pkt_attrib *prxattrib = &precv_frame->u.hdr.attrib; @@ -665,14 +660,10 @@ static union recv_frame *decryptor(struct adapter *padapter,union recv_frame *pr else{ prxattrib->bdecrypted = true; } - //recvframe_chkmic(adapter, precv_frame); //move to recvframme_defrag function - -; - return return_packet; - } -//###set the security information in the recv_frame + +/* set the security information in the recv_frame */ static union recv_frame * portctrl(struct adapter *adapter,union recv_frame * precv_frame) { u8 *psta_addr, *ptr; @@ -682,7 +673,7 @@ static union recv_frame * portctrl(struct adapter *adapter,union recv_frame * pr 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; ; @@ -706,13 +697,13 @@ static union recv_frame * portctrl(struct adapter *adapter,union recv_frame * pr { 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; memcpy(&be_tmp, ptr, 2); ether_type= ntohs(be_tmp); @@ -721,15 +712,15 @@ static union recv_frame * portctrl(struct adapter *adapter,union recv_frame * pr 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)); @@ -739,11 +730,11 @@ static union recv_frame * portctrl(struct adapter *adapter,union recv_frame * pr } 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; } @@ -780,7 +771,7 @@ sint recv_decache(union recv_frame *precv_frame, u8 bretry, struct stainfo_rxcac return _FAIL; } - if(1)//if(bretry) + if(1)/* if(bretry) */ { if(seq_ctrl == prxcache->tid_rxseq[tid]) { @@ -818,24 +809,24 @@ void process_pwrbit_data(struct 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_871X("to sleep, sta_dz_bitmap=%x\n", pstapriv->sta_dz_bitmap); + /* DBG_871X("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_871X("to wakeup, sta_dz_bitmap=%x\n", pstapriv->sta_dz_bitmap); + /* DBG_871X("to wakeup, sta_dz_bitmap=%x\n", pstapriv->sta_dz_bitmap); */ } } @@ -859,7 +850,7 @@ void process_wmmps_data(struct 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; @@ -869,7 +860,7 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_TDLS } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ if(psta->state&WIFI_SLEEP_STATE) { @@ -900,12 +891,12 @@ void process_wmmps_data(struct 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); } } @@ -926,10 +917,10 @@ sint OnTDLS(struct 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 @@ -979,25 +970,25 @@ sint OnTDLS(struct 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_871X("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_871X("recv tunneled probe response frame\n"); } } break; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ default: DBG_871X("receive TDLS frame but not supported\n"); ret=_FAIL; @@ -1068,7 +1059,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 @@ -1078,7 +1069,7 @@ sint sta2sta_data_frame( (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; @@ -1104,7 +1095,7 @@ sint sta2sta_data_frame( { #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) @@ -1115,7 +1106,7 @@ sint sta2sta_data_frame( 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))) @@ -1125,18 +1116,18 @@ sint sta2sta_data_frame( 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)) ) @@ -1145,19 +1136,19 @@ sint sta2sta_data_frame( 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_871X("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) { @@ -1172,7 +1163,7 @@ sint sta2sta_data_frame( 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; @@ -1184,9 +1175,9 @@ sint sta2sta_data_frame( } 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")); @@ -1202,15 +1193,15 @@ sint sta2sta_data_frame( { 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; @@ -1240,12 +1231,12 @@ sint sta2sta_data_frame( 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")); @@ -1285,7 +1276,7 @@ sint ap2sta_data_frame( ) { - // 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 @@ -1296,7 +1287,7 @@ sint ap2sta_data_frame( 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_, @@ -1309,7 +1300,7 @@ sint ap2sta_data_frame( } - // 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)) ) @@ -1336,7 +1327,7 @@ sint ap2sta_data_frame( 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")); @@ -1347,8 +1338,8 @@ sint ap2sta_data_frame( 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 */ @@ -1367,11 +1358,11 @@ sint ap2sta_data_frame( memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); memcpy(pattrib->ta, pattrib->src, ETH_ALEN); - // + /* */ 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 @@ -1393,7 +1384,7 @@ sint ap2sta_data_frame( { 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_871X("issue_deauth to the ap=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->bssid)); @@ -1436,7 +1427,7 @@ sint sta2ap_data_frame( 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; @@ -1495,22 +1486,22 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_ 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_871X("+validate_recv_ctrl_frame\n"); + /* DBG_871X("+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; @@ -1525,7 +1516,7 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_ return _FAIL; } - //for rx pkt statistics + /* for rx pkt statistics */ psta->sta_stats.rx_ctrl_pkts++; switch(pattrib->priority) @@ -1566,7 +1557,7 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_ struct xmit_frame *pxmitframe=NULL; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - //_enter_critical_bh(&psta->sleep_q.lock, &irqL); + /* _enter_critical_bh(&psta->sleep_q.lock, &irqL); */ _enter_critical_bh(&pxmitpriv->lock, &irqL); xmitframe_phead = get_list_head(&psta->sleep_q); @@ -1589,7 +1580,7 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_ pxmitframe->attrib.triggered = 1; - //DBG_871X("handling ps-poll, q_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); + /* DBG_871X("handling ps-poll, q_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */ rtw_hal_xmitframe_enqueue(padapter, pxmitframe); @@ -1597,28 +1588,28 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_ { 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); } - //_exit_critical_bh(&psta->sleep_q.lock, &irqL); + /* _exit_critical_bh(&psta->sleep_q.lock, &irqL); */ _exit_critical_bh(&pxmitpriv->lock, &irqL); } else { - //_exit_critical_bh(&psta->sleep_q.lock, &irqL); + /* _exit_critical_bh(&psta->sleep_q.lock, &irqL); */ _exit_critical_bh(&pxmitpriv->lock, &irqL); - //DBG_871X("no buffered packets to xmit\n"); + /* DBG_871X("no buffered packets to xmit\n"); */ if(pstapriv->tim_bitmap&BIT(psta->aid)) { if(psta->sleepq_len==0) { DBG_871X("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 @@ -1629,8 +1620,8 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_ 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); } @@ -1650,7 +1641,7 @@ union recv_frame* recvframe_chk_defrag(struct adapter *padapter, union recv_fram sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_frame); sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_frame) { - //struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + /* struct mlme_priv *pmlmepriv = &padapter->mlmepriv; */ RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("+validate_recv_mgnt_frame\n")); @@ -1661,7 +1652,7 @@ sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_ } { - //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++; @@ -1750,7 +1741,7 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f sint ret = _SUCCESS; #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &adapter->tdlsinfo; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ ; @@ -1824,14 +1815,14 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f 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)); @@ -1851,14 +1842,14 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f } - 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")); @@ -1880,7 +1871,7 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f 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)); @@ -1910,13 +1901,13 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec u8 subtype; type = GetFrameType(ptr); - subtype = GetFrameSubType(ptr); //bit(7)~bit(2) + subtype = GetFrameSubType(ptr); /* bit(7)~bit(2) */ - //only support station mode + /* only support station mode */ if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) && adapter->securitypriv.binstallBIPkey == true) { - //unicast management frame decrypt + /* unicast management frame decrypt */ if(pattrib->privacy && !(IS_MCAST(GetAddr1Ptr(ptr))) && (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC || subtype == WIFI_ACTION)) { @@ -1927,11 +1918,11 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec pattrib->bdecrypted = 0; pattrib->encrypt = _AES_; pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); - //set iv and icv length + /* set iv and icv length */ SET_ICE_IV_LEN(pattrib->iv_len, pattrib->icv_len, pattrib->encrypt); memcpy(pattrib->ra, GetAddr1Ptr(ptr), ETH_ALEN); memcpy(pattrib->ta, GetAddr2Ptr(ptr), ETH_ALEN); - //actual management data frame body + /* actual management data frame body */ data_len = pattrib->pkt_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len; mgmt_DATA = rtw_zmalloc(data_len); if(mgmt_DATA == NULL) @@ -1939,7 +1930,7 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec DBG_871X("%s mgmt allocate fail !!!!!!!!!\n", __FUNCTION__); goto validate_80211w_fail; } - /*//dump the packet content before decrypt + /*/* dump the packet content before decrypt */ { int pp; printk("pattrib->pktlen = %d =>", pattrib->pkt_len); @@ -1949,14 +1940,14 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec }*/ precv_frame = decryptor(adapter, precv_frame); - //save actual management data frame body + /* save actual management data frame body */ memcpy(mgmt_DATA, ptr+pattrib->hdrlen+pattrib->iv_len, data_len); - //overwrite the iv field + /* overwrite the iv field */ memcpy(ptr+pattrib->hdrlen, mgmt_DATA, data_len); - //remove the iv and icv length + /* remove the iv and icv length */ pattrib->pkt_len = pattrib->pkt_len - pattrib->iv_len - pattrib->icv_len; rtw_mfree(mgmt_DATA, data_len); - /*//print packet content after decryption + /*/* print packet content after decryption */ { int pp; printk("after decryption pattrib->pktlen = %d @@=>", pattrib->pkt_len); @@ -1974,26 +1965,26 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC)) { sint BIP_ret = _SUCCESS; - //verify BIP MME IE of broadcast/multicast de-auth/disassoc packet + /* verify BIP MME IE of broadcast/multicast de-auth/disassoc packet */ BIP_ret = rtw_BIP_verify(adapter, (u8 * )precv_frame); if(BIP_ret == _FAIL) { - //DBG_871X("802.11w BIP verify fail\n"); + /* DBG_871X("802.11w BIP verify fail\n"); */ goto validate_80211w_fail; } else if(BIP_ret == RTW_RX_HANDLED) { - //DBG_871X("802.11w recv none protected packet\n"); - //issue sa query request + /* DBG_871X("802.11w recv none protected packet\n"); */ + /* issue sa query request */ issue_action_SA_Query(adapter, NULL, 0, 0); goto validate_80211w_fail; } - }//802.11w protect + }/* 802.11w protect */ else { if(subtype == WIFI_ACTION) { - //according 802.11-2012 standard, these five types are not robust types + /* according 802.11-2012 standard, these five types are not robust types */ if( ptr[WLAN_HDR_A3_LEN] != RTW_WLAN_CATEGORY_PUBLIC && ptr[WLAN_HDR_A3_LEN] != RTW_WLAN_CATEGORY_HT && ptr[WLAN_HDR_A3_LEN] != RTW_WLAN_CATEGORY_UNPROTECTED_WNM && @@ -2007,7 +1998,7 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec else if(subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC) { DBG_871X("802.11w recv none protected packet\n"); - //issue sa query request + /* issue sa query request */ issue_action_SA_Query(adapter, NULL, 0, 0); goto validate_80211w_fail; } @@ -2019,14 +2010,14 @@ validate_80211w_fail: return _FAIL; } -#endif //CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame); sint validate_recv_frame(struct 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; @@ -2041,7 +2032,7 @@ sint validate_recv_frame(struct 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; @@ -2065,7 +2056,7 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) 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 ) @@ -2080,9 +2071,9 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) } DBG_871X("--\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; @@ -2090,7 +2081,7 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) } 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); @@ -2106,11 +2097,11 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) 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_871X("############################# \n"); @@ -2145,31 +2136,31 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) #endif switch (type) { - case WIFI_MGT_TYPE: //mgnt + case WIFI_MGT_TYPE: /* mgnt */ #ifdef CONFIG_IEEE80211W if(validate_80211w_mgmt(adapter, precv_frame) == _FAIL) { retval = _FAIL; break; } -#endif //CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ 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; @@ -2208,7 +2199,7 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) 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; @@ -2229,7 +2220,7 @@ 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); @@ -2245,7 +2236,7 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) struct 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; ; @@ -2257,11 +2248,11 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) 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; @@ -2277,7 +2268,7 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n===pattrib->hdrlen: %x, pattrib->iv_len:%x ===\n\n", pattrib->hdrlen, pattrib->iv_len)); 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)) @@ -2287,7 +2278,7 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) *(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); memcpy(ptr, get_rxmem(precvframe), 24); ptr+=24; @@ -2323,7 +2314,7 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) struct 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; @@ -2334,12 +2325,12 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) 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; @@ -2347,7 +2338,7 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) } } 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)); @@ -2358,46 +2349,43 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) *ptr = 0x87; *(ptr+1) = 0x12; - //back to original pointer + /* back to original pointer */ ptr -= rmv_len; } ptr += rmv_len ; memcpy(ð_type, ptr, 2); - eth_type= ntohs((unsigned short )eth_type); //pattrib->ether_type + eth_type= ntohs((unsigned short )eth_type); /* 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; - //memcpy(ptr, get_rxmem(precvframe), 16); + /* ptr -= 16; */ + /* memcpy(ptr, get_rxmem(precvframe), 16); */ } else { @@ -2406,19 +2394,19 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) u3232 UserPriority = precvframe->u.hdr.attrib.priority; u3232 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); memcpy(ptr, get_rxmem(precvframe), 24); @@ -2442,7 +2430,7 @@ exit: #endif -//perform defrag +/* perform defrag */ static union recv_frame * recvframe_defrag(struct adapter *adapter,_queue *defrag_q) { _list *plist, *phead; @@ -2465,8 +2453,8 @@ static union recv_frame * recvframe_defrag(struct adapter *adapter,_queue *defra 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); @@ -2487,12 +2475,12 @@ static union recv_frame * recvframe_defrag(struct adapter *adapter,_queue *defra 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; @@ -2500,17 +2488,17 @@ static union recv_frame * recvframe_defrag(struct adapter *adapter,_queue *defra 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 */ memcpy(pfhdr->rx_tail, pnfhdr->rx_data, pnfhdr->len); recvframe_put(prframe, pnfhdr->len); @@ -2520,7 +2508,7 @@ static union recv_frame * recvframe_defrag(struct adapter *adapter,_queue *defra }; - //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")); @@ -2530,7 +2518,7 @@ static union recv_frame * recvframe_defrag(struct adapter *adapter,_queue *defra 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(struct adapter *padapter, union recv_frame *precv_frame) { u8 ismfrag; @@ -2551,7 +2539,7 @@ union recv_frame* recvframe_chk_defrag(struct adapter *padapter, union recv_fram 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; @@ -2571,32 +2559,32 @@ union recv_frame* recvframe_chk_defrag(struct adapter *padapter, union recv_fram 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 */ - //_rtw_spinlock(&pdefrag_q->lock); + /* _rtw_spinlock(&pdefrag_q->lock); */ phead = get_list_head(pdefrag_q); rtw_list_insert_tail(&pfhdr->list, phead); - //_rtw_spinunlock(&pdefrag_q->lock); + /* _rtw_spinunlock(&pdefrag_q->lock); */ RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("Enqueuq: ismfrag = %d, fragnum= %d\n", ismfrag,fragnum)); @@ -2605,7 +2593,7 @@ union recv_frame* recvframe_chk_defrag(struct adapter *padapter, union recv_fram } 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)); @@ -2615,16 +2603,16 @@ union recv_frame* recvframe_chk_defrag(struct adapter *padapter, union recv_fram 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) { - //_rtw_spinlock(&pdefrag_q->lock); + /* _rtw_spinlock(&pdefrag_q->lock); */ phead = get_list_head(pdefrag_q); rtw_list_insert_tail(&pfhdr->list,phead); - //_rtw_spinunlock(&pdefrag_q->lock); + /* _rtw_spinunlock(&pdefrag_q->lock); */ - //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; @@ -2632,7 +2620,7 @@ union recv_frame* recvframe_chk_defrag(struct adapter *padapter, union recv_fram } 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)); @@ -2643,7 +2631,7 @@ union recv_frame* recvframe_chk_defrag(struct adapter *padapter, union recv_fram 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")); @@ -2692,14 +2680,14 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe) /* Offset 12 denote 2 mac address */ #ifdef ENDIAN_FREE - //nSubframe_Length = ntohs(*((u16*)(pdata + 12))); + /* nSubframe_Length = ntohs(*((u16*)(pdata + 12))); */ nSubframe_Length = RTW_GET_BE16(pdata + 12); -#else // ENDIAN_FREE +#else /* ENDIAN_FREE */ nSubframe_Length = *((u16*)(pdata + 12)); - //==m==>change the length order + /* m==>change the length order */ nSubframe_Length = (nSubframe_Length>>8) + (nSubframe_Length<<8); - //ntohs(nSubframe_Length); -#endif // ENDIAN_FREE + /* ntohs(nSubframe_Length); */ +#endif /* ENDIAN_FREE */ if( a_len < (ETHERNET_HEADER_SIZE + nSubframe_Length) ) { DBG_871X("nRemain_Length is %d and nSubframe_Length is : %d\n",a_len,nSubframe_Length); @@ -2720,7 +2708,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe) memcpy(data_ptr, pdata, nSubframe_Length); } else -#endif // CONFIG_SKB_COPY +#endif /* CONFIG_SKB_COPY */ { sub_skb = rtw_skb_clone(prframe->u.hdr.pkt); if(sub_skb) @@ -2736,7 +2724,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe) } } - //sub_skb->dev = padapter->pnetdev; + /* sub_skb->dev = padapter->pnetdev; */ subframes[nr_subframes++] = sub_skb; if(nr_subframes >= MAX_SUBFRAME_COUNT) { @@ -2764,11 +2752,11 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe) sub_skb = subframes[i]; /* convert hdr + possible LLC headers into Ethernet header */ #ifdef ENDIAN_FREE - //eth_type = ntohs(*(u16*)&sub_skb->data[6]); + /* eth_type = ntohs(*(u16*)&sub_skb->data[6]); */ eth_type = RTW_GET_BE16(&sub_skb->data[6]); -#else // ENDIAN_FREE +#else /* ENDIAN_FREE */ eth_type = (sub_skb->data[6] << 8) | sub_skb->data[7]; -#endif // ENDIAN_FREE +#endif /* ENDIAN_FREE */ if (sub_skb->len >= 8 && ((_rtw_memcmp(sub_skb->data, rtw_rfc1042_header, SNAP_SIZE) && eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || @@ -2788,38 +2776,38 @@ int amsdu_to_msdu(struct 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; void *br_port = NULL; #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) ) { if (nat25_handle_frame(padapter, sub_skb) == -1) { - //priv->ext_stats.rx_data_drops++; - //DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n"); - //return FAIL; + /* priv->ext_stats.rx_data_drops++; */ + /* DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n"); */ + /* return FAIL; */ #if 1 - // bypass this frame to upper layer!! + /* bypass this frame to upper layer!! */ #else rtw_skb_free(sub_skb); continue; #endif } } -#endif // CONFIG_BR_EXT +#endif /* CONFIG_BR_EXT */ sub_skb->protocol = eth_type_trans(sub_skb, padapter->pnetdev); sub_skb->dev = padapter->pnetdev; @@ -2832,7 +2820,7 @@ int amsdu_to_msdu(struct 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 */ rtw_netif_rx(padapter->pnetdev, sub_skb); } @@ -2841,7 +2829,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe) 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; } @@ -2849,9 +2837,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; @@ -2860,16 +2848,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_871X("%s IndicateSeq: %d > NewSeq: %d\n", __FUNCTION__, @@ -2880,11 +2868,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; @@ -2895,10 +2883,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 @@ -2910,7 +2898,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; } @@ -2924,10 +2912,10 @@ int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union rec union recv_frame *pnextrframe; struct rx_pkt_attrib *pnextattrib; - //DbgPrint("+enqueue_reorder_recvframe()\n"); + /* DbgPrint("+enqueue_reorder_recvframe()\n"); */ - //_enter_critical_ex(&ppending_recvframe_queue->lock, &irql); - //_rtw_spinlock_ex(&ppending_recvframe_queue->lock); + /* _enter_critical_ex(&ppending_recvframe_queue->lock, &irql); */ + /* _rtw_spinlock_ex(&ppending_recvframe_queue->lock); */ phead = get_list_head(ppending_recvframe_queue); @@ -2944,10 +2932,10 @@ int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union rec } else if( SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num)) { - //Duplicate entry is found!! Do not insert current entry. - //RT_TRACE(COMP_RX_REORDER, DBG_TRACE, ("InsertRxReorderList(): Duplicate packet is dropped!! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, SeqNum)); + /* Duplicate entry is found!! Do not insert current entry. */ + /* RT_TRACE(COMP_RX_REORDER, DBG_TRACE, ("InsertRxReorderList(): Duplicate packet is dropped!! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, SeqNum)); */ - //_exit_critical_ex(&ppending_recvframe_queue->lock, &irql); + /* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */ return false; } @@ -2956,23 +2944,23 @@ int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union rec break; } - //DbgPrint("enqueue_reorder_recvframe():while\n"); + /* DbgPrint("enqueue_reorder_recvframe():while\n"); */ } - //_enter_critical_ex(&ppending_recvframe_queue->lock, &irql); - //_rtw_spinlock_ex(&ppending_recvframe_queue->lock); + /* _enter_critical_ex(&ppending_recvframe_queue->lock, &irql); */ + /* _rtw_spinlock_ex(&ppending_recvframe_queue->lock); */ rtw_list_delete(&(prframe->u.hdr.list)); rtw_list_insert_tail(&(prframe->u.hdr.list), plist); - //_rtw_spinunlock_ex(&ppending_recvframe_queue->lock); - //_exit_critical_ex(&ppending_recvframe_queue->lock, &irql); + /* _rtw_spinunlock_ex(&ppending_recvframe_queue->lock); */ + /* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */ - //RT_TRACE(COMP_RX_REORDER, DBG_TRACE, ("InsertRxReorderList(): Pkt insert into buffer!! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, SeqNum)); + /* RT_TRACE(COMP_RX_REORDER, DBG_TRACE, ("InsertRxReorderList(): Pkt insert into buffer!! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, SeqNum)); */ return true; } @@ -2980,31 +2968,31 @@ int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union rec int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctrl *preorder_ctrl, int bforced); int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctrl *preorder_ctrl, int bforced) { - //_irqL irql; - //u8 bcancelled; + /* _irqL irql; */ + /* u8 bcancelled; */ _list *phead, *plist; union recv_frame *prframe; struct rx_pkt_attrib *pattrib; - //u8 index = 0; + /* u8 index = 0; */ int bPktInBuf = false; struct recv_priv *precvpriv = &padapter->recvpriv; _queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue; - //DbgPrint("+recv_indicatepkts_in_order\n"); + /* DbgPrint("+recv_indicatepkts_in_order\n"); */ - //_enter_critical_ex(&ppending_recvframe_queue->lock, &irql); - //_rtw_spinlock_ex(&ppending_recvframe_queue->lock); + /* _enter_critical_ex(&ppending_recvframe_queue->lock, &irql); */ + /* _rtw_spinlock_ex(&ppending_recvframe_queue->lock); */ 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)) { - // _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); - //_rtw_spinunlock_ex(&ppending_recvframe_queue->lock); + /* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */ + /* _rtw_spinunlock_ex(&ppending_recvframe_queue->lock); */ return true; } @@ -3017,8 +3005,8 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr #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)) { @@ -3042,24 +3030,24 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr #endif } - //Set this as a lock to make sure that only one thread is indicating packet. - //pTS->RxIndicateState = RXTS_INDICATE_PROCESSING; + /* Set this as a lock to make sure that only one thread is indicating packet. */ + /* pTS->RxIndicateState = RXTS_INDICATE_PROCESSING; */ - // Indicate packets - //RT_ASSERT((index<=REORDER_WIN_SIZE), ("RxReorderIndicatePacket(): Rx Reorder buffer full!! \n")); + /* Indicate packets */ + /* RT_ASSERT((index<=REORDER_WIN_SIZE), ("RxReorderIndicatePacket(): Rx Reorder buffer full!! \n")); */ - //indicate this recv_frame - //DbgPrint("recv_indicatepkts_in_order, indicate_seq=%d, seq_num=%d\n", precvpriv->indicate_seq, pattrib->seq_num); + /* indicate this recv_frame */ + /* DbgPrint("recv_indicatepkts_in_order, indicate_seq=%d, seq_num=%d\n", precvpriv->indicate_seq, pattrib->seq_num); */ if(!pattrib->amsdu) { - //DBG_871X("recv_indicatepkts_in_order, amsdu!=1, indicate_seq=%d, seq_num=%d\n", preorder_ctrl->indicate_seq, pattrib->seq_num); + /* DBG_871X("recv_indicatepkts_in_order, amsdu!=1, indicate_seq=%d, seq_num=%d\n", preorder_ctrl->indicate_seq, pattrib->seq_num); */ 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 */ } } @@ -3072,11 +3060,11 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr } else { - //error condition; + /* error condition; */ } - //Update local variables. + /* Update local variables. */ bPktInBuf = false; } @@ -3085,32 +3073,9 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr 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_871X("_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 true; */ return bPktInBuf; } @@ -3124,11 +3089,9 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame * _queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue; if(!pattrib->amsdu) { - //s1. + /* s1. */ wlanhdr_to_ethhdr(prframe); - //if ((pattrib->qos!=1) /*|| pattrib->priority!=0 || IS_MCAST(pattrib->ra)*/ - // || (pattrib->eth_type==0x0806) || (pattrib->ack_policy!=0)) if (pattrib->qos!=1) { if ((padapter->bDriverStopped == false) && (padapter->bSurpriseRemoved == false)) { @@ -3145,7 +3108,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame * return _FAIL; } 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_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__, @@ -3164,11 +3127,11 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame * } #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) { preorder_ctrl->indicate_seq = pattrib->seq_num; #ifdef DBG_RX_SEQ @@ -3200,7 +3163,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame * ("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)) { #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s check_indicate_seq fail\n", __FUNCTION__); @@ -3208,7 +3171,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame * goto _err_exit; } - //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)) { #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s enqueue_reorder_recvframe fail\n", __FUNCTION__); @@ -3216,15 +3179,15 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame * goto _err_exit; } - //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. */ + /* */ if(recv_indicatepkts_in_order(padapter, preorder_ctrl, false)) { _set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME); @@ -3253,7 +3216,7 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext) return; } - //DBG_871X("+rtw_reordering_ctrl_timeout_handler()=>\n"); + /* DBG_871X("+rtw_reordering_ctrl_timeout_handler()=>\n"); */ _enter_critical_bh(&ppending_recvframe_queue->lock, &irql); @@ -3270,12 +3233,12 @@ int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prfram int process_recv_indicatepkts(struct 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 @@ -3285,14 +3248,14 @@ int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prfram 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_871X("DBG_RX_DROP_FRAME %s recv_indicatepkt_reorder error!\n", __FUNCTION__); @@ -3306,7 +3269,7 @@ int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prfram } } } - else //B/G mode + else /* B/G mode */ #endif { retval=wlanhdr_to_ethhdr (prframe); @@ -3321,7 +3284,7 @@ int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prfram 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); @@ -3350,12 +3313,12 @@ static int recv_func_prehandle(struct adapter *padapter, union recv_frame *rfram _queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue; - //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; } @@ -3375,10 +3338,10 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr #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); @@ -3392,17 +3355,17 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr } #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) { @@ -3429,7 +3392,7 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr 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); @@ -3443,10 +3406,10 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s process_recv_indicatepkts fail!\n", __FUNCTION__); #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); @@ -3456,14 +3419,14 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s wlanhdr_to_ethhdr: drop pkt\n", __FUNCTION__); #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) { @@ -3482,7 +3445,7 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr 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 */ } } @@ -3506,7 +3469,7 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr #endif goto _recv_data_drop; } -#endif // CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ _exit_recv_func: return ret; @@ -3554,7 +3517,7 @@ int recv_func(struct adapter *padapter, union recv_frame *rframe) !psecuritypriv->busetkipkey) { rtw_enqueue_recvframe(rframe, &padapter->recvpriv.uc_swdec_pending_queue); - //DBG_871X("%s: no key, enqueue uc_swdec_pending_queue\n", __func__); + /* DBG_871X("%s: no key, enqueue uc_swdec_pending_queue\n", __func__); */ if (recvpriv->free_recvframe_cnt < NR_RECVFRAME/4) { /* to prevent from recvframe starvation, get recvframe from uc_swdec_pending_queue to free_recvframe_cnt */ @@ -3582,7 +3545,7 @@ s32 rtw_recv_entry(union recv_frame *precvframe) ; -// 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; @@ -3619,25 +3582,25 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){ u8 avg_signal_qual = 0; u32 num_signal_strength = 0; u32 num_signal_qual = 0; - 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; num_signal_strength = recvpriv->signal_strength_data.total_num; - // 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; num_signal_qual = recvpriv->signal_qual_data.total_num; - // 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; } @@ -3658,7 +3621,7 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){ goto set_timer; } - //update value of signal_strength, rssi, signal_qual + /* update value of signal_strength, rssi, signal_qual */ tmp_s = (avg_signal_strength+(_alpha-1)*recvpriv->signal_strength); if(tmp_s %_alpha) tmp_s = tmp_s/_alpha + 1; @@ -3698,4 +3661,4 @@ set_timer: 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 f5186e1..b6b0678 100755 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -26,7 +26,7 @@ #include -//=====WEP related===== +/* WEP related===== */ #define CRC32_POLY 0x04c11db7 @@ -161,7 +161,7 @@ static __le32 getcrc32(u8 *buf, sint len) Need to consider the fragment situation */ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) -{ // exclude ICV +{ /* exclude ICV */ unsigned char crc[4]; struct arc4context mycontext; @@ -169,7 +169,7 @@ void rtw_wep_encrypt(struct 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; @@ -195,7 +195,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) 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]; @@ -208,7 +208,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) 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; @@ -242,7 +242,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe) { - // exclude ICV + /* exclude ICV */ u8 crc[4]; struct arc4context mycontext; sint length; @@ -256,25 +256,25 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe) 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=(iv[3]&0x3); + /* keyindex=(iv[3]&0x3); */ keyindex = prxattrib->key_index; keylength=psecuritypriv->dot11DefKeylen[keyindex]; memcpy(&wepkey[0], iv, 3); - //memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0],keylength); + /* memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0],keylength); */ memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0],keylength); length= ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len; 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] || crc[2]!=payload[length-2] || crc[1]!=payload[length-3] || crc[0]!=payload[length-4]) @@ -291,10 +291,10 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe) } -//3 =====TKIP related===== +/* 3 =====TKIP related===== */ static u32 secmicgetuint32( u8 * p ) -// Convert from Byte[] to Us3232 in a portable way +/* Convert from Byte[] to Us3232 in a portable way */ { s32 i; u32 res = 0; @@ -308,7 +308,7 @@ static u32 secmicgetuint32( u8 * p ) } static void secmicputuint32( u8 * p, u32 val ) -// Convert from Us3232 to Byte[] in a portable way +/* Convert from Us3232 to Byte[] in a portable way */ { long i; ; @@ -322,7 +322,7 @@ static void secmicputuint32( u8 * p, u32 val ) static void secmicclear(struct mic_data *pmicdata) { -// Reset the state to the empty message. +/* Reset the state to the empty message. */ ; pmicdata->L = pmicdata->K0; pmicdata->R = pmicdata->K1; @@ -333,11 +333,11 @@ static void secmicclear(struct mic_data *pmicdata) void rtw_secmicsetkey(struct mic_data *pmicdata, u8 * key ) { - // Set the key + /* Set the key */ ; pmicdata->K0 = secmicgetuint32( key ); pmicdata->K1 = secmicgetuint32( key + 4 ); - // and reset the message + /* and reset the message */ secmicclear(pmicdata); ; } @@ -345,10 +345,10 @@ void rtw_secmicsetkey(struct mic_data *pmicdata, u8 * key ) void rtw_secmicappendbyte(struct mic_data *pmicdata, u8 b ) { ; - // 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; @@ -360,7 +360,7 @@ void rtw_secmicappendbyte(struct mic_data *pmicdata, u8 b ) 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; } @@ -370,7 +370,7 @@ void rtw_secmicappendbyte(struct mic_data *pmicdata, u8 b ) void rtw_secmicappend(struct mic_data *pmicdata, u8 * src, u32 nbytes ) { ; - // This is simple + /* This is simple */ while( nbytes > 0 ) { rtw_secmicappendbyte(pmicdata, *src++ ); @@ -382,21 +382,21 @@ void rtw_secmicappend(struct mic_data *pmicdata, u8 * src, u32 nbytes ) void rtw_secgetmic(struct mic_data *pmicdata, u8 * dst ) { ; - // 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); ; } @@ -412,16 +412,16 @@ void rtw_seccalctkipmic(u8 * key,u8 *header,u8 *data,u32 data_len,u8 *mic_code, 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); @@ -647,9 +647,9 @@ static void phase2(u8 *rc4key,const u8 *tk,const u16 *p1k,u16 iv16) } -//The hlen isn't include the IV +/* The hlen isn't include the IV */ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) -{ // exclude ICV +{ /* exclude ICV */ u16 pnl; u32 pnh; u8 rc4key[16]; @@ -684,7 +684,7 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) #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) @@ -731,7 +731,7 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) 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", pattrib->iv_len,pattrib->icv_len)); *((__le32 *)crc)=getcrc32(payload,length);/* modified by Amy*/ @@ -769,9 +769,9 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) } -//The hlen isn't include the IV +/* The hlen isn't include the IV */ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe) -{ // exclude ICV +{ /* exclude ICV */ u16 pnl; u32 pnh; u8 rc4key[16]; @@ -786,14 +786,14 @@ u32 rtw_tkip_decrypt(struct 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; ; 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] ); @@ -837,8 +837,8 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe) no_gkey_bc_cnt = 0; no_gkey_mc_cnt = 0; - //DBG_871X("rx bc/mc packets, to perform sw rtw_tkip_decrypt\n"); - //prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; + /* DBG_871X("rx bc/mc packets, to perform sw rtw_tkip_decrypt\n"); */ + /* prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; */ prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey; prwskeylen=16; } @@ -861,7 +861,7 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe) 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); @@ -890,7 +890,7 @@ exit: } -//3 =====AES related===== +/* 3 =====AES related===== */ @@ -947,12 +947,12 @@ static void construct_mic_iv( u8 *mpdu, uint payload_length, u8 * pn_vector, - uint frtype);// add for CONFIG_IEEE80211W, none 11w also can use + uint frtype);/* add for CONFIG_IEEE80211W, none 11w also can use */ static void construct_mic_header1( u8 *mic_header1, sint header_length, u8 *mpdu, - uint frtype);// add for CONFIG_IEEE80211W, none 11w also can use + uint frtype);/* add for CONFIG_IEEE80211W, none 11w also can use */ static void construct_mic_header2( u8 *mic_header2, u8 *mpdu, @@ -965,7 +965,7 @@ static void construct_ctr_preload( u8 *mpdu, u8 *pn_vector, sint c, - uint frtype);// add for CONFIG_IEEE80211W, none 11w also can use + uint frtype);/* add for CONFIG_IEEE80211W, none 11w also can use */ static void xor_128(u8 *a, u8 *b, u8 *out); static void xor_32(u8 *a, u8 *b, u8 *out); static u8 sbox(u8 a); @@ -1193,7 +1193,7 @@ static void construct_mic_iv( u8 *mpdu, uint payload_length, u8 *pn_vector, - uint frtype// add for CONFIG_IEEE80211W, none 11w also can use + uint frtype/* add for CONFIG_IEEE80211W, none 11w also can use */ ) { sint i; @@ -1203,10 +1203,10 @@ static void construct_mic_iv( if (qc_exists && !a4_exists) mic_iv[1] = mpdu[24] & 0x0f; /* mute bits 7-4 */ if (!qc_exists) mic_iv[1] = 0x00; #ifdef CONFIG_IEEE80211W - //802.11w management frame should set management bit(4) + /* 802.11w management frame should set management bit(4) */ if(frtype == WIFI_MGT_TYPE) mic_iv[1] |= BIT(4); -#endif //CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ for (i = 2; i < 8; i++) mic_iv[i] = mpdu[i + 8]; /* mic_iv[2:7] = A2[0:5] = mpdu[10:15] */ #ifdef CONSISTENT_PN_ORDER @@ -1232,18 +1232,18 @@ static void construct_mic_header1( u8 *mic_header1, sint header_length, u8 *mpdu, - uint frtype// add for CONFIG_IEEE80211W, none 11w also can use + uint frtype/* add for CONFIG_IEEE80211W, none 11w also can use */ ) { ; mic_header1[0] = (u8)((header_length - 2) / 256); mic_header1[1] = (u8)((header_length - 2) % 256); #ifdef CONFIG_IEEE80211W - //802.11w management frame don't AND subtype bits 4,5,6 of frame control field + /* 802.11w management frame don't AND subtype bits 4,5,6 of frame control field */ if(frtype == WIFI_MGT_TYPE) mic_header1[2] = mpdu[0]; /* Mute CF poll & CF ack bits */ else -#endif //CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ mic_header1[2] = mpdu[0] & 0xcf; /* Mute CF poll & CF ack bits */ mic_header1[3] = mpdu[1] & 0xc7; /* Mute retry, more data and pwr mgt bits */ @@ -1286,7 +1286,6 @@ static void construct_mic_header2( 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]; */ @@ -1329,7 +1328,7 @@ static void construct_ctr_preload( u8 *mpdu, u8 *pn_vector, sint c, - uint frtype // add for CONFIG_IEEE80211W, none 11w also can use + uint frtype /* add for CONFIG_IEEE80211W, none 11w also can use */ ) { sint i = 0; @@ -1343,10 +1342,10 @@ static void construct_ctr_preload( if (qc_exists && !a4_exists) ctr_preload[1] = mpdu[24] & 0x0f; #ifdef CONFIG_IEEE80211W - //802.11w management frame should set management bit(4) + /* 802.11w management frame should set management bit(4) */ if(frtype == WIFI_MGT_TYPE) ctr_preload[1] |= BIT(4); -#endif //CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ for (i = 2; i < 8; i++) ctr_preload[i] = mpdu[i + 8]; /* ctr_preload[2:7] = A2[0:5] = mpdu[10:15] */ #ifdef CONSISTENT_PN_ORDER @@ -1381,7 +1380,6 @@ static void bitwise_xor(u8 *ina, u8 *inb, u8 *out) 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; @@ -1396,7 +1394,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); @@ -1428,7 +1425,7 @@ static sint aes_cipher(u8 *key, uint hdrlen, hdrlen += 2; } } - // add for CONFIG_IEEE80211W, none 11w also can use + /* add for CONFIG_IEEE80211W, none 11w also can use */ else if ((frtype == WIFI_DATA) && ((frsubtype == 0x08) || (frsubtype == 0x09)|| @@ -1455,21 +1452,21 @@ static sint aes_cipher(u8 *key, uint hdrlen, mic_iv, qc_exists, a4_exists, - pframe, //message, + pframe, /* message, */ plen, pn_vector, - frtype // add for CONFIG_IEEE80211W, none 11w also can use + frtype /* add for CONFIG_IEEE80211W, none 11w also can use */ ); construct_mic_header1( mic_header1, hdrlen, - pframe, //message - frtype // add for CONFIG_IEEE80211W, none 11w also can use + pframe, /* message */ + frtype /* add for CONFIG_IEEE80211W, none 11w also can use */ ); construct_mic_header2( mic_header2, - pframe, //message, + pframe, /* message, */ a4_exists, qc_exists ); @@ -1490,7 +1487,7 @@ static sint aes_cipher(u8 *key, uint hdrlen, 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); @@ -1502,7 +1499,7 @@ static sint aes_cipher(u8 *key, uint hdrlen, 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); @@ -1513,7 +1510,7 @@ static sint aes_cipher(u8 *key, uint hdrlen, /* 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++) @@ -1522,13 +1519,13 @@ static sint aes_cipher(u8 *key, uint hdrlen, ctr_preload, a4_exists, qc_exists, - pframe, //message, + pframe, /* message, */ pn_vector, i+1, - frtype); // add for CONFIG_IEEE80211W, none 11w also can use + frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */ 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,*/ @@ -1537,19 +1534,19 @@ static sint aes_cipher(u8 *key, uint hdrlen, ctr_preload, a4_exists, qc_exists, - pframe, //message, + pframe, /* message, */ pn_vector, num_blocks+1, - frtype); // add for CONFIG_IEEE80211W, none 11w also can use + frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */ 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; ; @@ -1616,7 +1613,7 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe) 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) @@ -1648,7 +1645,7 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe) 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] ); @@ -1658,13 +1655,13 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe) prwskey=&ptdls_sta->tpk.tk[0]; } } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ prwskeylen=16; 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); @@ -1715,7 +1712,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); ; @@ -1730,9 +1727,9 @@ static sint aes_decipher(u8 *key, uint hdrlen, memset((void *)aes_out, 0, 16); 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; @@ -1758,7 +1755,7 @@ static sint aes_decipher(u8 *key, uint hdrlen, hdrlen += 2; } - }//only for data packet . add for CONFIG_IEEE80211W, none 11w also can use + }/* only for data packet . add for CONFIG_IEEE80211W, none 11w also can use */ else if ((frtype == WIFI_DATA) && ((frsubtype == 0x08) || (frsubtype == 0x09)|| @@ -1775,9 +1772,9 @@ static sint aes_decipher(u8 *key, uint hdrlen, 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++) { @@ -1806,7 +1803,7 @@ static sint aes_decipher(u8 *key, uint hdrlen, pframe, pn_vector, num_blocks+1, - frtype // add for CONFIG_IEEE80211W, none 11w also can use + frtype /* add for CONFIG_IEEE80211W, none 11w also can use */ ); for (j = 0; j < 16; j++) padded_buffer[j] = 0x00; @@ -1819,9 +1816,9 @@ static sint aes_decipher(u8 *key, uint hdrlen, for (j=0; ju.hdr.attrib; struct security_priv *psecuritypriv=&padapter->securitypriv; u32 res=_SUCCESS; ; 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] ); if (stainfo!=NULL){ @@ -1990,7 +1987,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe) static u32 no_gkey_bc_cnt = 0; static u32 no_gkey_mc_cnt = 0; - //in concurrent we should use sw descrypt in group key, so we remove this message + /* in concurrent we should use sw descrypt in group key, so we remove this message */ if (!psecuritypriv->binstallGrpkey) { res=_FAIL; @@ -2066,29 +2063,29 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe) DBG_871X("BIP AAD allocate fail\n"); return _FAIL; } - //PKT start + /* PKT start */ pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data; - //mapping to wlan header + /* mapping to wlan header */ pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; - //save the frame body + MME + /* save the frame body + MME */ memcpy(BIP_AAD+BIP_AAD_SIZE, pframe+WLAN_HDR_A3_LEN, pattrib->pkt_len-WLAN_HDR_A3_LEN); - //find MME IE pointer + /* find MME IE pointer */ p = rtw_get_ie(BIP_AAD+BIP_AAD_SIZE, _MME_IE_, &len, pattrib->pkt_len-WLAN_HDR_A3_LEN); - //Baron + /* Baron */ if(p) { u16 keyid=0; u64 temp_ipn=0; - //save packet number + /* save packet number */ memcpy(&temp_ipn, p+4, 6); temp_ipn = le64_to_cpu(temp_ipn); - //BIP packet number should bigger than previous BIP packet + /* BIP packet number should bigger than previous BIP packet */ if(temp_ipn <= pmlmeext->mgnt_80211w_IPN_rx) { DBG_871X("replay BIP packet\n"); goto BIP_exit; } - //copy key index + /* copy key index */ memcpy(&keyid, p+2, 2); keyid = le16_to_cpu(keyid); if(keyid != padapter->securitypriv.dot11wBIPKeyid) @@ -2096,41 +2093,41 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe) DBG_871X("BIP key index error!\n"); goto BIP_exit; } - //clear the MIC field of MME to zero + /* clear the MIC field of MME to zero */ memset(p+2+len-8, 0, 8); - //conscruct AAD, copy frame control field + /* conscruct AAD, copy frame control field */ memcpy(BIP_AAD, &pwlanhdr->frame_ctl, 2); ClearRetry(BIP_AAD); ClearPwrMgt(BIP_AAD); ClearMData(BIP_AAD); - //conscruct AAD, copy address 1 to address 3 + /* conscruct AAD, copy address 1 to address 3 */ memcpy(BIP_AAD+2, pwlanhdr->addr1, 18); if(omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->securitypriv.dot11wBIPKeyid].skey , BIP_AAD, ori_len, mic)) goto BIP_exit; - /*//management packet content + /*/* management packet content */ { int pp; DBG_871X("pkt: "); for(pp=0;pp< pattrib->pkt_len; pp++) printk(" %02x ", pframe[pp]); DBG_871X("\n"); - //BIP AAD + management frame body + MME(MIC is zero) + /* BIP AAD + management frame body + MME(MIC is zero) */ DBG_871X("AAD+PKT: "); for(pp=0;pp< ori_len; pp++) DBG_871X(" %02x ", BIP_AAD[pp]); DBG_871X("\n"); - //show the MIC result + /* show the MIC result */ DBG_871X("mic: "); for(pp=0;pp<16; pp++) DBG_871X(" %02x ", mic[pp]); DBG_871X("\n"); } */ - //MIC field should be last 8 bytes of packet (packet without FCS) + /* MIC field should be last 8 bytes of packet (packet without FCS) */ if(_rtw_memcmp(mic, pframe+pattrib->pkt_len-8, 8)) { pmlmeext->mgnt_80211w_IPN_rx = temp_ipn; @@ -2147,7 +2144,7 @@ BIP_exit: rtw_mfree(BIP_AAD, ori_len); return res; } -#endif //CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ /* compress 512-bits */ static int sha256_compress(struct sha256_state *md, unsigned char *buf) @@ -2851,7 +2848,7 @@ static int omac1_aes_128_vector(u8 *key, size_t num_elem, * This is a mode for using block cipher (AES in this case) for authentication. * OMAC1 was standardized with the name CMAC by NIST in a Special Publication * (SP) 800-38B. - */ //modify for CONFIG_IEEE80211W + */ /* modify for CONFIG_IEEE80211W */ 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); @@ -3016,16 +3013,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_871X( "[%s] Invalid MIC\n", __FUNCTION__); return 0; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ void rtw_use_tkipkey_handler(void *FunctionContext) { diff --git a/core/rtw_sreset.c b/core/rtw_sreset.c index 99f8570..287e0a6 100755 --- a/core/rtw_sreset.c +++ b/core/rtw_sreset.c @@ -39,7 +39,7 @@ void sreset_reset_value(struct adapter *padapter) HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); struct sreset_priv *psrtpriv = &pHalData->srestpriv; - //psrtpriv->silent_reset_inprogress = false; + /* psrtpriv->silent_reset_inprogress = false; */ psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS; psrtpriv->last_tx_time =0; psrtpriv->last_tx_complete_time =0; @@ -75,7 +75,7 @@ u8 sreset_get_wifi_status(struct adapter *padapter) } DBG_8192C("==> %s wifi_status(0x%x)\n",__FUNCTION__,status); - //status restore + /* status restore */ psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS; return status; @@ -126,7 +126,7 @@ static void sreset_restore_security_station(struct adapter *padapter) val8 = 0xcc; #ifdef CONFIG_WAPI_SUPPORT } else if (padapter->wapiInfo.bWapiEnable && pmlmeinfo->auth_algo == dot11AuthAlgrthm_WAPI) { - //Disable TxUseDefaultKey, RxUseDefaultKey, RxBroadcastUseDefaultKey. + /* Disable TxUseDefaultKey, RxUseDefaultKey, RxBroadcastUseDefaultKey. */ val8 = 0x4c; #endif } else { @@ -140,13 +140,13 @@ static void sreset_restore_security_station(struct adapter *padapter) { psta = rtw_get_stainfo(pstapriv, get_bssid(mlmepriv)); if (psta == NULL) { - //DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail \n")); + /* DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail \n")); */ } else { - //pairwise key + /* pairwise key */ rtw_setstakey_cmd(padapter, (unsigned char *)psta, true,false); - //group key + /* group key */ rtw_set_key(padapter,&padapter->securitypriv,padapter->securitypriv.dot118021XGrpKeyid, 0,false); } } @@ -162,8 +162,8 @@ static void sreset_restore_network_station(struct adapter *padapter) { u8 threshold; - // 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(mlmepriv->htpriv.ht_option) { if(padapter->registrypriv.wifi_spec==1) threshold = 1; @@ -178,8 +178,8 @@ static void sreset_restore_network_station(struct adapter *padapter) set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); - //disable dynamic functions, such as high power, DIG - //Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false); + /* disable dynamic functions, such as high power, DIG */ + /* Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false); */ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress); @@ -191,7 +191,7 @@ static void sreset_restore_network_station(struct adapter *padapter) Set_MSR(padapter, (pmlmeinfo->state & 0x3)); mlmeext_joinbss_event_callback(padapter, 1); - //restore Sequence No. + /* restore Sequence No. */ rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn); sreset_restore_security_station(padapter); diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 7e893ab..6f76af5 100755 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -40,9 +40,9 @@ void _rtw_init_stainfo(struct sta_info *psta) _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; @@ -76,11 +76,11 @@ void _rtw_init_stainfo(struct sta_info *psta) #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 */ #ifdef DBG_TRX_STA_PKTS psta->tx_be_cnt = 0; @@ -116,7 +116,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) _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); @@ -149,14 +149,12 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) 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 #ifdef CONFIG_ATMEL_RC_PATCH memset( pstapriv->atmel_rc_pattern, 0, ETH_ALEN); @@ -230,7 +228,7 @@ void rtw_mfree_stainfo(struct sta_info *psta) } -// 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 ) { @@ -266,7 +264,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); @@ -328,7 +326,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) } -//struct sta_info *rtw_alloc_stainfo(_queue *pfree_sta_queue, unsigned char *hwaddr) +/* struct sta_info *rtw_alloc_stainfo(_queue *pfree_sta_queue, unsigned char *hwaddr) */ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) { _irqL irqL, irqL2; @@ -346,7 +344,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2); if (_rtw_queue_empty(pfree_sta_queue) == true) { -// _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2); +/* _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2); */ psta = NULL; } else { psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list); @@ -376,10 +374,10 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) pstapriv->asoc_sta_count ++ ; -// 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++ ) memcpy( &psta->sta_recvpriv.rxcache.tid_rxseq[ i ], &wRxSeqInitialValue, 2 ); @@ -397,9 +395,9 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) 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]; @@ -413,8 +411,8 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) 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); @@ -422,7 +420,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) } - //init for DM + /* init for DM */ psta->rssi_stat.UndecoratedSmoothedPWDB = (-1); psta->rssi_stat.UndecoratedSmoothedCCK = (-1); #ifdef CONFIG_ATMEL_RC_PATCH @@ -437,7 +435,7 @@ exit: } -// using pstapriv->sta_hash_lock to protect +/* using pstapriv->sta_hash_lock to protect */ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta) { int i; @@ -465,62 +463,56 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta) 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; - //vo - //_enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0); + /* vo */ + /* _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)); phwxmit = pxmitpriv->hwxmits; phwxmit->accnt -= pstaxmitpriv->vo_q.qcnt; pstaxmitpriv->vo_q.qcnt = 0; - //_exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0); + /* _exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0); */ - //vi - //_enter_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0); + /* vi */ + /* _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)); phwxmit = pxmitpriv->hwxmits+1; phwxmit->accnt -= pstaxmitpriv->vi_q.qcnt; pstaxmitpriv->vi_q.qcnt = 0; - //_exit_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0); + /* _exit_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0); */ - //be - //_enter_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0); + /* be */ + /* _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)); phwxmit = pxmitpriv->hwxmits+2; phwxmit->accnt -= pstaxmitpriv->be_q.qcnt; pstaxmitpriv->be_q.qcnt = 0; - //_exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0); + /* _exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0); */ - //bk - //_enter_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0); + /* bk */ + /* _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)); phwxmit = pxmitpriv->hwxmits+3; phwxmit->accnt -= pstaxmitpriv->bk_q.qcnt; pstaxmitpriv->bk_q.qcnt = 0; - //_exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0); + /* _exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0); */ _exit_critical_bh(&pxmitpriv->lock, &irqL0); rtw_list_delete(&psta->hash_list); RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("\n free number_%d stainfo with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n",pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5])); pstapriv->asoc_sta_count --; - - - // re-init sta_info; 20061114 // will be init in alloc_stainfo - //_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv); - //_rtw_init_sta_recv_priv(&psta->sta_recvpriv); - _cancel_timer_ex(&psta->addba_retry_timer); #ifdef CONFIG_TDLS @@ -530,9 +522,9 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta) _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; @@ -605,7 +597,7 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta) 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)) { @@ -613,19 +605,19 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta) 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 */ _rtw_spinlock_free(&psta->lock); - //_enter_critical_bh(&(pfree_sta_queue->lock), &irqL0); + /* _enter_critical_bh(&(pfree_sta_queue->lock), &irqL0); */ rtw_list_insert_tail(&psta->list, get_list_head(pfree_sta_queue)); - //_exit_critical_bh(&(pfree_sta_queue->lock), &irqL0); + /* _exit_critical_bh(&(pfree_sta_queue->lock), &irqL0); */ exit: @@ -635,7 +627,7 @@ exit: } -// free all stainfo which in sta_hash[all] +/* free all stainfo which in sta_hash[all] */ void rtw_free_all_stainfo(struct adapter *padapter) { _irqL irqL; @@ -721,7 +713,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) 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; @@ -743,7 +735,7 @@ u32 rtw_init_bcmc_stainfo(struct 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; */ ; @@ -755,7 +747,7 @@ u32 rtw_init_bcmc_stainfo(struct adapter* padapter) goto exit; } - // default broadcast & multicast use macid 1 + /* default broadcast & multicast use macid 1 */ psta->mac_id = 1; ptxservq= &(psta->sta_xmitpriv.be_q); @@ -820,11 +812,11 @@ u8 rtw_access_ctrl(struct 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 5827b06..36fb471 100755 --- 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; 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, 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 */ 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 */ 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 */ 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 */ memcpy(pwlanhdr->addr1, rx_pkt_pattrib->src, ETH_ALEN); 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 memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN); 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_871X("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_871X("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_871X("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; 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; 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; 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,19 +1730,15 @@ 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); - } - } if(ptdls_sta->sleepq_len==0) { DBG_871X("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 +1792,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 +1853,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_871X("back to base channel %x\n", pmlmeext->cur_channel); @@ -1871,7 +1867,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 +1887,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 +1931,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 - // available for WFD session + Preferred TDLS + WSD ( WFD Service Discovery ) + /* Value1: */ + /* WFD device information */ + /* available for WFD session + Preferred TDLS + WSD ( WFD Service Discovery ) */ RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | 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 ) { memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); @@ -1996,26 +1992,26 @@ void wfd_ie_tdls(_adapter * padapter, u8 *pframe, u32 *pktlen ) 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 */ 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 +2024,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 +2032,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 +2044,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 */ memcpy(pframe, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); if(pattrib->encrypt) @@ -2063,7 +2059,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 +2073,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 - memset(pframe, 0, 84); //All fields except SNonce shall be set to 0 - memset(pframe, _FTIE_, 1); //version - memset((pframe+1), 82, 1); //length + /* FTIE */ + memset(pframe, 0, 84); /* All fields except SNonce shall be set to 0 */ + memset(pframe, _FTIE_, 1); /* version */ + memset((pframe+1), 82, 1); /* length */ memcpy((pframe+52), ptdls_sta->SNonce, 32); pframe += 84; pattrib->pktlen += 84; - //Timeout interval + /* Timeout interval */ timeout_itvl[0]=0x02; 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 */ memcpy(link_id_addr, pattrib->ra, 6); memcpy((link_id_addr+6), pattrib->src, 6); memcpy((link_id_addr+12), pattrib->dst, 6); @@ -2132,7 +2128,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 +2151,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 +2172,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_871X("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 */ memcpy(pframe, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); if(pattrib->encrypt ) @@ -2200,7 +2196,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 +2210,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; - memset(pframe, 0, 84); //All fields except SNonce shall be set to 0 - memset(pframe, _FTIE_, 1); //version - memset((pframe+1), 82, 1); //length + memset(pframe, 0, 84); /* All fields except SNonce shall be set to 0 */ + memset(pframe, _FTIE_, 1); /* version */ + memset((pframe+1), 82, 1); /* length */ memcpy((pframe+20), ptdls_sta->ANonce, 32); memcpy((pframe+52), ptdls_sta->SNonce, 32); pframe += 84; pattrib->pktlen += 84; - //Timeout interval + /* Timeout interval */ ptimeout_ie = pframe; timeout_itvl[0]=0x02; 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; memcpy(link_id_addr, pattrib->ra, 6); memcpy((link_id_addr+6), pattrib->dst, 6); 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 +2295,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; - memset(pframe, 0, 84); //All fields except SNonce shall be set to 0 - memset(pframe, _FTIE_, 1); //version - memset((pframe+1), 82, 1); //length + memset(pframe, 0, 84); /* All fields except SNonce shall be set to 0 */ + memset(pframe, _FTIE_, 1); /* version */ + memset((pframe+1), 82, 1); /* length */ memcpy((pframe+20), ptdls_sta->ANonce, 32); memcpy((pframe+52), ptdls_sta->SNonce, 32); pframe += 84; pattrib->pktlen += 84; - //Timeout interval + /* Timeout interval */ ptimeout_ie = pframe; timeout_itvl[0]=0x02; memcpy(timeout_itvl+1, (u8 *)(&ptdls_sta->TDLS_PeerKey_Lifetime), 4); @@ -2343,15 +2339,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; memcpy(link_id_addr, pattrib->ra, 6); memcpy((link_id_addr+6), pattrib->src, 6); 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 +2365,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){ memcpy(link_id_addr, pattrib->ra, 6); memcpy((link_id_addr+6), pattrib->src, 6); @@ -2400,15 +2396,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 */ memcpy(link_id_addr, pattrib->ra, 6); memcpy((link_id_addr+6), pattrib->src, 6); memcpy((link_id_addr+12), pattrib->dst, 6); @@ -2432,15 +2428,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 */ memcpy(pframe, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2); if(pattrib->encrypt) @@ -2448,7 +2444,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 +2458,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 - memset(pframe, 0, 84); //All fields shall be set to 0 - memset(pframe, _FTIE_, 1); //version - memset((pframe+1), 82, 1); //length + /* FTIE */ + memset(pframe, 0, 84); /* All fields shall be set to 0 */ + memset(pframe, _FTIE_, 1); /* version */ + memset((pframe+1), 82, 1); /* length */ pframe += 84; pattrib->pktlen += 84; - //Timeout interval + /* Timeout interval */ timeout_itvl[0]=0x02; 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 */ memcpy(link_id_addr, pattrib->ra, 6); memcpy((link_id_addr+6), pattrib->dst, 6); memcpy((link_id_addr+12), pattrib->src, 6); @@ -2521,21 +2517,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 */ memcpy(link_id_addr, pattrib->ra, 6); memcpy((link_id_addr+6), pattrib->src, 6); 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 +2558,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 */ memcpy(link_id_addr, pattrib->ra, 6); memcpy((link_id_addr+6), pattrib->src, 6); 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 */ memcpy(ch_switch_timing, &switch_time, 2); 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 +2597,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 */ memcpy(link_id_addr, pattrib->ra, 6); memcpy((link_id_addr+6), pattrib->src, 6); 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 */ memcpy(ch_switch_timing, &ptdls_sta->ch_switch_time, 2); 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 +2630,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 +2664,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 +2685,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 +2709,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 +2778,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 +2891,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 +2914,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 +2933,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 e1089d7..8d8a480 100755 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -47,7 +47,7 @@ unsigned char REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20}; #define R2T_PHY_DELAY (0) -//#define WAIT_FOR_BCN_TO_MIN (3000) +/* define WAIT_FOR_BCN_TO_MIN (3000) */ #define WAIT_FOR_BCN_TO_MIN (6000) #define WAIT_FOR_BCN_TO_MAX (20000) @@ -312,7 +312,7 @@ void UpdateBrateTbl( 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;isetch_mutex), NULL); - //saved channel info + /* saved channel info */ rtw_set_oper_ch(padapter, channel); rtw_hal_set_chan(padapter, channel); @@ -454,7 +454,7 @@ void SetBWMode(struct adapter *padapter, unsigned short bwmode, unsigned char ch _enter_critical_mutex(&(adapter_to_dvobj(padapter)->setbw_mutex), NULL); - //saved bw info + /* saved bw info */ rtw_set_oper_bw(padapter, bwmode); rtw_set_oper_choffset(padapter, channel_offset); @@ -475,33 +475,33 @@ void set_channel_bwmode(struct adapter *padapter, unsigned char channel, unsigne 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 */ _enter_critical_mutex(&(adapter_to_dvobj(padapter)->setch_mutex), NULL); - //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 */ _exit_critical_mutex(&(adapter_to_dvobj(padapter)->setch_mutex), NULL); @@ -623,14 +623,14 @@ void invalidate_cam_all(struct adapter *padapter) void read_cam(struct adapter *padapter ,u8 entry) { u32 j,count = 0, addr; - u32 cam_val[2]; //cam_val[0] is read_val, cam_val[1] is the address + u32 cam_val[2]; /* cam_val[0] is read_val, cam_val[1] is the address */ addr = entry << 3; DBG_8192C("********* DUMP CAM Entry_#%02d***************\n",entry); for (j = 0; j < 6; j++) { - //cmd = _ReadCAM(padapter ,addr+j); - //HW_VAR_CAM_READ + /* cmd = _ReadCAM(padapter ,addr+j); */ + /* HW_VAR_CAM_READ */ cam_val[1]=addr+j; rtw_hal_get_hwreg(padapter, HW_VAR_CAM_READ, (u8 *)cam_val); DBG_8192C("offset:0x%02x => 0x%08x \n",addr+j,cam_val[0]); @@ -741,7 +741,7 @@ int WFD_info_handler(struct adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) int WMM_param_handler(struct 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); @@ -755,27 +755,6 @@ int WMM_param_handler(struct adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) pmlmeinfo->WMM_enable = 1; 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; - _rtwmemcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element)); - return true; - } - } - else - { - pmlmeinfo->WMM_enable = 0; - return _FAIL; - }*/ - } void WMMOnAssocRsp(struct adapter *padapter) @@ -808,7 +787,7 @@ void WMMOnAssocRsp(struct 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); @@ -827,7 +806,7 @@ void WMMOnAssocRsp(struct 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; @@ -858,19 +837,19 @@ void WMMOnAssocRsp(struct 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; } @@ -955,7 +934,7 @@ static void bwmode_update_check(struct adapter *padapter, PNDIS_802_11_VARIABLE_ 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 @@ -970,10 +949,10 @@ static void bwmode_update_check(struct adapter *padapter, PNDIS_802_11_VARIABLE_ 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) { @@ -981,7 +960,7 @@ static void bwmode_update_check(struct adapter *padapter, PNDIS_802_11_VARIABLE_ if(phtpriv_sta->ht_option) { - // bwmode + /* bwmode */ phtpriv_sta->bwmode = pmlmeext->cur_bwmode; phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset; } @@ -992,11 +971,8 @@ static void bwmode_update_check(struct adapter *padapter, PNDIS_802_11_VARIABLE_ } } - - //pmlmeinfo->bwmode_updated = false;//bwmode_updated done, reset it! - } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ } void HT_caps_handler(struct adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) @@ -1021,13 +997,13 @@ void HT_caps_handler(struct 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); @@ -1050,15 +1026,15 @@ void HT_caps_handler(struct adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) } } - // Commented by Albert 2010/07/12 - // Have to handle the endian issue after copying. - // HT_ext_caps didn't be used yet. + /* Commented by Albert 2010/07/12 */ + /* Have to handle the endian issue after copying. */ + /* HT_ext_caps didn't be used yet. */ pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info = pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info; pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps = pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps; 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)) @@ -1074,7 +1050,7 @@ void HT_caps_handler(struct 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 { @@ -1082,7 +1058,7 @@ void HT_caps_handler(struct adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) } #endif } -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ return; } @@ -1104,7 +1080,7 @@ void HT_info_handler(struct adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) pmlmeinfo->HT_info_enable = 1; memcpy(&(pmlmeinfo->HT_info), pIE->data, pIE->Length); -#endif //CONFIG_80211N_HT +#endif /* CONFIG_80211N_HT */ return; } @@ -1112,7 +1088,7 @@ void HTOnAssocRsp(struct 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); @@ -1125,11 +1101,11 @@ void HTOnAssocRsp(struct 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 @@ -1163,12 +1139,12 @@ void VCS_update(struct 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; @@ -1181,7 +1157,7 @@ void VCS_update(struct adapter *padapter, struct sta_info *psta) } break; - case 2: //auto + case 2: /* auto */ default: if ((pmlmeinfo->ERP_enable) && (pmlmeinfo->ERP_IE & BIT(1))) { @@ -1208,7 +1184,7 @@ void VCS_update(struct 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) { @@ -1221,7 +1197,7 @@ int check_ap_tdls_prohibited(u8 *pframe, u8 pkt_len) return false; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) { @@ -1229,7 +1205,7 @@ int rtw_check_bcn_info(struct 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; @@ -1301,12 +1277,12 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) cur_network->BcnInfo.ht_cap_info, cur_network->BcnInfo.ht_info_infos_0); DBG_871X("%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 */ @@ -1442,8 +1418,8 @@ void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, stru #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); @@ -1452,8 +1428,8 @@ void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, stru pIE = (PNDIS_802_11_VARIABLE_IEs)(pframe + (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN) + i); 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; @@ -1466,7 +1442,7 @@ void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, stru if( check_ap_tdls_prohibited(pIE->data, pIE->Length) == true ) ptdlsinfo->ap_prohibited = true; break; -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ default: break; } @@ -1503,7 +1479,7 @@ void process_csa_ie(struct adapter *padapter, u8 *pframe, uint pkt_len) i += (pIE->Length + 2); } } -#endif //CONFIG_DFS +#endif /* CONFIG_DFS */ unsigned int is_ap_in_tkip(struct adapter *padapter) { @@ -1802,27 +1778,27 @@ void enable_rate_adaptive(struct adapter *padapter, struct sta_info *psta) void set_sta_rate(struct adapter *padapter, struct sta_info *psta) { - //rate adaptive + /* rate adaptive */ enable_rate_adaptive(padapter, psta); } -// Update RRSR and Rate for USERATE +/* Update RRSR and Rate for USERATE */ void update_tx_basic_rate(struct 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 */ memset(supported_rates, 0, NDIS_802_11_LENGTH_RATES_EX); @@ -1948,13 +1924,13 @@ void update_IOT_info(struct 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: @@ -1971,14 +1947,14 @@ void update_capinfo(struct adapter *Adapter, u16 updateCap) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); BOOLEAN 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; @@ -1986,8 +1962,8 @@ void update_capinfo(struct adapter *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; @@ -1997,23 +1973,23 @@ void update_capinfo(struct adapter *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; @@ -2026,7 +2002,7 @@ void update_capinfo(struct adapter *Adapter, u16 updateCap) } else { - //B Mode + /* B Mode */ pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME; } } @@ -2082,16 +2058,8 @@ void update_wireless_mode(struct 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); @@ -2108,7 +2076,7 @@ void update_bmc_sta_support_rate(struct 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 */ memcpy((pmlmeinfo->FW_sta_info[mac_id].SupportedRates), rtw_basic_rate_cck, 4); } else @@ -2219,7 +2187,7 @@ int rtw_handle_dualmac(struct 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_871X("%s(): pbuddy_padapter exist, Exchange Information\n",__FUNCTION__); } @@ -2297,4 +2265,4 @@ void rtw_set_sec_iv(struct adapter *padapter) DBG_871X("%s: dot11txpn: 0x%016llx\n", __func__ ,psta->dot11txpn.val); } } -#endif //CONFIG_WOWLAN +#endif /* CONFIG_WOWLAN */ diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index c3e4410..a8fd2f3 100755 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -52,8 +52,8 @@ void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv) _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, struct adapter *padapter) ; - // We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). - //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(). */ + /* memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); */ _rtw_spinlock_init(&pxmitpriv->lock); _rtw_spinlock_init(&pxmitpriv->lock_sctx); @@ -91,8 +91,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) 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); @@ -100,8 +100,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) _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 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) 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 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) 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 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) } 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 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) 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); @@ -239,7 +228,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) } pxmitpriv->free_xframe_ext_cnt = num_xmit_extbuf; - // 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); @@ -300,7 +289,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) _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; @@ -334,8 +323,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); @@ -372,8 +361,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++; } @@ -398,7 +387,7 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv) rtw_vmfree(pxmitpriv->xframe_ext_alloc_addr, num_xmit_extbuf * sizeof(struct xmit_frame) + 4); _rtw_spinlock_free(&pxmitpriv->free_xframe_ext_queue.lock); - // free xmit extension buff + /* free xmit extension buff */ _rtw_spinlock_free(&pxmitpriv->free_xmit_extbuf_queue.lock); pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; @@ -406,8 +395,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++; } @@ -462,15 +451,15 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame * { 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) @@ -491,7 +480,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame * { while (true) { - //IOT action + /* IOT action */ if((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) && (pattrib->ampdu_en==true) && (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_ )) { @@ -500,7 +489,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame * } - //check ERP protection + /* check ERP protection */ if(psta->rtsen || psta->cts2self) { if(psta->rtsen) @@ -511,7 +500,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame * break; } - //check HT op mode + /* check HT op mode */ if(pattrib->ht_en) { u8 HTOpMode = pmlmeinfo->HT_protection; @@ -523,16 +512,16 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame * } } - //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; @@ -558,7 +547,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; @@ -568,12 +557,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; @@ -622,14 +611,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; } @@ -683,27 +672,19 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib 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; } } @@ -718,7 +699,7 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib } #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 @@ -731,12 +712,12 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib 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:" MAC_FMT"\n", MAC_ARG(pattrib->ra))); #ifdef DBG_TX_DROP_FRAME DBG_871X("DBG_TX_DROP_FRAME %s get sta_info fail, ra:" MAC_FMT"\n", __FUNCTION__, MAC_ARG(pattrib->ra)); @@ -754,12 +735,12 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib if (psta) { pattrib->mac_id = psta->mac_id; - //DBG_8192C("%s ==> mac_id(%d)\n",__FUNCTION__,pattrib->mac_id ); + /* DBG_8192C("%s ==> mac_id(%d)\n",__FUNCTION__,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:" MAC_FMT "\n", MAC_ARG(pattrib->ra))); #ifdef DBG_TX_DROP_FRAME DBG_871X("DBG_TX_DROP_FRAME %s get sta_info fail, ra:" MAC_FMT"\n", __FUNCTION__, MAC_ARG(pattrib->ra)); @@ -769,8 +750,8 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib } 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; @@ -793,11 +774,7 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib } } } - - //pattrib->priority = 5; //force to used VI queue, for testing - - if (psta->ieee8021x_blocked == true) - { + if (psta->ieee8021x_blocked == true) { RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("\n psta->ieee8021x_blocked == true \n")); pattrib->encrypt = 0; @@ -959,9 +936,9 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr #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}; @@ -970,41 +947,41 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr 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; @@ -1038,7 +1015,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr 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 */ memcpy(payload, &(mic[0]),8); pattrib->last_txcmdsz+=8; @@ -1063,14 +1040,14 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmitframe){ struct pkt_attrib *pattrib = &pxmitframe->attrib; - //struct security_priv *psecuritypriv=&padapter->securitypriv; + /* struct security_priv *psecuritypriv=&padapter->securitypriv; */ ; - //if((psecuritypriv->sw_encrypt)||(pattrib->bswenc)) + /* if((psecuritypriv->sw_encrypt)||(pattrib->bswenc)) */ if(pattrib->bswenc) { - //DBG_871X("start xmitframe_swencrypt\n"); + /* DBG_871X("start xmitframe_swencrypt\n"); */ RT_TRACE(_module_rtl871x_xmit_c_,_drv_alert_,("### xmitframe_swencrypt\n")); switch(pattrib->encrypt){ case _WEP40_: @@ -1113,7 +1090,7 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat 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; __le16 *fctrl = &pwlanhdr->frame_ctl; @@ -1154,28 +1131,28 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat 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 */ memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); 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); memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN); } }else -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ { - //Data transfer to AP + /* Data transfer to AP */ SetToDs(fctrl); memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); @@ -1187,7 +1164,7 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat } else if ((check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) ) { - //to_ds = 0, fr_ds = 1; + /* to_ds = 0, fr_ds = 1; */ SetFrDs(fctrl); memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv), ETH_ALEN); @@ -1229,9 +1206,9 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat 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 @@ -1240,7 +1217,7 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat 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; @@ -1250,41 +1227,41 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat 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_871X("tx ampdu seqnum(%d) < tx_seq(%d)\n", pattrib->seqnum, tx_seq); - pattrib->ampdu_en = false;//AGG BK + /* DBG_871X("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_871X("tx ampdu over run\n"); + /* DBG_871X("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) { @@ -1294,8 +1271,8 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat 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 @@ -1303,12 +1280,12 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat 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 */ } } @@ -1427,7 +1404,7 @@ int rtw_build_tdls_ies(struct adapter * padapter, struct xmit_frame * pxmitframe case TUNNELED_PROBE_RSP: rtw_build_tunneled_probe_rsp_ies(padapter, pxmitframe, pframe); break; -#endif //CONFIG_WFD +#endif /* CONFIG_WFD */ default: res=_FAIL; break; @@ -1459,9 +1436,9 @@ s32 rtw_make_tdls_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib 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); @@ -1478,7 +1455,7 @@ s32 rtw_make_tdls_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib 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); @@ -1509,8 +1486,8 @@ s32 rtw_make_tdls_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib 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){ @@ -1586,7 +1563,7 @@ s32 rtw_xmit_tdls_coalesce(struct adapter * padapter, struct xmit_frame * pxmitf pframe = mem_start; pframe += pattrib->hdrlen; - //adding icv, if necessary... + /* adding icv, if necessary... */ if (pattrib->iv_len) { if (psta != NULL) @@ -1620,7 +1597,7 @@ s32 rtw_xmit_tdls_coalesce(struct adapter * padapter, struct xmit_frame * pxmitf 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); @@ -1650,7 +1627,7 @@ exit: return res; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ /* * Calculate wlan 802.11 packet MAX size from pkt_attrib @@ -1660,11 +1637,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; } @@ -1693,8 +1670,8 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit_fram 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; @@ -1739,7 +1716,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit_fram #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; @@ -1759,7 +1736,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit_fram _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) { @@ -1774,13 +1751,13 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit_fram 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) { @@ -1833,7 +1810,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit_fram 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); @@ -1892,7 +1869,7 @@ exit: } #ifdef CONFIG_IEEE80211W -//broadcast or multicast management pkt use BIP, unicast management pkt use CCMP encryption +/* broadcast or multicast management pkt use BIP, unicast management pkt use CCMP encryption */ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit_frame *pxmitframe) { struct pkt_file pktfile; @@ -1923,24 +1900,24 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit ; ori_len = BIP_AAD_SIZE+pattrib->pktlen; tmp_buf = BIP_AAD = rtw_zmalloc(ori_len); - subtype = GetFrameSubType(pframe); //bit(7)~bit(2) + subtype = GetFrameSubType(pframe); /* bit(7)~bit(2) */ if(BIP_AAD == NULL) return _FAIL; _enter_critical_bh(&padapter->security_key_mutex, &irqL); - //only support station mode + /* only support station mode */ if(!check_fwstate(pmlmepriv, WIFI_STATION_STATE) || !check_fwstate(pmlmepriv, _FW_LINKED)) goto xmitframe_coalesce_success; - //IGTK key is not install, it may not support 802.11w + /* IGTK key is not install, it may not support 802.11w */ if(padapter->securitypriv.binstallBIPkey != true) { DBG_871X("no instll BIP key\n"); goto xmitframe_coalesce_success; } - //station mode doesn't need TX BIP, just ready the code + /* station mode doesn't need TX BIP, just ready the code */ if(bmcst) { int frame_body_len; @@ -1948,36 +1925,36 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit memset(MME, 0, 18); - //other types doesn't need the BIP + /* other types doesn't need the BIP */ if(GetFrameSubType(pframe) != WIFI_DEAUTH && GetFrameSubType(pframe) != WIFI_DISASSOC) goto xmitframe_coalesce_fail; MGMT_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); pframe += pattrib->pktlen; - //octent 0 and 1 is key index ,BIP keyid is 4 or 5, LSB only need octent 0 + /* octent 0 and 1 is key index ,BIP keyid is 4 or 5, LSB only need octent 0 */ MME[0]=padapter->securitypriv.dot11wBIPKeyid; - //copy packet number + /* copy packet number */ memcpy(&MME[2], &pmlmeext->mgnt_80211w_IPN, 6); - //increase the packet number + /* increase the packet number */ pmlmeext->mgnt_80211w_IPN++; - //add MME IE with MIC all zero, MME string doesn't include element id and length + /* add MME IE with MIC all zero, MME string doesn't include element id and length */ pframe = rtw_set_ie(pframe, _MME_IE_ , 16 , MME, &(pattrib->pktlen)); pattrib->last_txcmdsz = pattrib->pktlen; - // total frame length - header length + /* total frame length - header length */ frame_body_len = pattrib->pktlen - sizeof(struct rtw_ieee80211_hdr_3addr); - //conscruct AAD, copy frame control field + /* conscruct AAD, copy frame control field */ memcpy(BIP_AAD, &pwlanhdr->frame_ctl, 2); ClearRetry(BIP_AAD); ClearPwrMgt(BIP_AAD); ClearMData(BIP_AAD); - //conscruct AAD, copy address 1 to address 3 + /* conscruct AAD, copy address 1 to address 3 */ memcpy(BIP_AAD+2, pwlanhdr->addr1, 18); - //copy management fram body + /* copy management fram body */ memcpy(BIP_AAD+BIP_AAD_SIZE, MGMT_body, frame_body_len); - /*//dump total packet include MME with zero MIC + /*/* dump total packet include MME with zero MIC */ { int i; printk("Total packet: "); @@ -1985,12 +1962,12 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit printk(" %02x ", BIP_AAD[i]); printk("\n"); }*/ - //calculate mic + /* calculate mic */ if(omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->securitypriv.dot11wBIPKeyid].skey , BIP_AAD, BIP_AAD_SIZE+frame_body_len, mic)) goto xmitframe_coalesce_fail; - /*//dump calculated mic result + /*/* dump calculated mic result */ { int i; printk("Calculated mic result: "); @@ -1998,7 +1975,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit printk(" %02x ", mic[i]); printk("\n"); }*/ - //copy right BIP mic value, total is 128bits, we use the 0~63 bits + /* copy right BIP mic value, total is 128bits, we use the 0~63 bits */ memcpy(pframe-8, mic, 8); /*/dump all packet after mic ok { @@ -2009,9 +1986,9 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit printk("\n"); }*/ } - else //unicast mgmt frame TX + else /* unicast mgmt frame TX */ { - //start to encrypt mgmt frame + /* start to encrypt mgmt frame */ if(subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC || subtype == WIFI_REASSOCREQ || subtype == WIFI_ACTION) { @@ -2035,8 +2012,8 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit goto xmitframe_coalesce_fail; } - //DBG_871X("%s, action frame category=%d \n", __func__, pframe[WLAN_HDR_A3_LEN]); - //according 802.11-2012 standard, these five types are not robust types + /* DBG_871X("%s, action frame category=%d \n", __func__, pframe[WLAN_HDR_A3_LEN]); */ + /* according 802.11-2012 standard, these five types are not robust types */ if(subtype == WIFI_ACTION && (pframe[WLAN_HDR_A3_LEN] == RTW_WLAN_CATEGORY_PUBLIC || pframe[WLAN_HDR_A3_LEN] == RTW_WLAN_CATEGORY_HT || @@ -2044,7 +2021,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit pframe[WLAN_HDR_A3_LEN] == RTW_WLAN_CATEGORY_SELF_PROTECTED || pframe[WLAN_HDR_A3_LEN] == RTW_WLAN_CATEGORY_P2P)) goto xmitframe_coalesce_fail; - /*//before encrypt dump the management packet content + /*/* before encrypt dump the management packet content */ { int i; printk("Management pkt: "); @@ -2053,40 +2030,40 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit printk("=======\n"); }*/ - //bakeup original management packet + /* bakeup original management packet */ memcpy(tmp_buf, pframe, pattrib->pktlen); - //move to data portion + /* move to data portion */ pframe += pattrib->hdrlen; - //802.11w unicast management packet must be _AES_ + /* 802.11w unicast management packet must be _AES_ */ pattrib->iv_len = 8; - //it's MIC of AES + /* it's MIC of AES */ pattrib->icv_len = 8; switch(pattrib->encrypt) { case _AES_: - //set AES IV header + /* set AES IV header */ AES_IV(pattrib->iv, psta->dot11wtxpn, 0); break; default: goto xmitframe_coalesce_fail; } - //insert iv header into management frame + /* insert iv header into management frame */ memcpy(pframe, pattrib->iv, pattrib->iv_len); pframe += pattrib->iv_len; - //copy mgmt data portion after CCMP header + /* copy mgmt data portion after CCMP header */ memcpy(pframe, tmp_buf+pattrib->hdrlen, pattrib->pktlen-pattrib->hdrlen); - //move pframe to end of mgmt pkt + /* move pframe to end of mgmt pkt */ pframe += pattrib->pktlen-pattrib->hdrlen; - //add 8 bytes CCMP IV header to length + /* add 8 bytes CCMP IV header to length */ pattrib->pktlen += pattrib->iv_len; - /*//dump management packet include AES IV header + /*/* dump management packet include AES IV header */ { int i; printk("Management pkt + IV: "); - //for(i=0; ipktlen; i++) - //printk(" %02x ", mem_start[i]); + /* for(i=0; ipktlen; i++) */ + /* printk(" %02x ", mem_start[i]); */ printk("@@@@@@@@@@@@@\n"); }*/ @@ -2094,14 +2071,14 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit memcpy(pframe, pattrib->icv, pattrib->icv_len); pframe += pattrib->icv_len; } - //add 8 bytes MIC + /* add 8 bytes MIC */ pattrib->pktlen += pattrib->icv_len; - //set final tx command size + /* set final tx command size */ pattrib->last_txcmdsz = pattrib->pktlen; - //set protected bit must be beofre SW encrypt + /* set protected bit must be beofre SW encrypt */ SetPrivacy(mem_start); - /*//dump management packet include AES header + /*/* dump management packet include AES header */ { int i; printk("prepare to enc Management pkt + IV: "); @@ -2109,7 +2086,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit printk(" %02x ", mem_start[i]); printk("@@@@@@@@@@@@@\n"); }*/ - //software encrypt + /* software encrypt */ xmitframe_swencrypt(padapter, pxmitframe); } } @@ -2127,7 +2104,7 @@ xmitframe_coalesce_fail: return _FAIL; } -#endif //CONFIG_IEEE80211W +#endif /* CONFIG_IEEE80211W */ /* Logical Link Control(LLC) SubNetwork Attachment Point(SNAP) header * IEEE LLC/SNAP header contains 8 octets @@ -2273,7 +2250,7 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv) pxmitbuf->priv_data = NULL; - //pxmitbuf->ext_tag = true; + /* pxmitbuf->ext_tag = true; */ if (pxmitbuf->sctx) { DBG_871X("%s pxmitbuf->sctx is not NULL\n", __func__); @@ -2327,7 +2304,7 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) ; - //DBG_871X("+rtw_alloc_xmitbuf\n"); + /* DBG_871X("+rtw_alloc_xmitbuf\n"); */ _enter_critical(&pfree_xmitbuf_queue->lock, &irqL); @@ -2350,10 +2327,10 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) #ifdef DBG_XMIT_BUF DBG_871X("DBG_XMIT_BUF ALLOC no=%d, free_xmitbuf_cnt=%d\n",pxmitbuf->no, pxmitpriv->free_xmitbuf_cnt); #endif - //DBG_871X("alloc, free_xmitbuf_cnt=%d\n", pxmitpriv->free_xmitbuf_cnt); + /* DBG_871X("alloc, free_xmitbuf_cnt=%d\n", pxmitpriv->free_xmitbuf_cnt); */ pxmitbuf->priv_data = NULL; - //pxmitbuf->ext_tag = false; + /* pxmitbuf->ext_tag = false; */ if (pxmitbuf->sctx) { DBG_871X("%s pxmitbuf->sctx is not NULL\n", __func__); rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC); @@ -2380,7 +2357,7 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) ; - //DBG_871X("+rtw_free_xmitbuf\n"); + /* DBG_871X("+rtw_free_xmitbuf\n"); */ if(pxmitbuf==NULL) { @@ -2405,7 +2382,7 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) rtw_list_insert_tail(&(pxmitbuf->list), get_list_head(pfree_xmitbuf_queue)); pxmitpriv->free_xmitbuf_cnt++; - //DBG_871X("FREE, free_xmitbuf_cnt=%d\n", pxmitpriv->free_xmitbuf_cnt); + /* DBG_871X("FREE, free_xmitbuf_cnt=%d\n", pxmitpriv->free_xmitbuf_cnt); */ #ifdef DBG_XMIT_BUF DBG_871X("DBG_XMIT_BUF FREE no=%d, free_xmitbuf_cnt=%d\n",pxmitbuf->no ,pxmitpriv->free_xmitbuf_cnt); #endif @@ -2419,18 +2396,18 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) static void rtw_init_xmitframe(struct xmit_frame *pxframe) { - if (pxframe != NULL)//default value setting + if (pxframe != NULL)/* default value setting */ { pxframe->buf_addr = NULL; pxframe->pxmitbuf = NULL; memset(&pxframe->attrib, 0, sizeof(struct pkt_attrib)); - //pxframe->attrib.psta = NULL; + /* pxframe->attrib.psta = NULL; */ pxframe->frame_tag = DATA_FRAMETAG; 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; @@ -2454,7 +2431,7 @@ Otherwise, we must use _enter/_exit critical to protect free_xmit_queue... 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, @@ -2651,7 +2628,7 @@ s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitfram { 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; } @@ -2688,9 +2665,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; @@ -2730,7 +2707,7 @@ struct xmit_frame* rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi { 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); @@ -2748,11 +2725,11 @@ struct xmit_frame* rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi { 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; } @@ -2761,7 +2738,7 @@ struct xmit_frame* rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi } - //_exit_critical_ex(&phwxmit->sta_queue->lock, &irqL0); + /* _exit_critical_ex(&phwxmit->sta_queue->lock, &irqL0); */ } @@ -2824,7 +2801,7 @@ struct tx_servq *rtw_get_sta_pending(struct adapter *padapter, struct sta_info * */ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe) { - //_irqL irqL0; + /* _irqL irqL0; */ u8 ac_index; struct sta_info *psta; struct tx_servq *ptxservq; @@ -2857,21 +2834,21 @@ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe) 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: @@ -2893,44 +2870,44 @@ void rtw_alloc_hwxmits(struct 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 @@ -2958,9 +2935,9 @@ void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry) ; 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; } ; @@ -2972,21 +2949,21 @@ static int rtw_br_client_tx(struct 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 && @@ -2999,10 +2976,10 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) _exit_critical_bh(&padapter->br_ext_lock, &irqL); } else - //if (!priv->pmib->ethBrExtInfo.nat25_disable) + /* if (!priv->pmib->ethBrExtInfo.nat25_disable) */ { -// if (priv->dev->br_port && -// !memcmp(skb->data+MACADDRLEN, priv->br_mac, MACADDRLEN)) { +/* if (priv->dev->br_port && */ +/* !memcmp(skb->data+MACADDRLEN, priv->br_mac, MACADDRLEN)) { */ #if 1 if (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_8021Q)) { is_vlan_tag = 1; @@ -3011,7 +2988,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) *((unsigned short *)(skb->data+MACADDRLEN*2+2-i*2)) = *((unsigned short *)(skb->data+MACADDRLEN*2-2-i*2)); skb_pull(skb, 4); } - //if SA == br_mac && skb== IP => copy SIP to br_ip ?? why + /* if SA == br_mac && skb== IP => copy SIP to br_ip ?? why */ if (!memcmp(skb->data+MACADDRLEN, padapter->br_mac, MACADDRLEN) && (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP))) memcpy(padapter->br_ip, skb->data+WLAN_ETHHDR_LEN+12, 4); @@ -3038,7 +3015,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) } } _exit_critical_bh(&padapter->br_ext_lock, &irqL); -#endif // 1 +#endif /* 1 */ if (do_nat25) { if (nat25_db_handle(padapter, skb, NAT25_CHECK) == 0) { @@ -3054,9 +3031,9 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) newskb = rtw_skb_copy(skb); if (newskb == NULL) { - //priv->ext_stats.tx_drops++; + /* priv->ext_stats.tx_drops++; */ DEBUG_ERR("TX DROP: rtw_skb_copy fail!\n"); - //goto stop_proc; + /* goto stop_proc; */ return -1; } rtw_skb_free(skb); @@ -3076,27 +3053,27 @@ static int rtw_br_client_tx(struct 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", __FUNCTION__, __LINE__); - //return -1; // return -1 will cause system crash on 2011/08/30! + /* we just print warning message and let it go */ + /* DEBUG_WARN("%s()-%d: nat25_db_handle INSERT Warning!\n", __FUNCTION__, __LINE__); */ + /* return -1; return -1 will cause system crash on 2011/08/30! */ return 0; } } @@ -3113,18 +3090,18 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) *((unsigned short *)(skb->data+MACADDRLEN*2+2)) = vlan_hdr; } } - // 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) { @@ -3152,7 +3129,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: @@ -3196,7 +3173,7 @@ s32 rtw_xmit(struct 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; @@ -3222,11 +3199,11 @@ s32 rtw_xmit(struct 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) { @@ -3238,7 +3215,7 @@ s32 rtw_xmit(struct adapter *padapter, _pkt **ppkt) } } -#endif // CONFIG_BR_EXT +#endif /* CONFIG_BR_EXT */ res = update_attrib(padapter, *ppkt, &pxmitframe->attrib); @@ -3311,14 +3288,14 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(struct adapter *padapter, struct xm { 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: @@ -3342,7 +3319,7 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(struct adapter *padapter, struct xm 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; @@ -3355,7 +3332,7 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(struct adapter *padapter, struct xm return ret; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ #if defined(CONFIG_AP_MODE) || defined(CONFIG_TDLS) @@ -3376,7 +3353,7 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr 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; @@ -3405,12 +3382,12 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr if(pattrib->triggered==1) { - //DBG_871X("directly xmit pspoll_triggered packet\n"); + /* DBG_871X("directly xmit pspoll_triggered packet\n"); */ - //pattrib->triggered=0; + /* pattrib->triggered=0; */ if(bmcst) - pattrib->qsel = 0x11;//HIQ + pattrib->qsel = 0x11;/* HIQ */ return ret; @@ -3421,35 +3398,25 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr { _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_871X("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; - } @@ -3463,7 +3430,7 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr { 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)); @@ -3497,22 +3464,22 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr { pstapriv->tim_bitmap |= BIT(psta->aid); - //DBG_871X("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); + /* DBG_871X("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */ if(psta->sleepq_len==1) { - //DBG_871X("sleepq_len==1, update BCNTIM\n"); - //upate BCN for TIM IE + /* DBG_871X("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; @@ -3558,7 +3525,7 @@ static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struc } else { - //DBG_871X("xmitframe_enqueue_for_sleeping_sta return false\n"); + /* DBG_871X("xmitframe_enqueue_for_sleeping_sta return false\n"); */ } } @@ -3575,7 +3542,7 @@ void stop_sta_xmit(struct 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); @@ -3585,7 +3552,7 @@ void stop_sta_xmit(struct 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); @@ -3610,10 +3577,10 @@ void stop_sta_xmit(struct 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)); @@ -3622,7 +3589,7 @@ void stop_sta_xmit(struct adapter *padapter, struct sta_info *psta) #ifdef CONFIG_TDLS } } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ _exit_critical_bh(&pxmitpriv->lock, &irqL0); @@ -3641,7 +3608,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) psta_bmc = rtw_get_bcmc_stainfo(padapter); - //_enter_critical_bh(&psta->sleep_q.lock, &irqL); + /* _enter_critical_bh(&psta->sleep_q.lock, &irqL); */ _enter_critical_bh(&pxmitpriv->lock, &irqL); xmitframe_phead = get_list_head(&psta->sleep_q); @@ -3712,11 +3679,11 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) } - //for BC/MC Frames + /* for BC/MC Frames */ if(!psta_bmc) goto _exit; - 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 */ { xmitframe_phead = get_list_head(&psta_bmc->sleep_q); xmitframe_plist = get_next(xmitframe_phead); @@ -3755,9 +3722,9 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) pstapriv->tim_bitmap &= ~BIT(0); pstapriv->sta_dz_bitmap &= ~BIT(0); - //DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); - //upate BCN for TIM IE - //update_BCNTIM(padapter); + /* DBG_871X("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); } @@ -3773,12 +3740,12 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) goto _exit; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ pstapriv->tim_bitmap &= ~BIT(psta->aid); - //DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); - //upate BCN for TIM IE - //update_BCNTIM(padapter); + /* DBG_871X("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) @@ -3795,13 +3762,13 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) _exit: - //_exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); + /* _exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); */ _exit_critical_bh(&pxmitpriv->lock, &irqL); if(update_mask) { - //update_BCNTIM(padapter); - //printk("%s => call update_beacon\n",__FUNCTION__); + /* update_BCNTIM(padapter); */ + /* printk("%s => call update_beacon\n",__FUNCTION__); */ update_beacon(padapter, _TIM_IE_, NULL, false); } @@ -3817,7 +3784,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - //_enter_critical_bh(&psta->sleep_q.lock, &irqL); + /* _enter_critical_bh(&psta->sleep_q.lock, &irqL); */ _enter_critical_bh(&pxmitpriv->lock, &irqL); xmitframe_phead = get_list_head(&psta->sleep_q); @@ -3884,23 +3851,23 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst #ifdef CONFIG_TDLS if(psta->tdls_sta_state & TDLS_LINKED_STATE ) { - //_exit_critical_bh(&psta->sleep_q.lock, &irqL); + /* _exit_critical_bh(&psta->sleep_q.lock, &irqL); */ _exit_critical_bh(&pxmitpriv->lock, &irqL); return; } -#endif //CONFIG_TDLS +#endif /* CONFIG_TDLS */ pstapriv->tim_bitmap &= ~BIT(psta->aid); - //DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); - //upate BCN for TIM IE - //update_BCNTIM(padapter); + /* DBG_871X("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); */ } } - //_exit_critical_bh(&psta->sleep_q.lock, &irqL); + /* _exit_critical_bh(&psta->sleep_q.lock, &irqL); */ _exit_critical_bh(&pxmitpriv->lock, &irqL); } @@ -4172,8 +4139,8 @@ int rtw_ack_tx_wait(struct xmit_priv *pxmitpriv, u32 timeout_ms) do { rtw_msleep_os(10); - //check_c2hcmd = rtw_read8(adapter, 0x1AF); - //check_ccx = rtw_read8(adapter, 0x1A0); + /* check_c2hcmd = rtw_read8(adapter, 0x1AF); */ + /* check_ccx = rtw_read8(adapter, 0x1A0); */ rtw_hal_get_hwreg(adapter, HW_VAR_C2HEVT_CLEAR, (u8 *)(&check_c2hcmd)); rtw_hal_get_hwreg(adapter, HW_VAR_C2HEVT_MSG_NORMAL, (u8 *)(&check_ccx)); @@ -4236,4 +4203,4 @@ void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status) DBG_871X("%s ack_tx not set\n", __func__); } } -#endif //CONFIG_XMIT_ACK +#endif /* CONFIG_XMIT_ACK */