Skip to contentSkip to conversation

cxgb3 - Add 1G fiber support

PATCH Applied Divy Le Ray 2 participants 2 messages Oct 9, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 8/8 cxgb3 - Add 1G fiber support

From: Divy Le Ray <[email protected]>

Add support for 1G optical Vitesse PHY.

---

 drivers/net/cxgb3/common.h  |    1 
 drivers/net/cxgb3/t3_hw.c   |   23 +++++
 drivers/net/cxgb3/vsc8211.c |  196 ++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 208 insertions(+), 12 deletions(-)
drivers/net/cxgb3/common.h +1 -0
index 416d3dd..593fb64 100644
@@ -691,6 +691,7 @@ int t3_mdio_change_bits(struct cphy *phy, int mmd, int reg, unsigned int clear,
 			unsigned int set);
 int t3_phy_reset(struct cphy *phy, int mmd, int wait);
 int t3_phy_advertise(struct cphy *phy, unsigned int advert);
+int t3_phy_advertise_fiber(struct cphy *phy, unsigned int advert);
 int t3_set_phy_speed_duplex(struct cphy *phy, int speed, int duplex);
 int t3_phy_lasi_intr_enable(struct cphy *phy);
 int t3_phy_lasi_intr_disable(struct cphy *phy);
drivers/net/cxgb3/t3_hw.c +23 -0
index 9d9c0ba..4da5b09 100644
@@ -408,6 +408,29 @@ int t3_phy_advertise(struct cphy *phy, unsigned int advert)
 }
 
 /**
+ *	t3_phy_advertise_fiber - set fiber PHY advertisement register
+ *	@phy: the PHY to operate on
+ *	@advert: bitmap of capabilities the PHY should advertise
+ *
+ *	Sets a fiber PHY's advertisement register to advertise the
+ *	requested capabilities.
+ */
+int t3_phy_advertise_fiber(struct cphy *phy, unsigned int advert)
+{
+	unsigned int val = 0;
+
+	if (advert & ADVERTISED_1000baseT_Half)
+		val |= ADVERTISE_1000XHALF;
+	if (advert & ADVERTISED_1000baseT_Full)
+		val |= ADVERTISE_1000XFULL;
+	if (advert & ADVERTISED_Pause)
+		val |= ADVERTISE_1000XPAUSE;
+	if (advert & ADVERTISED_Asym_Pause)
+		val |= ADVERTISE_1000XPSE_ASYM;
+	return mdio_write(phy, 0, MII_ADVERTISE, val);
+}
+
+/**
  *	t3_set_phy_speed_duplex - force PHY speed and duplex
  *	@phy: the PHY to operate on
  *	@speed: requested PHY speed
drivers/net/cxgb3/vsc8211.c +184 -12

230 lines not on this page · raw message