From: Malli Chilakala Date: Sat, 18 Jun 2005 00:44:20 +0000 (-0700) Subject: [PATCH] e1000: Ethtool set speed/duplex validates parameters for consistency X-Git-Tag: v2.6.13-rc1~51^2~40^2~11 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=6921368f64c59b2a1d4659a958c69458c94d8b75;p=linux-2.6-omap-h63xx.git [PATCH] e1000: Ethtool set speed/duplex validates parameters for consistency Ethtool set speed/duplex validates parameters for consistency Signed-off-by: Mallikarjuna R Chilakala Signed-off-by: Ganesh Venkatesan Signed-off-by: John Ronciak --- diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index d59f75b7bf1..f680c87254b 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -3617,6 +3617,13 @@ e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx) { adapter->hw.autoneg = 0; + /* Fiber NICs only allow 1000 gbps Full duplex */ + if((adapter->hw.media_type == e1000_media_type_fiber) && + spddplx != (SPEED_1000 + DUPLEX_FULL)) { + DPRINTK(PROBE, ERR, "Unsupported Speed/Duplex configuration\n"); + return -EINVAL; + } + switch(spddplx) { case SPEED_10 + DUPLEX_HALF: adapter->hw.forced_speed_duplex = e1000_10_half;