Skip to content

Commit

Permalink
lightnvm: expose mccap in identify command
Browse files Browse the repository at this point in the history
The mccap field is required for I/O command option support. It defines the
following flash access modes:

 * SLC mode
 * Erase/Program Suspension
 * Scramble On/Off
 * Encryption

It is slotted in between mpos and cpar, changing the offset for
cpar as well.

Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Matias Bjørling authored and Jens Axboe committed Nov 16, 2015
1 parent 36d5dbc commit 12be5ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/nvme/host/lightnvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ struct nvme_nvm_id_group {
__le32 tbet;
__le32 tbem;
__le32 mpos;
__le32 mccap;
__le16 cpar;
__u8 reserved[910];
__u8 reserved[906];
} __packed;

struct nvme_nvm_addr_format {
Expand Down Expand Up @@ -265,6 +266,7 @@ static int init_grps(struct nvm_id *nvm_id, struct nvme_nvm_id *nvme_nvm_id)
dst->tbet = le32_to_cpu(src->tbet);
dst->tbem = le32_to_cpu(src->tbem);
dst->mpos = le32_to_cpu(src->mpos);
dst->mccap = le32_to_cpu(src->mccap);

dst->cpar = le16_to_cpu(src->cpar);
}
Expand Down
1 change: 1 addition & 0 deletions include/linux/lightnvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct nvm_id_group {
u32 tbet;
u32 tbem;
u32 mpos;
u32 mccap;
u16 cpar;
u8 res[913];
} __packed;
Expand Down

0 comments on commit 12be5ed

Please sign in to comment.