diff options
author | peter <peter@FreeBSD.org> | 2001-06-12 09:40:04 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-06-12 09:40:04 +0000 |
commit | bbbe8875f0844bdf4e10cbc01dc9c7f2a2c8368a (patch) | |
tree | ddf23af998adfeb85fbbf912b89e3fa83f84fd4b /sys/cam/cam_xpt.c | |
parent | b44fc46ed5521eb3028aafbc0c4aef220ed24141 (diff) | |
download | FreeBSD-src-bbbe8875f0844bdf4e10cbc01dc9c7f2a2c8368a.zip FreeBSD-src-bbbe8875f0844bdf4e10cbc01dc9c7f2a2c8368a.tar.gz |
Hints overhaul:
- Replace some very poorly thought out API hacks that should have been
fixed a long while ago.
- Provide some much more flexible search functions (resource_find_*())
- Use strings for storage instead of an outgrowth of the rather
inconvenient temporary ioconf table from config(). We already had a
fallback to using strings before malloc/vm was running anyway.
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r-- | sys/cam/cam_xpt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 6c3cf99..6374e47 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -4346,7 +4346,7 @@ xptnextfreepathid(void) { struct cam_eb *bus; path_id_t pathid; - char *strval; + const char *strval; pathid = 0; bus = TAILQ_FIRST(&xpt_busses); @@ -4377,16 +4377,16 @@ xptpathid(const char *sim_name, int sim_unit, int sim_bus) path_id_t pathid; int i, dunit, val; char buf[32]; + const char *dname; pathid = CAM_XPT_PATH_ID; snprintf(buf, sizeof(buf), "%s%d", sim_name, sim_unit); - i = -1; - while ((i = resource_query_string(i, "at", buf)) != -1) { - if (strcmp(resource_query_name(i), "scbus")) { + i = 0; + while ((resource_find_match(&i, &dname, &dunit, "at", buf)) == 0) { + if (strcmp(dname, "scbus")) { /* Avoid a bit of foot shooting. */ continue; } - dunit = resource_query_unit(i); if (dunit < 0) /* unwired?! */ continue; if (resource_int_value("scbus", dunit, "bus", &val) == 0) { |