* [patch 04/15] libata: Allow for ata_port without a libata owned scsi_host
@ 2006-02-06 15:42 brking
2006-02-09 7:19 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: brking @ 2006-02-06 15:42 UTC (permalink / raw)
To: jgarzik; +Cc: linux-ide, linux-scsi, brking
Prepare for future SAS changes where libata will have ata_ports
with no libata owned scsi_host.
Signed-off-by: Brian King <brking@us.ibm.com>
---
drivers/scsi/libata-core.c | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
diff -puN drivers/scsi/libata-core.c~libata_scsi_host_owner drivers/scsi/libata-core.c
--- libata-dev/drivers/scsi/libata-core.c~libata_scsi_host_owner 2006-02-03 12:37:11.000000000 -0600
+++ libata-dev-bjking1/drivers/scsi/libata-core.c 2006-02-03 12:37:11.000000000 -0600
@@ -1208,6 +1208,21 @@ unsigned int ata_pio_need_iordy(const st
return 0;
}
+static void ata_set_cdb_len(struct ata_port *ap, unsigned int cdb_len)
+{
+ ap->cdb_len = cdb_len;
+ if (ap->host)
+ ap->host->max_cmd_len = cdb_len;
+}
+
+static void ata_set_max_sectors(struct ata_port *ap, unsigned int max_sectors)
+{
+ if (ap->host) {
+ ap->host->max_sectors = ATA_MAX_SECTORS;
+ ap->host->hostt->max_sectors = ATA_MAX_SECTORS;
+ }
+}
+
/**
* ata_dev_identify - obtain IDENTIFY x DEVICE page
* @ap: port on which device we wish to probe resides
@@ -1402,7 +1417,7 @@ retry:
}
- ap->host->max_cmd_len = 16;
+ ata_set_cdb_len(ap, 16);
}
/* ATAPI-specific feature tests */
@@ -1415,8 +1430,8 @@ retry:
printk(KERN_WARNING "ata%u: unsupported CDB len\n", ap->id);
goto err_out_nosup;
}
- ap->cdb_len = (unsigned int) rc;
- ap->host->max_cmd_len = (unsigned char) ap->cdb_len;
+
+ ata_set_cdb_len(ap, rc);
/* print device info to dmesg */
printk(KERN_INFO "ata%u: dev %u ATAPI, max %s\n",
@@ -1456,8 +1471,7 @@ void ata_dev_config(struct ata_port *ap,
printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
ap->id, ap->device->devno);
ap->udma_mask &= ATA_UDMA5;
- ap->host->max_sectors = ATA_MAX_SECTORS;
- ap->host->hostt->max_sectors = ATA_MAX_SECTORS;
+ ata_set_max_sectors(ap, ATA_MAX_SECTORS);
ap->device[i].flags |= ATA_DFLAG_LOCK_SECTORS;
}
_
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 04/15] libata: Allow for ata_port without a libata owned scsi_host
2006-02-06 15:42 [patch 04/15] libata: Allow for ata_port without a libata owned scsi_host brking
@ 2006-02-09 7:19 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2006-02-09 7:19 UTC (permalink / raw)
To: brking; +Cc: linux-ide, linux-scsi
brking@us.ibm.com wrote:
> Prepare for future SAS changes where libata will have ata_ports
> with no libata owned scsi_host.
>
> Signed-off-by: Brian King <brking@us.ibm.com>
ACK patches 4-6
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-02-09 7:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-06 15:42 [patch 04/15] libata: Allow for ata_port without a libata owned scsi_host brking
2006-02-09 7:19 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).