Alexander Motin wrote:
You should use device protocol for determining correct device type. You
should use ATA SMART commands for PROTO_ATA devices and SCSI equivalent
for PROTO_SCSI and PROTO_ATAPI devices. Transport type should not be
important for you.
atapicam reports devices as SCSI, but it reports only ATAPI devices, not
ATA disks, so there is no problem for you.
I already implemented this (protocol based detection for the CAM). Also current code autodetects USB connected devices using cam, but i`m doing it not via transport type, because it is available only starting from FreeBSD7.
I will try to replace parse_ata_chan_dev() and related code with new,
using ATAPI and CAM device type detections. First of all i want to
rewrite get_usb_id function with XPT_PATH_INQ, because this way we will
not need to scan all devices and code will be much easer.

I will need testers with adaX devices (FreeBSD8 with ahci driver) to
test the ada autodetection, please write me if you want to help.

I would like to review result code and I can test it if you need. Also I
have code in FreeBSD Perforce repository, wrapping legacy ata(4)
subsystem, turning it into real ATA CAM SIM, same as ahci. Wrapper is
not finished, but it is mostly working and could be suitable for your
tests. If you wish, I can generate diff against HEAD.
code is already committed to the SVN, and of course, testing is welcome, because i have only very limited number of devices (mostly ATA and SATA, 2 USB drives). Now everything but 3ware should work correctly, i will fix 3ware in a days. And yes, it is interesting for me to test this new cam<->ata code.