Merge git://oss.sgi.com:8090/xfs/xfs-2.6
[linux-drm-fsl-dcu.git] / net / irda / ircomm / ircomm_tty_ioctl.c
index 75e39ea599d81147fca02e540eb03f77e3f329d0..a5174e6e7ad3264fa5cad595f4eff9aa06b4f00c 100644 (file)
@@ -1,31 +1,31 @@
 /*********************************************************************
- *                
+ *
  * Filename:      ircomm_tty_ioctl.c
- * Version:       
- * Description:   
+ * Version:
+ * Description:
  * Status:        Experimental.
  * Author:        Dag Brattli <dagb@cs.uit.no>
  * Created at:    Thu Jun 10 14:39:09 1999
  * Modified at:   Wed Jan  5 14:45:43 2000
  * Modified by:   Dag Brattli <dagb@cs.uit.no>
- * 
+ *
  *     Copyright (c) 1999-2000 Dag Brattli, All Rights Reserved.
- *     
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
- * 
+ *
  *     This program is distributed in the hope that it will be useful,
  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  *     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, 
+ *
+ *     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
- *     
+ *
  ********************************************************************/
 
 #include <linux/init.h>
@@ -75,7 +75,7 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self)
        }
        if (cflag & CSTOPB)
                cval |= IRCOMM_2_STOP_BIT;
-       
+
        if (cflag & PARENB)
                cval |= IRCOMM_PARITY_ENABLE;
        if (!(cflag & PARODD))
@@ -88,7 +88,7 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self)
 
        self->settings.data_rate = baud;
        ircomm_param_request(self, IRCOMM_DATA_RATE, FALSE);
-       
+
        /* CTS flow control flag and modem status interrupts */
        if (cflag & CRTSCTS) {
                self->flags |= ASYNC_CTS_FLOW;
@@ -104,7 +104,7 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self)
                self->flags &= ~ASYNC_CHECK_CD;
        else
                self->flags |= ASYNC_CHECK_CD;
-#if 0  
+#if 0
        /*
         * Set up parity check flag
         */
@@ -113,7 +113,7 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self)
                driver->read_status_mask |= LSR_FE | LSR_PE;
        if (I_BRKINT(driver->tty) || I_PARMRK(driver->tty))
                driver->read_status_mask |= LSR_BI;
-       
+
        /*
         * Characters to ignore
         */
@@ -124,17 +124,17 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self)
        if (I_IGNBRK(self->tty)) {
                self->ignore_status_mask |= LSR_BI;
                /*
-                * If we're ignore parity and break indicators, ignore 
+                * If we're ignore parity and break indicators, ignore
                 * overruns too. (For real raw support).
                 */
-               if (I_IGNPAR(self->tty)) 
+               if (I_IGNPAR(self->tty))
                        self->ignore_status_mask |= LSR_OE;
        }
 #endif
        self->settings.data_format = cval;
 
        ircomm_param_request(self, IRCOMM_DATA_FORMAT, FALSE);
-       ircomm_param_request(self, IRCOMM_FLOW_CONTROL, TRUE);
+       ircomm_param_request(self, IRCOMM_FLOW_CONTROL, TRUE);
 }
 
 /*
@@ -145,7 +145,7 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self)
  *    should be prepared to accept the case where old == NULL, and try to
  *    do something rational.
  */
-void ircomm_tty_set_termios(struct tty_struct *tty, 
+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;
@@ -153,8 +153,8 @@ void ircomm_tty_set_termios(struct tty_struct *tty,
 
        IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
 
-       if ((cflag == old_termios->c_cflag) && 
-           (RELEVANT_IFLAG(tty->termios->c_iflag) == 
+       if ((cflag == old_termios->c_cflag) &&
+           (RELEVANT_IFLAG(tty->termios->c_iflag) ==
             RELEVANT_IFLAG(old_termios->c_iflag)))
        {
                return;
@@ -168,21 +168,21 @@ void ircomm_tty_set_termios(struct tty_struct *tty,
                self->settings.dte &= ~(IRCOMM_DTR|IRCOMM_RTS);
                ircomm_param_request(self, IRCOMM_DTE, TRUE);
        }
-       
+
        /* Handle transition away from B0 status */
        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;
                }
                ircomm_param_request(self, IRCOMM_DTE, TRUE);
        }
-       
+
        /* 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);
@@ -192,7 +192,7 @@ void ircomm_tty_set_termios(struct tty_struct *tty,
 /*
  * Function ircomm_tty_tiocmget (tty, file)
  *
- *    
+ *
  *
  */
 int ircomm_tty_tiocmget(struct tty_struct *tty, struct file *file)
@@ -217,12 +217,12 @@ int ircomm_tty_tiocmget(struct tty_struct *tty, struct file *file)
 /*
  * Function ircomm_tty_tiocmset (tty, file, set, clear)
  *
- *    
+ *
  *
  */
 int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file,
                        unsigned int set, unsigned int clear)
-{ 
+{
        struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
 
        IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
@@ -249,21 +249,21 @@ int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file,
                self->settings.dte |= IRCOMM_DELTA_DTR;
 
        ircomm_param_request(self, IRCOMM_DTE, TRUE);
-       
+
        return 0;
 }
 
 /*
  * Function get_serial_info (driver, retinfo)
  *
- *    
+ *
  *
  */
 static int ircomm_tty_get_serial_info(struct ircomm_tty_cb *self,
                                      struct serial_struct __user *retinfo)
 {
        struct serial_struct info;
-   
+
        if (!retinfo)
                return -EFAULT;
 
@@ -277,11 +277,11 @@ static int ircomm_tty_get_serial_info(struct ircomm_tty_cb *self,
        info.closing_wait = self->closing_wait;
 
        /* For compatibility  */
-       info.type = PORT_16550A;
-       info.port = 0;
-       info.irq = 0;
+       info.type = PORT_16550A;
+       info.port = 0;
+       info.irq = 0;
        info.xmit_fifo_size = 0;
-       info.hub6 = 0;   
+       info.hub6 = 0;
        info.custom_divisor = 0;
 
        if (copy_to_user(retinfo, &info, sizeof(*retinfo)))
@@ -293,7 +293,7 @@ static int ircomm_tty_get_serial_info(struct ircomm_tty_cb *self,
 /*
  * Function set_serial_info (driver, new_info)
  *
- *    
+ *
  *
  */
 static int ircomm_tty_set_serial_info(struct ircomm_tty_cb *self,
@@ -311,7 +311,7 @@ static int ircomm_tty_set_serial_info(struct ircomm_tty_cb *self,
 
        state = self
        old_state = *self;
-  
+
        if (!capable(CAP_SYS_ADMIN)) {
                if ((new_serial.baud_base != state->settings.data_rate) ||
                    (new_serial.close_delay != state->close_delay) ||
@@ -368,10 +368,10 @@ static int ircomm_tty_set_serial_info(struct ircomm_tty_cb *self,
 /*
  * Function ircomm_tty_ioctl (tty, file, cmd, arg)
  *
- *    
+ *
  *
  */
-int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, 
+int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file,
                     unsigned int cmd, unsigned long arg)
 {
        struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
@@ -416,7 +416,7 @@ int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file,
                    put_user(cnow.brk, &p_cuser->brk) ||
                    put_user(cnow.buf_overrun, &p_cuser->buf_overrun))
                        return -EFAULT;
-#endif         
+#endif
                return 0;
        default:
                ret = -ENOIOCTLCMD;  /* ioctls which we must ignore */