s390/ap: introduce new ap function ap_get_qdev()
authorHarald Freudenberger <freude@linux.ibm.com>
Fri, 8 May 2020 13:51:19 +0000 (15:51 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 20 May 2020 08:22:51 +0000 (10:22 +0200)
commitbc4b295e87a86bf14333753daeb1c84909197c46
tree97aba2dd14759acde3f150e3436c667f8df5fd47
parentd03756aa0535f347f321c681ab0ca0fc7ba335bc
s390/ap: introduce new ap function ap_get_qdev()

Provide a new interface function to be used by the ap drivers:
  struct ap_queue *ap_get_qdev(ap_qid_t qid);
Returns ptr to the struct ap_queue device or NULL if there
was no ap_queue device with this qid found. When something is
found, the reference count of the embedded device is increased.
So the caller has to decrease the reference count after use
with a call to put_device(&aq->ap_dev.device).

With this patch also the ap_card_list is removed from the
ap core code and a new hashtable is introduced which stores
hnodes of all the ap queues known to the ap bus.

The hashtable approach and a first implementation of this
interface comes from a previous patch from
Anthony Krowiak and an idea from Halil Pasic.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Suggested-by: Tony Krowiak <akrowiak@linux.ibm.com>
Suggested-by: Halil Pasic <pasic@linux.ibm.com>
Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
drivers/s390/crypto/ap_bus.c
drivers/s390/crypto/ap_bus.h
drivers/s390/crypto/ap_card.c
drivers/s390/crypto/ap_queue.c