 /* * SATA DMA transfers must be multiples of 4 byte, so * we need to pad ATAPI transfers using an extra sg. * Decrement max hw segments accordingly. */ if (dev->class == ATA_DEV_ATAPI) { request_queue_t *q = sdev->request_queue; blk_queue_max_hw_segments(q, q->max_hw_segments - 1); } 
int ata_scsi_slave_config(struct scsi_device *sdev){	sdev->use_10_for_rw = 1;	sdev->use_10_for_ms = 1;	blk_queue_max_phys_segments(sdev->request_queue, LIBATA_MAX_PRD);	if (sdev->id < ATA_MAX_DEVICES) {		struct ata_port *ap;		struct ata_device *dev;		ap = (struct ata_port *) &sdev->host->hostdata[0];		dev = &ap->device[sdev->id];		/* TODO: 1024 is an arbitrary number, not the		 * hardware maximum.  This should be increased to		 * 65534 when Jens Axboe's patch for dynamically		 * determining max_sectors is merged.		 */		if ((dev->flags & ATA_DFLAG_LBA48) &&		    ((dev->flags & ATA_DFLAG_LOCK_SECTORS) == 0)) {			/*			 * do not overwrite sdev->host->max_sectors, since			 * other drives on this host may not support LBA48			 */			blk_queue_max_sectors(sdev->request_queue, 2048);		}	}	return 0;	/* scsi layer doesn't check return value, sigh */}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/cedc9a478d8c6265879dc3839ef3d4849a709184/libata-scsi.c/buggy/drivers/scsi/libata-scsi.c