Each logical interface has pointer to its parent controller and PHY interface structures. Corrected the code for dual MAC controllers. Each logical interface has its own TX and RX buffers. Use logical interface data for PHY read and write.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Daniil Egranov daniil.egranov@arm.com --- Drivers/Net/MarvellYukonDxe/if_mskreg.h | 17 ++++++++++++++--- Drivers/Net/MarvellYukonDxe/miivar.h | 15 ++------------- 2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/Drivers/Net/MarvellYukonDxe/if_mskreg.h b/Drivers/Net/MarvellYukonDxe/if_mskreg.h index 7718536..0e18598 100644 --- a/Drivers/Net/MarvellYukonDxe/if_mskreg.h +++ b/Drivers/Net/MarvellYukonDxe/if_mskreg.h @@ -99,6 +99,11 @@
/*$FreeBSD: src/sys/dev/msk/if_mskreg.h,v 1.27.2.10.2.1 2010/06/14 02:09:06 kensmith Exp $*/
+#ifndef _IF_MSKREG_H_ +#define _IF_MSKREG_H_ + +#include "miivar.h" + /* * SysKonnect PCI vendor ID */ @@ -2460,10 +2465,8 @@ struct msk_softc { INTN msk_int_holdoff; INTN msk_process_limit; INTN msk_stat_cons; - LIST_ENTRY TransmitQueueHead; - LIST_ENTRY TransmitFreeQueueHead; - LIST_ENTRY ReceiveQueueHead; EFI_EVENT Timer; + EFI_PCI_IO_PROTOCOL *PciIo; };
#define MSK_USECS(sc, us) ((sc)->msk_clock * (us)) @@ -2497,9 +2500,17 @@ struct msk_if_softc { struct msk_chain_data msk_cdata; struct msk_ring_data msk_rdata; struct msk_hw_stats msk_stats; + struct msk_softc *msk_softc; /* parent controller */ + VOID *phy_softc; /* interface phy */ + BOOLEAN active; + LIST_ENTRY TransmitQueueHead; + LIST_ENTRY TransmitFreeQueueHead; + LIST_ENTRY ReceiveQueueHead; EFI_MAC_ADDRESS MacAddress; };
#define MSK_TIMEOUT 1000 #define MSK_PHY_POWERUP 1 #define MSK_PHY_POWERDOWN 0 + +#endif /* _IF_MSKREG_H_ */ diff --git a/Drivers/Net/MarvellYukonDxe/miivar.h b/Drivers/Net/MarvellYukonDxe/miivar.h index 1903ef6..ff28017 100644 --- a/Drivers/Net/MarvellYukonDxe/miivar.h +++ b/Drivers/Net/MarvellYukonDxe/miivar.h @@ -55,13 +55,6 @@ #define _DEV_MII_MIIVAR_H_
/* - * Callbacks from MII layer into network interface device driver. - */ -INTN msk_phy_readreg (INTN, INTN); -INTN msk_phy_writereg (INTN, INTN, INTN); -void msk_miibus_statchg (INTN); - -/* * A network interface driver has one of these structures in its softc. * It is the interface from the network interface driver to the MII * layer. @@ -181,9 +174,9 @@ struct mii_phydesc { #define MII_PHY_DESC(a, b) { MII_OUI_ ## a, MII_MODEL_ ## a ## _ ## b, MII_STR_ ## a ## _ ## b } #define MII_PHY_END { 0, 0, NULL }
-#define PHY_READ(p, r) msk_phy_readreg ((p)->mmd->port, (r)) +#define PHY_READ(p, r) msk_phy_readreg ((p)->sc_if, (r))
-#define PHY_WRITE(p, r, v) msk_phy_writereg ((p)->mmd->port, (r), (v)) +#define PHY_WRITE(p, r, v) msk_phy_writereg ((p)->sc_if, (r), (v))
struct msk_mii_data { INTN port; @@ -191,8 +184,4 @@ struct msk_mii_data { INTN mii_flags; };
-EFI_STATUS e1000_probe_and_attach (struct mii_data *mii, const struct msk_mii_data *mmd); -void e1000phy_tick (void); -void e1000phy_mediachg (void); - #endif /* _DEV_MII_MIIVAR_H_ */