diff options
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r-- | include/linux/usb.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 19fabc487beb..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 | ||
552 | static inline void usb_autopm_enable(struct usb_interface *intf) | 552 | static 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 | ||
558 | static inline void usb_autopm_disable(struct usb_interface *intf) | 558 | static 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 | ||
@@ -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. |
@@ -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 | * |