mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-19 15:33:56 +00:00
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
This commit is contained in:
parent
2b6ceccde5
commit
78abbdd54f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=242777
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user