Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364860
b: refs/heads/master
c: d91641b
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Apr 17, 2013
1 parent 39bd94d commit d4e04d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 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: b42abbcde44a0a58e7dbaa4e3f0adc4cf5b74684
refs/heads/master: d91641b161594672242b3c5d8656ad3b2ef58f34
14 changes: 7 additions & 7 deletions trunk/drivers/usb/serial/omninet.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ static void omninet_close(struct usb_serial_port *port)
}


#define OMNINET_DATAOFFSET 0x04
#define OMNINET_HEADERLEN sizeof(struct omninet_header)
#define OMNINET_BULKOUTSIZE (64 - OMNINET_HEADERLEN)
#define OMNINET_HEADERLEN 4
#define OMNINET_BULKOUTSIZE 64
#define OMNINET_PAYLOADSIZE (OMNINET_BULKOUTSIZE - OMNINET_HEADERLEN)

static void omninet_read_bulk_callback(struct urb *urb)
{
Expand All @@ -173,7 +173,7 @@ static void omninet_read_bulk_callback(struct urb *urb)
}

if (urb->actual_length && header->oh_len) {
tty_insert_flip_string(&port->port, data + OMNINET_DATAOFFSET,
tty_insert_flip_string(&port->port, data + OMNINET_HEADERLEN,
header->oh_len);
tty_flip_buffer_push(&port->port);
}
Expand Down Expand Up @@ -208,9 +208,9 @@ static int omninet_write(struct tty_struct *tty, struct usb_serial_port *port,
return 0;
}

count = (count > OMNINET_BULKOUTSIZE) ? OMNINET_BULKOUTSIZE : count;
count = (count > OMNINET_PAYLOADSIZE) ? OMNINET_PAYLOADSIZE : count;

memcpy(wport->write_urb->transfer_buffer + OMNINET_DATAOFFSET,
memcpy(wport->write_urb->transfer_buffer + OMNINET_HEADERLEN,
buf, count);

usb_serial_debug_data(&port->dev, __func__, count,
Expand All @@ -222,7 +222,7 @@ static int omninet_write(struct tty_struct *tty, struct usb_serial_port *port,
header->oh_pad = 0x00;

/* send the data out the bulk port, always 64 bytes */
wport->write_urb->transfer_buffer_length = 64;
wport->write_urb->transfer_buffer_length = OMNINET_BULKOUTSIZE;

result = usb_submit_urb(wport->write_urb, GFP_ATOMIC);
if (result) {
Expand Down

0 comments on commit d4e04d4

Please sign in to comment.