Deleted Added
full compact
olpt.c (48006) olpt.c (48645)
1/*
2 * Copyright (c) 1990 William F. Jolitz, TeleMuse
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

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

41 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
42 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
44 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
45 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * SUCH DAMAGE.
47 *
48 * from: unknown origin, 386BSD 0.1
1/*
2 * Copyright (c) 1990 William F. Jolitz, TeleMuse
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

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

41 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
42 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
44 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
45 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * SUCH DAMAGE.
47 *
48 * from: unknown origin, 386BSD 0.1
49 * $Id$
49 * $Id: olpt.c,v 1.1 1999/06/18 14:48:26 kato Exp $
50 */
51
52/*
53 * Device Driver for AT parallel printer port
54 * Written by William Jolitz 12/18/90
55 */
56
57/*

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

140#include <sys/socket.h>
141#include <sys/sockio.h>
142
143#include <net/if.h>
144#include <net/if_types.h>
145#include <net/netisr.h>
146#include <netinet/in.h>
147#include <netinet/in_var.h>
50 */
51
52/*
53 * Device Driver for AT parallel printer port
54 * Written by William Jolitz 12/18/90
55 */
56
57/*

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

140#include <sys/socket.h>
141#include <sys/sockio.h>
142
143#include <net/if.h>
144#include <net/if_types.h>
145#include <net/netisr.h>
146#include <netinet/in.h>
147#include <netinet/in_var.h>
148#include "bpfilter.h"
149#if NBPFILTER > 0
148#include "bpf.h"
149#if NBPF > 0
150#include <net/bpf.h>
151#endif
152#endif /* INET */
153
154
155#define LPINITRDY 4 /* wait up to 4 seconds for a ready */
156#define LPTOUTINITIAL 10 /* initial timeout to wait for ready 1/10 s */
157#define LPTOUTMAX 1 /* maximal timeout 1 s */

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

953 ifp->if_output = lpoutput;
954 ifp->if_type = IFT_PARA;
955 ifp->if_hdrlen = 0;
956 ifp->if_addrlen = 0;
957 ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
958 if_attach(ifp);
959 printf("lp%d: TCP/IP capable interface\n", unit);
960
150#include <net/bpf.h>
151#endif
152#endif /* INET */
153
154
155#define LPINITRDY 4 /* wait up to 4 seconds for a ready */
156#define LPTOUTINITIAL 10 /* initial timeout to wait for ready 1/10 s */
157#define LPTOUTMAX 1 /* maximal timeout 1 s */

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

953 ifp->if_output = lpoutput;
954 ifp->if_type = IFT_PARA;
955 ifp->if_hdrlen = 0;
956 ifp->if_addrlen = 0;
957 ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
958 if_attach(ifp);
959 printf("lp%d: TCP/IP capable interface\n", unit);
960
961#if NBPFILTER > 0
961#if NBPF > 0
962 bpfattach(ifp, DLT_NULL, LPIPHDRLEN);
963#endif
964}
965
966#ifndef PC98
967/*
968 * Build the translation tables for the LPIP (BSD unix) protocol.
969 * We don't want to calculate these nasties in our tight loop, so we

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

1227
1228 sc->sc_iferrs = 0;
1229
1230 if (IF_QFULL(&ipintrq)) {
1231 lprintf(("DROP"));
1232 IF_DROP(&ipintrq);
1233 goto done;
1234 }
962 bpfattach(ifp, DLT_NULL, LPIPHDRLEN);
963#endif
964}
965
966#ifndef PC98
967/*
968 * Build the translation tables for the LPIP (BSD unix) protocol.
969 * We don't want to calculate these nasties in our tight loop, so we

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

1227
1228 sc->sc_iferrs = 0;
1229
1230 if (IF_QFULL(&ipintrq)) {
1231 lprintf(("DROP"));
1232 IF_DROP(&ipintrq);
1233 goto done;
1234 }
1235#if NBPFILTER > 0
1235#if NBPF > 0
1236 if (sc->sc_if.if_bpf) {
1237 bpf_tap(&sc->sc_if, sc->sc_ifbuf, len);
1238 }
1239#endif
1240 len -= LPIPHDRLEN;
1241 sc->sc_if.if_ipackets++;
1242 sc->sc_if.if_ibytes += len;
1243 top = m_devget(sc->sc_ifbuf + LPIPHDRLEN, len, 0, &sc->sc_if, 0);

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

1419 outb(lpt_data_port, txmitl[*cp] ^ 0x17);
1420
1421 if (err) { /* if we didn't timeout... */
1422 ifp->if_oerrors++;
1423 lprintf(("X"));
1424 } else {
1425 ifp->if_opackets++;
1426 ifp->if_obytes += m->m_pkthdr.len;
1236 if (sc->sc_if.if_bpf) {
1237 bpf_tap(&sc->sc_if, sc->sc_ifbuf, len);
1238 }
1239#endif
1240 len -= LPIPHDRLEN;
1241 sc->sc_if.if_ipackets++;
1242 sc->sc_if.if_ibytes += len;
1243 top = m_devget(sc->sc_ifbuf + LPIPHDRLEN, len, 0, &sc->sc_if, 0);

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

1419 outb(lpt_data_port, txmitl[*cp] ^ 0x17);
1420
1421 if (err) { /* if we didn't timeout... */
1422 ifp->if_oerrors++;
1423 lprintf(("X"));
1424 } else {
1425 ifp->if_opackets++;
1426 ifp->if_obytes += m->m_pkthdr.len;
1427#if NBPFILTER > 0
1427#if NBPF > 0
1428 if (ifp->if_bpf) {
1429 /*
1430 * We need to prepend the packet type as
1431 * a two byte field. Cons up a dummy header
1432 * to pacify bpf. This is safe because bpf
1433 * will only read from the mbuf (i.e., it won't
1434 * try to free it or keep a pointer to it).
1435 */

--- 38 unchanged lines hidden ---
1428 if (ifp->if_bpf) {
1429 /*
1430 * We need to prepend the packet type as
1431 * a two byte field. Cons up a dummy header
1432 * to pacify bpf. This is safe because bpf
1433 * will only read from the mbuf (i.e., it won't
1434 * try to free it or keep a pointer to it).
1435 */

--- 38 unchanged lines hidden ---