aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-acpi.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-08-06 05:36:22 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-12 14:55:30 -0400
commit9af5c9c97dc9d599281778864c72b385f0c63341 (patch)
tree8359986bd42c4a9a5b1993078aa9ee4c7971ac3d /drivers/ata/libata-acpi.c
parent640fdb504941fa2b9f6f274716fc9f97f2bf6bff (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/libata-acpi.c')
-rw-r--r--drivers/ata/libata-acpi.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index c059f78ad944..0023ac4ff496 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -44,7 +44,8 @@ static void ata_acpi_associate_sata_port(struct ata_port *ap)
44{ 44{
45 acpi_integer adr = SATA_ADR(ap->port_no, NO_PORT_MULT); 45 acpi_integer adr = SATA_ADR(ap->port_no, NO_PORT_MULT);
46 46
47 ap->device->acpi_handle = acpi_get_child(ap->host->acpi_handle, adr); 47 ap->link.device->acpi_handle =
48 acpi_get_child(ap->host->acpi_handle, adr);
48} 49}
49 50
50static void ata_acpi_associate_ide_port(struct ata_port *ap) 51static void ata_acpi_associate_ide_port(struct ata_port *ap)
@@ -60,7 +61,7 @@ static void ata_acpi_associate_ide_port(struct ata_port *ap)
60 max_devices++; 61 max_devices++;
61 62
62 for (i = 0; i < max_devices; i++) { 63 for (i = 0; i < max_devices; i++) {
63 struct ata_device *dev = &ap->device[i]; 64 struct ata_device *dev = &ap->link.device[i];
64 65
65 dev->acpi_handle = acpi_get_child(ap->acpi_handle, i); 66 dev->acpi_handle = acpi_get_child(ap->acpi_handle, i);
66 } 67 }
@@ -182,10 +183,10 @@ static int ata_acpi_stm(const struct ata_port *ap, struct ata_acpi_gtm *stm)
182 /* Buffers for id may need byteswapping ? */ 183 /* Buffers for id may need byteswapping ? */
183 in_params[1].type = ACPI_TYPE_BUFFER; 184 in_params[1].type = ACPI_TYPE_BUFFER;
184 in_params[1].buffer.length = 512; 185 in_params[1].buffer.length = 512;
185 in_params[1].buffer.pointer = (u8 *)ap->device[0].id; 186 in_params[1].buffer.pointer = (u8 *)ap->link.device[0].id;
186 in_params[2].type = ACPI_TYPE_BUFFER; 187 in_params[2].type = ACPI_TYPE_BUFFER;
187 in_params[2].buffer.length = 512; 188 in_params[2].buffer.length = 512;
188 in_params[2].buffer.pointer = (u8 *)ap->device[1].id; 189 in_params[2].buffer.pointer = (u8 *)ap->link.device[1].id;
189 190
190 input.count = 3; 191 input.count = 3;
191 input.pointer = in_params; 192 input.pointer = in_params;
@@ -226,7 +227,7 @@ static int ata_acpi_stm(const struct ata_port *ap, struct ata_acpi_gtm *stm)
226static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, 227static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
227 void **ptr_to_free) 228 void **ptr_to_free)
228{ 229{
229 struct ata_port *ap = dev->ap; 230 struct ata_port *ap = dev->link->ap;
230 acpi_status status; 231 acpi_status status;
231 struct acpi_buffer output; 232 struct acpi_buffer output;
232 union acpi_object *out_obj; 233 union acpi_object *out_obj;
@@ -320,7 +321,7 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
320static int taskfile_load_raw(struct ata_device *dev, 321static int taskfile_load_raw(struct ata_device *dev,
321 const struct ata_acpi_gtf *gtf) 322 const struct ata_acpi_gtf *gtf)
322{ 323{
323 struct ata_port *ap = dev->ap; 324 struct ata_port *ap = dev->link->ap;
324 struct ata_taskfile tf, rtf; 325 struct ata_taskfile tf, rtf;
325 unsigned int err_mask; 326 unsigned int err_mask;
326 327
@@ -424,7 +425,7 @@ static int ata_acpi_exec_tfs(struct ata_device *dev)
424 */ 425 */
425static int ata_acpi_push_id(struct ata_device *dev) 426static int ata_acpi_push_id(struct ata_device *dev)
426{ 427{
427 struct ata_port *ap = dev->ap; 428 struct ata_port *ap = dev->link->ap;
428 int err; 429 int err;
429 acpi_status status; 430 acpi_status status;
430 struct acpi_object_list input; 431 struct acpi_object_list input;
@@ -519,7 +520,7 @@ void ata_acpi_on_resume(struct ata_port *ap)
519 520
520 /* schedule _GTF */ 521 /* schedule _GTF */
521 for (i = 0; i < ATA_MAX_DEVICES; i++) 522 for (i = 0; i < ATA_MAX_DEVICES; i++)
522 ap->device[i].flags |= ATA_DFLAG_ACPI_PENDING; 523 ap->link.device[i].flags |= ATA_DFLAG_ACPI_PENDING;
523} 524}
524 525
525/** 526/**
@@ -538,8 +539,8 @@ void ata_acpi_on_resume(struct ata_port *ap)
538 */ 539 */
539int ata_acpi_on_devcfg(struct ata_device *dev) 540int ata_acpi_on_devcfg(struct ata_device *dev)
540{ 541{
541 struct ata_port *ap = dev->ap; 542 struct ata_port *ap = dev->link->ap;
542 struct ata_eh_context *ehc = &ap->eh_context; 543 struct ata_eh_context *ehc = &ap->link.eh_context;
543 int acpi_sata = ap->flags & ATA_FLAG_ACPI_SATA; 544 int acpi_sata = ap->flags & ATA_FLAG_ACPI_SATA;
544 int rc; 545 int rc;
545 546