]> git.proxmox.com Git - mirror_edk2.git/commit
MdePkg: UefiScsiLib: do not encode LUN in CDB for other SCSI commands
authorLaszlo Ersek <lersek@redhat.com>
Fri, 28 Nov 2014 10:24:56 +0000 (10:24 +0000)
committerlersek <lersek@Edk2>
Fri, 28 Nov 2014 10:24:56 +0000 (10:24 +0000)
commitb04a63ac48a73329006d25e8b7518bc09bb9843c
tree9fbf16f2a1215cab0dfaca0deecf373c44cc045a
parentc128d5281ffb25d8c335a3cce6a9a9497df57059
MdePkg: UefiScsiLib: do not encode LUN in CDB for other SCSI commands

The TEST UNIT READY, INQUIRY, MODE SENSE, REQUEST SENSE and READ CAPACITY
commands define bits [7:5] of Cdb[1] as Reserved (potentially as part of a
larger Reserved bitfield):

  Command             Reserved bitfield in Cdb[1]  SCSI spec reference
  ------------------  ---------------------------  -------------------
  TEST UNIT READY     all bits                     SPC-4 6.37
  INQUIRY             bits [7:2]                   SPC-4 6.4.1
  MODE SENSE (6)      bits [7:4]                   SPC-4 6.11.1
  MODE SENSE (10)     bits [7:5]                   SPC-4 6.12
  REQUEST SENSE       bits [7:1]                   SPC-4 6.29
  READ CAPACITY (10)  bits [7:1]                   SBC-3 5.16
  READ CAPACITY (16)  bits [7:5]                   SBC-3 5.17

Update the UefiScsiLib functions accordingly.

(In ScsiReadCapacity16Command() the LUN has not been encoded, so there we
just remove the useless ScsiIo->GetDeviceLocation() call, with its
auxiliary local variables.)

The EFI_SCSI_TARGET_MAX_BYTES and EFI_SCSI_LOGICAL_UNIT_NUMBER_MASK macros
become unused with this patch, remove them too.

Suggested-by: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16455 6f19259b-4bc3-4df7-8a09-765794883524
MdePkg/Library/UefiScsiLib/UefiScsiLib.c