Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Dec 2015 10:13:56 -0700
From:      Alan Somers <asomers@freebsd.org>
To:        Ravi Pokala <rpokala@mac.com>
Cc:        Kevin Bowling <kevin.bowling@kev009.com>,  "freebsd-scsi@freebsd.org" <freebsd-scsi@freebsd.org>
Subject:   Re: Accessing static drive info w/o ATA identify and lockup with camcontrol identify
Message-ID:  <CAOtMX2gLyzyJOuj3Z1yOwZtcwGv-YHFk=5Lo-cU=pMRR5_j%2BUA@mail.gmail.com>
In-Reply-To: <CF44FCC6-F16A-448B-A1F4-0CFD84AD85D5@panasas.com>
References:  <80BB5907-CC31-4F06-9C70-E6F7834FF28E@panasas.com> <CAK7dMtBmMdOMs4vdPy0otprfWTVREJCyrVaeVtXj2gw-3BFQGA@mail.gmail.com> <E7955294-60BE-45B9-9197-33767EBD3DEA@panasas.com> <CAOtMX2je1o26g8DXjUopJZOT=uSqEnWz=rWe4a02vJRHShWdjg@mail.gmail.com> <CF44FCC6-F16A-448B-A1F4-0CFD84AD85D5@panasas.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Dec 10, 2015 at 9:25 AM, Ravi Pokala <rpokala@mac.com> wrote:
> -----Original Message-----
>
>
> From: <asomers@gmail.com> on behalf of Alan Somers <asomers@freebsd.org>
> Date: 2015-12-10, Thursday at 08:15
> To: Ravi Pokala <rpokala@panasas.com>
> Cc: Kevin Bowling <kevin.bowling@kev009.com>, Ravi Pokala <rpokala@mac.co=
m>, "freebsd-scsi@freebsd.org" <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 <rpokala@panasas.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2gLyzyJOuj3Z1yOwZtcwGv-YHFk=5Lo-cU=pMRR5_j%2BUA>