tag | line | file | source code |
sl | 132 | drivers/net/slip.c | sl_initialize(struct slip *sl, struct device *dev) |
sl | 134 | drivers/net/slip.c | sl->inuse = 0; |
sl | 135 | drivers/net/slip.c | sl->sending = 0; |
sl | 136 | drivers/net/slip.c | sl->escape = 0; |
sl | 137 | drivers/net/slip.c | sl->flags = 0; |
sl | 139 | drivers/net/slip.c | sl->mode = SL_MODE_CSLIP; /* Default */ |
sl | 141 | drivers/net/slip.c | sl->mode = SL_MODE_SLIP; /* Default for non compressors */ |
sl | 144 | drivers/net/slip.c | sl->line = dev->base_addr; |
sl | 145 | drivers/net/slip.c | sl->tty = NULL; |
sl | 146 | drivers/net/slip.c | sl->dev = dev; |
sl | 147 | drivers/net/slip.c | sl->slcomp = NULL; |
sl | 150 | drivers/net/slip.c | sl->rbuff = NULL; |
sl | 151 | drivers/net/slip.c | sl->xbuff = NULL; |
sl | 152 | drivers/net/slip.c | sl->cbuff = NULL; |
sl | 154 | drivers/net/slip.c | sl->rhead = NULL; |
sl | 155 | drivers/net/slip.c | sl->rend = NULL; |
sl | 167 | drivers/net/slip.c | struct slip *sl; |
sl | 172 | drivers/net/slip.c | sl = &sl_ctrl[i]; |
sl | 173 | drivers/net/slip.c | if (sl->tty == tty) return(sl); |
sl | 184 | drivers/net/slip.c | struct slip *sl; |
sl | 190 | drivers/net/slip.c | sl = &sl_ctrl[i]; |
sl | 191 | drivers/net/slip.c | if (sl->inuse == 0) { |
sl | 192 | drivers/net/slip.c | sl->inuse = 1; |
sl | 193 | drivers/net/slip.c | sl->tty = NULL; |
sl | 195 | drivers/net/slip.c | return(sl); |
sl | 205 | drivers/net/slip.c | sl_free(struct slip *sl) |
sl | 209 | drivers/net/slip.c | if (sl->inuse) { |
sl | 212 | drivers/net/slip.c | sl->inuse = 0; |
sl | 213 | drivers/net/slip.c | sl->tty = NULL; |
sl | 222 | drivers/net/slip.c | static void sl_changedmtu(struct slip *sl) |
sl | 224 | drivers/net/slip.c | struct device *dev=sl->dev; |
sl | 227 | drivers/net/slip.c | int omtu=sl->mtu; |
sl | 229 | drivers/net/slip.c | sl->mtu=dev->mtu; |
sl | 241 | drivers/net/slip.c | sl->mtu=omtu; |
sl | 254 | drivers/net/slip.c | tf=(unsigned char *)sl->dev->mem_start; |
sl | 255 | drivers/net/slip.c | sl->dev->mem_start=(unsigned long)tb; |
sl | 256 | drivers/net/slip.c | sl->dev->mem_end=(unsigned long) (sl->dev->mem_start + l); |
sl | 257 | drivers/net/slip.c | rf=(unsigned char *)sl->dev->rmem_start; |
sl | 258 | drivers/net/slip.c | sl->dev->rmem_start=(unsigned long)rb; |
sl | 259 | drivers/net/slip.c | sl->dev->rmem_end=(unsigned long) (sl->dev->rmem_start + l); |
sl | 261 | drivers/net/slip.c | sl->xbuff = (unsigned char *) sl->dev->mem_start; |
sl | 262 | drivers/net/slip.c | sl->rbuff = (unsigned char *) sl->dev->rmem_start; |
sl | 263 | drivers/net/slip.c | sl->rend = (unsigned char *) sl->dev->rmem_end; |
sl | 264 | drivers/net/slip.c | sl->rhead = sl->rbuff; |
sl | 266 | drivers/net/slip.c | cf=sl->cbuff; |
sl | 267 | drivers/net/slip.c | sl->cbuff=cb; |
sl | 269 | drivers/net/slip.c | sl->escape=0; |
sl | 270 | drivers/net/slip.c | sl->sending=0; |
sl | 271 | drivers/net/slip.c | sl->rcount=0; |
sl | 286 | drivers/net/slip.c | sl_enqueue(struct slip *sl, unsigned char c) |
sl | 292 | drivers/net/slip.c | if (sl->rhead < sl->rend) { |
sl | 293 | drivers/net/slip.c | *sl->rhead = c; |
sl | 294 | drivers/net/slip.c | sl->rhead++; |
sl | 295 | drivers/net/slip.c | sl->rcount++; |
sl | 296 | drivers/net/slip.c | } else sl->roverrun++; |
sl | 302 | drivers/net/slip.c | sl_dequeue(struct slip *sl, int i) |
sl | 308 | drivers/net/slip.c | if (sl->rhead > sl->rbuff) { |
sl | 309 | drivers/net/slip.c | sl->rhead -= i; |
sl | 310 | drivers/net/slip.c | sl->rcount -= i; |
sl | 318 | drivers/net/slip.c | sl_lock(struct slip *sl) |
sl | 324 | drivers/net/slip.c | sl->sending = 1; |
sl | 325 | drivers/net/slip.c | sl->dev->tbusy = 1; |
sl | 332 | drivers/net/slip.c | sl_unlock(struct slip *sl) |
sl | 338 | drivers/net/slip.c | sl->sending = 0; |
sl | 339 | drivers/net/slip.c | sl->dev->tbusy = 0; |
sl | 346 | drivers/net/slip.c | sl_bump(struct slip *sl) |
sl | 353 | drivers/net/slip.c | count = sl->rcount; |
sl | 354 | drivers/net/slip.c | if (sl->mode & SL_MODE_CSLIP) { |
sl | 355 | drivers/net/slip.c | if ((c = sl->rbuff[0]) & SL_TYPE_COMPRESSED_TCP) { |
sl | 359 | drivers/net/slip.c | if ((sl->rhead + 80) < sl->rend) { |
sl | 360 | drivers/net/slip.c | sl->rhead += 80; |
sl | 361 | drivers/net/slip.c | sl->rcount += 80; |
sl | 364 | drivers/net/slip.c | sl->roverrun++; |
sl | 371 | drivers/net/slip.c | count = slhc_uncompress(sl->slcomp, sl->rbuff, count); |
sl | 373 | drivers/net/slip.c | sl->errors++; |
sl | 377 | drivers/net/slip.c | sl->rbuff[0] &= 0x4f; |
sl | 378 | drivers/net/slip.c | if (slhc_remember(sl->slcomp, sl->rbuff, count) <= 0) { |
sl | 379 | drivers/net/slip.c | sl->errors++; |
sl | 385 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "<< \"%s\" recv:\r\n", sl->dev->name)); |
sl | 386 | drivers/net/slip.c | ip_dump(sl->rbuff, sl->rcount); |
sl | 391 | drivers/net/slip.c | sl->rcount, sl->rbuff)); |
sl | 393 | drivers/net/slip.c | done = dev_rint(sl->rbuff, count, 0, sl->dev); |
sl | 397 | drivers/net/slip.c | sl->rpacket++; |
sl | 403 | drivers/net/slip.c | sl_next(struct slip *sl) |
sl | 405 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: sl_next(0x%X) called!\n", sl)); |
sl | 406 | drivers/net/slip.c | sl_unlock(sl); |
sl | 407 | drivers/net/slip.c | dev_tint(sl->dev); |
sl | 413 | drivers/net/slip.c | sl_encaps(struct slip *sl, unsigned char *icp, int len) |
sl | 419 | drivers/net/slip.c | DPRINTF((DBG_SLIP, ">> \"%s\" sent:\r\n", sl->dev->name)); |
sl | 423 | drivers/net/slip.c | if(sl->mtu != sl->dev->mtu) /* Someone has been ifconfigging */ |
sl | 424 | drivers/net/slip.c | sl_changedmtu(sl); |
sl | 426 | drivers/net/slip.c | if(len>sl->mtu) /* Sigh, shouldn't occur BUT ... */ |
sl | 428 | drivers/net/slip.c | len=sl->mtu; |
sl | 433 | drivers/net/slip.c | if(sl->mode & SL_MODE_CSLIP) |
sl | 434 | drivers/net/slip.c | len = slhc_compress(sl->slcomp, p, len, sl->cbuff, &p, 1); |
sl | 442 | drivers/net/slip.c | bp = sl->xbuff; |
sl | 471 | drivers/net/slip.c | if(sl->mode & SL_MODE_SLIP6) |
sl | 472 | drivers/net/slip.c | count=slip_esc6(p, (unsigned char *)sl->xbuff,len); |
sl | 474 | drivers/net/slip.c | count=slip_esc(p, (unsigned char *)sl->xbuff,len); |
sl | 476 | drivers/net/slip.c | sl->spacket++; |
sl | 477 | drivers/net/slip.c | bp = sl->xbuff; |
sl | 481 | drivers/net/slip.c | if (tty_write_data(sl->tty, (char *) bp, count, |
sl | 482 | drivers/net/slip.c | (void (*)(void *))sl_next, (void *) sl) == 0) { |
sl | 484 | drivers/net/slip.c | sl_next(sl); |
sl | 494 | drivers/net/slip.c | struct slip *sl; |
sl | 497 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 498 | drivers/net/slip.c | tty = sl->tty; |
sl | 500 | drivers/net/slip.c | dev->name, skb, sl->sending)); |
sl | 507 | drivers/net/slip.c | if (sl->sending) { |
sl | 509 | drivers/net/slip.c | sl->sbusy++; |
sl | 516 | drivers/net/slip.c | if(sl->mode & SL_MODE_AX25) |
sl | 527 | drivers/net/slip.c | sl_lock(sl); |
sl | 528 | drivers/net/slip.c | sl_encaps(sl, (unsigned char *) (skb + 1), skb->len); |
sl | 540 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 541 | drivers/net/slip.c | if(sl->mode&SL_MODE_AX25) |
sl | 554 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 556 | drivers/net/slip.c | if((sl->mode&SL_MODE_AX25) && type!=NET16(ETH_P_AX25)) |
sl | 617 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 619 | drivers/net/slip.c | if(sl->mode&SL_MODE_AX25) |
sl | 630 | drivers/net/slip.c | struct slip *sl=&sl_ctrl[dev->base_addr]; |
sl | 632 | drivers/net/slip.c | if(sl->mode&SL_MODE_AX25) |
sl | 655 | drivers/net/slip.c | struct slip *sl; |
sl | 659 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 660 | drivers/net/slip.c | if (sl->tty == NULL) { |
sl | 661 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: channel %d not connected!\n", sl->line)); |
sl | 664 | drivers/net/slip.c | sl->dev = dev; |
sl | 681 | drivers/net/slip.c | sl->mtu = dev->mtu; |
sl | 682 | drivers/net/slip.c | sl->dev->mem_start = (unsigned long) p; |
sl | 683 | drivers/net/slip.c | sl->dev->mem_end = (unsigned long) (sl->dev->mem_start + l); |
sl | 690 | drivers/net/slip.c | sl->dev->rmem_start = (unsigned long) p; |
sl | 691 | drivers/net/slip.c | sl->dev->rmem_end = (unsigned long) (sl->dev->rmem_start + l); |
sl | 693 | drivers/net/slip.c | sl->xbuff = (unsigned char *) sl->dev->mem_start; |
sl | 694 | drivers/net/slip.c | sl->rbuff = (unsigned char *) sl->dev->rmem_start; |
sl | 695 | drivers/net/slip.c | sl->rend = (unsigned char *) sl->dev->rmem_end; |
sl | 696 | drivers/net/slip.c | sl->rhead = sl->rbuff; |
sl | 698 | drivers/net/slip.c | sl->escape = 0; |
sl | 699 | drivers/net/slip.c | sl->sending = 0; |
sl | 700 | drivers/net/slip.c | sl->rcount = 0; |
sl | 704 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->mem_start); |
sl | 708 | drivers/net/slip.c | sl->cbuff = p; |
sl | 710 | drivers/net/slip.c | sl->slcomp = slhc_init(16, 16); |
sl | 711 | drivers/net/slip.c | if (sl->slcomp == NULL) { |
sl | 712 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->mem_start); |
sl | 713 | drivers/net/slip.c | kfree((unsigned char *)sl->dev->rmem_start); |
sl | 714 | drivers/net/slip.c | kfree(sl->cbuff); |
sl | 719 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: channel %d opened.\n", sl->line)); |
sl | 728 | drivers/net/slip.c | struct slip *sl; |
sl | 730 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 731 | drivers/net/slip.c | if (sl->tty == NULL) { |
sl | 732 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: channel %d not connected!\n", sl->line)); |
sl | 735 | drivers/net/slip.c | sl_free(sl); |
sl | 738 | drivers/net/slip.c | kfree(sl->rbuff); |
sl | 739 | drivers/net/slip.c | kfree(sl->xbuff); |
sl | 740 | drivers/net/slip.c | kfree(sl->cbuff); |
sl | 741 | drivers/net/slip.c | slhc_free(sl->slcomp); |
sl | 743 | drivers/net/slip.c | sl_initialize(sl, dev); |
sl | 745 | drivers/net/slip.c | DPRINTF((DBG_SLIP, "SLIP: channel %d closed.\n", sl->line)); |
sl | 761 | drivers/net/slip.c | struct slip *sl; |
sl | 765 | drivers/net/slip.c | if ((sl = sl_find(tty)) == NULL) return; /* not connected */ |
sl | 767 | drivers/net/slip.c | if(sl->mtu!=sl->dev->mtu) /* Argh! mtu change time! - costs us the packet part received at the change */ |
sl | 768 | drivers/net/slip.c | sl_changedmtu(sl); |
sl | 784 | drivers/net/slip.c | if (sl->escape) { |
sl | 786 | drivers/net/slip.c | sl_enqueue(sl, ESC); |
sl | 788 | drivers/net/slip.c | sl_enqueue(sl, END); |
sl | 791 | drivers/net/slip.c | sl->escape = 0; |
sl | 794 | drivers/net/slip.c | sl->escape = 1; |
sl | 796 | drivers/net/slip.c | if (sl->rcount > 2) sl_bump(sl); |
sl | 797 | drivers/net/slip.c | sl_dequeue(sl, sl->rcount); |
sl | 798 | drivers/net/slip.c | sl->rcount = 0; |
sl | 799 | drivers/net/slip.c | } else sl_enqueue(sl, c); |
sl | 803 | drivers/net/slip.c | if(sl->mode & SL_MODE_SLIP6) |
sl | 804 | drivers/net/slip.c | slip_unesc6(sl,buff,count,error); |
sl | 806 | drivers/net/slip.c | slip_unesc(sl,buff,count,error); |
sl | 823 | drivers/net/slip.c | struct slip *sl; |
sl | 826 | drivers/net/slip.c | if ((sl = sl_find(tty)) != NULL) { |
sl | 828 | drivers/net/slip.c | tty->line, sl->dev->name)); |
sl | 833 | drivers/net/slip.c | if ((sl = sl_alloc()) == NULL) { |
sl | 838 | drivers/net/slip.c | sl->tty = tty; |
sl | 843 | drivers/net/slip.c | (void) sl_open(sl->dev); |
sl | 845 | drivers/net/slip.c | tty->line, sl->dev->name)); |
sl | 848 | drivers/net/slip.c | return(sl->line); |
sl | 861 | drivers/net/slip.c | struct slip *sl; |
sl | 864 | drivers/net/slip.c | if ((sl = sl_find(tty)) == NULL) { |
sl | 869 | drivers/net/slip.c | (void) dev_close(sl->dev); |
sl | 871 | drivers/net/slip.c | tty->line, sl->dev->name)); |
sl | 919 | drivers/net/slip.c | slip_unesc(struct slip *sl, unsigned char *s, int count, int error) |
sl | 926 | drivers/net/slip.c | sl->flags |= SLF_ESCAPE; |
sl | 929 | drivers/net/slip.c | if (sl->flags & SLF_ESCAPE) |
sl | 930 | drivers/net/slip.c | sl_enqueue(sl, ESC); |
sl | 932 | drivers/net/slip.c | sl_enqueue(sl, *s); |
sl | 933 | drivers/net/slip.c | sl->flags &= ~SLF_ESCAPE; |
sl | 936 | drivers/net/slip.c | if (sl->flags & SLF_ESCAPE) |
sl | 937 | drivers/net/slip.c | sl_enqueue(sl, END); |
sl | 939 | drivers/net/slip.c | sl_enqueue(sl, *s); |
sl | 940 | drivers/net/slip.c | sl->flags &= ~SLF_ESCAPE; |
sl | 943 | drivers/net/slip.c | if (sl->rcount > 2) |
sl | 944 | drivers/net/slip.c | sl_bump(sl); |
sl | 945 | drivers/net/slip.c | sl_dequeue(sl, sl->rcount); |
sl | 946 | drivers/net/slip.c | sl->rcount = 0; |
sl | 947 | drivers/net/slip.c | sl->flags &= ~(SLF_ESCAPE | SLF_ERROR); |
sl | 950 | drivers/net/slip.c | sl_enqueue(sl, *s); |
sl | 951 | drivers/net/slip.c | sl->flags &= ~SLF_ESCAPE; |
sl | 955 | drivers/net/slip.c | sl->flags |= SLF_ERROR; |
sl | 1006 | drivers/net/slip.c | slip_unesc6(struct slip *sl, unsigned char *s, int count, int error) |
sl | 1013 | drivers/net/slip.c | if (sl->rcount > 8) { /* XXX must be 2 for compressed slip */ |
sl | 1016 | drivers/net/slip.c | sl->rbuff[0], |
sl | 1017 | drivers/net/slip.c | sl->rbuff[1], |
sl | 1018 | drivers/net/slip.c | sl->rbuff[2], |
sl | 1019 | drivers/net/slip.c | sl->rbuff[3] |
sl | 1022 | drivers/net/slip.c | sl_bump(sl); |
sl | 1024 | drivers/net/slip.c | sl_dequeue(sl, sl->rcount); |
sl | 1025 | drivers/net/slip.c | sl->rcount = 0; |
sl | 1026 | drivers/net/slip.c | sl->flags &= ~(SLF_ESCAPE | SLF_ERROR); /* SLF_ESCAPE not used */ |
sl | 1027 | drivers/net/slip.c | sl->xbits = 0; |
sl | 1029 | drivers/net/slip.c | sl->xdata = (sl->xdata << 6) | ((*s - 0x30) & 0x3F); |
sl | 1030 | drivers/net/slip.c | sl->xbits += 6; |
sl | 1031 | drivers/net/slip.c | if (sl->xbits >= 8) { |
sl | 1032 | drivers/net/slip.c | sl->xbits -= 8; |
sl | 1033 | drivers/net/slip.c | c = (unsigned char)(sl->xdata >> sl->xbits); |
sl | 1034 | drivers/net/slip.c | sl_enqueue(sl, c); |
sl | 1040 | drivers/net/slip.c | sl->flags |= SLF_ERROR; |
sl | 1061 | drivers/net/slip.c | struct slip *sl; |
sl | 1065 | drivers/net/slip.c | if ((sl = sl_find(tty)) == NULL) { |
sl | 1076 | drivers/net/slip.c | memcpy_tofs(arg, sl->dev->name, strlen(sl->dev->name) + 1); |
sl | 1080 | drivers/net/slip.c | put_fs_long(sl->mode,(long *)arg); |
sl | 1084 | drivers/net/slip.c | sl->mode=get_fs_long((long *)arg); |
sl | 1086 | drivers/net/slip.c | if(sl->mode & SL_MODE_AX25) |
sl | 1088 | drivers/net/slip.c | sl->dev->addr_len=7; /* sizeof an AX.25 addr */ |
sl | 1089 | drivers/net/slip.c | sl->dev->hard_header_len=17; /* We don't do digipeaters */ |
sl | 1090 | drivers/net/slip.c | sl->dev->type=3; /* AF_AX25 not an AF_INET device */ |
sl | 1094 | drivers/net/slip.c | sl->dev->addr_len=0; /* No mac addr in slip mode */ |
sl | 1095 | drivers/net/slip.c | sl->dev->hard_header_len=0; |
sl | 1096 | drivers/net/slip.c | sl->dev->type=0; |
sl | 1102 | drivers/net/slip.c | return sl_set_mac_address(sl->dev,arg); |
sl | 1115 | drivers/net/slip.c | struct slip *sl; |
sl | 1122 | drivers/net/slip.c | sl = &sl_ctrl[dev->base_addr]; |
sl | 1145 | drivers/net/slip.c | sl_initialize(sl, dev); |
sl | 1148 | drivers/net/slip.c | sl->rcount = 0; /* SLIP receiver count */ |
sl | 1149 | drivers/net/slip.c | sl->rpacket = 0; /* #frames received */ |
sl | 1150 | drivers/net/slip.c | sl->roverrun = 0; /* "overrun" counter */ |
sl | 1151 | drivers/net/slip.c | sl->spacket = 0; /* #frames sent out */ |
sl | 1152 | drivers/net/slip.c | sl->sbusy = 0; /* "xmit busy" counter */ |
sl | 1153 | drivers/net/slip.c | sl->errors = 0; /* not used at present */ |
sl | 78 | drivers/net/slip.h | extern void slip_unesc(struct slip *sl, unsigned char *s, int count, int error); |
sl | 79 | drivers/net/slip.h | extern void slip_unesc6(struct slip *sl, unsigned char *s, int count, int error); |
sl | 642 | drivers/scsi/ultrastor.c | struct scatterlist *sl; |
sl | 646 | drivers/scsi/ultrastor.c | sl = (struct scatterlist *) SCpnt->request_buffer; |
sl | 649 | drivers/scsi/ultrastor.c | mscp->sglist[i].address = (unsigned int)sl[i].address; |
sl | 650 | drivers/scsi/ultrastor.c | mscp->sglist[i].num_bytes = sl[i].length; |
sl | 651 | drivers/scsi/ultrastor.c | transfer_length += sl[i].length; |