Recreate devnodes on USB_SET_ALTINTERFACE ioctl.

This fixes net/pppoa port for Alcatel Speedtouch devices.

Submitted by: Jay Cornwall <jay@evilrealms.net>
Tested by: Francois Rogler <francois@rogler.org>
Approved by: re (scottl)
This commit is contained in:
ticso 2003-05-18 21:22:00 +00:00
parent 5a893bc465
commit 6ab7ac813b

View File

@ -1024,6 +1024,12 @@ ugen_set_interface(struct ugen_softc *sc, int ifaceidx, int altno)
err = usbd_endpoint_count(iface, &nendpt);
if (err)
return (err);
#if defined(__FreeBSD__)
/* destroy the existing devices, we remake the new ones in a moment */
ugen_destroy_devnodes(sc);
#endif
/* XXX should only do this after setting new altno has succeeded */
for (endptno = 0; endptno < nendpt; endptno++) {
ed = usbd_interface2endpoint_descriptor(iface,endptno);
@ -1035,6 +1041,11 @@ ugen_set_interface(struct ugen_softc *sc, int ifaceidx, int altno)
sce->iface = 0;
}
#if defined(__FreeBSD__)
/* make the new devices */
ugen_make_devnodes(sc);
#endif
/* change setting */
err = usbd_set_interface(iface, altno);
if (err)