n_hdlc 166 drivers/tty/n_hdlc.c static struct n_hdlc *n_hdlc_alloc (void); n_hdlc 193 drivers/tty/n_hdlc.c #define tty2n_hdlc(tty) ((struct n_hdlc *) ((tty)->disc_data)) n_hdlc 194 drivers/tty/n_hdlc.c #define n_hdlc2tty(n_hdlc) ((n_hdlc)->tty) n_hdlc 198 drivers/tty/n_hdlc.c struct n_hdlc *n_hdlc = tty2n_hdlc(tty); n_hdlc 201 drivers/tty/n_hdlc.c while ((buf = n_hdlc_buf_get(&n_hdlc->rx_buf_list))) n_hdlc 202 drivers/tty/n_hdlc.c n_hdlc_buf_put(&n_hdlc->rx_free_buf_list, buf); n_hdlc 207 drivers/tty/n_hdlc.c struct n_hdlc *n_hdlc = tty2n_hdlc(tty); n_hdlc 210 drivers/tty/n_hdlc.c while ((buf = n_hdlc_buf_get(&n_hdlc->tx_buf_list))) n_hdlc 211 drivers/tty/n_hdlc.c n_hdlc_buf_put(&n_hdlc->tx_free_buf_list, buf); n_hdlc 233 drivers/tty/n_hdlc.c static void n_hdlc_release(struct n_hdlc *n_hdlc) n_hdlc 235 drivers/tty/n_hdlc.c struct tty_struct *tty = n_hdlc2tty (n_hdlc); n_hdlc 245 drivers/tty/n_hdlc.c if (tty->disc_data == n_hdlc) n_hdlc 250 drivers/tty/n_hdlc.c buf = n_hdlc_buf_get(&n_hdlc->rx_free_buf_list); n_hdlc 257 drivers/tty/n_hdlc.c buf = n_hdlc_buf_get(&n_hdlc->tx_free_buf_list); n_hdlc 264 drivers/tty/n_hdlc.c buf = n_hdlc_buf_get(&n_hdlc->rx_buf_list); n_hdlc 271 drivers/tty/n_hdlc.c buf = n_hdlc_buf_get(&n_hdlc->tx_buf_list); n_hdlc 277 drivers/tty/n_hdlc.c kfree(n_hdlc); n_hdlc 290 drivers/tty/n_hdlc.c struct n_hdlc *n_hdlc = tty2n_hdlc (tty); n_hdlc 295 drivers/tty/n_hdlc.c if (n_hdlc != NULL) { n_hdlc 296 drivers/tty/n_hdlc.c if (n_hdlc->magic != HDLC_MAGIC) { n_hdlc 304 drivers/tty/n_hdlc.c if (tty == n_hdlc->backup_tty) n_hdlc 305 drivers/tty/n_hdlc.c n_hdlc->backup_tty = NULL; n_hdlc 306 drivers/tty/n_hdlc.c if (tty != n_hdlc->tty) n_hdlc 308 drivers/tty/n_hdlc.c if (n_hdlc->backup_tty) { n_hdlc 309 drivers/tty/n_hdlc.c n_hdlc->tty = n_hdlc->backup_tty; n_hdlc 311 drivers/tty/n_hdlc.c n_hdlc_release (n_hdlc); n_hdlc 328 drivers/tty/n_hdlc.c struct n_hdlc *n_hdlc = tty2n_hdlc (tty); n_hdlc 336 drivers/tty/n_hdlc.c if (n_hdlc) { n_hdlc 341 drivers/tty/n_hdlc.c n_hdlc = n_hdlc_alloc(); n_hdlc 342 drivers/tty/n_hdlc.c if (!n_hdlc) { n_hdlc 347 drivers/tty/n_hdlc.c tty->disc_data = n_hdlc; n_hdlc 348 drivers/tty/n_hdlc.c n_hdlc->tty = tty; n_hdlc 375 drivers/tty/n_hdlc.c static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) n_hdlc 385 drivers/tty/n_hdlc.c spin_lock_irqsave(&n_hdlc->tx_buf_list.spinlock, flags); n_hdlc 386 drivers/tty/n_hdlc.c if (n_hdlc->tbusy) { n_hdlc 387 drivers/tty/n_hdlc.c n_hdlc->woke_up = 1; n_hdlc 388 drivers/tty/n_hdlc.c spin_unlock_irqrestore(&n_hdlc->tx_buf_list.spinlock, flags); n_hdlc 391 drivers/tty/n_hdlc.c n_hdlc->tbusy = 1; n_hdlc 392 drivers/tty/n_hdlc.c n_hdlc->woke_up = 0; n_hdlc 393 drivers/tty/n_hdlc.c spin_unlock_irqrestore(&n_hdlc->tx_buf_list.spinlock, flags); n_hdlc 395 drivers/tty/n_hdlc.c tbuf = n_hdlc_buf_get(&n_hdlc->tx_buf_list); n_hdlc 407 drivers/tty/n_hdlc.c n_hdlc_buf_return(&n_hdlc->tx_buf_list, tbuf); n_hdlc 421 drivers/tty/n_hdlc.c n_hdlc_buf_put(&n_hdlc->tx_free_buf_list, tbuf); n_hdlc 427 drivers/tty/n_hdlc.c tbuf = n_hdlc_buf_get(&n_hdlc->tx_buf_list); n_hdlc 437 drivers/tty/n_hdlc.c n_hdlc_buf_return(&n_hdlc->tx_buf_list, tbuf); n_hdlc 446 drivers/tty/n_hdlc.c spin_lock_irqsave(&n_hdlc->tx_buf_list.spinlock, flags); n_hdlc 447 drivers/tty/n_hdlc.c n_hdlc->tbusy = 0; n_hdlc 448 drivers/tty/n_hdlc.c spin_unlock_irqrestore(&n_hdlc->tx_buf_list.spinlock, flags); n_hdlc 450 drivers/tty/n_hdlc.c if (n_hdlc->woke_up) n_hdlc 466 drivers/tty/n_hdlc.c struct n_hdlc *n_hdlc = tty2n_hdlc(tty); n_hdlc 471 drivers/tty/n_hdlc.c if (!n_hdlc) n_hdlc 474 drivers/tty/n_hdlc.c if (tty != n_hdlc->tty) { n_hdlc 479 drivers/tty/n_hdlc.c n_hdlc_send_frames (n_hdlc, tty); n_hdlc 496 drivers/tty/n_hdlc.c register struct n_hdlc *n_hdlc = tty2n_hdlc (tty); n_hdlc 504 drivers/tty/n_hdlc.c if (!n_hdlc || tty != n_hdlc->tty) n_hdlc 508 drivers/tty/n_hdlc.c if (n_hdlc->magic != HDLC_MAGIC) { n_hdlc 522 drivers/tty/n_hdlc.c buf = n_hdlc_buf_get(&n_hdlc->rx_free_buf_list); n_hdlc 526 drivers/tty/n_hdlc.c if (n_hdlc->rx_buf_list.count < MAX_RX_BUF_COUNT) n_hdlc 542 drivers/tty/n_hdlc.c n_hdlc_buf_put(&n_hdlc->rx_buf_list, buf); n_hdlc 546 drivers/tty/n_hdlc.c if (n_hdlc->tty->fasync != NULL) n_hdlc 547 drivers/tty/n_hdlc.c kill_fasync (&n_hdlc->tty->fasync, SIGIO, POLL_IN); n_hdlc 563 drivers/tty/n_hdlc.c struct n_hdlc *n_hdlc = tty2n_hdlc(tty); n_hdlc 572 drivers/tty/n_hdlc.c if (!n_hdlc) n_hdlc 594 drivers/tty/n_hdlc.c rbuf = n_hdlc_buf_get(&n_hdlc->rx_buf_list); n_hdlc 607 drivers/tty/n_hdlc.c if (n_hdlc->rx_free_buf_list.count > n_hdlc 611 drivers/tty/n_hdlc.c n_hdlc_buf_put(&n_hdlc->rx_free_buf_list, rbuf); n_hdlc 648 drivers/tty/n_hdlc.c struct n_hdlc *n_hdlc = tty2n_hdlc (tty); n_hdlc 658 drivers/tty/n_hdlc.c if (!n_hdlc) n_hdlc 661 drivers/tty/n_hdlc.c if (n_hdlc->magic != HDLC_MAGIC) n_hdlc 679 drivers/tty/n_hdlc.c tbuf = n_hdlc_buf_get(&n_hdlc->tx_free_buf_list); n_hdlc 689 drivers/tty/n_hdlc.c n_hdlc = tty2n_hdlc (tty); n_hdlc 690 drivers/tty/n_hdlc.c if (!n_hdlc || n_hdlc->magic != HDLC_MAGIC || n_hdlc 691 drivers/tty/n_hdlc.c tty != n_hdlc->tty) { n_hdlc 692 drivers/tty/n_hdlc.c printk("n_hdlc_tty_write: %p invalid after wait!\n", n_hdlc); n_hdlc 712 drivers/tty/n_hdlc.c n_hdlc_buf_put(&n_hdlc->tx_buf_list,tbuf); n_hdlc 713 drivers/tty/n_hdlc.c n_hdlc_send_frames(n_hdlc,tty); n_hdlc 732 drivers/tty/n_hdlc.c struct n_hdlc *n_hdlc = tty2n_hdlc (tty); n_hdlc 743 drivers/tty/n_hdlc.c if (!n_hdlc || n_hdlc->magic != HDLC_MAGIC) n_hdlc 750 drivers/tty/n_hdlc.c spin_lock_irqsave(&n_hdlc->rx_buf_list.spinlock,flags); n_hdlc 751 drivers/tty/n_hdlc.c buf = list_first_entry_or_null(&n_hdlc->rx_buf_list.list, n_hdlc 757 drivers/tty/n_hdlc.c spin_unlock_irqrestore(&n_hdlc->rx_buf_list.spinlock,flags); n_hdlc 765 drivers/tty/n_hdlc.c spin_lock_irqsave(&n_hdlc->tx_buf_list.spinlock,flags); n_hdlc 766 drivers/tty/n_hdlc.c buf = list_first_entry_or_null(&n_hdlc->tx_buf_list.list, n_hdlc 770 drivers/tty/n_hdlc.c spin_unlock_irqrestore(&n_hdlc->tx_buf_list.spinlock,flags); n_hdlc 803 drivers/tty/n_hdlc.c struct n_hdlc *n_hdlc = tty2n_hdlc (tty); n_hdlc 809 drivers/tty/n_hdlc.c if (n_hdlc && n_hdlc->magic == HDLC_MAGIC && tty == n_hdlc->tty) { n_hdlc 817 drivers/tty/n_hdlc.c if (!list_empty(&n_hdlc->rx_buf_list.list)) n_hdlc 824 drivers/tty/n_hdlc.c !list_empty(&n_hdlc->tx_free_buf_list.list)) n_hdlc 835 drivers/tty/n_hdlc.c static struct n_hdlc *n_hdlc_alloc(void) n_hdlc 839 drivers/tty/n_hdlc.c struct n_hdlc *n_hdlc = kzalloc(sizeof(*n_hdlc), GFP_KERNEL); n_hdlc 841 drivers/tty/n_hdlc.c if (!n_hdlc) n_hdlc 844 drivers/tty/n_hdlc.c spin_lock_init(&n_hdlc->rx_free_buf_list.spinlock); n_hdlc 845 drivers/tty/n_hdlc.c spin_lock_init(&n_hdlc->tx_free_buf_list.spinlock); n_hdlc 846 drivers/tty/n_hdlc.c spin_lock_init(&n_hdlc->rx_buf_list.spinlock); n_hdlc 847 drivers/tty/n_hdlc.c spin_lock_init(&n_hdlc->tx_buf_list.spinlock); n_hdlc 849 drivers/tty/n_hdlc.c INIT_LIST_HEAD(&n_hdlc->rx_free_buf_list.list); n_hdlc 850 drivers/tty/n_hdlc.c INIT_LIST_HEAD(&n_hdlc->tx_free_buf_list.list); n_hdlc 851 drivers/tty/n_hdlc.c INIT_LIST_HEAD(&n_hdlc->rx_buf_list.list); n_hdlc 852 drivers/tty/n_hdlc.c INIT_LIST_HEAD(&n_hdlc->tx_buf_list.list); n_hdlc 858 drivers/tty/n_hdlc.c n_hdlc_buf_put(&n_hdlc->rx_free_buf_list,buf); n_hdlc 867 drivers/tty/n_hdlc.c n_hdlc_buf_put(&n_hdlc->tx_free_buf_list,buf); n_hdlc 873 drivers/tty/n_hdlc.c n_hdlc->magic = HDLC_MAGIC; n_hdlc 874 drivers/tty/n_hdlc.c n_hdlc->flags = 0; n_hdlc 876 drivers/tty/n_hdlc.c return n_hdlc;