Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95807
b: refs/heads/master
c: 62fd2ca
h: refs/heads/master
i:
  95805: b41951d
  95803: 1120fb0
  95799: d57b43b
  95791: 911a7d7
  95775: 95b0238
  95743: d7dfffa
v: v3
  • Loading branch information
David Lopo authored and Greg Kroah-Hartman committed May 2, 2008
1 parent 8bfbe29 commit aecad7c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a5e54b0dbb6a099793caf508b1d6c7d82f965ec3
refs/heads/master: 62fd2cac5bf5cf9e6fcb2fc40b32e7271e605c53
25 changes: 24 additions & 1 deletion trunk/drivers/usb/gadget/file_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -2307,6 +2307,29 @@ static int halt_bulk_in_endpoint(struct fsg_dev *fsg)
return rc;
}

static int wedge_bulk_in_endpoint(struct fsg_dev *fsg)
{
int rc;

DBG(fsg, "bulk-in set wedge\n");
rc = usb_ep_set_wedge(fsg->bulk_in);
if (rc == -EAGAIN)
VDBG(fsg, "delayed bulk-in endpoint wedge\n");
while (rc != 0) {
if (rc != -EAGAIN) {
WARN(fsg, "usb_ep_set_wedge -> %d\n", rc);
rc = 0;
break;
}

/* Wait for a short time and then try again */
if (msleep_interruptible(100) != 0)
return -EINTR;
rc = usb_ep_set_wedge(fsg->bulk_in);
}
return rc;
}

static int pad_with_zeros(struct fsg_dev *fsg)
{
struct fsg_buffhd *bh = fsg->next_buffhd_to_fill;
Expand Down Expand Up @@ -2957,7 +2980,7 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
* We aren't required to halt the OUT endpoint; instead
* we can simply accept and discard any data received
* until the next reset. */
halt_bulk_in_endpoint(fsg);
wedge_bulk_in_endpoint(fsg);
set_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags);
return -EINVAL;
}
Expand Down

0 comments on commit aecad7c

Please sign in to comment.