aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorDennis Dalessandro <dennis.dalessandro@intel.com>2016-05-19 08:26:24 -0400
committerDoug Ledford <dledford@redhat.com>2016-05-26 11:35:06 -0400
commit8d970cf991a6c38a5566572979487b906d643740 (patch)
treee538a501c86b9e7803461b3476d6175e01b65692 /include/uapi
parentac56f162d4586885238da05131c4e6bbdb536d4e (diff)
IB/hfi1: Add ioctl() interface for user commands
IOCTL is more suited to what user space commands need to do than the write() interface. Add IOCTL definitions for all existing write commands and the handling for those. The write() interface will be removed in a follow on patch. Reviewed-by: Mitko Haralanov <mitko.haralanov@intel.com> Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/rdma/hfi/hfi1_user.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/uapi/rdma/hfi/hfi1_user.h b/include/uapi/rdma/hfi/hfi1_user.h
index aa48fbe016af..9784159c9d52 100644
--- a/include/uapi/rdma/hfi/hfi1_user.h
+++ b/include/uapi/rdma/hfi/hfi1_user.h
@@ -78,6 +78,11 @@
78#define HFI1_USER_SWMINOR 1 78#define HFI1_USER_SWMINOR 1
79 79
80/* 80/*
81 * We will encode the major/minor inside a single 32bit version number.
82 */
83#define HFI1_SWMAJOR_SHIFT 16
84
85/*
81 * Set of HW and driver capability/feature bits. 86 * Set of HW and driver capability/feature bits.
82 * These bit values are used to configure enabled/disabled HW and 87 * These bit values are used to configure enabled/disabled HW and
83 * driver features. The same set of bits are communicated to user 88 * driver features. The same set of bits are communicated to user
@@ -121,6 +126,46 @@
121#define HFI1_CMD_SET_PKEY 11 /* set context's pkey */ 126#define HFI1_CMD_SET_PKEY 11 /* set context's pkey */
122#define HFI1_CMD_CTXT_RESET 12 /* reset context's HW send context */ 127#define HFI1_CMD_CTXT_RESET 12 /* reset context's HW send context */
123#define HFI1_CMD_TID_INVAL_READ 13 /* read TID cache invalidations */ 128#define HFI1_CMD_TID_INVAL_READ 13 /* read TID cache invalidations */
129#define HFI1_CMD_GET_VERS 14 /* get the version of the user cdev */
130
131/*
132 * User IOCTLs can not go above 128 if they do then see common.h and change the
133 * base for the snoop ioctl
134 */
135#define IB_IOCTL_MAGIC 0x1b /* See Documentation/ioctl/ioctl-number.txt */
136
137/*
138 * Make the ioctls occupy the last 0xf0-0xff portion of the IB range
139 */
140#define __NUM(cmd) (HFI1_CMD_##cmd + 0xe0)
141
142struct hfi1_cmd;
143#define HFI1_IOCTL_ASSIGN_CTXT \
144 _IOWR(IB_IOCTL_MAGIC, __NUM(ASSIGN_CTXT), struct hfi1_user_info)
145#define HFI1_IOCTL_CTXT_INFO \
146 _IOW(IB_IOCTL_MAGIC, __NUM(CTXT_INFO), struct hfi1_ctxt_info)
147#define HFI1_IOCTL_USER_INFO \
148 _IOW(IB_IOCTL_MAGIC, __NUM(USER_INFO), struct hfi1_base_info)
149#define HFI1_IOCTL_TID_UPDATE \
150 _IOWR(IB_IOCTL_MAGIC, __NUM(TID_UPDATE), struct hfi1_tid_info)
151#define HFI1_IOCTL_TID_FREE \
152 _IOWR(IB_IOCTL_MAGIC, __NUM(TID_FREE), struct hfi1_tid_info)
153#define HFI1_IOCTL_CREDIT_UPD \
154 _IO(IB_IOCTL_MAGIC, __NUM(CREDIT_UPD))
155#define HFI1_IOCTL_RECV_CTRL \
156 _IOW(IB_IOCTL_MAGIC, __NUM(RECV_CTRL), int)
157#define HFI1_IOCTL_POLL_TYPE \
158 _IOW(IB_IOCTL_MAGIC, __NUM(POLL_TYPE), int)
159#define HFI1_IOCTL_ACK_EVENT \
160 _IOW(IB_IOCTL_MAGIC, __NUM(ACK_EVENT), unsigned long)
161#define HFI1_IOCTL_SET_PKEY \
162 _IOW(IB_IOCTL_MAGIC, __NUM(SET_PKEY), __u16)
163#define HFI1_IOCTL_CTXT_RESET \
164 _IO(IB_IOCTL_MAGIC, __NUM(CTXT_RESET))
165#define HFI1_IOCTL_TID_INVAL_READ \
166 _IOWR(IB_IOCTL_MAGIC, __NUM(TID_INVAL_READ), struct hfi1_tid_info)
167#define HFI1_IOCTL_GET_VERS \
168 _IOR(IB_IOCTL_MAGIC, __NUM(GET_VERS), int)
124 169
125#define _HFI1_EVENT_FROZEN_BIT 0 170#define _HFI1_EVENT_FROZEN_BIT 0
126#define _HFI1_EVENT_LINKDOWN_BIT 1 171#define _HFI1_EVENT_LINKDOWN_BIT 1