Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264338
b: refs/heads/master
c: a3a4bfd
h: refs/heads/master
v: v3
  • Loading branch information
Wolfgang Grandegger authored and David S. Miller committed Oct 10, 2011
1 parent bcf9edb commit 6f2f28f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: cdaf557034bb4397b2c86bb424de1788b134f610
refs/heads/master: a3a4bfde8a271df7ee56fcf31b8d907d50e7f216
11 changes: 8 additions & 3 deletions trunk/drivers/net/can/mscan/mscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,13 @@ static netdev_tx_t mscan_start_xmit(struct sk_buff *skb, struct net_device *dev)
void __iomem *data = &regs->tx.dsr1_0;
u16 *payload = (u16 *)frame->data;

/* It is safe to write into dsr[dlc+1] */
for (i = 0; i < (frame->can_dlc + 1) / 2; i++) {
for (i = 0; i < frame->can_dlc / 2; i++) {
out_be16(data, *payload++);
data += 2 + _MSCAN_RESERVED_DSR_SIZE;
}
/* write remaining byte if necessary */
if (frame->can_dlc & 1)
out_8(data, frame->data[frame->can_dlc - 1]);
}

out_8(&regs->tx.dlr, frame->can_dlc);
Expand Down Expand Up @@ -330,10 +332,13 @@ static void mscan_get_rx_frame(struct net_device *dev, struct can_frame *frame)
void __iomem *data = &regs->rx.dsr1_0;
u16 *payload = (u16 *)frame->data;

for (i = 0; i < (frame->can_dlc + 1) / 2; i++) {
for (i = 0; i < frame->can_dlc / 2; i++) {
*payload++ = in_be16(data);
data += 2 + _MSCAN_RESERVED_DSR_SIZE;
}
/* read remaining byte if necessary */
if (frame->can_dlc & 1)
frame->data[frame->can_dlc - 1] = in_8(data);
}

out_8(&regs->canrflg, MSCAN_RXF);
Expand Down

0 comments on commit 6f2f28f

Please sign in to comment.