Lines Matching +full:cam +full:- +full:0

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 1997-2007 Kenneth D. Merry
50 #include <cam/cam.h>
51 #include <cam/cam_debug.h>
52 #include <cam/cam_ccb.h>
53 #include <cam/scsi/scsi_all.h>
54 #include <cam/scsi/scsi_da.h>
55 #include <cam/scsi/scsi_pass.h>
56 #include <cam/scsi/scsi_message.h>
57 #include <cam/scsi/smp_all.h>
58 #include <cam/ata/ata_all.h>
73 if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) { in print_periphs()
97 ccb.cdm.num_matches = 0; in print_periphs()
103 ccb.cdm.num_patterns = 0; in print_periphs()
104 ccb.cdm.pattern_buf_len = 0; in print_periphs()
106 path_id = -1; /* Make GCC happy. */ in print_periphs()
107 have_path_id = 0; in print_periphs()
118 if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { in print_periphs()
126 xo_warnx("got CAM error %#x, CDM error %d\n", in print_periphs()
131 for (i = 0; i < ccb.cdm.num_matches; i++) { in print_periphs()
140 if (strcmp(bus_result->dev_name, "iscsi") != 0) { in print_periphs()
145 if ((int)bus_result->unit_number != session_id) { in print_periphs()
146 //printf("wrong unit, %d != %d\n", bus_result->unit_number, session_id); in print_periphs()
149 skip_bus = 0; in print_periphs()
154 if (skip_bus != 0) in print_periphs()
157 skip_device = 0; in print_periphs()
166 if (skip_device != 0) in print_periphs()
169 if (strcmp(periph_result->periph_name, "pass") == 0) in print_periphs()
173 xo_emit("{e:lun/%d}", periph_result->target_lun); in print_periphs()
175 periph_result->periph_name, in print_periphs()
176 periph_result->unit_number); in print_periphs()
179 if (have_path_id == 0) { in print_periphs()
180 path_id = periph_result->path_id; in print_periphs()
197 have_path_id ? (int)path_id : -1, 0, have_path_id ? 0 : -1); in print_periphs()