Re: USB ugen_set_interface issue (+ possible patch)

From: Jay Cornwall <jay_at_evilrealms.net>
Date: Wed, 7 May 2003 03:11:35 +0100
On Wednesday 07 May 2003 03:08 am, Jay Cornwall wrote:

> My proposal for a patch to fix this is fairly simple, and is attached to
> this email. [..]

But of course, it just wouldn't be fun if the list manager didn't strip 
attachments. :)

I've popped the patch below.

Cheers,
Jay

http://www.evilrealms.net/ - Systems Administrator & Developer
http://www.ic.ac.uk/ - Imperial College, 2nd year CS student


Index: ugen.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/usb/ugen.c,v
retrieving revision 1.65
diff -u -3 -p -r1.65 ugen.c
--- ugen.c	7 Nov 2002 21:34:21 -0000	1.65
+++ ugen.c	7 May 2003 02:04:55 -0000
_at__at_ -998,6 +998,12 _at__at_ ugen_set_interface(struct ugen_softc *sc
 	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);
_at__at_ -1026,6 +1032,12 _at__at_ ugen_set_interface(struct ugen_softc *sc
 		sce->edesc = ed;
 		sce->iface = iface;
 	}
+
+#if defined(__FreeBSD__)
+	/* make the new devices */
+	ugen_make_devnodes(sc);
+#endif
+
 	return (0);
 }
Received on Tue May 06 2003 - 17:11:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:06 UTC