aboutsummaryrefslogtreecommitdiff
path: root/include/linux/usb/gadget.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-02 11:03:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-02 11:03:08 -0700
commit1be1d6b7f3f6e3a87f872dd5e7a867d03d8a6851 (patch)
tree102ef63f93d7d6d8400fc88158cc859a92a2b44f /include/linux/usb/gadget.h
parent37b6a04fd9fc887bbcc1a27d9354a5e7a5a4cdd8 (diff)
parent62fd2cac5bf5cf9e6fcb2fc40b32e7271e605c53 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (32 commits) USB GADGET/PERIPHERAL: g_file_storage Bulk-Only Transport compliance, clear-feature ignore USB GADGET/PERIPHERAL: g_file_storage Bulk-Only Transport compliance usb_serial: some coding style fixes USB: Remove redundant dependencies on USB_ATM. USB: UHCI: disable remote wakeup when it's not needed USB: OHCI: work around bogus compiler warning USB: add Cypress c67x00 OTG controller HCD driver USB: add Cypress c67x00 OTG controller core driver USB: add Cypress c67x00 low level interface code USB: airprime: unlock mutex instead of trying to lock it again USB: storage: Update mailling list address USB: storage: UNUSUAL_DEVS() for PanDigital Picture frame. USB: Add the USB 2.0 extension descriptor. USB: add more FTDI device ids USB: fix cannot work usb storage when using ohci-sm501 usb: gadget zero timer init fix usb: gadget zero style fixups (mostly whitespace) usb serial gadget: CDC ACM fixes usb: pxa27x_udc driver USB: INTOVA Pixtreme camera mass storage device ...
Diffstat (limited to 'include/linux/usb/gadget.h')
-rw-r--r--include/linux/usb/gadget.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index d8128f7102c..cf468fbdbf8 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.
*