drivers/net: Add device index for multiple NIC cards
This patch adds a member device_index to r8168 chip information which allows driver to identify which NIC card requests MAC address. In this implementation, only 10 NIC cards are supported, the device index is in the range of 0 to 10. Regarding to MAC address mapping, when there is only one NIC on DUT, it is treated as a special case mapping to "ethernet_mac" in VPD for backward compatibility. When there are multiple NICs on DUT, they are mapping to "ethernet_macN" where N is [0-9]. Device tree configuration: For single NIC: .device_index = "0", maps to "ethernet_mac" For multiple NICs: .device_index = "[1-10]", maps to "ethernet_mac[device_index - 1]" BUG=b:69950854 BRANCH=None TEST=Added device_index = [0-10] under /drivers/net in device tree && Programmed the mac address to VPD in shell vpd -s ethernet_mac=<mac address> or vpd -s ethernet-mac[0-9]=<mac address> && reboot the system. Ensure the MAC address was fetched correctly by ifconfig command. Change-Id: I108b9bfba39370c8906a2fa4d2b39b106e884e0c Signed-off-by: Gaggery Tsai <gaggery.tsai@intel.com> Reviewed-on: https://review.coreboot.org/22984 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
committed by
Furquan Shaikh
parent
ff588063e9
commit
1f84704636
@ -16,7 +16,13 @@
|
||||
|
||||
struct drivers_net_config {
|
||||
uint16_t customized_leds;
|
||||
unsigned wake; /* Wake pin for ACPI _PRW */
|
||||
unsigned wake; /* Wake pin for ACPI _PRW */
|
||||
/*
|
||||
* There maybe many NIC cards in a system.
|
||||
* This paramter is for driver to identify what
|
||||
* the device number is and the valid range is [1-10].
|
||||
*/
|
||||
uint8_t device_index;
|
||||
};
|
||||
|
||||
#endif /* __DRIVERS_R8168_CHIP_H__ */
|
||||
|
Reference in New Issue
Block a user