Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168717
b: refs/heads/master
c: fca9474
h: refs/heads/master
i:
  168715: 2e79001
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Nov 18, 2009
1 parent de06b0c commit 891b83f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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: 5294bea40666db5c5d6c336b8e4e55d69fa576ca
refs/heads/master: fca94748c5136ff390eadc443871b82f1f77dcd6
11 changes: 7 additions & 4 deletions trunk/drivers/usb/mon/mon_bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ static unsigned int mon_buff_area_alloc_contiguous(struct mon_reader_bin *rp,

/*
* Return a few (kilo-)bytes to the head of the buffer.
* This is used if a DMA fetch fails.
* This is used if a data fetch fails.
*/
static void mon_buff_area_shrink(struct mon_reader_bin *rp, unsigned int size)
{

size = (size + PKT_ALIGN-1) & ~(PKT_ALIGN-1);
/* size &= ~(PKT_ALIGN-1); -- we're called with aligned size */
rp->b_cnt -= size;
if (rp->b_in < size)
rp->b_in += rp->b_size;
Expand Down Expand Up @@ -433,6 +433,7 @@ static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb,
unsigned int urb_length;
unsigned int offset;
unsigned int length;
unsigned int delta;
unsigned int ndesc, lendesc;
unsigned char dir;
struct mon_bin_hdr *ep;
Expand Down Expand Up @@ -537,8 +538,10 @@ static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb,
if (length != 0) {
ep->flag_data = mon_bin_get_data(rp, offset, urb, length);
if (ep->flag_data != 0) { /* Yes, it's 0x00, not '0' */
ep->len_cap = 0;
mon_buff_area_shrink(rp, length);
delta = (ep->len_cap + PKT_ALIGN-1) & ~(PKT_ALIGN-1);
ep->len_cap -= length;
delta -= (ep->len_cap + PKT_ALIGN-1) & ~(PKT_ALIGN-1);
mon_buff_area_shrink(rp, delta);
}
} else {
ep->flag_data = data_tag;
Expand Down

0 comments on commit 891b83f

Please sign in to comment.