diff options
author | Paul Mackerras <paulus@samba.org> | 2008-05-09 20:12:06 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-05-09 20:12:06 +1000 |
commit | 2a5f2e3e6cd1ce9fb3f8b186b6bc9aa1f1497a92 (patch) | |
tree | b2306840f227972a7c9d4a2b75e516fe81358ce8 /include/linux/usb/gadget.h | |
parent | 02539d71fa98d5737bb668b02286c76241e4bac9 (diff) | |
parent | 78be76476a34a77f0ea9db2f78ba46a2b0fd5ab5 (diff) |
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx into merge
Diffstat (limited to 'include/linux/usb/gadget.h')
-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 { int (*dequeue) (struct usb_ep *ep, struct usb_request *req); int (*set_halt) (struct usb_ep *ep, int value); + int (*set_wedge) (struct usb_ep *ep); + int (*fifo_status) (struct usb_ep *ep); void (*fifo_flush) (struct usb_ep *ep); }; @@ -349,6 +351,25 @@ static inline int usb_ep_clear_halt(struct usb_ep *ep) } /** + * usb_ep_set_wedge - sets the halt feature and ignores clear requests + * @ep: the endpoint being wedged + * + * Use this to stall an endpoint and ignore CLEAR_FEATURE(HALT_ENDPOINT) + * requests. If the gadget driver clears the halt status, it will + * automatically unwedge the endpoint. + * + * Returns zero on success, else negative errno. + */ +static inline int +usb_ep_set_wedge(struct usb_ep *ep) +{ + if (ep->ops->set_wedge) + return ep->ops->set_wedge(ep); + else + return ep->ops->set_halt(ep, 1); +} + +/** * usb_ep_fifo_status - returns number of bytes in fifo, or error * @ep: the endpoint whose fifo status is being checked. * |