From 044979827eda13675abab99879ebe3ea535d59fa Mon Sep 17 00:00:00 2001 From: Divy Le Ray Date: Wed, 8 Oct 2008 17:38:29 -0700 Subject: cxgb3: simplify port type struct and usage Second step in overall phy layer reorganization. Clean up the port_type_info structure. Support coextistence of clause 22 and clause 45 MDIO devices. Select the type of MDIO transaction on a per transaction basis. Signed-off-by: Divy Le Ray Signed-off-by: David S. Miller --- drivers/net/cxgb3/common.h | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'drivers/net/cxgb3/common.h') diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h index 78c10d3f0efa..e83a360bcc9e 100644 --- a/drivers/net/cxgb3/common.h +++ b/drivers/net/cxgb3/common.h @@ -193,8 +193,6 @@ struct mdio_ops { struct adapter_info { unsigned char nports; /* # of ports */ unsigned char phy_base_addr; /* MDIO PHY base address */ - unsigned char mdien; - unsigned char mdiinv; unsigned int gpio_out; /* GPIO output settings */ unsigned int gpio_intr; /* GPIO IRQ enable mask */ unsigned long caps; /* adapter capabilities */ @@ -202,13 +200,6 @@ struct adapter_info { const char *desc; /* product description */ }; -struct port_type_info { - int (*phy_prep)(struct cphy *phy, struct adapter *adapter, - int phy_addr, const struct mdio_ops *ops); - unsigned int caps; - const char *desc; -}; - struct mc5_stats { unsigned long parity_err; unsigned long active_rgn_full; @@ -548,7 +539,6 @@ enum { /* PHY operations */ struct cphy_ops { - void (*destroy)(struct cphy *phy); int (*reset)(struct cphy *phy, int wait); int (*intr_enable)(struct cphy *phy); @@ -569,8 +559,10 @@ struct cphy_ops { /* A PHY instance */ struct cphy { - int addr; /* PHY address */ + int addr; /* PHY address */ + unsigned int caps; /* PHY capabilities */ struct adapter *adapter; /* associated adapter */ + const char *desc; /* PHY description */ unsigned long fifo_errors; /* FIFO over/under-flows */ const struct cphy_ops *ops; /* PHY operations */ int (*mdio_read)(struct adapter *adapter, int phy_addr, int mmd_addr, @@ -595,10 +587,13 @@ static inline int mdio_write(struct cphy *phy, int mmd, int reg, /* Convenience initializer */ static inline void cphy_init(struct cphy *phy, struct adapter *adapter, int phy_addr, struct cphy_ops *phy_ops, - const struct mdio_ops *mdio_ops) + const struct mdio_ops *mdio_ops, + unsigned int caps, const char *desc) { - phy->adapter = adapter; phy->addr = phy_addr; + phy->caps = caps; + phy->adapter = adapter; + phy->desc = desc; phy->ops = phy_ops; if (mdio_ops) { phy->mdio_read = mdio_ops->read; -- cgit v1.2.3