Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Fix a bug that 1Gbps is printed even if th...



details:   https://anonhg.NetBSD.org/src/rev/38bee910f3b2
branches:  trunk
changeset: 351240:38bee910f3b2
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Feb 08 04:20:29 2017 +0000

description:
Fix a bug that 1Gbps is printed even if the phyiscal media is at 100Mbps.

diffstat:

 sys/dev/pci/ixgbe/ixv.c |  33 ++++++++++++++++++++++++++-------
 1 files changed, 26 insertions(+), 7 deletions(-)

diffs (60 lines):

diff -r 5a333cc97b84 -r 38bee910f3b2 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Wed Feb 08 04:18:42 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Wed Feb 08 04:20:29 2017 +0000
@@ -31,7 +31,7 @@
 
 ******************************************************************************/
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.41 2017/02/08 04:14:05 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.42 2017/02/08 04:20:29 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1029,11 +1029,14 @@
        ifmr->ifm_status |= IFM_ACTIVE;
 
        switch (adapter->link_speed) {
+               case IXGBE_LINK_SPEED_10GB_FULL:
+                       ifmr->ifm_active |= IFM_10G_T | IFM_FDX;
+                       break;
                case IXGBE_LINK_SPEED_1GB_FULL:
                        ifmr->ifm_active |= IFM_1000_T | IFM_FDX;
                        break;
-               case IXGBE_LINK_SPEED_10GB_FULL:
-                       ifmr->ifm_active |= IFM_10G_T | IFM_FDX;
+               case IXGBE_LINK_SPEED_100_FULL:
+                       ifmr->ifm_active |= IFM_100_TX | IFM_FDX;
                        break;
        }
 
@@ -1227,10 +1230,26 @@
 
        if (adapter->link_up){ 
                if (adapter->link_active == FALSE) {
-                       if (bootverbose)
-                               device_printf(dev,"Link is up %d Gbps %s \n",
-                                   ((adapter->link_speed == 128)? 10:1),
-                                   "Full Duplex");
+                       if (bootverbose) {
+                               const char *bpsmsg;
+
+                               switch (adapter->link_speed) {
+                               case IXGBE_LINK_SPEED_10GB_FULL:
+                                       bpsmsg = "10 Gbps";
+                                       break;
+                               case IXGBE_LINK_SPEED_1GB_FULL:
+                                       bpsmsg = "1 Gbps";
+                                       break;
+                               case IXGBE_LINK_SPEED_100_FULL:
+                                       bpsmsg = "100 Mbps";
+                                       break;
+                               default:
+                                       bpsmsg = "unknown speed";
+                                       break;
+                               }
+                               device_printf(dev,"Link is up %s %s \n",
+                                   bpsmsg, "Full Duplex");
+                       }
                        adapter->link_active = TRUE;
                        if_link_state_change(ifp, LINK_STATE_UP);
                }



Home | Main Index | Thread Index | Old Index