aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index b1e3c2fbfe11..a34fa89f1474 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -195,7 +195,7 @@ struct usb_interface {
195 195
196 struct device dev; /* interface specific device info */ 196 struct device dev; /* interface specific device info */
197 struct device *usb_dev; 197 struct device *usb_dev;
198 int pm_usage_cnt; /* usage counter for autosuspend */ 198 atomic_t pm_usage_cnt; /* usage counter for autosuspend */
199 struct work_struct reset_ws; /* for resets in atomic context */ 199 struct work_struct reset_ws; /* for resets in atomic context */
200}; 200};
201#define to_usb_interface(d) container_of(d, struct usb_interface, dev) 201#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
@@ -551,13 +551,13 @@ extern void usb_autopm_put_interface_async(struct usb_interface *intf);
551 551
552static inline void usb_autopm_enable(struct usb_interface *intf) 552static inline void usb_autopm_enable(struct usb_interface *intf)
553{ 553{
554 intf->pm_usage_cnt = 0; 554 atomic_set(&intf->pm_usage_cnt, 0);
555 usb_autopm_set_interface(intf); 555 usb_autopm_set_interface(intf);
556} 556}
557 557
558static inline void usb_autopm_disable(struct usb_interface *intf) 558static inline void usb_autopm_disable(struct usb_interface *intf)
559{ 559{
560 intf->pm_usage_cnt = 1; 560 atomic_set(&intf->pm_usage_cnt, 1);
561 usb_autopm_set_interface(intf); 561 usb_autopm_set_interface(intf);
562} 562}
563 563
@@ -922,7 +922,7 @@ extern struct bus_type usb_bus_type;
922/** 922/**
923 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number 923 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number
924 * @name: the usb class device name for this driver. Will show up in sysfs. 924 * @name: the usb class device name for this driver. Will show up in sysfs.
925 * @nodename: Callback to provide a naming hint for a possible 925 * @devnode: Callback to provide a naming hint for a possible
926 * device node to create. 926 * device node to create.
927 * @fops: pointer to the struct file_operations of this driver. 927 * @fops: pointer to the struct file_operations of this driver.
928 * @minor_base: the start of the minor range for this driver. 928 * @minor_base: the start of the minor range for this driver.
@@ -933,7 +933,7 @@ extern struct bus_type usb_bus_type;
933 */ 933 */
934struct usb_class_driver { 934struct usb_class_driver {
935 char *name; 935 char *name;
936 char *(*nodename)(struct device *dev); 936 char *(*devnode)(struct device *dev, mode_t *mode);
937 const struct file_operations *fops; 937 const struct file_operations *fops;
938 int minor_base; 938 int minor_base;
939}; 939};
@@ -1036,9 +1036,10 @@ typedef void (*usb_complete_t)(struct urb *);
1036 * @transfer_flags: A variety of flags may be used to affect how URB 1036 * @transfer_flags: A variety of flags may be used to affect how URB
1037 * submission, unlinking, or operation are handled. Different 1037 * submission, unlinking, or operation are handled. Different
1038 * kinds of URB can use different flags. 1038 * kinds of URB can use different flags.
1039 * @transfer_buffer: This identifies the buffer to (or from) which 1039 * @transfer_buffer: This identifies the buffer to (or from) which the I/O
1040 * the I/O request will be performed (unless URB_NO_TRANSFER_DMA_MAP 1040 * request will be performed unless URB_NO_TRANSFER_DMA_MAP is set
1041 * is set). This buffer must be suitable for DMA; allocate it with 1041 * (however, do not leave garbage in transfer_buffer even then).
1042 * This buffer must be suitable for DMA; allocate it with
1042 * kmalloc() or equivalent. For transfers to "in" endpoints, contents 1043 * kmalloc() or equivalent. For transfers to "in" endpoints, contents
1043 * of this buffer will be modified. This buffer is used for the data 1044 * of this buffer will be modified. This buffer is used for the data
1044 * stage of control transfers. 1045 * stage of control transfers.
@@ -1071,7 +1072,7 @@ typedef void (*usb_complete_t)(struct urb *);
1071 * @start_frame: Returns the initial frame for isochronous transfers. 1072 * @start_frame: Returns the initial frame for isochronous transfers.
1072 * @number_of_packets: Lists the number of ISO transfer buffers. 1073 * @number_of_packets: Lists the number of ISO transfer buffers.
1073 * @interval: Specifies the polling interval for interrupt or isochronous 1074 * @interval: Specifies the polling interval for interrupt or isochronous
1074 * transfers. The units are frames (milliseconds) for for full and low 1075 * transfers. The units are frames (milliseconds) for full and low
1075 * speed devices, and microframes (1/8 millisecond) for highspeed ones. 1076 * speed devices, and microframes (1/8 millisecond) for highspeed ones.
1076 * @error_count: Returns the number of ISO transfers that reported errors. 1077 * @error_count: Returns the number of ISO transfers that reported errors.
1077 * @context: For use in completion functions. This normally points to 1078 * @context: For use in completion functions. This normally points to
@@ -1104,9 +1105,15 @@ typedef void (*usb_complete_t)(struct urb *);
1104 * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). 1105 * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map().
1105 * When these transfer flags are provided, host controller drivers will 1106 * When these transfer flags are provided, host controller drivers will
1106 * attempt to use the dma addresses found in the transfer_dma and/or 1107 * attempt to use the dma addresses found in the transfer_dma and/or
1107 * setup_dma fields rather than determining a dma address themselves. (Note 1108 * setup_dma fields rather than determining a dma address themselves.
1108 * that transfer_buffer and setup_packet must still be set because not all 1109 *
1109 * host controllers use DMA, nor do virtual root hubs). 1110 * Note that transfer_buffer must still be set if the controller
1111 * does not support DMA (as indicated by bus.uses_dma) and when talking
1112 * to root hub. If you have to trasfer between highmem zone and the device
1113 * on such controller, create a bounce buffer or bail out with an error.
1114 * If transfer_buffer cannot be set (is in highmem) and the controller is DMA
1115 * capable, assign NULL to it, so that usbmon knows not to use the value.
1116 * The setup_packet must always be set, so it cannot be located in highmem.
1110 * 1117 *
1111 * Initialization: 1118 * Initialization:
1112 * 1119 *