diff options
author | David Lopo <lopo.david@gmail.com> | 2008-04-29 05:12:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-02 13:25:58 -0400 |
commit | a5e54b0dbb6a099793caf508b1d6c7d82f965ec3 (patch) | |
tree | a36d616f8445e9576214850054b0f1746f9c33be /include | |
parent | c4d0f8cbca3a97900f85b082064a63c7a5928bd7 (diff) |
USB GADGET/PERIPHERAL: g_file_storage Bulk-Only Transport compliance
Gadget can tell controller driver to ignore Clear-Feature(HALT_ENDPOINT)
This API change enables future support for Bulk-Only Transport compliance
Signed-off-by: David Lopo <lopo.david@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/usb/gadget.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index d8128f7102c9..cf468fbdbf8e 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -114,6 +114,8 @@ struct usb_ep_ops { | |||
114 | int (*dequeue) (struct usb_ep *ep, struct usb_request *req); | 114 | int (*dequeue) (struct usb_ep *ep, struct usb_request *req); |
115 | 115 | ||
116 | int (*set_halt) (struct usb_ep *ep, int value); | 116 | int (*set_halt) (struct usb_ep *ep, int value); |
117 | int (*set_wedge) (struct usb_ep *ep); | ||
118 | |||
117 | int (*fifo_status) (struct usb_ep *ep); | 119 | int (*fifo_status) (struct usb_ep *ep); |
118 | void (*fifo_flush) (struct usb_ep *ep); | 120 | void (*fifo_flush) (struct usb_ep *ep); |
119 | }; | 121 | }; |
@@ -349,6 +351,25 @@ static inline int usb_ep_clear_halt(struct usb_ep *ep) | |||
349 | } | 351 | } |
350 | 352 | ||
351 | /** | 353 | /** |
354 | * usb_ep_set_wedge - sets the halt feature and ignores clear requests | ||
355 | * @ep: the endpoint being wedged | ||
356 | * | ||
357 | * Use this to stall an endpoint and ignore CLEAR_FEATURE(HALT_ENDPOINT) | ||
358 | * requests. If the gadget driver clears the halt status, it will | ||
359 | * automatically unwedge the endpoint. | ||
360 | * | ||
361 | * Returns zero on success, else negative errno. | ||
362 | */ | ||
363 | static inline int | ||
364 | usb_ep_set_wedge(struct usb_ep *ep) | ||
365 | { | ||
366 | if (ep->ops->set_wedge) | ||
367 | return ep->ops->set_wedge(ep); | ||
368 | else | ||
369 | return ep->ops->set_halt(ep, 1); | ||
370 | } | ||
371 | |||
372 | /** | ||
352 | * usb_ep_fifo_status - returns number of bytes in fifo, or error | 373 | * usb_ep_fifo_status - returns number of bytes in fifo, or error |
353 | * @ep: the endpoint whose fifo status is being checked. | 374 | * @ep: the endpoint whose fifo status is being checked. |
354 | * | 375 | * |