tag | line | file | source code |
ppp | 79 | drivers/net/ppp.c | #define CHECK_PPP(a) if (!ppp->inuse) { PRINTK ((ppp_warning, __LINE__)) return a;} |
ppp | 80 | drivers/net/ppp.c | #define CHECK_PPP_VOID() if (!ppp->inuse) { PRINTK ((ppp_warning, __LINE__)) return;} |
ppp | 82 | drivers/net/ppp.c | #define in_xmap(ppp,c) (ppp->xmit_async_map[(c) >> 5] & (1 << ((c) & 0x1f))) |
ppp | 83 | drivers/net/ppp.c | #define in_rmap(ppp,c) ((((unsigned int) (unsigned char) (c)) < 0x20) && \ |
ppp | 84 | drivers/net/ppp.c | ppp->recv_async_map & (1 << (c))) |
ppp | 95 | drivers/net/ppp.c | static void ppp_init_ctrl_blk(struct ppp *); |
ppp | 99 | drivers/net/ppp.c | static void ppp_kick_tty(struct ppp *); |
ppp | 102 | drivers/net/ppp.c | #define ppp_find(tty) ((struct ppp *) tty->disc_data) |
ppp | 105 | drivers/net/ppp.c | static void ppp_unesc(struct ppp *ppp, unsigned char *c, int n); |
ppp | 106 | drivers/net/ppp.c | static struct ppp *ppp_find(struct tty_struct *); |
ppp | 109 | drivers/net/ppp.c | static void ppp_doframe(struct ppp *); |
ppp | 110 | drivers/net/ppp.c | static int ppp_do_ip(struct ppp *, unsigned short, unsigned char *, int); |
ppp | 111 | drivers/net/ppp.c | static int ppp_us_queue(struct ppp *, unsigned short, unsigned char *, int); |
ppp | 130 | drivers/net/ppp.c | static struct ppp *ppp_alloc(void); |
ppp | 131 | drivers/net/ppp.c | static int ppp_lock(struct ppp *); |
ppp | 132 | drivers/net/ppp.c | static void ppp_unlock(struct ppp *); |
ppp | 133 | drivers/net/ppp.c | static void ppp_add_fcs(struct ppp *); |
ppp | 134 | drivers/net/ppp.c | static int ppp_check_fcs(struct ppp *); |
ppp | 196 | drivers/net/ppp.c | static struct ppp ppp_ctrl[PPP_NRUNIT]; |
ppp | 209 | drivers/net/ppp.c | struct ppp *ppp; |
ppp | 212 | drivers/net/ppp.c | ppp = &ppp_ctrl[dev->base_addr]; |
ppp | 257 | drivers/net/ppp.c | ppp_init_ctrl_blk (ppp); |
ppp | 258 | drivers/net/ppp.c | ppp->inuse = 0; |
ppp | 259 | drivers/net/ppp.c | ppp->line = dev->base_addr; |
ppp | 260 | drivers/net/ppp.c | ppp->tty = NULL; |
ppp | 261 | drivers/net/ppp.c | ppp->dev = dev; |
ppp | 264 | drivers/net/ppp.c | memset (&ppp->stats, '\0', sizeof (struct ppp_stats)); |
ppp | 301 | drivers/net/ppp.c | ppp_init_ctrl_blk(struct ppp *ppp) |
ppp | 303 | drivers/net/ppp.c | ppp->magic = PPP_MAGIC; |
ppp | 304 | drivers/net/ppp.c | ppp->sending = 0; |
ppp | 305 | drivers/net/ppp.c | ppp->toss = 0xFE; |
ppp | 306 | drivers/net/ppp.c | ppp->escape = 0; |
ppp | 308 | drivers/net/ppp.c | ppp->flags = 0; |
ppp | 309 | drivers/net/ppp.c | ppp->mtu = PPP_MTU; |
ppp | 310 | drivers/net/ppp.c | ppp->mru = PPP_MRU; |
ppp | 311 | drivers/net/ppp.c | ppp->fcs = 0; |
ppp | 313 | drivers/net/ppp.c | memset (ppp->xmit_async_map, 0, sizeof (ppp->xmit_async_map)); |
ppp | 314 | drivers/net/ppp.c | ppp->xmit_async_map[0] = 0xffffffff; |
ppp | 315 | drivers/net/ppp.c | ppp->xmit_async_map[3] = 0x60000000; |
ppp | 316 | drivers/net/ppp.c | ppp->recv_async_map = 0x00000000; |
ppp | 318 | drivers/net/ppp.c | ppp->slcomp = NULL; |
ppp | 319 | drivers/net/ppp.c | ppp->rbuff = NULL; |
ppp | 320 | drivers/net/ppp.c | ppp->xbuff = NULL; |
ppp | 321 | drivers/net/ppp.c | ppp->cbuff = NULL; |
ppp | 323 | drivers/net/ppp.c | ppp->rhead = NULL; |
ppp | 324 | drivers/net/ppp.c | ppp->rend = NULL; |
ppp | 325 | drivers/net/ppp.c | ppp->rcount = 0; |
ppp | 326 | drivers/net/ppp.c | ppp->xhead = NULL; |
ppp | 327 | drivers/net/ppp.c | ppp->xtail = NULL; |
ppp | 329 | drivers/net/ppp.c | ppp->us_rbuff = NULL; |
ppp | 330 | drivers/net/ppp.c | ppp->us_rbuff_end = NULL; |
ppp | 331 | drivers/net/ppp.c | ppp->us_rbuff_head = NULL; |
ppp | 332 | drivers/net/ppp.c | ppp->us_rbuff_tail = NULL; |
ppp | 333 | drivers/net/ppp.c | ppp->read_wait = NULL; |
ppp | 334 | drivers/net/ppp.c | ppp->write_wait = NULL; |
ppp | 335 | drivers/net/ppp.c | ppp->us_rbuff_lock = 0; |
ppp | 336 | drivers/net/ppp.c | ppp->inp_sig = 0; |
ppp | 337 | drivers/net/ppp.c | ppp->inp_sig_pid = 0; |
ppp | 340 | drivers/net/ppp.c | ppp->last_xmit = jiffies - OPTIMIZE_FLAG_TIME; |
ppp | 342 | drivers/net/ppp.c | ppp->last_xmit = 0; |
ppp | 346 | drivers/net/ppp.c | memset (&ppp->stats, '\0', sizeof (struct ppp_stats)); |
ppp | 349 | drivers/net/ppp.c | ppp->ddinfo.ip_sjiffies = |
ppp | 350 | drivers/net/ppp.c | ppp->ddinfo.ip_rjiffies = |
ppp | 351 | drivers/net/ppp.c | ppp->ddinfo.nip_sjiffies = |
ppp | 352 | drivers/net/ppp.c | ppp->ddinfo.nip_rjiffies = jiffies; |
ppp | 362 | drivers/net/ppp.c | ppp_changedmtu (struct ppp *ppp, int new_mtu, int new_mru) |
ppp | 371 | drivers/net/ppp.c | dev = ppp->dev; |
ppp | 412 | drivers/net/ppp.c | old_xbuff = ppp->xbuff; |
ppp | 413 | drivers/net/ppp.c | old_rbuff = ppp->rbuff; |
ppp | 414 | drivers/net/ppp.c | old_cbuff = ppp->cbuff; |
ppp | 416 | drivers/net/ppp.c | ppp->xbuff = new_xbuff; |
ppp | 417 | drivers/net/ppp.c | ppp->rbuff = new_rbuff; |
ppp | 418 | drivers/net/ppp.c | ppp->cbuff = new_cbuff; |
ppp | 424 | drivers/net/ppp.c | ppp->rend = (unsigned char *) |
ppp | 427 | drivers/net/ppp.c | ppp->rhead = new_rbuff; |
ppp | 431 | drivers/net/ppp.c | ppp->toss = 0xFE; |
ppp | 432 | drivers/net/ppp.c | ppp->escape = 0; |
ppp | 433 | drivers/net/ppp.c | ppp->sending = 0; |
ppp | 434 | drivers/net/ppp.c | ppp->rcount = 0; |
ppp | 436 | drivers/net/ppp.c | ppp->mru = new_mru; |
ppp | 438 | drivers/net/ppp.c | ppp->mtu = |
ppp | 459 | drivers/net/ppp.c | ppp_release(struct ppp *ppp) |
ppp | 462 | drivers/net/ppp.c | if (ppp->tty != NULL && ppp->tty->disc_data == ppp) |
ppp | 463 | drivers/net/ppp.c | ppp->tty->disc_data = NULL; /* Break the tty->ppp link */ |
ppp | 466 | drivers/net/ppp.c | if (ppp->dev) { |
ppp | 467 | drivers/net/ppp.c | ppp->dev->flags &= ~IFF_UP; /* down the device */ |
ppp | 468 | drivers/net/ppp.c | ppp->dev->flags |= IFF_POINTOPOINT; |
ppp | 471 | drivers/net/ppp.c | kfree (ppp->xbuff); |
ppp | 472 | drivers/net/ppp.c | kfree (ppp->cbuff); |
ppp | 473 | drivers/net/ppp.c | kfree (ppp->rbuff); |
ppp | 474 | drivers/net/ppp.c | kfree (ppp->us_rbuff); |
ppp | 476 | drivers/net/ppp.c | ppp->xbuff = |
ppp | 477 | drivers/net/ppp.c | ppp->cbuff = |
ppp | 478 | drivers/net/ppp.c | ppp->rbuff = |
ppp | 479 | drivers/net/ppp.c | ppp->us_rbuff = NULL; |
ppp | 481 | drivers/net/ppp.c | if (ppp->slcomp) { |
ppp | 482 | drivers/net/ppp.c | slhc_free(ppp->slcomp); |
ppp | 483 | drivers/net/ppp.c | ppp->slcomp = NULL; |
ppp | 486 | drivers/net/ppp.c | ppp->inuse = 0; |
ppp | 487 | drivers/net/ppp.c | ppp->tty = NULL; |
ppp | 493 | drivers/net/ppp.c | struct ppp *ppp = ppp_find(tty); |
ppp | 495 | drivers/net/ppp.c | if (ppp == NULL || ppp->magic != PPP_MAGIC) { |
ppp | 499 | drivers/net/ppp.c | ppp_release (ppp); |
ppp | 501 | drivers/net/ppp.c | PRINTKN (2,(KERN_INFO "ppp: channel %s closing.\n", ppp->dev->name)); |
ppp | 509 | drivers/net/ppp.c | struct ppp *ppp = ppp_find(tty); |
ppp | 511 | drivers/net/ppp.c | if (ppp) { |
ppp | 513 | drivers/net/ppp.c | ppp->magic == PPP_MAGIC ? ppp->dev->name : "unknown")); |
ppp | 517 | drivers/net/ppp.c | ppp = ppp_alloc(); |
ppp | 518 | drivers/net/ppp.c | if (ppp == NULL) { |
ppp | 524 | drivers/net/ppp.c | ppp_init_ctrl_blk (ppp); |
ppp | 526 | drivers/net/ppp.c | ppp->tty = tty; |
ppp | 529 | drivers/net/ppp.c | tty->disc_data = ppp; |
ppp | 539 | drivers/net/ppp.c | if ((ppp->slcomp = slhc_init(16, 16)) == NULL) { |
ppp | 541 | drivers/net/ppp.c | ppp_release (ppp); |
ppp | 546 | drivers/net/ppp.c | ppp_changedmtu (ppp, ppp->dev->mtu, ppp->mru); |
ppp | 547 | drivers/net/ppp.c | if (ppp->rbuff == NULL) { |
ppp | 548 | drivers/net/ppp.c | ppp_release (ppp); |
ppp | 553 | drivers/net/ppp.c | ppp->us_rbuff = (unsigned char *) kmalloc (RBUFSIZE, GFP_KERNEL); |
ppp | 554 | drivers/net/ppp.c | if (ppp->us_rbuff == NULL) { |
ppp | 556 | drivers/net/ppp.c | ppp_release (ppp); |
ppp | 560 | drivers/net/ppp.c | ppp->us_rbuff_head = |
ppp | 561 | drivers/net/ppp.c | ppp->us_rbuff_tail = ppp->us_rbuff; |
ppp | 562 | drivers/net/ppp.c | ppp->us_rbuff_end = ppp->us_rbuff + RBUFSIZE; |
ppp | 564 | drivers/net/ppp.c | PRINTKN (2,(KERN_INFO "ppp: channel %s open\n", ppp->dev->name)); |
ppp | 566 | drivers/net/ppp.c | return (ppp->line); |
ppp | 574 | drivers/net/ppp.c | struct ppp *ppp = &ppp_ctrl[dev->base_addr]; |
ppp | 579 | drivers/net/ppp.c | if (ppp->tty == NULL) { |
ppp | 595 | drivers/net/ppp.c | struct ppp *ppp = &ppp_ctrl[dev->base_addr]; |
ppp | 597 | drivers/net/ppp.c | if (ppp->tty == NULL) { |
ppp | 612 | drivers/net/ppp.c | struct ppp *ppp = &ppp_ctrl[dev->base_addr]; |
ppp | 628 | drivers/net/ppp.c | memcpy_tofs (&result->ppp_stats, &ppp->stats, sizeof (struct ppp_stats)); |
ppp | 629 | drivers/net/ppp.c | if (ppp->slcomp) |
ppp | 630 | drivers/net/ppp.c | memcpy_tofs (&result->slhc, ppp->slcomp, sizeof (struct slcompress)); |
ppp | 648 | drivers/net/ppp.c | ppp_output_done (void *ppp) |
ppp | 651 | drivers/net/ppp.c | ppp_unlock ((struct ppp *) ppp); |
ppp | 655 | drivers/net/ppp.c | if (((struct ppp *) ppp)->dev->flags & IFF_UP) |
ppp | 659 | drivers/net/ppp.c | dev_tint (((struct ppp *) ppp)->dev); |
ppp | 663 | drivers/net/ppp.c | wake_up_interruptible (&((struct ppp *) ppp)->write_wait); |
ppp | 668 | drivers/net/ppp.c | ppp_kick_tty (struct ppp *ppp) |
ppp | 670 | drivers/net/ppp.c | register int count = ppp->xhead - ppp->xbuff; |
ppp | 673 | drivers/net/ppp.c | ppp->stats.sbytes += count; |
ppp | 675 | drivers/net/ppp.c | answer = tty_write_data (ppp->tty, |
ppp | 676 | drivers/net/ppp.c | ppp->xbuff, |
ppp | 679 | drivers/net/ppp.c | (void *) ppp); |
ppp | 682 | drivers/net/ppp.c | ppp_output_done (ppp); /* Should not happen */ |
ppp | 685 | drivers/net/ppp.c | ppp->stats.serrors++; |
ppp | 686 | drivers/net/ppp.c | ppp_output_done (ppp); /* unlock the transmitter */ |
ppp | 693 | drivers/net/ppp.c | ppp_kick_tty (struct ppp *ppp) |
ppp | 697 | drivers/net/ppp.c | count = ppp->xhead - ppp->xbuff; |
ppp | 699 | drivers/net/ppp.c | actual = ppp->tty->driver.write(ppp->tty, 0, ppp->xbuff, count); |
ppp | 700 | drivers/net/ppp.c | ppp->stats.sbytes += actual; |
ppp | 702 | drivers/net/ppp.c | ppp_output_done(ppp); |
ppp | 704 | drivers/net/ppp.c | ppp->xtail = ppp->xbuff + actual; |
ppp | 705 | drivers/net/ppp.c | ppp->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); |
ppp | 712 | drivers/net/ppp.c | struct ppp *ppp = ppp_find(tty); |
ppp | 714 | drivers/net/ppp.c | if (!ppp || ppp->magic != PPP_MAGIC) { |
ppp | 721 | drivers/net/ppp.c | if (!ppp->xtail) |
ppp | 725 | drivers/net/ppp.c | if (ppp->flags & SC_XMIT_BUSY) { |
ppp | 729 | drivers/net/ppp.c | ppp->flags |= SC_XMIT_BUSY; |
ppp | 732 | drivers/net/ppp.c | count = ppp->xhead - ppp->xtail; |
ppp | 734 | drivers/net/ppp.c | actual = tty->driver.write(tty, 0, ppp->xtail, count); |
ppp | 735 | drivers/net/ppp.c | ppp->stats.sbytes += actual; |
ppp | 737 | drivers/net/ppp.c | ppp->xtail = 0; |
ppp | 740 | drivers/net/ppp.c | ppp_output_done(ppp); |
ppp | 742 | drivers/net/ppp.c | ppp->xtail += actual; |
ppp | 744 | drivers/net/ppp.c | ppp->flags &= ~SC_XMIT_BUSY; |
ppp | 759 | drivers/net/ppp.c | ppp_enqueue(struct ppp *ppp, unsigned char c) |
ppp | 765 | drivers/net/ppp.c | if (ppp->rhead < ppp->rend) { |
ppp | 766 | drivers/net/ppp.c | *ppp->rhead = c; |
ppp | 767 | drivers/net/ppp.c | ppp->rhead++; |
ppp | 768 | drivers/net/ppp.c | ppp->rcount++; |
ppp | 770 | drivers/net/ppp.c | ppp->stats.roverrun++; |
ppp | 812 | drivers/net/ppp.c | struct ppp *ppp = ppp_find(tty); |
ppp | 817 | drivers/net/ppp.c | if (!ppp || ppp->magic != PPP_MAGIC) { |
ppp | 827 | drivers/net/ppp.c | ppp_dump_inqueue(ppp->tty); |
ppp | 843 | drivers/net/ppp.c | ppp->stats.rbytes += n; |
ppp | 844 | drivers/net/ppp.c | ppp_unesc(ppp,buff,n); |
ppp | 846 | drivers/net/ppp.c | ppp->toss = error; |
ppp | 856 | drivers/net/ppp.c | ppp_unesc(struct ppp *ppp, unsigned char *c, int n) |
ppp | 877 | drivers/net/ppp.c | ppp->escape = PPP_TRANS; |
ppp | 881 | drivers/net/ppp.c | if (ppp->escape) /* PPP_ESC just before PPP_FLAG is illegal */ |
ppp | 882 | drivers/net/ppp.c | ppp->toss = 0xFF; |
ppp | 884 | drivers/net/ppp.c | if ((ppp->toss & 0x80) == 0) |
ppp | 885 | drivers/net/ppp.c | ppp_doframe(ppp); /* pass frame on to next layers */ |
ppp | 887 | drivers/net/ppp.c | ppp->rcount = 0; |
ppp | 888 | drivers/net/ppp.c | ppp->rhead = ppp->rbuff; |
ppp | 889 | drivers/net/ppp.c | ppp->escape = 0; |
ppp | 890 | drivers/net/ppp.c | ppp->toss = 0; |
ppp | 894 | drivers/net/ppp.c | if (!in_rmap (ppp, *c)) { |
ppp | 895 | drivers/net/ppp.c | if (ppp->toss == 0) |
ppp | 896 | drivers/net/ppp.c | ppp_enqueue (ppp, *c ^ ppp->escape); |
ppp | 897 | drivers/net/ppp.c | ppp->escape = 0; |
ppp | 914 | drivers/net/ppp.c | register struct ppp *ppp = ppp_find (tty); |
ppp | 919 | drivers/net/ppp.c | if (!ppp || ppp->magic != PPP_MAGIC) { |
ppp | 931 | drivers/net/ppp.c | ppp->stats.rbytes += count; |
ppp | 937 | drivers/net/ppp.c | if (*fp && ppp->toss == 0) |
ppp | 938 | drivers/net/ppp.c | ppp->toss = *fp; |
ppp | 956 | drivers/net/ppp.c | ppp->escape = PPP_TRANS; |
ppp | 960 | drivers/net/ppp.c | if (ppp->escape) /* PPP_ESC just before PPP_FLAG is "cancel"*/ |
ppp | 961 | drivers/net/ppp.c | ppp->toss = 0xFF; |
ppp | 963 | drivers/net/ppp.c | if ((ppp->toss & 0x80) == 0) |
ppp | 964 | drivers/net/ppp.c | ppp_doframe(ppp); /* pass frame on to next layers */ |
ppp | 966 | drivers/net/ppp.c | ppp->rcount = 0; |
ppp | 967 | drivers/net/ppp.c | ppp->rhead = ppp->rbuff; |
ppp | 968 | drivers/net/ppp.c | ppp->escape = 0; |
ppp | 969 | drivers/net/ppp.c | ppp->toss = 0; |
ppp | 973 | drivers/net/ppp.c | if (!in_rmap (ppp, c)) { |
ppp | 974 | drivers/net/ppp.c | if (ppp->toss == 0) |
ppp | 975 | drivers/net/ppp.c | ppp_enqueue (ppp, c ^ ppp->escape); |
ppp | 976 | drivers/net/ppp.c | ppp->escape = 0; |
ppp | 986 | drivers/net/ppp.c | ppp_doframe(struct ppp *ppp) |
ppp | 988 | drivers/net/ppp.c | u_char *c = ppp->rbuff; |
ppp | 990 | drivers/net/ppp.c | int count = ppp->rcount; |
ppp | 993 | drivers/net/ppp.c | if (ppp->toss) { |
ppp | 995 | drivers/net/ppp.c | ppp->toss)); |
ppp | 996 | drivers/net/ppp.c | ppp->stats.rerrors++; |
ppp | 1009 | drivers/net/ppp.c | ppp->stats.runts++; |
ppp | 1014 | drivers/net/ppp.c | if (!ppp_check_fcs(ppp)) { |
ppp | 1016 | drivers/net/ppp.c | ppp->stats.rerrors++; |
ppp | 1038 | drivers/net/ppp.c | if ((ppp->dev->flags & IFF_UP) && ppp_do_ip(ppp, proto, c, count)) { |
ppp | 1039 | drivers/net/ppp.c | ppp->ddinfo.ip_rjiffies = jiffies; |
ppp | 1049 | drivers/net/ppp.c | if (ppp_us_queue (ppp, proto, c, count+2)) { |
ppp | 1050 | drivers/net/ppp.c | ppp->ddinfo.nip_rjiffies = jiffies; |
ppp | 1051 | drivers/net/ppp.c | ppp->stats.rothers++; |
ppp | 1058 | drivers/net/ppp.c | ppp->stats.tossed++; |
ppp | 1066 | drivers/net/ppp.c | ppp_do_ip (struct ppp *ppp, unsigned short proto, unsigned char *c, |
ppp | 1075 | drivers/net/ppp.c | PRINTK (("KERN_DEBUG %s <-- proto %x len %d\n", ppp->dev->name, |
ppp | 1080 | drivers/net/ppp.c | ppp->stats.runcomp++; |
ppp | 1084 | drivers/net/ppp.c | if ((proto == PROTO_VJCOMP) && !(ppp->flags & SC_REJ_COMP_TCP)) { |
ppp | 1089 | drivers/net/ppp.c | if ((ppp->rhead + 80) < ppp->rend) { |
ppp | 1090 | drivers/net/ppp.c | ppp->rhead += 80; |
ppp | 1091 | drivers/net/ppp.c | ppp->rcount += 80; |
ppp | 1099 | drivers/net/ppp.c | ppp->stats.roverrun++; |
ppp | 1103 | drivers/net/ppp.c | count = slhc_uncompress(ppp->slcomp, c, count); |
ppp | 1105 | drivers/net/ppp.c | ppp->stats.rerrors++; |
ppp | 1109 | drivers/net/ppp.c | ppp->stats.rcomp++; |
ppp | 1113 | drivers/net/ppp.c | if ((proto == PROTO_VJUNCOMP) && !(ppp->flags & SC_REJ_COMP_TCP)) { |
ppp | 1114 | drivers/net/ppp.c | if (slhc_remember(ppp->slcomp, c, count) <= 0) { |
ppp | 1115 | drivers/net/ppp.c | ppp->stats.rerrors++; |
ppp | 1119 | drivers/net/ppp.c | ppp->stats.runcomp++; |
ppp | 1129 | drivers/net/ppp.c | PRINTK ((KERN_INFO "%s <-- src %lx dst %lx len %d\n", ppp->dev->name, |
ppp | 1134 | drivers/net/ppp.c | (void) dev_rint (c, count, 0, ppp->dev); |
ppp | 1141 | drivers/net/ppp.c | #define PUTC(c,label) *ppp->us_rbuff_head++ = c; \ |
ppp | 1142 | drivers/net/ppp.c | if (ppp->us_rbuff_head == ppp->us_rbuff_end) \ |
ppp | 1143 | drivers/net/ppp.c | ppp->us_rbuff_head = ppp->us_rbuff; \ |
ppp | 1144 | drivers/net/ppp.c | if (ppp->us_rbuff_head == ppp->us_rbuff_tail) \ |
ppp | 1146 | drivers/net/ppp.c | #define GETC(c) c = *ppp->us_rbuff_tail++; \ |
ppp | 1147 | drivers/net/ppp.c | if (ppp->us_rbuff_tail == ppp->us_rbuff_end) \ |
ppp | 1148 | drivers/net/ppp.c | ppp->us_rbuff_tail = ppp->us_rbuff; |
ppp | 1151 | drivers/net/ppp.c | ppp_us_queue(struct ppp *ppp, unsigned short proto, |
ppp | 1159 | drivers/net/ppp.c | if (set_bit(1, &ppp->us_rbuff_lock)) { |
ppp | 1163 | drivers/net/ppp.c | saved_head = ppp->us_rbuff_head; |
ppp | 1175 | drivers/net/ppp.c | clear_bit(1, &ppp->us_rbuff_lock); |
ppp | 1176 | drivers/net/ppp.c | wake_up_interruptible (&ppp->read_wait); |
ppp | 1179 | drivers/net/ppp.c | kill_fasync(ppp->tty->fasync, SIGIO); |
ppp | 1182 | drivers/net/ppp.c | if (ppp->inp_sig && ppp->inp_sig_pid) |
ppp | 1183 | drivers/net/ppp.c | if (kill_proc (ppp->inp_sig_pid, ppp->inp_sig, 1) != 0) { |
ppp | 1187 | drivers/net/ppp.c | ppp->inp_sig = 0; |
ppp | 1188 | drivers/net/ppp.c | ppp->inp_sig_pid = 0; |
ppp | 1193 | drivers/net/ppp.c | ppp->us_rbuff_head = saved_head; |
ppp | 1194 | drivers/net/ppp.c | clear_bit(1, &ppp->us_rbuff_lock); |
ppp | 1216 | drivers/net/ppp.c | struct ppp *ppp = ppp_find(tty); |
ppp | 1220 | drivers/net/ppp.c | if (!ppp || ppp->magic != PPP_MAGIC) { |
ppp | 1233 | drivers/net/ppp.c | if (set_bit(0, &ppp->us_rbuff_lock) == 0) { |
ppp | 1235 | drivers/net/ppp.c | if (ppp->us_rbuff_head == ppp->us_rbuff_tail) { |
ppp | 1238 | drivers/net/ppp.c | clear_bit(0, &ppp->us_rbuff_lock); |
ppp | 1239 | drivers/net/ppp.c | if (ppp->inp_sig) { |
ppp | 1246 | drivers/net/ppp.c | ppp->ddinfo.nip_rjiffies = jiffies; |
ppp | 1257 | drivers/net/ppp.c | ppp->us_rbuff_head += len; |
ppp | 1258 | drivers/net/ppp.c | if (ppp->us_rbuff_head > ppp->us_rbuff_end) |
ppp | 1259 | drivers/net/ppp.c | ppp->us_rbuff_head += - (ppp->us_rbuff_end - ppp->us_rbuff); |
ppp | 1260 | drivers/net/ppp.c | clear_bit(0, &ppp->us_rbuff_lock); |
ppp | 1261 | drivers/net/ppp.c | wake_up_interruptible (&ppp->read_wait); |
ppp | 1262 | drivers/net/ppp.c | ppp->stats.rgiants++; |
ppp | 1275 | drivers/net/ppp.c | clear_bit(0, &ppp->us_rbuff_lock); |
ppp | 1277 | drivers/net/ppp.c | ppp->stats.rothers++; |
ppp | 1285 | drivers/net/ppp.c | interruptible_sleep_on (&ppp->read_wait); |
ppp | 1295 | drivers/net/ppp.c | ppp_stuff_char(struct ppp *ppp, unsigned char c) |
ppp | 1297 | drivers/net/ppp.c | int curpt = ppp->xhead - ppp->xbuff; |
ppp | 1300 | drivers/net/ppp.c | (unsigned int) ppp->xbuff, (unsigned int) ppp->xhead, curpt)) |
ppp | 1302 | drivers/net/ppp.c | if (in_xmap (ppp, c)) { |
ppp | 1303 | drivers/net/ppp.c | *ppp->xhead++ = PPP_ESC; |
ppp | 1304 | drivers/net/ppp.c | *ppp->xhead++ = c ^ PPP_TRANS; |
ppp | 1306 | drivers/net/ppp.c | *ppp->xhead++ = c; |
ppp | 1307 | drivers/net/ppp.c | ppp->fcs = (ppp->fcs >> 8) ^ fcstab[(ppp->fcs ^ c) & 0xff]; |
ppp | 1317 | drivers/net/ppp.c | struct ppp *ppp = ppp_find(tty); |
ppp | 1320 | drivers/net/ppp.c | if (!ppp || ppp->magic != PPP_MAGIC) { |
ppp | 1327 | drivers/net/ppp.c | if (ppp->mtu != ppp->dev->mtu) /* Someone has been ifconfigging */ |
ppp | 1328 | drivers/net/ppp.c | ppp_changedmtu (ppp, ppp->dev->mtu, ppp->mru); |
ppp | 1330 | drivers/net/ppp.c | if (nr > ppp->mtu) { |
ppp | 1333 | drivers/net/ppp.c | nr, ppp->mtu)); |
ppp | 1334 | drivers/net/ppp.c | nr = ppp->mtu; |
ppp | 1342 | drivers/net/ppp.c | while ((ppp->sending == 1) || !ppp_lock(ppp)) { |
ppp | 1345 | drivers/net/ppp.c | interruptible_sleep_on(&ppp->write_wait); |
ppp | 1353 | drivers/net/ppp.c | ppp->xhead = ppp->xbuff; |
ppp | 1356 | drivers/net/ppp.c | if (jiffies - ppp->last_xmit > OPTIMIZE_FLAG_TIME) |
ppp | 1357 | drivers/net/ppp.c | *ppp->xhead++ = PPP_FLAG; |
ppp | 1358 | drivers/net/ppp.c | ppp->last_xmit = jiffies; |
ppp | 1360 | drivers/net/ppp.c | *ppp->xhead++ = PPP_FLAG; |
ppp | 1363 | drivers/net/ppp.c | ppp->fcs = PPP_FCS_INIT; |
ppp | 1366 | drivers/net/ppp.c | ppp_stuff_char(ppp,get_fs_byte(buf++)); |
ppp | 1368 | drivers/net/ppp.c | ppp_add_fcs(ppp); /* concatenate FCS at end */ |
ppp | 1370 | drivers/net/ppp.c | *ppp->xhead++ = PPP_FLAG; |
ppp | 1373 | drivers/net/ppp.c | ppp->ddinfo.nip_sjiffies = jiffies; |
ppp | 1376 | drivers/net/ppp.c | ppp_print_buffer ("xmit buffer", ppp->xbuff, ppp->xhead - ppp->xbuff, KERNEL_DS); |
ppp | 1379 | drivers/net/ppp.c | "ppp_write: writing %d chars\n", ppp->xhead - ppp->xbuff)); |
ppp | 1383 | drivers/net/ppp.c | ++ppp->stats.sothers; |
ppp | 1384 | drivers/net/ppp.c | ppp_kick_tty(ppp); |
ppp | 1393 | drivers/net/ppp.c | struct ppp *ppp = ppp_find(tty); |
ppp | 1397 | drivers/net/ppp.c | if (!ppp || ppp->magic != PPP_MAGIC) { |
ppp | 1414 | drivers/net/ppp.c | if (ppp->mru != temp_i) |
ppp | 1415 | drivers/net/ppp.c | ppp_changedmtu (ppp, ppp->dev->mtu, temp_i); |
ppp | 1422 | drivers/net/ppp.c | temp_i = (ppp->flags & SC_MASK); |
ppp | 1437 | drivers/net/ppp.c | ppp->flags ^= ((ppp->flags ^ temp_i) & SC_MASK); |
ppp | 1445 | drivers/net/ppp.c | put_fs_long (ppp->xmit_async_map[0], l); |
ppp | 1447 | drivers/net/ppp.c | l, ppp->xmit_async_map[0])); |
ppp | 1454 | drivers/net/ppp.c | memset (ppp->xmit_async_map, 0, sizeof (ppp->xmit_async_map)); |
ppp | 1455 | drivers/net/ppp.c | ppp->xmit_async_map[0] = get_fs_long (l); |
ppp | 1456 | drivers/net/ppp.c | bset (ppp->xmit_async_map, PPP_FLAG); |
ppp | 1457 | drivers/net/ppp.c | bset (ppp->xmit_async_map, PPP_ESC); |
ppp | 1459 | drivers/net/ppp.c | ppp->xmit_async_map[0])); |
ppp | 1466 | drivers/net/ppp.c | ppp->recv_async_map = get_fs_long (l); |
ppp | 1468 | drivers/net/ppp.c | ppp->recv_async_map)); |
ppp | 1475 | drivers/net/ppp.c | put_fs_long (ppp->dev->base_addr, l); |
ppp | 1476 | drivers/net/ppp.c | PRINTKN (3,(KERN_INFO "ppp_ioctl: get unit: %d", ppp->dev->base_addr)); |
ppp | 1483 | drivers/net/ppp.c | ppp->inp_sig = (int) get_fs_long (l); |
ppp | 1484 | drivers/net/ppp.c | ppp->inp_sig_pid = current->pid; |
ppp | 1485 | drivers/net/ppp.c | PRINTKN (3,(KERN_INFO "ppp_ioctl: set input signal %d\n", ppp->inp_sig)); |
ppp | 1512 | drivers/net/ppp.c | memcpy_tofs ((void *) l, &ppp->stats, sizeof (struct ppp_stats)); |
ppp | 1524 | drivers/net/ppp.c | cur_ddinfo.ip_sjiffies = cur_jiffies - ppp->ddinfo.ip_sjiffies; |
ppp | 1525 | drivers/net/ppp.c | cur_ddinfo.ip_rjiffies = cur_jiffies - ppp->ddinfo.ip_rjiffies; |
ppp | 1526 | drivers/net/ppp.c | cur_ddinfo.nip_sjiffies = cur_jiffies - ppp->ddinfo.nip_sjiffies; |
ppp | 1527 | drivers/net/ppp.c | cur_ddinfo.nip_rjiffies = cur_jiffies - ppp->ddinfo.nip_rjiffies; |
ppp | 1537 | drivers/net/ppp.c | sizeof (ppp->xmit_async_map)); |
ppp | 1540 | drivers/net/ppp.c | ppp->xmit_async_map, |
ppp | 1541 | drivers/net/ppp.c | sizeof (ppp->xmit_async_map)); |
ppp | 1548 | drivers/net/ppp.c | sizeof (ppp->xmit_async_map)); |
ppp | 1552 | drivers/net/ppp.c | memcpy_fromfs (temp_tbl, (void *) l, sizeof (ppp->xmit_async_map)); |
ppp | 1562 | drivers/net/ppp.c | memcpy (ppp->xmit_async_map, temp_tbl, sizeof (ppp->xmit_async_map)); |
ppp | 1573 | drivers/net/ppp.c | if (ppp->slcomp != NULL) |
ppp | 1574 | drivers/net/ppp.c | slhc_free (ppp->slcomp); |
ppp | 1576 | drivers/net/ppp.c | ppp->slcomp = slhc_init (temp_i, temp_i); |
ppp | 1578 | drivers/net/ppp.c | if (ppp->slcomp == NULL) { |
ppp | 1580 | drivers/net/ppp.c | ppp_release (ppp); |
ppp | 1616 | drivers/net/ppp.c | struct ppp *ppp = ppp_find (tty); |
ppp | 1618 | drivers/net/ppp.c | if (!ppp || ppp->magic != PPP_MAGIC) { |
ppp | 1629 | drivers/net/ppp.c | if (set_bit(0, &ppp->us_rbuff_lock) == 0) { |
ppp | 1631 | drivers/net/ppp.c | if (ppp->us_rbuff_head != ppp->us_rbuff_tail) { |
ppp | 1632 | drivers/net/ppp.c | clear_bit (0, &ppp->us_rbuff_lock); |
ppp | 1635 | drivers/net/ppp.c | clear_bit (0, &ppp->us_rbuff_lock); |
ppp | 1651 | drivers/net/ppp.c | select_wait (&ppp->read_wait, wait); |
ppp | 1655 | drivers/net/ppp.c | if (ppp_lock (ppp)) { |
ppp | 1656 | drivers/net/ppp.c | if (ppp->sending == 0) { |
ppp | 1657 | drivers/net/ppp.c | ppp_unlock (ppp); |
ppp | 1660 | drivers/net/ppp.c | ppp_unlock (ppp); |
ppp | 1662 | drivers/net/ppp.c | select_wait (&ppp->write_wait, wait); |
ppp | 1680 | drivers/net/ppp.c | struct ppp *ppp; |
ppp | 1692 | drivers/net/ppp.c | ppp = &ppp_ctrl[dev->base_addr]; |
ppp | 1693 | drivers/net/ppp.c | tty = ppp->tty; |
ppp | 1699 | drivers/net/ppp.c | (unsigned long int) skb, ppp->sending)); |
ppp | 1723 | drivers/net/ppp.c | if (ppp->flags & SC_IP_DOWN) { |
ppp | 1724 | drivers/net/ppp.c | if (ppp->flags & SC_IP_FLUSH == 0) { |
ppp | 1725 | drivers/net/ppp.c | if (ppp_us_queue (ppp, proto, p, len)) |
ppp | 1726 | drivers/net/ppp.c | ppp->flags |= SC_IP_FLUSH; |
ppp | 1732 | drivers/net/ppp.c | if (ppp->sending || !ppp_lock(ppp)) { |
ppp | 1734 | drivers/net/ppp.c | ppp->stats.sbusy++; |
ppp | 1738 | drivers/net/ppp.c | ppp->xhead = ppp->xbuff; |
ppp | 1741 | drivers/net/ppp.c | if (ppp->flags & SC_COMP_TCP) { |
ppp | 1743 | drivers/net/ppp.c | len = slhc_compress(ppp->slcomp, p, len, ppp->cbuff, &p, 0); |
ppp | 1756 | drivers/net/ppp.c | ++ppp->stats.scomp; |
ppp | 1758 | drivers/net/ppp.c | ++ppp->stats.suncomp; |
ppp | 1769 | drivers/net/ppp.c | if (jiffies - ppp->last_xmit > OPTIMIZE_FLAG_TIME) |
ppp | 1770 | drivers/net/ppp.c | *ppp->xhead++ = PPP_FLAG; |
ppp | 1771 | drivers/net/ppp.c | ppp->last_xmit = jiffies; |
ppp | 1773 | drivers/net/ppp.c | *ppp->xhead++ = PPP_FLAG; |
ppp | 1776 | drivers/net/ppp.c | ppp->fcs = PPP_FCS_INIT; |
ppp | 1777 | drivers/net/ppp.c | if (!(ppp->flags & SC_COMP_AC)) { |
ppp | 1778 | drivers/net/ppp.c | ppp_stuff_char(ppp, PPP_ADDRESS); |
ppp | 1779 | drivers/net/ppp.c | ppp_stuff_char(ppp, PPP_CONTROL); |
ppp | 1782 | drivers/net/ppp.c | if (!(ppp->flags & SC_COMP_PROT) || (proto & 0xff00)) |
ppp | 1783 | drivers/net/ppp.c | ppp_stuff_char(ppp, proto>>8); |
ppp | 1784 | drivers/net/ppp.c | ppp_stuff_char(ppp, proto&0xff); |
ppp | 1788 | drivers/net/ppp.c | ppp_stuff_char(ppp, *p++); |
ppp | 1791 | drivers/net/ppp.c | ppp_add_fcs(ppp); |
ppp | 1792 | drivers/net/ppp.c | *ppp->xhead++ = PPP_FLAG; |
ppp | 1795 | drivers/net/ppp.c | ppp->ddinfo.ip_sjiffies = jiffies; |
ppp | 1799 | drivers/net/ppp.c | ppp_print_buffer ("xmit buffer", ppp->xbuff, ppp->xhead - ppp->xbuff, KERNEL_DS); |
ppp | 1802 | drivers/net/ppp.c | "ppp_write: writing %d chars\n", ppp->xhead - ppp->xbuff)); |
ppp | 1805 | drivers/net/ppp.c | ppp_kick_tty(ppp); |
ppp | 1857 | drivers/net/ppp.c | struct ppp *ppp = &ppp_ctrl[dev->base_addr]; |
ppp | 1860 | drivers/net/ppp.c | ppp_stats.rx_packets = ppp->stats.rcomp + ppp->stats.runcomp; |
ppp | 1861 | drivers/net/ppp.c | ppp_stats.rx_errors = ppp->stats.rerrors; |
ppp | 1862 | drivers/net/ppp.c | ppp_stats.rx_dropped = ppp->stats.tossed; |
ppp | 1864 | drivers/net/ppp.c | ppp_stats.rx_length_errors = ppp->stats.runts; |
ppp | 1865 | drivers/net/ppp.c | ppp_stats.rx_over_errors = ppp->stats.roverrun; |
ppp | 1868 | drivers/net/ppp.c | ppp_stats.tx_packets = ppp->stats.scomp + ppp->stats.suncomp; |
ppp | 1869 | drivers/net/ppp.c | ppp_stats.tx_errors = ppp->stats.serrors; |
ppp | 1872 | drivers/net/ppp.c | ppp_stats.collisions = ppp->stats.sbusy; |
ppp | 1889 | drivers/net/ppp.c | struct ppp * |
ppp | 1901 | drivers/net/ppp.c | static struct ppp * |
ppp | 1917 | drivers/net/ppp.c | ppp_lock(struct ppp *ppp) |
ppp | 1922 | drivers/net/ppp.c | locked = ppp->sending; |
ppp | 1923 | drivers/net/ppp.c | ppp->sending = 1; |
ppp | 1924 | drivers/net/ppp.c | if (ppp->dev->flags & IFF_UP) |
ppp | 1925 | drivers/net/ppp.c | ppp->dev->tbusy = 1; |
ppp | 1931 | drivers/net/ppp.c | ppp_unlock(struct ppp *ppp) |
ppp | 1936 | drivers/net/ppp.c | ppp->sending = 0; |
ppp | 1937 | drivers/net/ppp.c | if (ppp->dev->flags & IFF_UP) |
ppp | 1938 | drivers/net/ppp.c | ppp->dev->tbusy = 0; |
ppp | 1945 | drivers/net/ppp.c | ppp_add_fcs(struct ppp *ppp) |
ppp | 1947 | drivers/net/ppp.c | unsigned short fcs = ppp->fcs; |
ppp | 1950 | drivers/net/ppp.c | ppp_stuff_char(ppp, fcs & 0x00ff); |
ppp | 1951 | drivers/net/ppp.c | ppp_stuff_char(ppp, (fcs & 0xff00) >> 8); |
ppp | 1952 | drivers/net/ppp.c | ASSERT (ppp->fcs == PPP_FCS_GOOD); |
ppp | 1958 | drivers/net/ppp.c | ppp_check_fcs(struct ppp *ppp) |
ppp | 1961 | drivers/net/ppp.c | unsigned char *c = ppp->rbuff; |
ppp | 1964 | drivers/net/ppp.c | for (i = 0; i < ppp->rcount - 2; i++, c++) |