Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95806
b: refs/heads/master
c: a5e54b0
h: refs/heads/master
v: v3
  • Loading branch information
David Lopo authored and Greg Kroah-Hartman committed May 2, 2008
1 parent b41951d commit 8bfbe29
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c4d0f8cbca3a97900f85b082064a63c7a5928bd7
refs/heads/master: a5e54b0dbb6a099793caf508b1d6c7d82f965ec3
21 changes: 21 additions & 0 deletions trunk/include/linux/usb/gadget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down Expand Up @@ -348,6 +350,25 @@ static inline int usb_ep_clear_halt(struct usb_ep *ep)
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
* @ep: the endpoint whose fifo status is being checked.
Expand Down

0 comments on commit 8bfbe29

Please sign in to comment.