summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_port.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2004-08-14 22:10:26 +0000
committerimp <imp@FreeBSD.org>2004-08-14 22:10:26 +0000
commitda6b7d8015bfe072fdecf22c4958f40e135d3c2b (patch)
tree9b99e9bea5a7c62b7a26bf54ee02ab0537c960ee /sys/dev/usb/usb_port.h
parentbce29358a4ba1d2f5f059296d3e2d2d6ff05ce13 (diff)
downloadFreeBSD-src-da6b7d8015bfe072fdecf22c4958f40e135d3c2b.zip
FreeBSD-src-da6b7d8015bfe072fdecf22c4958f40e135d3c2b.tar.gz
Next step in making usb more newbus:
o reprobe children when a new driver is added to uhub o fix the usbd_probe_and_attach to set the ivars to a malloc'd area, as well as freeing the ivars on child destruction. o Don't delete children that don't attach. Evidentally, the need to do this is a common misconception. o minor formatting foo that may violate style(9) at the moment, but keeps the diffs against my p4 tree smaller. This does not solve the ugen gobbling things up problem, but the fixes I have for that expose bugs in other parts of the tree...
Diffstat (limited to 'sys/dev/usb/usb_port.h')
-rw-r--r--sys/dev/usb/usb_port.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
index bb9addc..abfac81 100644
--- a/sys/dev/usb/usb_port.h
+++ b/sys/dev/usb/usb_port.h
@@ -417,7 +417,11 @@ typedef struct callout usb_callout_t;
#define PWR_RESUME 0
#define PWR_SUSPEND 1
-#define config_detach(dev, flag) device_delete_child(device_get_parent(dev), dev)
+#define config_detach(dev, flag) \
+ do { \
+ free(device_get_ivars(dev), M_USB); \
+ device_delete_child(device_get_parent(dev), dev); \
+ } while (0);
typedef struct malloc_type *usb_malloc_type;
OpenPOWER on IntegriCloud