Skip to content

Commit

Permalink
[PATCH] e1000: Ethtool set speed/duplex validates parameters for cons…
Browse files Browse the repository at this point in the history
…istency

Ethtool set speed/duplex validates parameters for consistency

Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Signed-off-by: Ganesh Venkatesan <ganesh.venkatesan@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
  • Loading branch information
Malli Chilakala authored and Jeff Garzik committed Jun 27, 2005
1 parent d439d4b commit 6921368
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6921368

Please sign in to comment.