提交 a5e54b0d 编写于 作者: D David Lopo 提交者: Greg Kroah-Hartman

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: NDavid Lopo <lopo.david@gmail.com>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c4d0f8cb
...@@ -114,6 +114,8 @@ struct usb_ep_ops { ...@@ -114,6 +114,8 @@ struct usb_ep_ops {
int (*dequeue) (struct usb_ep *ep, struct usb_request *req); int (*dequeue) (struct usb_ep *ep, struct usb_request *req);
int (*set_halt) (struct usb_ep *ep, int value); int (*set_halt) (struct usb_ep *ep, int value);
int (*set_wedge) (struct usb_ep *ep);
int (*fifo_status) (struct usb_ep *ep); int (*fifo_status) (struct usb_ep *ep);
void (*fifo_flush) (struct usb_ep *ep); void (*fifo_flush) (struct usb_ep *ep);
}; };
...@@ -348,6 +350,25 @@ static inline int usb_ep_clear_halt(struct usb_ep *ep) ...@@ -348,6 +350,25 @@ static inline int usb_ep_clear_halt(struct usb_ep *ep)
return ep->ops->set_halt(ep, 0); return ep->ops->set_halt(ep, 0);
} }
/**
* 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 * usb_ep_fifo_status - returns number of bytes in fifo, or error
* @ep: the endpoint whose fifo status is being checked. * @ep: the endpoint whose fifo status is being checked.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册