Re: modalias for scsi devices?

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

 



Michael Tokarev wrote on 2006-10-27:
...
> But at that time, someone replied telling me he's implementing
> this functionality in a more general way.

Could you point to an archive of this discussion?

...
> The modalias format is like this:
> 
>  scsi:type-0x04
...
> o osst.c driver handles tapes too, like st.c, but only SOME tapes.
>   With this setup, hotplug scripts (or whatever is used by the
>   user) will try to load both st and osst modules for all SCSI
>   tapes found, because both modules have scsi:type-0x01 alias).
>   It is not harmful, but one extra module is no good either.
>   It is possible to solve this, by exporting more info in
>   modalias attribute, including vendor and device identification
>   strings, so that modalias becomes something like
>     scsi:type-0x12:vendor-Adaptec LTD:device-OnStream Tape Drive
>   and having that, match for all 3 attributes, not only device
>   type.  But oh well, vendor and device strings may be large,

8 and 16 characters may be somewhat large for modalias strings but I
think this is still OK.

>   and they do contain spaces and whatnot.
...

What about the string format that scsi_scan.c::scsi_add_lun() prints in
Linux 2.6.19?

	sdev_printk(KERN_NOTICE, sdev, "%s %.8s %.16s %.4s PQ: %d "
			"ANSI: %d%s\n", scsi_device_type(sdev->type),
			sdev->vendor, sdev->model, sdev->rev,
			sdev->inq_periph_qual, inq_result[2] & 0x07,
			(inq_result[3] & 0x0f) == 1 ? " CCS" : "");

Of course you could use hexadecimal for the type again and use other
delimiters. But I think the only sane way to parse vendor and model is
to rely on their fixed length, not on some nifty delimiters. I don't
know though if existing userspace helpers are prepared for fixed-length
string elements.

I can't comment on the general idea to switch to modaliases.
-- 
Stefan Richter
-=====-=-==- =-=- =====
http://arcgraph.de/sr/
-
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