summaryrefslogtreecommitdiff
path: root/sys/include/dev/phy
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-06-22 03:21:15 -0400
committerIan Moffett <ian@osmora.org>2025-06-22 03:51:36 -0400
commitc350af5c23326d408047966fae453fa709bf2be4 (patch)
treea5e526fcbcbdbe96fefc31a35763f8cb05e99239 /sys/include/dev/phy
parentde130e9873a1f2e3c275c0f091482e9e18e05466 (diff)
kernel: e1000: Read MAC address into `netif'
This commit implements EEPROM reading logic as well as some code to read the ethernet address into a `netif' structure. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/dev/phy')
-rw-r--r--sys/include/dev/phy/e1000regs.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/include/dev/phy/e1000regs.h b/sys/include/dev/phy/e1000regs.h
index 907996d..7caceee 100644
--- a/sys/include/dev/phy/e1000regs.h
+++ b/sys/include/dev/phy/e1000regs.h
@@ -100,4 +100,20 @@
#define E1000_EECD_SIZE BIT(9) /* EEPROM size (1024-bit [0], 4096-bit [1]) */
#define E1000_EECD_TYPE BIT(13) /* EEPROM type (microwire [0], SPI [1]) */
+/*
+ * EEPROM read (`eerd') register bits
+ *
+ * See section 13.4.4 of the PCI/PCI-X Intel Gigabit
+ * Ethernet controller spec
+ */
+#define E1000_EERD_START BIT(0) /* Start read */
+#define E1000_EERD_DONE BIT(4) /* EEPROM read finished */
+
+/*
+ * EEPROM word addresses
+ */
+#define E1000_HWADDR0 0x00 /* Word 0 */
+#define E1000_HWADDR1 0x01 /* Word 1 */
+#define E1000_HWADDR2 0x02 /* Word 2 */
+
#endif /* !_PHY_E1000_REGS_H_ */