From owner-freebsd-scsi@FreeBSD.ORG Sat Sep 22 02:49:46 2012 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B77A106564A; Sat, 22 Sep 2012 02:49:46 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 21C778FC08; Sat, 22 Sep 2012 02:49:45 +0000 (UTC) Received: by vcbfw7 with SMTP id fw7so5963191vcb.13 for ; Fri, 21 Sep 2012 19:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=sIruuyLqI66XqEmQi0KKfZ9dpRG1B2g9pAD8rQIpn6g=; b=ogVnp0bnJKo5Gt6rchTNny7nvxx3yqVnxld5JgnZo+x18tXKaRzkNDSCysu5rVyrE1 Pfa2DERcEvAbiLhPUAh25wzzhH5huFsh0/bPFvGp7O/gYYKvF+0U9a4CJo8Z1n2UAVoM vJ9aXqliHmbJZvDXh1NMes72zVoYMHCHXl27uaXMhygQDuP52O2mcAXC5D5IINnnCcYF ZWMOAWUytdM/rnOi8F5Yc7HPUEPMMwcJueoN/Owqxk8zEUFBPU2akvWqAA0aIObxnxJH 1GXCdUpCBzHwL0DDg0RcP+yH1zGlWSJlVJyijJzSIFQy0hvAi0fK2oc7xTpgKiardqe5 6+gQ== MIME-Version: 1.0 Received: by 10.221.13.202 with SMTP id pn10mr3976811vcb.57.1348282185183; Fri, 21 Sep 2012 19:49:45 -0700 (PDT) Sender: jim.harris@gmail.com Received: by 10.58.249.135 with HTTP; Fri, 21 Sep 2012 19:49:45 -0700 (PDT) In-Reply-To: <20120922021009.GA86891@FreeBSD.org> References: <20120922021009.GA86891@FreeBSD.org> Date: Fri, 21 Sep 2012 19:49:45 -0700 X-Google-Sender-Auth: xIj0m-1dqF6GKBGz_s5iw02R-js Message-ID: From: Jim Harris To: John Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD-scsi Subject: Re: camcontrol inquiry xpt0 ? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 02:49:46 -0000 On Fri, Sep 21, 2012 at 7:10 PM, John 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: 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"