| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_udav.c,v 1.71 2019/08/23 04:32:57 mrg Exp $ */ | | 1 | /* $NetBSD: if_udav.c,v 1.72 2019/10/07 09:37:16 skrll Exp $ */ |
2 | /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ | | 2 | /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ |
3 | | | 3 | |
4 | /* | | 4 | /* |
5 | * Copyright (c) 2003 | | 5 | * Copyright (c) 2003 |
6 | * Shingo WATANABE <nabe@nabechan.org>. All rights reserved. | | 6 | * Shingo WATANABE <nabe@nabechan.org>. All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
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 |
| @@ -35,27 +35,27 @@ | | | @@ -35,27 +35,27 @@ |
35 | * DM9601(DAVICOM USB to Ethernet MAC Controller with Integrated 10/100 PHY) | | 35 | * DM9601(DAVICOM USB to Ethernet MAC Controller with Integrated 10/100 PHY) |
36 | * The spec can be found at the following url. | | 36 | * The spec can be found at the following url. |
37 | * http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-F01-062202s.pdf | | 37 | * http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-F01-062202s.pdf |
38 | */ | | 38 | */ |
39 | | | 39 | |
40 | /* | | 40 | /* |
41 | * TODO: | | 41 | * TODO: |
42 | * Interrupt Endpoint support | | 42 | * Interrupt Endpoint support |
43 | * External PHYs | | 43 | * External PHYs |
44 | * powerhook() support? | | 44 | * powerhook() support? |
45 | */ | | 45 | */ |
46 | | | 46 | |
47 | #include <sys/cdefs.h> | | 47 | #include <sys/cdefs.h> |
48 | __KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.71 2019/08/23 04:32:57 mrg Exp $"); | | 48 | __KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.72 2019/10/07 09:37:16 skrll Exp $"); |
49 | | | 49 | |
50 | #ifdef _KERNEL_OPT | | 50 | #ifdef _KERNEL_OPT |
51 | #include "opt_usb.h" | | 51 | #include "opt_usb.h" |
52 | #endif | | 52 | #endif |
53 | | | 53 | |
54 | #include <sys/param.h> | | 54 | #include <sys/param.h> |
55 | | | 55 | |
56 | #include <dev/usb/usbnet.h> | | 56 | #include <dev/usb/usbnet.h> |
57 | #include <dev/usb/if_udavreg.h> | | 57 | #include <dev/usb/if_udavreg.h> |
58 | | | 58 | |
59 | /* Function declarations */ | | 59 | /* Function declarations */ |
60 | int udav_match(device_t, cfdata_t, void *); | | 60 | int udav_match(device_t, cfdata_t, void *); |
61 | void udav_attach(device_t, device_t, void *); | | 61 | void udav_attach(device_t, device_t, void *); |
| @@ -854,26 +854,26 @@ udav_mii_write_reg(struct usbnet *un, in | | | @@ -854,26 +854,26 @@ udav_mii_write_reg(struct usbnet *un, in |
854 | } | | 854 | } |
855 | | | 855 | |
856 | static void | | 856 | static void |
857 | udav_mii_statchg(struct ifnet *ifp) | | 857 | udav_mii_statchg(struct ifnet *ifp) |
858 | { | | 858 | { |
859 | struct usbnet * const un = ifp->if_softc; | | 859 | struct usbnet * const un = ifp->if_softc; |
860 | struct mii_data * const mii = usbnet_mii(un); | | 860 | struct mii_data * const mii = usbnet_mii(un); |
861 | | | 861 | |
862 | DPRINTF(("%s: %s: enter\n", ifp->if_xname, __func__)); | | 862 | DPRINTF(("%s: %s: enter\n", ifp->if_xname, __func__)); |
863 | | | 863 | |
864 | if (usbnet_isdying(un)) | | 864 | if (usbnet_isdying(un)) |
865 | return; | | 865 | return; |
866 | | | 866 | |
867 | if (mii->mii_media_status & IFM_ACTIVE && | | 867 | if ((mii->mii_media_status & IFM_ACTIVE) && |
868 | IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { | | 868 | IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { |
869 | DPRINTF(("%s: %s: got link\n", | | 869 | DPRINTF(("%s: %s: got link\n", |
870 | device_xname(un->un_dev), __func__)); | | 870 | device_xname(un->un_dev), __func__)); |
871 | usbnet_set_link(un, true); | | 871 | usbnet_set_link(un, true); |
872 | } | | 872 | } |
873 | } | | 873 | } |
874 | | | 874 | |
875 | #ifdef _MODULE | | 875 | #ifdef _MODULE |
876 | #include "ioconf.c" | | 876 | #include "ioconf.c" |
877 | #endif | | 877 | #endif |
878 | | | 878 | |
879 | USBNET_MODULE(udav) | | 879 | USBNET_MODULE(udav) |