Accessing static drive info w/o ATA identify and lockup with camcontrol identify

Pokala, Ravi rpokala at panasas.com
Thu Dec 10 21:44:04 UTC 2015


-----Original Message-----


From: <asomers at gmail.com> on behalf of Alan Somers <asomers at freebsd.org>
Date: 2015-12-10, Thursday at 09:13
To: Ravi Pokala <rpokala at mac.com>
Cc: Kevin Bowling <kevin.bowling at kev009.com>, "freebsd-scsi at freebsd.org" <freebsd-scsi at freebsd.org>
Subject: Re: Accessing static drive info w/o ATA identify and lockup with camcontrol identify

>Actually, it is possible to get that info in userland, though a little
>Awkward.

Oh sure. For various historical reasons, I get ident information by passing an IDENTIFY_DEVICE command from userland via passthrough ioctl, then extract what I need from there. It's a heavy hammer, but it works.


>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.

Yeah, I saw that when I was looking at this this morning. It looks like there are quite a few CAM ioctls which just return information that's already in the kernel, without sending any commands to any devices.

-Ravi

>-Alan


More information about the freebsd-scsi mailing list