if_plip.c (121816) | if_plip.c (123922) |
---|---|
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 --- 13 unchanged lines hidden (view full) --- 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 */ 28 29#include <sys/cdefs.h> | 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 --- 13 unchanged lines hidden (view full) --- 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 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/ppbus/if_plip.c 121816 2003-10-31 18:32:15Z brooks $"); | 30__FBSDID("$FreeBSD: head/sys/dev/ppbus/if_plip.c 123922 2003-12-28 03:56:00Z sam $"); |
31 32/* 33 * Parallel port TCP/IP interfaces added. I looked at the driver from 34 * MACH but this is a complete rewrite, and btw. incompatible, and it 35 * should perform better too. I have never run the MACH driver though. 36 * 37 * This driver sends two bytes (0x08, 0x00) in front of each packet, 38 * to allow us to distinguish another format later. --- 401 unchanged lines hidden (view full) --- 440 ppb_wdtr(ppbus, 0x00); 441 442 return (ctrecvl[cl] | ctrecvh[c]); 443} 444 445static void 446lptap(struct ifnet *ifp, struct mbuf *m) 447{ | 31 32/* 33 * Parallel port TCP/IP interfaces added. I looked at the driver from 34 * MACH but this is a complete rewrite, and btw. incompatible, and it 35 * should perform better too. I have never run the MACH driver though. 36 * 37 * This driver sends two bytes (0x08, 0x00) in front of each packet, 38 * to allow us to distinguish another format later. --- 401 unchanged lines hidden (view full) --- 440 ppb_wdtr(ppbus, 0x00); 441 442 return (ctrecvl[cl] | ctrecvh[c]); 443} 444 445static void 446lptap(struct ifnet *ifp, struct mbuf *m) 447{ |
448 /* 449 * Send a packet through bpf. We need to prepend the address family 450 * as a four byte field. Cons up a dummy header to pacify bpf. This 451 * is safe because bpf will only read from the mbuf (i.e., it won't 452 * try to free it or keep a pointer to it). 453 */ | |
454 u_int32_t af = AF_INET; | 448 u_int32_t af = AF_INET; |
455 struct mbuf m0; 456 457 m0.m_next = m; 458 m0.m_len = sizeof(u_int32_t); 459 m0.m_data = (char *)⁡ 460 BPF_MTAP(ifp, &m0); | 449 BPF_MTAP2(ifp, &af, sizeof(af), m); |
461} 462 463static void 464lp_intr (void *arg) 465{ 466 device_t dev = (device_t)arg; 467 device_t ppbus = device_get_parent(dev); 468 struct lp_data *sc = DEVTOSOFTC(dev); --- 306 unchanged lines hidden --- | 450} 451 452static void 453lp_intr (void *arg) 454{ 455 device_t dev = (device_t)arg; 456 device_t ppbus = device_get_parent(dev); 457 struct lp_data *sc = DEVTOSOFTC(dev); --- 306 unchanged lines hidden --- |