tag | line | file | source code |
sl | 79 | drivers/net/slip.c | sl_initialize(struct slip *sl, struct device *dev) |
sl | 81 | drivers/net/slip.c | sl->magic = SLIP_MAGIC; |
sl | 82 | drivers/net/slip.c | sl->inuse = 0; |
sl | 83 | drivers/net/slip.c | sl->sending = 0; |
sl | 84 | drivers/net/slip.c | sl->escape = 0; |
sl | 85 | drivers/net/slip.c | sl->flags = 0; |
sl | 87 | drivers/net/slip.c | sl->mode = SL_MODE_ADAPTIVE; /* automatic CSLIP recognition */ |
sl | 90 | drivers/net/slip.c | sl->mode = SL_MODE_CSLIP | SL_MODE_ADAPTIVE; /* Default */ |
sl | 92 | drivers/net/slip.c | sl->mode = SL_MODE_SLIP; /* Default for non compressors */ |
sl | 96 | drivers/net/slip.c | sl->line = dev->base_addr; |
sl | 97 | drivers/net/slip.c | sl->tty = NULL; |
sl | 98 | drivers/net/slip.c | sl->dev = dev; |
sl | 99 | drivers/net/slip.c | sl->slcomp = NULL; |
sl | 102 | drivers/net/slip.c | sl->rbuff = NULL; |
sl | 103 | drivers/net/slip.c | sl->xbuff = NULL; |
sl | 104 | drivers/net/slip.c | sl->cbuff = NULL; |
sl | 106 | drivers/net/slip.c | sl->rhead = NULL; |
sl | 107 | drivers/net/slip.c | sl->rend = NULL; |
sl | 112 | drivers/net/slip.c | dev->type = ARPHRD_SLIP + sl->mode; |
sl | 122 | drivers/net/slip.c | struct slip *sl; |
sl | 128 | drivers/net/slip.c | sl = &sl_ctrl[i]; |
sl | 129 | drivers/net/slip.c | if (sl->inuse == 0) { |
sl | 130 | drivers/net/slip.c | sl->inuse = 1; |
sl | 131 | drivers/net/slip.c | sl->tty = NULL; |
sl | 133 | drivers/net/slip.c | return(sl); |
sl | 143 | drivers/net/slip.c | sl_free(struct slip *sl) |
sl | 147 | drivers/net/slip.c | if (sl->inuse) { |
sl | 150 | drivers/net/slip.c | sl->inuse = 0; |
sl | 151 | drivers/net/slip.c | sl->tty = NULL; |
sl | 160 | drivers/net/slip.c | static void sl_changedmtu(struct slip *sl) |
sl | 162 | drivers/net/slip.c | struct device *dev=sl->dev; |
sl | 165 | drivers/net/slip.c | int omtu=sl->mtu; |
sl | 167 | drivers/net/slip.c | sl->mtu=dev->mtu; |
sl | 184 | drivers/net/slip.c | sl->mtu=omtu; |
sl | 197 | drivers/net/slip.c | tf=(unsigned char *)sl->dev->mem_start; |
sl | 198 | drivers/net/slip.c | sl->dev->mem_start=(unsigned long)tb; |
sl | 199 | drivers/net/slip.c | sl->dev->mem_end=(unsigned long) (sl->dev->mem_start + l); |
sl | 200 | drivers/net/slip.c | rf=(unsigned char *)sl->dev->rmem_start; |
sl | 201 | drivers/net/slip.c | sl->dev->rmem_start=(unsigned long)rb; |
sl | 202 | drivers/net/slip.c | sl->dev->rmem_end=(unsigned long) (sl->dev->rmem_start + l); |
sl | 204 | drivers/net/slip.c | sl->xbuff = (unsigned char *) sl->dev->mem_start; |
sl | 205 | drivers/net/slip.c | sl->rbuff = (unsigned char *) sl->dev->rmem_start; |
sl | 206 | drivers/net/slip.c | sl->rend = (unsigned char *) sl->dev->rmem_end; |
sl | 207 | drivers/net/slip.c | sl->rhead = sl->rbuff; |
sl | 209 | drivers/net/slip.c | cf=sl->cbuff; |
sl | 210 | drivers/net/slip.c | sl->cbuff=cb; |
sl | 212 | drivers/net/slip.c | sl->escape=0; |
sl | 213 | drivers/net/slip.c | sl->sending=0; |
sl | 214 | drivers/net/slip.c | sl->rcount=0; |
sl | 229 | drivers/net/slip.c | sl_enqueue(struct slip *sl, unsigned char c) |
sl | 235 | drivers/net/slip.c | if (sl->rhead < sl->rend) { |
sl | 236 | drivers/net/slip.c | *sl->rhead = c; |
sl | 237 | drivers/net/slip.c | sl->rhead++; |
sl | 238 | drivers/net/slip.c | sl->rcount++; |
sl | 239 | drivers/net/slip.c | } else sl->roverrun++; |
sl | 245 | drivers/net/slip.c | sl_dequeue(struct slip *sl, int i) |
sl | 251 | drivers/net/slip.c | if (sl->rhead > sl->rbuff) { |
sl | 252 | drivers/net/slip.c | sl->rhead -= i; |
sl | 253 | drivers/net/slip.c | sl->rcount -= i; |
sl | 261 | drivers/net/slip.c | sl_lock(struct slip *sl) |
sl | 267 | drivers/net/slip.c | sl->sending = 1; |
sl | 268 | drivers/net/slip.c | sl->dev->tbusy = 1; |
sl | 275 | drivers/net/slip.c | sl_unlock(struct slip *sl) |
sl | 281 | drivers/net/slip.c | sl->sending = 0; |
sl | 282 | drivers/net/slip.c | sl->dev->tbusy = 0; |
sl | 289 | drivers/net/slip.c | sl_bump(struct slip *sl) |
sl | 296 | drivers/net/slip.c | count = sl->rcount; |
sl | 298 | drivers/net/slip.c | if (sl->mode & (SL_MODE_ADAPTIVE | SL_MODE_CSLIP)) { |
sl | 299 | drivers/net/slip.c | if ((c = sl->rbuff[0]) & SL_TYPE_COMPRESSED_TCP) { |
sl | 302 | drivers/net/slip.c | if (!(sl->mode & SL_MODE_CSLIP)) { |
sl | 310 | drivers/net/slip.c | if ((sl->rhead + 80) < sl->rend) { |
sl | 311 | drivers/net/slip.c | sl->rhead += 80; |
sl | 312 | drivers/net/slip.c | sl->rcount += 80; |
sl | 315 | drivers/net/slip.c | sl->roverrun++; |
sl | 322 | drivers/net/slip.c | count = slhc_uncompress(sl->slcomp, sl->rbuff, count); |
sl | 324 | drivers/net/slip.c | sl->errors++; |
sl | 328 | drivers/net/slip.c | if (!(sl->mode & SL_MODE_CSLIP)) { |
sl | 330 | drivers/net/slip.c | sl->mode |= SL_MODE_CSLIP; |
sl | 333 | drivers/net/slip.c | sl->rbuff[0] &= 0x4f; |
sl | 334 | drivers/net/slip.c | if (slhc_remember(sl->slcomp, sl->rbuff, count) <= 0) { |
sl | 335 | drivers/net/slip.c | sl->errors++; |
sl | 345 | drivers/net/slip.c | done = dev_rint(sl->rbuff, count, 0, sl->dev); |
sl | 349 | drivers/net/slip.c | sl->rpacket++; |
sl | 354 | drivers/net/slip.c | sl_encaps(struct slip *sl, unsigned char *icp, int len) |
sl | 360 | drivers/net/slip.c | if(sl->mtu != sl->dev->mtu) /* Someone has been ifconfigging */ |
sl | 361 | drivers/net/slip.c | sl_changedmtu(sl); |
sl | 363 | drivers/net/slip.c | if(len>sl->mtu) /* Sigh, shouldn't occur BUT ... */ |
sl | 365 | drivers/net/slip.c | len=sl->mtu; |
sl | 371 | drivers/net/slip.c | if(sl->mode & SL_MODE_CSLIP) |
sl | 372 | drivers/net/slip.c | len = slhc_compress(sl->slcomp, p, len, sl->cbuff, &p, 1); |
sl | 374 | drivers/net/slip.c | if(sl->mode & SL_MODE_SLIP6) |
sl | 375 | drivers/net/slip.c | count=slip_esc6(p, (unsigned char *)sl->xbuff,len); |
sl | 377 | drivers/net/slip.c | count=slip_esc(p, (unsigned char *)sl->xbuff,len); |
sl | 378 | drivers/net/slip.c | sl->spacket++; |
sl | 381 | drivers/net/slip.c | actual = sl->tty->driver.write(sl->tty, 0, sl->xbuff, count); |
sl | 383 | drivers/net/slip.c | sl_unlock(sl); |
sl | 386 | drivers/net/slip.c | sl->xhead = sl->xbuff + count; |
sl | 387 | drivers/net/slip.c | sl->xtail = sl->xbuff + actual; |
sl | 388 | drivers/net/slip.c | sl->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); |
sl | 399 | drivers/net/slip.c | struct slip *sl = (struct slip *) tty->disc_data; |
sl | 402 | drivers/net/slip.c | if (!sl || sl->magic != SLIP_MAGIC) { |
sl | 406 | drivers/net/slip.c | if (!sl->xtail) |
sl | 410 | drivers/net/slip.c | if (sl->flags & SLF_XMIT_BUSY) { |
sl | 414 | drivers/net/slip.c | sl->flags |= SLF_XMIT_BUSY; |
sl | 417 | drivers/net/slip.c | count = sl->xhead - sl->xtail; |
sl | 419 | drivers/net/slip.c | answer = tty->driver.write(tty, 0, sl->xtail, count); |
sl | 421 | drivers/net/slip.c | sl->xtail = 0; |
sl | 424 | drivers/net/slip.c | sl_unlock(sl); |
sl | 427 | drivers/net/slip.c | sl->xtail += answer; |
sl | 429 | drivers/net/slip.c | sl->flags &= ~SLF_XMIT_BUSY; |
sl | 453 | drivers/net/slip.c | struct slip *sl; |
sl | 457 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 458 | drivers/net/slip.c | tty = sl->tty; |
sl | 465 | drivers/net/slip.c | if (sl->sending) { |
sl | 466 | drivers/net/slip.c | sl->sbusy++; |
sl | 472 | drivers/net/slip.c | sl_lock(sl); |
sl | 475 | drivers/net/slip.c | sl_encaps(sl, skb->data, size); |
sl | 487 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 488 | drivers/net/slip.c | if(sl->mode&SL_MODE_AX25) |
sl | 502 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 503 | drivers/net/slip.c | if((sl->mode&SL_MODE_AX25) && type!=htons(ETH_P_AX25)) |
sl | 519 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 521 | drivers/net/slip.c | if(sl->mode&SL_MODE_AX25) |
sl | 533 | drivers/net/slip.c | struct slip *sl; |
sl | 537 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 538 | drivers/net/slip.c | if (sl->tty == NULL) { |
sl | 541 | drivers/net/slip.c | sl->dev = dev; |
sl | 565 | drivers/net/slip.c | sl->mtu = dev->mtu; |
sl | 566 | drivers/net/slip.c | sl->dev->mem_start = (unsigned long) p; |
sl | 567 | drivers/net/slip.c | sl->dev->mem_end = (unsigned long) (sl->dev->mem_start + l); |
sl | 571 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->mem_start); |
sl | 574 | drivers/net/slip.c | sl->dev->rmem_start = (unsigned long) p; |
sl | 575 | drivers/net/slip.c | sl->dev->rmem_end = (unsigned long) (sl->dev->rmem_start + l); |
sl | 577 | drivers/net/slip.c | sl->xbuff = (unsigned char *) sl->dev->mem_start; |
sl | 578 | drivers/net/slip.c | sl->rbuff = (unsigned char *) sl->dev->rmem_start; |
sl | 579 | drivers/net/slip.c | sl->rend = (unsigned char *) sl->dev->rmem_end; |
sl | 580 | drivers/net/slip.c | sl->rhead = sl->rbuff; |
sl | 582 | drivers/net/slip.c | sl->escape = 0; |
sl | 583 | drivers/net/slip.c | sl->sending = 0; |
sl | 584 | drivers/net/slip.c | sl->rcount = 0; |
sl | 588 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->mem_start); |
sl | 589 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->rmem_start); |
sl | 592 | drivers/net/slip.c | sl->cbuff = p; |
sl | 594 | drivers/net/slip.c | sl->slcomp = slhc_init(16, 16); |
sl | 595 | drivers/net/slip.c | if (sl->slcomp == NULL) { |
sl | 596 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->mem_start); |
sl | 597 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->rmem_start); |
sl | 598 | drivers/net/slip.c | kfree((unsigned char *)sl->cbuff); |
sl | 614 | drivers/net/slip.c | struct slip *sl; |
sl | 616 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 617 | drivers/net/slip.c | if (sl->tty == NULL) { |
sl | 620 | drivers/net/slip.c | sl->tty->disc_data = 0; |
sl | 621 | drivers/net/slip.c | sl_free(sl); |
sl | 624 | drivers/net/slip.c | kfree(sl->rbuff); |
sl | 625 | drivers/net/slip.c | kfree(sl->xbuff); |
sl | 626 | drivers/net/slip.c | kfree(sl->cbuff); |
sl | 628 | drivers/net/slip.c | slhc_free(sl->slcomp); |
sl | 630 | drivers/net/slip.c | sl_initialize(sl, dev); |
sl | 649 | drivers/net/slip.c | struct slip *sl = (struct slip *) tty->disc_data; |
sl | 651 | drivers/net/slip.c | if (!sl || sl->magic != SLIP_MAGIC) |
sl | 658 | drivers/net/slip.c | if(sl->mtu!=sl->dev->mtu) |
sl | 659 | drivers/net/slip.c | sl_changedmtu(sl); |
sl | 664 | drivers/net/slip.c | sl->flags |= SLF_ERROR; |
sl | 668 | drivers/net/slip.c | if (sl->mode & SL_MODE_SLIP6) |
sl | 669 | drivers/net/slip.c | slip_unesc6(sl,*cp++); |
sl | 671 | drivers/net/slip.c | slip_unesc(sl,*cp++); |
sl | 685 | drivers/net/slip.c | struct slip *sl = (struct slip *) tty->disc_data; |
sl | 688 | drivers/net/slip.c | if (sl && sl->magic == SLIP_MAGIC) { |
sl | 693 | drivers/net/slip.c | if ((sl = sl_alloc()) == NULL) { |
sl | 696 | drivers/net/slip.c | sl->tty = tty; |
sl | 697 | drivers/net/slip.c | tty->disc_data = sl; |
sl | 704 | drivers/net/slip.c | (void) sl_open(sl->dev); |
sl | 707 | drivers/net/slip.c | return(sl->line); |
sl | 715 | drivers/net/slip.c | struct slip *sl; |
sl | 719 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 720 | drivers/net/slip.c | if (! sl) |
sl | 725 | drivers/net/slip.c | stats.rx_packets = sl->rpacket; |
sl | 726 | drivers/net/slip.c | stats.rx_over_errors = sl->roverrun; |
sl | 727 | drivers/net/slip.c | stats.tx_packets = sl->spacket; |
sl | 728 | drivers/net/slip.c | stats.tx_dropped = sl->sbusy; |
sl | 729 | drivers/net/slip.c | stats.rx_errors = sl->errors; |
sl | 731 | drivers/net/slip.c | comp = sl->slcomp; |
sl | 751 | drivers/net/slip.c | struct slip *sl = (struct slip *) tty->disc_data; |
sl | 754 | drivers/net/slip.c | if (!sl || sl->magic != SLIP_MAGIC) { |
sl | 758 | drivers/net/slip.c | (void) dev_close(sl->dev); |
sl | 806 | drivers/net/slip.c | slip_unesc(struct slip *sl, unsigned char s) |
sl | 810 | drivers/net/slip.c | sl->flags |= SLF_ESCAPE; |
sl | 813 | drivers/net/slip.c | if (sl->flags & SLF_ESCAPE) |
sl | 814 | drivers/net/slip.c | sl_enqueue(sl, ESC); |
sl | 816 | drivers/net/slip.c | sl_enqueue(sl, s); |
sl | 817 | drivers/net/slip.c | sl->flags &= ~SLF_ESCAPE; |
sl | 820 | drivers/net/slip.c | if (sl->flags & SLF_ESCAPE) |
sl | 821 | drivers/net/slip.c | sl_enqueue(sl, END); |
sl | 823 | drivers/net/slip.c | sl_enqueue(sl, s); |
sl | 824 | drivers/net/slip.c | sl->flags &= ~SLF_ESCAPE; |
sl | 827 | drivers/net/slip.c | if (sl->rcount > 2) |
sl | 828 | drivers/net/slip.c | sl_bump(sl); |
sl | 829 | drivers/net/slip.c | sl_dequeue(sl, sl->rcount); |
sl | 830 | drivers/net/slip.c | sl->rcount = 0; |
sl | 831 | drivers/net/slip.c | sl->flags &= ~(SLF_ESCAPE | SLF_ERROR); |
sl | 834 | drivers/net/slip.c | sl_enqueue(sl, s); |
sl | 835 | drivers/net/slip.c | sl->flags &= ~SLF_ESCAPE; |
sl | 888 | drivers/net/slip.c | slip_unesc6(struct slip *sl, unsigned char s) |
sl | 893 | drivers/net/slip.c | if (sl->rcount > 8) { /* XXX must be 2 for compressed slip */ |
sl | 896 | drivers/net/slip.c | sl->rbuff[0], |
sl | 897 | drivers/net/slip.c | sl->rbuff[1], |
sl | 898 | drivers/net/slip.c | sl->rbuff[2], |
sl | 899 | drivers/net/slip.c | sl->rbuff[3] |
sl | 902 | drivers/net/slip.c | sl_bump(sl); |
sl | 904 | drivers/net/slip.c | sl_dequeue(sl, sl->rcount); |
sl | 905 | drivers/net/slip.c | sl->rcount = 0; |
sl | 906 | drivers/net/slip.c | sl->flags &= ~(SLF_ESCAPE | SLF_ERROR); /* SLF_ESCAPE not used */ |
sl | 907 | drivers/net/slip.c | sl->xbits = 0; |
sl | 909 | drivers/net/slip.c | sl->xdata = (sl->xdata << 6) | ((s - 0x30) & 0x3F); |
sl | 910 | drivers/net/slip.c | sl->xbits += 6; |
sl | 911 | drivers/net/slip.c | if (sl->xbits >= 8) { |
sl | 912 | drivers/net/slip.c | sl->xbits -= 8; |
sl | 913 | drivers/net/slip.c | c = (unsigned char)(sl->xdata >> sl->xbits); |
sl | 914 | drivers/net/slip.c | sl_enqueue(sl, c); |
sl | 944 | drivers/net/slip.c | struct slip *sl = (struct slip *) tty->disc_data; |
sl | 948 | drivers/net/slip.c | if (!sl || sl->magic != SLIP_MAGIC) { |
sl | 957 | drivers/net/slip.c | memcpy_tofs(arg, sl->dev->name, strlen(sl->dev->name) + 1); |
sl | 961 | drivers/net/slip.c | put_fs_long(sl->mode,(long *)arg); |
sl | 965 | drivers/net/slip.c | sl->mode=get_fs_long((long *)arg); |
sl | 967 | drivers/net/slip.c | if(sl->mode & SL_MODE_AX25) |
sl | 969 | drivers/net/slip.c | sl->dev->addr_len=7; /* sizeof an AX.25 addr */ |
sl | 970 | drivers/net/slip.c | sl->dev->hard_header_len=17; /* We don't do digipeaters */ |
sl | 974 | drivers/net/slip.c | sl->dev->addr_len=0; /* No mac addr in slip mode */ |
sl | 975 | drivers/net/slip.c | sl->dev->hard_header_len=0; |
sl | 978 | drivers/net/slip.c | sl->dev->type=ARPHRD_SLIP+sl->mode; |
sl | 979 | drivers/net/slip.c | if(sl->dev->type==260) |
sl | 980 | drivers/net/slip.c | sl->dev->type=ARPHRD_AX25; |
sl | 984 | drivers/net/slip.c | return sl_set_mac_address(sl->dev,arg); |
sl | 1001 | drivers/net/slip.c | struct slip *sl; |
sl | 1008 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 1038 | drivers/net/slip.c | sl_initialize(sl, dev); |
sl | 1041 | drivers/net/slip.c | sl->rcount = 0; /* SLIP receiver count */ |
sl | 1042 | drivers/net/slip.c | sl->rpacket = 0; /* #frames received */ |
sl | 1043 | drivers/net/slip.c | sl->roverrun = 0; /* "overrun" counter */ |
sl | 1044 | drivers/net/slip.c | sl->spacket = 0; /* #frames sent out */ |
sl | 1045 | drivers/net/slip.c | sl->sbusy = 0; /* "xmit busy" counter */ |
sl | 1046 | drivers/net/slip.c | sl->errors = 0; /* not used at present */ |
sl | 89 | drivers/net/slip.h | extern void slip_unesc(struct slip *sl, unsigned char s); |
sl | 90 | drivers/net/slip.h | extern void slip_unesc6(struct slip *sl, unsigned char s); |
sl | 643 | drivers/scsi/ultrastor.c | struct scatterlist *sl; |
sl | 647 | drivers/scsi/ultrastor.c | sl = (struct scatterlist *) SCpnt->request_buffer; |
sl | 650 | drivers/scsi/ultrastor.c | mscp->sglist[i].address = (unsigned int)sl[i].address; |
sl | 651 | drivers/scsi/ultrastor.c | mscp->sglist[i].num_bytes = sl[i].length; |
sl | 652 | drivers/scsi/ultrastor.c | transfer_length += sl[i].length; |