summaryrefslogtreecommitdiff
path: root/src/drivers/net/chip.h
diff options
context:
space:
mode:
authorGaggery Tsai <gaggery.tsai@intel.com>2017-12-26 17:13:52 +0800
committerFurquan Shaikh <furquan@google.com>2018-01-22 23:04:34 +0000
commit1f8470463634b4e09c986150a07b51edfd1999ee (patch)
tree88e33b6ed61b1ae8e909c86347766b2cf33fa809 /src/drivers/net/chip.h
parentff588063e9f747a6c13a009fb100ed49fca93c7b (diff)
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>
Diffstat (limited to 'src/drivers/net/chip.h')
-rw-r--r--src/drivers/net/chip.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/drivers/net/chip.h b/src/drivers/net/chip.h
index 8e8c02b002..81dbefa556 100644
--- a/src/drivers/net/chip.h
+++ b/src/drivers/net/chip.h
@@ -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__ */