diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-07 09:47:22 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:25 -0400 |
commit | 071f44b1d2c051641b62a3571223314737ccbe59 (patch) | |
tree | a07794c8109e5d82a78223ae0159eadbf862c463 /drivers/ata/libata-scsi.c | |
parent | 48515f6c006c2a9d7b624ee8ad068018c2d3fe0e (diff) |
libata: implement PMP helpers
Implement helpers to test whether PMP is supported, attached and
determine pmp number to use when issuing SRST to a link. While at it,
move ata_is_host_link() so that it's together with the two new PMP
helpers.
This change simplifies LLDs and helps making PMP support optional.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index a70881c408e5..fedf62de9460 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2617,7 +2617,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc) | |||
2617 | 2617 | ||
2618 | static struct ata_device *ata_find_dev(struct ata_port *ap, int devno) | 2618 | static struct ata_device *ata_find_dev(struct ata_port *ap, int devno) |
2619 | { | 2619 | { |
2620 | if (ap->nr_pmp_links == 0) { | 2620 | if (!sata_pmp_attached(ap)) { |
2621 | if (likely(devno < ata_link_max_devices(&ap->link))) | 2621 | if (likely(devno < ata_link_max_devices(&ap->link))) |
2622 | return &ap->link.device[devno]; | 2622 | return &ap->link.device[devno]; |
2623 | } else { | 2623 | } else { |
@@ -2634,7 +2634,7 @@ static struct ata_device *__ata_scsi_find_dev(struct ata_port *ap, | |||
2634 | int devno; | 2634 | int devno; |
2635 | 2635 | ||
2636 | /* skip commands not addressed to targets we simulate */ | 2636 | /* skip commands not addressed to targets we simulate */ |
2637 | if (ap->nr_pmp_links == 0) { | 2637 | if (!sata_pmp_attached(ap)) { |
2638 | if (unlikely(scsidev->channel || scsidev->lun)) | 2638 | if (unlikely(scsidev->channel || scsidev->lun)) |
2639 | return NULL; | 2639 | return NULL; |
2640 | devno = scsidev->id; | 2640 | devno = scsidev->id; |
@@ -3492,7 +3492,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, | |||
3492 | if (lun != SCAN_WILD_CARD && lun) | 3492 | if (lun != SCAN_WILD_CARD && lun) |
3493 | return -EINVAL; | 3493 | return -EINVAL; |
3494 | 3494 | ||
3495 | if (ap->nr_pmp_links == 0) { | 3495 | if (!sata_pmp_attached(ap)) { |
3496 | if (channel != SCAN_WILD_CARD && channel) | 3496 | if (channel != SCAN_WILD_CARD && channel) |
3497 | return -EINVAL; | 3497 | return -EINVAL; |
3498 | devno = id; | 3498 | devno = id; |