diff options
author | hselasky <hselasky@FreeBSD.org> | 2012-11-08 16:31:13 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2012-11-08 16:31:13 +0000 |
commit | 392da320d785d0ce7a71619640477eb96a4f8c78 (patch) | |
tree | ea7c9a9deea76f9faafda930b24d93d10d70a8a3 | |
parent | 5acb236703d9a9583774709f6a1bf710f08ba6d2 (diff) | |
download | FreeBSD-src-392da320d785d0ce7a71619640477eb96a4f8c78.zip FreeBSD-src-392da320d785d0ce7a71619640477eb96a4f8c78.tar.gz |
Make the USB ethernet methods constant again in if_udav.c,
so that both adapter variants can be attached at the same
time.
MFC after: 0 days
-rw-r--r-- | sys/dev/usb/net/if_udav.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/usb/net/if_udav.c b/sys/dev/usb/net/if_udav.c index c6f0811..ff57e25 100644 --- a/sys/dev/usb/net/if_udav.c +++ b/sys/dev/usb/net/if_udav.c @@ -169,7 +169,7 @@ MODULE_DEPEND(udav, ether, 1, 1, 1); MODULE_DEPEND(udav, miibus, 1, 1, 1); MODULE_VERSION(udav, 1); -static struct usb_ether_methods udav_ue_methods = { +static const struct usb_ether_methods udav_ue_methods = { .ue_attach_post = udav_attach_post, .ue_start = udav_start, .ue_init = udav_init, @@ -181,6 +181,15 @@ static struct usb_ether_methods udav_ue_methods = { .ue_mii_sts = udav_ifmedia_status, }; +static const struct usb_ether_methods udav_ue_methods_nophy = { + .ue_attach_post = udav_attach_post, + .ue_start = udav_start, + .ue_init = udav_init, + .ue_stop = udav_stop, + .ue_setmulti = udav_setmulti, + .ue_setpromisc = udav_setpromisc, +}; + #ifdef USB_DEBUG static int udav_debug = 0; @@ -264,17 +273,16 @@ udav_attach(device_t dev) * The JP1082 has an unusable PHY and provides no link information. */ if (sc->sc_flags & UDAV_FLAG_NO_PHY) { - udav_ue_methods.ue_tick = NULL; - udav_ue_methods.ue_mii_upd = NULL; - udav_ue_methods.ue_mii_sts = NULL; + ue->ue_methods = &udav_ue_methods_nophy; sc->sc_flags |= UDAV_FLAG_LINK; + } else { + ue->ue_methods = &udav_ue_methods; } ue->ue_sc = sc; ue->ue_dev = dev; ue->ue_udev = uaa->device; ue->ue_mtx = &sc->sc_mtx; - ue->ue_methods = &udav_ue_methods; error = uether_ifattach(ue); if (error) { |