aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-24 13:22:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-24 13:22:09 -0400
commitc6668726d2c2c581e6c417448c472c994d026f5f (patch)
treeccbc5a73b9dfe09a065cb5d8627aa2297e730ec0 /include/uapi/linux
parent06b45f2aa703837163496f5db6a53575665cc6b4 (diff)
parent68d4cef3bab3fb9bb0dbac690ba35a96cb5a16d9 (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Pull SCSI target updates from Nicholas Bellinger: "Lots of activity in target land the last months. The highlights include: - Convert fabric drivers tree-wide to target_register_template() (hch + bart) - iser-target hardening fixes + v1.0 improvements (sagi) - Convert iscsi_thread_set usage to kthread.h + kill iscsi_target_tq.c (sagi + nab) - Add support for T10-PI WRITE_STRIP + READ_INSERT operation (mkp + sagi + nab) - DIF fixes for CONFIG_DEBUG_SG=y + UNMAP file emulation (akinobu + sagi + mkp) - Extended TCMU ABI v2 for future BIDI + DIF support (andy + ilias) - Fix COMPARE_AND_WRITE handling for NO_ALLLOC drivers (hch + nab) Thanks to everyone who contributed this round with new features, bug-reports, fixes, cleanups and improvements. Looking forward, it's currently shaping up to be a busy v4.2 as well" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (69 commits) target: Put TCMU under a new config option target: Version 2 of TCMU ABI target: fix tcm_mod_builder.py target/file: Fix UNMAP with DIF protection support target/file: Fix SG table for prot_buf initialization target/file: Fix BUG() when CONFIG_DEBUG_SG=y and DIF protection enabled target: Make core_tmr_abort_task() skip TMFs target/sbc: Update sbc_dif_generate pr_debug output target/sbc: Make internal DIF emulation honor ->prot_checks target/sbc: Return INVALID_CDB_FIELD if DIF + sess_prot_type disabled target: Ensure sess_prot_type is saved across session restart target/rd: Don't pass incomplete scatterlist entries to sbc_dif_verify_* target: Remove the unused flag SCF_ACK_KREF target: Fix two sparse warnings target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling target: simplify the target template registration API target: simplify target_xcopy_init_pt_lun target: remove the unused SCF_CMD_XCOPY_PASSTHROUGH flag target/rd: reduce code duplication in rd_execute_rw() tcm_loop: fixup tpgt string to integer conversion ...
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/target_core_user.h44
1 files changed, 27 insertions, 17 deletions
diff --git a/include/uapi/linux/target_core_user.h b/include/uapi/linux/target_core_user.h
index b483d1909d3e..b67f99d3c520 100644
--- a/include/uapi/linux/target_core_user.h
+++ b/include/uapi/linux/target_core_user.h
@@ -6,7 +6,7 @@
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/uio.h> 7#include <linux/uio.h>
8 8
9#define TCMU_VERSION "1.0" 9#define TCMU_VERSION "2.0"
10 10
11/* 11/*
12 * Ring Design 12 * Ring Design
@@ -39,9 +39,13 @@
39 * should process the next packet the same way, and so on. 39 * should process the next packet the same way, and so on.
40 */ 40 */
41 41
42#define TCMU_MAILBOX_VERSION 1 42#define TCMU_MAILBOX_VERSION 2
43#define ALIGN_SIZE 64 /* Should be enough for most CPUs */ 43#define ALIGN_SIZE 64 /* Should be enough for most CPUs */
44 44
45/* See https://gcc.gnu.org/onlinedocs/cpp/Stringification.html */
46#define xstr(s) str(s)
47#define str(s) #s
48
45struct tcmu_mailbox { 49struct tcmu_mailbox {
46 __u16 version; 50 __u16 version;
47 __u16 flags; 51 __u16 flags;
@@ -64,31 +68,36 @@ enum tcmu_opcode {
64 * Only a few opcodes, and length is 8-byte aligned, so use low bits for opcode. 68 * Only a few opcodes, and length is 8-byte aligned, so use low bits for opcode.
65 */ 69 */
66struct tcmu_cmd_entry_hdr { 70struct tcmu_cmd_entry_hdr {
67 __u32 len_op; 71 __u32 len_op;
72 __u16 cmd_id;
73 __u8 kflags;
74#define TCMU_UFLAG_UNKNOWN_OP 0x1
75 __u8 uflags;
76
68} __packed; 77} __packed;
69 78
70#define TCMU_OP_MASK 0x7 79#define TCMU_OP_MASK 0x7
71 80
72static inline enum tcmu_opcode tcmu_hdr_get_op(struct tcmu_cmd_entry_hdr *hdr) 81static inline enum tcmu_opcode tcmu_hdr_get_op(__u32 len_op)
73{ 82{
74 return hdr->len_op & TCMU_OP_MASK; 83 return len_op & TCMU_OP_MASK;
75} 84}
76 85
77static inline void tcmu_hdr_set_op(struct tcmu_cmd_entry_hdr *hdr, enum tcmu_opcode op) 86static inline void tcmu_hdr_set_op(__u32 *len_op, enum tcmu_opcode op)
78{ 87{
79 hdr->len_op &= ~TCMU_OP_MASK; 88 *len_op &= ~TCMU_OP_MASK;
80 hdr->len_op |= (op & TCMU_OP_MASK); 89 *len_op |= (op & TCMU_OP_MASK);
81} 90}
82 91
83static inline __u32 tcmu_hdr_get_len(struct tcmu_cmd_entry_hdr *hdr) 92static inline __u32 tcmu_hdr_get_len(__u32 len_op)
84{ 93{
85 return hdr->len_op & ~TCMU_OP_MASK; 94 return len_op & ~TCMU_OP_MASK;
86} 95}
87 96
88static inline void tcmu_hdr_set_len(struct tcmu_cmd_entry_hdr *hdr, __u32 len) 97static inline void tcmu_hdr_set_len(__u32 *len_op, __u32 len)
89{ 98{
90 hdr->len_op &= TCMU_OP_MASK; 99 *len_op &= TCMU_OP_MASK;
91 hdr->len_op |= len; 100 *len_op |= len;
92} 101}
93 102
94/* Currently the same as SCSI_SENSE_BUFFERSIZE */ 103/* Currently the same as SCSI_SENSE_BUFFERSIZE */
@@ -97,13 +106,14 @@ static inline void tcmu_hdr_set_len(struct tcmu_cmd_entry_hdr *hdr, __u32 len)
97struct tcmu_cmd_entry { 106struct tcmu_cmd_entry {
98 struct tcmu_cmd_entry_hdr hdr; 107 struct tcmu_cmd_entry_hdr hdr;
99 108
100 uint16_t cmd_id;
101 uint16_t __pad1;
102
103 union { 109 union {
104 struct { 110 struct {
111 uint32_t iov_cnt;
112 uint32_t iov_bidi_cnt;
113 uint32_t iov_dif_cnt;
105 uint64_t cdb_off; 114 uint64_t cdb_off;
106 uint64_t iov_cnt; 115 uint64_t __pad1;
116 uint64_t __pad2;
107 struct iovec iov[0]; 117 struct iovec iov[0];
108 } req; 118 } req;
109 struct { 119 struct {