On Mon, 6 Oct 2014 15:26:41 -0400 (EDT)
Alan Stern <[email protected]> wrote:
> On Mon, 6 Oct 2014, Mark Knibbs wrote:
>
> > The max_lun field in the scsi_host/us_data structure is the maximum
> > possible LUN value *plus 1*.
>
> You are confusing two different fields. The max_lun field in scsi_host
> is different from the max_lun field in us_data.
>
> The field in us_data is the maximum possible LUN value, _not_ plus 1.
> See this code in usb_stor_control_thread():
>
> else if (us->srb->device->lun > us->max_lun) {
> usb_stor_dbg(us, "Bad LUN (%d:%llu)\n",
> us->srb->device->id,
> us->srb->device->lun);
> us->srb->result = DID_BAD_TARGET << 16;
> }
>
> > It's initially set to 8 by scsi_host_alloc()
> > which is called by usb_stor_probe1().
>
> scsi_host_alloc() doesn't touch anything in the us_data structure.
Whoops, thanks very much for clearing that up. I got confused with the
identical member names. (While looking into why multiple LUNs don't work
with SCM USB-SCSI converters; I hope to post a patch for that shortly.)
Mark
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html