Skip to content

Commit

Permalink
block: sed-opal: Introduce SUM_SET_LIST parameter and append it using…
Browse files Browse the repository at this point in the history
… 'add_token_u64'

In function 'activate_lsp', rather than hard-coding the short atom
header(0x83), we need to let the function 'add_short_atom_header' append
the header based on the parameter being appended.

The parameter has been defined in Section 3.1.2.1 of
https://trustedcomputinggroup.org/wp-content/uploads/TCG_Storage-Opal_Feature_Set_Single_User_Mode_v1-00_r1-00-Final.pdf

Reviewed-by: Jon Derrick <[email protected]>
Signed-off-by: Revanth Rajashekar <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
RevanthRajashekar authored and axboe committed Nov 18, 2019
1 parent 496074f commit c6da429
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions block/opal_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ enum opal_lockingstate {
OPAL_LOCKING_LOCKED = 0x03,
};

enum opal_parameter {
OPAL_SUM_SET_LIST = 0x060000,
};

/* Packets derived from:
* TCG_Storage_Architecture_Core_Spec_v2.01_r1.00
* Secion: 3.2.3 ComPackets, Packets & Subpackets
Expand Down
6 changes: 1 addition & 5 deletions block/sed-opal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,6 @@ static int activate_lsp(struct opal_dev *dev, void *data)
{
struct opal_lr_act *opal_act = data;
u8 user_lr[OPAL_UID_LENGTH];
u8 uint_3 = 0x83;
int err, i;

err = cmd_start(dev, opaluid[OPAL_LOCKINGSP_UID],
Expand All @@ -1899,10 +1898,7 @@ static int activate_lsp(struct opal_dev *dev, void *data)
return err;

add_token_u8(&err, dev, OPAL_STARTNAME);
add_token_u8(&err, dev, uint_3);
add_token_u8(&err, dev, 6);
add_token_u8(&err, dev, 0);
add_token_u8(&err, dev, 0);
add_token_u64(&err, dev, OPAL_SUM_SET_LIST);

add_token_u8(&err, dev, OPAL_STARTLIST);
add_token_bytestring(&err, dev, user_lr, OPAL_UID_LENGTH);
Expand Down

0 comments on commit c6da429

Please sign in to comment.