NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Rescanning ahcisata* or atabus* for eSATA



I have an external enclosure capable of connecting a hard disk whether
with USB (3.0) or eSATA.

I have put a bracket with eSATA connectors on a amd64 box (and this is
just a SATA to eSATA connector, just a difference in connectors shape,
there is no circuitry involved).

If I reboot the node (and the enclosure is powered) the external disk is
recognized the same way as if it was directly connected to the SATA
port.

I can detach with:

# drvctl -d wd?

or the wedges (the disk is GPT partitionned) are still present and
trying to mount fails (no hard lock) with input/output error. As long as
the device is not detached, the initial information (device tree and
wedges) is kept.

But I tried the reverse operation: trying to rescan the bus.

On ahcisata?, this is EOPNOTSUPP.

On atabus?, this is EINVAL. I tried to wander in the sources but
couldn't find where the EINVAL comes from. There is rescan routine in
dev/ata/ata.c, and EINVAL comes not from there; in atabusioctl(), there
is no support for RESCAN...

So is there a way to rescan a sata bus, at whatever level (ahcisata or,
lower, atabus)?

On a more general way, what is the pattern for ioctl calling: what
subroutine is called via this generic name or, more precisely, how one
can infer the name of the routine really called starting from the type
of device the ioctl applies to?

TIA
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                     http://www.kergis.com/
                       http://www.sbfa.fr/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index