Skip to contentSkip to conversation

remove ->emulated from host template

PATCH In review Jeff Garzik 2 participants 2 messages Apr 1, 2004

Subsystems (9)
SCSI USB Block layer MIPS +5 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove ->emulated from host template

I think the comment and usage in drivers/block/scsi_ioctl.c says it all, but just in case...

This ->emulated exists solely to export an unneeded distinction to userspace. As you can see from sg_emulated_host() in scsi_ioctl.c, the value in today's 2.6.x kernels is pretty much completely meaningless.

===== arch/mips/kernel/ioctl32.c 1.17 vs edited =====

arch/mips/kernel/ioctl32.c +0 -1
@@ -1074,7 +1074,6 @@
 /* SG stuff */
 COMPATIBLE_IOCTL(SG_SET_TIMEOUT)
 COMPATIBLE_IOCTL(SG_GET_TIMEOUT)
-COMPATIBLE_IOCTL(SG_EMULATED_HOST)
 COMPATIBLE_IOCTL(SG_SET_TRANSFORM)
 COMPATIBLE_IOCTL(SG_GET_TRANSFORM)
 COMPATIBLE_IOCTL(SG_SET_RESERVED_SIZE)

===== drivers/block/scsi_ioctl.c 1.41 vs edited =====

drivers/block/scsi_ioctl.c +0 -12
@@ -96,15 +96,6 @@
 	return 0;
 }
 
-/*
- * will always return that we are ATAPI even for a real SCSI drive, I'm not
- * so sure this is worth doing anything about (why would you care??)
- */
-static int sg_emulated_host(request_queue_t *q, int *p)
-{
-	return put_user(1, p);
-}
-
 static int sg_io(request_queue_t *q, struct gendisk *bd_disk,
 		 struct sg_io_hdr *hdr)
 {
@@ -344,9 +335,6 @@
 			break;
 		case SG_SET_RESERVED_SIZE:
 			err = sg_set_reserved_size(q, (int *) arg);
-			break;
-		case SG_EMULATED_HOST:
-			err = sg_emulated_host(q, (int *) arg);
 			break;
 		case SG_IO: {
 			struct sg_io_hdr hdr;

===== drivers/scsi/3w-xxxx.c 1.40 vs edited =====

drivers/scsi/3w-xxxx.c +0 -1
@@ -3494,7 +3494,6 @@
 	.max_sectors		= TW_MAX_SECTORS,
 	.cmd_per_lun		= TW_MAX_CMDS_PER_LUN,	
 	.use_clustering		= ENABLE_CLUSTERING,
-	.emulated		= 1
 };
 #include "scsi_module.c"
 

===== drivers/scsi/ata_piix.c 1.12 vs edited =====

drivers/scsi/ata_piix.c +0 -1
@@ -106,7 +106,6 @@
 	.sg_tablesize		= LIBATA_MAX_PRD,
 	.max_sectors		= ATA_MAX_SECTORS,
 	.cmd_per_lun		= ATA_SHT_CMD_PER_LUN,
-	.emulated		= ATA_SHT_EMULATED,
 	.use_clustering		= ATA_SHT_USE_CLUSTERING,
 	.proc_name		= DRV_NAME,
 	.dma_boundary		= ATA_DMA_BOUNDARY,

===== drivers/scsi/ide-scsi.c 1.38 vs edited =====

drivers/scsi/ide-scsi.c +0 -1
@@ -1077,7 +1077,6 @@
 	.cmd_per_lun		= 5,
 	.max_sectors		= 128,
 	.use_clustering		= DISABLE_CLUSTERING,
-	.emulated		= 1,
 	.proc_name		= "ide-scsi",
 };
 

===== drivers/scsi/sata_promise.c 1.29 vs edited =====

drivers/scsi/sata_promise.c +0 -1
@@ -185,7 +185,6 @@
 	.sg_tablesize		= LIBATA_MAX_PRD,
 	.max_sectors		= ATA_MAX_SECTORS,
 	.cmd_per_lun		= ATA_SHT_CMD_PER_LUN,
-	.emulated		= ATA_SHT_EMULATED,
 	.use_clustering		= ATA_SHT_USE_CLUSTERING,
 	.proc_name		= DRV_NAME,
 	.dma_boundary		= ATA_DMA_BOUNDARY,

===== drivers/scsi/sata_sil.c 1.20 vs edited =====

drivers/scsi/sata_sil.c +0 -1
@@ -108,7 +108,6 @@
 	.sg_tablesize		= LIBATA_MAX_PRD,
 	.max_sectors		= ATA_MAX_SECTORS,
 	.cmd_per_lun		= ATA_SHT_CMD_PER_LUN,
-	.emulated		= ATA_SHT_EMULATED,
 	.use_clustering		= ATA_SHT_USE_CLUSTERING,
 	.proc_name		= DRV_NAME,
 	.dma_boundary		= ATA_DMA_BOUNDARY,

===== drivers/scsi/sata_svw.c 1.14 vs edited =====

drivers/scsi/sata_svw.c +0 -1
@@ -207,7 +207,6 @@
 	.sg_tablesize		= LIBATA_MAX_PRD,
 	.max_sectors		= ATA_MAX_SECTORS,
 	.cmd_per_lun		= ATA_SHT_CMD_PER_LUN,
-	.emulated		= ATA_SHT_EMULATED,
 	.use_clustering		= ATA_SHT_USE_CLUSTERING,
 	.proc_name		= DRV_NAME,
 	.dma_boundary		= ATA_DMA_BOUNDARY,

===== drivers/scsi/sata_via.c 1.11 vs edited =====

