aboutsummaryrefslogtreecommitdiff
path: root/drivers/s390/crypto/ap_bus.c
diff options
context:
space:
mode:
authorGravatar Harald Freudenberger <freude@linux.ibm.com> 2022-09-12 18:02:44 +0200
committerGravatar Heiko Carstens <hca@linux.ibm.com> 2023-03-20 11:12:48 +0100
commit211c06d845a7a5d856e2a99276ceb02aaa11c618 (patch)
tree38f6c0035e0f93ead755f1d2549a67c4bb20a947 /drivers/s390/crypto/ap_bus.c
parents390/ap: introduce new AP bus sysfs attribute features (diff)
downloadlinux-211c06d845a7a5d856e2a99276ceb02aaa11c618.tar.gz
linux-211c06d845a7a5d856e2a99276ceb02aaa11c618.tar.bz2
linux-211c06d845a7a5d856e2a99276ceb02aaa11c618.zip
s390/ap: make tapq gr2 response a struct
This patch introduces a new struct ap_tapq_gr2 which covers the response in GR2 on TAPQ invocation. This makes it much easier and less error-prone for the calling functions to access the right field without shifting and masking. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com> Reviewed-by: Holger Dengler <dengler@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/ap_bus.c')
-rw-r--r--drivers/s390/crypto/ap_bus.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 4e1926cf7a3d..ab37818faeab 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -343,18 +343,7 @@ static bool ap_queue_info(ap_qid_t qid, int *q_type, unsigned int *q_fac,
int *q_depth, int *q_ml, bool *q_decfg, bool *q_cstop)
{
struct ap_queue_status status;
- union {
- unsigned long value;
- struct {
- unsigned int fac : 32; /* facility bits */
- unsigned int at : 8; /* ap type */
- unsigned int _res1 : 8;
- unsigned int _res2 : 4;
- unsigned int ml : 4; /* apxl ml */
- unsigned int _res3 : 4;
- unsigned int qd : 4; /* queue depth */
- } tapq_gr2;
- } tapq_info;
+ struct ap_tapq_gr2 tapq_info;
tapq_info.value = 0;
@@ -364,7 +353,7 @@ static bool ap_queue_info(ap_qid_t qid, int *q_type, unsigned int *q_fac,
return false;
/* call TAPQ on this APQN */
- status = ap_test_queue(qid, ap_apft_available(), &tapq_info.value);
+ status = ap_test_queue(qid, ap_apft_available(), &tapq_info);
switch (status.response_code) {
case AP_RESPONSE_NORMAL:
case AP_RESPONSE_RESET_IN_PROGRESS:
@@ -378,10 +367,10 @@ static bool ap_queue_info(ap_qid_t qid, int *q_type, unsigned int *q_fac,
*/
if (WARN_ON_ONCE(!tapq_info.value))
return false;
- *q_type = tapq_info.tapq_gr2.at;
- *q_fac = tapq_info.tapq_gr2.fac;
- *q_depth = tapq_info.tapq_gr2.qd;
- *q_ml = tapq_info.tapq_gr2.ml;
+ *q_type = tapq_info.at;
+ *q_fac = tapq_info.fac;
+ *q_depth = tapq_info.qd;
+ *q_ml = tapq_info.ml;
*q_decfg = status.response_code == AP_RESPONSE_DECONFIGURED;
*q_cstop = status.response_code == AP_RESPONSE_CHECKSTOPPED;
switch (*q_type) {