}
                return;
        }
-
        if (ac) {
                /* Check APQN against existing card device for changes */
                if (ac->raw_hwtype != type) {
                        ap_scan_rm_card_dev_and_queue_devs(ac);
                        put_device(dev);
                        ac = NULL;
-               } else if (ac->functions != func) {
+               } else if ((ac->functions & TAPQ_CARD_FUNC_CMP_MASK) !=
+                          (func & TAPQ_CARD_FUNC_CMP_MASK)) {
                        AP_DBF_INFO("%s(%d) functions 0x%08x changed, rm card and queue devs\n",
-                                   __func__, ap, type);
+                                   __func__, ap, func);
                        ap_scan_rm_card_dev_and_queue_devs(ac);
                        put_device(dev);
                        ac = NULL;
 
 struct ap_card {
        struct ap_device ap_dev;
        int raw_hwtype;                 /* AP raw hardware type. */
-       unsigned int functions;         /* AP device function bitfield. */
+       unsigned int functions;         /* TAPQ GR2 upper 32 facility bits */
        int queue_depth;                /* AP queue depth.*/
        int id;                         /* AP card number. */
        unsigned int maxmsgsize;        /* AP msg limit for this card */
        atomic64_t total_request_count; /* # requests ever for this AP device.*/
 };
 
+#define TAPQ_CARD_FUNC_CMP_MASK 0xFFFF0000
+
 #define to_ap_card(x) container_of((x), struct ap_card, ap_dev.device)
 
 struct ap_queue {
 
 
 static DEVICE_ATTR_RO(chkstop);
 
+static ssize_t ap_functions_show(struct device *dev,
+                                struct device_attribute *attr, char *buf)
+{
+       struct ap_queue *aq = to_ap_queue(dev);
+       struct ap_queue_status status;
+       struct ap_tapq_gr2 info;
+
+       status = ap_test_queue(aq->qid, 1, &info);
+       if (status.response_code > AP_RESPONSE_BUSY) {
+               AP_DBF_DBG("%s RC 0x%02x on tapq(0x%02x.%04x)\n",
+                          __func__, status.response_code,
+                          AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid));
+               return -EIO;
+       }
+
+       return sysfs_emit(buf, "0x%08X\n", info.fac);
+}
+
+static DEVICE_ATTR_RO(ap_functions);
+
 #ifdef CONFIG_ZCRYPT_DEBUG
 static ssize_t states_show(struct device *dev,
                           struct device_attribute *attr, char *buf)
        &dev_attr_interrupt.attr,
        &dev_attr_config.attr,
        &dev_attr_chkstop.attr,
+       &dev_attr_ap_functions.attr,
 #ifdef CONFIG_ZCRYPT_DEBUG
        &dev_attr_states.attr,
        &dev_attr_last_err_rc.attr,