On Thu, Feb 26, 2009 at 15:31, Martin K. Petersen <martin.petersen@xxxxxxxxxx> wrote: > > There are a few cases where it would be useful to know which transport > is associated with a scsi_device. For instance when determining whether > to send a READ CAPACITY(16) to a device or not: > > static int sd_try_rc16_first(struct scsi_device *sdp) > { > if (scsi_device_transport(sdp) == SCSI_TRANSPORT_USB) > return 0; /* Run screaming for the hills */ > [...] > > This patch implements support for a transport identifier in the > scsi_host. The id defaults to SPI and it is explicitly overridden in > the host templates for FC, SAS, USB, etc. drivers. > > It also looks like the availability of this transport id could improve > the sysfs parsing in lsscsi. > > Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> [snip] > +/* These strings must match the scsi_transport_id enum in scsi.h */ > +static const char * const transport_names[] = { > + "spi", "fc", "sas", "iscsi", "sbp", "usb", "ata", > +}; Firstly, this should probably mark which name is for which value. (I know it's obvious, but it could get confusing if there are ever user friendly names here.) [snip] > +enum scsi_transport_id { > + SCSI_TRANSPORT_SPI, > + SCSI_TRANSPORT_FC, > + SCSI_TRANSPORT_SAS, > + SCSI_TRANSPORT_ISCSI, > + SCSI_TRANSPORT_SBP, > + SCSI_TRANSPORT_USB, > + SCSI_TRANSPORT_ATA, > +}; Should there be a comment here pointing out that the names must also be updated if new items are added? Thanks, -- Julian Calaby Email: julian.calaby@xxxxxxxxx .Plan: http://sites.google.com/site/juliancalaby/ -- To unsubscribe from this list: 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