Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104627
b: refs/heads/master
c: 28874b7
h: refs/heads/master
i:
  104625: da2179a
  104623: 500a753
v: v3
  • Loading branch information
Julien May authored and Greg Kroah-Hartman committed Jul 21, 2008
1 parent be3a202 commit a7611a9
Show file tree
Hide file tree
Showing 2 changed files with 20 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: df3e1ab7334279bc744344bcf05272dc8b985d3d
refs/heads/master: 28874b7ec47e1e5cfe2b67420c4d07c6297a43a9
23 changes: 19 additions & 4 deletions trunk/drivers/usb/host/isp116x-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ static void write_ptddata_to_fifo(struct isp116x *isp116x, void *buf, int len)
u16 w;
int quot = len % 4;

/* buffer is already in 'usb data order', which is LE. */
/* When reading buffer as u16, we have to take care byte order */
/* doesn't get mixed up */

if ((unsigned long)dp2 & 1) {
/* not aligned */
for (; len > 1; len -= 2) {
Expand All @@ -105,8 +109,11 @@ static void write_ptddata_to_fifo(struct isp116x *isp116x, void *buf, int len)
isp116x_write_data16(isp116x, (u16) * dp);
} else {
/* aligned */
for (; len > 1; len -= 2)
isp116x_raw_write_data16(isp116x, *dp2++);
for (; len > 1; len -= 2) {
/* Keep byte order ! */
isp116x_raw_write_data16(isp116x, cpu_to_le16(*dp2++));
}

if (len)
isp116x_write_data16(isp116x, 0xff & *((u8 *) dp2));
}
Expand All @@ -124,19 +131,27 @@ static void read_ptddata_from_fifo(struct isp116x *isp116x, void *buf, int len)
u16 w;
int quot = len % 4;

/* buffer is already in 'usb data order', which is LE. */
/* When reading buffer as u16, we have to take care byte order */
/* doesn't get mixed up */

if ((unsigned long)dp2 & 1) {
/* not aligned */
for (; len > 1; len -= 2) {
w = isp116x_raw_read_data16(isp116x);
*dp++ = w & 0xff;
*dp++ = (w >> 8) & 0xff;
}

if (len)
*dp = 0xff & isp116x_read_data16(isp116x);
} else {
/* aligned */
for (; len > 1; len -= 2)
*dp2++ = isp116x_raw_read_data16(isp116x);
for (; len > 1; len -= 2) {
/* Keep byte order! */
*dp2++ = le16_to_cpu(isp116x_raw_read_data16(isp116x));
}

if (len)
*(u8 *) dp2 = 0xff & isp116x_read_data16(isp116x);
}
Expand Down

0 comments on commit a7611a9

Please sign in to comment.