diff options
Diffstat (limited to 'net/irda/ircomm/ircomm_tty_ioctl.c')
| -rw-r--r-- | net/irda/ircomm/ircomm_tty_ioctl.c | 51 | 
1 files changed, 25 insertions, 26 deletions
diff --git a/net/irda/ircomm/ircomm_tty_ioctl.c b/net/irda/ircomm/ircomm_tty_ioctl.c index 24cb3aa2bbf..ce943853c38 100644 --- a/net/irda/ircomm/ircomm_tty_ioctl.c +++ b/net/irda/ircomm/ircomm_tty_ioctl.c @@ -22,9 +22,7 @@   *     GNU General Public License for more details.   *   *     You should have received a copy of the GNU General Public License - *     along with this program; if not, write to the Free Software - *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, - *     MA 02111-1307 USA + *     along with this program; if not, see <http://www.gnu.org/licenses/>.   *   ********************************************************************/ @@ -52,17 +50,18 @@   *    Change speed of the driver. If the remote device is a DCE, then this   *    should make it change the speed of its serial port   */ -static void ircomm_tty_change_speed(struct ircomm_tty_cb *self) +static void ircomm_tty_change_speed(struct ircomm_tty_cb *self, +		struct tty_struct *tty)  { -	unsigned cflag, cval; +	unsigned int cflag, cval;  	int baud;  	IRDA_DEBUG(2, "%s()\n", __func__ ); -	if (!self->tty || !self->tty->termios || !self->ircomm) +	if (!self->ircomm)  		return; -	cflag = self->tty->termios->c_cflag; +	cflag = tty->termios.c_cflag;  	/*  byte size and parity */  	switch (cflag & CSIZE) { @@ -81,7 +80,7 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self)  		cval |= IRCOMM_PARITY_EVEN;  	/* Determine divisor based on baud rate */ -	baud = tty_get_baud_rate(self->tty); +	baud = tty_get_baud_rate(tty);  	if (!baud)  		baud = 9600;	/* B0 transition handled in rs_set_termios */ @@ -90,19 +89,19 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self)  	/* CTS flow control flag and modem status interrupts */  	if (cflag & CRTSCTS) { -		self->flags |= ASYNC_CTS_FLOW; +		self->port.flags |= ASYNC_CTS_FLOW;  		self->settings.flow_control |= IRCOMM_RTS_CTS_IN;  		/* This got me. Bummer. Jean II */  		if (self->service_type == IRCOMM_3_WIRE_RAW)  			IRDA_WARNING("%s(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n", __func__);  	} else { -		self->flags &= ~ASYNC_CTS_FLOW; +		self->port.flags &= ~ASYNC_CTS_FLOW;  		self->settings.flow_control &= ~IRCOMM_RTS_CTS_IN;  	}  	if (cflag & CLOCAL) -		self->flags &= ~ASYNC_CHECK_CD; +		self->port.flags &= ~ASYNC_CHECK_CD;  	else -		self->flags |= ASYNC_CHECK_CD; +		self->port.flags |= ASYNC_CHECK_CD;  #if 0  	/*  	 * Set up parity check flag @@ -148,18 +147,18 @@ void ircomm_tty_set_termios(struct tty_struct *tty,  			    struct ktermios *old_termios)  {  	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; -	unsigned int cflag = tty->termios->c_cflag; +	unsigned int cflag = tty->termios.c_cflag;  	IRDA_DEBUG(2, "%s()\n", __func__ );  	if ((cflag == old_termios->c_cflag) && -	    (RELEVANT_IFLAG(tty->termios->c_iflag) == +	    (RELEVANT_IFLAG(tty->termios.c_iflag) ==  	     RELEVANT_IFLAG(old_termios->c_iflag)))  	{  		return;  	} -	ircomm_tty_change_speed(self); +	ircomm_tty_change_speed(self, tty);  	/* Handle transition to B0 status */  	if ((old_termios->c_cflag & CBAUD) && @@ -172,7 +171,7 @@ void ircomm_tty_set_termios(struct tty_struct *tty,  	if (!(old_termios->c_cflag & CBAUD) &&  	    (cflag & CBAUD)) {  		self->settings.dte |= IRCOMM_DTR; -		if (!(tty->termios->c_cflag & CRTSCTS) || +		if (!(tty->termios.c_cflag & CRTSCTS) ||  		    !test_bit(TTY_THROTTLED, &tty->flags)) {  			self->settings.dte |= IRCOMM_RTS;  		} @@ -181,7 +180,7 @@ void ircomm_tty_set_termios(struct tty_struct *tty,  	/* Handle turning off CRTSCTS */  	if ((old_termios->c_cflag & CRTSCTS) && -	    !(tty->termios->c_cflag & CRTSCTS)) +	    !(tty->termios.c_cflag & CRTSCTS))  	{  		tty->hw_stopped = 0;  		ircomm_tty_start(tty); @@ -189,12 +188,12 @@ void ircomm_tty_set_termios(struct tty_struct *tty,  }  /* - * Function ircomm_tty_tiocmget (tty, file) + * Function ircomm_tty_tiocmget (tty)   *   *   *   */ -int ircomm_tty_tiocmget(struct tty_struct *tty, struct file *file) +int ircomm_tty_tiocmget(struct tty_struct *tty)  {  	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;  	unsigned int result; @@ -214,12 +213,12 @@ int ircomm_tty_tiocmget(struct tty_struct *tty, struct file *file)  }  /* - * Function ircomm_tty_tiocmset (tty, file, set, clear) + * Function ircomm_tty_tiocmset (tty, set, clear)   *   *   *   */ -int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file, +int ircomm_tty_tiocmset(struct tty_struct *tty,  			unsigned int set, unsigned int clear)  {  	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; @@ -270,10 +269,10 @@ static int ircomm_tty_get_serial_info(struct ircomm_tty_cb *self,  	memset(&info, 0, sizeof(info));  	info.line = self->line; -	info.flags = self->flags; +	info.flags = self->port.flags;  	info.baud_base = self->settings.data_rate; -	info.close_delay = self->close_delay; -	info.closing_wait = self->closing_wait; +	info.close_delay = self->port.close_delay; +	info.closing_wait = self->port.closing_wait;  	/* For compatibility  */  	info.type = PORT_16550A; @@ -365,12 +364,12 @@ static int ircomm_tty_set_serial_info(struct ircomm_tty_cb *self,  }  /* - * Function ircomm_tty_ioctl (tty, file, cmd, arg) + * Function ircomm_tty_ioctl (tty, cmd, arg)   *   *   *   */ -int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, +int ircomm_tty_ioctl(struct tty_struct *tty,  		     unsigned int cmd, unsigned long arg)  {  	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;  | 
