Date: Fri, 21 Sep 2012 19:49:45 -0700 From: Jim Harris <jimharris@freebsd.org> To: John <jwd@freebsd.org> Cc: FreeBSD-scsi <freebsd-scsi@freebsd.org> Subject: Re: camcontrol inquiry xpt0 ? Message-ID: <CAJP=Hc-eB143FVDnRPv4sw6owkOExJxf2KQYXuXKJuX=1iEnyA@mail.gmail.com> In-Reply-To: <20120922021009.GA86891@FreeBSD.org> References: <20120922021009.GA86891@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 21, 2012 at 7:10 PM, John <jwd@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@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-scsi > To unsubscribe, send any mail to "freebsd-scsi-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJP=Hc-eB143FVDnRPv4sw6owkOExJxf2KQYXuXKJuX=1iEnyA>