summaryrefslogtreecommitdiffstats
path: root/sys/pccard
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1997-10-26 21:08:42 +0000
committernate <nate@FreeBSD.org>1997-10-26 21:08:42 +0000
commitfa55951ed537b4c4f68482e66fc7123eab0cf3fc (patch)
tree0439bf497279cd9e48c661b7d3e61a65cd486efb /sys/pccard
parentc76c50d092e899d58a0c957da71951be8e875d62 (diff)
downloadFreeBSD-src-fa55951ed537b4c4f68482e66fc7123eab0cf3fc.zip
FreeBSD-src-fa55951ed537b4c4f68482e66fc7123eab0cf3fc.tar.gz
- Instead of relying on a functional call to register PCARD-capable drivers,
use a Linker Set. Note, if a driver is loaded as an LKM if will have to use the function call, but since none of the existing drivers are loadable, this made things cleaner and boot messages nicer. Obtained from: PAO-970616
Diffstat (limited to 'sys/pccard')
-rw-r--r--sys/pccard/driver.h1
-rw-r--r--sys/pccard/pccard.c12
-rw-r--r--sys/pccard/skel.c2
3 files changed, 13 insertions, 2 deletions
diff --git a/sys/pccard/driver.h b/sys/pccard/driver.h
index ee6942d..5e3a693 100644
--- a/sys/pccard/driver.h
+++ b/sys/pccard/driver.h
@@ -9,6 +9,7 @@
struct lkm_table;
struct pccard_device;
+extern struct linker_set pccarddrv_set;
void pccard_add_driver __P((struct pccard_device *));
#ifdef _I386_ISA_ISA_DEVICE_H_ /* XXX actually if inthand2_t is declared */
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index cf6f62d..549f215 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -141,13 +141,22 @@ static struct cdevsw crd_cdevsw =
* slot number accessed via the character device entries.
*/
void
-pccard_configure()
+pccard_configure(void)
{
+ struct pccard_device **drivers, *drv;
#include "pcic.h"
#if NPCIC > 0
pcic_probe();
#endif
+
+ drivers = (struct pccard_device **)pccarddrv_set.ls_items;
+ printf("Initializing PC-card drivers:");
+ while ((drv = *drivers++)) {
+ printf(" %s", drv->name);
+ pccard_add_driver(drv);
+ }
+ printf("\n");
}
/*
@@ -164,7 +173,6 @@ pccard_add_driver(struct pccard_device *drv)
printf("Driver %s already loaded\n", drv->name);
return;
}
- printf("pccard driver %s added\n", drv->name);
drv->next = drivers;
drivers = drv;
}
diff --git a/sys/pccard/skel.c b/sys/pccard/skel.c
index d0e7d6e..38daba4 100644
--- a/sys/pccard/skel.c
+++ b/sys/pccard/skel.c
@@ -63,6 +63,8 @@ static struct pccard_device skel_info = {
&net_imask /* Interrupt mask for device */
};
+DATA_SET(pccarddrv_set, skel_info);
+
static int opened; /* Rather minimal device state... */
/*
OpenPOWER on IntegriCloud