summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/smscusb.h
diff options
context:
space:
mode:
authorMichael Brown2018-04-19 13:38:55 +0200
committerMichael Brown2018-04-19 13:43:06 +0200
commit6804a8c89b8c31c3ef4e7e8ab03b82ebee41dd45 (patch)
treeceb234f68817ac16268c97b55771c0e0d16c9e7c /src/drivers/net/smscusb.h
parent[velocity] Fix usage of mii_read() and mii_write() (diff)
downloadipxe-6804a8c89b8c31c3ef4e7e8ab03b82ebee41dd45.tar.gz
ipxe-6804a8c89b8c31c3ef4e7e8ab03b82ebee41dd45.tar.xz
ipxe-6804a8c89b8c31c3ef4e7e8ab03b82ebee41dd45.zip
[mii] Separate concepts of MII interface and MII device
We currently have no generic concept of a PHY address, since all existing implementations simply hardcode the PHY address within the MII access methods. A bit-bashing MII interface will need to be provided with an explicit PHY address in order to generate the correct waveform. Allow for this by separating out the concept of a MII device (i.e. a specific PHY address attached to a particular MII interface). Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/smscusb.h')
-rw-r--r--src/drivers/net/smscusb.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/drivers/net/smscusb.h b/src/drivers/net/smscusb.h
index 5e4440ea..b5d9ad3f 100644
--- a/src/drivers/net/smscusb.h
+++ b/src/drivers/net/smscusb.h
@@ -151,7 +151,9 @@ struct smscusb_device {
/** USB network device */
struct usbnet_device usbnet;
/** MII interface */
- struct mii_interface mii;
+ struct mii_interface mdio;
+ /** MII device */
+ struct mii_device mii;
/** MII register base */
uint16_t mii_base;
/** PHY interrupt source register */
@@ -275,7 +277,8 @@ static inline __attribute__ (( always_inline )) void
smscusb_mii_init ( struct smscusb_device *smscusb, unsigned int mii_base,
unsigned int phy_source ) {
- mii_init ( &smscusb->mii, &smscusb_mii_operations );
+ mdio_init ( &smscusb->mdio, &smscusb_mii_operations );
+ mii_init ( &smscusb->mii, &smscusb->mdio, 0 );
smscusb->mii_base = mii_base;
smscusb->phy_source = phy_source;
}