rtl8188eu: Change C90 comments to kernel form for files in core/

This commit also includes some sparse fixes for endian issues.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-07-09 17:38:46 -05:00
parent fb786d0283
commit d2c90ee304
24 changed files with 4667 additions and 5077 deletions

View file

@ -47,9 +47,9 @@ u8 RSN_CIPHER_SUITE_TKIP[] = { 0x00, 0x0f, 0xac, 2 };
u8 RSN_CIPHER_SUITE_WRAP[] = { 0x00, 0x0f, 0xac, 3 };
u8 RSN_CIPHER_SUITE_CCMP[] = { 0x00, 0x0f, 0xac, 4 };
u8 RSN_CIPHER_SUITE_WEP104[] = { 0x00, 0x0f, 0xac, 5 };
//-----------------------------------------------------------
// for adhoc-master to generate ie and provide supported-rate to fw
//-----------------------------------------------------------
/* */
/* for adhoc-master to generate ie and provide supported-rate to fw */
/* */
static u8 WIFI_CCKRATES[] =
{(IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK),
@ -70,7 +70,7 @@ static u8 WIFI_OFDMRATES[] =
int rtw_get_bit_value_from_ieee_value(u8 val)
{
unsigned char dot11_rate_table[]={2,4,11,22,12,18,24,36,48,72,96,108,0}; // last element must be zero!!
unsigned char dot11_rate_table[]={2,4,11,22,12,18,24,36,48,72,96,108,0}; /* last element must be zero!! */
int i=0;
while (dot11_rate_table[i] != 0) {
@ -124,7 +124,7 @@ int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
else
return WIRELESS_11A;
}
else // could be pure B, pure G, or B/G
else /* could be pure B, pure G, or B/G */
{
if ((rtw_is_cckratesonly_included(rate)) == true)
return WIRELESS_11B;
@ -144,14 +144,14 @@ u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *sourc
return (pbuf + len);
}
// rtw_set_ie will update frame length
/* rtw_set_ie will update frame length */
u8 *rtw_set_ie
(
u8 *pbuf,
sint index,
uint len,
u8 *source,
uint *frlen //frame length
uint *frlen /* frame length */
)
{
_func_enter_;
@ -300,7 +300,7 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
}
else
{
cnt+=in_ie[cnt+1]+2; //goto next
cnt+=in_ie[cnt+1]+2; /* goto next */
}
}
@ -370,7 +370,7 @@ _func_enter_;
case WIRELESS_11G:
case WIRELESS_11A:
case WIRELESS_11_5N:
case WIRELESS_11A_5N://Todo: no basic rate for ofdm ?
case WIRELESS_11A_5N:/* Todo: no basic rate for ofdm ? */
_rtw_memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
break;
@ -413,16 +413,16 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
_func_enter_;
//timestamp will be inserted by hardware
/* timestamp will be inserted by hardware */
sz += 8;
ie += sz;
//beacon interval : 2bytes
*(__le16*)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);//BCN_INTERVAL;
/* beacon interval : 2bytes */
*(__le16*)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);/* BCN_INTERVAL; */
sz += 2;
ie += 2;
//capability info
/* capability info */
*(u16*)ie = 0;
*(__le16*)ie |= cpu_to_le16(cap_IBSS);
@ -436,10 +436,10 @@ _func_enter_;
sz += 2;
ie += 2;
//SSID
/* SSID */
ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz);
//supported rates
/* supported rates */
if (pregistrypriv->wireless_mode == WIRELESS_11ABGN)
{
if (pdev_network->Configuration.DSConfig > 14)
@ -459,18 +459,18 @@ _func_enter_;
if (rateLen > 8)
{
ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, 8, pdev_network->SupportedRates, &sz);
//ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz);
/* ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz); */
}
else
{
ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, rateLen, pdev_network->SupportedRates, &sz);
}
//DS parameter set
/* DS parameter set */
ie = rtw_set_ie(ie, _DSSET_IE_, 1, (u8 *)&(pdev_network->Configuration.DSConfig), &sz);
//IBSS Parameter Set
/* IBSS Parameter Set */
ie = rtw_set_ie(ie, _IBSS_PARA_IE_, 2, (u8 *)&(pdev_network->Configuration.ATIMWindow), &sz);
@ -480,22 +480,19 @@ _func_enter_;
}
#ifdef CONFIG_80211N_HT
//HT Cap.
/* HT Cap. */
if (((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N))
&& (pregistrypriv->ht_enable==true))
{
//todo:
/* todo: */
}
#endif //CONFIG_80211N_HT
//pdev_network->IELength = sz; //update IELength
#endif /* CONFIG_80211N_HT */
_func_exit_;
//return _SUCCESS;
/* return _SUCCESS; */
return sz;
}
unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
@ -513,13 +510,13 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
if (pbuf) {
//check if oui matches...
/* check if oui matches... */
if (_rtw_memcmp((pbuf + 2), wpa_oui_type, sizeof (wpa_oui_type)) == false) {
goto check_next_ie;
}
//check version...
/* check version... */
_rtw_memcpy((u8 *)&le_tmp, (pbuf + 6), sizeof(val16));
val16 = le16_to_cpu(le_tmp);
@ -619,7 +616,7 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
left = wpa_ie_len - 8;
//group_cipher
/* group_cipher */
if (left >= WPA_SELECTOR_LEN) {
*group_cipher = rtw_get_wpa_cipher_suite(pos);
@ -636,10 +633,10 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
}
//pairwise_cipher
/* pairwise_cipher */
if (left >= 2)
{
//count = le16_to_cpu(*(u16*)pos);
/* count = le16_to_cpu(*(u16*)pos); */
count = RTW_GET_LE16(pos);
pos += 2;
left -= 2;
@ -701,7 +698,7 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
pos += 4;
left = rsn_ie_len - 4;
//group_cipher
/* group_cipher */
if (left >= RSN_SELECTOR_LEN) {
*group_cipher = rtw_get_wpa2_cipher_suite(pos);
@ -714,10 +711,10 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
return _FAIL;
}
//pairwise_cipher
/* pairwise_cipher */
if (left >= 2)
{
//count = le16_to_cpu(*(u16*)pos);
/* count = le16_to_cpu(*(u16*)pos); */
count = RTW_GET_LE16(pos);
pos += 2;
left -= 2;
@ -772,7 +769,7 @@ _func_enter_;
{
authmode=in_ie[cnt];
//if (authmode==_WAPI_IE_)
/* if (authmode==_WAPI_IE_) */
if (authmode==_WAPI_IE_ && (_rtw_memcmp(&in_ie[cnt+6], wapi_oui1,4)==true ||
_rtw_memcmp(&in_ie[cnt+6], wapi_oui2,4)==true))
{
@ -787,11 +784,11 @@ _func_enter_;
}
*wapi_len=in_ie[cnt+1]+2;
cnt+=in_ie[cnt+1]+2; //get next
cnt+=in_ie[cnt+1]+2; /* get next */
}
else
{
cnt+=in_ie[cnt+1]+2; //get next
cnt+=in_ie[cnt+1]+2; /* get next */
}
}
@ -810,7 +807,7 @@ int rtw_get_sec_ie(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16
_func_enter_;
//Search required WPA or WPA2 IE and copy to sec_ie[ ]
/* Search required WPA or WPA2 IE and copy to sec_ie[ ] */
cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_);
@ -835,7 +832,7 @@ _func_enter_;
}
*wpa_len=in_ie[cnt+1]+2;
cnt+=in_ie[cnt+1]+2; //get next
cnt+=in_ie[cnt+1]+2; /* get next */
}
else
{
@ -854,11 +851,11 @@ _func_enter_;
}
*rsn_len=in_ie[cnt+1]+2;
cnt+=in_ie[cnt+1]+2; //get next
cnt+=in_ie[cnt+1]+2; /* get next */
}
else
{
cnt+=in_ie[cnt+1]+2; //get next
cnt+=in_ie[cnt+1]+2; /* get next */
}
}
@ -881,7 +878,7 @@ u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
if ((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&ie_ptr[2], wps_oui, 4)==true))
{
//DBG_88E("==> found WPS_IE.....\n");
/* DBG_88E("==> found WPS_IE.....\n"); */
*wps_ielen = ie_ptr[1]+2;
match=true;
}
@ -931,7 +928,7 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
}
else
{
cnt+=in_ie[cnt+1]+2; //goto next
cnt+=in_ie[cnt+1]+2; /* goto next */
}
}
@ -964,17 +961,17 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att
return attr_ptr;
}
// 6 = 1(Element ID) + 1(Length) + 4(WPS OUI)
attr_ptr = wps_ie + 6; //goto first attr
/* 6 = 1(Element ID) + 1(Length) + 4(WPS OUI) */
attr_ptr = wps_ie + 6; /* goto first attr */
while (attr_ptr - wps_ie < wps_ielen)
{
// 4 = 2(Attribute ID) + 2(Length)
/* 4 = 2(Attribute ID) + 2(Length) */
u16 attr_id = RTW_GET_BE16(attr_ptr);
u16 attr_data_len = RTW_GET_BE16(attr_ptr + 2);
u16 attr_len = attr_data_len + 4;
//DBG_88E("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len);
/* DBG_88E("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len); */
if ( attr_id == target_attr_id )
{
target_attr_ptr = attr_ptr;
@ -989,7 +986,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att
}
else
{
attr_ptr += attr_len; //goto next
attr_ptr += attr_len; /* goto next */
}
}
@ -1291,7 +1288,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
if (mac_addr == NULL) return;
if ( rtw_initmac )
{ // Users specify the mac address
{ /* Users specify the mac address */
int jj,kk;
for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 )
@ -1301,7 +1298,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
}
else
{ // Use the mac address stored in the Efuse
{ /* Use the mac address stored in the Efuse */
_rtw_memcpy(mac, mac_addr, ETH_ALEN);
}
@ -1316,7 +1313,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
mac[3] = 0x87;
mac[4] = 0x00;
mac[5] = 0x00;
// use default mac addresss
/* use default mac addresss */
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
DBG_88E("MAC Address from efuse error, assign default one !!!\n");
}
@ -1436,7 +1433,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
}
else
{
cnt += in_ie[ cnt + 1 ] +2; //goto next
cnt += in_ie[ cnt + 1 ] +2; /* goto next */
}
}
@ -1470,17 +1467,17 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr
return attr_ptr;
}
// 6 = 1(Element ID) + 1(Length) + 3 (OUI) + 1(OUI Type)
attr_ptr = p2p_ie + 6; //goto first attr
/* 6 = 1(Element ID) + 1(Length) + 3 (OUI) + 1(OUI Type) */
attr_ptr = p2p_ie + 6; /* goto first attr */
while (attr_ptr - p2p_ie < p2p_ielen)
{
// 3 = 1(Attribute ID) + 2(Length)
/* 3 = 1(Attribute ID) + 2(Length) */
u8 attr_id = *attr_ptr;
u16 attr_data_len = RTW_GET_LE16(attr_ptr + 1);
u16 attr_len = attr_data_len + 3;
//DBG_88E("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len);
/* DBG_88E("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len); */
if ( attr_id == target_attr_id )
{
target_attr_ptr = attr_ptr;
@ -1495,7 +1492,7 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr
}
else
{
attr_ptr += attr_len; //goto next
attr_ptr += attr_len; /* goto next */
}
}
@ -1543,7 +1540,7 @@ u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr)
*pbuf = attr_id;
//*(u16*)(pbuf + 1) = cpu_to_le16(attr_len);
/* u16*)(pbuf + 1) = cpu_to_le16(attr_len); */
RTW_PUT_LE16(pbuf + 1, attr_len);
if (pdata_attr)
@ -1605,7 +1602,7 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
}
}
#endif //CONFIG_P2P
#endif /* CONFIG_P2P */
#ifdef CONFIG_WFD
int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
@ -1653,7 +1650,7 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
}
else
{
cnt += in_ie[ cnt + 1 ] +2; //goto next
cnt += in_ie[ cnt + 1 ] +2; /* goto next */
}
}
@ -1667,8 +1664,8 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
}
// attr_content: The output buffer, contains the "body field" of WFD attribute.
// attr_contentlen: The data length of the "body field" of WFD attribute.
/* attr_content: The output buffer, contains the "body field" of WFD attribute. */
/* attr_contentlen: The data length of the "body field" of WFD attribute. */
int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *attr_content, uint *attr_contentlen)
{
int match;
@ -1684,7 +1681,7 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
return( match );
}
// 1 ( WFD IE ) + 1 ( Length ) + 3 ( OUI ) + 1 ( OUI Type )
/* 1 ( WFD IE ) + 1 ( Length ) + 3 ( OUI ) + 1 ( OUI Type ) */
cnt = 6;
while ( cnt < wfd_ielen )
{
@ -1693,7 +1690,7 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
attr_id = wfd_ie[cnt];
if ( attr_id == target_attr_id )
{
// 3 -> 1 byte for attribute ID field, 2 bytes for length field
/* 3 -> 1 byte for attribute ID field, 2 bytes for length field */
if (attr_content)
_rtw_memcpy( attr_content, &wfd_ie[ cnt + 3 ], attrlen );
@ -1707,7 +1704,7 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
}
else
{
cnt += attrlen + 3; //goto next
cnt += attrlen + 3; /* goto next */
}
}
@ -1715,9 +1712,9 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
return match;
}
#endif // CONFIG_WFD
#endif /* CONFIG_WFD */
//Baron adds to avoid FreeBSD warning
/* Baron adds to avoid FreeBSD warning */
int ieee80211_is_empty_essid(const char *essid, int essid_len)
{
/* Single white space is for Linksys APs */
@ -1860,7 +1857,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
}
}
//show MCS rate, unit: 100Kbps
/* show MCS rate, unit: 100Kbps */
u16 rtw_mcs_rate(u8 rf_type, u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40, unsigned char * MCS_rate)
{
u16 max_rate = 0;