diff options
Diffstat (limited to 'drivers/net/cxgb3')
-rw-r--r-- | drivers/net/cxgb3/t3_hw.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c index 95a8ba0759f1..427c451be1a7 100644 --- a/drivers/net/cxgb3/t3_hw.c +++ b/drivers/net/cxgb3/t3_hw.c | |||
@@ -679,14 +679,6 @@ int t3_seeprom_wp(struct adapter *adapter, int enable) | |||
679 | return t3_seeprom_write(adapter, EEPROM_STAT_ADDR, enable ? 0xc : 0); | 679 | return t3_seeprom_write(adapter, EEPROM_STAT_ADDR, enable ? 0xc : 0); |
680 | } | 680 | } |
681 | 681 | ||
682 | /* | ||
683 | * Convert a character holding a hex digit to a number. | ||
684 | */ | ||
685 | static unsigned int hex2int(unsigned char c) | ||
686 | { | ||
687 | return isdigit(c) ? c - '0' : toupper(c) - 'A' + 10; | ||
688 | } | ||
689 | |||
690 | /** | 682 | /** |
691 | * get_vpd_params - read VPD parameters from VPD EEPROM | 683 | * get_vpd_params - read VPD parameters from VPD EEPROM |
692 | * @adapter: adapter to read | 684 | * @adapter: adapter to read |
@@ -727,15 +719,15 @@ static int get_vpd_params(struct adapter *adapter, struct vpd_params *p) | |||
727 | p->port_type[0] = uses_xaui(adapter) ? 1 : 2; | 719 | p->port_type[0] = uses_xaui(adapter) ? 1 : 2; |
728 | p->port_type[1] = uses_xaui(adapter) ? 6 : 2; | 720 | p->port_type[1] = uses_xaui(adapter) ? 6 : 2; |
729 | } else { | 721 | } else { |
730 | p->port_type[0] = hex2int(vpd.port0_data[0]); | 722 | p->port_type[0] = hex_to_bin(vpd.port0_data[0]); |
731 | p->port_type[1] = hex2int(vpd.port1_data[0]); | 723 | p->port_type[1] = hex_to_bin(vpd.port1_data[0]); |
732 | p->xauicfg[0] = simple_strtoul(vpd.xaui0cfg_data, NULL, 16); | 724 | p->xauicfg[0] = simple_strtoul(vpd.xaui0cfg_data, NULL, 16); |
733 | p->xauicfg[1] = simple_strtoul(vpd.xaui1cfg_data, NULL, 16); | 725 | p->xauicfg[1] = simple_strtoul(vpd.xaui1cfg_data, NULL, 16); |
734 | } | 726 | } |
735 | 727 | ||
736 | for (i = 0; i < 6; i++) | 728 | for (i = 0; i < 6; i++) |
737 | p->eth_base[i] = hex2int(vpd.na_data[2 * i]) * 16 + | 729 | p->eth_base[i] = hex_to_bin(vpd.na_data[2 * i]) * 16 + |
738 | hex2int(vpd.na_data[2 * i + 1]); | 730 | hex_to_bin(vpd.na_data[2 * i + 1]); |
739 | return 0; | 731 | return 0; |
740 | } | 732 | } |
741 | 733 | ||