diff options
author | Divy Le Ray <divy@chelsio.com> | 2008-10-08 20:38:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-08 20:38:29 -0400 |
commit | 044979827eda13675abab99879ebe3ea535d59fa (patch) | |
tree | bc4917540c36679c56cd1d3e70d26242233a555c /drivers/net/cxgb3/common.h | |
parent | 78e4689e908adc8334272756c32c9218d1967408 (diff) |
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 <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb3/common.h')
-rw-r--r-- | drivers/net/cxgb3/common.h | 21 |
1 files changed, 8 insertions, 13 deletions
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 { | |||
193 | struct adapter_info { | 193 | struct adapter_info { |
194 | unsigned char nports; /* # of ports */ | 194 | unsigned char nports; /* # of ports */ |
195 | unsigned char phy_base_addr; /* MDIO PHY base address */ | 195 | unsigned char phy_base_addr; /* MDIO PHY base address */ |
196 | unsigned char mdien; | ||
197 | unsigned char mdiinv; | ||
198 | unsigned int gpio_out; /* GPIO output settings */ | 196 | unsigned int gpio_out; /* GPIO output settings */ |
199 | unsigned int gpio_intr; /* GPIO IRQ enable mask */ | 197 | unsigned int gpio_intr; /* GPIO IRQ enable mask */ |
200 | unsigned long caps; /* adapter capabilities */ | 198 | unsigned long caps; /* adapter capabilities */ |
@@ -202,13 +200,6 @@ struct adapter_info { | |||
202 | const char *desc; /* product description */ | 200 | const char *desc; /* product description */ |
203 | }; | 201 | }; |
204 | 202 | ||
205 | struct port_type_info { | ||
206 | int (*phy_prep)(struct cphy *phy, struct adapter *adapter, | ||
207 | int phy_addr, const struct mdio_ops *ops); | ||
208 | unsigned int caps; | ||
209 | const char *desc; | ||
210 | }; | ||
211 | |||
212 | struct mc5_stats { | 203 | struct mc5_stats { |
213 | unsigned long parity_err; | 204 | unsigned long parity_err; |
214 | unsigned long active_rgn_full; | 205 | unsigned long active_rgn_full; |
@@ -548,7 +539,6 @@ enum { | |||
548 | 539 | ||
549 | /* PHY operations */ | 540 | /* PHY operations */ |
550 | struct cphy_ops { | 541 | struct cphy_ops { |
551 | void (*destroy)(struct cphy *phy); | ||
552 | int (*reset)(struct cphy *phy, int wait); | 542 | int (*reset)(struct cphy *phy, int wait); |
553 | 543 | ||
554 | int (*intr_enable)(struct cphy *phy); | 544 | int (*intr_enable)(struct cphy *phy); |
@@ -569,8 +559,10 @@ struct cphy_ops { | |||
569 | 559 | ||
570 | /* A PHY instance */ | 560 | /* A PHY instance */ |
571 | struct cphy { | 561 | struct cphy { |
572 | int addr; /* PHY address */ | 562 | int addr; /* PHY address */ |
563 | unsigned int caps; /* PHY capabilities */ | ||
573 | struct adapter *adapter; /* associated adapter */ | 564 | struct adapter *adapter; /* associated adapter */ |
565 | const char *desc; /* PHY description */ | ||
574 | unsigned long fifo_errors; /* FIFO over/under-flows */ | 566 | unsigned long fifo_errors; /* FIFO over/under-flows */ |
575 | const struct cphy_ops *ops; /* PHY operations */ | 567 | const struct cphy_ops *ops; /* PHY operations */ |
576 | int (*mdio_read)(struct adapter *adapter, int phy_addr, int mmd_addr, | 568 | 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, | |||
595 | /* Convenience initializer */ | 587 | /* Convenience initializer */ |
596 | static inline void cphy_init(struct cphy *phy, struct adapter *adapter, | 588 | static inline void cphy_init(struct cphy *phy, struct adapter *adapter, |
597 | int phy_addr, struct cphy_ops *phy_ops, | 589 | int phy_addr, struct cphy_ops *phy_ops, |
598 | const struct mdio_ops *mdio_ops) | 590 | const struct mdio_ops *mdio_ops, |
591 | unsigned int caps, const char *desc) | ||
599 | { | 592 | { |
600 | phy->adapter = adapter; | ||
601 | phy->addr = phy_addr; | 593 | phy->addr = phy_addr; |
594 | phy->caps = caps; | ||
595 | phy->adapter = adapter; | ||
596 | phy->desc = desc; | ||
602 | phy->ops = phy_ops; | 597 | phy->ops = phy_ops; |
603 | if (mdio_ops) { | 598 | if (mdio_ops) { |
604 | phy->mdio_read = mdio_ops->read; | 599 | phy->mdio_read = mdio_ops->read; |