Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: wangxun: remove redundant kernel log

Since PBA info can be read from lspci, delete txgbe_read_pba_string()
and the prints. In addition, delete the redundant MAC address printing.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20231017100635.154967-1-jiawenwu@trustnetic.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jiawen Wu and committed by
Jakub Kicinski
48e44287 8bb04756

-128
-5
drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
··· 679 679 680 680 pci_set_drvdata(pdev, wx); 681 681 682 - netif_info(wx, probe, netdev, 683 - "PHY: %s, PBA No: Wang Xun GbE Family Controller\n", 684 - wx->mac_type == em_mac_type_mdi ? "Internal" : "External"); 685 - netif_info(wx, probe, netdev, "%pM\n", netdev->dev_addr); 686 - 687 682 return 0; 688 683 689 684 err_register:
-108
drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c
··· 71 71 } 72 72 73 73 /** 74 - * txgbe_read_pba_string - Reads part number string from EEPROM 75 - * @wx: pointer to hardware structure 76 - * @pba_num: stores the part number string from the EEPROM 77 - * @pba_num_size: part number string buffer length 78 - * 79 - * Reads the part number string from the EEPROM. 80 - **/ 81 - int txgbe_read_pba_string(struct wx *wx, u8 *pba_num, u32 pba_num_size) 82 - { 83 - u16 pba_ptr, offset, length, data; 84 - int ret_val; 85 - 86 - if (!pba_num) { 87 - wx_err(wx, "PBA string buffer was null\n"); 88 - return -EINVAL; 89 - } 90 - 91 - ret_val = wx_read_ee_hostif(wx, 92 - wx->eeprom.sw_region_offset + TXGBE_PBANUM0_PTR, 93 - &data); 94 - if (ret_val != 0) { 95 - wx_err(wx, "NVM Read Error\n"); 96 - return ret_val; 97 - } 98 - 99 - ret_val = wx_read_ee_hostif(wx, 100 - wx->eeprom.sw_region_offset + TXGBE_PBANUM1_PTR, 101 - &pba_ptr); 102 - if (ret_val != 0) { 103 - wx_err(wx, "NVM Read Error\n"); 104 - return ret_val; 105 - } 106 - 107 - /* if data is not ptr guard the PBA must be in legacy format which 108 - * means pba_ptr is actually our second data word for the PBA number 109 - * and we can decode it into an ascii string 110 - */ 111 - if (data != TXGBE_PBANUM_PTR_GUARD) { 112 - wx_err(wx, "NVM PBA number is not stored as string\n"); 113 - 114 - /* we will need 11 characters to store the PBA */ 115 - if (pba_num_size < 11) { 116 - wx_err(wx, "PBA string buffer too small\n"); 117 - return -ENOMEM; 118 - } 119 - 120 - /* extract hex string from data and pba_ptr */ 121 - pba_num[0] = (data >> 12) & 0xF; 122 - pba_num[1] = (data >> 8) & 0xF; 123 - pba_num[2] = (data >> 4) & 0xF; 124 - pba_num[3] = data & 0xF; 125 - pba_num[4] = (pba_ptr >> 12) & 0xF; 126 - pba_num[5] = (pba_ptr >> 8) & 0xF; 127 - pba_num[6] = '-'; 128 - pba_num[7] = 0; 129 - pba_num[8] = (pba_ptr >> 4) & 0xF; 130 - pba_num[9] = pba_ptr & 0xF; 131 - 132 - /* put a null character on the end of our string */ 133 - pba_num[10] = '\0'; 134 - 135 - /* switch all the data but the '-' to hex char */ 136 - for (offset = 0; offset < 10; offset++) { 137 - if (pba_num[offset] < 0xA) 138 - pba_num[offset] += '0'; 139 - else if (pba_num[offset] < 0x10) 140 - pba_num[offset] += 'A' - 0xA; 141 - } 142 - 143 - return 0; 144 - } 145 - 146 - ret_val = wx_read_ee_hostif(wx, pba_ptr, &length); 147 - if (ret_val != 0) { 148 - wx_err(wx, "NVM Read Error\n"); 149 - return ret_val; 150 - } 151 - 152 - if (length == 0xFFFF || length == 0) { 153 - wx_err(wx, "NVM PBA number section invalid length\n"); 154 - return -EINVAL; 155 - } 156 - 157 - /* check if pba_num buffer is big enough */ 158 - if (pba_num_size < (((u32)length * 2) - 1)) { 159 - wx_err(wx, "PBA string buffer too small\n"); 160 - return -ENOMEM; 161 - } 162 - 163 - /* trim pba length from start of string */ 164 - pba_ptr++; 165 - length--; 166 - 167 - for (offset = 0; offset < length; offset++) { 168 - ret_val = wx_read_ee_hostif(wx, pba_ptr + offset, &data); 169 - if (ret_val != 0) { 170 - wx_err(wx, "NVM Read Error\n"); 171 - return ret_val; 172 - } 173 - pba_num[offset * 2] = (u8)(data >> 8); 174 - pba_num[(offset * 2) + 1] = (u8)(data & 0xFF); 175 - } 176 - pba_num[offset * 2] = '\0'; 177 - 178 - return 0; 179 - } 180 - 181 - /** 182 74 * txgbe_calc_eeprom_checksum - Calculates and returns the checksum 183 75 * @wx: pointer to hardware structure 184 76 * @checksum: pointer to cheksum
-1
drivers/net/ethernet/wangxun/txgbe/txgbe_hw.h
··· 6 6 7 7 int txgbe_disable_sec_tx_path(struct wx *wx); 8 8 void txgbe_enable_sec_tx_path(struct wx *wx); 9 - int txgbe_read_pba_string(struct wx *wx, u8 *pba_num, u32 pba_num_size); 10 9 int txgbe_validate_eeprom_checksum(struct wx *wx, u16 *checksum_val); 11 10 int txgbe_reset_hw(struct wx *wx); 12 11
-8
drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
··· 540 540 u16 eeprom_verh = 0, eeprom_verl = 0, offset = 0; 541 541 u16 eeprom_cfg_blkh = 0, eeprom_cfg_blkl = 0; 542 542 u16 build = 0, major = 0, patch = 0; 543 - u8 part_str[TXGBE_PBANUM_LENGTH]; 544 543 u32 etrack_id = 0; 545 544 546 545 err = pci_enable_device_mem(pdev); ··· 736 737 txgbe_check_minimum_link(wx); 737 738 else 738 739 dev_warn(&pdev->dev, "Failed to enumerate PF devices.\n"); 739 - 740 - /* First try to read PBA as a string */ 741 - err = txgbe_read_pba_string(wx, part_str, TXGBE_PBANUM_LENGTH); 742 - if (err) 743 - strncpy(part_str, "Unknown", TXGBE_PBANUM_LENGTH); 744 - 745 - netif_info(wx, probe, netdev, "%pM\n", netdev->dev_addr); 746 740 747 741 return 0; 748 742
-6
drivers/net/ethernet/wangxun/txgbe/txgbe_type.h
··· 88 88 #define TXGBE_XPCS_IDA_ADDR 0x13000 89 89 #define TXGBE_XPCS_IDA_DATA 0x13004 90 90 91 - /* Part Number String Length */ 92 - #define TXGBE_PBANUM_LENGTH 32 93 - 94 91 /* Checksum and EEPROM pointers */ 95 92 #define TXGBE_EEPROM_LAST_WORD 0x800 96 93 #define TXGBE_EEPROM_CHECKSUM 0x2F ··· 95 98 #define TXGBE_EEPROM_VERSION_L 0x1D 96 99 #define TXGBE_EEPROM_VERSION_H 0x1E 97 100 #define TXGBE_ISCSI_BOOT_CONFIG 0x07 98 - #define TXGBE_PBANUM0_PTR 0x05 99 - #define TXGBE_PBANUM1_PTR 0x06 100 - #define TXGBE_PBANUM_PTR_GUARD 0xFAFA 101 101 102 102 #define TXGBE_MAX_MSIX_VECTORS 64 103 103 #define TXGBE_MAX_FDIR_INDICES 63