X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Fppp_synctty.c;h=d2fa2db1358633771439013546758654444c6a00;hb=276e79ee6b3ff670dc9c041178da4b61af456a27;hp=0d80fa54671963a002540d29eefdcaf042c7aa8d;hpb=0ba6c33bcddc64a54b5f1c25a696c4767dc76292;p=linux-2.6-omap-h63xx.git diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c index 0d80fa54671..d2fa2db1358 100644 --- a/drivers/net/ppp_synctty.c +++ b/drivers/net/ppp_synctty.c @@ -206,6 +206,10 @@ ppp_sync_open(struct tty_struct *tty) { struct syncppp *ap; int err; + int speed; + + if (tty->ops->write == NULL) + return -EOPNOTSUPP; ap = kzalloc(sizeof(*ap), GFP_KERNEL); err = -ENOMEM; @@ -231,6 +235,8 @@ ppp_sync_open(struct tty_struct *tty) ap->chan.ops = &sync_ops; ap->chan.mtu = PPP_MRU; ap->chan.hdrlen = 2; /* for A/C bytes */ + speed = tty_get_baud_rate(tty); + ap->chan.speed = speed; err = ppp_register_channel(&ap->chan); if (err) goto out_free; @@ -278,8 +284,7 @@ ppp_sync_close(struct tty_struct *tty) ppp_unregister_channel(&ap->chan); skb_queue_purge(&ap->rqueue); - if (ap->tpkt) - kfree_skb(ap->tpkt); + kfree_skb(ap->tpkt); kfree(ap); } @@ -330,9 +335,6 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file, err = -EFAULT; switch (cmd) { case PPPIOCGCHAN: - err = -ENXIO; - if (!ap) - break; err = -EFAULT; if (put_user(ppp_channel_index(&ap->chan), p)) break; @@ -340,9 +342,6 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file, break; case PPPIOCGUNIT: - err = -ENXIO; - if (!ap) - break; err = -EFAULT; if (put_user(ppp_unit_number(&ap->chan), p)) break; @@ -398,9 +397,7 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf, if (!skb_queue_empty(&ap->rqueue)) tasklet_schedule(&ap->tsk); sp_put(ap); - if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) - && tty->driver->unthrottle) - tty->driver->unthrottle(tty); + tty_unthrottle(tty); } static void @@ -417,7 +414,7 @@ ppp_sync_wakeup(struct tty_struct *tty) } -static struct tty_ldisc ppp_sync_ldisc = { +static struct tty_ldisc_ops ppp_sync_ldisc = { .owner = THIS_MODULE, .magic = TTY_LDISC_MAGIC, .name = "pppsync", @@ -653,7 +650,7 @@ ppp_sync_push(struct syncppp *ap) tty_stuffed = 0; if (!tty_stuffed && ap->tpkt) { set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - sent = tty->driver->write(tty, ap->tpkt->data, ap->tpkt->len); + sent = tty->ops->write(tty, ap->tpkt->data, ap->tpkt->len); if (sent < 0) goto flush; /* error, e.g. loss of CD */ if (sent < ap->tpkt->len) {