hex_to_bin could be used to convert hexdecimal digit to its binary
representation.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
return unknown ? ParseUnknown : ParseOK;
}
-u8 key_char2num(u8 ch)
-{
- if ((ch >= '0') && (ch <= '9'))
- return ch - '0';
- else if ((ch >= 'a') && (ch <= 'f'))
- return ch - 'a' + 10;
- else if ((ch >= 'A') && (ch <= 'F'))
- return ch - 'A' + 10;
- else
- return 0xff;
-}
-
-u8 str_2char2num(u8 hch, u8 lch)
-{
- return (key_char2num(hch) * 10) + key_char2num(lch);
-}
-
void rtw_macaddr_cfg(u8 *mac_addr)
{
u8 mac[ETH_ALEN];
struct ndis_802_11_auth_encrypt AuthenticationEncryptionSupported[1];
};
-u8 key_char2num(u8 ch);
-u8 str_2char2num(u8 hch, u8 lch);
-
#endif /* ifndef WLAN_BSSDEF_H_ */
intent = extra[0] - '0';
break;
case 2:
- intent = str_2char2num(extra[0], extra[1]);
+ intent = hex_to_bin(extra[0]) * 10 + hex_to_bin(extra[1]);
break;
}
if (intent <= 15)
listen_ch = extra[0] - '0';
break;
case 2:
- listen_ch = str_2char2num(extra[0], extra[1]);
+ listen_ch = hex_to_bin(extra[0]) * 10 + hex_to_bin(extra[1]);
break;
}
op_ch = extra[0] - '0';
break;
case 2:
- op_ch = str_2char2num(extra[0], extra[1]);
+ op_ch = hex_to_bin(extra[0]) * 10 + hex_to_bin(extra[1]);
break;
}