From owner-freebsd-scsi@freebsd.org Thu Dec 10 17:13:57 2015 Return-Path: Delivered-To: freebsd-scsi@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03A3B9D68F3 for ; Thu, 10 Dec 2015 17:13:57 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ob0-x235.google.com (mail-ob0-x235.google.com [IPv6:2607:f8b0:4003:c01::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C20DF10BD for ; Thu, 10 Dec 2015 17:13:56 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by obcse5 with SMTP id se5so64142916obc.3 for ; Thu, 10 Dec 2015 09:13:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=DTvFIf3kx2NhdrboJDA54Ag95eHYvwNQhHXXlDKZt48=; b=dlf92jjY7F8COOz9QEaM4YCT7H2+XVTnKTeyGN/nuMXkWM6lRtSPN67W3DT9z8ceZ+ WTj01agjPO0Xc1JgOFbqJUUH/1CaestsMa5iLnfHV1yhi8AbIPoRsPqicPaHwdhxX4X2 q/Mn0Y9dabT+n/f4bTFhftkxeL3awacoMDYP9Vlq8XinWoaSe5lJqkM5RLdroL1AlZBd L58fUx6eXSBSH9oRR+u0dXs/1Ks0uxikAXMAeGRfVfhOWb3haJ/IpMuiLR19Fkl33D7R LII18U4hbas2f1sQRpsdNS8NHPmZUMwFjRqLzFGhJ5xRLGtNaOsKgTDrbLlfoibPHEiV K0GQ== MIME-Version: 1.0 X-Received: by 10.60.92.138 with SMTP id cm10mr10211025oeb.64.1449767636175; Thu, 10 Dec 2015 09:13:56 -0800 (PST) Sender: asomers@gmail.com Received: by 10.202.0.7 with HTTP; Thu, 10 Dec 2015 09:13:56 -0800 (PST) In-Reply-To: References: <80BB5907-CC31-4F06-9C70-E6F7834FF28E@panasas.com> Date: Thu, 10 Dec 2015 10:13:56 -0700 X-Google-Sender-Auth: xXpqayMDlhy7eY2BeLoNKWaNTlM Message-ID: Subject: Re: Accessing static drive info w/o ATA identify and lockup with camcontrol identify From: Alan Somers To: Ravi Pokala Cc: Kevin Bowling , "freebsd-scsi@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 17:13:57 -0000 On Thu, Dec 10, 2015 at 9:25 AM, Ravi Pokala wrote: > -----Original Message----- > > > From: on behalf of Alan Somers > Date: 2015-12-10, Thursday at 08:15 > To: Ravi Pokala > Cc: Kevin Bowling , Ravi Pokala , "freebsd-scsi@freebsd.org" > Subject: Re: Accessing static drive info w/o ATA identify and lockup with= camcontrol identify > >>On Thu, Dec 10, 2015 at 9:10 AM, Pokala, Ravi wrote= : >>>Interesting. I never noticed that firmware wasn't already included in "s= truct disk", like drive model and serial number already are. It should be t= rivial to add, but keeping a copy of the string will of course make "struct= disk" larger. That might have implications on KBI compatibility for out-of= -tree drivers...? Again, I'm not sure. >> >> >>This information is already perserved in CAM, if not in GEOM. For >>SCSI disks, look at (struct cam_device).inq_data.revision. For ATA >>disks, look at (struct ccb_getdev).ident_data.revision. > > Right, but it sounded like Kevin was looking for a way to get this from u= serland. That means through something like `geom disk list' (or the raw XML= from which that is parsed). > > -Ravi > Actually, it is possible to get that info in userland, though a little awkward. You can do 'cam_open_device("da13")' to get a struct cam_device. Getting the ccb_getdev is harder though. Look at get_cgd() from camcontrol.c. Even though it looks like it's sending a CCB, the CCB actually gets processed by CAM and doesn't result in any I/O hitting the disk. -Alan