.. | .. |
---|
331 | 331 | |
---|
332 | 332 | /* variable-length array of alternate settings for this interface, |
---|
333 | 333 | * stored in no particular order */ |
---|
334 | | - struct usb_host_interface altsetting[0]; |
---|
| 334 | + struct usb_host_interface altsetting[]; |
---|
335 | 335 | }; |
---|
336 | 336 | #define ref_to_usb_interface_cache(r) \ |
---|
337 | 337 | container_of(r, struct usb_interface_cache, ref) |
---|
.. | .. |
---|
347 | 347 | * @interface: array of pointers to usb_interface structures, one for each |
---|
348 | 348 | * interface in the configuration. The number of interfaces is stored |
---|
349 | 349 | * in desc.bNumInterfaces. These pointers are valid only while the |
---|
350 | | - * the configuration is active. |
---|
| 350 | + * configuration is active. |
---|
351 | 351 | * @intf_cache: array of pointers to usb_interface_cache structures, one |
---|
352 | 352 | * for each interface in the configuration. These structures exist |
---|
353 | 353 | * for the entire life of the device. |
---|
.. | .. |
---|
408 | 408 | struct usb_ssp_cap_descriptor *ssp_cap; |
---|
409 | 409 | struct usb_ss_container_id_descriptor *ss_id; |
---|
410 | 410 | struct usb_ptm_cap_descriptor *ptm_cap; |
---|
411 | | - struct usb_config_summary_descriptor *config_summary; |
---|
412 | | - unsigned int num_config_summary_desc; |
---|
413 | 411 | |
---|
414 | 412 | ANDROID_KABI_RESERVE(1); |
---|
415 | 413 | ANDROID_KABI_RESERVE(2); |
---|
.. | .. |
---|
435 | 433 | * Allocated per bus (tree of devices) we have: |
---|
436 | 434 | */ |
---|
437 | 435 | struct usb_bus { |
---|
438 | | - struct device *controller; /* host/master side hardware */ |
---|
| 436 | + struct device *controller; /* host side hardware */ |
---|
439 | 437 | struct device *sysdev; /* as seen from firmware or bus */ |
---|
440 | 438 | int busnum; /* Bus number (in order of reg) */ |
---|
441 | 439 | const char *bus_name; /* stable id (PCI slot_name etc) */ |
---|
442 | | - u8 uses_dma; /* Does the host controller use DMA? */ |
---|
443 | 440 | u8 uses_pio_for_control; /* |
---|
444 | 441 | * Does the host controller use PIO |
---|
445 | 442 | * for control transfers? |
---|
.. | .. |
---|
479 | 476 | struct mon_bus *mon_bus; /* non-null when associated */ |
---|
480 | 477 | int monitored; /* non-zero when monitored */ |
---|
481 | 478 | #endif |
---|
482 | | - unsigned skip_resume:1; /* All USB devices are brought into full |
---|
483 | | - * power state after system resume. It |
---|
484 | | - * is desirable for some buses to keep |
---|
485 | | - * their devices in suspend state even |
---|
486 | | - * after system resume. The devices |
---|
487 | | - * are resumed later when a remote |
---|
488 | | - * wakeup is detected or an interface |
---|
489 | | - * driver starts I/O. |
---|
490 | | - */ |
---|
491 | 479 | |
---|
492 | 480 | ANDROID_KABI_RESERVE(1); |
---|
493 | 481 | ANDROID_KABI_RESERVE(2); |
---|
.. | .. |
---|
605 | 593 | * @bus_mA: Current available from the bus |
---|
606 | 594 | * @portnum: parent port number (origin 1) |
---|
607 | 595 | * @level: number of USB hub ancestors |
---|
| 596 | + * @devaddr: device address, XHCI: assigned by HW, others: same as devnum |
---|
608 | 597 | * @can_submit: URBs may be submitted |
---|
609 | 598 | * @persist_enabled: USB_PERSIST enabled for this device |
---|
610 | 599 | * @have_langid: whether string_langid is valid |
---|
.. | .. |
---|
647 | 636 | * Management to be disabled for this usb_device. This count should only |
---|
648 | 637 | * be manipulated by those functions, with the bandwidth_mutex is held. |
---|
649 | 638 | * @hub_delay: cached value consisting of: |
---|
650 | | - * parent->hub_delay + wHubDelay + tTPTransmissionDelay (40ns) |
---|
651 | | - * |
---|
| 639 | + * parent->hub_delay + wHubDelay + tTPTransmissionDelay (40ns) |
---|
652 | 640 | * Will be used as wValue for SetIsochDelay requests. |
---|
| 641 | + * @use_generic_driver: ask driver core to reprobe using the generic driver. |
---|
653 | 642 | * |
---|
654 | 643 | * Notes: |
---|
655 | 644 | * Usbcore drivers should not set usbdev->state directly. Instead use |
---|
.. | .. |
---|
688 | 677 | unsigned short bus_mA; |
---|
689 | 678 | u8 portnum; |
---|
690 | 679 | u8 level; |
---|
| 680 | + u8 devaddr; |
---|
691 | 681 | |
---|
692 | 682 | unsigned can_submit:1; |
---|
693 | 683 | unsigned persist_enabled:1; |
---|
.. | .. |
---|
734 | 724 | unsigned lpm_disable_count; |
---|
735 | 725 | |
---|
736 | 726 | u16 hub_delay; |
---|
| 727 | + unsigned use_generic_driver:1; |
---|
737 | 728 | |
---|
738 | 729 | ANDROID_KABI_RESERVE(1); |
---|
739 | 730 | ANDROID_KABI_RESERVE(2); |
---|
.. | .. |
---|
775 | 766 | /* USB port reset for device reinitialization */ |
---|
776 | 767 | extern int usb_reset_device(struct usb_device *dev); |
---|
777 | 768 | extern void usb_queue_reset_device(struct usb_interface *dev); |
---|
| 769 | + |
---|
| 770 | +extern struct device *usb_intf_get_dma_device(struct usb_interface *intf); |
---|
778 | 771 | |
---|
779 | 772 | #ifdef CONFIG_ACPI |
---|
780 | 773 | extern int usb_acpi_set_power_state(struct usb_device *hdev, int index, |
---|
.. | .. |
---|
856 | 849 | |
---|
857 | 850 | /* for drivers using iso endpoints */ |
---|
858 | 851 | extern int usb_get_current_frame_number(struct usb_device *usb_dev); |
---|
859 | | -extern int usb_sec_event_ring_setup(struct usb_device *dev, |
---|
860 | | - unsigned int intr_num); |
---|
861 | | -extern int usb_sec_event_ring_cleanup(struct usb_device *dev, |
---|
862 | | - unsigned int intr_num); |
---|
863 | | - |
---|
864 | | -extern phys_addr_t usb_get_sec_event_ring_phys_addr( |
---|
865 | | - struct usb_device *dev, unsigned int intr_num, dma_addr_t *dma); |
---|
866 | | -extern phys_addr_t usb_get_xfer_ring_phys_addr(struct usb_device *dev, |
---|
867 | | - struct usb_host_endpoint *ep, dma_addr_t *dma); |
---|
868 | | -extern int usb_get_controller_id(struct usb_device *dev); |
---|
869 | | - |
---|
870 | | -extern int usb_stop_endpoint(struct usb_device *dev, |
---|
871 | | - struct usb_host_endpoint *ep); |
---|
872 | 852 | |
---|
873 | 853 | /* Sets up a group of bulk endpoints to support multiple stream IDs. */ |
---|
874 | 854 | extern int usb_alloc_streams(struct usb_interface *interface, |
---|
.. | .. |
---|
1194 | 1174 | * @id_table: USB drivers use ID table to support hotplugging. |
---|
1195 | 1175 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set |
---|
1196 | 1176 | * or your driver's probe function will never get called. |
---|
| 1177 | + * @dev_groups: Attributes attached to the device that will be created once it |
---|
| 1178 | + * is bound to the driver. |
---|
1197 | 1179 | * @dynids: used internally to hold the list of dynamically added device |
---|
1198 | 1180 | * ids for this driver. |
---|
1199 | 1181 | * @drvwrap: Driver-model core structure wrapper. |
---|
.. | .. |
---|
1241 | 1223 | int (*post_reset)(struct usb_interface *intf); |
---|
1242 | 1224 | |
---|
1243 | 1225 | const struct usb_device_id *id_table; |
---|
| 1226 | + const struct attribute_group **dev_groups; |
---|
1244 | 1227 | |
---|
1245 | 1228 | struct usb_dynids dynids; |
---|
1246 | 1229 | struct usbdrv_wrap drvwrap; |
---|
.. | .. |
---|
1260 | 1243 | * struct usb_device_driver - identifies USB device driver to usbcore |
---|
1261 | 1244 | * @name: The driver name should be unique among USB drivers, |
---|
1262 | 1245 | * and should normally be the same as the module name. |
---|
| 1246 | + * @match: If set, used for better device/driver matching. |
---|
1263 | 1247 | * @probe: Called to see if the driver is willing to manage a particular |
---|
1264 | 1248 | * device. If it is, probe returns zero and uses dev_set_drvdata() |
---|
1265 | 1249 | * to associate driver-specific data with the device. If unwilling |
---|
.. | .. |
---|
1269 | 1253 | * module is being unloaded. |
---|
1270 | 1254 | * @suspend: Called when the device is going to be suspended by the system. |
---|
1271 | 1255 | * @resume: Called when the device is being resumed by the system. |
---|
| 1256 | + * @dev_groups: Attributes attached to the device that will be created once it |
---|
| 1257 | + * is bound to the driver. |
---|
1272 | 1258 | * @drvwrap: Driver-model core structure wrapper. |
---|
| 1259 | + * @id_table: used with @match() to select better matching driver at |
---|
| 1260 | + * probe() time. |
---|
1273 | 1261 | * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend |
---|
1274 | 1262 | * for devices bound to this driver. |
---|
| 1263 | + * @generic_subclass: if set to 1, the generic USB driver's probe, disconnect, |
---|
| 1264 | + * resume and suspend functions will be called in addition to the driver's |
---|
| 1265 | + * own, so this part of the setup does not need to be replicated. |
---|
1275 | 1266 | * |
---|
1276 | | - * USB drivers must provide all the fields listed above except drvwrap. |
---|
| 1267 | + * USB drivers must provide all the fields listed above except drvwrap, |
---|
| 1268 | + * match, and id_table. |
---|
1277 | 1269 | */ |
---|
1278 | 1270 | struct usb_device_driver { |
---|
1279 | 1271 | const char *name; |
---|
1280 | 1272 | |
---|
| 1273 | + bool (*match) (struct usb_device *udev); |
---|
1281 | 1274 | int (*probe) (struct usb_device *udev); |
---|
1282 | 1275 | void (*disconnect) (struct usb_device *udev); |
---|
1283 | 1276 | |
---|
1284 | 1277 | int (*suspend) (struct usb_device *udev, pm_message_t message); |
---|
1285 | 1278 | int (*resume) (struct usb_device *udev, pm_message_t message); |
---|
| 1279 | + const struct attribute_group **dev_groups; |
---|
1286 | 1280 | struct usbdrv_wrap drvwrap; |
---|
| 1281 | + const struct usb_device_id *id_table; |
---|
1287 | 1282 | unsigned int supports_autosuspend:1; |
---|
| 1283 | + unsigned int generic_subclass:1; |
---|
1288 | 1284 | }; |
---|
1289 | 1285 | #define to_usb_device_driver(d) container_of(d, struct usb_device_driver, \ |
---|
1290 | 1286 | drvwrap.driver) |
---|
.. | .. |
---|
1505 | 1501 | * field rather than determining a dma address themselves. |
---|
1506 | 1502 | * |
---|
1507 | 1503 | * Note that transfer_buffer must still be set if the controller |
---|
1508 | | - * does not support DMA (as indicated by bus.uses_dma) and when talking |
---|
| 1504 | + * does not support DMA (as indicated by hcd_uses_dma()) and when talking |
---|
1509 | 1505 | * to root hub. If you have to trasfer between highmem zone and the device |
---|
1510 | 1506 | * on such controller, create a bounce buffer or bail out with an error. |
---|
1511 | 1507 | * If transfer_buffer cannot be set (is in highmem) and the controller is DMA |
---|
.. | .. |
---|
1593 | 1589 | struct urb { |
---|
1594 | 1590 | /* private: usb core and host controller only fields in the urb */ |
---|
1595 | 1591 | struct kref kref; /* reference count of the URB */ |
---|
| 1592 | + int unlinked; /* unlink error code */ |
---|
1596 | 1593 | void *hcpriv; /* private data for host controller */ |
---|
1597 | 1594 | atomic_t use_count; /* concurrent submissions counter */ |
---|
1598 | 1595 | atomic_t reject; /* submissions will fail */ |
---|
1599 | | - int unlinked; /* unlink error code */ |
---|
1600 | 1596 | |
---|
1601 | 1597 | /* public: documented fields in the urb that can be used by drivers */ |
---|
1602 | 1598 | struct list_head urb_list; /* list head for use by the urb's |
---|
.. | .. |
---|
1625 | 1621 | int error_count; /* (return) number of ISO errors */ |
---|
1626 | 1622 | void *context; /* (in) context for completion */ |
---|
1627 | 1623 | usb_complete_t complete; /* (in) completion routine */ |
---|
1628 | | - struct usb_iso_packet_descriptor iso_frame_desc[0]; |
---|
1629 | | - /* (in) ISO ONLY */ |
---|
| 1624 | + |
---|
1630 | 1625 | ANDROID_KABI_RESERVE(1); |
---|
1631 | 1626 | ANDROID_KABI_RESERVE(2); |
---|
1632 | 1627 | ANDROID_KABI_RESERVE(3); |
---|
1633 | 1628 | ANDROID_KABI_RESERVE(4); |
---|
| 1629 | + |
---|
| 1630 | + struct usb_iso_packet_descriptor iso_frame_desc[]; |
---|
| 1631 | + /* (in) ISO ONLY */ |
---|
1634 | 1632 | }; |
---|
1635 | 1633 | |
---|
1636 | 1634 | /* ----------------------------------------------------------------------- */ |
---|
.. | .. |
---|
1800 | 1798 | return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT; |
---|
1801 | 1799 | } |
---|
1802 | 1800 | |
---|
| 1801 | +int usb_pipe_type_check(struct usb_device *dev, unsigned int pipe); |
---|
1803 | 1802 | int usb_urb_ep_type_check(const struct urb *urb); |
---|
1804 | 1803 | |
---|
1805 | 1804 | void *usb_alloc_coherent(struct usb_device *dev, size_t size, |
---|
.. | .. |
---|
1837 | 1836 | int timeout); |
---|
1838 | 1837 | |
---|
1839 | 1838 | /* wrappers around usb_control_msg() for the most common standard requests */ |
---|
| 1839 | +int usb_control_msg_send(struct usb_device *dev, __u8 endpoint, __u8 request, |
---|
| 1840 | + __u8 requesttype, __u16 value, __u16 index, |
---|
| 1841 | + const void *data, __u16 size, int timeout, |
---|
| 1842 | + gfp_t memflags); |
---|
| 1843 | +int usb_control_msg_recv(struct usb_device *dev, __u8 endpoint, __u8 request, |
---|
| 1844 | + __u8 requesttype, __u16 value, __u16 index, |
---|
| 1845 | + void *data, __u16 size, int timeout, |
---|
| 1846 | + gfp_t memflags); |
---|
1840 | 1847 | extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype, |
---|
1841 | 1848 | unsigned char descindex, void *buf, int size); |
---|
1842 | 1849 | extern int usb_get_status(struct usb_device *dev, |
---|
.. | .. |
---|
2044 | 2051 | #define USB_DEVICE_REMOVE 0x0002 |
---|
2045 | 2052 | #define USB_BUS_ADD 0x0003 |
---|
2046 | 2053 | #define USB_BUS_REMOVE 0x0004 |
---|
2047 | | -#define USB_BUS_DIED 0x0005 |
---|
2048 | 2054 | extern void usb_register_notify(struct notifier_block *nb); |
---|
2049 | 2055 | extern void usb_unregister_notify(struct notifier_block *nb); |
---|
2050 | | -extern void usb_register_atomic_notify(struct notifier_block *nb); |
---|
2051 | | -extern void usb_unregister_atomic_notify(struct notifier_block *nb); |
---|
2052 | 2056 | |
---|
2053 | 2057 | /* debugfs stuff */ |
---|
2054 | 2058 | extern struct dentry *usb_debug_root; |
---|