tag | line | file | source code |
sl | 94 | drivers/net/slip.c | static void slip_unesc(struct slip *sl, unsigned char c); |
sl | 97 | drivers/net/slip.c | static void slip_unesc6(struct slip *sl, unsigned char c); |
sl | 105 | drivers/net/slip.c | struct slip *sl; |
sl | 109 | drivers/net/slip.c | sl = &sl_ctrl[i]; |
sl | 110 | drivers/net/slip.c | if (!set_bit(SLF_INUSE, &sl->flags)) { |
sl | 111 | drivers/net/slip.c | return sl; |
sl | 120 | drivers/net/slip.c | sl_free(struct slip *sl) |
sl | 123 | drivers/net/slip.c | if (sl->rbuff) { |
sl | 124 | drivers/net/slip.c | kfree(sl->rbuff); |
sl | 126 | drivers/net/slip.c | sl->rbuff = NULL; |
sl | 127 | drivers/net/slip.c | if (sl->xbuff) { |
sl | 128 | drivers/net/slip.c | kfree(sl->xbuff); |
sl | 130 | drivers/net/slip.c | sl->xbuff = NULL; |
sl | 133 | drivers/net/slip.c | if (sl->slcomp) { |
sl | 134 | drivers/net/slip.c | sl->rx_compressed += sl->slcomp->sls_i_compressed; |
sl | 135 | drivers/net/slip.c | sl->rx_dropped += sl->slcomp->sls_i_tossed; |
sl | 136 | drivers/net/slip.c | sl->tx_compressed += sl->slcomp->sls_o_compressed; |
sl | 137 | drivers/net/slip.c | sl->tx_misses += sl->slcomp->sls_o_misses; |
sl | 139 | drivers/net/slip.c | if (sl->cbuff) { |
sl | 140 | drivers/net/slip.c | kfree(sl->cbuff); |
sl | 142 | drivers/net/slip.c | sl->cbuff = NULL; |
sl | 143 | drivers/net/slip.c | if(sl->slcomp) |
sl | 144 | drivers/net/slip.c | slhc_free(sl->slcomp); |
sl | 145 | drivers/net/slip.c | sl->slcomp = NULL; |
sl | 148 | drivers/net/slip.c | if (!clear_bit(SLF_INUSE, &sl->flags)) { |
sl | 149 | drivers/net/slip.c | printk("%s: sl_free for already free unit.\n", sl->dev->name); |
sl | 157 | drivers/net/slip.c | static void sl_changedmtu(struct slip *sl) |
sl | 159 | drivers/net/slip.c | struct device *dev = sl->dev; |
sl | 189 | drivers/net/slip.c | sl->dev->name); |
sl | 190 | drivers/net/slip.c | dev->mtu = sl->mtu; |
sl | 207 | drivers/net/slip.c | oxbuff = sl->xbuff; |
sl | 208 | drivers/net/slip.c | sl->xbuff = xbuff; |
sl | 209 | drivers/net/slip.c | orbuff = sl->rbuff; |
sl | 210 | drivers/net/slip.c | sl->rbuff = rbuff; |
sl | 212 | drivers/net/slip.c | ocbuff = sl->cbuff; |
sl | 213 | drivers/net/slip.c | sl->cbuff = cbuff; |
sl | 215 | drivers/net/slip.c | if (sl->xleft) { |
sl | 216 | drivers/net/slip.c | if (sl->xleft <= len) { |
sl | 217 | drivers/net/slip.c | memcpy(sl->xbuff, sl->xhead, sl->xleft); |
sl | 219 | drivers/net/slip.c | sl->xleft = 0; |
sl | 220 | drivers/net/slip.c | sl->tx_dropped++; |
sl | 223 | drivers/net/slip.c | sl->xhead = sl->xbuff; |
sl | 225 | drivers/net/slip.c | if (sl->rcount) { |
sl | 226 | drivers/net/slip.c | if (sl->rcount <= len) { |
sl | 227 | drivers/net/slip.c | memcpy(sl->rbuff, orbuff, sl->rcount); |
sl | 229 | drivers/net/slip.c | sl->rcount = 0; |
sl | 230 | drivers/net/slip.c | sl->rx_over_errors++; |
sl | 231 | drivers/net/slip.c | set_bit(SLF_ERROR, &sl->flags); |
sl | 235 | drivers/net/slip.c | sl->mtu = dev->mtu + 73; |
sl | 237 | drivers/net/slip.c | sl->mtu = dev->mtu; |
sl | 239 | drivers/net/slip.c | sl->buffsize = len; |
sl | 259 | drivers/net/slip.c | sl_lock(struct slip *sl) |
sl | 261 | drivers/net/slip.c | if (set_bit(0, (void *) &sl->dev->tbusy)) { |
sl | 262 | drivers/net/slip.c | printk("%s: trying to lock already locked device!\n", sl->dev->name); |
sl | 269 | drivers/net/slip.c | sl_unlock(struct slip *sl) |
sl | 271 | drivers/net/slip.c | if (!clear_bit(0, (void *)&sl->dev->tbusy)) { |
sl | 272 | drivers/net/slip.c | printk("%s: trying to unlock already unlocked device!\n", sl->dev->name); |
sl | 278 | drivers/net/slip.c | sl_bump(struct slip *sl) |
sl | 283 | drivers/net/slip.c | count = sl->rcount; |
sl | 285 | drivers/net/slip.c | if (sl->mode & (SL_MODE_ADAPTIVE | SL_MODE_CSLIP)) { |
sl | 287 | drivers/net/slip.c | if ((c = sl->rbuff[0]) & SL_TYPE_COMPRESSED_TCP) { |
sl | 289 | drivers/net/slip.c | if (!(sl->mode & SL_MODE_CSLIP)) { |
sl | 290 | drivers/net/slip.c | printk("%s: compressed packet ignored\n", sl->dev->name); |
sl | 294 | drivers/net/slip.c | if (count + 80 > sl->buffsize) { |
sl | 295 | drivers/net/slip.c | sl->rx_over_errors++; |
sl | 298 | drivers/net/slip.c | count = slhc_uncompress(sl->slcomp, sl->rbuff, count); |
sl | 303 | drivers/net/slip.c | if (!(sl->mode & SL_MODE_CSLIP)) { |
sl | 305 | drivers/net/slip.c | sl->mode |= SL_MODE_CSLIP; |
sl | 306 | drivers/net/slip.c | sl->mode &= ~SL_MODE_ADAPTIVE; |
sl | 307 | drivers/net/slip.c | printk("%s: header compression turned on\n", sl->dev->name); |
sl | 309 | drivers/net/slip.c | sl->rbuff[0] &= 0x4f; |
sl | 310 | drivers/net/slip.c | if (slhc_remember(sl->slcomp, sl->rbuff, count) <= 0) { |
sl | 319 | drivers/net/slip.c | printk("%s: memory squeeze, dropping packet.\n", sl->dev->name); |
sl | 320 | drivers/net/slip.c | sl->rx_dropped++; |
sl | 323 | drivers/net/slip.c | skb->dev = sl->dev; |
sl | 324 | drivers/net/slip.c | memcpy(skb_put(skb,count), sl->rbuff, count); |
sl | 326 | drivers/net/slip.c | if(sl->mode&(SL_MODE_AX25|SL_MODE_AX25VC)) |
sl | 331 | drivers/net/slip.c | sl->rx_packets++; |
sl | 336 | drivers/net/slip.c | sl_encaps(struct slip *sl, unsigned char *icp, int len) |
sl | 343 | drivers/net/slip.c | if (sl->mtu != sl->dev->mtu + 73) { /* Someone has been ifconfigging */ |
sl | 345 | drivers/net/slip.c | if (sl->mtu != sl->dev->mtu) { /* Someone has been ifconfigging */ |
sl | 347 | drivers/net/slip.c | sl_changedmtu(sl); |
sl | 350 | drivers/net/slip.c | if (len > sl->mtu) { /* Sigh, shouldn't occur BUT ... */ |
sl | 351 | drivers/net/slip.c | len = sl->mtu; |
sl | 352 | drivers/net/slip.c | printk ("%s: truncating oversized transmit packet!\n", sl->dev->name); |
sl | 353 | drivers/net/slip.c | sl->tx_dropped++; |
sl | 354 | drivers/net/slip.c | sl_unlock(sl); |
sl | 360 | drivers/net/slip.c | if (sl->mode & SL_MODE_CSLIP) { |
sl | 361 | drivers/net/slip.c | len = slhc_compress(sl->slcomp, p, len, sl->cbuff, &p, 1); |
sl | 365 | drivers/net/slip.c | if(sl->mode & SL_MODE_SLIP6) |
sl | 366 | drivers/net/slip.c | count = slip_esc6(p, (unsigned char *) sl->xbuff, len); |
sl | 369 | drivers/net/slip.c | count = slip_esc(p, (unsigned char *) sl->xbuff, len); |
sl | 379 | drivers/net/slip.c | sl->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); |
sl | 380 | drivers/net/slip.c | actual = sl->tty->driver.write(sl->tty, 0, sl->xbuff, count); |
sl | 382 | drivers/net/slip.c | sl->dev->trans_start = jiffies; |
sl | 384 | drivers/net/slip.c | sl->xleft = count - actual; |
sl | 385 | drivers/net/slip.c | sl->xhead = sl->xbuff + actual; |
sl | 395 | drivers/net/slip.c | struct slip *sl = (struct slip *) tty->disc_data; |
sl | 398 | drivers/net/slip.c | if (!sl || sl->magic != SLIP_MAGIC || !sl->dev->start) { |
sl | 402 | drivers/net/slip.c | if (sl->xleft <= 0) { |
sl | 405 | drivers/net/slip.c | sl->tx_packets++; |
sl | 407 | drivers/net/slip.c | sl_unlock(sl); |
sl | 412 | drivers/net/slip.c | actual = tty->driver.write(tty, 0, sl->xhead, sl->xleft); |
sl | 413 | drivers/net/slip.c | sl->xleft -= actual; |
sl | 414 | drivers/net/slip.c | sl->xhead += actual; |
sl | 421 | drivers/net/slip.c | struct slip *sl = &sl_ctrl[dev->base_addr]; |
sl | 447 | drivers/net/slip.c | (sl->tty->driver.chars_in_buffer(sl->tty) || sl->xleft) ? |
sl | 449 | drivers/net/slip.c | sl->xleft = 0; |
sl | 450 | drivers/net/slip.c | sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); |
sl | 451 | drivers/net/slip.c | sl_unlock(sl); |
sl | 459 | drivers/net/slip.c | sl_lock(sl); |
sl | 460 | drivers/net/slip.c | sl_encaps(sl, skb->data, skb->len); |
sl | 476 | drivers/net/slip.c | struct slip *sl = &sl_ctrl[dev->base_addr]; |
sl | 478 | drivers/net/slip.c | if (((sl->mode & SL_MODE_AX25) || (sl->mode & SL_MODE_AX25VC)) && type != htons(ETH_P_AX25)) { |
sl | 494 | drivers/net/slip.c | struct slip *sl = &sl_ctrl[dev->base_addr]; |
sl | 496 | drivers/net/slip.c | if ((sl->mode & SL_MODE_AX25) || (sl->mode & SL_MODE_AX25VC)) { |
sl | 509 | drivers/net/slip.c | struct slip *sl = &sl_ctrl[dev->base_addr]; |
sl | 512 | drivers/net/slip.c | if (sl->tty == NULL) { |
sl | 532 | drivers/net/slip.c | sl->rbuff = (unsigned char *) kmalloc(len + 4, GFP_KERNEL); |
sl | 533 | drivers/net/slip.c | if (sl->rbuff == NULL) { |
sl | 536 | drivers/net/slip.c | sl->xbuff = (unsigned char *) kmalloc(len + 4, GFP_KERNEL); |
sl | 537 | drivers/net/slip.c | if (sl->xbuff == NULL) { |
sl | 541 | drivers/net/slip.c | sl->cbuff = (unsigned char *) kmalloc(len + 4, GFP_KERNEL); |
sl | 542 | drivers/net/slip.c | if (sl->cbuff == NULL) { |
sl | 545 | drivers/net/slip.c | sl->slcomp = slhc_init(16, 16); |
sl | 546 | drivers/net/slip.c | if (sl->slcomp == NULL) { |
sl | 552 | drivers/net/slip.c | sl->mtu = dev->mtu + 73; |
sl | 554 | drivers/net/slip.c | sl->mtu = dev->mtu; |
sl | 556 | drivers/net/slip.c | sl->buffsize = len; |
sl | 557 | drivers/net/slip.c | sl->rcount = 0; |
sl | 558 | drivers/net/slip.c | sl->xleft = 0; |
sl | 560 | drivers/net/slip.c | sl->xdata = 0; |
sl | 561 | drivers/net/slip.c | sl->xbits = 0; |
sl | 563 | drivers/net/slip.c | sl->flags &= (1 << SLF_INUSE); /* Clear ESCAPE & ERROR flags */ |
sl | 578 | drivers/net/slip.c | kfree(sl->cbuff); |
sl | 581 | drivers/net/slip.c | kfree(sl->xbuff); |
sl | 583 | drivers/net/slip.c | kfree(sl->rbuff); |
sl | 593 | drivers/net/slip.c | struct slip *sl = &sl_ctrl[dev->base_addr]; |
sl | 595 | drivers/net/slip.c | if (sl->tty == NULL) { |
sl | 598 | drivers/net/slip.c | sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); |
sl | 622 | drivers/net/slip.c | struct slip *sl = (struct slip *) tty->disc_data; |
sl | 624 | drivers/net/slip.c | if (!sl || sl->magic != SLIP_MAGIC || !sl->dev->start) |
sl | 632 | drivers/net/slip.c | if (sl->mtu != sl->dev->mtu + 73) { |
sl | 634 | drivers/net/slip.c | if (sl->mtu != sl->dev->mtu) { |
sl | 636 | drivers/net/slip.c | sl_changedmtu(sl); |
sl | 642 | drivers/net/slip.c | if (!set_bit(SLF_ERROR, &sl->flags)) { |
sl | 643 | drivers/net/slip.c | sl->rx_errors++; |
sl | 649 | drivers/net/slip.c | if (sl->mode & SL_MODE_SLIP6) |
sl | 650 | drivers/net/slip.c | slip_unesc6(sl, *cp++); |
sl | 653 | drivers/net/slip.c | slip_unesc(sl, *cp++); |
sl | 667 | drivers/net/slip.c | struct slip *sl = (struct slip *) tty->disc_data; |
sl | 671 | drivers/net/slip.c | if (sl && sl->magic == SLIP_MAGIC) { |
sl | 676 | drivers/net/slip.c | if ((sl = sl_alloc()) == NULL) { |
sl | 680 | drivers/net/slip.c | sl->tty = tty; |
sl | 681 | drivers/net/slip.c | tty->disc_data = sl; |
sl | 690 | drivers/net/slip.c | sl->mode = SL_MODE_DEFAULT; |
sl | 691 | drivers/net/slip.c | sl->dev->type = ARPHRD_SLIP + sl->mode; |
sl | 693 | drivers/net/slip.c | if (sl->dev->type == 260 || sl->dev->type == 272) { /* KISS */ |
sl | 694 | drivers/net/slip.c | sl->dev->type = ARPHRD_AX25; |
sl | 698 | drivers/net/slip.c | if ((err = sl_open(sl->dev))) { |
sl | 707 | drivers/net/slip.c | return sl->dev->base_addr; |
sl | 720 | drivers/net/slip.c | struct slip *sl = (struct slip *) tty->disc_data; |
sl | 723 | drivers/net/slip.c | if (!sl || sl->magic != SLIP_MAGIC) { |
sl | 727 | drivers/net/slip.c | (void) dev_close(sl->dev); |
sl | 730 | drivers/net/slip.c | sl->tty = NULL; |
sl | 731 | drivers/net/slip.c | sl_free(sl); |
sl | 742 | drivers/net/slip.c | struct slip *sl = &sl_ctrl[dev->base_addr]; |
sl | 749 | drivers/net/slip.c | stats.rx_packets = sl->rx_packets; |
sl | 750 | drivers/net/slip.c | stats.tx_packets = sl->tx_packets; |
sl | 751 | drivers/net/slip.c | stats.rx_dropped = sl->rx_dropped; |
sl | 752 | drivers/net/slip.c | stats.tx_dropped = sl->tx_dropped; |
sl | 753 | drivers/net/slip.c | stats.tx_errors = sl->tx_errors; |
sl | 754 | drivers/net/slip.c | stats.rx_errors = sl->rx_errors; |
sl | 755 | drivers/net/slip.c | stats.rx_over_errors = sl->rx_over_errors; |
sl | 757 | drivers/net/slip.c | stats.rx_fifo_errors = sl->rx_compressed; |
sl | 758 | drivers/net/slip.c | stats.tx_fifo_errors = sl->tx_compressed; |
sl | 759 | drivers/net/slip.c | stats.collisions = sl->tx_misses; |
sl | 760 | drivers/net/slip.c | comp = sl->slcomp; |
sl | 815 | drivers/net/slip.c | slip_unesc(struct slip *sl, unsigned char s) |
sl | 820 | drivers/net/slip.c | if (!clear_bit(SLF_ERROR, &sl->flags) && (sl->rcount > 2)) { |
sl | 821 | drivers/net/slip.c | sl_bump(sl); |
sl | 823 | drivers/net/slip.c | clear_bit(SLF_ESCAPE, &sl->flags); |
sl | 824 | drivers/net/slip.c | sl->rcount = 0; |
sl | 828 | drivers/net/slip.c | set_bit(SLF_ESCAPE, &sl->flags); |
sl | 831 | drivers/net/slip.c | if (clear_bit(SLF_ESCAPE, &sl->flags)) { |
sl | 836 | drivers/net/slip.c | if (clear_bit(SLF_ESCAPE, &sl->flags)) { |
sl | 841 | drivers/net/slip.c | if (!test_bit(SLF_ERROR, &sl->flags)) { |
sl | 842 | drivers/net/slip.c | if (sl->rcount < sl->buffsize) { |
sl | 843 | drivers/net/slip.c | sl->rbuff[sl->rcount++] = s; |
sl | 846 | drivers/net/slip.c | sl->rx_over_errors++; |
sl | 847 | drivers/net/slip.c | set_bit(SLF_ERROR, &sl->flags); |
sl | 896 | drivers/net/slip.c | slip_unesc6(struct slip *sl, unsigned char s) |
sl | 901 | drivers/net/slip.c | if (!clear_bit(SLF_ERROR, &sl->flags) && (sl->rcount > 2)) { |
sl | 902 | drivers/net/slip.c | sl_bump(sl); |
sl | 904 | drivers/net/slip.c | sl->rcount = 0; |
sl | 905 | drivers/net/slip.c | sl->xbits = 0; |
sl | 906 | drivers/net/slip.c | sl->xdata = 0; |
sl | 908 | drivers/net/slip.c | sl->xdata = (sl->xdata << 6) | ((s - 0x30) & 0x3F); |
sl | 909 | drivers/net/slip.c | sl->xbits += 6; |
sl | 910 | drivers/net/slip.c | if (sl->xbits >= 8) { |
sl | 911 | drivers/net/slip.c | sl->xbits -= 8; |
sl | 912 | drivers/net/slip.c | c = (unsigned char)(sl->xdata >> sl->xbits); |
sl | 913 | drivers/net/slip.c | if (!test_bit(SLF_ERROR, &sl->flags)) { |
sl | 914 | drivers/net/slip.c | if (sl->rcount < sl->buffsize) { |
sl | 915 | drivers/net/slip.c | sl->rbuff[sl->rcount++] = c; |
sl | 918 | drivers/net/slip.c | sl->rx_over_errors++; |
sl | 919 | drivers/net/slip.c | set_bit(SLF_ERROR, &sl->flags); |
sl | 951 | drivers/net/slip.c | struct slip *sl = &sl_ctrl[dev->base_addr]; |
sl | 953 | drivers/net/slip.c | return sl->mode & SL_MODE_AX25VC; |
sl | 963 | drivers/net/slip.c | struct slip *sl = (struct slip *) tty->disc_data; |
sl | 968 | drivers/net/slip.c | if (!sl || sl->magic != SLIP_MAGIC) { |
sl | 974 | drivers/net/slip.c | err = verify_area(VERIFY_WRITE, arg, strlen(sl->dev->name) + 1); |
sl | 978 | drivers/net/slip.c | memcpy_tofs(arg, sl->dev->name, strlen(sl->dev->name) + 1); |
sl | 986 | drivers/net/slip.c | put_user(sl->mode, (int *)arg); |
sl | 1017 | drivers/net/slip.c | sl->dev->addr_len=AX25_ADDR_LEN; /* sizeof an AX.25 addr */ |
sl | 1018 | drivers/net/slip.c | sl->dev->hard_header_len=73; /* We don't do digipeaters */ |
sl | 1020 | drivers/net/slip.c | sl->dev->addr_len=0; /* No mac addr in slip mode */ |
sl | 1021 | drivers/net/slip.c | sl->dev->hard_header_len=0; |
sl | 1024 | drivers/net/slip.c | sl->mode = tmp; |
sl | 1025 | drivers/net/slip.c | sl->dev->type = ARPHRD_SLIP+sl->mode; |
sl | 1027 | drivers/net/slip.c | if (sl->dev->type == 260 || sl->dev->type == 272) { |
sl | 1028 | drivers/net/slip.c | sl->dev->type = ARPHRD_AX25; |
sl | 1035 | drivers/net/slip.c | return sl_set_mac_address(sl->dev, arg); |
sl | 1052 | drivers/net/slip.c | struct slip *sl = &sl_ctrl[dev->base_addr]; |
sl | 1053 | drivers/net/slip.c | if(sl->tty==NULL) |
sl | 1062 | drivers/net/slip.c | struct slip *sl = &sl_ctrl[dev->base_addr]; |
sl | 1107 | drivers/net/slip.c | memset(sl, 0, sizeof (struct slip)); |
sl | 1108 | drivers/net/slip.c | sl->magic = SLIP_MAGIC; |
sl | 1109 | drivers/net/slip.c | sl->dev = dev; |
sl | 1127 | drivers/net/slip.c | if (sl->dev->type == 260 || sl->dev->type == 272) { |
sl | 1128 | drivers/net/slip.c | sl->dev->type = ARPHRD_AX25; |
sl | 351 | drivers/scsi/eata_dma.c | struct scatterlist *sl; |
sl | 467 | drivers/scsi/eata_dma.c | sl=(struct scatterlist *)cmd->request_buffer; |
sl | 468 | drivers/scsi/eata_dma.c | for(i = 0; i < cmd->use_sg; i++, sl++){ |
sl | 469 | drivers/scsi/eata_dma.c | cp->sg_list[i].data = htonl((u32) sl->address); |
sl | 470 | drivers/scsi/eata_dma.c | cp->sg_list[i].len = htonl((u32) sl->length); |
sl | 651 | drivers/scsi/ultrastor.c | struct scatterlist *sl; |
sl | 655 | drivers/scsi/ultrastor.c | sl = (struct scatterlist *) SCpnt->request_buffer; |
sl | 658 | drivers/scsi/ultrastor.c | mscp->sglist[i].address = (unsigned int)sl[i].address; |
sl | 659 | drivers/scsi/ultrastor.c | mscp->sglist[i].num_bytes = sl[i].length; |
sl | 660 | drivers/scsi/ultrastor.c | transfer_length += sl[i].length; |