From ed6d949afdbe3f25e6ef640881d8a0a72d7b7aa8 Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Tue, 23 Jun 2009 02:19:59 +0000 Subject: - Make struct usb_xfer opaque so that drivers can not access the internals - Reduce the number of headers needed for a usb driver, the common case is just usb.h and usbdi.h --- sys/dev/usb/usb_device.h | 46 +--------------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) (limited to 'sys/dev/usb/usb_device.h') diff --git a/sys/dev/usb/usb_device.h b/sys/dev/usb/usb_device.h index 9a3bc2325304..d601c146a210 100644 --- a/sys/dev/usb/usb_device.h +++ b/sys/dev/usb/usb_device.h @@ -76,44 +76,6 @@ struct usb_host_interface { uint8_t bsd_iface_index; } __aligned(USB_HOST_ALIGN); -/* - * The following structure defines an USB endpoint - * USB endpoint. - */ -struct usb_endpoint { - struct usb_xfer_queue endpoint_q; /* queue of USB transfers */ - - struct usb_endpoint_descriptor *edesc; - struct usb_pipe_methods *methods; /* set by HC driver */ - - uint16_t isoc_next; - uint16_t refcount; - - uint8_t toggle_next:1; /* next data toggle value */ - uint8_t is_stalled:1; /* set if endpoint is stalled */ - uint8_t is_synced:1; /* set if we a synchronised */ - uint8_t unused:5; - uint8_t iface_index; /* not used by "default endpoint" */ -}; - -/* - * The following structure defines an USB interface. - */ -struct usb_interface { - struct usb_interface_descriptor *idesc; - device_t subdev; - uint8_t alt_index; - uint8_t parent_iface_index; - - /* Linux compat */ - struct usb_host_interface *altsetting; - struct usb_host_interface *cur_altsetting; - struct usb_device *linux_udev; - void *bsd_priv_sc; /* device specific information */ - uint8_t num_altsetting; /* number of alternate settings */ - uint8_t bsd_iface_index; -}; - /* * The following structure defines the USB device flags. */ @@ -228,14 +190,11 @@ extern int usb_template; /* function prototypes */ +const char *usb_statestr(enum usb_dev_state state); struct usb_device *usb_alloc_device(device_t parent_dev, struct usb_bus *bus, struct usb_device *parent_hub, uint8_t depth, uint8_t port_index, uint8_t port_no, enum usb_dev_speed speed, enum usb_hc_mode mode); -struct usb_endpoint *usbd_get_endpoint(struct usb_device *udev, uint8_t iface_index, - const struct usb_config *setup); -struct usb_endpoint *usbd_get_ep_by_addr(struct usb_device *udev, uint8_t ea_val); -usb_error_t usb_interface_count(struct usb_device *udev, uint8_t *count); usb_error_t usb_probe_and_attach(struct usb_device *udev, uint8_t iface_index); usb_error_t usb_reset_iface_endpoints(struct usb_device *udev, @@ -247,9 +206,6 @@ usb_error_t usb_suspend_resume(struct usb_device *udev, uint8_t do_suspend); void usb_devinfo(struct usb_device *udev, char *dst_ptr, uint16_t dst_len); void usb_free_device(struct usb_device *, uint8_t); -void *usbd_find_descriptor(struct usb_device *udev, void *id, - uint8_t iface_index, uint8_t type, uint8_t type_mask, - uint8_t subtype, uint8_t subtype_mask); void usb_linux_free_device(struct usb_device *dev); uint8_t usb_peer_can_wakeup(struct usb_device *udev); struct usb_endpoint *usb_endpoint_foreach(struct usb_device *udev, struct usb_endpoint *ep); -- cgit v1.3