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/ahci.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/ahci.c')
-rw-r--r-- | drivers/ata/ahci.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index c16820325d7b..c72fa468a697 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -1064,7 +1064,7 @@ static int ahci_do_softreset(struct ata_port *ap, unsigned int *class, | |||
1064 | ata_port_printk(ap, KERN_WARNING, | 1064 | ata_port_printk(ap, KERN_WARNING, |
1065 | "failed to reset engine (errno=%d)", rc); | 1065 | "failed to reset engine (errno=%d)", rc); |
1066 | 1066 | ||
1067 | ata_tf_init(ap->device, &tf); | 1067 | ata_tf_init(ap->link.device, &tf); |
1068 | 1068 | ||
1069 | /* issue the first D2H Register FIS */ | 1069 | /* issue the first D2H Register FIS */ |
1070 | msecs = 0; | 1070 | msecs = 0; |
@@ -1132,7 +1132,7 @@ static int ahci_hardreset(struct ata_port *ap, unsigned int *class, | |||
1132 | ahci_stop_engine(ap); | 1132 | ahci_stop_engine(ap); |
1133 | 1133 | ||
1134 | /* clear D2H reception area to properly wait for D2H FIS */ | 1134 | /* clear D2H reception area to properly wait for D2H FIS */ |
1135 | ata_tf_init(ap->device, &tf); | 1135 | ata_tf_init(ap->link.device, &tf); |
1136 | tf.command = 0x80; | 1136 | tf.command = 0x80; |
1137 | ata_tf_to_fis(&tf, 0, 0, d2h_fis); | 1137 | ata_tf_to_fis(&tf, 0, 0, d2h_fis); |
1138 | 1138 | ||
@@ -1159,7 +1159,7 @@ static int ahci_vt8251_hardreset(struct ata_port *ap, unsigned int *class, | |||
1159 | 1159 | ||
1160 | ahci_stop_engine(ap); | 1160 | ahci_stop_engine(ap); |
1161 | 1161 | ||
1162 | rc = sata_port_hardreset(ap, sata_ehc_deb_timing(&ap->eh_context), | 1162 | rc = sata_port_hardreset(ap, sata_ehc_deb_timing(&ap->link.eh_context), |
1163 | deadline); | 1163 | deadline); |
1164 | 1164 | ||
1165 | /* vt8251 needs SError cleared for the port to operate */ | 1165 | /* vt8251 needs SError cleared for the port to operate */ |
@@ -1278,7 +1278,7 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc) | |||
1278 | static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) | 1278 | static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) |
1279 | { | 1279 | { |
1280 | struct ahci_port_priv *pp = ap->private_data; | 1280 | struct ahci_port_priv *pp = ap->private_data; |
1281 | struct ata_eh_info *ehi = &ap->eh_info; | 1281 | struct ata_eh_info *ehi = &ap->link.eh_info; |
1282 | unsigned int err_mask = 0, action = 0; | 1282 | unsigned int err_mask = 0, action = 0; |
1283 | struct ata_queued_cmd *qc; | 1283 | struct ata_queued_cmd *qc; |
1284 | u32 serror; | 1284 | u32 serror; |
@@ -1332,7 +1332,7 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) | |||
1332 | ehi->serror |= serror; | 1332 | ehi->serror |= serror; |
1333 | ehi->action |= action; | 1333 | ehi->action |= action; |
1334 | 1334 | ||
1335 | qc = ata_qc_from_tag(ap, ap->active_tag); | 1335 | qc = ata_qc_from_tag(ap, ap->link.active_tag); |
1336 | if (qc) | 1336 | if (qc) |
1337 | qc->err_mask |= err_mask; | 1337 | qc->err_mask |= err_mask; |
1338 | else | 1338 | else |
@@ -1347,7 +1347,7 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) | |||
1347 | static void ahci_port_intr(struct ata_port *ap) | 1347 | static void ahci_port_intr(struct ata_port *ap) |
1348 | { | 1348 | { |
1349 | void __iomem *port_mmio = ap->ioaddr.cmd_addr; | 1349 | void __iomem *port_mmio = ap->ioaddr.cmd_addr; |
1350 | struct ata_eh_info *ehi = &ap->eh_info; | 1350 | struct ata_eh_info *ehi = &ap->link.eh_info; |
1351 | struct ahci_port_priv *pp = ap->private_data; | 1351 | struct ahci_port_priv *pp = ap->private_data; |
1352 | u32 status, qc_active; | 1352 | u32 status, qc_active; |
1353 | int rc, known_irq = 0; | 1353 | int rc, known_irq = 0; |
@@ -1360,7 +1360,7 @@ static void ahci_port_intr(struct ata_port *ap) | |||
1360 | return; | 1360 | return; |
1361 | } | 1361 | } |
1362 | 1362 | ||
1363 | if (ap->sactive) | 1363 | if (ap->link.sactive) |
1364 | qc_active = readl(port_mmio + PORT_SCR_ACT); | 1364 | qc_active = readl(port_mmio + PORT_SCR_ACT); |
1365 | else | 1365 | else |
1366 | qc_active = readl(port_mmio + PORT_CMD_ISSUE); | 1366 | qc_active = readl(port_mmio + PORT_CMD_ISSUE); |
@@ -1380,7 +1380,7 @@ static void ahci_port_intr(struct ata_port *ap) | |||
1380 | /* if !NCQ, ignore. No modern ATA device has broken HSM | 1380 | /* if !NCQ, ignore. No modern ATA device has broken HSM |
1381 | * implementation for non-NCQ commands. | 1381 | * implementation for non-NCQ commands. |
1382 | */ | 1382 | */ |
1383 | if (!ap->sactive) | 1383 | if (!ap->link.sactive) |
1384 | return; | 1384 | return; |
1385 | 1385 | ||
1386 | if (status & PORT_IRQ_D2H_REG_FIS) { | 1386 | if (status & PORT_IRQ_D2H_REG_FIS) { |
@@ -1433,7 +1433,7 @@ static void ahci_port_intr(struct ata_port *ap) | |||
1433 | if (!known_irq) | 1433 | if (!known_irq) |
1434 | ata_port_printk(ap, KERN_INFO, "spurious interrupt " | 1434 | ata_port_printk(ap, KERN_INFO, "spurious interrupt " |
1435 | "(irq_stat 0x%x active_tag 0x%x sactive 0x%x)\n", | 1435 | "(irq_stat 0x%x active_tag 0x%x sactive 0x%x)\n", |
1436 | status, ap->active_tag, ap->sactive); | 1436 | status, ap->link.active_tag, ap->link.sactive); |
1437 | } | 1437 | } |
1438 | 1438 | ||
1439 | static void ahci_irq_clear(struct ata_port *ap) | 1439 | static void ahci_irq_clear(struct ata_port *ap) |