hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/include/uapi/linux/fpga-dfl.h
....@@ -151,6 +151,65 @@
151151
152152 #define DFL_FPGA_PORT_DMA_UNMAP _IO(DFL_FPGA_MAGIC, DFL_PORT_BASE + 4)
153153
154
+/**
155
+ * struct dfl_fpga_irq_set - the argument for DFL_FPGA_XXX_SET_IRQ ioctl.
156
+ *
157
+ * @start: Index of the first irq.
158
+ * @count: The number of eventfd handler.
159
+ * @evtfds: Eventfd handlers.
160
+ */
161
+struct dfl_fpga_irq_set {
162
+ __u32 start;
163
+ __u32 count;
164
+ __s32 evtfds[];
165
+};
166
+
167
+/**
168
+ * DFL_FPGA_PORT_ERR_GET_IRQ_NUM - _IOR(DFL_FPGA_MAGIC, DFL_PORT_BASE + 5,
169
+ * __u32 num_irqs)
170
+ *
171
+ * Get the number of irqs supported by the fpga port error reporting private
172
+ * feature. Currently hardware supports up to 1 irq.
173
+ * Return: 0 on success, -errno on failure.
174
+ */
175
+#define DFL_FPGA_PORT_ERR_GET_IRQ_NUM _IOR(DFL_FPGA_MAGIC, \
176
+ DFL_PORT_BASE + 5, __u32)
177
+
178
+/**
179
+ * DFL_FPGA_PORT_ERR_SET_IRQ - _IOW(DFL_FPGA_MAGIC, DFL_PORT_BASE + 6,
180
+ * struct dfl_fpga_irq_set)
181
+ *
182
+ * Set fpga port error reporting interrupt trigger if evtfds[n] is valid.
183
+ * Unset related interrupt trigger if evtfds[n] is a negative value.
184
+ * Return: 0 on success, -errno on failure.
185
+ */
186
+#define DFL_FPGA_PORT_ERR_SET_IRQ _IOW(DFL_FPGA_MAGIC, \
187
+ DFL_PORT_BASE + 6, \
188
+ struct dfl_fpga_irq_set)
189
+
190
+/**
191
+ * DFL_FPGA_PORT_UINT_GET_IRQ_NUM - _IOR(DFL_FPGA_MAGIC, DFL_PORT_BASE + 7,
192
+ * __u32 num_irqs)
193
+ *
194
+ * Get the number of irqs supported by the fpga AFU interrupt private
195
+ * feature.
196
+ * Return: 0 on success, -errno on failure.
197
+ */
198
+#define DFL_FPGA_PORT_UINT_GET_IRQ_NUM _IOR(DFL_FPGA_MAGIC, \
199
+ DFL_PORT_BASE + 7, __u32)
200
+
201
+/**
202
+ * DFL_FPGA_PORT_UINT_SET_IRQ - _IOW(DFL_FPGA_MAGIC, DFL_PORT_BASE + 8,
203
+ * struct dfl_fpga_irq_set)
204
+ *
205
+ * Set fpga AFU interrupt trigger if evtfds[n] is valid.
206
+ * Unset related interrupt trigger if evtfds[n] is a negative value.
207
+ * Return: 0 on success, -errno on failure.
208
+ */
209
+#define DFL_FPGA_PORT_UINT_SET_IRQ _IOW(DFL_FPGA_MAGIC, \
210
+ DFL_PORT_BASE + 8, \
211
+ struct dfl_fpga_irq_set)
212
+
154213 /* IOCTLs for FME file descriptor */
155214
156215 /**
....@@ -176,4 +235,45 @@
176235
177236 #define DFL_FPGA_FME_PORT_PR _IO(DFL_FPGA_MAGIC, DFL_FME_BASE + 0)
178237
238
+/**
239
+ * DFL_FPGA_FME_PORT_RELEASE - _IOW(DFL_FPGA_MAGIC, DFL_FME_BASE + 1,
240
+ * int port_id)
241
+ *
242
+ * Driver releases the port per Port ID provided by caller.
243
+ * Return: 0 on success, -errno on failure.
244
+ */
245
+#define DFL_FPGA_FME_PORT_RELEASE _IOW(DFL_FPGA_MAGIC, DFL_FME_BASE + 1, int)
246
+
247
+/**
248
+ * DFL_FPGA_FME_PORT_ASSIGN - _IOW(DFL_FPGA_MAGIC, DFL_FME_BASE + 2,
249
+ * int port_id)
250
+ *
251
+ * Driver assigns the port back per Port ID provided by caller.
252
+ * Return: 0 on success, -errno on failure.
253
+ */
254
+#define DFL_FPGA_FME_PORT_ASSIGN _IOW(DFL_FPGA_MAGIC, DFL_FME_BASE + 2, int)
255
+
256
+/**
257
+ * DFL_FPGA_FME_ERR_GET_IRQ_NUM - _IOR(DFL_FPGA_MAGIC, DFL_FME_BASE + 3,
258
+ * __u32 num_irqs)
259
+ *
260
+ * Get the number of irqs supported by the fpga fme error reporting private
261
+ * feature. Currently hardware supports up to 1 irq.
262
+ * Return: 0 on success, -errno on failure.
263
+ */
264
+#define DFL_FPGA_FME_ERR_GET_IRQ_NUM _IOR(DFL_FPGA_MAGIC, \
265
+ DFL_FME_BASE + 3, __u32)
266
+
267
+/**
268
+ * DFL_FPGA_FME_ERR_SET_IRQ - _IOW(DFL_FPGA_MAGIC, DFL_FME_BASE + 4,
269
+ * struct dfl_fpga_irq_set)
270
+ *
271
+ * Set fpga fme error reporting interrupt trigger if evtfds[n] is valid.
272
+ * Unset related interrupt trigger if evtfds[n] is a negative value.
273
+ * Return: 0 on success, -errno on failure.
274
+ */
275
+#define DFL_FPGA_FME_ERR_SET_IRQ _IOW(DFL_FPGA_MAGIC, \
276
+ DFL_FME_BASE + 4, \
277
+ struct dfl_fpga_irq_set)
278
+
179279 #endif /* _UAPI_LINUX_FPGA_DFL_H */