[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>
This commit is contained in:
Michael Brown
2018-04-19 12:38:55 +01:00
parent 285e3e5287
commit 6804a8c89b
10 changed files with 118 additions and 59 deletions

View File

@@ -37,10 +37,10 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
/**
* Restart autonegotiation
*
* @v mii MII interface
* @v mii MII device
* @ret rc Return status code
*/
int mii_restart ( struct mii_interface *mii ) {
int mii_restart ( struct mii_device *mii ) {
int bmcr;
int rc;
@@ -66,12 +66,12 @@ int mii_restart ( struct mii_interface *mii ) {
}
/**
* Reset MII interface
* Reset MII device
*
* @v mii MII interface
* @v mii MII device
* @ret rc Return status code
*/
int mii_reset ( struct mii_interface *mii ) {
int mii_reset ( struct mii_device *mii ) {
unsigned int i;
int bmcr;
int rc;
@@ -119,11 +119,11 @@ int mii_reset ( struct mii_interface *mii ) {
/**
* Update link status via MII
*
* @v mii MII interface
* @v mii MII device
* @v netdev Network device
* @ret rc Return status code
*/
int mii_check_link ( struct mii_interface *mii, struct net_device *netdev ) {
int mii_check_link ( struct mii_device *mii, struct net_device *netdev ) {
int bmsr;
int link;
int rc;