summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-10-19 01:59:11 +0000
committerwollman <wollman@FreeBSD.org>1994-10-19 01:59:11 +0000
commit24e218260af83b7292524d1581b8dfcf5d3c8c5b (patch)
tree5d1fe7fa29fd95ce356cefa187ddba64b0b97b6d /sys/i386
parentc2771d0d1bd4ee9f81f73a838d7aa075897c1b71 (diff)
downloadFreeBSD-src-24e218260af83b7292524d1581b8dfcf5d3c8c5b.zip
FreeBSD-src-24e218260af83b7292524d1581b8dfcf5d3c8c5b.tar.gz
Add support for devconf to a large number of device drivers, and do
the right thing in dev_goawayall() when kdc_goaway is null.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/eisa/aha1742.c20
-rw-r--r--sys/i386/include/devconf.h9
-rw-r--r--sys/i386/isa/aha1542.c20
-rw-r--r--sys/i386/isa/aha1742.c20
-rw-r--r--sys/i386/isa/aic6360.c22
-rw-r--r--sys/i386/isa/b004.c20
-rw-r--r--sys/i386/isa/ctx.c18
-rw-r--r--sys/i386/isa/fd.c4
-rw-r--r--sys/i386/isa/if_ed.c20
-rw-r--r--sys/i386/isa/if_el.c20
-rw-r--r--sys/i386/isa/if_ie.c21
-rw-r--r--sys/i386/isa/if_is.c20
-rw-r--r--sys/i386/isa/if_le.c79
-rw-r--r--sys/i386/isa/if_lnc.c57
-rw-r--r--sys/i386/isa/isa.c15
-rw-r--r--sys/i386/isa/isa_device.h12
16 files changed, 315 insertions, 62 deletions
diff --git a/sys/i386/eisa/aha1742.c b/sys/i386/eisa/aha1742.c
index 88c0009..945e8ea 100644
--- a/sys/i386/eisa/aha1742.c
+++ b/sys/i386/eisa/aha1742.c
@@ -14,7 +14,7 @@
*
* commenced: Sun Sep 27 18:14:01 PDT 1992
*
- * $Id: aha1742.c,v 1.21 1994/08/31 23:32:32 se Exp $
+ * $Id: aha1742.c,v 1.22 1994/09/16 13:33:34 davidg Exp $
*/
#include <sys/types.h>
@@ -33,6 +33,7 @@
#endif /*KERNEL */
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
+#include <sys/devconf.h>
/* */
@@ -316,6 +317,22 @@ struct scsi_device ahb_dev =
{ 0, 0 }
};
+static struct kern_devconf kdc_ahb[NAHB] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "ahb", 0, { "isa0", MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
+} };
+
+static inline void
+ahb_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_ahb[id->id_unit] = kdc_ahb[0];
+ kdc_ahb[id->id_unit].kdc_unit = id->id_unit;
+ kdc_ahb[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_ahb[id->id_unit]);
+}
+
#endif /*KERNEL */
#ifndef KERNEL
@@ -518,6 +535,7 @@ ahb_attach(dev)
ahb->sc_link.adapter = &ahb_switch;
ahb->sc_link.device = &ahb_dev;
+ ahb_registerdev(dev);
/*
* ask the adapter what subunits are present
*/
diff --git a/sys/i386/include/devconf.h b/sys/i386/include/devconf.h
index c011467..6a50508 100644
--- a/sys/i386/include/devconf.h
+++ b/sys/i386/include/devconf.h
@@ -53,11 +53,20 @@ struct machdep_devconf {
char mddc_parent[PARENTNAMELEN];
enum machdep_devtype mddc_devtype;
int mddc_flags;
+ /*
+ * The user doesn't need to see this, but it's useful in the kernel code.
+ */
+ union {
+ struct isa_device *mddcu_isa;
+ struct scsi_link *mddcu_scsi;
+ } mddc_un;
};
#define dc_parent dc_md.mddc_parent
#define dc_devtype dc_md.mddc_devtype
#define dc_flags dc_md.mddc_flags
+#define kdc_isa kdc_md.mddc_un.mddcu_isa
+#define kdc_scsi kdc_md.mddc_un.mddcu_scsi
#include <i386/isa/isa_device.h>
#include <i386/pci/pcireg.h>
diff --git a/sys/i386/isa/aha1542.c b/sys/i386/isa/aha1542.c
index ab226c1..ad14148 100644
--- a/sys/i386/isa/aha1542.c
+++ b/sys/i386/isa/aha1542.c
@@ -12,7 +12,7 @@
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
*
- * $Id: aha1542.c,v 1.35 1994/09/21 18:17:56 davidg Exp $
+ * $Id: aha1542.c,v 1.36 1994/10/10 01:12:23 phk Exp $
*/
/*
@@ -35,6 +35,7 @@
#endif /* KERNEL */
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
+#include <sys/devconf.h>
#ifdef KERNEL
#include <sys/kernel.h>
@@ -344,6 +345,22 @@ struct isa_driver ahadriver =
"aha"
};
+static struct kern_devconf kdc_aha[NAHA] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "aha", 0, { "isa0", MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
+} };
+
+static inline void
+aha_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_aha[id->id_unit] = kdc_aha[0];
+ kdc_aha[id->id_unit].kdc_unit = id->id_unit;
+ kdc_aha[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_aha[id->id_unit]);
+}
+
#endif /* KERNEL */
static int ahaunit = 0;
@@ -597,6 +614,7 @@ ahaattach(dev)
/*
* ask the adapter what subunits are present
*/
+ aha_registerdev(dev);
scsi_attachdevs(&(aha->sc_link));
return 1;
diff --git a/sys/i386/isa/aha1742.c b/sys/i386/isa/aha1742.c
index 88c0009..945e8ea 100644
--- a/sys/i386/isa/aha1742.c
+++ b/sys/i386/isa/aha1742.c
@@ -14,7 +14,7 @@
*
* commenced: Sun Sep 27 18:14:01 PDT 1992
*
- * $Id: aha1742.c,v 1.21 1994/08/31 23:32:32 se Exp $
+ * $Id: aha1742.c,v 1.22 1994/09/16 13:33:34 davidg Exp $
*/
#include <sys/types.h>
@@ -33,6 +33,7 @@
#endif /*KERNEL */
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
+#include <sys/devconf.h>
/* */
@@ -316,6 +317,22 @@ struct scsi_device ahb_dev =
{ 0, 0 }
};
+static struct kern_devconf kdc_ahb[NAHB] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "ahb", 0, { "isa0", MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
+} };
+
+static inline void
+ahb_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_ahb[id->id_unit] = kdc_ahb[0];
+ kdc_ahb[id->id_unit].kdc_unit = id->id_unit;
+ kdc_ahb[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_ahb[id->id_unit]);
+}
+
#endif /*KERNEL */
#ifndef KERNEL
@@ -518,6 +535,7 @@ ahb_attach(dev)
ahb->sc_link.adapter = &ahb_switch;
ahb->sc_link.device = &ahb_dev;
+ ahb_registerdev(dev);
/*
* ask the adapter what subunits are present
*/
diff --git a/sys/i386/isa/aic6360.c b/sys/i386/isa/aic6360.c
index cee494c..f091bb0 100644
--- a/sys/i386/isa/aic6360.c
+++ b/sys/i386/isa/aic6360.c
@@ -31,7 +31,7 @@
*/
/*
- * $Id$
+ * $Id: aic6360.c,v 1.1 1994/09/26 16:15:45 jkh Exp $
*
* Acknowledgements: Many of the algorithms used in this driver are
* inspired by the work of Julian Elischer (julian@tfs.com) and
@@ -134,10 +134,11 @@
#include <scsi/scsiconf.h>
#ifdef __FreeBSD__
+#include <sys/devconf.h>
#include <i386/isa/isa_device.h>
#include "ddb.h"
-#include "kernel.h"
+#include <sys/kernel.h>
#else
#include <i386/isa/isavar.h>
#include <i386/isa/icu.h>
@@ -748,6 +749,22 @@ struct scsi_device aic_dev = {
0
};
+static struct kern_devconf kdc_aic[NAIC] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "aic", 0, { "isa0", MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
+} };
+
+static inline void
+aic_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_aic[id->id_unit] = kdc_aic[0];
+ kdc_aic[id->id_unit].kdc_unit = id->id_unit;
+ kdc_aic[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_aic[id->id_unit]);
+}
+
/*
* INITIALIZATION ROUTINES (probe, attach ++)
*/
@@ -803,6 +820,7 @@ aicprobe(parent, self, aux)
return 0;
}
aicunit++;
+ aic_registerdev(dev);
return 0x20;
#else
#ifdef NEWCONFIG
diff --git a/sys/i386/isa/b004.c b/sys/i386/isa/b004.c
index bdd0902..e3fa922 100644
--- a/sys/i386/isa/b004.c
+++ b/sys/i386/isa/b004.c
@@ -515,10 +515,28 @@ bquioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p)
return result;
} /* bquioctl() */
+
+static struct kern_devconf kdc_bqu[NBQU] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "bqu", 0, { "isa0", MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
+} };
+
+static inline void
+bqu_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_bqu[id->id_unit] = kdc_bqu[0];
+ kdc_bqu[id->id_unit].kdc_unit = id->id_unit;
+ kdc_bqu[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_bqu[id->id_unit]);
+}
+
int
bquattach(struct isa_device *idp)
{
- return 1;
+ bqu_registerdev(idp);
+ return 1;
}
/*
diff --git a/sys/i386/isa/ctx.c b/sys/i386/isa/ctx.c
index 8ba2cc6..7a14059 100644
--- a/sys/i386/isa/ctx.c
+++ b/sys/i386/isa/ctx.c
@@ -8,7 +8,7 @@
* of this software, nor does the author assume any responsibility
* for damages incurred with its use.
*
- * $Id$
+ * $Id: ctx.c,v 1.1 1994/10/01 17:59:41 davidg Exp $
*/
/*
@@ -153,6 +153,21 @@ struct ctx_soft_registers {
} ctx_sr[NCTX];
+static struct kern_devconf kdc_ctx[NCTX] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "ctx", 0, { "isa0", MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
+} };
+
+static inline void
+ctx_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_ctx[id->id_unit] = kdc_ctx[0];
+ kdc_ctx[id->id_unit].kdc_unit = id->id_unit;
+ kdc_ctx[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_ctx[id->id_unit]);
+}
int
ctxprobe(struct isa_device * devp)
@@ -178,6 +193,7 @@ ctxattach(struct isa_device * devp)
sr->iobase = devp->id_iobase;
sr->maddr = devp->id_maddr;
sr->msize = devp->id_msize;
+ ctx_registerdev(devp);
return (1);
}
diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c
index 89885a1..a645d34 100644
--- a/sys/i386/isa/fd.c
+++ b/sys/i386/isa/fd.c
@@ -81,7 +81,6 @@
static int fd_goaway(struct kern_devconf *, int);
static int fdc_goaway(struct kern_devconf *, int);
static int fd_externalize(struct proc *, struct kern_devconf *, void *, size_t);
-static int fdc_externalize(struct proc *, struct kern_devconf *, void *, size_t);
/*
* Templates for the kern_devconf structures used when we attach.
@@ -95,7 +94,7 @@ static struct kern_devconf kdc_fd_template = {
static struct kern_devconf kdc_fdc_template = {
0, 0, 0, /* filled in by kern_devconf.c */
"fdc", 0, { "isa0", MDDT_ISA, 0 },
- fdc_externalize, 0, fdc_goaway, ISA_EXTERNALLEN
+ isa_generic_externalize, 0, fdc_goaway, ISA_EXTERNALLEN
};
static inline void
@@ -380,6 +379,7 @@ fdattach(dev)
return 0;
*kdc = kdc_fdc_template;
kdc->kdc_unit = fdcu;
+ kdc->kdc_isa = dev;
dev_attach(kdc);
fdc->fdcu = fdcu;
diff --git a/sys/i386/isa/if_ed.c b/sys/i386/isa/if_ed.c
index 38b7f44..a3479f6 100644
--- a/sys/i386/isa/if_ed.c
+++ b/sys/i386/isa/if_ed.c
@@ -13,7 +13,7 @@
* the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000,
* and a variety of similar clones.
*
- * $Id: if_ed.c,v 1.50 1994/10/14 11:56:36 davidg Exp $
+ * $Id: if_ed.c,v 1.51 1994/10/17 21:16:37 phk Exp $
*/
#include "ed.h"
@@ -26,6 +26,7 @@
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/syslog.h>
+#include <sys/devconf.h>
#include <net/if.h>
#include <net/if_dl.h>
@@ -166,6 +167,22 @@ static unsigned short ed_790_intr_mask[] = {
#define ETHER_ADDR_LEN 6
#define ETHER_HDR_SIZE 14
+static struct kern_devconf kdc_ed[NED] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "ed", 0, { "isa0", MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
+} };
+
+static inline void
+ed_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_ed[id->id_unit] = kdc_ed[0];
+ kdc_ed[id->id_unit].kdc_unit = id->id_unit;
+ kdc_ed[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_ed[id->id_unit]);
+}
+
/*
* Determine if the device is present
*
@@ -1097,6 +1114,7 @@ ed_attach(isa_dev)
* Attach the interface
*/
if_attach(ifp);
+ ed_registerdev(isa_dev);
/*
* Print additional info when attached
diff --git a/sys/i386/isa/if_el.c b/sys/i386/isa/if_el.c
index ceaac8f..82d3e8c 100644
--- a/sys/i386/isa/if_el.c
+++ b/sys/i386/isa/if_el.c
@@ -6,7 +6,7 @@
*
* Questions, comments, bug reports and fixes to kimmel@cs.umass.edu.
*
- * $Id: if_el.c,v 1.4 1994/08/08 13:33:12 davidg Exp $
+ * $Id: if_el.c,v 1.5 1994/08/13 03:50:04 wollman Exp $
*/
/* Except of course for the portions of code lifted from other FreeBSD
* drivers (mainly elread, elget and el_ioctl)
@@ -30,6 +30,7 @@
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/syslog.h>
+#include <sys/devconf.h>
#include <net/if.h>
#include <net/if_dl.h>
@@ -97,6 +98,22 @@ struct isa_driver eldriver = {
el_probe, el_attach, "el"
};
+static struct kern_devconf kdc_el[NEL] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "el", 0, { "isa0", MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
+} };
+
+static inline void
+el_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_el[id->id_unit] = kdc_el[0];
+ kdc_el[id->id_unit].kdc_unit = id->id_unit;
+ kdc_el[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_el[id->id_unit]);
+}
+
/* Probe routine. See if the card is there and at the right place. */
int el_probe(struct isa_device *idev)
{
@@ -189,6 +206,7 @@ int el_attach(struct isa_device *idev)
/* Now we can attach the interface */
dprintf(("Attaching interface...\n"));
if_attach(ifp);
+ el_registerdev(idev);
/* Put the station address in the ifa address list's AF_LINK
* entry, if any.
diff --git a/sys/i386/isa/if_ie.c b/sys/i386/isa/if_ie.c
index 0371610..43bd9cc 100644
--- a/sys/i386/isa/if_ie.c
+++ b/sys/i386/isa/if_ie.c
@@ -43,7 +43,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ie.c,v 1.14 1994/09/05 22:28:31 ats Exp $
+ * $Id: if_ie.c,v 1.15 1994/09/07 03:34:12 wollman Exp $
*/
/*
@@ -115,6 +115,7 @@ iomem, and to make 16-pointers, we subtract iomem and and with 0xffff.
#include <sys/ioctl.h>
#include <sys/errno.h>
#include <sys/syslog.h>
+#include <sys/devconf.h>
#include <net/if.h>
#include <net/if_types.h>
@@ -305,6 +306,22 @@ static int sl_probe(struct isa_device *);
static int el_probe(struct isa_device *);
static int ni_probe(struct isa_device *);
+static struct kern_devconf kdc_ie[NIE] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "ie", 0, { "isa0", MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
+} };
+
+static inline void
+ie_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_ie[id->id_unit] = kdc_ie[0];
+ kdc_ie[id->id_unit].kdc_unit = id->id_unit;
+ kdc_ie[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_ie[id->id_unit]);
+}
+
/* This routine written by Charles Martin Hannum. */
int ieprobe(dvp)
struct isa_device *dvp;
@@ -569,6 +586,8 @@ ieattach(dvp)
#endif
if_attach(ifp);
+ ie_registerdev(dvp);
+
{
struct ifaddr *ifa = ifp->if_addrlist;
struct sockaddr_dl *sdl;
diff --git a/sys/i386/isa/if_is.c b/sys/i386/isa/if_is.c
index 1f90292..1254f7f 100644
--- a/sys/i386/isa/if_is.c
+++ b/sys/i386/isa/if_is.c
@@ -11,7 +11,7 @@
* of this software, nor does the author assume any responsibility
* for damages incurred with its use.
*
- * $Id: if_is.c,v 1.26 1994/08/13 03:50:06 wollman Exp $
+ * $Id: if_is.c,v 1.27 1994/09/21 18:33:23 davidg Exp $
*/
/* TODO
@@ -34,6 +34,7 @@
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/syslog.h>
+#include <sys/devconf.h>
#include <net/if.h>
#include <net/if_dl.h>
@@ -139,6 +140,22 @@ u_short isrdcsr(unit,port)
return(inw(is_softc[unit].rdp));
}
+static struct kern_devconf kdc_is[NIS] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "is", 0, { "isa0", MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
+} };
+
+static inline void
+is_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_is[id->id_unit] = kdc_is[0];
+ kdc_is[id->id_unit].kdc_unit = id->id_unit;
+ kdc_is[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_is[id->id_unit]);
+}
+
int
is_probe(isa_dev)
struct isa_device *isa_dev;
@@ -352,6 +369,7 @@ is_attach(isa_dev)
isa_dmacascade(isa_dev->id_drq);
if_attach(ifp);
+ is_registerdev(isa_dev);
/*
* Search down the ifa address list looking
diff --git a/sys/i386/isa/if_le.c b/sys/i386/isa/if_le.c
index 2a919d2..cfe00cb 100644
--- a/sys/i386/isa/if_le.c
+++ b/sys/i386/isa/if_le.c
@@ -21,9 +21,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_le.c,v 1.9 1994/08/16 20:40:56 thomas Exp $
+ * $Id: if_le.c,v 1.7 1994/10/12 11:39:37 se Exp $
*
* $Log: if_le.c,v $
+ * Revision 1.7 1994/10/12 11:39:37 se
+ * Submitted by: Matt Thomas <thomas@lkg.dec.com>
+ * #ifdef MULTICAST removed.
+ *
* Revision 1.9 1994/08/16 20:40:56 thomas
* New README files (one per driver)
* Minor updates to drivers (DEPCA support and add pass to attach
@@ -51,45 +55,47 @@
#include "le.h"
#if NLE > 0
-#include "param.h"
-#include "systm.h"
-#include "mbuf.h"
-#include "protosw.h"
-#include "socket.h"
-#include "ioctl.h"
-#include "errno.h"
-#include "malloc.h"
-#include "syslog.h"
-
-#include "net/if.h"
-#include "net/if_types.h"
-#include "net/if_dl.h"
-#include "net/route.h"
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/ioccom.h>
+#include <sys/sockio.h>
+#include <sys/errno.h>
+#include <sys/malloc.h>
+#include <sys/syslog.h>
+#include <sys/devconf.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/if_dl.h>
+#include <net/route.h>
#include "bpfilter.h"
#ifdef INET
-#include "netinet/in.h"
-#include "netinet/in_systm.h"
-#include "netinet/in_var.h"
-#include "netinet/ip.h"
-#include "netinet/if_ether.h"
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/if_ether.h>
#endif
#ifdef NS
-#include "netns/ns.h"
-#include "netns/ns_if.h"
+#include <netns/ns.h>
+#include <netns/ns_if.h>
#endif
-#include "i386/isa/isa.h"
-#include "i386/isa/isa_device.h"
-#include "i386/isa/icu.h"
+#include <i386/isa/isa.h>
+#include <i386/isa/isa_device.h>
+#include <i386/isa/icu.h>
-#include "vm/vm.h"
+#include <vm/vm.h>
#if NBPFILTER > 0
-#include "net/bpf.h"
-#include "net/bpfdesc.h"
+#include <net/bpf.h>
+#include <net/bpfdesc.h>
#endif
/* Forward declarations */
@@ -329,6 +335,22 @@ unsigned le_intrs[NLE];
#define MEMSET(where, what, howmuch) bzero(where, howmuch)
#define MEMCMP(l, r, len) bcmp(l, r, len)
+static struct kern_devconf kdc_le[NLE] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "le", 0, { "isa0", MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
+} };
+
+static inline void
+le_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_le[id->id_unit] = kdc_le[0];
+ kdc_le[id->id_unit].kdc_unit = id->id_unit;
+ kdc_le[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_le[id->id_unit]);
+}
+
static int
le_probe(
struct isa_device *dvp)
@@ -395,6 +417,7 @@ le_attach(
#endif
if_attach(ifp);
+ le_registerdev(dvp);
while (ifa && ifa->ifa_addr && ifa->ifa_addr->sa_family != AF_LINK)
ifa = ifa->ifa_next;
diff --git a/sys/i386/isa/if_lnc.c b/sys/i386/isa/if_lnc.c
index 89cec80..1c6911a 100644
--- a/sys/i386/isa/if_lnc.c
+++ b/sys/i386/isa/if_lnc.c
@@ -51,31 +51,34 @@
#define MULTICAST_ADDR_LEN 8
#define ETHER_MIN_LEN 64
-#include "param.h"
-#include "systm.h"
-#include "errno.h"
-#include "ioctl.h"
-#include "mbuf.h"
-#include "socket.h"
-#include "syslog.h"
-#include "net/if.h"
-#include "net/if_dl.h"
-#include "net/if_types.h"
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/errno.h>
+#include <sys/ioccom.h>
+#include <sys/sockio.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
+#include <sys/devconf.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
#ifdef INET
-#include "netinet/in.h"
-#include "netinet/in_systm.h"
-#include "netinet/in_var.h"
-#include "netinet/ip.h"
-#include "netinet/if_ether.h"
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/if_ether.h>
#endif
#if NBPFILTER > 0
-#include "net/bpf.h"
-#include "net/bpfdesc.h"
+#include <net/bpf.h>
+#include <net/bpfdesc.h>
#endif
-#include "i386/isa/isa_device.h"
-#include "i386/isa/if_lnc.h"
+#include <i386/isa/isa_device.h>
+#include <i386/isa/if_lnc.h>
struct lnc_softc {
struct arpcom arpcom; /* see ../../netinet/if_ether.h */
@@ -725,6 +728,22 @@ lnc_tint(int unit)
}
+static struct kern_devconf kdc_lnc[NLNC] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "lnc", 0, { "isa0", MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN
+} };
+
+static inline void
+lnc_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_lnc[id->id_unit] = kdc_lnc[0];
+ kdc_lnc[id->id_unit].kdc_unit = id->id_unit;
+ kdc_lnc[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_lnc[id->id_unit]);
+}
+
int
lnc_probe(struct isa_device * isa_dev)
{
diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c
index c063d16..5ee9c6c 100644
--- a/sys/i386/isa/isa.c
+++ b/sys/i386/isa/isa.c
@@ -65,6 +65,7 @@
#include <i386/isa/icu.h>
#include <i386/isa/ic/i8237.h>
#include <i386/isa/ic/i8042.h>
+#include <sys/devconf.h>
#include "vector.h"
/*
@@ -558,6 +559,20 @@ isa_internalize(struct isa_device *id, void **userpp, size_t *len)
return rv;
}
+int
+isa_generic_externalize(struct proc *p, struct kern_devconf *kdc,
+ void *userp, size_t l)
+{
+ return isa_externalize(kdc->kdc_isa, userp, &l);
+}
+
+int
+eisa_generic_externalize(struct proc *p, struct kern_devconf *kdc,
+ void *userp, size_t l)
+{
+ return eisa_externalize(kdc->kdc_isa, -1, userp, &l);
+}
+
/*
* Fill in default interrupt table (in case of spuruious interrupt
* during configuration of kernel, setup interrupt control unit
diff --git a/sys/i386/isa/isa_device.h b/sys/i386/isa/isa_device.h
index 9badfde..fdd702a 100644
--- a/sys/i386/isa/isa_device.h
+++ b/sys/i386/isa/isa_device.h
@@ -92,6 +92,11 @@ struct isa_driver {
int sensitive_hw; /* true if other probes confuse us */
};
+#define ISA_EXTERNALLEN (sizeof(struct isa_device))
+#define EISA_EXTERNALLEN (sizeof(struct isa_device) + sizeof(int))
+
+#ifdef KERNEL
+
extern char eintrnames[]; /* end of intrnames[] */
extern u_long intrcnt[]; /* counts for for each device and stray */
extern char intrnames[]; /* string table containing device names */
@@ -130,10 +135,13 @@ int register_intr __P((int intr, int device_id, u_int flags,
inthand2_t *handler, u_int mask, int unit));
int unregister_intr __P((int intr, inthand2_t *handler));
-#define ISA_EXTERNALLEN (sizeof(struct isa_device))
-#define EISA_EXTERNALLEN (sizeof(struct isa_device) + sizeof(int))
extern int isa_externalize(struct isa_device *, void *, size_t *);
extern int isa_internalize(struct isa_device *, void **, size_t *);
extern int eisa_externalize(struct isa_device *, int, void *, size_t *);
+struct kern_devconf;
+extern int isa_generic_externalize(struct proc *, struct kern_devconf *, void *, size_t);
+extern int eisa_generic_externalize(struct proc *,struct kern_devconf *, void *, size_t);
+#endif /* KERNEL */
+
#endif /* _I386_ISA_ISA_DEVICE_H_ */
OpenPOWER on IntegriCloud