diff options
author | Matthew R. Ochs <mrochs@linux.vnet.ibm.com> | 2017-06-21 21:16:22 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-06-26 15:01:12 -0400 |
commit | bc88ac47d5cb11c7dd9896781f793fae519d53fa (patch) | |
tree | 0a5955e480acc1eeef0a2388697f77c516695d80 /include/uapi/scsi | |
parent | 9cf43a360450ddd758b0021d1b55f1cc5643b9ed (diff) |
scsi: cxlflash: Support AFU debug
Adopt the SISLite AFU debug capability to allow future CXL Flash
adapters the ability to better debug AFU issues. Update the SISLite
header with the changes necessary to support AFU debug operations
and create a host ioctl interface for user debug software. Also
update the cxlflash documentation to describe this new host ioctl.
Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/uapi/scsi')
-rw-r--r-- | include/uapi/scsi/cxlflash_ioctl.h | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/include/uapi/scsi/cxlflash_ioctl.h b/include/uapi/scsi/cxlflash_ioctl.h index ad79c34f4d11..48d107e75cf2 100644 --- a/include/uapi/scsi/cxlflash_ioctl.h +++ b/include/uapi/scsi/cxlflash_ioctl.h @@ -18,6 +18,11 @@ #include <linux/types.h> /* + * Structure and definitions for all CXL Flash ioctls + */ +#define CXLFLASH_WWID_LEN 16 + +/* * Structure and flag definitions CXL Flash superpipe ioctls */ @@ -151,7 +156,7 @@ struct dk_cxlflash_recover_afu { __u64 reserved[8]; /* Reserved for future use */ }; -#define DK_CXLFLASH_MANAGE_LUN_WWID_LEN 16 +#define DK_CXLFLASH_MANAGE_LUN_WWID_LEN CXLFLASH_WWID_LEN #define DK_CXLFLASH_MANAGE_LUN_ENABLE_SUPERPIPE 0x8000000000000000ULL #define DK_CXLFLASH_MANAGE_LUN_DISABLE_SUPERPIPE 0x4000000000000000ULL #define DK_CXLFLASH_MANAGE_LUN_ALL_PORTS_ACCESSIBLE 0x2000000000000000ULL @@ -209,10 +214,20 @@ struct ht_cxlflash_hdr { __u64 return_flags; /* Returned flags */ }; +/* + * Input flag definitions available to all host ioctls + * + * These are grown from the bottom-up with the intention that ioctl-specific + * input flag definitions would grow from the top-down, allowing the two sets + * to co-exist. While not required/enforced at this time, this provides future + * flexibility. + */ +#define HT_CXLFLASH_HOST_READ 0x0000000000000000ULL +#define HT_CXLFLASH_HOST_WRITE 0x0000000000000001ULL + #define HT_CXLFLASH_LUN_PROVISION_SUBCMD_CREATE_LUN 0x0001 #define HT_CXLFLASH_LUN_PROVISION_SUBCMD_DELETE_LUN 0x0002 #define HT_CXLFLASH_LUN_PROVISION_SUBCMD_QUERY_PORT 0x0003 -#define HT_CXLFLASH_LUN_PROVISION_WWID_LEN 16 struct ht_cxlflash_lun_provision { struct ht_cxlflash_hdr hdr; /* Common fields */ @@ -220,7 +235,7 @@ struct ht_cxlflash_lun_provision { __u16 reserved16[3]; /* Reserved for future use */ __u64 size; /* Size of LUN (4K blocks) */ __u64 lun_id; /* SCSI LUN ID */ - __u8 wwid[HT_CXLFLASH_LUN_PROVISION_WWID_LEN]; /* Page83 WWID, NAA-6 */ + __u8 wwid[CXLFLASH_WWID_LEN];/* Page83 WWID, NAA-6 */ __u64 max_num_luns; /* Maximum number of LUNs provisioned */ __u64 cur_num_luns; /* Current number of LUNs provisioned */ __u64 max_cap_port; /* Total capacity for port (4K blocks) */ @@ -228,8 +243,23 @@ struct ht_cxlflash_lun_provision { __u64 reserved[8]; /* Reserved for future use */ }; +#define HT_CXLFLASH_AFU_DEBUG_MAX_DATA_LEN 262144 /* 256K */ +#define HT_CXLFLASH_AFU_DEBUG_SUBCMD_LEN 12 +struct ht_cxlflash_afu_debug { + struct ht_cxlflash_hdr hdr; /* Common fields */ + __u8 reserved8[4]; /* Reserved for future use */ + __u8 afu_subcmd[HT_CXLFLASH_AFU_DEBUG_SUBCMD_LEN]; /* AFU subcommand, + * (pass through) + */ + __u64 data_ea; /* Data buffer effective address */ + __u32 data_len; /* Data buffer length */ + __u32 reserved32; /* Reserved for future use */ + __u64 reserved[8]; /* Reserved for future use */ +}; + union cxlflash_ht_ioctls { struct ht_cxlflash_lun_provision lun_provision; + struct ht_cxlflash_afu_debug afu_debug; }; #define MAX_HT_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ht_ioctls)) @@ -239,6 +269,7 @@ union cxlflash_ht_ioctls { * region (0xBF) and grow downwards. */ #define HT_CXLFLASH_LUN_PROVISION CXL_IOWR(0xBF, ht_cxlflash_lun_provision) +#define HT_CXLFLASH_AFU_DEBUG CXL_IOWR(0xBE, ht_cxlflash_afu_debug) #endif /* ifndef _CXLFLASH_IOCTL_H */ |