drivers/scsi/sata_via.c +0 -1
@@ -84,7 +84,6 @@
 	.sg_tablesize		= LIBATA_MAX_PRD,
 	.max_sectors		= ATA_MAX_SECTORS,
 	.cmd_per_lun		= ATA_SHT_CMD_PER_LUN,
-	.emulated		= ATA_SHT_EMULATED,
 	.use_clustering		= ATA_SHT_USE_CLUSTERING,
 	.proc_name		= DRV_NAME,
 	.dma_boundary		= ATA_DMA_BOUNDARY,

===== drivers/scsi/sata_vsc.c 1.6 vs edited =====

drivers/scsi/sata_vsc.c +0 -1
@@ -191,7 +191,6 @@
 	.sg_tablesize		= LIBATA_MAX_PRD,
 	.max_sectors		= ATA_MAX_SECTORS,
 	.cmd_per_lun		= ATA_SHT_CMD_PER_LUN,
-	.emulated		= ATA_SHT_EMULATED,
 	.use_clustering		= ATA_SHT_USE_CLUSTERING,
 	.proc_name		= DRV_NAME,
 	.dma_boundary		= ATA_DMA_BOUNDARY,

===== drivers/scsi/sg.c 1.85 vs edited =====

drivers/scsi/sg.c +2 -7
@@ -952,10 +952,6 @@
 			return (__copy_to_user((void *) arg, rinfo,
 			        SZ_SG_REQ_INFO * SG_MAX_QUEUE) ? -EFAULT : 0);
 		}
-	case SG_EMULATED_HOST:
-		if (sdp->detached)
-			return -ENODEV;
-		return put_user(sdp->device->host->hostt->emulated, (int *) arg);
 	case SG_SCSI_RESET:
 		if (sdp->detached)
 			return -ENODEV;
@@ -3035,11 +3031,10 @@
 				seq_printf(s, "detached pending close ");
 			else
 				seq_printf
-				    (s, "scsi%d chan=%d id=%d lun=%d   em=%d",
+				    (s, "scsi%d chan=%d id=%d lun=%d   em=0",
 				     scsidp->host->host_no,
 				     scsidp->channel, scsidp->id,
-				     scsidp->lun,
-				     scsidp->host->hostt->emulated);
+				     scsidp->lun);
 			seq_printf(s, " sg_tablesize=%d excl=%d\n",
 				   sdp->sg_tablesize, sdp->exclude);
 		}

===== drivers/usb/image/hpusbscsi.c 1.34 vs edited =====

drivers/usb/image/hpusbscsi.c +0 -1
@@ -34,7 +34,6 @@
 	.this_id		= -1,
 	.cmd_per_lun		= 1,
 	.use_clustering		= 1,
-	.emulated		= 1,
 };
 
 static int

===== drivers/usb/image/microtek.c 1.35 vs edited =====

drivers/usb/image/microtek.c +0 -1
@@ -639,7 +639,6 @@
 	.this_id =		-1,
 	.cmd_per_lun =		1,
 	.use_clustering =	1,
-	.emulated =		1,
 };
 
 struct vendor_product

===== drivers/usb/storage/scsiglue.c 1.59 vs edited =====

drivers/usb/storage/scsiglue.c +0 -3
@@ -391,9 +391,6 @@
 	 */
 	.use_clustering =		TRUE,
 
-	/* emulated HBA */
-	.emulated =			TRUE,
-
 	/* sysfs device attributes */
 	.sdev_attrs =			sysfs_device_attr_list,
 

===== include/linux/compat_ioctl.h 1.20 vs edited =====

include/linux/compat_ioctl.h +0 -1
@@ -264,7 +264,6 @@
 /* SG stuff */
 COMPATIBLE_IOCTL(SG_SET_TIMEOUT)
 COMPATIBLE_IOCTL(SG_GET_TIMEOUT)
-COMPATIBLE_IOCTL(SG_EMULATED_HOST)
 ULONG_IOCTL(SG_SET_TRANSFORM)
 COMPATIBLE_IOCTL(SG_GET_TRANSFORM)
 COMPATIBLE_IOCTL(SG_SET_RESERVED_SIZE)

===== include/linux/libata.h 1.15 vs edited =====

include/linux/libata.h +0 -1
@@ -78,7 +78,6 @@
 	ATA_DEF_BUSY_WAIT	= 10000,
 	ATA_SHORT_PAUSE		= (HZ >> 6) + 1,
 
-	ATA_SHT_EMULATED	= 1,
 	ATA_SHT_CMD_PER_LUN	= 1,
 	ATA_SHT_THIS_ID		= -1,
 	ATA_SHT_USE_CLUSTERING	= 0,

===== include/scsi/sg.h 1.12 vs edited =====

include/scsi/sg.h +0 -2
@@ -182,8 +182,6 @@
  [Those that only apply to the SG 2.x drivers are at the end of the file.]
  (_GET_s yield result via 'int *' 3rd argument unless otherwise indicated) */
 
-#define SG_EMULATED_HOST 0x2203 /* true for emulated host adapter (ATAPI) */
-
 /* Used to configure SCSI command transformation layer for ATAPI devices */
 /* Only supported by the ide-scsi driver */
 #define SG_SET_TRANSFORM 0x2204 /* N.B. 3rd arg is not pointer but value: */
#1 lore raw
Quoted 7 lines · Jeff Garzik

I think the comment and usage in drivers/block/scsi_ioctl.c says it all, but just in case...

This ->emulated exists solely to export an unneeded distinction to userspace. As you can see from sg_emulated_host() in scsi_ioctl.c, the value in today's 2.6.x kernels is pretty much completely meaningless.

I agree with this change, but 2.6.x is the wrong place for it. Please resubmit for early 2.7.