Lines Matching refs:ctlp
710 CONTROLLER_t *ctlp = rp->rp_ctlp; in rpfree() local
712 atomic_subtract_32(&ctlp->free, 1); in rpfree()
716 rp_attachcommon(CONTROLLER_T *ctlp, int num_aiops, int num_ports) in rp_attachcommon() argument
726 unit = device_get_unit(ctlp->dev); in rp_attachcommon()
731 ctlp->num_ports = num_ports; in rp_attachcommon()
732 ctlp->rp = rp = (struct rp_port *) in rp_attachcommon()
735 device_printf(ctlp->dev, "rp_attachcommon: Could not malloc rp_ports structures.\n"); in rp_attachcommon()
742 num_chan = sGetAiopNumChan(ctlp, aiop); in rp_attachcommon()
747 rp->rp_ctlp = ctlp; in rp_attachcommon()
757 if(sInitChan(ctlp, &rp->rp_channel, aiop, chan) == 0) { in rp_attachcommon()
758 device_printf(ctlp->dev, "RocketPort sInitChan(%d, %d, %d) failed.\n", in rp_attachcommon()
769 mtx_init(&ctlp->hwmtx, "rp_hwmtx", NULL, MTX_DEF); in rp_attachcommon()
770 ctlp->hwmtx_init = 1; in rp_attachcommon()
774 rp_releaseresource(ctlp); in rp_attachcommon()
780 rp_releaseresource(CONTROLLER_t *ctlp) in rp_releaseresource() argument
785 if (ctlp->rp != NULL) { in rp_releaseresource()
786 for (i = 0; i < ctlp->num_ports; i++) { in rp_releaseresource()
787 rp = ctlp->rp + i; in rp_releaseresource()
788 atomic_add_32(&ctlp->free, 1); in rp_releaseresource()
792 free(ctlp->rp, M_DEVBUF); in rp_releaseresource()
793 ctlp->rp = NULL; in rp_releaseresource()
796 while (ctlp->free != 0) { in rp_releaseresource()
800 if (ctlp->hwmtx_init) in rp_releaseresource()
801 mtx_destroy(&ctlp->hwmtx); in rp_releaseresource()