diff options
author | Tejun Heo <htejun@gmail.com> | 2007-08-06 05:36:22 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-12 14:55:30 -0400 |
commit | 9af5c9c97dc9d599281778864c72b385f0c63341 (patch) | |
tree | 8359986bd42c4a9a5b1993078aa9ee4c7971ac3d /drivers/ata/sata_nv.c | |
parent | 640fdb504941fa2b9f6f274716fc9f97f2bf6bff (diff) |
libata-link: introduce ata_link
Introduce ata_link. It abstracts PHY and sits between ata_port and
ata_device. This new level of abstraction is necessary to support
SATA Port Multiplier, which basically adds a bunch of links (PHYs) to
a ATA host port. Fields related to command execution, spd_limit and
EH are per-link and thus moved to ata_link.
This patch only defines the host link. Multiple link handling will be
added later. Also, a lot of ap->link derefences are added but many of
them will be removed as each part is converted to deal directly with
ata_link instead of ata_port.
This patch introduces no behavior change.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: James Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/sata_nv.c')
-rw-r--r-- | drivers/ata/sata_nv.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 40dc73139858..df4d50dcffbc 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -594,7 +594,7 @@ static int nv_adma_slave_config(struct scsi_device *sdev) | |||
594 | /* Not a proper libata device, ignore */ | 594 | /* Not a proper libata device, ignore */ |
595 | return rc; | 595 | return rc; |
596 | 596 | ||
597 | if (ap->device[sdev->id].class == ATA_DEV_ATAPI) { | 597 | if (ap->link.device[sdev->id].class == ATA_DEV_ATAPI) { |
598 | /* | 598 | /* |
599 | * NVIDIA reports that ADMA mode does not support ATAPI commands. | 599 | * NVIDIA reports that ADMA mode does not support ATAPI commands. |
600 | * Therefore ATAPI commands are sent through the legacy interface. | 600 | * Therefore ATAPI commands are sent through the legacy interface. |
@@ -711,7 +711,7 @@ static int nv_adma_check_cpb(struct ata_port *ap, int cpb_num, int force_err) | |||
711 | flags & (NV_CPB_RESP_ATA_ERR | | 711 | flags & (NV_CPB_RESP_ATA_ERR | |
712 | NV_CPB_RESP_CMD_ERR | | 712 | NV_CPB_RESP_CMD_ERR | |
713 | NV_CPB_RESP_CPB_ERR)))) { | 713 | NV_CPB_RESP_CPB_ERR)))) { |
714 | struct ata_eh_info *ehi = &ap->eh_info; | 714 | struct ata_eh_info *ehi = &ap->link.eh_info; |
715 | int freeze = 0; | 715 | int freeze = 0; |
716 | 716 | ||
717 | ata_ehi_clear_desc(ehi); | 717 | ata_ehi_clear_desc(ehi); |
@@ -747,7 +747,7 @@ static int nv_adma_check_cpb(struct ata_port *ap, int cpb_num, int force_err) | |||
747 | DPRINTK("Completing qc from tag %d\n",cpb_num); | 747 | DPRINTK("Completing qc from tag %d\n",cpb_num); |
748 | ata_qc_complete(qc); | 748 | ata_qc_complete(qc); |
749 | } else { | 749 | } else { |
750 | struct ata_eh_info *ehi = &ap->eh_info; | 750 | struct ata_eh_info *ehi = &ap->link.eh_info; |
751 | /* Notifier bits set without a command may indicate the drive | 751 | /* Notifier bits set without a command may indicate the drive |
752 | is misbehaving. Raise host state machine violation on this | 752 | is misbehaving. Raise host state machine violation on this |
753 | condition. */ | 753 | condition. */ |
@@ -764,7 +764,7 @@ static int nv_adma_check_cpb(struct ata_port *ap, int cpb_num, int force_err) | |||
764 | 764 | ||
765 | static int nv_host_intr(struct ata_port *ap, u8 irq_stat) | 765 | static int nv_host_intr(struct ata_port *ap, u8 irq_stat) |
766 | { | 766 | { |
767 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); | 767 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->link.active_tag); |
768 | 768 | ||
769 | /* freeze if hotplugged */ | 769 | /* freeze if hotplugged */ |
770 | if (unlikely(irq_stat & (NV_INT_ADDED | NV_INT_REMOVED))) { | 770 | if (unlikely(irq_stat & (NV_INT_ADDED | NV_INT_REMOVED))) { |
@@ -817,7 +817,7 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) | |||
817 | if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) { | 817 | if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) { |
818 | u8 irq_stat = readb(host->iomap[NV_MMIO_BAR] + NV_INT_STATUS_CK804) | 818 | u8 irq_stat = readb(host->iomap[NV_MMIO_BAR] + NV_INT_STATUS_CK804) |
819 | >> (NV_INT_PORT_SHIFT * i); | 819 | >> (NV_INT_PORT_SHIFT * i); |
820 | if(ata_tag_valid(ap->active_tag)) | 820 | if(ata_tag_valid(ap->link.active_tag)) |
821 | /** NV_INT_DEV indication seems unreliable at times | 821 | /** NV_INT_DEV indication seems unreliable at times |
822 | at least in ADMA mode. Force it on always when a | 822 | at least in ADMA mode. Force it on always when a |
823 | command is active, to prevent losing interrupts. */ | 823 | command is active, to prevent losing interrupts. */ |
@@ -852,7 +852,7 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) | |||
852 | NV_ADMA_STAT_HOTUNPLUG | | 852 | NV_ADMA_STAT_HOTUNPLUG | |
853 | NV_ADMA_STAT_TIMEOUT | | 853 | NV_ADMA_STAT_TIMEOUT | |
854 | NV_ADMA_STAT_SERROR))) { | 854 | NV_ADMA_STAT_SERROR))) { |
855 | struct ata_eh_info *ehi = &ap->eh_info; | 855 | struct ata_eh_info *ehi = &ap->link.eh_info; |
856 | 856 | ||
857 | ata_ehi_clear_desc(ehi); | 857 | ata_ehi_clear_desc(ehi); |
858 | __ata_ehi_push_desc(ehi, "ADMA status 0x%08x: ", status ); | 858 | __ata_ehi_push_desc(ehi, "ADMA status 0x%08x: ", status ); |
@@ -879,10 +879,10 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) | |||
879 | u32 check_commands; | 879 | u32 check_commands; |
880 | int pos, error = 0; | 880 | int pos, error = 0; |
881 | 881 | ||
882 | if(ata_tag_valid(ap->active_tag)) | 882 | if(ata_tag_valid(ap->link.active_tag)) |
883 | check_commands = 1 << ap->active_tag; | 883 | check_commands = 1 << ap->link.active_tag; |
884 | else | 884 | else |
885 | check_commands = ap->sactive; | 885 | check_commands = ap->link.sactive; |
886 | 886 | ||
887 | /** Check CPBs for completed commands */ | 887 | /** Check CPBs for completed commands */ |
888 | while ((pos = ffs(check_commands)) && !error) { | 888 | while ((pos = ffs(check_commands)) && !error) { |
@@ -1333,7 +1333,7 @@ static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance) | |||
1333 | !(ap->flags & ATA_FLAG_DISABLED)) { | 1333 | !(ap->flags & ATA_FLAG_DISABLED)) { |
1334 | struct ata_queued_cmd *qc; | 1334 | struct ata_queued_cmd *qc; |
1335 | 1335 | ||
1336 | qc = ata_qc_from_tag(ap, ap->active_tag); | 1336 | qc = ata_qc_from_tag(ap, ap->link.active_tag); |
1337 | if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) | 1337 | if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) |
1338 | handled += ata_host_intr(ap, qc); | 1338 | handled += ata_host_intr(ap, qc); |
1339 | else | 1339 | else |
@@ -1485,7 +1485,7 @@ static void nv_adma_error_handler(struct ata_port *ap) | |||
1485 | int i; | 1485 | int i; |
1486 | u16 tmp; | 1486 | u16 tmp; |
1487 | 1487 | ||
1488 | if(ata_tag_valid(ap->active_tag) || ap->sactive) { | 1488 | if(ata_tag_valid(ap->link.active_tag) || ap->link.sactive) { |
1489 | u32 notifier = readl(mmio + NV_ADMA_NOTIFIER); | 1489 | u32 notifier = readl(mmio + NV_ADMA_NOTIFIER); |
1490 | u32 notifier_error = readl(mmio + NV_ADMA_NOTIFIER_ERROR); | 1490 | u32 notifier_error = readl(mmio + NV_ADMA_NOTIFIER_ERROR); |
1491 | u32 gen_ctl = readl(pp->gen_block + NV_ADMA_GEN_CTL); | 1491 | u32 gen_ctl = readl(pp->gen_block + NV_ADMA_GEN_CTL); |
@@ -1501,8 +1501,8 @@ static void nv_adma_error_handler(struct ata_port *ap) | |||
1501 | 1501 | ||
1502 | for( i=0;i<NV_ADMA_MAX_CPBS;i++) { | 1502 | for( i=0;i<NV_ADMA_MAX_CPBS;i++) { |
1503 | struct nv_adma_cpb *cpb = &pp->cpb[i]; | 1503 | struct nv_adma_cpb *cpb = &pp->cpb[i]; |
1504 | if( (ata_tag_valid(ap->active_tag) && i == ap->active_tag) || | 1504 | if( (ata_tag_valid(ap->link.active_tag) && i == ap->link.active_tag) || |
1505 | ap->sactive & (1 << i) ) | 1505 | ap->link.sactive & (1 << i) ) |
1506 | ata_port_printk(ap, KERN_ERR, | 1506 | ata_port_printk(ap, KERN_ERR, |
1507 | "CPB %d: ctl_flags 0x%x, resp_flags 0x%x\n", | 1507 | "CPB %d: ctl_flags 0x%x, resp_flags 0x%x\n", |
1508 | i, cpb->ctl_flags, cpb->resp_flags); | 1508 | i, cpb->ctl_flags, cpb->resp_flags); |