Deleted Added
full compact
if_ed.c (3796) if_ed.c (3816)
1/*
2 * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
3 * adapters. By David Greenman, 29-April-1993
4 *
5 * Copyright (C) 1993, David Greenman. This software may be used, modified,
6 * copied, distributed, and sold, in both source and binary form provided
7 * that the above copyright and these terms are retained. Under no
8 * circumstances is the author responsible for the proper functioning
9 * of this software, nor does the author assume any responsibility
10 * for damages incurred with its use.
11 *
12 * Currently supports the Western Digital/SMC 8003 and 8013 series,
13 * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000,
14 * and a variety of similar clones.
15 *
1/*
2 * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
3 * adapters. By David Greenman, 29-April-1993
4 *
5 * Copyright (C) 1993, David Greenman. This software may be used, modified,
6 * copied, distributed, and sold, in both source and binary form provided
7 * that the above copyright and these terms are retained. Under no
8 * circumstances is the author responsible for the proper functioning
9 * of this software, nor does the author assume any responsibility
10 * for damages incurred with its use.
11 *
12 * Currently supports the Western Digital/SMC 8003 and 8013 series,
13 * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000,
14 * and a variety of similar clones.
15 *
16 * $Id: if_ed.c,v 1.52 1994/10/19 01:58:58 wollman Exp $
16 * $Id: if_ed.c,v 1.53 1994/10/22 17:52:22 phk Exp $
17 */
18
19#include "ed.h"
20#include "bpfilter.h"
21
22#include <sys/param.h>
23#include <sys/systm.h>
24#include <sys/errno.h>

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

168
169#define ETHER_MIN_LEN 64
170#define ETHER_MAX_LEN 1518
171#define ETHER_ADDR_LEN 6
172#define ETHER_HDR_SIZE 14
173
174static struct kern_devconf kdc_ed[NED] = { {
175 0, 0, 0, /* filled in by dev_attach */
17 */
18
19#include "ed.h"
20#include "bpfilter.h"
21
22#include <sys/param.h>
23#include <sys/systm.h>
24#include <sys/errno.h>

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

168
169#define ETHER_MIN_LEN 64
170#define ETHER_MAX_LEN 1518
171#define ETHER_ADDR_LEN 6
172#define ETHER_HDR_SIZE 14
173
174static struct kern_devconf kdc_ed[NED] = { {
175 0, 0, 0, /* filled in by dev_attach */
176 "ed", 0, { "isa0", MDDT_ISA, 0 },
177 isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
176 "ed", 0, { MDDT_ISA, 0, "net" },
177 isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
178 &kdc_isa0, /* parent */
179 0, /* parentdata */
180 DC_BUSY, /* network interfaces are always ``open'' */
181 "" /* description */
178} };
179
180static inline void
182} };
183
184static inline void
181ed_registerdev(struct isa_device *id)
185ed_registerdev(struct isa_device *id, const char *descr)
182{
183 if(id->id_unit)
184 kdc_ed[id->id_unit] = kdc_ed[0];
185 kdc_ed[id->id_unit].kdc_unit = id->id_unit;
186{
187 if(id->id_unit)
188 kdc_ed[id->id_unit] = kdc_ed[0];
189 kdc_ed[id->id_unit].kdc_unit = id->id_unit;
186 kdc_ed[id->id_unit].kdc_isa = id;
190 kdc_ed[id->id_unit].kdc_parentdata = id;
191 kdc_ed[id->id_unit].kdc_description = descr;
187 dev_attach(&kdc_ed[id->id_unit]);
188}
189
190/*
191 * Determine if the device is present
192 *
193 * on entry:
194 * a pointer to an isa_device struct

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

1115 else
1116 ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS |
1117 IFF_MULTICAST);
1118
1119 /*
1120 * Attach the interface
1121 */
1122 if_attach(ifp);
192 dev_attach(&kdc_ed[id->id_unit]);
193}
194
195/*
196 * Determine if the device is present
197 *
198 * on entry:
199 * a pointer to an isa_device struct

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

1120 else
1121 ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS |
1122 IFF_MULTICAST);
1123
1124 /*
1125 * Attach the interface
1126 */
1127 if_attach(ifp);
1123 ed_registerdev(isa_dev);
1128 ed_registerdev(isa_dev, sc->type_str ? sc->type_str : "Ethernet adapter");
1124
1125 /*
1126 * Print additional info when attached
1127 */
1128 printf("ed%d: address %s, ", isa_dev->id_unit,
1129 ether_sprintf(sc->arpcom.ac_enaddr));
1130
1131 if (sc->type_str && (*sc->type_str != 0))

--- 1429 unchanged lines hidden ---
1129
1130 /*
1131 * Print additional info when attached
1132 */
1133 printf("ed%d: address %s, ", isa_dev->id_unit,
1134 ether_sprintf(sc->arpcom.ac_enaddr));
1135
1136 if (sc->type_str && (*sc->type_str != 0))

--- 1429 unchanged lines hidden ---