diff options
author | Ian Moffett <ian@osmora.org> | 2025-06-22 03:17:40 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-06-22 03:17:40 -0400 |
commit | 7d212c1bc146ec9040d1db7af530a66bf530df66 (patch) | |
tree | 0fe045140700edb1670dadbb7ea4c67fd2a2bcfa /sys/dev/phy | |
parent | 51d525d4be110cc3616018eb78457f4310cb5ed4 (diff) |
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 <ian@osmora.org>
Diffstat (limited to 'sys/dev/phy')
-rw-r--r-- | sys/dev/phy/e1000.c | 13 |
1 files changed, 5 insertions, 8 deletions
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; } |