Lines Matching defs:hca

462 #define	DAPLKA_HOLD_HCA_WITHOUT_LOCK(hca)	((hca)->hca_ref_cnt++)
463 #define DAPLKA_RELE_HCA_WITHOUT_LOCK(hca) ((hca)->hca_ref_cnt--)
465 #define DAPLKA_HOLD_HCA(dp, hca) { \
467 DAPLKA_HOLD_HCA_WITHOUT_LOCK(hca); \
471 #define DAPLKA_RELE_HCA(dp, hca) { \
473 DAPLKA_RELE_HCA_WITHOUT_LOCK(hca); \
477 #define DAPLKA_HCA_BUSY(hca) \
478 ((hca)->hca_ref_cnt != 0 || \
479 (hca)->hca_qp_count != 0 || \
480 (hca)->hca_cq_count != 0 || \
481 (hca)->hca_pd_count != 0 || \
482 (hca)->hca_mw_count != 0 || \
483 (hca)->hca_mr_count != 0)
657 daplka_enqueue_hca(daplka_t *dp, daplka_hca_t *hca)
664 dp->daplka_hca_list_head = hca;
670 h->hca_next = hca;
675 daplka_dequeue_hca(daplka_t *dp, daplka_hca_t *hca)
681 if (dp->daplka_hca_list_head == hca)
682 dp->daplka_hca_list_head = hca->hca_next;
685 while (h->hca_next != hca)
687 h->hca_next = hca->hca_next;
694 daplka_hca_t *hca;
700 hca = kmem_zalloc(sizeof (daplka_hca_t), KM_SLEEP);
702 hca->hca_guid = hca_guid;
707 status = ibt_open_hca(dp->daplka_clnt_hdl, hca_guid, &hca->hca_hdl);
714 kmem_free(hca, sizeof (daplka_hca_t));
721 status = ibt_query_hca(hca->hca_hdl, &hca->hca_attr);
731 status = ibt_query_hca_ports(hca->hca_hdl,
732 0, &pinfop, &hca->hca_nports, &size);
739 hca->hca_ports = pinfop;
740 hca->hca_pinfosz = size;
742 DERR("hca guid 0x%llx, nports %d\n",
743 (longlong_t)hca_guid, hca->hca_nports);
744 for (j = 0; j < hca->hca_nports; j++) {
753 daplka_enqueue_hca(dp, hca);
759 (void) ibt_close_hca(hca->hca_hdl);
760 kmem_free(hca, sizeof (daplka_hca_t));
800 daplka_fini_hca(daplka_t *dp, daplka_hca_t *hca)
804 if (hca->hca_hdl != NULL) {
805 status = ibt_close_hca(hca->hca_hdl);
809 (longlong_t)hca->hca_guid);
812 daplka_enqueue_hca(dp, hca);
819 if (hca->hca_ports != NULL)
820 ibt_free_portinfo(hca->hca_ports, hca->hca_pinfosz);
822 kmem_free(hca, sizeof (daplka_hca_t));
833 daplka_hca_t *hca;
836 while ((hca = dp->daplka_hca_list_head) != NULL) {
837 if (DAPLKA_HCA_BUSY(hca)) {
841 daplka_dequeue_hca(daplka_dev, hca);
844 if ((status = daplka_fini_hca(dp, hca)) != IBT_SUCCESS)
4384 * returns a list of hca attributes
4641 /* Pass the service driver mr cleanup handler to the hca driver */
4897 /* Pass the service driver mr cleanup handler to the hca driver */
5116 /* Pass the service driver mr cleanup handler to the hca driver */
7489 daplka_hca_t *hca;
7504 * find the hca with the matching guid
7507 for (hca = daplka_dev->daplka_hca_list_head; hca != NULL;
7508 hca = hca->hca_next) {
7509 if (hca->hca_guid == args.ia_guid) {
7510 DAPLKA_HOLD_HCA_WITHOUT_LOCK(hca);
7516 if (hca == NULL) {
7525 if (args.ia_port > hca->hca_nports) {
7527 DAPLKA_RELE_HCA(daplka_dev, hca);
7530 hca_hdl = hca->hca_hdl;
7533 DAPLKA_RELE_HCA(daplka_dev, hca);
7541 DAPLKA_RELE_HCA(daplka_dev, hca);
7555 ia_rp->ia_hca = hca;
7917 * to the hca/port for which we got the event
7940 daplka_hca_t *hca;
7943 * find the hca with the matching guid
7946 for (hca = daplka_dev->daplka_hca_list_head; hca != NULL;
7947 hca = hca->hca_next) {
7948 if (hca->hca_guid == event->ev_hca_guid) {
7949 if (DAPLKA_HCA_BUSY(hca)) {
7953 daplka_dequeue_hca(daplka_dev, hca);
7959 if (hca == NULL)
7962 return (daplka_fini_hca(daplka_dev, hca));
8006 /* Free all hca resources and close the HCA. */