summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-05-19 06:17:37 +0000
committerimp <imp@FreeBSD.org>2001-05-19 06:17:37 +0000
commit1a0ef36b0146047ccbfb239506991b84bb1e62e3 (patch)
treec48a3b884e3a07e81a19c5e9da9dcb2ba9540e52 /sys
parent9566430dfac0c03278e276bf249f5d674447e478 (diff)
downloadFreeBSD-src-1a0ef36b0146047ccbfb239506991b84bb1e62e3.zip
FreeBSD-src-1a0ef36b0146047ccbfb239506991b84bb1e62e3.tar.gz
Initialize cinfo structure at compile time rather than run time since
they are now constant.
Diffstat (limited to 'sys')
-rw-r--r--sys/pccard/mecia.c34
-rw-r--r--sys/pccard/pcic.c29
2 files changed, 29 insertions, 34 deletions
diff --git a/sys/pccard/mecia.c b/sys/pccard/mecia.c
index 394990a..76669c8 100644
--- a/sys/pccard/mecia.c
+++ b/sys/pccard/mecia.c
@@ -82,7 +82,22 @@ struct mecia_slot {
u_char last_reg1; /* Last value of change reg */
};
-static struct slot_ctrl mecia_cinfo;
+static struct slot_ctrl mecia_cinfo = {
+ mecia_mapirq,
+ mecia_memory,
+ mecia_io,
+ mecia_reset,
+ mecia_disable,
+ mecia_power,
+ mecia_ioctl,
+ mecia_resume,
+ 1,
+#if 0
+ 1
+#else
+ 2 /* Fake for UE2212 LAN card */
+#endif
+};
static int validunits = 0;
@@ -100,23 +115,6 @@ mecia_probe(device_t dev)
if (isa_get_logicalid(dev)) /* skip PnP probes */
return (ENXIO);
- /*
- * Initialise controller information structure.
- */
- mecia_cinfo.ioctl = mecia_ioctl;
- mecia_cinfo.mapmem = mecia_memory;
- mecia_cinfo.mapio = mecia_io;
- mecia_cinfo.power = mecia_power;
- mecia_cinfo.mapirq = mecia_mapirq;
- mecia_cinfo.reset = mecia_reset;
- mecia_cinfo.disable = mecia_disable;
- mecia_cinfo.resume = mecia_resume;
- mecia_cinfo.maxmem = 1;
-#if 0
- mecia_cinfo.maxio = 1;
-#else
- mecia_cinfo.maxio = 2; /* fake for UE2212 LAN card */
-#endif
if (inb(MECIA_REG0) != 0xff) {
validslots++;
/* XXX need to allocated the port resources */
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index ee470d2..01d1633 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -66,7 +66,18 @@ static int pcic_io(struct slot *, int);
devclass_t pcic_devclass;
-static struct slot_ctrl cinfo;
+static struct slot_ctrl pcic_cinfo = {
+ pcic_mapirq,
+ pcic_memory,
+ pcic_io,
+ pcic_reset,
+ pcic_disable,
+ pcic_power,
+ pcic_ioctl,
+ pcic_resume,
+ PCIC_MEM_WIN,
+ PCIC_IO_WIN
+};
/*
* Clear bit(s) of a register.
@@ -240,20 +251,6 @@ pcic_attach(device_t dev)
struct pcic_slot *sp;
int stat;
- /*
- * Initialise controller information structure.
- */
- cinfo.mapirq = pcic_mapirq;
- cinfo.mapmem = pcic_memory;
- cinfo.mapio = pcic_io;
- cinfo.ioctl = pcic_ioctl;
- cinfo.power = pcic_power;
- cinfo.reset = pcic_reset;
- cinfo.disable = pcic_disable;
- cinfo.resume = pcic_resume;
- cinfo.maxmem = PCIC_MEM_WIN;
- cinfo.maxio = PCIC_IO_WIN;
-
sc = (struct pcic_softc *) device_get_softc(dev);
sp = &sc->slots[0];
for (i = 0; i < PCIC_CARD_SLOTS; i++, sp++) {
@@ -266,7 +263,7 @@ pcic_attach(device_t dev)
return (ENXIO);
}
device_probe_and_attach(kid);
- slt = pccard_init_slot(kid, &cinfo);
+ slt = pccard_init_slot(kid, &pcic_cinfo);
if (slt == 0) {
device_printf(dev, "Can't get pccard info slot %d", i);
return (ENXIO);
OpenPOWER on IntegriCloud