iPXE
|
Media Independent Interface. More...
Go to the source code of this file.
Data Structures | |
struct | mii_operations |
MII interface operations. More... | |
struct | mii_interface |
An MII interface. More... | |
struct | mii_device |
An MII device. More... | |
Macros | |
#define | MII_RESET_MAX_WAIT_MS 500 |
Maximum time to wait for a reset, in milliseconds. More... | |
#define | MII_MAX_PHY_ADDRESS 31 |
Maximum PHY address. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | mdio_init (struct mii_interface *mdio, struct mii_operations *op) |
Initialise MII interface. More... | |
static void | mii_init (struct mii_device *mii, struct mii_interface *mdio, unsigned int address) |
Initialise MII device. More... | |
static int | mii_read (struct mii_device *mii, unsigned int reg) |
Read from MII register. More... | |
static int | mii_write (struct mii_device *mii, unsigned int reg, unsigned int data) |
Write to MII register. More... | |
static void | mii_dump (struct mii_device *mii) |
Dump MII registers (for debugging) More... | |
int | mii_restart (struct mii_device *mii) |
Restart autonegotiation. More... | |
int | mii_reset (struct mii_device *mii) |
Reset MII device. More... | |
int | mii_check_link (struct mii_device *mii, struct net_device *netdev) |
Update link status via MII. More... | |
int | mii_find (struct mii_device *mii) |
Find PHY address. More... | |
Media Independent Interface.
Definition in file mii.h.
#define MII_RESET_MAX_WAIT_MS 500 |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Initialise MII interface.
mdio | MII interface |
op | MII interface operations |
Definition at line 63 of file mii.h.
References mii_interface::op, and op.
Referenced by init_mii_bit_basher(), rdc_probe(), realtek_probe(), rhine_probe(), and velocity_probe().
|
inlinestatic |
Initialise MII device.
mii | MII device |
mdio | MII interface |
address | PHY address |
Definition at line 75 of file mii.h.
Referenced by icplus_probe(), rdc_probe(), realtek_probe(), rhine_probe(), and velocity_probe().
|
inlinestatic |
Read from MII register.
mii | MII device |
reg | Register address |
data | Data read, or negative error |
Definition at line 89 of file mii.h.
References mii, mii_interface::op, mii_operations::read, and reg.
Referenced by mii_dump().
|
inlinestatic |
Write to MII register.
mii | MII device |
reg | Register address |
data | Data to write |
rc | Return status code |
Definition at line 104 of file mii.h.
References data, mii, mii_interface::op, reg, and mii_operations::write.
Referenced by icplus_init_phy(), mii_reset(), mii_restart(), realtek_phy_reset(), realtek_phy_speed(), smscusb_mii_check_link(), smscusb_mii_open(), and velocity_set_link().
|
inlinestatic |
Dump MII registers (for debugging)
mii | MII device |
Definition at line 116 of file mii.h.
References data, DBG_LOG, DBGC, mii, and mii_read().
Referenced by realtek_check_link().
int mii_restart | ( | struct mii_device * | mii | ) |
Restart autonegotiation.
mii | MII device |
rc | Return status code |
Definition at line 43 of file mii.c.
References BMCR_ANENABLE, BMCR_ANRESTART, DBGC, mii, MII_BMCR, mii_read(), mii_write(), rc, and strerror().
Referenced by mii_reset(), and realtek_phy_reset().
int mii_reset | ( | struct mii_device * | mii | ) |
Reset MII device.
mii | MII device |
rc | Return status code |
Definition at line 74 of file mii.c.
References BMCR_ANENABLE, BMCR_RESET, DBGC, ETIMEDOUT, mdelay(), mii, MII_BMCR, mii_read(), MII_RESET_MAX_WAIT_MS, mii_restart(), mii_write(), rc, and strerror().
Referenced by icplus_init_phy(), rdc_init_phy(), realtek_phy_reset(), rhine_probe(), and velocity_probe().
int mii_check_link | ( | struct mii_device * | mii, |
struct net_device * | netdev | ||
) |
Update link status via MII.
mii | MII device |
netdev | Network device |
rc | Return status code |
Definition at line 126 of file mii.c.
References BMSR_LSTATUS, DBGC, link, mii, MII_BMSR, mii_read(), netdev, netdev_link_down(), netdev_link_up(), and rc.
Referenced by rdc_check_link(), and smscusb_mii_check_link().
int mii_find | ( | struct mii_device * | mii | ) |
Find PHY address.
mii | MII device |
rc | Return status code |
Definition at line 157 of file mii.c.
References address, DBGC, ENOENT, id, mii, MII_MAX_PHY_ADDRESS, MII_PHYSID1, and mii_read().
Referenced by icplus_init_phy(), and rdc_init_phy().