tag | line | file | source code |
sl | 133 | drivers/net/slip.c | sl_initialize(struct slip *sl, struct device *dev) |
sl | 135 | drivers/net/slip.c | sl->inuse = 0; |
sl | 136 | drivers/net/slip.c | sl->sending = 0; |
sl | 137 | drivers/net/slip.c | sl->escape = 0; |
sl | 138 | drivers/net/slip.c | sl->flags = 0; |
sl | 140 | drivers/net/slip.c | sl->mode = SL_MODE_ADAPTIVE; /* automatic CSLIP recognition */ |
sl | 143 | drivers/net/slip.c | sl->mode = SL_MODE_CSLIP | SL_MODE_ADAPTIVE; /* Default */ |
sl | 145 | drivers/net/slip.c | sl->mode = SL_MODE_SLIP; /* Default for non compressors */ |
sl | 149 | drivers/net/slip.c | sl->line = dev->base_addr; |
sl | 150 | drivers/net/slip.c | sl->tty = NULL; |
sl | 151 | drivers/net/slip.c | sl->dev = dev; |
sl | 152 | drivers/net/slip.c | sl->slcomp = NULL; |
sl | 155 | drivers/net/slip.c | sl->rbuff = NULL; |
sl | 156 | drivers/net/slip.c | sl->xbuff = NULL; |
sl | 157 | drivers/net/slip.c | sl->cbuff = NULL; |
sl | 159 | drivers/net/slip.c | sl->rhead = NULL; |
sl | 160 | drivers/net/slip.c | sl->rend = NULL; |
sl | 172 | drivers/net/slip.c | struct slip *sl; |
sl | 177 | drivers/net/slip.c | sl = &sl_ctrl[i]; |
sl | 178 | drivers/net/slip.c | if (sl->tty == tty) return(sl); |
sl | 189 | drivers/net/slip.c | struct slip *sl; |
sl | 195 | drivers/net/slip.c | sl = &sl_ctrl[i]; |
sl | 196 | drivers/net/slip.c | if (sl->inuse == 0) { |
sl | 197 | drivers/net/slip.c | sl->inuse = 1; |
sl | 198 | drivers/net/slip.c | sl->tty = NULL; |
sl | 200 | drivers/net/slip.c | return(sl); |
sl | 210 | drivers/net/slip.c | sl_free(struct slip *sl) |
sl | 214 | drivers/net/slip.c | if (sl->inuse) { |
sl | 217 | drivers/net/slip.c | sl->inuse = 0; |
sl | 218 | drivers/net/slip.c | sl->tty = NULL; |
sl | 227 | drivers/net/slip.c | static void sl_changedmtu(struct slip *sl) |
sl | 229 | drivers/net/slip.c | struct device *dev=sl->dev; |
sl | 232 | drivers/net/slip.c | int omtu=sl->mtu; |
sl | 234 | drivers/net/slip.c | sl->mtu=dev->mtu; |
sl | 253 | drivers/net/slip.c | sl->mtu=omtu; |
sl | 266 | drivers/net/slip.c | tf=(unsigned char *)sl->dev->mem_start; |
sl | 267 | drivers/net/slip.c | sl->dev->mem_start=(unsigned long)tb; |
sl | 268 | drivers/net/slip.c | sl->dev->mem_end=(unsigned long) (sl->dev->mem_start + l); |
sl | 269 | drivers/net/slip.c | rf=(unsigned char *)sl->dev->rmem_start; |
sl | 270 | drivers/net/slip.c | sl->dev->rmem_start=(unsigned long)rb; |
sl | 271 | drivers/net/slip.c | sl->dev->rmem_end=(unsigned long) (sl->dev->rmem_start + l); |
sl | 273 | drivers/net/slip.c | sl->xbuff = (unsigned char *) sl->dev->mem_start; |
sl | 274 | drivers/net/slip.c | sl->rbuff = (unsigned char *) sl->dev->rmem_start; |
sl | 275 | drivers/net/slip.c | sl->rend = (unsigned char *) sl->dev->rmem_end; |
sl | 276 | drivers/net/slip.c | sl->rhead = sl->rbuff; |
sl | 278 | drivers/net/slip.c | cf=sl->cbuff; |
sl | 279 | drivers/net/slip.c | sl->cbuff=cb; |
sl | 281 | drivers/net/slip.c | sl->escape=0; |
sl | 282 | drivers/net/slip.c | sl->sending=0; |
sl | 283 | drivers/net/slip.c | sl->rcount=0; |
sl | 298 | drivers/net/slip.c | sl_enqueue(struct slip *sl, unsigned char c) |
sl | 304 | drivers/net/slip.c | if (sl->rhead < sl->rend) { |
sl | 305 | drivers/net/slip.c | *sl->rhead = c; |
sl | 306 | drivers/net/slip.c | sl->rhead++; |
sl | 307 | drivers/net/slip.c | sl->rcount++; |
sl | 308 | drivers/net/slip.c | } else sl->roverrun++; |
sl | 314 | drivers/net/slip.c | sl_dequeue(struct slip *sl, int i) |
sl | 320 | drivers/net/slip.c | if (sl->rhead > sl->rbuff) { |
sl | 321 | drivers/net/slip.c | sl->rhead -= i; |
sl | 322 | drivers/net/slip.c | sl->rcount -= i; |
sl | 330 | drivers/net/slip.c | sl_lock(struct slip *sl) |
sl | 336 | drivers/net/slip.c | sl->sending = 1; |
sl | 337 | drivers/net/slip.c | sl->dev->tbusy = 1; |
sl | 344 | drivers/net/slip.c | sl_unlock(struct slip *sl) |
sl | 350 | drivers/net/slip.c | sl->sending = 0; |
sl | 351 | drivers/net/slip.c | sl->dev->tbusy = 0; |
sl | 358 | drivers/net/slip.c | sl_bump(struct slip *sl) |
sl | 365 | drivers/net/slip.c | count = sl->rcount; |
sl | 366 | drivers/net/slip.c | if (sl->mode & (SL_MODE_ADAPTIVE | SL_MODE_CSLIP)) { |
sl | 367 | drivers/net/slip.c | if ((c = sl->rbuff[0]) & SL_TYPE_COMPRESSED_TCP) { |
sl | 370 | drivers/net/slip.c | if (!(sl->mode & SL_MODE_CSLIP)) { |
sl | 378 | drivers/net/slip.c | if ((sl->rhead + 80) < sl->rend) { |
sl | 379 | drivers/net/slip.c | sl->rhead += 80; |
sl | 380 | drivers/net/slip.c | sl->rcount += 80; |
sl | 383 | drivers/net/slip.c | sl->roverrun++; |
sl | 390 | drivers/net/slip.c | count = slhc_uncompress(sl->slcomp, sl->rbuff, count); |
sl | 392 | drivers/net/slip.c | sl->errors++; |
sl | 396 | drivers/net/slip.c | if (!(sl->mode & SL_MODE_CSLIP)) { |
sl | 398 | drivers/net/slip.c | sl->mode |= SL_MODE_CSLIP; |
sl | 401 | drivers/net/slip.c | sl->rbuff[0] &= 0x4f; |
sl | 402 | drivers/net/slip.c | if (slhc_remember(sl->slcomp, sl->rbuff, count) <= 0) { |
sl | 403 | drivers/net/slip.c | sl->errors++; |
sl | 409 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "<< \"%s\" recv:\r\n", sl->dev->name)); |
sl | 410 | drivers/net/slip.c | ip_dump(sl->rbuff, sl->rcount); |
sl | 415 | drivers/net/slip.c | sl->rcount, sl->rbuff)); |
sl | 417 | drivers/net/slip.c | done = dev_rint(sl->rbuff, count, 0, sl->dev); |
sl | 421 | drivers/net/slip.c | sl->rpacket++; |
sl | 427 | drivers/net/slip.c | sl_next(struct slip *sl) |
sl | 429 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: sl_next(0x%X) called!\n", sl)); |
sl | 430 | drivers/net/slip.c | sl_unlock(sl); |
sl | 431 | drivers/net/slip.c | dev_tint(sl->dev); |
sl | 437 | drivers/net/slip.c | sl_encaps(struct slip *sl, unsigned char *icp, int len) |
sl | 443 | drivers/net/slip.c | DPRINTF((DBG_SLIP, ">> \"%s\" sent:\r\n", sl->dev->name)); |
sl | 447 | drivers/net/slip.c | if(sl->mtu != sl->dev->mtu) /* Someone has been ifconfigging */ |
sl | 448 | drivers/net/slip.c | sl_changedmtu(sl); |
sl | 450 | drivers/net/slip.c | if(len>sl->mtu) /* Sigh, shouldn't occur BUT ... */ |
sl | 452 | drivers/net/slip.c | len=sl->mtu; |
sl | 457 | drivers/net/slip.c | if(sl->mode & SL_MODE_CSLIP) |
sl | 458 | drivers/net/slip.c | len = slhc_compress(sl->slcomp, p, len, sl->cbuff, &p, 1); |
sl | 466 | drivers/net/slip.c | bp = sl->xbuff; |
sl | 495 | drivers/net/slip.c | if(sl->mode & SL_MODE_SLIP6) |
sl | 496 | drivers/net/slip.c | count=slip_esc6(p, (unsigned char *)sl->xbuff,len); |
sl | 498 | drivers/net/slip.c | count=slip_esc(p, (unsigned char *)sl->xbuff,len); |
sl | 500 | drivers/net/slip.c | sl->spacket++; |
sl | 501 | drivers/net/slip.c | bp = sl->xbuff; |
sl | 505 | drivers/net/slip.c | if (tty_write_data(sl->tty, (char *) bp, count, |
sl | 506 | drivers/net/slip.c | (void (*)(void *))sl_next, (void *) sl) == 0) { |
sl | 508 | drivers/net/slip.c | sl_next(sl); |
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 | tty = sl->tty; |
sl | 540 | drivers/net/slip.c | dev->name, skb, sl->sending)); |
sl | 547 | drivers/net/slip.c | if (sl->sending) { |
sl | 549 | drivers/net/slip.c | sl->sbusy++; |
sl | 556 | drivers/net/slip.c | if(sl->mode & SL_MODE_AX25) |
sl | 567 | drivers/net/slip.c | sl_lock(sl); |
sl | 569 | drivers/net/slip.c | if (!(sl->mode & SL_MODE_AX25)) { |
sl | 578 | drivers/net/slip.c | sl_encaps(sl, skb->data, size); |
sl | 590 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 591 | drivers/net/slip.c | if(sl->mode&SL_MODE_AX25) |
sl | 604 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 605 | drivers/net/slip.c | if((sl->mode&SL_MODE_AX25) && type!=NET16(ETH_P_AX25)) |
sl | 618 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 620 | drivers/net/slip.c | if(sl->mode&SL_MODE_AX25) |
sl | 631 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 633 | drivers/net/slip.c | if(sl->mode&SL_MODE_AX25) |
sl | 644 | drivers/net/slip.c | struct slip *sl; |
sl | 648 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 649 | drivers/net/slip.c | if (sl->tty == NULL) { |
sl | 650 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: channel %d not connected!\n", sl->line)); |
sl | 653 | drivers/net/slip.c | sl->dev = dev; |
sl | 678 | drivers/net/slip.c | sl->mtu = dev->mtu; |
sl | 679 | drivers/net/slip.c | sl->dev->mem_start = (unsigned long) p; |
sl | 680 | drivers/net/slip.c | sl->dev->mem_end = (unsigned long) (sl->dev->mem_start + l); |
sl | 687 | drivers/net/slip.c | sl->dev->rmem_start = (unsigned long) p; |
sl | 688 | drivers/net/slip.c | sl->dev->rmem_end = (unsigned long) (sl->dev->rmem_start + l); |
sl | 690 | drivers/net/slip.c | sl->xbuff = (unsigned char *) sl->dev->mem_start; |
sl | 691 | drivers/net/slip.c | sl->rbuff = (unsigned char *) sl->dev->rmem_start; |
sl | 692 | drivers/net/slip.c | sl->rend = (unsigned char *) sl->dev->rmem_end; |
sl | 693 | drivers/net/slip.c | sl->rhead = sl->rbuff; |
sl | 695 | drivers/net/slip.c | sl->escape = 0; |
sl | 696 | drivers/net/slip.c | sl->sending = 0; |
sl | 697 | drivers/net/slip.c | sl->rcount = 0; |
sl | 701 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->mem_start); |
sl | 705 | drivers/net/slip.c | sl->cbuff = p; |
sl | 707 | drivers/net/slip.c | sl->slcomp = slhc_init(16, 16); |
sl | 708 | drivers/net/slip.c | if (sl->slcomp == NULL) { |
sl | 709 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->mem_start); |
sl | 710 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->rmem_start); |
sl | 711 | drivers/net/slip.c | kfree(sl->cbuff); |
sl | 720 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: channel %d opened.\n", sl->line)); |
sl | 729 | drivers/net/slip.c | struct slip *sl; |
sl | 731 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 732 | drivers/net/slip.c | if (sl->tty == NULL) { |
sl | 733 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: channel %d not connected!\n", sl->line)); |
sl | 736 | drivers/net/slip.c | sl_free(sl); |
sl | 739 | drivers/net/slip.c | kfree(sl->rbuff); |
sl | 740 | drivers/net/slip.c | kfree(sl->xbuff); |
sl | 741 | drivers/net/slip.c | kfree(sl->cbuff); |
sl | 742 | drivers/net/slip.c | slhc_free(sl->slcomp); |
sl | 744 | drivers/net/slip.c | sl_initialize(sl, dev); |
sl | 746 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: channel %d closed.\n", sl->line)); |
sl | 762 | drivers/net/slip.c | struct slip *sl; |
sl | 766 | drivers/net/slip.c | if ((sl = sl_find(tty)) == NULL) return; /* not connected */ |
sl | 768 | drivers/net/slip.c | if(sl->mtu!=sl->dev->mtu) /* Argh! mtu change time! - costs us the packet part received at the change */ |
sl | 769 | drivers/net/slip.c | sl_changedmtu(sl); |
sl | 785 | drivers/net/slip.c | if (sl->escape) { |
sl | 787 | drivers/net/slip.c | sl_enqueue(sl, ESC); |
sl | 789 | drivers/net/slip.c | sl_enqueue(sl, END); |
sl | 792 | drivers/net/slip.c | sl->escape = 0; |
sl | 795 | drivers/net/slip.c | sl->escape = 1; |
sl | 797 | drivers/net/slip.c | if (sl->rcount > 2) sl_bump(sl); |
sl | 798 | drivers/net/slip.c | sl_dequeue(sl, sl->rcount); |
sl | 799 | drivers/net/slip.c | sl->rcount = 0; |
sl | 800 | drivers/net/slip.c | } else sl_enqueue(sl, c); |
sl | 804 | drivers/net/slip.c | if(sl->mode & SL_MODE_SLIP6) |
sl | 805 | drivers/net/slip.c | slip_unesc6(sl,buff,count,error); |
sl | 807 | drivers/net/slip.c | slip_unesc(sl,buff,count,error); |
sl | 824 | drivers/net/slip.c | struct slip *sl; |
sl | 827 | drivers/net/slip.c | if ((sl = sl_find(tty)) != NULL) { |
sl | 829 | drivers/net/slip.c | tty->line, sl->dev->name)); |
sl | 834 | drivers/net/slip.c | if ((sl = sl_alloc()) == NULL) { |
sl | 839 | drivers/net/slip.c | sl->tty = tty; |
sl | 844 | drivers/net/slip.c | (void) sl_open(sl->dev); |
sl | 846 | drivers/net/slip.c | tty->line, sl->dev->name)); |
sl | 849 | drivers/net/slip.c | return(sl->line); |
sl | 857 | drivers/net/slip.c | struct slip *sl; |
sl | 861 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 862 | drivers/net/slip.c | if (! sl) |
sl | 867 | drivers/net/slip.c | stats.rx_packets = sl->rpacket; |
sl | 868 | drivers/net/slip.c | stats.rx_over_errors = sl->roverrun; |
sl | 869 | drivers/net/slip.c | stats.tx_packets = sl->spacket; |
sl | 870 | drivers/net/slip.c | stats.tx_dropped = sl->sbusy; |
sl | 871 | drivers/net/slip.c | stats.rx_errors = sl->errors; |
sl | 873 | drivers/net/slip.c | comp = sl->slcomp; |
sl | 893 | drivers/net/slip.c | struct slip *sl; |
sl | 896 | drivers/net/slip.c | if ((sl = sl_find(tty)) == NULL) { |
sl | 901 | drivers/net/slip.c | (void) dev_close(sl->dev); |
sl | 903 | drivers/net/slip.c | tty->line, sl->dev->name)); |
sl | 951 | drivers/net/slip.c | slip_unesc(struct slip *sl, unsigned char *s, int count, int error) |
sl | 958 | drivers/net/slip.c | sl->flags |= SLF_ESCAPE; |
sl | 961 | drivers/net/slip.c | if (sl->flags & SLF_ESCAPE) |
sl | 962 | drivers/net/slip.c | sl_enqueue(sl, ESC); |
sl | 964 | drivers/net/slip.c | sl_enqueue(sl, *s); |
sl | 965 | drivers/net/slip.c | sl->flags &= ~SLF_ESCAPE; |
sl | 968 | drivers/net/slip.c | if (sl->flags & SLF_ESCAPE) |
sl | 969 | drivers/net/slip.c | sl_enqueue(sl, END); |
sl | 971 | drivers/net/slip.c | sl_enqueue(sl, *s); |
sl | 972 | drivers/net/slip.c | sl->flags &= ~SLF_ESCAPE; |
sl | 975 | drivers/net/slip.c | if (sl->rcount > 2) |
sl | 976 | drivers/net/slip.c | sl_bump(sl); |
sl | 977 | drivers/net/slip.c | sl_dequeue(sl, sl->rcount); |
sl | 978 | drivers/net/slip.c | sl->rcount = 0; |
sl | 979 | drivers/net/slip.c | sl->flags &= ~(SLF_ESCAPE | SLF_ERROR); |
sl | 982 | drivers/net/slip.c | sl_enqueue(sl, *s); |
sl | 983 | drivers/net/slip.c | sl->flags &= ~SLF_ESCAPE; |
sl | 987 | drivers/net/slip.c | sl->flags |= SLF_ERROR; |
sl | 1038 | drivers/net/slip.c | slip_unesc6(struct slip *sl, unsigned char *s, int count, int error) |
sl | 1045 | drivers/net/slip.c | if (sl->rcount > 8) { /* XXX must be 2 for compressed slip */ |
sl | 1048 | drivers/net/slip.c | sl->rbuff[0], |
sl | 1049 | drivers/net/slip.c | sl->rbuff[1], |
sl | 1050 | drivers/net/slip.c | sl->rbuff[2], |
sl | 1051 | drivers/net/slip.c | sl->rbuff[3] |
sl | 1054 | drivers/net/slip.c | sl_bump(sl); |
sl | 1056 | drivers/net/slip.c | sl_dequeue(sl, sl->rcount); |
sl | 1057 | drivers/net/slip.c | sl->rcount = 0; |
sl | 1058 | drivers/net/slip.c | sl->flags &= ~(SLF_ESCAPE | SLF_ERROR); /* SLF_ESCAPE not used */ |
sl | 1059 | drivers/net/slip.c | sl->xbits = 0; |
sl | 1061 | drivers/net/slip.c | sl->xdata = (sl->xdata << 6) | ((*s - 0x30) & 0x3F); |
sl | 1062 | drivers/net/slip.c | sl->xbits += 6; |
sl | 1063 | drivers/net/slip.c | if (sl->xbits >= 8) { |
sl | 1064 | drivers/net/slip.c | sl->xbits -= 8; |
sl | 1065 | drivers/net/slip.c | c = (unsigned char)(sl->xdata >> sl->xbits); |
sl | 1066 | drivers/net/slip.c | sl_enqueue(sl, c); |
sl | 1072 | drivers/net/slip.c | sl->flags |= SLF_ERROR; |
sl | 1093 | drivers/net/slip.c | struct slip *sl; |
sl | 1097 | drivers/net/slip.c | if ((sl = sl_find(tty)) == NULL) { |
sl | 1108 | drivers/net/slip.c | memcpy_tofs(arg, sl->dev->name, strlen(sl->dev->name) + 1); |
sl | 1112 | drivers/net/slip.c | put_fs_long(sl->mode,(long *)arg); |
sl | 1116 | drivers/net/slip.c | sl->mode=get_fs_long((long *)arg); |
sl | 1118 | drivers/net/slip.c | if(sl->mode & SL_MODE_AX25) |
sl | 1120 | drivers/net/slip.c | sl->dev->addr_len=7; /* sizeof an AX.25 addr */ |
sl | 1121 | drivers/net/slip.c | sl->dev->hard_header_len=17; /* We don't do digipeaters */ |
sl | 1122 | drivers/net/slip.c | sl->dev->type=3; /* AF_AX25 not an AF_INET device */ |
sl | 1126 | drivers/net/slip.c | sl->dev->addr_len=0; /* No mac addr in slip mode */ |
sl | 1127 | drivers/net/slip.c | sl->dev->hard_header_len=0; |
sl | 1128 | drivers/net/slip.c | sl->dev->type=0; |
sl | 1134 | drivers/net/slip.c | return sl_set_mac_address(sl->dev,arg); |
sl | 1147 | drivers/net/slip.c | struct slip *sl; |
sl | 1154 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 1178 | drivers/net/slip.c | sl_initialize(sl, dev); |
sl | 1181 | drivers/net/slip.c | sl->rcount = 0; /* SLIP receiver count */ |
sl | 1182 | drivers/net/slip.c | sl->rpacket = 0; /* #frames received */ |
sl | 1183 | drivers/net/slip.c | sl->roverrun = 0; /* "overrun" counter */ |
sl | 1184 | drivers/net/slip.c | sl->spacket = 0; /* #frames sent out */ |
sl | 1185 | drivers/net/slip.c | sl->sbusy = 0; /* "xmit busy" counter */ |
sl | 1186 | 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; |