Lines Matching refs:zq
576 struct zcrypt_queue *zq, in zcrypt_pick_queue() argument
580 if (!zq || !try_module_get(zq->queue->ap_dev.device.driver->owner)) in zcrypt_pick_queue()
582 zcrypt_queue_get(zq); in zcrypt_pick_queue()
583 get_device(&zq->queue->ap_dev.device); in zcrypt_pick_queue()
585 atomic_add(weight, &zq->load); in zcrypt_pick_queue()
586 zq->request_count++; in zcrypt_pick_queue()
587 *pmod = zq->queue->ap_dev.device.driver->owner; in zcrypt_pick_queue()
588 return zq; in zcrypt_pick_queue()
592 struct zcrypt_queue *zq, in zcrypt_drop_queue() argument
596 zq->request_count--; in zcrypt_drop_queue()
598 atomic_sub(weight, &zq->load); in zcrypt_drop_queue()
599 put_device(&zq->queue->ap_dev.device); in zcrypt_drop_queue()
600 zcrypt_queue_put(zq); in zcrypt_drop_queue()
619 static inline bool zcrypt_queue_compare(struct zcrypt_queue *zq, in zcrypt_queue_compare() argument
626 weight += atomic_read(&zq->load); in zcrypt_queue_compare()
629 return zq->queue->total_request_count < in zcrypt_queue_compare()
642 struct zcrypt_queue *zq, *pref_zq; in zcrypt_rsa_modexpo() local
693 for_each_zcrypt_queue(zq, zc) { in zcrypt_rsa_modexpo()
695 if (!zq->online || !zq->ops->rsa_modexpo || in zcrypt_rsa_modexpo()
696 !zq->queue->config || zq->queue->chkstop) in zcrypt_rsa_modexpo()
700 AP_QID_QUEUE(zq->queue->qid))) in zcrypt_rsa_modexpo()
704 tr->last_qid == zq->queue->qid) ? in zcrypt_rsa_modexpo()
706 if (!zcrypt_queue_compare(zq, pref_zq, in zcrypt_rsa_modexpo()
710 pref_zq = zq; in zcrypt_rsa_modexpo()
747 struct zcrypt_queue *zq, *pref_zq; in zcrypt_rsa_crt() local
798 for_each_zcrypt_queue(zq, zc) { in zcrypt_rsa_crt()
800 if (!zq->online || !zq->ops->rsa_modexpo_crt || in zcrypt_rsa_crt()
801 !zq->queue->config || zq->queue->chkstop) in zcrypt_rsa_crt()
805 AP_QID_QUEUE(zq->queue->qid))) in zcrypt_rsa_crt()
809 tr->last_qid == zq->queue->qid) ? in zcrypt_rsa_crt()
811 if (!zcrypt_queue_compare(zq, pref_zq, in zcrypt_rsa_crt()
815 pref_zq = zq; in zcrypt_rsa_crt()
852 struct zcrypt_queue *zq, *pref_zq; in _zcrypt_send_cprb() local
916 for_each_zcrypt_queue(zq, zc) { in _zcrypt_send_cprb()
918 if (!zq->online || !zq->ops->send_cprb || in _zcrypt_send_cprb()
919 !zq->queue->config || zq->queue->chkstop || in _zcrypt_send_cprb()
921 tdom != AP_QID_QUEUE(zq->queue->qid))) in _zcrypt_send_cprb()
925 AP_QID_QUEUE(zq->queue->qid))) in _zcrypt_send_cprb()
929 tr->last_qid == zq->queue->qid) ? in _zcrypt_send_cprb()
931 if (!zcrypt_queue_compare(zq, pref_zq, in _zcrypt_send_cprb()
935 pref_zq = zq; in _zcrypt_send_cprb()
1009 struct zcrypt_queue *zq, *pref_zq; in _zcrypt_send_ep11_cprb() local
1087 for_each_zcrypt_queue(zq, zc) { in _zcrypt_send_ep11_cprb()
1089 if (!zq->online || !zq->ops->send_ep11_cprb || in _zcrypt_send_ep11_cprb()
1090 !zq->queue->config || zq->queue->chkstop || in _zcrypt_send_ep11_cprb()
1092 !is_desired_ep11_queue(zq->queue->qid, in _zcrypt_send_ep11_cprb()
1097 AP_QID_QUEUE(zq->queue->qid))) in _zcrypt_send_ep11_cprb()
1101 tr->last_qid == zq->queue->qid) ? in _zcrypt_send_ep11_cprb()
1103 if (!zcrypt_queue_compare(zq, pref_zq, in _zcrypt_send_ep11_cprb()
1107 pref_zq = zq; in _zcrypt_send_ep11_cprb()
1159 struct zcrypt_queue *zq, *pref_zq; in zcrypt_rng() local
1186 for_each_zcrypt_queue(zq, zc) { in zcrypt_rng()
1188 if (!zq->online || !zq->ops->rng || in zcrypt_rng()
1189 !zq->queue->config || zq->queue->chkstop) in zcrypt_rng()
1191 if (!zcrypt_queue_compare(zq, pref_zq, wgt, pref_wgt)) in zcrypt_rng()
1194 pref_zq = zq; in zcrypt_rng()
1225 struct zcrypt_queue *zq; in zcrypt_device_status_mask() local
1234 for_each_zcrypt_queue(zq, zc) { in zcrypt_device_status_mask()
1235 card = AP_QID_CARD(zq->queue->qid); in zcrypt_device_status_mask()
1238 queue = AP_QID_QUEUE(zq->queue->qid); in zcrypt_device_status_mask()
1242 stat->qid = zq->queue->qid; in zcrypt_device_status_mask()
1243 stat->online = zq->online ? 0x01 : 0x00; in zcrypt_device_status_mask()
1252 struct zcrypt_queue *zq; in zcrypt_device_status_mask_ext() local
1261 for_each_zcrypt_queue(zq, zc) { in zcrypt_device_status_mask_ext()
1262 card = AP_QID_CARD(zq->queue->qid); in zcrypt_device_status_mask_ext()
1263 queue = AP_QID_QUEUE(zq->queue->qid); in zcrypt_device_status_mask_ext()
1267 stat->qid = zq->queue->qid; in zcrypt_device_status_mask_ext()
1268 stat->online = zq->online ? 0x01 : 0x00; in zcrypt_device_status_mask_ext()
1279 struct zcrypt_queue *zq; in zcrypt_device_status_ext() local
1285 for_each_zcrypt_queue(zq, zc) { in zcrypt_device_status_ext()
1286 if (card == AP_QID_CARD(zq->queue->qid) && in zcrypt_device_status_ext()
1287 queue == AP_QID_QUEUE(zq->queue->qid)) { in zcrypt_device_status_ext()
1290 devstat->qid = zq->queue->qid; in zcrypt_device_status_ext()
1291 devstat->online = zq->online ? 0x01 : 0x00; in zcrypt_device_status_ext()
1306 struct zcrypt_queue *zq; in zcrypt_status_mask() local
1312 for_each_zcrypt_queue(zq, zc) { in zcrypt_status_mask()
1313 card = AP_QID_CARD(zq->queue->qid); in zcrypt_status_mask()
1314 if (AP_QID_QUEUE(zq->queue->qid) != ap_domain_index || in zcrypt_status_mask()
1326 struct zcrypt_queue *zq; in zcrypt_qdepth_mask() local
1333 for_each_zcrypt_queue(zq, zc) { in zcrypt_qdepth_mask()
1334 card = AP_QID_CARD(zq->queue->qid); in zcrypt_qdepth_mask()
1335 if (AP_QID_QUEUE(zq->queue->qid) != ap_domain_index || in zcrypt_qdepth_mask()
1338 spin_lock(&zq->queue->lock); in zcrypt_qdepth_mask()
1340 zq->queue->pendingq_count + in zcrypt_qdepth_mask()
1341 zq->queue->requestq_count; in zcrypt_qdepth_mask()
1342 spin_unlock(&zq->queue->lock); in zcrypt_qdepth_mask()
1352 struct zcrypt_queue *zq; in zcrypt_perdev_reqcnt() local
1360 for_each_zcrypt_queue(zq, zc) { in zcrypt_perdev_reqcnt()
1361 card = AP_QID_CARD(zq->queue->qid); in zcrypt_perdev_reqcnt()
1362 if (AP_QID_QUEUE(zq->queue->qid) != ap_domain_index || in zcrypt_perdev_reqcnt()
1365 spin_lock(&zq->queue->lock); in zcrypt_perdev_reqcnt()
1366 cnt = zq->queue->total_request_count; in zcrypt_perdev_reqcnt()
1367 spin_unlock(&zq->queue->lock); in zcrypt_perdev_reqcnt()
1378 struct zcrypt_queue *zq; in zcrypt_pendingq_count() local
1385 for_each_zcrypt_queue(zq, zc) { in zcrypt_pendingq_count()
1386 if (AP_QID_QUEUE(zq->queue->qid) != ap_domain_index) in zcrypt_pendingq_count()
1388 spin_lock(&zq->queue->lock); in zcrypt_pendingq_count()
1389 pendingq_count += zq->queue->pendingq_count; in zcrypt_pendingq_count()
1390 spin_unlock(&zq->queue->lock); in zcrypt_pendingq_count()
1401 struct zcrypt_queue *zq; in zcrypt_requestq_count() local
1408 for_each_zcrypt_queue(zq, zc) { in zcrypt_requestq_count()
1409 if (AP_QID_QUEUE(zq->queue->qid) != ap_domain_index) in zcrypt_requestq_count()
1411 spin_lock(&zq->queue->lock); in zcrypt_requestq_count()
1412 requestq_count += zq->queue->requestq_count; in zcrypt_requestq_count()
1413 spin_unlock(&zq->queue->lock); in zcrypt_requestq_count()