[libata] ahci: send event when AN received

When we get an SDB FIS with the 'N' bit set, we should send
an event to user space to indicate that there has been a
media change.  This will be done via the scsi device.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Kristen Carlson Accardi
2007-08-15 04:11:25 -04:00
committed by Jeff Garzik
parent 9f45cbd3f0
commit 2f2949680a
3 changed files with 43 additions and 0 deletions

View File

@@ -3159,6 +3159,24 @@ static void ata_scsi_handle_link_detach(struct ata_link *link)
}
}
/**
* ata_scsi_media_change_notify - send media change event
* @atadev: Pointer to the disk device with media change event
*
* Tell the block layer to send a media change notification
* event.
*
* LOCKING:
* interrupt context, may not sleep.
*/
void ata_scsi_media_change_notify(struct ata_device *atadev)
{
#ifdef OTHER_AN_PATCHES_HAVE_BEEN_APPLIED
scsi_device_event_notify(atadev->sdev, SDEV_MEDIA_CHANGE);
#endif
}
EXPORT_SYMBOL_GPL(ata_scsi_media_change_notify);
/**
* ata_scsi_hotplug - SCSI part of hotplug
* @work: Pointer to ATA port to perform SCSI hotplug on