camcontrol inquiry xpt0 ?
Jim Harris
jimharris at freebsd.org
Sat Sep 22 02:49:46 UTC 2012
On Fri, Sep 21, 2012 at 7:10 PM, John <jwd at freebsd.org> wrote:
> Hi Folks,
>
> I'm trying to understand how some code in the mps driver works,
> specifically sys/dev/mps/mps_sas.c:
>
> static void
> mpssas_action(struct cam_sim *sim, union ccb *ccb)
> {
> struct mpssas_softc *sassc;
>
> sassc = cam_sim_softc(sim);
>
> mps_dprint(sassc->sc, MPS_TRACE, "%s func 0x%x\n", __func__,
> ccb->ccb_h.func_code);
> mtx_assert(&sassc->sc->mps_mtx, MA_OWNED);
>
> switch (ccb->ccb_h.func_code) {
> case XPT_PATH_INQ:
> {
>
>
> In trying to cause the the XPT_PATH_INQ case to execute, I was
> playing around with the pass driver and xpt:
>
> camcontrol inquiry xpt0
>
> and received the following:
>
> camcontrol: cam_lookup_pass: CAMGETPASSTHRU ioctl failed
> cam_lookup_pass: No such file or directory
> cam_lookup_pass: either the pass driver isn't in your kernel
> cam_lookup_pass: or xpt0 doesn't exist
>
> However, pass is in the kernel, and /dev/xpt0 exists:
>
> # ls -al /dev/xpt0
> crw------- 1 root operator 0, 81 Sep 20 08:05 /dev/xpt0
>
> And for instance:
>
> # camcontrol inquiry pass22
> pass22: <HP EG0600FBLSH HPD2> Fixed Direct Access SCSI-5 device
> pass22: Serial Number 6XR15VLY0000M149G7XX
> pass22: 600.000MB/s transfers, Command Queueing Enabled
>
>
> I'm trying figure out if the code above setting itself as
> device id 255 is related to my system not being able to scan
> the disk device at id 255.
>
> Am I doing something wrong? Any ideas?
The names are similar, but XPT_PATH_INQ isn't actually associated at
all with a SCSI INQUIRY command. XPT_PATH_INQ is the first CCB sent
to the driver, so that CAM can get the basic characteristics of the
SIM to proceed with enumeration. SCSI INQUIRY commands come into the
SIM driver through the XPT_SCSI_IO opcode.
xpt0 isn't a SCSI device, which is why camcontrol is showing the error
messages you're seeing.
I think "camcontrol negotiate" is a way to invoke the XPT_PATH_INQ
code path after the controller has initialized, but I haven't tried
this myself.
-Jim
The code path you are looking at gets invoked during controller
initialization.
> FreeBSD 9.1-PRERELEASE #0:
>
> Thanks!
> John
>
> _______________________________________________
> freebsd-scsi at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-scsi
> To unsubscribe, send any mail to "freebsd-scsi-unsubscribe at freebsd.org"
More information about the freebsd-scsi
mailing list