Commit e9da4d7f731dafc2b93ce7b31aa09c4d935ef978

Authored by Boaz Harrosh
Committed by James Bottomley
1 parent f8d3a644be

[SCSI] libosd: OSD2r05: on-the-wire changes for latest OSD2 revision 5.

OSC's OSD2 target: [git clone git://git.open-osd.org/osc-osd/ master]
(Initiator code prior to this patch must use: "git checkout CDB_VER_OSD2r01"
 in the target tree above)

This is a summery of the wire changes:

 * OSDv2_ADDITIONAL_CDB_LENGTH == 192 => 228 (Total CDB is now 236 bytes)
 * Attributes List Element Header grew, so attribute values are 8 bytes
   aligned.
 * Cryptographic keys and signatures are 20 => 32
 * Few new definitions.

(Still missing new standard definitions attribute values, these do not change
 wire format and will be added later when needed)

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

Showing 2 changed files with 19 additions and 11 deletions Side-by-side Diff

drivers/scsi/osd/osd_initiator.c
... ... @@ -263,7 +263,12 @@
263 263 oa->attr_page = be32_to_cpu(attr->attr_page);
264 264 oa->attr_id = be32_to_cpu(attr->attr_id);
265 265  
266   - oa->val_ptr = attr->attr_val;
  266 + /* OSD2: For convenience, on empty attributes, we return 8 bytes
  267 + * of zeros here. This keeps the same behaviour with OSD2r04,
  268 + * and is nice with null terminating ASCII fields.
  269 + * oa->val_ptr == NULL marks the end-of-list, or error.
  270 + */
  271 + oa->val_ptr = likely(oa->len) ? attr->attr_val : attr->reserved;
267 272 }
268 273 return inc;
269 274 }
include/scsi/osd_protocol.h
... ... @@ -24,18 +24,17 @@
24 24 OSDv1_ADDITIONAL_CDB_LENGTH = 192,
25 25 OSDv1_TOTAL_CDB_LEN = OSDv1_ADDITIONAL_CDB_LENGTH + 8,
26 26 OSDv1_CAP_LEN = 80,
  27 +
27 28 /* Latest supported version */
28   -/* OSD_ADDITIONAL_CDB_LENGTH = 216,*/
  29 + OSDv2_ADDITIONAL_CDB_LENGTH = 228,
29 30 OSD_ADDITIONAL_CDB_LENGTH =
30   - OSDv1_ADDITIONAL_CDB_LENGTH, /* FIXME: Pete rev-001 sup */
  31 + OSDv2_ADDITIONAL_CDB_LENGTH,
31 32 OSD_TOTAL_CDB_LEN = OSD_ADDITIONAL_CDB_LENGTH + 8,
32   -/* OSD_CAP_LEN = 104,*/
33   - OSD_CAP_LEN = OSDv1_CAP_LEN,/* FIXME: Pete rev-001 sup */
  33 + OSD_CAP_LEN = 104,
34 34  
35 35 OSD_SYSTEMID_LEN = 20,
36 36 OSDv1_CRYPTO_KEYID_SIZE = 20,
37   - /*FIXME: OSDv2_CRYPTO_KEYID_SIZE = 32,*/
38   - OSDv2_CRYPTO_KEYID_SIZE = 20,
  37 + OSDv2_CRYPTO_KEYID_SIZE = 32,
39 38 OSD_CRYPTO_KEYID_SIZE = OSDv2_CRYPTO_KEYID_SIZE,
40 39 OSD_CRYPTO_SEED_SIZE = 4,
41 40 OSD_CRYPTO_NONCE_SIZE = 12,
... ... @@ -166,7 +165,11 @@
166 165 /* called allocation_length in some commands */
167 166 /*32*/ __be64 length;
168 167 /*40*/ __be64 start_address;
169   -/*48*/ __be32 list_identifier;/* Rarely used */
  168 + union {
  169 +/*48*/ __be32 list_identifier;/* Rarely used */
  170 + /* OSD2r05 5.2.5 CDB continuation length */
  171 +/*48*/ __be32 cdb_continuation_length;
  172 + };
170 173 } __packed v2;
171 174 };
172 175 /*52*/ union { /* selected attributes mode Page/List/Single */
... ... @@ -331,6 +334,7 @@
331 334 struct osdv2_attributes_list_element {
332 335 __be32 attr_page;
333 336 __be32 attr_id;
  337 + u8 reserved[6];
334 338 __be16 attr_bytes; /* valid bytes at attr_val without padding */
335 339 u8 attr_val[0];
336 340 } __packed;
... ... @@ -520,7 +524,7 @@
520 524  
521 525 OSD_SEC_CAP_NONE1 = BIT(8),
522 526 OSD_SEC_CAP_NONE2 = BIT(9),
523   - OSD_SEC_CAP_NONE3 = BIT(10),
  527 + OSD_SEC_GBL_REM = BIT(10), /*v2 only*/
524 528 OSD_SEC_CAP_QUERY = BIT(11), /*v2 only*/
525 529 OSD_SEC_CAP_M_OBJECT = BIT(12), /*v2 only*/
526 530 OSD_SEC_CAP_POL_SEC = BIT(13),
... ... @@ -595,8 +599,7 @@
595 599  
596 600 struct osd_capability {
597 601 struct osd_capability_head h;
598   -/* struct osd_cap_object_descriptor od;*/
599   - struct osdv1_cap_object_descriptor od; /* FIXME: Pete rev-001 sup */
  602 + struct osd_cap_object_descriptor od;
600 603 } __packed;
601 604  
602 605 /**