diff options
Diffstat (limited to 'drivers/s390/crypto/ap_bus.h')
| -rw-r--r-- | drivers/s390/crypto/ap_bus.h | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/drivers/s390/crypto/ap_bus.h b/drivers/s390/crypto/ap_bus.h index 52d61995af88..685f6cc022f9 100644 --- a/drivers/s390/crypto/ap_bus.h +++ b/drivers/s390/crypto/ap_bus.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright IBM Corp. 2006 | 2 | * Copyright IBM Corp. 2006, 2012 |
| 3 | * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com> | 3 | * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com> |
| 4 | * Martin Schwidefsky <schwidefsky@de.ibm.com> | 4 | * Martin Schwidefsky <schwidefsky@de.ibm.com> |
| 5 | * Ralph Wuerthner <rwuerthn@de.ibm.com> | 5 | * Ralph Wuerthner <rwuerthn@de.ibm.com> |
| @@ -83,13 +83,12 @@ int ap_queue_status_invalid_test(struct ap_queue_status *status) | |||
| 83 | return !(memcmp(status, &invalid, sizeof(struct ap_queue_status))); | 83 | return !(memcmp(status, &invalid, sizeof(struct ap_queue_status))); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | #define MAX_AP_FACILITY 31 | 86 | #define AP_MAX_BITS 31 |
| 87 | 87 | static inline int ap_test_bit(unsigned int *ptr, unsigned int nr) | |
| 88 | static inline int test_ap_facility(unsigned int function, unsigned int nr) | ||
| 89 | { | 88 | { |
| 90 | if (nr > MAX_AP_FACILITY) | 89 | if (nr > AP_MAX_BITS) |
| 91 | return 0; | 90 | return 0; |
| 92 | return function & (unsigned int)(0x80000000 >> nr); | 91 | return (*ptr & (0x80000000u >> nr)) != 0; |
| 93 | } | 92 | } |
| 94 | 93 | ||
| 95 | #define AP_RESPONSE_NORMAL 0x00 | 94 | #define AP_RESPONSE_NORMAL 0x00 |
| @@ -117,6 +116,15 @@ static inline int test_ap_facility(unsigned int function, unsigned int nr) | |||
| 117 | #define AP_DEVICE_TYPE_CEX2C 7 | 116 | #define AP_DEVICE_TYPE_CEX2C 7 |
| 118 | #define AP_DEVICE_TYPE_CEX3A 8 | 117 | #define AP_DEVICE_TYPE_CEX3A 8 |
| 119 | #define AP_DEVICE_TYPE_CEX3C 9 | 118 | #define AP_DEVICE_TYPE_CEX3C 9 |
| 119 | #define AP_DEVICE_TYPE_CEX4 10 | ||
| 120 | |||
| 121 | /* | ||
| 122 | * Known function facilities | ||
| 123 | */ | ||
| 124 | #define AP_FUNC_MEX4K 1 | ||
| 125 | #define AP_FUNC_CRT4K 2 | ||
| 126 | #define AP_FUNC_COPRO 3 | ||
| 127 | #define AP_FUNC_ACCEL 4 | ||
| 120 | 128 | ||
| 121 | /* | 129 | /* |
| 122 | * AP reset flag states | 130 | * AP reset flag states |
| @@ -151,6 +159,7 @@ struct ap_device { | |||
| 151 | ap_qid_t qid; /* AP queue id. */ | 159 | ap_qid_t qid; /* AP queue id. */ |
| 152 | int queue_depth; /* AP queue depth.*/ | 160 | int queue_depth; /* AP queue depth.*/ |
| 153 | int device_type; /* AP device type. */ | 161 | int device_type; /* AP device type. */ |
| 162 | unsigned int functions; /* AP device function bitfield. */ | ||
| 154 | int unregistered; /* marks AP device as unregistered */ | 163 | int unregistered; /* marks AP device as unregistered */ |
| 155 | struct timer_list timeout; /* Timer for request timeouts. */ | 164 | struct timer_list timeout; /* Timer for request timeouts. */ |
| 156 | int reset; /* Reset required after req. timeout. */ | 165 | int reset; /* Reset required after req. timeout. */ |
| @@ -183,6 +192,17 @@ struct ap_message { | |||
| 183 | struct ap_message *); | 192 | struct ap_message *); |
| 184 | }; | 193 | }; |
| 185 | 194 | ||
| 195 | struct ap_config_info { | ||
| 196 | unsigned int special_command:1; | ||
| 197 | unsigned int ap_extended:1; | ||
| 198 | unsigned char reserved1:6; | ||
| 199 | unsigned char reserved2[15]; | ||
| 200 | unsigned int apm[8]; /* AP ID mask */ | ||
| 201 | unsigned int aqm[8]; /* AP queue mask */ | ||
| 202 | unsigned int adm[8]; /* AP domain mask */ | ||
| 203 | unsigned char reserved4[16]; | ||
| 204 | } __packed; | ||
| 205 | |||
| 186 | #define AP_DEVICE(dt) \ | 206 | #define AP_DEVICE(dt) \ |
| 187 | .dev_type=(dt), \ | 207 | .dev_type=(dt), \ |
| 188 | .match_flags=AP_DEVICE_ID_MATCH_DEVICE_TYPE, | 208 | .match_flags=AP_DEVICE_ID_MATCH_DEVICE_TYPE, |
| @@ -211,10 +231,9 @@ int ap_recv(ap_qid_t, unsigned long long *, void *, size_t); | |||
| 211 | void ap_queue_message(struct ap_device *ap_dev, struct ap_message *ap_msg); | 231 | void ap_queue_message(struct ap_device *ap_dev, struct ap_message *ap_msg); |
| 212 | void ap_cancel_message(struct ap_device *ap_dev, struct ap_message *ap_msg); | 232 | void ap_cancel_message(struct ap_device *ap_dev, struct ap_message *ap_msg); |
| 213 | void ap_flush_queue(struct ap_device *ap_dev); | 233 | void ap_flush_queue(struct ap_device *ap_dev); |
| 234 | void ap_bus_force_rescan(void); | ||
| 214 | 235 | ||
| 215 | int ap_module_init(void); | 236 | int ap_module_init(void); |
| 216 | void ap_module_exit(void); | 237 | void ap_module_exit(void); |
| 217 | 238 | ||
| 218 | int ap_4096_commands_available(ap_qid_t qid); | ||
| 219 | |||
| 220 | #endif /* _AP_BUS_H_ */ | 239 | #endif /* _AP_BUS_H_ */ |
