if_ep.c (2826) | if_ep.c (3816) |
---|---|
1/* 2 * Copyright (c) 1993 Herb Peyerl <hpeyerl@novatel.ca> 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 --- 7 unchanged lines hidden (view full) --- 16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * | 1/* 2 * Copyright (c) 1993 Herb Peyerl <hpeyerl@novatel.ca> 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 --- 7 unchanged lines hidden (view full) --- 16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * |
24 * From: if_ep.c,v 1.9 1994/01/25 10:46:29 deraadt Exp $ 25 * $Id: if_ep.c,v 1.12 1994/09/03 18:10:43 ats Exp $ | 24 * From: if_ep.c,v 1.9 1994/01/25 10:46:29 deraadt Exp 25 * $Id: if_ep.c,v 1.13 1994/09/16 13:33:41 davidg Exp $ |
26 */ 27 28#include "ep.h" 29#if NEP > 0 30 31#include "bpfilter.h" 32 33#include <sys/param.h> 34#if defined(__FreeBSD__) 35#include <sys/systm.h> 36#include <sys/kernel.h> 37#endif 38#include <sys/mbuf.h> 39#include <sys/socket.h> 40#include <sys/ioctl.h> 41#include <sys/errno.h> 42#include <sys/syslog.h> | 26 */ 27 28#include "ep.h" 29#if NEP > 0 30 31#include "bpfilter.h" 32 33#include <sys/param.h> 34#if defined(__FreeBSD__) 35#include <sys/systm.h> 36#include <sys/kernel.h> 37#endif 38#include <sys/mbuf.h> 39#include <sys/socket.h> 40#include <sys/ioctl.h> 41#include <sys/errno.h> 42#include <sys/syslog.h> |
43#include <sys/devconf.h> |
|
43#if defined(__NetBSD__) 44#include <sys/select.h> 45#endif 46 47#include <net/if.h> 48#include <net/if_dl.h> 49#include <net/if_types.h> 50 --- 63 unchanged lines hidden (view full) --- 114void epwatchdog __P((int)); 115 116struct isa_driver epdriver = { 117 epprobe, 118 epattach, 119 "ep" 120}; 121 | 44#if defined(__NetBSD__) 45#include <sys/select.h> 46#endif 47 48#include <net/if.h> 49#include <net/if_dl.h> 50#include <net/if_types.h> 51 --- 63 unchanged lines hidden (view full) --- 115void epwatchdog __P((int)); 116 117struct isa_driver epdriver = { 118 epprobe, 119 epattach, 120 "ep" 121}; 122 |
123static struct kern_devconf kdc_ep[NEP] = { { 124 0, 0, 0, /* filled in by dev_attach */ 125 "ep", 0, { MDDT_ISA, 0, "net" }, 126 isa_generic_externalize, 0, 0, ISA_EXTERNALLEN, 127 &kdc_isa0, /* parent */ 128 0, /* parentdata */ 129 DC_BUSY, /* network interfaces are always ``open'' */ 130 "3Com 3C509 Ethernet adapter" 131} }; 132 133static inline void 134ep_registerdev(struct isa_device *id) 135{ 136 if(id->id_unit) 137 kdc_ep[id->id_unit] = kdc_ep[0]; 138 kdc_ep[id->id_unit].kdc_unit = id->id_unit; 139 kdc_ep[id->id_unit].kdc_parentdata = id; 140 dev_attach(&kdc_ep[id->id_unit]); 141} 142 |
|
122static int send_ID_sequence __P((u_short)); 123static u_short epreadeeprom __P((int, int)); 124static int epbusyeeprom __P((int, ushort)); 125 126 127#define MAXEPCARDS 20 /* if you have 21 cards in your machine... you lose */ 128 129static struct epcard { --- 242 unchanged lines hidden (view full) --- 372 IFF_MULTICAST ; 373 ifp->if_init = epinit; 374 ifp->if_output = ether_output; 375 ifp->if_start = epstart; 376 ifp->if_ioctl = epioctl; 377 ifp->if_watchdog = epwatchdog; 378 379 if_attach(ifp); | 143static int send_ID_sequence __P((u_short)); 144static u_short epreadeeprom __P((int, int)); 145static int epbusyeeprom __P((int, ushort)); 146 147 148#define MAXEPCARDS 20 /* if you have 21 cards in your machine... you lose */ 149 150static struct epcard { --- 242 unchanged lines hidden (view full) --- 393 IFF_MULTICAST ; 394 ifp->if_init = epinit; 395 ifp->if_output = ether_output; 396 ifp->if_start = epstart; 397 ifp->if_ioctl = epioctl; 398 ifp->if_watchdog = epwatchdog; 399 400 if_attach(ifp); |
401 ep_registerdev(is); |
|
380 381 /* 382 * Fill the hardware address into ifa_addr if we find an 383 * AF_LINK entry. We need to do this so bpf's can get the hardware 384 * addr of this card. netstat likes this too! 385 */ 386 ifa = ifp->if_addrlist; 387 while ((ifa != 0) && (ifa->ifa_addr != 0) && --- 775 unchanged lines hidden --- | 402 403 /* 404 * Fill the hardware address into ifa_addr if we find an 405 * AF_LINK entry. We need to do this so bpf's can get the hardware 406 * addr of this card. netstat likes this too! 407 */ 408 ifa = ifp->if_addrlist; 409 while ((ifa != 0) && (ifa->ifa_addr != 0) && --- 775 unchanged lines hidden --- |