Re: RFC: Transport identifier

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

 



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

[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