ibtl_impl.c (d1a5c838) ibtl_impl.c (76c04273)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 563 unchanged lines hidden (view full) ---

572 ibtl_clear_ibhw_status();
573 return (IBC_FAILURE);
574 }
575
576 ibtl_thread_init2();
577
578 /* Allocate the memory for per-client info structure */
579 hca_devp = kmem_zalloc(sizeof (ibtl_hca_devinfo_t) +
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 563 unchanged lines hidden (view full) ---

572 ibtl_clear_ibhw_status();
573 return (IBC_FAILURE);
574 }
575
576 ibtl_thread_init2();
577
578 /* Allocate the memory for per-client info structure */
579 hca_devp = kmem_zalloc(sizeof (ibtl_hca_devinfo_t) +
580 (nports - 1) * sizeof (ibtl_async_port_status_t), KM_SLEEP);
580 (nports - 1) * sizeof (ibtl_async_port_event_t), KM_SLEEP);
581
582 mutex_enter(&ibtl_clnt_list_mutex);
583
584 /* Update HCA dev info structure */
585 hca_devp->hd_ibc_hca_hdl = info_p->hca_handle;
586 hca_devp->hd_ibc_ops = info_p->hca_ops;
587 hca_devp->hd_hca_attr = info_p->hca_attr;
588 hca_devp->hd_hca_dip = info_p->hca_dip;
589
590 status = ibtl_init_hca_portinfo(hca_devp);
591 if (status != IBT_SUCCESS) {
592 mutex_exit(&ibtl_clnt_list_mutex);
593 IBTF_DPRINTF_L1(ibtf, "ibc_attach: call to ibc_query_hca_ports "
594 "failed: status = %d", status);
595 kmem_free(hca_devp, sizeof (ibtl_hca_devinfo_t) +
581
582 mutex_enter(&ibtl_clnt_list_mutex);
583
584 /* Update HCA dev info structure */
585 hca_devp->hd_ibc_hca_hdl = info_p->hca_handle;
586 hca_devp->hd_ibc_ops = info_p->hca_ops;
587 hca_devp->hd_hca_attr = info_p->hca_attr;
588 hca_devp->hd_hca_dip = info_p->hca_dip;
589
590 status = ibtl_init_hca_portinfo(hca_devp);
591 if (status != IBT_SUCCESS) {
592 mutex_exit(&ibtl_clnt_list_mutex);
593 IBTF_DPRINTF_L1(ibtf, "ibc_attach: call to ibc_query_hca_ports "
594 "failed: status = %d", status);
595 kmem_free(hca_devp, sizeof (ibtl_hca_devinfo_t) +
596 (nports - 1) * sizeof (ibtl_async_port_status_t));
596 (nports - 1) * sizeof (ibtl_async_port_event_t));
597 return (IBC_FAILURE);
598 }
599
600 /* Register the with MPxIO as PHCI */
601 if (ibtl_ibnex_phci_register(info_p->hca_dip) != IBT_SUCCESS) {
602 mutex_exit(&ibtl_clnt_list_mutex);
603 IBTF_DPRINTF_L1(ibtf, "ibc_attach: MPxIO register failed");
604 kmem_free(hca_devp, sizeof (ibtl_hca_devinfo_t) +
597 return (IBC_FAILURE);
598 }
599
600 /* Register the with MPxIO as PHCI */
601 if (ibtl_ibnex_phci_register(info_p->hca_dip) != IBT_SUCCESS) {
602 mutex_exit(&ibtl_clnt_list_mutex);
603 IBTF_DPRINTF_L1(ibtf, "ibc_attach: MPxIO register failed");
604 kmem_free(hca_devp, sizeof (ibtl_hca_devinfo_t) +
605 (nports - 1) * sizeof (ibtl_async_port_status_t));
605 (nports - 1) * sizeof (ibtl_async_port_event_t));
606 return (IBC_FAILURE);
607 }
608
609 /* Initialize the Client List for this HCA. */
610 hca_devp->hd_state = IBTL_HCA_DEV_ATTACHED;
611
612 /* lock out asyncs until after we announce the new HCA */
613 hca_devp->hd_async_busy = 1;

--- 194 unchanged lines hidden (view full) ---

808 kmem_free(hca_devp->hd_portinfop, hca_devp->hd_portinfo_len);
809 mutex_exit(&ibtl_clnt_list_mutex);
810
811 ibtl_kstat_fini(hca_devp);
812
813 /* Free up the memory of per-client info struct */
814 kmem_free(hca_devp, sizeof (ibtl_hca_devinfo_t) +
815 (hca_devp->hd_hca_attr->hca_nports - 1) *
606 return (IBC_FAILURE);
607 }
608
609 /* Initialize the Client List for this HCA. */
610 hca_devp->hd_state = IBTL_HCA_DEV_ATTACHED;
611
612 /* lock out asyncs until after we announce the new HCA */
613 hca_devp->hd_async_busy = 1;

--- 194 unchanged lines hidden (view full) ---

808 kmem_free(hca_devp->hd_portinfop, hca_devp->hd_portinfo_len);
809 mutex_exit(&ibtl_clnt_list_mutex);
810
811 ibtl_kstat_fini(hca_devp);
812
813 /* Free up the memory of per-client info struct */
814 kmem_free(hca_devp, sizeof (ibtl_hca_devinfo_t) +
815 (hca_devp->hd_hca_attr->hca_nports - 1) *
816 sizeof (ibtl_async_port_status_t));
816 sizeof (ibtl_async_port_event_t));
817 ibtl_clear_ibhw_status();
818}
819
820/*
821 * Function:
822 * ibt_ci_data_in()
823 *
824 * Input:

--- 521 unchanged lines hidden ---
817 ibtl_clear_ibhw_status();
818}
819
820/*
821 * Function:
822 * ibt_ci_data_in()
823 *
824 * Input:

--- 521 unchanged lines hidden ---