X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fn_hdlc.c;h=9f54733f16236e9e5618c91967d1d1434ef824ef;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=b3dbff1cf967b504fd8048d110c1dd2927692038;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c index b3dbff1cf..9f54733f1 100644 --- a/drivers/char/n_hdlc.c +++ b/drivers/char/n_hdlc.c @@ -191,7 +191,6 @@ static unsigned int n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp, poll_table *wait); static int n_hdlc_tty_open(struct tty_struct *tty); static void n_hdlc_tty_close(struct tty_struct *tty); -static int n_hdlc_tty_room(struct tty_struct *tty); static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *cp, char *fp, int count); static void n_hdlc_tty_wakeup(struct tty_struct *tty); @@ -212,7 +211,6 @@ static struct tty_ldisc n_hdlc_ldisc = { .ioctl = n_hdlc_tty_ioctl, .poll = n_hdlc_tty_poll, .receive_buf = n_hdlc_tty_receive, - .receive_room = n_hdlc_tty_room, .write_wakeup = n_hdlc_tty_wakeup, }; @@ -264,8 +262,7 @@ static void n_hdlc_release(struct n_hdlc *n_hdlc) } else break; } - if (n_hdlc->tbuf) - kfree(n_hdlc->tbuf); + kfree(n_hdlc->tbuf); kfree(n_hdlc); } /* end of n_hdlc_release() */ @@ -338,6 +335,7 @@ static int n_hdlc_tty_open (struct tty_struct *tty) tty->disc_data = n_hdlc; n_hdlc->tty = tty; + tty->receive_room = 65536; #if defined(TTY_NO_WRITE_SPLIT) /* change tty_io write() to not split large writes into 8K chunks */ @@ -478,22 +476,6 @@ static void n_hdlc_tty_wakeup(struct tty_struct *tty) } /* end of n_hdlc_tty_wakeup() */ -/** - * n_hdlc_tty_room - Return the amount of space left in the receiver's buffer - * @tty - pointer to associated tty instance data - * - * Callback function from tty driver. Return the amount of space left in the - * receiver's buffer to decide if remote transmitter is to be throttled. - */ -static int n_hdlc_tty_room(struct tty_struct *tty) -{ - if (debuglevel >= DEBUG_LEVEL_INFO) - printk("%s(%d)n_hdlc_tty_room() called\n",__FILE__,__LINE__); - /* always return a larger number to prevent */ - /* throttling of remote transmitter. */ - return 65536; -} /* end of n_hdlc_tty_root() */ - /** * n_hdlc_tty_receive - Called by tty driver when receive data is available * @tty - pointer to tty instance data @@ -563,7 +545,7 @@ static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data, } /* end of n_hdlc_tty_receive() */ /** - * n_hdlc_tty_read - Called to retreive one frame of data (if available) + * n_hdlc_tty_read - Called to retrieve one frame of data (if available) * @tty - pointer to tty instance data * @file - pointer to open file object * @buf - pointer to returned data buffer @@ -960,7 +942,7 @@ static char hdlc_unregister_fail[] __exitdata = static void __exit n_hdlc_exit(void) { /* Release tty registration of line discipline */ - int status = tty_register_ldisc(N_HDLC, NULL); + int status = tty_unregister_ldisc(N_HDLC); if (status) printk(hdlc_unregister_fail, status);