|
@@ -704,17 +704,6 @@ static char *host_addr;
|
|
module_param(host_addr, charp, S_IRUGO);
|
|
module_param(host_addr, charp, S_IRUGO);
|
|
MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
|
|
MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
|
|
|
|
|
|
-
|
|
|
|
-static u8 __init nibble(unsigned char c)
|
|
|
|
-{
|
|
|
|
- if (isdigit(c))
|
|
|
|
- return c - '0';
|
|
|
|
- c = toupper(c);
|
|
|
|
- if (isxdigit(c))
|
|
|
|
- return 10 + c - 'A';
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int get_ether_addr(const char *str, u8 *dev_addr)
|
|
static int get_ether_addr(const char *str, u8 *dev_addr)
|
|
{
|
|
{
|
|
if (str) {
|
|
if (str) {
|
|
@@ -725,8 +714,8 @@ static int get_ether_addr(const char *str, u8 *dev_addr)
|
|
|
|
|
|
if ((*str == '.') || (*str == ':'))
|
|
if ((*str == '.') || (*str == ':'))
|
|
str++;
|
|
str++;
|
|
- num = nibble(*str++) << 4;
|
|
|
|
- num |= (nibble(*str++));
|
|
|
|
|
|
+ num = hex_to_bin(*str++) << 4;
|
|
|
|
+ num |= hex_to_bin(*str++);
|
|
dev_addr [i] = num;
|
|
dev_addr [i] = num;
|
|
}
|
|
}
|
|
if (is_valid_ether_addr(dev_addr))
|
|
if (is_valid_ether_addr(dev_addr))
|