/* for adhoc-master to generate ie and provide supported-rate to fw */
/* */
-static u8 WIFI_CCKRATES[] =
-{(IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK),
- (IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK),
- (IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK),
- (IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK)};
-
-static u8 WIFI_OFDMRATES[] =
-{(IEEE80211_OFDM_RATE_6MB),
- (IEEE80211_OFDM_RATE_9MB),
- (IEEE80211_OFDM_RATE_12MB),
- (IEEE80211_OFDM_RATE_18MB),
- (IEEE80211_OFDM_RATE_24MB),
- IEEE80211_OFDM_RATE_36MB,
- IEEE80211_OFDM_RATE_48MB,
- IEEE80211_OFDM_RATE_54MB};
+static u8 WIFI_CCKRATES[] = {
+ IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK,
+ IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
+ IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK,
+ IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK
+};
+
+static u8 WIFI_OFDMRATES[] = {
+ IEEE80211_OFDM_RATE_6MB,
+ IEEE80211_OFDM_RATE_9MB,
+ IEEE80211_OFDM_RATE_12MB,
+ IEEE80211_OFDM_RATE_18MB,
+ IEEE80211_OFDM_RATE_24MB,
+ IEEE80211_OFDM_RATE_36MB,
+ IEEE80211_OFDM_RATE_48MB,
+ IEEE80211_OFDM_RATE_54MB
+};
int rtw_get_bit_value_from_ieee_value23a(u8 val)
{
{
u32 i = 0;
- while (rate[i] != 0) {
- if ((((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
- (((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22))
+ while (rate[i]) {
+ if ((rate[i] & 0x7f) == 2 || (rate[i] & 0x7f) == 4 ||
+ (rate[i] & 0x7f) == 11 || (rate[i] & 0x7f) == 22)
return true;
i++;
}
{
u32 i = 0;
- while (rate[i] != 0) {
- if ((((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
- (((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22))
+ while (rate[i]) {
+ if ((rate[i] & 0x7f) != 2 && (rate[i] & 0x7f) != 4 &&
+ (rate[i] & 0x7f) != 11 && (rate[i] & 0x7f) != 22)
return false;
i++;
*frlen = *frlen + (len + 2);
-
return pbuf + len + 2;
}
uint i = 0;
while(1) {
- if ((rateset[i]) == 0)
+ if (rateset[i] == 0)
break;
if (i > 12)
return _FAIL;
}
- if ((*rsn_ie!= _WPA2_IE_ID_) || (*(rsn_ie+1) != (u8)(rsn_ie_len - 2))) {
+ if (*rsn_ie != _WPA2_IE_ID_ || *(rsn_ie+1) != (u8)(rsn_ie_len - 2)) {
return _FAIL;
}
eid = ie_ptr[0];
- if ((eid == WLAN_EID_VENDOR_SPECIFIC) &&
+ if (eid == WLAN_EID_VENDOR_SPECIFIC &&
!memcmp(&ie_ptr[2], wps_oui, 4)) {
/* DBG_8723A("==> found WPS_IE.....\n"); */
*wps_ielen = ie_ptr[1] + 2;
while (cnt < in_len) {
eid = in_ie[cnt];
- if ((eid == WLAN_EID_VENDOR_SPECIFIC) &&
+ if (eid == WLAN_EID_VENDOR_SPECIFIC &&
!memcmp(&in_ie[cnt+2], wps_oui, 4)) {
wpsie_ptr = &in_ie[cnt];
if (len_attr)
*len_attr = 0;
- if ((wps_ie[0] != WLAN_EID_VENDOR_SPECIFIC) ||
+ if (wps_ie[0] != WLAN_EID_VENDOR_SPECIFIC ||
memcmp(wps_ie + 2, wps_oui, 4)) {
return attr_ptr;
}
static u8 key_char2num(u8 ch)
{
- if ((ch >= '0') && (ch <= '9'))
+ if (ch >= '0' && ch <= '9')
return ch - '0';
- else if ((ch >= 'a') && (ch <= 'f'))
+ else if (ch >= 'a' && ch <= 'f')
return ch - 'a' + 10;
- else if ((ch >= 'A') && (ch <= 'F'))
+ else if (ch >= 'A' && ch <= 'F')
return ch - 'A' + 10;
else
return 0xff;
u8 str_2char2num23a(u8 hch, u8 lch)
{
- return (key_char2num(hch) * 10) + key_char2num(lch);
+ return key_char2num(hch) * 10 + key_char2num(lch);
}
u8 key_2char2num23a(u8 hch, u8 lch)
{
- return (key_char2num(hch) << 4) | key_char2num(lch);
+ return key_char2num(hch) << 4 | key_char2num(lch);
}
void rtw_macaddr_cfg23a(u8 *mac_addr)