Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Use if_link_state_change() even if ixl(4) is att...



details:   https://anonhg.NetBSD.org/src/rev/5d3d7fd5630b
branches:  trunk
changeset: 744587:5d3d7fd5630b
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Fri Feb 07 09:38:29 2020 +0000

description:
Use if_link_state_change() even if ixl(4) is attaching

diffstat:

 sys/dev/pci/if_ixl.c |  20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diffs (69 lines):

diff -r 7c7708d5ddd2 -r 5d3d7fd5630b sys/dev/pci/if_ixl.c
--- a/sys/dev/pci/if_ixl.c      Fri Feb 07 07:16:32 2020 +0000
+++ b/sys/dev/pci/if_ixl.c      Fri Feb 07 09:38:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ixl.c,v 1.36 2020/02/04 05:44:14 thorpej Exp $      */
+/*     $NetBSD: if_ixl.c,v 1.37 2020/02/07 09:38:29 yamaguchi Exp $    */
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -793,7 +793,7 @@
 static int     ixl_set_vsi(struct ixl_softc *);
 static void    ixl_set_filter_control(struct ixl_softc *);
 static void    ixl_get_link_status(void *);
-static int     ixl_get_link_status_poll(struct ixl_softc *);
+static int     ixl_get_link_status_poll(struct ixl_softc *, int *);
 static int     ixl_set_link_status(struct ixl_softc *,
                    const struct ixl_aq_desc *);
 static uint64_t        ixl_search_link_speed(uint8_t);
@@ -1083,7 +1083,7 @@
        pcireg_t memtype;
        uint32_t firstq, port, ari, func;
        char xnamebuf[32];
-       int tries, rv;
+       int tries, rv, link;
 
        sc = device_private(self);
        sc->sc_dev = self;
@@ -1285,7 +1285,7 @@
                goto free_hmc;
        }
 
-       rv = ixl_get_link_status_poll(sc);
+       rv = ixl_get_link_status_poll(sc, NULL);
        if (rv != 0) {
                aprint_error_dev(self, "GET LINK STATUS %s\n",
                    rv == ETIMEDOUT ? "timeout" : "error");
@@ -1395,7 +1395,11 @@
        ether_ifattach(ifp, sc->sc_enaddr);
        ether_set_ifflags_cb(&sc->sc_ec, ixl_ifflags_cb);
 
-       (void)ixl_get_link_status_poll(sc);
+       rv = ixl_get_link_status_poll(sc, &link);
+       if (rv != 0)
+               link = LINK_STATE_UNKNOWN;
+       if_link_state_change(ifp, link);
+
        ixl_work_set(&sc->sc_link_state_task, ixl_get_link_status, sc);
 
        ixl_config_other_intr(sc);
@@ -4435,7 +4439,7 @@
 }
 
 static int
-ixl_get_link_status_poll(struct ixl_softc *sc)
+ixl_get_link_status_poll(struct ixl_softc *sc, int *l)
 {
        struct ixl_aq_desc iaq;
        struct ixl_aq_link_param *param;
@@ -4454,7 +4458,9 @@
        }
 
        link = ixl_set_link_status(sc, &iaq);
-       sc->sc_ec.ec_if.if_link_state = link;
+
+       if (l != NULL)
+               *l = link;
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index