tag | line | file | source code |
sl | 131 | drivers/net/slip.c | sl_initialize(struct slip *sl, struct device *dev) |
sl | 133 | drivers/net/slip.c | sl->inuse = 0; |
sl | 134 | drivers/net/slip.c | sl->sending = 0; |
sl | 135 | drivers/net/slip.c | sl->escape = 0; |
sl | 136 | drivers/net/slip.c | sl->flags = 0; |
sl | 138 | drivers/net/slip.c | sl->mode = SL_MODE_ADAPTIVE; /* automatic CSLIP recognition */ |
sl | 141 | drivers/net/slip.c | sl->mode = SL_MODE_CSLIP | SL_MODE_ADAPTIVE; /* Default */ |
sl | 143 | drivers/net/slip.c | sl->mode = SL_MODE_SLIP; /* Default for non compressors */ |
sl | 147 | drivers/net/slip.c | sl->line = dev->base_addr; |
sl | 148 | drivers/net/slip.c | sl->tty = NULL; |
sl | 149 | drivers/net/slip.c | sl->dev = dev; |
sl | 150 | drivers/net/slip.c | sl->slcomp = NULL; |
sl | 153 | drivers/net/slip.c | sl->rbuff = NULL; |
sl | 154 | drivers/net/slip.c | sl->xbuff = NULL; |
sl | 155 | drivers/net/slip.c | sl->cbuff = NULL; |
sl | 157 | drivers/net/slip.c | sl->rhead = NULL; |
sl | 158 | drivers/net/slip.c | sl->rend = NULL; |
sl | 170 | drivers/net/slip.c | struct slip *sl; |
sl | 175 | drivers/net/slip.c | sl = &sl_ctrl[i]; |
sl | 176 | drivers/net/slip.c | if (sl->tty == tty) return(sl); |
sl | 187 | drivers/net/slip.c | struct slip *sl; |
sl | 193 | drivers/net/slip.c | sl = &sl_ctrl[i]; |
sl | 194 | drivers/net/slip.c | if (sl->inuse == 0) { |
sl | 195 | drivers/net/slip.c | sl->inuse = 1; |
sl | 196 | drivers/net/slip.c | sl->tty = NULL; |
sl | 198 | drivers/net/slip.c | return(sl); |
sl | 208 | drivers/net/slip.c | sl_free(struct slip *sl) |
sl | 212 | drivers/net/slip.c | if (sl->inuse) { |
sl | 215 | drivers/net/slip.c | sl->inuse = 0; |
sl | 216 | drivers/net/slip.c | sl->tty = NULL; |
sl | 225 | drivers/net/slip.c | static void sl_changedmtu(struct slip *sl) |
sl | 227 | drivers/net/slip.c | struct device *dev=sl->dev; |
sl | 230 | drivers/net/slip.c | int omtu=sl->mtu; |
sl | 232 | drivers/net/slip.c | sl->mtu=dev->mtu; |
sl | 244 | drivers/net/slip.c | sl->mtu=omtu; |
sl | 257 | drivers/net/slip.c | tf=(unsigned char *)sl->dev->mem_start; |
sl | 258 | drivers/net/slip.c | sl->dev->mem_start=(unsigned long)tb; |
sl | 259 | drivers/net/slip.c | sl->dev->mem_end=(unsigned long) (sl->dev->mem_start + l); |
sl | 260 | drivers/net/slip.c | rf=(unsigned char *)sl->dev->rmem_start; |
sl | 261 | drivers/net/slip.c | sl->dev->rmem_start=(unsigned long)rb; |
sl | 262 | drivers/net/slip.c | sl->dev->rmem_end=(unsigned long) (sl->dev->rmem_start + l); |
sl | 264 | drivers/net/slip.c | sl->xbuff = (unsigned char *) sl->dev->mem_start; |
sl | 265 | drivers/net/slip.c | sl->rbuff = (unsigned char *) sl->dev->rmem_start; |
sl | 266 | drivers/net/slip.c | sl->rend = (unsigned char *) sl->dev->rmem_end; |
sl | 267 | drivers/net/slip.c | sl->rhead = sl->rbuff; |
sl | 269 | drivers/net/slip.c | cf=sl->cbuff; |
sl | 270 | drivers/net/slip.c | sl->cbuff=cb; |
sl | 272 | drivers/net/slip.c | sl->escape=0; |
sl | 273 | drivers/net/slip.c | sl->sending=0; |
sl | 274 | drivers/net/slip.c | sl->rcount=0; |
sl | 289 | drivers/net/slip.c | sl_enqueue(struct slip *sl, unsigned char c) |
sl | 295 | drivers/net/slip.c | if (sl->rhead < sl->rend) { |
sl | 296 | drivers/net/slip.c | *sl->rhead = c; |
sl | 297 | drivers/net/slip.c | sl->rhead++; |
sl | 298 | drivers/net/slip.c | sl->rcount++; |
sl | 299 | drivers/net/slip.c | } else sl->roverrun++; |
sl | 305 | drivers/net/slip.c | sl_dequeue(struct slip *sl, int i) |
sl | 311 | drivers/net/slip.c | if (sl->rhead > sl->rbuff) { |
sl | 312 | drivers/net/slip.c | sl->rhead -= i; |
sl | 313 | drivers/net/slip.c | sl->rcount -= i; |
sl | 321 | drivers/net/slip.c | sl_lock(struct slip *sl) |
sl | 327 | drivers/net/slip.c | sl->sending = 1; |
sl | 328 | drivers/net/slip.c | sl->dev->tbusy = 1; |
sl | 335 | drivers/net/slip.c | sl_unlock(struct slip *sl) |
sl | 341 | drivers/net/slip.c | sl->sending = 0; |
sl | 342 | drivers/net/slip.c | sl->dev->tbusy = 0; |
sl | 349 | drivers/net/slip.c | sl_bump(struct slip *sl) |
sl | 356 | drivers/net/slip.c | count = sl->rcount; |
sl | 357 | drivers/net/slip.c | if (sl->mode & (SL_MODE_ADAPTIVE | SL_MODE_CSLIP)) { |
sl | 358 | drivers/net/slip.c | if ((c = sl->rbuff[0]) & SL_TYPE_COMPRESSED_TCP) { |
sl | 361 | drivers/net/slip.c | if (!(sl->mode & SL_MODE_CSLIP)) { |
sl | 369 | drivers/net/slip.c | if ((sl->rhead + 80) < sl->rend) { |
sl | 370 | drivers/net/slip.c | sl->rhead += 80; |
sl | 371 | drivers/net/slip.c | sl->rcount += 80; |
sl | 374 | drivers/net/slip.c | sl->roverrun++; |
sl | 381 | drivers/net/slip.c | count = slhc_uncompress(sl->slcomp, sl->rbuff, count); |
sl | 383 | drivers/net/slip.c | sl->errors++; |
sl | 387 | drivers/net/slip.c | if (!(sl->mode & SL_MODE_CSLIP)) { |
sl | 389 | drivers/net/slip.c | sl->mode |= SL_MODE_CSLIP; |
sl | 392 | drivers/net/slip.c | sl->rbuff[0] &= 0x4f; |
sl | 393 | drivers/net/slip.c | if (slhc_remember(sl->slcomp, sl->rbuff, count) <= 0) { |
sl | 394 | drivers/net/slip.c | sl->errors++; |
sl | 400 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "<< \"%s\" recv:\r\n", sl->dev->name)); |
sl | 401 | drivers/net/slip.c | ip_dump(sl->rbuff, sl->rcount); |
sl | 406 | drivers/net/slip.c | sl->rcount, sl->rbuff)); |
sl | 408 | drivers/net/slip.c | done = dev_rint(sl->rbuff, count, 0, sl->dev); |
sl | 412 | drivers/net/slip.c | sl->rpacket++; |
sl | 418 | drivers/net/slip.c | sl_next(struct slip *sl) |
sl | 420 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: sl_next(0x%X) called!\n", sl)); |
sl | 421 | drivers/net/slip.c | sl_unlock(sl); |
sl | 422 | drivers/net/slip.c | dev_tint(sl->dev); |
sl | 428 | drivers/net/slip.c | sl_encaps(struct slip *sl, unsigned char *icp, int len) |
sl | 434 | drivers/net/slip.c | DPRINTF((DBG_SLIP, ">> \"%s\" sent:\r\n", sl->dev->name)); |
sl | 438 | drivers/net/slip.c | if(sl->mtu != sl->dev->mtu) /* Someone has been ifconfigging */ |
sl | 439 | drivers/net/slip.c | sl_changedmtu(sl); |
sl | 441 | drivers/net/slip.c | if(len>sl->mtu) /* Sigh, shouldn't occur BUT ... */ |
sl | 443 | drivers/net/slip.c | len=sl->mtu; |
sl | 448 | drivers/net/slip.c | if(sl->mode & SL_MODE_CSLIP) |
sl | 449 | drivers/net/slip.c | len = slhc_compress(sl->slcomp, p, len, sl->cbuff, &p, 1); |
sl | 457 | drivers/net/slip.c | bp = sl->xbuff; |
sl | 486 | drivers/net/slip.c | if(sl->mode & SL_MODE_SLIP6) |
sl | 487 | drivers/net/slip.c | count=slip_esc6(p, (unsigned char *)sl->xbuff,len); |
sl | 489 | drivers/net/slip.c | count=slip_esc(p, (unsigned char *)sl->xbuff,len); |
sl | 491 | drivers/net/slip.c | sl->spacket++; |
sl | 492 | drivers/net/slip.c | bp = sl->xbuff; |
sl | 496 | drivers/net/slip.c | if (tty_write_data(sl->tty, (char *) bp, count, |
sl | 497 | drivers/net/slip.c | (void (*)(void *))sl_next, (void *) sl) == 0) { |
sl | 499 | drivers/net/slip.c | sl_next(sl); |
sl | 524 | drivers/net/slip.c | struct slip *sl; |
sl | 527 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 528 | drivers/net/slip.c | tty = sl->tty; |
sl | 530 | drivers/net/slip.c | dev->name, skb, sl->sending)); |
sl | 537 | drivers/net/slip.c | if (sl->sending) { |
sl | 539 | drivers/net/slip.c | sl->sbusy++; |
sl | 546 | drivers/net/slip.c | if(sl->mode & SL_MODE_AX25) |
sl | 557 | drivers/net/slip.c | sl_lock(sl); |
sl | 559 | drivers/net/slip.c | sl_encaps(sl, (unsigned char *) (skb + 1), skb->len); |
sl | 571 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 572 | drivers/net/slip.c | if(sl->mode&SL_MODE_AX25) |
sl | 585 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 586 | drivers/net/slip.c | if((sl->mode&SL_MODE_AX25) && type!=NET16(ETH_P_AX25)) |
sl | 599 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 601 | drivers/net/slip.c | if(sl->mode&SL_MODE_AX25) |
sl | 612 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 614 | drivers/net/slip.c | if(sl->mode&SL_MODE_AX25) |
sl | 625 | drivers/net/slip.c | struct slip *sl; |
sl | 629 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 630 | drivers/net/slip.c | if (sl->tty == NULL) { |
sl | 631 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: channel %d not connected!\n", sl->line)); |
sl | 634 | drivers/net/slip.c | sl->dev = dev; |
sl | 651 | drivers/net/slip.c | sl->mtu = dev->mtu; |
sl | 652 | drivers/net/slip.c | sl->dev->mem_start = (unsigned long) p; |
sl | 653 | drivers/net/slip.c | sl->dev->mem_end = (unsigned long) (sl->dev->mem_start + l); |
sl | 660 | drivers/net/slip.c | sl->dev->rmem_start = (unsigned long) p; |
sl | 661 | drivers/net/slip.c | sl->dev->rmem_end = (unsigned long) (sl->dev->rmem_start + l); |
sl | 663 | drivers/net/slip.c | sl->xbuff = (unsigned char *) sl->dev->mem_start; |
sl | 664 | drivers/net/slip.c | sl->rbuff = (unsigned char *) sl->dev->rmem_start; |
sl | 665 | drivers/net/slip.c | sl->rend = (unsigned char *) sl->dev->rmem_end; |
sl | 666 | drivers/net/slip.c | sl->rhead = sl->rbuff; |
sl | 668 | drivers/net/slip.c | sl->escape = 0; |
sl | 669 | drivers/net/slip.c | sl->sending = 0; |
sl | 670 | drivers/net/slip.c | sl->rcount = 0; |
sl | 674 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->mem_start); |
sl | 678 | drivers/net/slip.c | sl->cbuff = p; |
sl | 680 | drivers/net/slip.c | sl->slcomp = slhc_init(16, 16); |
sl | 681 | drivers/net/slip.c | if (sl->slcomp == NULL) { |
sl | 682 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->mem_start); |
sl | 683 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->rmem_start); |
sl | 684 | drivers/net/slip.c | kfree(sl->cbuff); |
sl | 689 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: channel %d opened.\n", sl->line)); |
sl | 698 | drivers/net/slip.c | struct slip *sl; |
sl | 700 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 701 | drivers/net/slip.c | if (sl->tty == NULL) { |
sl | 702 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: channel %d not connected!\n", sl->line)); |
sl | 705 | drivers/net/slip.c | sl_free(sl); |
sl | 708 | drivers/net/slip.c | kfree(sl->rbuff); |
sl | 709 | drivers/net/slip.c | kfree(sl->xbuff); |
sl | 710 | drivers/net/slip.c | kfree(sl->cbuff); |
sl | 711 | drivers/net/slip.c | slhc_free(sl->slcomp); |
sl | 713 | drivers/net/slip.c | sl_initialize(sl, dev); |
sl | 715 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: channel %d closed.\n", sl->line)); |
sl | 731 | drivers/net/slip.c | struct slip *sl; |
sl | 735 | drivers/net/slip.c | if ((sl = sl_find(tty)) == NULL) return; /* not connected */ |
sl | 737 | drivers/net/slip.c | if(sl->mtu!=sl->dev->mtu) /* Argh! mtu change time! - costs us the packet part received at the change */ |
sl | 738 | drivers/net/slip.c | sl_changedmtu(sl); |
sl | 754 | drivers/net/slip.c | if (sl->escape) { |
sl | 756 | drivers/net/slip.c | sl_enqueue(sl, ESC); |
sl | 758 | drivers/net/slip.c | sl_enqueue(sl, END); |
sl | 761 | drivers/net/slip.c | sl->escape = 0; |
sl | 764 | drivers/net/slip.c | sl->escape = 1; |
sl | 766 | drivers/net/slip.c | if (sl->rcount > 2) sl_bump(sl); |
sl | 767 | drivers/net/slip.c | sl_dequeue(sl, sl->rcount); |
sl | 768 | drivers/net/slip.c | sl->rcount = 0; |
sl | 769 | drivers/net/slip.c | } else sl_enqueue(sl, c); |
sl | 773 | drivers/net/slip.c | if(sl->mode & SL_MODE_SLIP6) |
sl | 774 | drivers/net/slip.c | slip_unesc6(sl,buff,count,error); |
sl | 776 | drivers/net/slip.c | slip_unesc(sl,buff,count,error); |
sl | 793 | drivers/net/slip.c | struct slip *sl; |
sl | 796 | drivers/net/slip.c | if ((sl = sl_find(tty)) != NULL) { |
sl | 798 | drivers/net/slip.c | tty->line, sl->dev->name)); |
sl | 803 | drivers/net/slip.c | if ((sl = sl_alloc()) == NULL) { |
sl | 808 | drivers/net/slip.c | sl->tty = tty; |
sl | 813 | drivers/net/slip.c | (void) sl_open(sl->dev); |
sl | 815 | drivers/net/slip.c | tty->line, sl->dev->name)); |
sl | 818 | drivers/net/slip.c | return(sl->line); |
sl | 826 | drivers/net/slip.c | struct slip *sl; |
sl | 830 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 831 | drivers/net/slip.c | if (! sl) |
sl | 836 | drivers/net/slip.c | stats.rx_packets = sl->rpacket; |
sl | 837 | drivers/net/slip.c | stats.rx_over_errors = sl->roverrun; |
sl | 838 | drivers/net/slip.c | stats.tx_packets = sl->spacket; |
sl | 839 | drivers/net/slip.c | stats.tx_dropped = sl->sbusy; |
sl | 840 | drivers/net/slip.c | stats.rx_errors = sl->errors; |
sl | 842 | drivers/net/slip.c | comp = sl->slcomp; |
sl | 862 | drivers/net/slip.c | struct slip *sl; |
sl | 865 | drivers/net/slip.c | if ((sl = sl_find(tty)) == NULL) { |
sl | 870 | drivers/net/slip.c | (void) dev_close(sl->dev); |
sl | 872 | drivers/net/slip.c | tty->line, sl->dev->name)); |
sl | 920 | drivers/net/slip.c | slip_unesc(struct slip *sl, unsigned char *s, int count, int error) |
sl | 927 | drivers/net/slip.c | sl->flags |= SLF_ESCAPE; |
sl | 930 | drivers/net/slip.c | if (sl->flags & SLF_ESCAPE) |
sl | 931 | drivers/net/slip.c | sl_enqueue(sl, ESC); |
sl | 933 | drivers/net/slip.c | sl_enqueue(sl, *s); |
sl | 934 | drivers/net/slip.c | sl->flags &= ~SLF_ESCAPE; |
sl | 937 | drivers/net/slip.c | if (sl->flags & SLF_ESCAPE) |
sl | 938 | drivers/net/slip.c | sl_enqueue(sl, END); |
sl | 940 | drivers/net/slip.c | sl_enqueue(sl, *s); |
sl | 941 | drivers/net/slip.c | sl->flags &= ~SLF_ESCAPE; |
sl | 944 | drivers/net/slip.c | if (sl->rcount > 2) |
sl | 945 | drivers/net/slip.c | sl_bump(sl); |
sl | 946 | drivers/net/slip.c | sl_dequeue(sl, sl->rcount); |
sl | 947 | drivers/net/slip.c | sl->rcount = 0; |
sl | 948 | drivers/net/slip.c | sl->flags &= ~(SLF_ESCAPE | SLF_ERROR); |
sl | 951 | drivers/net/slip.c | sl_enqueue(sl, *s); |
sl | 952 | drivers/net/slip.c | sl->flags &= ~SLF_ESCAPE; |
sl | 956 | drivers/net/slip.c | sl->flags |= SLF_ERROR; |
sl | 1007 | drivers/net/slip.c | slip_unesc6(struct slip *sl, unsigned char *s, int count, int error) |
sl | 1014 | drivers/net/slip.c | if (sl->rcount > 8) { /* XXX must be 2 for compressed slip */ |
sl | 1017 | drivers/net/slip.c | sl->rbuff[0], |
sl | 1018 | drivers/net/slip.c | sl->rbuff[1], |
sl | 1019 | drivers/net/slip.c | sl->rbuff[2], |
sl | 1020 | drivers/net/slip.c | sl->rbuff[3] |
sl | 1023 | drivers/net/slip.c | sl_bump(sl); |
sl | 1025 | drivers/net/slip.c | sl_dequeue(sl, sl->rcount); |
sl | 1026 | drivers/net/slip.c | sl->rcount = 0; |
sl | 1027 | drivers/net/slip.c | sl->flags &= ~(SLF_ESCAPE | SLF_ERROR); /* SLF_ESCAPE not used */ |
sl | 1028 | drivers/net/slip.c | sl->xbits = 0; |
sl | 1030 | drivers/net/slip.c | sl->xdata = (sl->xdata << 6) | ((*s - 0x30) & 0x3F); |
sl | 1031 | drivers/net/slip.c | sl->xbits += 6; |
sl | 1032 | drivers/net/slip.c | if (sl->xbits >= 8) { |
sl | 1033 | drivers/net/slip.c | sl->xbits -= 8; |
sl | 1034 | drivers/net/slip.c | c = (unsigned char)(sl->xdata >> sl->xbits); |
sl | 1035 | drivers/net/slip.c | sl_enqueue(sl, c); |
sl | 1041 | drivers/net/slip.c | sl->flags |= SLF_ERROR; |
sl | 1062 | drivers/net/slip.c | struct slip *sl; |
sl | 1066 | drivers/net/slip.c | if ((sl = sl_find(tty)) == NULL) { |
sl | 1077 | drivers/net/slip.c | memcpy_tofs(arg, sl->dev->name, strlen(sl->dev->name) + 1); |
sl | 1081 | drivers/net/slip.c | put_fs_long(sl->mode,(long *)arg); |
sl | 1085 | drivers/net/slip.c | sl->mode=get_fs_long((long *)arg); |
sl | 1087 | drivers/net/slip.c | if(sl->mode & SL_MODE_AX25) |
sl | 1089 | drivers/net/slip.c | sl->dev->addr_len=7; /* sizeof an AX.25 addr */ |
sl | 1090 | drivers/net/slip.c | sl->dev->hard_header_len=17; /* We don't do digipeaters */ |
sl | 1091 | drivers/net/slip.c | sl->dev->type=3; /* AF_AX25 not an AF_INET device */ |
sl | 1095 | drivers/net/slip.c | sl->dev->addr_len=0; /* No mac addr in slip mode */ |
sl | 1096 | drivers/net/slip.c | sl->dev->hard_header_len=0; |
sl | 1097 | drivers/net/slip.c | sl->dev->type=0; |
sl | 1103 | drivers/net/slip.c | return sl_set_mac_address(sl->dev,arg); |
sl | 1116 | drivers/net/slip.c | struct slip *sl; |
sl | 1123 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 1147 | drivers/net/slip.c | sl_initialize(sl, dev); |
sl | 1150 | drivers/net/slip.c | sl->rcount = 0; /* SLIP receiver count */ |
sl | 1151 | drivers/net/slip.c | sl->rpacket = 0; /* #frames received */ |
sl | 1152 | drivers/net/slip.c | sl->roverrun = 0; /* "overrun" counter */ |
sl | 1153 | drivers/net/slip.c | sl->spacket = 0; /* #frames sent out */ |
sl | 1154 | drivers/net/slip.c | sl->sbusy = 0; /* "xmit busy" counter */ |
sl | 1155 | drivers/net/slip.c | sl->errors = 0; /* not used at present */ |
sl | 79 | drivers/net/slip.h | extern void slip_unesc(struct slip *sl, unsigned char *s, int count, int error); |
sl | 80 | drivers/net/slip.h | extern void slip_unesc6(struct slip *sl, unsigned char *s, int count, int error); |
sl | 628 | drivers/scsi/ultrastor.c | struct scatterlist *sl; |
sl | 632 | drivers/scsi/ultrastor.c | sl = (struct scatterlist *) SCpnt->request_buffer; |
sl | 635 | drivers/scsi/ultrastor.c | mscp->sglist[i].address = (unsigned int)sl[i].address; |
sl | 636 | drivers/scsi/ultrastor.c | mscp->sglist[i].num_bytes = sl[i].length; |
sl | 637 | drivers/scsi/ultrastor.c | transfer_length += sl[i].length; |