[PATCH] tty: switch to ktermios
[safe/jmp/linux-2.6] / drivers / char / n_r3964.c
index 853c98c..103d338 100644 (file)
@@ -142,12 +142,11 @@ static ssize_t r3964_write(struct tty_struct * tty, struct file * file,
                       const unsigned char * buf, size_t nr);
 static int r3964_ioctl(struct tty_struct * tty, struct file * file,
                        unsigned int cmd, unsigned long arg);
-static void r3964_set_termios(struct tty_struct *tty, struct termios * old);
+static void r3964_set_termios(struct tty_struct *tty, struct ktermios * old);
 static unsigned int r3964_poll(struct tty_struct * tty, struct file * file,
                      struct poll_table_struct  *wait);
 static void r3964_receive_buf(struct tty_struct *tty, const unsigned char *cp,
                               char *fp, int count);
-static int  r3964_receive_room(struct tty_struct *tty);
 
 static struct tty_ldisc tty_ldisc_N_R3964 = {
        .owner   = THIS_MODULE,
@@ -161,7 +160,6 @@ static struct tty_ldisc tty_ldisc_N_R3964 = {
        .set_termios = r3964_set_termios,
        .poll   = r3964_poll,            
        .receive_buf = r3964_receive_buf,
-       .receive_room = r3964_receive_room,
 };
 
 
@@ -953,7 +951,8 @@ static void add_msg(struct r3964_client_info *pClient, int msg_id, int arg,
    {
 queue_the_message:
 
-      pMsg = kmalloc(sizeof(struct r3964_message), GFP_KERNEL);
+      pMsg = kmalloc(sizeof(struct r3964_message),
+                    error_code?GFP_ATOMIC:GFP_KERNEL);
       TRACE_M("add_msg - kmalloc %p",pMsg);
       if(pMsg==NULL) {
          return;
@@ -1119,6 +1118,7 @@ static int r3964_open(struct tty_struct *tty)
    pInfo->nRetry = 0;
    
    tty->disc_data = pInfo;
+   tty->receive_room = 65536;
 
    init_timer(&pInfo->tmr);
    pInfo->tmr.data = (unsigned long)pInfo;
@@ -1347,7 +1347,7 @@ static int r3964_ioctl(struct tty_struct * tty, struct file * file,
    }
 }
 
-static void r3964_set_termios(struct tty_struct *tty, struct termios * old)
+static void r3964_set_termios(struct tty_struct *tty, struct ktermios * old)
 {
    TRACE_L("set_termios");
 }
@@ -1405,12 +1405,5 @@ static void r3964_receive_buf(struct tty_struct *tty, const unsigned char *cp,
     }
 }
 
-static int r3964_receive_room(struct tty_struct *tty)
-{
-   TRACE_L("receive_room");
-   return -1;
-}
-
-
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_LDISC(N_R3964);