From 7d212c1bc146ec9040d1db7af530a66bf530df66 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 22 Jun 2025 03:17:40 -0400 Subject: kernel: e1000: Use raw register VAP offsets The E1000 may add padding in-between registers and for the sake of simplicity, we will deal with raw offsets instead of a silly structure. Signed-off-by: Ian Moffett --- sys/dev/phy/e1000.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'sys/dev/phy/e1000.c') diff --git a/sys/dev/phy/e1000.c b/sys/dev/phy/e1000.c index c25d6ee..ad20e52 100644 --- a/sys/dev/phy/e1000.c +++ b/sys/dev/phy/e1000.c @@ -45,11 +45,7 @@ static struct pci_device *e1000; struct e1000_nic { - union { - struct e1000_iomem *iop; - void *vap; - }; - + void *vap; uint8_t has_eeprom : 1; uint16_t eeprom_size; }; @@ -66,17 +62,18 @@ struct e1000_nic { static void eeprom_query(struct e1000_nic *np) { - uint32_t eecd; uint16_t size_bits = 1024; + uint32_t eecd, *eecd_p; const char *typestr = "microwire"; - struct e1000_iomem *iop = np->iop; + + eecd_p = PTR_OFFSET(np->vap, E1000_EECD); /* * First we should check if there is an EEPROM * on-board as if not, there is nothing we can do * here. */ - eecd = mmio_read32(&iop->eecd); + eecd = mmio_read32(eecd_p); if (!ISSET(eecd, E1000_EECD_PRES)) { return; } -- cgit v1.2.3