[PATCH 2/2] libata: Use scsi_device max_cmd_len

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use the newly added max_cmd_len in the scsi_device
struct instead of the field by the same name in
the scsi_host struct. This allows for better
granularity of control of the max allowed command
length and simplifies supporting libata controlled
SATA devices attached to SAS HBAs.

Signed-off-by: Brian King <brking@xxxxxxxxxx>
---

 libata-dev-bjking1/drivers/scsi/libata-core.c |   10 ++--------
 libata-dev-bjking1/drivers/scsi/libata-scsi.c |    1 +
 2 files changed, 3 insertions(+), 8 deletions(-)

diff -puN drivers/scsi/libata-core.c~libata_sd_cdb_len drivers/scsi/libata-core.c
--- libata-dev/drivers/scsi/libata-core.c~libata_sd_cdb_len	2006-03-28 16:09:14.000000000 -0600
+++ libata-dev-bjking1/drivers/scsi/libata-core.c	2006-03-28 16:09:14.000000000 -0600
@@ -1208,7 +1208,7 @@ static int ata_dev_configure(struct ata_
 {
 	const u16 *id = dev->id;
 	unsigned int xfer_mask;
-	int i, rc;
+	int rc;
 
 	if (!ata_dev_present(dev)) {
 		DPRINTK("ENTER/EXIT (host %u, dev %u) -- nodev\n",
@@ -1311,12 +1311,6 @@ static int ata_dev_configure(struct ata_
 			       ap->id, dev->devno, ata_mode_string(xfer_mask));
 	}
 
-	ap->host->max_cmd_len = 0;
-	for (i = 0; i < ATA_MAX_DEVICES; i++)
-		ap->host->max_cmd_len = max_t(unsigned int,
-					      ap->host->max_cmd_len,
-					      ap->device[i].cdb_len);
-
 	/* limit bridge transfers to udma5, 200 sectors */
 	if (ata_dev_knobble(ap, dev)) {
 		if (print_info)
@@ -4396,7 +4390,7 @@ static void ata_host_init(struct ata_por
 	host->max_lun = 1;
 	host->max_channel = 1;
 	host->unique_id = ata_unique_id++;
-	host->max_cmd_len = 12;
+	host->max_cmd_len = ATAPI_CDB_LEN;
 
 	ap->flags = ATA_FLAG_PORT_DISABLED;
 	ap->id = host->unique_id;
diff -puN drivers/scsi/libata-scsi.c~libata_sd_cdb_len drivers/scsi/libata-scsi.c
--- libata-dev/drivers/scsi/libata-scsi.c~libata_sd_cdb_len	2006-03-28 16:09:14.000000000 -0600
+++ libata-dev-bjking1/drivers/scsi/libata-scsi.c	2006-03-28 16:09:14.000000000 -0600
@@ -680,6 +680,7 @@ static void ata_scsi_dev_config(struct s
 		max_sectors = dev->max_sectors;
 
 	blk_queue_max_sectors(sdev->request_queue, max_sectors);
+	sdev->max_cmd_len = dev->cdb_len;
 
 	/*
 	 * SATA DMA transfers must be multiples of 4 byte, so
_
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux