@@ -203,9 +203,9 @@ struct ep11_urb {
203
203
} __attribute__((packed ));
204
204
205
205
/**
206
- * struct zcrypt_device_status
206
+ * struct zcrypt_device_status_ext
207
207
* @hwtype: raw hardware type
208
- * @qid: 6 bit device index, 8 bit domain
208
+ * @qid: 8 bit device index, 8 bit domain
209
209
* @functions: AP device function bit field 'abcdef'
210
210
* a, b, c = reserved
211
211
* d = CCA coprocessor
@@ -214,28 +214,23 @@ struct ep11_urb {
214
214
* @online online status
215
215
* @reserved reserved
216
216
*/
217
- struct zcrypt_device_status {
217
+ struct zcrypt_device_status_ext {
218
218
unsigned int hwtype :8 ;
219
- unsigned int qid :14 ;
219
+ unsigned int qid :16 ;
220
220
unsigned int online :1 ;
221
221
unsigned int functions :6 ;
222
- unsigned int reserved :3 ;
222
+ unsigned int reserved :1 ;
223
223
};
224
224
225
- #define MAX_ZDEV_CARDIDS 64
226
- #define MAX_ZDEV_DOMAINS 256
225
+ #define MAX_ZDEV_CARDIDS_EXT 256
226
+ #define MAX_ZDEV_DOMAINS_EXT 256
227
227
228
- /**
229
- * Maximum number of zcrypt devices
230
- */
231
- #define MAX_ZDEV_ENTRIES (MAX_ZDEV_CARDIDS * MAX_ZDEV_DOMAINS)
228
+ /* Maximum number of zcrypt devices */
229
+ #define MAX_ZDEV_ENTRIES_EXT (MAX_ZDEV_CARDIDS_EXT * MAX_ZDEV_DOMAINS_EXT)
232
230
233
- /**
234
- * zcrypt_device_matrix
235
- * Device matrix of all zcrypt devices
236
- */
237
- struct zcrypt_device_matrix {
238
- struct zcrypt_device_status device [MAX_ZDEV_ENTRIES ];
231
+ /* Device matrix of all zcrypt devices */
232
+ struct zcrypt_device_matrix_ext {
233
+ struct zcrypt_device_status_ext device [MAX_ZDEV_ENTRIES_EXT ];
239
234
};
240
235
241
236
#define AUTOSELECT ((unsigned int)0xFFFFFFFF)
@@ -270,39 +265,35 @@ struct zcrypt_device_matrix {
270
265
* ZSENDEP11CPRB
271
266
* Send an arbitrary EP11 CPRB to an EP11 coprocessor crypto card.
272
267
*
273
- * Z90STAT_STATUS_MASK
274
- * Return an 64 element array of unsigned chars for the status of
275
- * all devices.
268
+ * ZCRYPT_DEVICE_STATUS
269
+ * The given struct zcrypt_device_matrix_ext is updated with
270
+ * status information for each currently known apqn.
271
+ *
272
+ * ZCRYPT_STATUS_MASK
273
+ * Return an MAX_ZDEV_CARDIDS_EXT element array of unsigned chars for the
274
+ * status of all devices.
276
275
* 0x01: PCICA
277
276
* 0x02: PCICC
278
277
* 0x03: PCIXCC_MCL2
279
278
* 0x04: PCIXCC_MCL3
280
279
* 0x05: CEX2C
281
280
* 0x06: CEX2A
282
- * 0x0d: device is disabled via the proc filesystem
283
- *
284
- * Z90STAT_QDEPTH_MASK
285
- * Return an 64 element array of unsigned chars for the queue
286
- * depth of all devices.
287
- *
288
- * Z90STAT_PERDEV_REQCNT
289
- * Return an 64 element array of unsigned integers for the number
290
- * of successfully completed requests per device since the device
291
- * was detected and made available.
292
- *
293
- * Z90STAT_REQUESTQ_COUNT
294
- * Return an integer count of the number of entries waiting to be
295
- * sent to a device.
281
+ * 0x07: CEX3C
282
+ * 0x08: CEX3A
283
+ * 0x0a: CEX4
284
+ * 0x0b: CEX5
285
+ * 0x0c: CEX6
286
+ * 0x0d: device is disabled
296
287
*
297
- * Z90STAT_PENDINGQ_COUNT
298
- * Return an integer count of the number of entries sent to all
299
- * devices awaiting the reply .
288
+ * ZCRYPT_QDEPTH_MASK
289
+ * Return an MAX_ZDEV_CARDIDS_EXT element array of unsigned chars for the
290
+ * queue depth of all devices .
300
291
*
301
- * Z90STAT_TOTALOPEN_COUNT
302
- * Return an integer count of the number of open file handles.
292
+ * ZCRYPT_PERDEV_REQCNT
293
+ * Return an MAX_ZDEV_CARDIDS_EXT element array of unsigned integers for
294
+ * the number of successfully completed requests per device since the
295
+ * device was detected and made available.
303
296
*
304
- * Z90STAT_DOMAIN_INDEX
305
- * Return the integer value of the Cryptographic Domain.
306
297
*/
307
298
308
299
/**
@@ -312,15 +303,56 @@ struct zcrypt_device_matrix {
312
303
#define ICARSACRT _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x06, 0)
313
304
#define ZSECSENDCPRB _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x81, 0)
314
305
#define ZSENDEP11CPRB _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x04, 0)
315
- #define ZDEVICESTATUS _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x4f, 0)
316
306
317
- /* Status ioctl calls */
307
+ #define ZCRYPT_DEVICE_STATUS _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x5f, 0)
308
+ #define ZCRYPT_STATUS_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x58, char[MAX_ZDEV_CARDIDS_EXT])
309
+ #define ZCRYPT_QDEPTH_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x59, char[MAX_ZDEV_CARDIDS_EXT])
310
+ #define ZCRYPT_PERDEV_REQCNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x5a, int[MAX_ZDEV_CARDIDS_EXT])
311
+
312
+ /*
313
+ * Only deprecated defines, structs and ioctls below this line.
314
+ */
315
+
316
+ /* Deprecated: use MAX_ZDEV_CARDIDS_EXT */
317
+ #define MAX_ZDEV_CARDIDS 64
318
+ /* Deprecated: use MAX_ZDEV_DOMAINS_EXT */
319
+ #define MAX_ZDEV_DOMAINS 256
320
+
321
+ /* Deprecated: use MAX_ZDEV_ENTRIES_EXT */
322
+ #define MAX_ZDEV_ENTRIES (MAX_ZDEV_CARDIDS * MAX_ZDEV_DOMAINS)
323
+
324
+ /* Deprecated: use struct zcrypt_device_status_ext */
325
+ struct zcrypt_device_status {
326
+ unsigned int hwtype :8 ;
327
+ unsigned int qid :14 ;
328
+ unsigned int online :1 ;
329
+ unsigned int functions :6 ;
330
+ unsigned int reserved :3 ;
331
+ };
332
+
333
+ /* Deprecated: use struct zcrypt_device_matrix_ext */
334
+ struct zcrypt_device_matrix {
335
+ struct zcrypt_device_status device [MAX_ZDEV_ENTRIES ];
336
+ };
337
+
338
+ /* Deprecated: use ZCRYPT_DEVICE_STATUS */
339
+ #define ZDEVICESTATUS _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x4f, 0)
340
+ /* Deprecated: use ZCRYPT_STATUS_MASK */
341
+ #define Z90STAT_STATUS_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x48, char[64])
342
+ /* Deprecated: use ZCRYPT_QDEPTH_MASK */
343
+ #define Z90STAT_QDEPTH_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x49, char[64])
344
+ /* Deprecated: use ZCRYPT_PERDEV_REQCNT */
345
+ #define Z90STAT_PERDEV_REQCNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x4a, int[64])
346
+
347
+ /* Deprecated: use sysfs to query these values */
318
348
#define Z90STAT_REQUESTQ_COUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x44, int)
319
349
#define Z90STAT_PENDINGQ_COUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x45, int)
320
350
#define Z90STAT_TOTALOPEN_COUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x46, int)
321
351
#define Z90STAT_DOMAIN_INDEX _IOR(ZCRYPT_IOCTL_MAGIC, 0x47, int)
322
- #define Z90STAT_STATUS_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x48, char[64])
323
- #define Z90STAT_QDEPTH_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x49, char[64])
324
- #define Z90STAT_PERDEV_REQCNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x4a, int[64])
352
+
353
+ /*
354
+ * The ioctl number ranges 0x40 - 0x42 and 0x4b - 0x4e had been used in the
355
+ * past, don't assign new ioctls for these.
356
+ */
325
357
326
358
#endif /* __ASM_S390_ZCRYPT_H */
0 commit comments