scsi: cxlflash: Introduce host ioctl support

As staging for supporting various host management functions, add a host
ioctl infrastructure to filter ioctl commands and perform operations that
are common for all host ioctls. Also update the cxlflash documentation to
create a new section for documenting host ioctls.

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>
This commit is contained in:
Matthew R. Ochs
2017-06-21 21:15:42 -05:00
committed by Martin K. Petersen
parent cf24302790
commit d6e32f530d
4 changed files with 168 additions and 5 deletions

View File

@@ -31,7 +31,7 @@ struct dk_cxlflash_hdr {
};
/*
* Return flag definitions available to all ioctls
* Return flag definitions available to all superpipe ioctls
*
* Similar to the input flags, these are grown from the bottom-up with the
* intention that ioctl-specific return flag definitions would grow from the
@@ -180,6 +180,10 @@ union cxlflash_ioctls {
#define CXL_MAGIC 0xCA
#define CXL_IOWR(_n, _s) _IOWR(CXL_MAGIC, _n, struct _s)
/*
* CXL Flash superpipe ioctls start at base of the reserved CXL_MAGIC
* region (0x80) and grow upwards.
*/
#define DK_CXLFLASH_ATTACH CXL_IOWR(0x80, dk_cxlflash_attach)
#define DK_CXLFLASH_USER_DIRECT CXL_IOWR(0x81, dk_cxlflash_udirect)
#define DK_CXLFLASH_RELEASE CXL_IOWR(0x82, dk_cxlflash_release)
@@ -191,4 +195,29 @@ union cxlflash_ioctls {
#define DK_CXLFLASH_VLUN_RESIZE CXL_IOWR(0x88, dk_cxlflash_resize)
#define DK_CXLFLASH_VLUN_CLONE CXL_IOWR(0x89, dk_cxlflash_clone)
/*
* Structure and flag definitions CXL Flash host ioctls
*/
#define HT_CXLFLASH_VERSION_0 0
struct ht_cxlflash_hdr {
__u16 version; /* Version data */
__u16 subcmd; /* Sub-command */
__u16 rsvd[2]; /* Reserved for future use */
__u64 flags; /* Input flags */
__u64 return_flags; /* Returned flags */
};
union cxlflash_ht_ioctls {
};
#define MAX_HT_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ht_ioctls))
/*
* CXL Flash host ioctls start at the top of the reserved CXL_MAGIC
* region (0xBF) and grow downwards.
*/
#endif /* ifndef _CXLFLASH_IOCTL_H */