aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto/ap_bus.h
diff options
context:
space:
mode:
authorHolger Dengler <hd@linux.vnet.ibm.com>2012-08-28 10:41:50 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-09-26 09:44:54 -0400
commit75014550516b147e5f530b84c71496341e036d6f (patch)
treede0993eb3ec2ea2b5ce0953b8a91630685f60fc5 /drivers/s390/crypto/ap_bus.h
parent48a8ca03f8fd49a4d0c0c8843d4f5a7008dc2656 (diff)
s390/ap: configuration information exploitation
Query AP configuration information. Improve performance of AP bus scans by skipping AP device probing, if the AP deviec is not configured. Reviewed-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com> Signed-off-by: Holger Dengler <hd@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/ap_bus.h')
-rw-r--r--drivers/s390/crypto/ap_bus.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/s390/crypto/ap_bus.h b/drivers/s390/crypto/ap_bus.h
index 52d61995af88..5018f66dada5 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 87static inline int ap_test_bit(unsigned int *ptr, unsigned int nr)
88static 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
@@ -183,6 +182,17 @@ struct ap_message {
183 struct ap_message *); 182 struct ap_message *);
184}; 183};
185 184
185struct ap_config_info {
186 unsigned int special_command:1;
187 unsigned int ap_extended:1;
188 unsigned char reserved1:6;
189 unsigned char reserved2[15];
190 unsigned int apm[8]; /* AP ID mask */
191 unsigned int aqm[8]; /* AP queue mask */
192 unsigned int adm[8]; /* AP domain mask */
193 unsigned char reserved4[16];
194} __packed;
195
186#define AP_DEVICE(dt) \ 196#define AP_DEVICE(dt) \
187 .dev_type=(dt), \ 197 .dev_type=(dt), \
188 .match_flags=AP_DEVICE_ID_MATCH_DEVICE_TYPE, 198 .match_flags=AP_DEVICE_ID_MATCH_DEVICE_TYPE,