2 * linux/drivers/s390/misc/z90common.h
6 * Copyright (C) 2001, 2004 IBM Corporation
7 * Author(s): Robert Burroughs (burrough@us.ibm.com)
8 * Eric Rossman (edrossma@us.ibm.com)
10 * Hotplug & misc device support: Jochen Roehrig (roehrig@de.ibm.com)
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2, or (at your option)
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #define VERSION_Z90COMMON_H "$Revision: 1.8 $"
33 #define RESPBUFFSIZE 256
34 #define PCI_FUNC_KEY_DECRYPT 0x5044
35 #define PCI_FUNC_KEY_ENCRYPT 0x504B
59 #define Z90C_AMBIGUOUS_DOMAIN 2
60 #define Z90C_INCORRECT_DOMAIN 3
64 #define SEN_USER_ERROR 8
65 #define SEN_QUEUE_FULL 11
66 #define SEN_NOT_AVAIL 16
67 #define SEN_PAD_ERROR 17
69 #define SEN_RELEASED 24
73 #define REC_OPERAND_INV 8
74 #define REC_OPERAND_SIZE 9
75 #define REC_EVEN_MOD 10
76 #define REC_NO_WORK 11
77 #define REC_HARDWAR_ERR 12
78 #define REC_NO_RESPONSE 13
79 #define REC_RETRY_DEV 14
80 #define REC_USER_GONE 15
81 #define REC_BAD_MESSAGE 16
82 #define REC_INVALID_PAD 17
83 #define REC_RELEASED 28
85 #define WRONG_DEVICE_TYPE 20
87 #define REC_FATAL_ERROR 32
88 #define SEN_FATAL_ERROR 33
89 #define TSQ_FATAL_ERROR 34
90 #define RSQ_FATAL_ERROR 35
107 #define DEV_NAME "z90crypt"
109 #define PRINTK(fmt, args...) \
110 printk(KERN_DEBUG DEV_NAME ": %s -> " fmt, __FUNCTION__ , ## args)
111 #define PRINTKN(fmt, args...) \
112 printk(KERN_DEBUG DEV_NAME ": " fmt, ## args)
113 #define PRINTKW(fmt, args...) \
114 printk(KERN_WARNING DEV_NAME ": %s -> " fmt, __FUNCTION__ , ## args)
115 #define PRINTKC(fmt, args...) \
116 printk(KERN_CRIT DEV_NAME ": %s -> " fmt, __FUNCTION__ , ## args)
118 #ifdef Z90CRYPT_DEBUG
119 #define PDEBUG(fmt, args...) \
120 printk(KERN_DEBUG DEV_NAME ": %s -> " fmt, __FUNCTION__ , ## args)
122 #define PDEBUG(fmt, args...) do {} while (0)
125 #define UMIN(a,b) ((a) < (b) ? (a) : (b))
126 #define IS_EVEN(x) ((x) == (2 * ((x) / 2)))