Deleted Added
full compact
cam_xpt.c (77710) cam_xpt.c (78135)
1/*
2 * Implementation of the Common Access Method Transport (XPT) layer.
3 *
4 * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*
2 * Implementation of the Common Access Method Transport (XPT) layer.
3 *
4 * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/cam/cam_xpt.c 77710 2001-06-04 18:23:49Z mjacob $
29 * $FreeBSD: head/sys/cam/cam_xpt.c 78135 2001-06-12 09:40:04Z peter $
30 */
31#include <sys/param.h>
32#include <sys/bus.h>
33#include <sys/systm.h>
34#include <sys/types.h>
35#include <sys/malloc.h>
36#include <sys/kernel.h>
37#include <sys/time.h>

--- 4303 unchanged lines hidden (view full) ---

4341 return (CAM_REQ_CMP);
4342}
4343
4344static path_id_t
4345xptnextfreepathid(void)
4346{
4347 struct cam_eb *bus;
4348 path_id_t pathid;
30 */
31#include <sys/param.h>
32#include <sys/bus.h>
33#include <sys/systm.h>
34#include <sys/types.h>
35#include <sys/malloc.h>
36#include <sys/kernel.h>
37#include <sys/time.h>

--- 4303 unchanged lines hidden (view full) ---

4341 return (CAM_REQ_CMP);
4342}
4343
4344static path_id_t
4345xptnextfreepathid(void)
4346{
4347 struct cam_eb *bus;
4348 path_id_t pathid;
4349 char *strval;
4349 const char *strval;
4350
4351 pathid = 0;
4352 bus = TAILQ_FIRST(&xpt_busses);
4353retry:
4354 /* Find an unoccupied pathid */
4355 while (bus != NULL
4356 && bus->path_id <= pathid) {
4357 if (bus->path_id == pathid)

--- 14 unchanged lines hidden (view full) ---

4372}
4373
4374static path_id_t
4375xptpathid(const char *sim_name, int sim_unit, int sim_bus)
4376{
4377 path_id_t pathid;
4378 int i, dunit, val;
4379 char buf[32];
4350
4351 pathid = 0;
4352 bus = TAILQ_FIRST(&xpt_busses);
4353retry:
4354 /* Find an unoccupied pathid */
4355 while (bus != NULL
4356 && bus->path_id <= pathid) {
4357 if (bus->path_id == pathid)

--- 14 unchanged lines hidden (view full) ---

4372}
4373
4374static path_id_t
4375xptpathid(const char *sim_name, int sim_unit, int sim_bus)
4376{
4377 path_id_t pathid;
4378 int i, dunit, val;
4379 char buf[32];
4380 const char *dname;
4380
4381 pathid = CAM_XPT_PATH_ID;
4382 snprintf(buf, sizeof(buf), "%s%d", sim_name, sim_unit);
4381
4382 pathid = CAM_XPT_PATH_ID;
4383 snprintf(buf, sizeof(buf), "%s%d", sim_name, sim_unit);
4383 i = -1;
4384 while ((i = resource_query_string(i, "at", buf)) != -1) {
4385 if (strcmp(resource_query_name(i), "scbus")) {
4384 i = 0;
4385 while ((resource_find_match(&i, &dname, &dunit, "at", buf)) == 0) {
4386 if (strcmp(dname, "scbus")) {
4386 /* Avoid a bit of foot shooting. */
4387 continue;
4388 }
4387 /* Avoid a bit of foot shooting. */
4388 continue;
4389 }
4389 dunit = resource_query_unit(i);
4390 if (dunit < 0) /* unwired?! */
4391 continue;
4392 if (resource_int_value("scbus", dunit, "bus", &val) == 0) {
4393 if (sim_bus == val) {
4394 pathid = dunit;
4395 break;
4396 }
4397 } else if (sim_bus == 0) {

--- 2588 unchanged lines hidden ---
4390 if (dunit < 0) /* unwired?! */
4391 continue;
4392 if (resource_int_value("scbus", dunit, "bus", &val) == 0) {
4393 if (sim_bus == val) {
4394 pathid = dunit;
4395 break;
4396 }
4397 } else if (sim_bus == 0) {

--- 2588 unchanged lines hidden ---