Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb When a child device is detached and no interface...
details: https://anonhg.NetBSD.org/src/rev/61c93a719dfb
branches: trunk
changeset: 765522:61c93a719dfb
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun May 29 12:37:09 2011 +0000
description:
When a child device is detached and no interfaces are claimed by drivers,
free the port's subdevice list. This allows for detaching a driver from
a USB device and loading a different one without disconnecting the device.
diffstat:
sys/dev/usb/uhub.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (30 lines):
diff -r b95a9fa60015 -r 61c93a719dfb sys/dev/usb/uhub.c
--- a/sys/dev/usb/uhub.c Sun May 29 10:29:01 2011 +0000
+++ b/sys/dev/usb/uhub.c Sun May 29 12:37:09 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uhub.c,v 1.112 2010/11/03 22:59:40 dyoung Exp $ */
+/* $NetBSD: uhub.c,v 1.113 2011/05/29 12:37:09 jmcneill Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */
/*
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.112 2010/11/03 22:59:40 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.113 2011/05/29 12:37:09 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -663,6 +663,11 @@
dev->nifaces_claimed--;
}
}
+ if (dev->nifaces_claimed == 0) {
+ free(dev->subdevs, M_USB);
+ dev->subdevs = NULL;
+ dev->subdevlen = 0;
+ }
}
}
Home |
Main Index |
Thread Index |
Old Index