olpt.c (67164) | olpt.c (69152) |
---|---|
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 * $FreeBSD: head/sys/pc98/cbus/olpt.c 67164 2000-10-15 14:19:01Z phk $ | 49 * $FreeBSD: head/sys/pc98/cbus/olpt.c 69152 2000-11-25 07:35:38Z jlemon $ |
50 */ 51 52/* 53 * Device Driver for AT parallel printer port 54 * Written by William Jolitz 12/18/90 55 */ 56 57/* --- 1098 unchanged lines hidden (view full) --- 1156 } 1157 1158 len = bp - sc->sc_ifbuf; 1159 if (len <= CLPIPHDRLEN) 1160 goto err; 1161 1162 sc->sc_iferrs = 0; 1163 | 50 */ 51 52/* 53 * Device Driver for AT parallel printer port 54 * Written by William Jolitz 12/18/90 55 */ 56 57/* --- 1098 unchanged lines hidden (view full) --- 1156 } 1157 1158 len = bp - sc->sc_ifbuf; 1159 if (len <= CLPIPHDRLEN) 1160 goto err; 1161 1162 sc->sc_iferrs = 0; 1163 |
1164 if (IF_QFULL(&ipintrq)) { 1165 lprintf(("DROP")); 1166 IF_DROP(&ipintrq); 1167 goto done; 1168 } | |
1169 len -= CLPIPHDRLEN; 1170 sc->sc_if.if_ipackets++; 1171 sc->sc_if.if_ibytes += len; 1172 top = m_devget(sc->sc_ifbuf + CLPIPHDRLEN, len, 0, &sc->sc_if, 0); 1173 if (top) { | 1164 len -= CLPIPHDRLEN; 1165 sc->sc_if.if_ipackets++; 1166 sc->sc_if.if_ibytes += len; 1167 top = m_devget(sc->sc_ifbuf + CLPIPHDRLEN, len, 0, &sc->sc_if, 0); 1168 if (top) { |
1174 IF_ENQUEUE(&ipintrq, top); 1175 schednetisr(NETISR_IP); | 1169 if (! IF_HANDOFF(&ipintrq, top, NULL)) 1170 lprintf(("DROP")); 1171 else 1172 schednetisr(NETISR_IP); |
1176 } 1177 goto done; 1178 } 1179 while ((inb(lpt_stat_port) & LPIP_SHAKE)) { 1180 len = sc->sc_if.if_mtu + LPIPHDRLEN; 1181 bp = sc->sc_ifbuf; 1182 while (len--) { 1183 --- 21 unchanged lines hidden (view full) --- 1205 1206 end: 1207 len = bp - sc->sc_ifbuf; 1208 if (len <= LPIPHDRLEN) 1209 goto err; 1210 1211 sc->sc_iferrs = 0; 1212 | 1173 } 1174 goto done; 1175 } 1176 while ((inb(lpt_stat_port) & LPIP_SHAKE)) { 1177 len = sc->sc_if.if_mtu + LPIPHDRLEN; 1178 bp = sc->sc_ifbuf; 1179 while (len--) { 1180 --- 21 unchanged lines hidden (view full) --- 1202 1203 end: 1204 len = bp - sc->sc_ifbuf; 1205 if (len <= LPIPHDRLEN) 1206 goto err; 1207 1208 sc->sc_iferrs = 0; 1209 |
1213 if (IF_QFULL(&ipintrq)) { 1214 lprintf(("DROP")); 1215 IF_DROP(&ipintrq); 1216 goto done; 1217 } | |
1218 if (sc->sc_if.if_bpf) { 1219 bpf_tap(&sc->sc_if, sc->sc_ifbuf, len); 1220 } 1221 len -= LPIPHDRLEN; 1222 sc->sc_if.if_ipackets++; 1223 sc->sc_if.if_ibytes += len; 1224 top = m_devget(sc->sc_ifbuf + LPIPHDRLEN, len, 0, &sc->sc_if, 0); 1225 if (top) { | 1210 if (sc->sc_if.if_bpf) { 1211 bpf_tap(&sc->sc_if, sc->sc_ifbuf, len); 1212 } 1213 len -= LPIPHDRLEN; 1214 sc->sc_if.if_ipackets++; 1215 sc->sc_if.if_ibytes += len; 1216 top = m_devget(sc->sc_ifbuf + LPIPHDRLEN, len, 0, &sc->sc_if, 0); 1217 if (top) { |
1226 IF_ENQUEUE(&ipintrq, top); 1227 schednetisr(NETISR_IP); | 1218 if (! IF_HANDOFF(&ipintrq, top, NULL)) 1219 lprintf(("DROP")); 1220 else 1221 schednetisr(NETISR_IP); |
1228 } 1229 } 1230 goto done; 1231 1232 err: 1233 outb(lpt_data_port, 0); 1234 lprintf(("R")); 1235 sc->sc_if.if_ierrors++; --- 217 unchanged lines hidden --- | 1222 } 1223 } 1224 goto done; 1225 1226 err: 1227 outb(lpt_data_port, 0); 1228 lprintf(("R")); 1229 sc->sc_if.if_ierrors++; --- 217 unchanged lines hidden --- |