]> git.karo-electronics.de Git - linux-beck.git/commit
usb/uas: use scsi_host_find_tag() to find command from a tag
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Mon, 19 Dec 2011 19:22:39 +0000 (20:22 +0100)
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 22 Dec 2011 09:36:19 +0000 (10:36 +0100)
commit22188f4a933c6e86ac67f52028895c795896492e
tree2646ffe21321f1c5798add211a68915214b6b0a3
parentdae51546b6564b06cbae4191d4f2dee7136be3c1
usb/uas: use scsi_host_find_tag() to find command from a tag

In "usb/uas: use unique tags for all LUNs" we make sure to create unique
tags across all LUNs. This patch uses scsi_host_find_tag() to obtain the
correct command which is associated with the tag.
The following changes are required:
- don't use sdev->current_cmnd anymore
  Since we can have devices which don't support command queueing we must
  ensure that we can tell the two commands apart. Even if a device
  supports comand queuing we send the INQUIRY command "untagged" for
  LUN1 while we can send a tagged command to LUN0 at the same time.
  devinfo->cmnd is used for stashing the one "untagged" command.
- tag number is altered. If stream support is used then the tag number
  must match the stream number. Therefore we can't use tag 0 and must
  start at tag 1.
  In case we have untagged commands (at least the first command) we must
  be able to distinguish between command tag 0 (which becomes 1) and
  untagged command (which becomes curently also 1).
  The following tag numbers are used:
  0: never
  1: for untagged commands (devinfo->cmnd)
  2+: tagged commands.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
drivers/usb/storage/uas.c