Deleted Added
full compact
if_plip.c (67164) if_plip.c (69152)
1/*-
2 * Copyright (c) 1997 Poul-Henning Kamp
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 10 unchanged lines hidden (view full) ---

19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp
1/*-
2 * Copyright (c) 1997 Poul-Henning Kamp
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 10 unchanged lines hidden (view full) ---

19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp
27 * $FreeBSD: head/sys/dev/ppbus/if_plip.c 67164 2000-10-15 14:19:01Z phk $
27 * $FreeBSD: head/sys/dev/ppbus/if_plip.c 69152 2000-11-25 07:35:38Z jlemon $
28 */
29
30/*
31 * Parallel port TCP/IP interfaces added. I looked at the driver from
32 * MACH but this is a complete rewrite, and btw. incompatible, and it
33 * should perform better too. I have never run the MACH driver though.
34 *
35 * This driver sends two bytes (0x08, 0x00) in front of each packet,

--- 472 unchanged lines hidden (view full) ---

508 }
509
510 len = bp - sc->sc_ifbuf;
511 if (len <= CLPIPHDRLEN)
512 goto err;
513
514 sc->sc_iferrs = 0;
515
28 */
29
30/*
31 * Parallel port TCP/IP interfaces added. I looked at the driver from
32 * MACH but this is a complete rewrite, and btw. incompatible, and it
33 * should perform better too. I have never run the MACH driver though.
34 *
35 * This driver sends two bytes (0x08, 0x00) in front of each packet,

--- 472 unchanged lines hidden (view full) ---

508 }
509
510 len = bp - sc->sc_ifbuf;
511 if (len <= CLPIPHDRLEN)
512 goto err;
513
514 sc->sc_iferrs = 0;
515
516 if (IF_QFULL(&ipintrq)) {
517 lprintf("DROP");
518 IF_DROP(&ipintrq);
519 goto done;
520 }
521 len -= CLPIPHDRLEN;
522 sc->sc_if.if_ipackets++;
523 sc->sc_if.if_ibytes += len;
524 top = m_devget(sc->sc_ifbuf + CLPIPHDRLEN, len, 0, &sc->sc_if, 0);
525 if (top) {
526 if (sc->sc_if.if_bpf)
527 lptap(&sc->sc_if, top);
516 len -= CLPIPHDRLEN;
517 sc->sc_if.if_ipackets++;
518 sc->sc_if.if_ibytes += len;
519 top = m_devget(sc->sc_ifbuf + CLPIPHDRLEN, len, 0, &sc->sc_if, 0);
520 if (top) {
521 if (sc->sc_if.if_bpf)
522 lptap(&sc->sc_if, top);
528 IF_ENQUEUE(&ipintrq, top);
529 schednetisr(NETISR_IP);
523 if (! IF_HANDOFF(&ipintrq, top, NULL)) {
524 lprintf("DROP");
525 } else {
526 schednetisr(NETISR_IP);
527 }
530 }
531 goto done;
532 }
533 while ((ppb_rstr(ppbus) & LPIP_SHAKE)) {
534 len = sc->sc_if.if_mtu + LPIPHDRLEN;
535 bp = sc->sc_ifbuf;
536 while (len--) {
537

--- 21 unchanged lines hidden (view full) ---

559
560 end:
561 len = bp - sc->sc_ifbuf;
562 if (len <= LPIPHDRLEN)
563 goto err;
564
565 sc->sc_iferrs = 0;
566
528 }
529 goto done;
530 }
531 while ((ppb_rstr(ppbus) & LPIP_SHAKE)) {
532 len = sc->sc_if.if_mtu + LPIPHDRLEN;
533 bp = sc->sc_ifbuf;
534 while (len--) {
535

--- 21 unchanged lines hidden (view full) ---

557
558 end:
559 len = bp - sc->sc_ifbuf;
560 if (len <= LPIPHDRLEN)
561 goto err;
562
563 sc->sc_iferrs = 0;
564
567 if (IF_QFULL(&ipintrq)) {
568 lprintf("DROP");
569 IF_DROP(&ipintrq);
570 goto done;
571 }
572 len -= LPIPHDRLEN;
573 sc->sc_if.if_ipackets++;
574 sc->sc_if.if_ibytes += len;
575 top = m_devget(sc->sc_ifbuf + LPIPHDRLEN, len, 0, &sc->sc_if, 0);
576 if (top) {
577 if (sc->sc_if.if_bpf)
578 lptap(&sc->sc_if, top);
565 len -= LPIPHDRLEN;
566 sc->sc_if.if_ipackets++;
567 sc->sc_if.if_ibytes += len;
568 top = m_devget(sc->sc_ifbuf + LPIPHDRLEN, len, 0, &sc->sc_if, 0);
569 if (top) {
570 if (sc->sc_if.if_bpf)
571 lptap(&sc->sc_if, top);
579 IF_ENQUEUE(&ipintrq, top);
580 schednetisr(NETISR_IP);
572 if (! IF_HANDOFF(&ipintrq, top, NULL)) {
573 lprintf("DROP");
574 } else {
575 schednetisr(NETISR_IP);
576 }
581 }
582 }
583 goto done;
584
585 err:
586 ppb_wdtr(ppbus, 0);
587 lprintf("R");
588 sc->sc_if.if_ierrors++;

--- 200 unchanged lines hidden ---
577 }
578 }
579 goto done;
580
581 err:
582 ppb_wdtr(ppbus, 0);
583 lprintf("R");
584 sc->sc_if.if_ierrors++;

--- 200 unchanged lines hidden ---