Author Topic: Command Block Tag (dCBWTag)  (Read 14196 times)

Nik

  • Member
  • ***
  • Posts: 40
Command Block Tag (dCBWTag)
« on: January 23, 2014, 11:33:11 am »
Hello all,

I am writing a USB Host MSD stack and has to implement the Bulk-Only-Transport protocol.

I am confused about the Command Block Tag (dCBWTag) value assignment. What should be the standard to be followed ?
Do I need to assign different value to every single packet ?

Regards,
Nik

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Command Block Tag (dCBWTag)
« Reply #1 on: January 23, 2014, 12:43:33 pm »
Yes, it's how the host matches a CBW with the CSW the device sends in response.

Nik

  • Member
  • ***
  • Posts: 40
Re: Command Block Tag (dCBWTag)
« Reply #2 on: January 23, 2014, 01:05:52 pm »
Thank you so much for the response Jan.

Just to be clear, here is what I understood :
CBW no.1 - dCBWTag1
CBW no.2 - dCBWTag2
CBW no.3 - dCBWTag3
.                .
.                .
.                .
CBW no.N -  dCBWTagN

Is that correct ? Then how shall I select the value of the tag ?


Appreciate your time.

Regards,
Nik

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Command Block Tag (dCBWTag)
« Reply #3 on: January 23, 2014, 01:44:03 pm »
I think the values can be anything as long as they're unique. Once a value is no longer in use, you should be able to reuse it.

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: Command Block Tag (dCBWTag)
« Reply #4 on: January 23, 2014, 02:05:51 pm »
It can be anything.

It doesn't even have to be unique, though it makes more sense if its unique. Just counting works perfectly well for several implimentations.

Nik

  • Member
  • ***
  • Posts: 40
Re: Command Block Tag (dCBWTag)
« Reply #5 on: January 23, 2014, 02:32:47 pm »
Thank you Jan, Barry !

I will get back to you with the implementation results.


Regards,
Nik

tsybezoff

  • Member
  • ***
  • Posts: 10
Re: Command Block Tag (dCBWTag)
« Reply #6 on: January 29, 2014, 02:44:06 am »
you can use that

#define TAG_REQ_SENSE                       0x41444903
#define TAG_READ10                             0x41444928
#define TAG_WRITE10                           0x4144492A
#define TAG_INQUIRY                            0x41444912
#define TAG_TEST_UNIT_READY              0x41444900
#define TAG_READ_FORMAT_CAPACITIES  0x41444923
#define TAG_READ_CAPACITY                  0x41444925
#define TAG_MODE_SENSE6                     0x4144491A
#define TAG_START_STOP                       0x4144491B
#define TAG_MEDIUM_REMOVAL          0x4144491E

Nik

  • Member
  • ***
  • Posts: 40
Re: Command Block Tag (dCBWTag)
« Reply #7 on: January 29, 2014, 10:45:01 am »
Thanks tsybezoff !