Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


SCSI ReadCapacity16 is failing in windows driver for BOT mode with CheckCondition and Invalid Opcode

vkonintivkoninti Member Posts: 3

I have two USB drives.

1. Drive_1 - It supports USB SCSI protocol in BOT mode only. I see below observations for SCSI ReadCapacity16 command execution in Drive_1.
a. USB SCSI ReadCapacity16 command works properly in windows driver for BOT mode. The command request and response are captured in Wireshark traces.
b. USB SCSI ReadCapacity16 command works properly with inhouse developed driver for BOT mode. The command request and response are captured in Wireshark traces.

2. Drive_2 - It supports USB SCSI protocol in both BOT and UAS mode. I see below observations for SCSI ReadCapacity16 command execution in Drive_2.
a. USB SCSI ReadCapacity16 command is failing in windows driver for BOT mode with CheckCondition and Invalid Opcode error. Here I notice that the command request is not captured in Wireshark or Lecroy tools.
b. USB SCSI ReadCapacity16 command works properly with inhouse developed driver for BOT mode. The command request and response are captured in Wireshark traces.
c. USB SCSI ReadCapacity16 command works fine in windows driver for UAS mode. The command request and response are captured in Wireshark traces.
d. USB SCSI ReadCapacity16 command works properly with inhouse developed driver for UAS mode. The command request and response are captured in Wireshark traces.

CDB details:
cdbLength = 16
serviceAction = 0x10
allocationLength = 32

  cdb[0] = 0x9E //Opcode
  cdb[1] = serviceAction
  cdb[2] = 0
  cdb[3] = 0
  cdb[4] = 0
  cdb[5] = 0
  cdb[6] = 0
  cdb[7] = 0
  cdb[8] = 0
  cdb[9] = 0
  cdb[10] = (allocationLength >> 24) & 0xFF
  cdb[11] = (allocationLength >> 16) & 0xFF
  cdb[12] = (allocationLength >> 8) & 0xFF
  cdb[13] = (allocationLength & 0xFF)
  cdb[14] = 0
  cdb[15] = 0

  cdb = [0x9E 0x10 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x20 0x00 0x00]

Error raised for ReadCapacity16 command:
Sense Key Desc : Illegal Request (0x05)
Additional Error Desc : INVALID COMMAND OPERATION CODE
Additional Sense Code & Qualifier: 0x20 & 0x00

Sense Buffer : 

[ 0x70 0x00 0x05 0x00 0x00 0x00 0x00 0x0a ]
[ 0x00 0x00 0x00 0x00 0x20 0x00 0x00 0x00 ]
[ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ]
[ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ]

I see that firmware supports ReadCapacity16 command and hence 2.b, 2.c and 2.d steps are successful above.

Any help would be appreciated to debug the failure in For 2.a step above for Drive_2 with windows driver.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 26 Feb - 1 Mar 2024 Live, Online