ata: ahci: find eSATA ports and flag them as removable
authorManuel Lauss <manuel.lauss@gmail.com>
Wed, 30 Sep 2015 19:10:25 +0000 (21:10 +0200)
committerTejun Heo <tj@kernel.org>
Wed, 30 Sep 2015 21:37:55 +0000 (17:37 -0400)
commit8a3e33cf92c7b7ae25c589eccd1a69ab11cc4353
tree5dd0856ad1213f3100101f7be901f682ca3ebf98
parenta73f22f9811da0f69d5f04eadcfc87b4d6280814
ata: ahci: find eSATA ports and flag them as removable

If the AHCI ports' HPCP or ESP bits are set, the port
should be considered external (e.g. eSATA) and is marked
as removable.  Userspace tools like udisks then treat it
like an usb drive.

With this patch applied, when I plug a drive into the esata port,
KDE pops up a window asking what to do with the drives(s), just
like it does for any random USB stick.

Removability is indicated to the upper layers by way of the
SCSI RMB bit, as I haven't found another way to signal
userspace to treat a sata disk like any usb stick.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/ahci.h
drivers/ata/libahci.c
drivers/ata/libata-scsi.c
include/linux/libata.h