From 3311f87be611f7f1570cc4b728eeadceb9169eec Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 28 Jan 2002 01:03:19 +0000 Subject: Merge from NetBSD. uhub.c: revision 1.37 usb.4: revision 1.30 usb.c: revision 1.38 usb.h: revision 1.40 usb_port.h: revision 1.21 usb_subr.c: revision 1.65 usbdi.h: revision 1.40 Split the attach/detach events up into device, driver and controller attach and detach events. The commit message from NetBSD was: date: 2000/02/02 07:34:00; author: augustss; state: Exp; Change the USB event mechanism to include more information about devices and drivers. Partly from FreeBSD. Also rework usbd to take these new event types into account. --- sys/dev/usb/usb_subr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/dev/usb/usb_subr.c') diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index f17e515..2565c44 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -1031,9 +1031,9 @@ usbd_new_device(device_ptr_t parent, usbd_bus_handle bus, int depth, usbd_remove_device(dev, up); return (err); } - - usbd_add_event(USB_EVENT_CTRLR_ATTACH, dev); + usbd_add_dev_event(USB_EVENT_DEVICE_ATTACH, dev); + return (USBD_NORMAL_COMPLETION); } @@ -1158,6 +1158,7 @@ usbd_fill_deviceinfo(usbd_device_handle dev, struct usb_device_info *di, di->bus = USBDEVUNIT(dev->bus->bdev); di->addr = dev->address; + di->cookie = dev->cookie; usbd_devinfo_vp(dev, di->vendor, di->product, usedev); usbd_printBCD(di->release, UGETW(dev->ddesc.bcdDevice)); di->vendorNo = UGETW(dev->ddesc.idVendor); @@ -1281,7 +1282,7 @@ usb_disconnect_port(struct usbd_port *up, device_ptr_t parent) } } - /*usbd_add_event(USB_EVENT_DETACH, dev);*/ + /*usbd_add_dev_event(USB_EVENT_DEVICE_DETACH, dev);*/ dev->bus->devices[dev->address] = NULL; up->device = NULL; usb_free_device(dev); -- cgit v1.1