#include <linux/workqueue.h>
#include <asm/uaccess.h>
#include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
- static int debug = 1;
-#else
- static int debug;
-#endif
-
#include "usb-serial.h"
-
/* Defines */
/*
/* Statics */
+static int debug;
+
static struct usb_device_id id_table_combined [] = {
{ USB_DEVICE(DIGI_VENDOR_ID, DIGI_2_ID) },
{ USB_DEVICE(DIGI_VENDOR_ID, DIGI_4_ID) },
wake_up_interruptible( &port->write_wait );
/* wake up line discipline */
- if( (tty->flags & (1 << TTY_DO_WRITE_WAKEUP))
- && tty->ldisc.write_wakeup )
- (tty->ldisc.write_wakeup)(tty);
-
- /* wake up other tty processes */
- wake_up_interruptible( &tty->write_wait );
- /* For 2.2.16 backport -- wake_up_interruptible( &tty->poll_wait ); */
-
+ tty_wakeup(tty);
}
return;
}
- /* further sanity checks */
- if( port_paranoia_check( port, __FUNCTION__ )
- || serial_paranoia_check( serial, __FUNCTION__ ) )
- return;
-
/* try to send any buffered data on this port, if it is open */
spin_lock( &priv->dp_port_lock );
priv->dp_write_urb_in_use = 0;
dbg( "digi_close: TOP: port=%d, open_count=%d", priv->dp_port_num, port->open_count );
+ /* if disconnected, just clear flags */
+ if (!usb_get_intfdata(port->serial->interface))
+ goto exit;
+
/* do cleanup only after final close on this port */
spin_lock_irqsave( &priv->dp_port_lock, flags );
priv->dp_in_close = 1;
spin_unlock_irqrestore( &priv->dp_port_lock, flags );
/* tell line discipline to process only XON/XOFF */
- tty->closing = 1;
+ tty->closing = 1;
/* wait for output to drain */
if( (filp->f_flags&(O_NDELAY|O_NONBLOCK)) == 0 ) {
/* flush driver and line discipline buffers */
if( tty->driver->flush_buffer )
tty->driver->flush_buffer( tty );
- if( tty->ldisc.flush_buffer )
- tty->ldisc.flush_buffer( tty );
+ tty_ldisc_flush(tty);
if (port->serial->dev) {
/* wait for transmit idle */
tty->closing = 0;
+exit:
spin_lock_irqsave( &priv->dp_port_lock, flags );
priv->dp_write_urb_in_use = 0;
priv->dp_in_close = 0;
return;
}
if( port->serial == NULL
- || serial_paranoia_check( port->serial, __FUNCTION__ )
|| (serial_priv=usb_get_serial_data(port->serial)) == NULL ) {
err("%s: serial is bad or serial->private is NULL, status=%d", __FUNCTION__, urb->status );
return;
unsigned char *data = ((unsigned char *)urb->transfer_buffer)+3;
int flag,throttled;
-
- /* sanity check */
- if( port_paranoia_check( port, __FUNCTION__ ) )
- return( -1 );
-
/* do not process callbacks on closed ports */
/* but do continue the read chain */
if( port->open_count == 0 )
port = serial->port[line];
- if( port_paranoia_check( port, __FUNCTION__ )
- || (priv=usb_get_serial_port_data(port)) == NULL )
- return( -1 );
+ if ((priv=usb_get_serial_port_data(port)) == NULL )
+ return -1;
if( opcode == DIGI_CMD_READ_INPUT_SIGNALS ) {
MODULE_DESCRIPTION( DRIVER_DESC );
MODULE_LICENSE("GPL");
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(debug, "Debug enabled or not");
-