public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH: USB white heat update for new tty buffers
@ 2005-09-06 14:42 Alan Cox
  0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2005-09-06 14:42 UTC (permalink / raw)
  To: linux-kernel, akpm

This got missed originally as it is marked BROKEN_ON_SMP (I can't see
why however). Updated and compile tested. I don't have hardware

Signed-off-by: Alan Cox <alan@redhat.com>

--- ../linux.vanilla-2.6.13-rc6-mm2/drivers/usb/serial/whiteheat.c	2005-08-25 17:04:32.000000000 +0100
+++ drivers/usb/serial/whiteheat.c	2005-09-06 14:50:38.000000000 +0100
@@ -1430,7 +1430,9 @@
 		urb = wrap->urb;
 
 		if (tty && urb->actual_length) {
-			if (urb->actual_length > TTY_FLIPBUF_SIZE - tty->flip.count) {
+			int len = tty_buffer_request_room(tty, urb->actual_length);
+			/* This stuff can go away now I suspect */
+			if (unlikely(len < urb->actual_length)) {
 				spin_lock_irqsave(&info->lock, flags);
 				list_add(tmp, &info->rx_urb_q);
 				spin_unlock_irqrestore(&info->lock, flags);
@@ -1438,11 +1440,8 @@
 				schedule_work(&info->rx_work);
 				return;
 			}
-
-			memcpy(tty->flip.char_buf_ptr, urb->transfer_buffer, urb->actual_length);
-			tty->flip.char_buf_ptr += urb->actual_length;
-			tty->flip.count += urb->actual_length;
-			sent += urb->actual_length;
+			tty_insert_flip_string(tty, urb->transfer_buffer, len);
+			sent += len;
 		}
 
 		urb->dev = port->serial->dev;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-06 14:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-06 14:42 PATCH: USB white heat update for new tty buffers Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox