Skip to contentSkip to conversation

igb: add check for fiber/serdes devices to igb_set_spd_dplx;

PATCH Applied Jeff Kirsher 2 participants 2 messages Oct 13, 2010 – Oct 14, 2010

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

PATCH 1/1 igb: add check for fiber/serdes devices to igb_set_spd_dplx;

From: Carolyn Wyborny <[email protected]>

---

 drivers/net/igb/igb_main.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/net/igb/igb_main.c +7 -0
index 55edcb7..5b04eff 100644
@@ -6115,6 +6115,13 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx)
 
 	mac->autoneg = 0;
 
+	/* Fiber NIC's only allow 1000 Gbps Full duplex */
+	if ((adapter->hw.phy.media_type == e1000_media_type_internal_serdes) &&
+		spddplx != (SPEED_1000 + DUPLEX_FULL)) {
+		dev_err(&pdev->dev, "Unsupported Speed/Duplex configuration\n");
+		return -EINVAL;
+	}
+
 	switch (spddplx) {
 	case SPEED_10 + DUPLEX_HALF:
 		mac->forced_speed_duplex = ADVERTISE_10_HALF;