| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_ixl.c,v 1.60 2020/03/03 04:55:46 yamaguchi Exp $ */ | | 1 | /* $NetBSD: if_ixl.c,v 1.61 2020/03/12 09:34:41 yamaguchi Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2013-2015, Intel Corporation | | 4 | * Copyright (c) 2013-2015, Intel Corporation |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | | | 6 | |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions are met: | | 8 | * modification, are permitted provided that the following conditions are met: |
9 | * | | 9 | * |
10 | * 1. Redistributions of source code must retain the above copyright notice, | | 10 | * 1. Redistributions of source code must retain the above copyright notice, |
11 | * this list of conditions and the following disclaimer. | | 11 | * this list of conditions and the following disclaimer. |
12 | * | | 12 | * |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -64,27 +64,27 @@ | | | @@ -64,27 +64,27 @@ |
64 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 64 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
65 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 65 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
66 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 66 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
67 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 67 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
68 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 68 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
69 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 69 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
70 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 70 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
71 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 71 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
72 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 72 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
73 | * POSSIBILITY OF SUCH DAMAGE. | | 73 | * POSSIBILITY OF SUCH DAMAGE. |
74 | */ | | 74 | */ |
75 | | | 75 | |
76 | #include <sys/cdefs.h> | | 76 | #include <sys/cdefs.h> |
77 | __KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.60 2020/03/03 04:55:46 yamaguchi Exp $"); | | 77 | __KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.61 2020/03/12 09:34:41 yamaguchi Exp $"); |
78 | | | 78 | |
79 | #ifdef _KERNEL_OPT | | 79 | #ifdef _KERNEL_OPT |
80 | #include "opt_net_mpsafe.h" | | 80 | #include "opt_net_mpsafe.h" |
81 | #include "opt_if_ixl.h" | | 81 | #include "opt_if_ixl.h" |
82 | #endif | | 82 | #endif |
83 | | | 83 | |
84 | #include <sys/param.h> | | 84 | #include <sys/param.h> |
85 | #include <sys/types.h> | | 85 | #include <sys/types.h> |
86 | | | 86 | |
87 | #include <sys/cpu.h> | | 87 | #include <sys/cpu.h> |
88 | #include <sys/device.h> | | 88 | #include <sys/device.h> |
89 | #include <sys/evcnt.h> | | 89 | #include <sys/evcnt.h> |
90 | #include <sys/interrupt.h> | | 90 | #include <sys/interrupt.h> |
| @@ -1678,31 +1678,26 @@ ixl_media_add(struct ixl_softc *sc) | | | @@ -1678,31 +1678,26 @@ ixl_media_add(struct ixl_softc *sc) |
1678 | 0, NULL); | | 1678 | 0, NULL); |
1679 | } | | 1679 | } |
1680 | } | | 1680 | } |
1681 | } | | 1681 | } |
1682 | } | | 1682 | } |
1683 | | | 1683 | |
1684 | static void | | 1684 | static void |
1685 | ixl_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) | | 1685 | ixl_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) |
1686 | { | | 1686 | { |
1687 | struct ixl_softc *sc = ifp->if_softc; | | 1687 | struct ixl_softc *sc = ifp->if_softc; |
1688 | | | 1688 | |
1689 | ifmr->ifm_status = sc->sc_media_status; | | 1689 | ifmr->ifm_status = sc->sc_media_status; |
1690 | ifmr->ifm_active = sc->sc_media_active; | | 1690 | ifmr->ifm_active = sc->sc_media_active; |
1691 | | | | |
1692 | mutex_enter(&sc->sc_cfg_lock); | | | |
1693 | if (ifp->if_link_state == LINK_STATE_UP) | | | |
1694 | SET(ifmr->ifm_status, IFM_ACTIVE); | | | |
1695 | mutex_exit(&sc->sc_cfg_lock); | | | |
1696 | } | | 1691 | } |
1697 | | | 1692 | |
1698 | static int | | 1693 | static int |
1699 | ixl_media_change(struct ifnet *ifp) | | 1694 | ixl_media_change(struct ifnet *ifp) |
1700 | { | | 1695 | { |
1701 | struct ixl_softc *sc = ifp->if_softc; | | 1696 | struct ixl_softc *sc = ifp->if_softc; |
1702 | struct ifmedia *ifm = &sc->sc_media; | | 1697 | struct ifmedia *ifm = &sc->sc_media; |
1703 | uint64_t ifm_active = sc->sc_media_active; | | 1698 | uint64_t ifm_active = sc->sc_media_active; |
1704 | uint8_t link_speed, abilities; | | 1699 | uint8_t link_speed, abilities; |
1705 | | | 1700 | |
1706 | switch (IFM_SUBTYPE(ifm_active)) { | | 1701 | switch (IFM_SUBTYPE(ifm_active)) { |
1707 | case IFM_1000_SGMII: | | 1702 | case IFM_1000_SGMII: |
1708 | case IFM_1000_KX: | | 1703 | case IFM_1000_KX: |