igc: Change default duplex setting
During media selection through ifconfig one might not specify the duplex setting through the mediaopt flag. In that case the igc driver would default to full-duplex. The problem with this approach is that e1000(em/igb) driver defaults to half-duplex. Because of that if one connects both NICs and sets media to e.g. 100baseTX on both of them no link will be found. Fix that by matching igc behaviour with what e1000 does. Reviewed by: grehan Approved by: mw(mentor) Obtained from: Semihalf Sponsored by: Stormshield MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35673
This commit is contained in:
parent
ab453714fc
commit
3b8d04f845
@ -1070,16 +1070,16 @@ igc_if_media_change(if_ctx_t ctx)
|
|||||||
adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
|
adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
|
||||||
break;
|
break;
|
||||||
case IFM_100_TX:
|
case IFM_100_TX:
|
||||||
if ((ifm->ifm_media & IFM_GMASK) == IFM_HDX)
|
if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX)
|
||||||
adapter->hw.phy.autoneg_advertised = ADVERTISE_100_HALF;
|
|
||||||
else
|
|
||||||
adapter->hw.phy.autoneg_advertised = ADVERTISE_100_FULL;
|
adapter->hw.phy.autoneg_advertised = ADVERTISE_100_FULL;
|
||||||
|
else
|
||||||
|
adapter->hw.phy.autoneg_advertised = ADVERTISE_100_HALF;
|
||||||
break;
|
break;
|
||||||
case IFM_10_T:
|
case IFM_10_T:
|
||||||
if ((ifm->ifm_media & IFM_GMASK) == IFM_HDX)
|
if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX)
|
||||||
adapter->hw.phy.autoneg_advertised = ADVERTISE_10_HALF;
|
|
||||||
else
|
|
||||||
adapter->hw.phy.autoneg_advertised = ADVERTISE_10_FULL;
|
adapter->hw.phy.autoneg_advertised = ADVERTISE_10_FULL;
|
||||||
|
else
|
||||||
|
adapter->hw.phy.autoneg_advertised = ADVERTISE_10_HALF;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
device_printf(adapter->dev, "Unsupported media type\n");
|
device_printf(adapter->dev, "Unsupported media type\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user