aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ixgbe
diff options
context:
space:
mode:
authorMarcelo Araujo <araujo@FreeBSD.org>2015-03-09 08:22:11 +0000
committerMarcelo Araujo <araujo@FreeBSD.org>2015-03-09 08:22:11 +0000
commitdf634d45d345a9fc9ad33878be07bfcbd7947d80 (patch)
tree6d7c4d944889fda8c3f119de5fbc3ea84af895ae /sys/dev/ixgbe
parentd85550b2c7d1aaf70ae6ee825228cdee9647dad1 (diff)
downloadsrc-df634d45d345a9fc9ad33878be07bfcbd7947d80.tar.gz
src-df634d45d345a9fc9ad33878be07bfcbd7947d80.zip
Notes
Diffstat (limited to 'sys/dev/ixgbe')
-rw-r--r--sys/dev/ixgbe/ixgbe.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c
index 28d1271c868c..ecaa37a94837 100644
--- a/sys/dev/ixgbe/ixgbe.c
+++ b/sys/dev/ixgbe/ixgbe.c
@@ -1699,6 +1699,7 @@ static void
ixgbe_media_status(struct ifnet * ifp, struct ifmediareq * ifmr)
{
struct adapter *adapter = ifp->if_softc;
+ struct ixgbe_hw *hw = &adapter->hw;
INIT_DEBUGOUT("ixgbe_media_status: begin");
IXGBE_CORE_LOCK(adapter);
@@ -1714,17 +1715,29 @@ ixgbe_media_status(struct ifnet * ifp, struct ifmediareq * ifmr)
ifmr->ifm_status |= IFM_ACTIVE;
- switch (adapter->link_speed) {
- case IXGBE_LINK_SPEED_100_FULL:
- ifmr->ifm_active |= IFM_100_TX | IFM_FDX;
- break;
- case IXGBE_LINK_SPEED_1GB_FULL:
- ifmr->ifm_active |= IFM_1000_SX | IFM_FDX;
- break;
- case IXGBE_LINK_SPEED_10GB_FULL:
- ifmr->ifm_active |= adapter->optics | IFM_FDX;
- break;
- }
+ /*
+ * Not all NIC are 1000baseSX as an example X540T.
+ * We must set properly the media based on NIC model.
+ */
+ switch (hw->device_id) {
+ case IXGBE_DEV_ID_X540T:
+ if (adapter->link_speed == IXGBE_LINK_SPEED_100_FULL)
+ ifmr->ifm_active |= IFM_100_TX | IFM_FDX;
+ else if (adapter->link_speed == IXGBE_LINK_SPEED_1GB_FULL)
+ ifmr->ifm_active |= IFM_1000_T | IFM_FDX;
+ else if (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL)
+ ifmr->ifm_active |= adapter->optics | IFM_FDX;
+ break;
+ default:
+ if (adapter->link_speed == IXGBE_LINK_SPEED_100_FULL)
+ ifmr->ifm_active |= IFM_100_TX | IFM_FDX;
+ else if (adapter->link_speed == IXGBE_LINK_SPEED_1GB_FULL)
+ ifmr->ifm_active |= IFM_1000_SX | IFM_FDX;
+ else if (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL)
+ ifmr->ifm_active |= adapter->optics | IFM_FDX;
+ break;
+ }
+
IXGBE_CORE_UNLOCK(adapter);