Commit 39892da4 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

USB: Digi AccelePort adapted to new tty buffering

this fixes the flushing trouble due to its own buffering for this driver.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
Cc: Al Borchers <alborchers@steinerpoint.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b308e74d
...@@ -930,23 +930,17 @@ static void digi_rx_unthrottle( struct usb_serial_port *port ) ...@@ -930,23 +930,17 @@ static void digi_rx_unthrottle( struct usb_serial_port *port )
{ {
int ret = 0; int ret = 0;
int len;
unsigned long flags; unsigned long flags;
struct digi_port *priv = usb_get_serial_port_data(port); struct digi_port *priv = usb_get_serial_port_data(port);
struct tty_struct *tty = port->tty;
dbg( "digi_rx_unthrottle: TOP: port=%d", priv->dp_port_num ); dbg( "digi_rx_unthrottle: TOP: port=%d", priv->dp_port_num );
spin_lock_irqsave( &priv->dp_port_lock, flags ); spin_lock_irqsave( &priv->dp_port_lock, flags );
/* send any buffered chars from throttle time on to tty subsystem */ /* turn throttle off */
priv->dp_throttled = 0;
len = tty_buffer_request_room(tty, priv->dp_in_buf_len); priv->dp_in_buf_len = 0;
if( len > 0 ) { priv->dp_throttle_restart = 0;
tty_insert_flip_string_flags(tty, priv->dp_in_buf, priv->dp_in_flag_buf, len);
tty_flip_buffer_push( tty );
}
/* restart read chain */ /* restart read chain */
if( priv->dp_throttle_restart ) { if( priv->dp_throttle_restart ) {
...@@ -954,11 +948,6 @@ dbg( "digi_rx_unthrottle: TOP: port=%d", priv->dp_port_num ); ...@@ -954,11 +948,6 @@ dbg( "digi_rx_unthrottle: TOP: port=%d", priv->dp_port_num );
ret = usb_submit_urb( port->read_urb, GFP_ATOMIC ); ret = usb_submit_urb( port->read_urb, GFP_ATOMIC );
} }
/* turn throttle off */
priv->dp_throttled = 0;
priv->dp_in_buf_len = 0;
priv->dp_throttle_restart = 0;
spin_unlock_irqrestore( &priv->dp_port_lock, flags ); spin_unlock_irqrestore( &priv->dp_port_lock, flags );
if( ret ) { if( ret ) {
...@@ -1864,31 +1853,16 @@ static int digi_read_inb_callback( struct urb *urb ) ...@@ -1864,31 +1853,16 @@ static int digi_read_inb_callback( struct urb *urb )
/* data length is len-1 (one byte of len is status) */ /* data length is len-1 (one byte of len is status) */
--len; --len;
if( throttled ) { len = tty_buffer_request_room(tty, len);
if( len > 0 ) {
len = min( len, /* Hot path */
DIGI_IN_BUF_SIZE - priv->dp_in_buf_len ); if(flag == TTY_NORMAL)
tty_insert_flip_string(tty, data, len);
if( len > 0 ) { else {
memcpy( priv->dp_in_buf + priv->dp_in_buf_len, for(i = 0; i < len; i++)
data, len ); tty_insert_flip_char(tty, data[i], flag);
memset( priv->dp_in_flag_buf
+ priv->dp_in_buf_len, flag, len );
priv->dp_in_buf_len += len;
}
} else {
len = tty_buffer_request_room(tty, len);
if( len > 0 ) {
/* Hot path */
if(flag == TTY_NORMAL)
tty_insert_flip_string(tty, data, len);
else {
for(i = 0; i < len; i++)
tty_insert_flip_char(tty, data[i], flag);
}
tty_flip_buffer_push( tty );
} }
tty_flip_buffer_push( tty );
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment