rtl8188eu: Change C90 comments to /* */ form

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2015-02-19 15:34:32 -06:00
parent 9b5b5c4e12
commit 54abf571c4
21 changed files with 4526 additions and 4764 deletions

View file

@ -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;