]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/s390/crypto/ap_bus.c
s390/zcrypt: Fix wrong dispatching for control domain CPRBs
[linux.git] / drivers / s390 / crypto / ap_bus.c
index cc30e4f07fffabe0da6968dfa379c9ef9de843a3..b9fc502c58c24a146c9e5c5109312a2d40c7d268 100644 (file)
@@ -254,19 +254,37 @@ static inline int ap_test_config_card_id(unsigned int id)
 }
 
 /*
- * ap_test_config_domain(): Test, whether an AP usage domain is configured.
+ * ap_test_config_usage_domain(): Test, whether an AP usage domain
+ * is configured.
  * @domain AP usage domain ID
  *
  * Returns 0 if the usage domain is not configured
  *        1 if the usage domain is configured or
  *          if the configuration information is not available
  */
-static inline int ap_test_config_domain(unsigned int domain)
+int ap_test_config_usage_domain(unsigned int domain)
 {
        if (!ap_configuration)  /* QCI not supported */
                return domain < 16;
        return ap_test_config(ap_configuration->aqm, domain);
 }
+EXPORT_SYMBOL(ap_test_config_usage_domain);
+
+/*
+ * ap_test_config_ctrl_domain(): Test, whether an AP control domain
+ * is configured.
+ * @domain AP control domain ID
+ *
+ * Returns 1 if the control domain is configured
+ *        0 in all other cases
+ */
+int ap_test_config_ctrl_domain(unsigned int domain)
+{
+       if (!ap_configuration)  /* QCI not supported */
+               return 0;
+       return ap_test_config(ap_configuration->adm, domain);
+}
+EXPORT_SYMBOL(ap_test_config_ctrl_domain);
 
 /**
  * ap_query_queue(): Check if an AP queue is available.
@@ -1267,7 +1285,7 @@ static void ap_select_domain(void)
        best_domain = -1;
        max_count = 0;
        for (i = 0; i < AP_DOMAINS; i++) {
-               if (!ap_test_config_domain(i) ||
+               if (!ap_test_config_usage_domain(i) ||
                    !test_bit_inv(i, ap_perms.aqm))
                        continue;
                count = 0;
@@ -1442,7 +1460,7 @@ static void _ap_scan_bus_adapter(int id)
                                      (void *)(long) qid,
                                      __match_queue_device_with_qid);
                aq = dev ? to_ap_queue(dev) : NULL;
-               if (!ap_test_config_domain(dom)) {
+               if (!ap_test_config_usage_domain(dom)) {
                        if (dev) {
                                /* Queue device exists but has been
                                 * removed from configuration.