summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-02-07 07:05:59 +0000
committerpeter <peter@FreeBSD.org>2001-02-07 07:05:59 +0000
commitd4473642637e5eadfea57b93316a31adcf33e702 (patch)
tree7daf0a32251f6c943f48831c9250eaf0e77a3776 /sys/cam/cam_xpt.c
parent2b52ef3ebe9d93d57501db078ac5327c92971919 (diff)
downloadFreeBSD-src-d4473642637e5eadfea57b93316a31adcf33e702.zip
FreeBSD-src-d4473642637e5eadfea57b93316a31adcf33e702.tar.gz
Change the peripheral driver list from a linker set to module driven
driver registration. This should allow things like da, sa, cd etc to be in seperate KLD's to the cam core and make them preloadable.
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r--sys/cam/cam_xpt.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 142fdf4..8e8a49b 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -576,8 +576,8 @@ static struct periph_driver probe_driver =
TAILQ_HEAD_INITIALIZER(probe_driver.units)
};
-DATA_SET(periphdriver_set, xpt_driver);
-DATA_SET(periphdriver_set, probe_driver);
+PERIPHDRIVER_DECLARE(xpt, xpt_driver);
+PERIPHDRIVER_DECLARE(probe, probe_driver);
#define XPT_CDEV_MAJOR 104
@@ -1167,8 +1167,7 @@ ptstartover:
cur_generation = xsoftc.generation;
/* first find our driver in the list of drivers */
- for (p_drv = (struct periph_driver **)periphdriver_set.ls_items;
- *p_drv != NULL; p_drv++)
+ for (p_drv = periph_drivers; *p_drv != NULL; p_drv++)
if (strcmp((*p_drv)->driver_name, name) == 0)
break;
@@ -2342,9 +2341,7 @@ xptplistperiphfunc(struct cam_periph *periph, void *arg)
* peripheral driver linker set entry would cost
* more in the long run than doing this quick lookup.
*/
- for (pdrv =
- (struct periph_driver **)periphdriver_set.ls_items;
- *pdrv != NULL; pdrv++) {
+ for (pdrv = periph_drivers; *pdrv != NULL; pdrv++) {
if (strcmp((*pdrv)->driver_name,
periph->periph_name) == 0)
break;
@@ -2546,8 +2543,7 @@ xptpdrvtraverse(struct periph_driver **start_pdrv,
* change while the system is running), the list traversal should
* be modified to work like the other traversal functions.
*/
- for (pdrv = (start_pdrv ? start_pdrv :
- (struct periph_driver **)periphdriver_set.ls_items);
+ for (pdrv = (start_pdrv ? start_pdrv : periph_drivers);
*pdrv != NULL; pdrv++) {
retval = tr_func(pdrv, arg);
@@ -6210,7 +6206,7 @@ xpt_finishconfig(struct cam_periph *periph, union ccb *done_ccb)
if (busses_to_config == 0) {
/* Register all the peripheral drivers */
/* XXX This will have to change when we have loadable modules */
- p_drv = (struct periph_driver **)periphdriver_set.ls_items;
+ p_drv = periph_drivers;
for (i = 0; p_drv[i] != NULL; i++) {
(*p_drv[i]->init)();
}
OpenPOWER on IntegriCloud