From 732f2ab7afb975755dcfbdcbe6eafe42e8cdc1d4 Mon Sep 17 00:00:00 2001 From: "Lendacky, Thomas" Date: Thu, 10 Nov 2016 17:11:14 -0600 Subject: amd-xgbe: Add support for MDIO attached PHYs Use the phylib support in the kernel to communicate with and control an MDIO attached PHY. Use the hardware's MDIO communication mechanism to communicate with the PHY. Signed-off-by: Tom Lendacky Signed-off-by: David S. Miller --- drivers/net/ethernet/amd/xgbe/xgbe.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/net/ethernet/amd/xgbe/xgbe.h') diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h index a691f844fa72..34db47094c61 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe.h +++ b/drivers/net/ethernet/amd/xgbe/xgbe.h @@ -289,6 +289,9 @@ /* ECC correctable error notification window (seconds) */ #define XGBE_ECC_LIMIT 60 +/* MDIO port types */ +#define XGMAC_MAX_C22_PORT 3 + struct xgbe_prv_data; struct xgbe_packet_data { @@ -675,6 +678,14 @@ struct xgbe_hw_if { void (*write_mmd_regs)(struct xgbe_prv_data *, int, int, int); int (*set_speed)(struct xgbe_prv_data *, int); + int (*set_ext_mii_mode)(struct xgbe_prv_data *, unsigned int, + enum xgbe_mdio_mode); + int (*read_ext_mii_regs)(struct xgbe_prv_data *, int, int); + int (*write_ext_mii_regs)(struct xgbe_prv_data *, int, int, u16); + + int (*set_gpio)(struct xgbe_prv_data *, unsigned int); + int (*clr_gpio)(struct xgbe_prv_data *, unsigned int); + void (*enable_tx)(struct xgbe_prv_data *); void (*disable_tx)(struct xgbe_prv_data *); void (*enable_rx)(struct xgbe_prv_data *); @@ -1111,6 +1122,7 @@ struct xgbe_prv_data { struct xgbe_phy phy; int mdio_mmd; unsigned long link_check; + struct completion mdio_complete; char an_name[IFNAMSIZ + 32]; struct workqueue_struct *an_workqueue; -- cgit