Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28310
b: refs/heads/master
c: c10746d
h: refs/heads/master
v: v3
  • Loading branch information
Paul Fulghum authored and Greg Kroah-Hartman committed Jun 21, 2006
1 parent c640f18 commit 8e17f2a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 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: 01cced250722d22d99c2342979490f93ca886521
refs/heads/master: c10746dbb39d41e5fc27badfebe61448210c426d
39 changes: 30 additions & 9 deletions trunk/drivers/usb/serial/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,38 @@ static void usb_console_write(struct console *co, const char *buf, unsigned coun

if (!port->open_count) {
dbg ("%s - port not opened", __FUNCTION__);
goto exit;
return;
}

/* pass on to the driver specific version of this function if it is available */
if (serial->type->write)
retval = serial->type->write(port, buf, count);
else
retval = usb_serial_generic_write(port, buf, count);

exit:
dbg("%s - return value (if we had one): %d", __FUNCTION__, retval);
while (count) {
unsigned int i;
unsigned int lf;
/* search for LF so we can insert CR if necessary */
for (i=0, lf=0 ; i < count ; i++) {
if (*(buf + i) == 10) {
lf = 1;
i++;
break;
}
}
/* pass on to the driver specific version of this function if it is available */
if (serial->type->write)
retval = serial->type->write(port, buf, i);
else
retval = usb_serial_generic_write(port, buf, i);
dbg("%s - return value : %d", __FUNCTION__, retval);
if (lf) {
/* append CR after LF */
unsigned char cr = 13;
if (serial->type->write)
retval = serial->type->write(port, &cr, 1);
else
retval = usb_serial_generic_write(port, &cr, 1);
dbg("%s - return value : %d", __FUNCTION__, retval);
}
buf += i;
count -= i;
}
}

static struct console usbcons = {
Expand Down

0 comments on commit 8e17f2a

Please sign in to comment.