prepare_to_wait(&priv->dp_flush_wait, &wait, TASK_UNINTERRUPTIBLE); 
prepare_to_wait(&priv->dp_flush_wait, &wait, TASK_INTERRUPTIBLE); 
static void digi_close( struct usb_serial_port *port, struct file *filp ){	DEFINE_WAIT(wait);	int ret;	unsigned char buf[32];	struct tty_struct *tty = port->tty;	struct digi_port *priv = usb_get_serial_port_data(port);	unsigned long flags = 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;	/* wait for output to drain */	if( (filp->f_flags&(O_NDELAY|O_NONBLOCK)) == 0 ) {		tty_wait_until_sent( tty, DIGI_CLOSE_TIMEOUT );	}	/* flush driver and line discipline buffers */	if( tty->driver->flush_buffer )		tty->driver->flush_buffer( tty );	tty_ldisc_flush(tty);	if (port->serial->dev) {		/* wait for transmit idle */		if( (filp->f_flags&(O_NDELAY|O_NONBLOCK)) == 0 ) {			digi_transmit_idle( port, DIGI_CLOSE_TIMEOUT );		}		/* drop DTR and RTS */		digi_set_modem_signals( port, 0, 0 );		/* disable input flow control */		buf[0] = DIGI_CMD_SET_INPUT_FLOW_CONTROL;		buf[1] = priv->dp_port_num;		buf[2] = DIGI_DISABLE;		buf[3] = 0;		/* disable output flow control */		buf[4] = DIGI_CMD_SET_OUTPUT_FLOW_CONTROL;		buf[5] = priv->dp_port_num;		buf[6] = DIGI_DISABLE;		buf[7] = 0;		/* disable reading modem signals automatically */		buf[8] = DIGI_CMD_READ_INPUT_SIGNALS;		buf[9] = priv->dp_port_num;		buf[10] = DIGI_DISABLE;		buf[11] = 0;		/* disable receive */		buf[12] = DIGI_CMD_RECEIVE_ENABLE;		buf[13] = priv->dp_port_num;		buf[14] = DIGI_DISABLE;		buf[15] = 0;		/* flush fifos */		buf[16] = DIGI_CMD_IFLUSH_FIFO;		buf[17] = priv->dp_port_num;		buf[18] = DIGI_FLUSH_TX | DIGI_FLUSH_RX;		buf[19] = 0;		if( (ret=digi_write_oob_command( port, buf, 20, 0 )) != 0 )			dbg( "digi_close: write oob failed, ret=%d", ret );		/* wait for final commands on oob port to complete */		prepare_to_wait(&priv->dp_flush_wait, &wait, TASK_UNINTERRUPTIBLE);		schedule_timeout(DIGI_CLOSE_TIMEOUT);		finish_wait(&priv->dp_flush_wait, &wait);		/* shutdown any outstanding bulk writes */		usb_kill_urb(port->write_urb);	}	tty->closing = 0;exit:	spin_lock_irqsave( &priv->dp_port_lock, flags );	priv->dp_write_urb_in_use = 0;	priv->dp_in_close = 0;	wake_up_interruptible( &priv->dp_close_wait );	spin_unlock_irqrestore( &priv->dp_port_lock, flags );dbg( "digi_close: done" );}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/45f23f189ca66d98b1f8b7f3d30a194d3188039d/digi_acceleport.c/clean/drivers/usb/serial/digi_acceleport.c