Lines Matching defs:cpqary3p

29 uint8_t cpqary3_check_simple_ctlr_intr(cpqary3_t *cpqary3p);
30 uint8_t cpqary3_check_perf_ctlr_intr(cpqary3_t *cpqary3p);
31 uint8_t cpqary3_check_perf_e200_intr(cpqary3_t *cpqary3p);
44 cpqary3_check_simple_ctlr_intr(cpqary3_t *cpqary3p)
53 intr_pending_mask = cpqary3p->bddef->bd_intrpendmask;
56 (ddi_get32(cpqary3p->isr_handle, (uint32_t *)cpqary3p->isr)))
73 cpqary3_check_perf_ctlr_intr(cpqary3_t *cpqary3p)
80 if (0x1 & (ddi_get32(cpqary3p->isr_handle,
81 (uint32_t *)cpqary3p->isr))) {
99 cpqary3_check_perf_e200_intr(cpqary3_t *cpqary3p)
106 if (0x4 & (ddi_get32(cpqary3p->isr_handle,
107 (uint32_t *)cpqary3p->isr))) {
128 cpqary3_retrieve(cpqary3_t *cpqary3p)
142 RETURN_FAILURE_IF_NULL(cpqary3p);
145 replyq_ptr = (cpqary3_drvr_replyq_t *)cpqary3p->drvr_replyq;
146 CmdsOutMax = cpqary3p->ctlr_maxcmds;
160 cpqary3_cmdpvtp = &cpqary3p->cmdmemlistp->pool[
164 mutex_enter(&cpqary3p->sw_mutex);
166 mutex_exit(&cpqary3p->sw_mutex);
201 cpqary3_poll_retrieve(cpqary3_t *cpqary3p, uint32_t poll_tag)
210 RETURN_FAILURE_IF_NULL(cpqary3p);
213 replyq_ptr = (cpqary3_drvr_replyq_t *)cpqary3p->drvr_replyq;
214 CmdsOutMax = cpqary3p->cmdmemlistp->max_memcnt;
216 if (!(cpqary3p->bddef->bd_flags & SA_BD_SAS)) {
217 while ((tag = ddi_get32(cpqary3p->opq_handle,
218 (uint32_t *)cpqary3p->opq)) != 0xFFFFFFFF) {
219 cpqary3_cmdpvtp = &cpqary3p->cmdmemlistp->pool[
242 cpqary3_cmdpvtp = &cpqary3p->cmdmemlistp->pool[
288 cpqary3_submit(cpqary3_t *cpqary3p, uint32_t cmd_phyaddr)
298 ASSERT(cpqary3p != NULL);
311 ddi_put32(cpqary3p->ipq_handle, (uint32_t *)cpqary3p->ipq, cmd_phyaddr);
317 if (cpqary3p->controller_lockup == CPQARY3_TRUE) {
323 if (!(cpqary3p->bddef->bd_flags & SA_BD_SAS)) {
324 ddi_put32(cpqary3p->ipq_handle,
325 (uint32_t *)cpqary3p->ipq, cmd_phyaddr);
329 ddi_put32(cpqary3p->ipq_handle,
330 (uint32_t *)cpqary3p->ipq, phys_addr);
359 cpqary3_intr_onoff(cpqary3_t *cpqary3p, uint8_t flag)
370 ASSERT(cpqary3p != NULL);
372 intr = ddi_get32(cpqary3p->imr_handle, (uint32_t *)cpqary3p->imr);
373 intr_mask = cpqary3p->bddef->bd_intrmask;
376 ddi_put32(cpqary3p->imr_handle,
377 (uint32_t *)cpqary3p->imr, intr & ~(intr_mask));
379 ddi_put32(cpqary3p->imr_handle,
380 (uint32_t *)cpqary3p->imr, (intr | intr_mask));
396 cpqary3_lockup_intr_onoff(cpqary3_t *cpqary3p, uint8_t flag)
407 ASSERT(cpqary3p != NULL);
409 intr = ddi_get32(cpqary3p->imr_handle, (uint32_t *)cpqary3p->imr);
410 intr_lockup_mask = cpqary3p->bddef->bd_lockup_intrmask;
413 ddi_put32(cpqary3p->imr_handle,
414 (uint32_t *)cpqary3p->imr, intr & ~(intr_lockup_mask));
416 ddi_put32(cpqary3p->imr_handle,
417 (uint32_t *)cpqary3p->imr, (intr | intr_lockup_mask));
434 cpqary3_init_ctlr(cpqary3_t *cpqary3p)
457 RETURN_FAILURE_IF_NULL(cpqary3p);
458 ctp = (CfgTable_t *)cpqary3p->ct;
459 perf_cfg = (CfgTrans_Perf_t *)cpqary3p->cp;
462 cpqary3p->drvr_replyq =
466 if (!cpqary3_check_ctlr_init(cpqary3p))
478 if (DDI_GET8(cpqary3p, &ctp->Signature[cntr]) !=
488 if (!(cpqary3p->bddef->bd_flags & SA_BD_SAS)) {
489 CmdsOutMax = DDI_GET32(cpqary3p, &ctp->CmdsOutMax);
499 cpqary3p->ctlr_maxcmds = CmdsOutMax;
500 cpqary3p->sg_cnt = CPQARY3_SG_CNT;
502 queue_depth = cpqary3p->ctlr_maxcmds;
505 cpqary3p->drvr_replyq->cyclic_indicator =
507 cpqary3p->drvr_replyq->simple_cyclic_indicator =
509 cpqary3p->drvr_replyq->max_index = cpqary3p->ctlr_maxcmds;
510 cpqary3p->drvr_replyq->simple_index = 0;
513 cpqary3p->drvr_replyq->replyq_headptr =
516 cpqary3p->drvr_replyq->replyq_simple_ptr =
519 cpqary3p->drvr_replyq->replyq_start_addr = replyq_start_addr;
526 if (!(DDI_GET32(cpqary3p, &ctp->TransportSupport) &
542 DDI_PUT32(cpqary3p, &ctp->HostWrite.TransportRequest,
544 ddi_put32(cpqary3p->idr_handle, (uint32_t *)cpqary3p->idr,
545 ddi_get32(cpqary3p->idr_handle, (uint32_t *)cpqary3p->idr) |
553 while (ddi_get32(cpqary3p->idr_handle,
554 (uint32_t *)cpqary3p->idr) & CFGTBL_ACC_CMDS) {
579 if (!(DDI_GET32(cpqary3p, &ctp->TransportActive) &
594 if (!(DDI_GET32(cpqary3p, &ctp->TransportActive) &
608 CmdsOutMax = DDI_GET32(cpqary3p, &ctp->CmdsOutMax);
617 cpqary3p->ctlr_maxcmds = CmdsOutMax;
623 DDI_PUT32(cpqary3p, &ctp->HostWrite.Upper32Addr, 0x00000000);
624 cpqary3p->heartbeat = DDI_GET32(cpqary3p, &ctp->HeartBeat);
627 cpqary3p->check_ctlr_intr = cpqary3_check_simple_ctlr_intr;
629 cpqary3p->host_support =
630 DDI_GET32(cpqary3p, &ctp->HostDrvrSupport);
631 DDI_PUT32(cpqary3p, &ctp->HostDrvrSupport,
632 (cpqary3p->host_support | 0x4));
633 cpqary3p->host_support =
634 DDI_GET32(cpqary3p, &ctp->HostDrvrSupport);
636 cpqary3p->lockup_logged = CPQARY3_FALSE;
643 if (!(DDI_GET32(cpqary3p, &ctp->TransportSupport)
652 CmdsOutMax = DDI_GET32(cpqary3p, &ctp->MaxPerfModeCmdsOutMax);
654 CmdsOutMax = DDI_GET32(cpqary3p, &ctp->CmdsOutMax);
663 cpqary3p->ctlr_maxcmds = CmdsOutMax;
668 queue_depth = cpqary3p->ctlr_maxcmds;
670 DDI_PUT32_CP(cpqary3p, &perf_cfg->ReplyQSize, queue_depth);
671 DDI_PUT32_CP(cpqary3p, &perf_cfg->ReplyQCount, 1);
672 DDI_PUT32_CP(cpqary3p, &perf_cfg->ReplyQCntrAddrLow32, 0);
673 DDI_PUT32_CP(cpqary3p, &perf_cfg->ReplyQCntrAddrHigh32, 0);
685 replyq_start_addr = cpqary3_alloc_phyctgs_mem(cpqary3p,
694 cpqary3p->drvr_replyq->replyq_headptr =
697 cpqary3p->drvr_replyq->index = 0;
698 cpqary3p->drvr_replyq->max_index = queue_depth;
699 cpqary3p->drvr_replyq->replyq_start_addr = replyq_start_addr;
700 cpqary3p->drvr_replyq->cyclic_indicator =
702 cpqary3p->drvr_replyq->replyq_start_paddr = phy_addr;
704 DDI_PUT32_CP(cpqary3p, &perf_cfg->ReplyQAddr0Low32, phy_addr);
705 DDI_PUT32_CP(cpqary3p, &perf_cfg->ReplyQAddr0High32, 0);
708 DDI_GET32(cpqary3p, &ctp->MaxBlockFetchCount);
732 DDI_PUT32_CP(cpqary3p, &perf_cfg->BlockFetchCnt[0],
734 DDI_PUT32(cpqary3p, &ctp->HostWrite.TransportRequest,
736 ddi_put32(cpqary3p->idr_handle, (uint32_t *)cpqary3p->idr,
737 ddi_get32(cpqary3p->idr_handle, (uint32_t *)cpqary3p->idr) |
745 while (ddi_get32(cpqary3p->idr_handle,
746 (uint32_t *)cpqary3p->idr) & CFGTBL_ACC_CMDS) {
771 if (!(DDI_GET32(cpqary3p, &ctp->TransportActive) &
787 if (!(DDI_GET32(cpqary3p, &ctp->TransportActive) &
799 CmdsOutMax = DDI_GET32(cpqary3p, &ctp->MaxPerfModeCmdsOutMax);
801 CmdsOutMax = DDI_GET32(cpqary3p, &ctp->CmdsOutMax);
811 cpqary3p->ctlr_maxcmds = CmdsOutMax;
814 max_sg_cnt = DDI_GET32(cpqary3p, &ctp->MaxSGElements);
816 DDI_GET32(cpqary3p, &ctp->MaxBlockFetchCount);
825 cpqary3p->sg_cnt = CPQARY3_PERF_SG_CNT;
842 cpqary3p->sg_cnt = MIN(max_sg_cnt, optimal_sg);
844 if (cpqary3p->sg_cnt > MAX_PERF_SG_CNT)
845 cpqary3p->sg_cnt = MAX_PERF_SG_CNT;
854 DDI_PUT32(cpqary3p, &ctp->HostWrite.Upper32Addr, 0x00000000);
855 cpqary3p->heartbeat = DDI_GET32(cpqary3p, &ctp->HeartBeat);
859 if (cpqary3p->bddef->bd_is_e200) {
860 cpqary3p->check_ctlr_intr =
863 cpqary3p->check_ctlr_intr =
867 if ((!cpqary3p->bddef->bd_is_e200) &&
868 (!cpqary3p->bddef->bd_is_ssll)) {
869 cpqary3p->host_support =
870 DDI_GET32(cpqary3p, &ctp->HostDrvrSupport);
871 DDI_PUT32(cpqary3p, &ctp->HostDrvrSupport,
872 (cpqary3p->host_support | 0x4));
874 cpqary3p->host_support =
875 DDI_GET32(cpqary3p, &ctp->HostDrvrSupport);
876 cpqary3p->lockup_logged = CPQARY3_FALSE;
891 cpqary3_check_ctlr_init(cpqary3_t *cpqary3p)
899 RETURN_FAILURE_IF_NULL(cpqary3p);
909 retvalue = ddi_regs_map_setup(cpqary3p->dip, INDEX_PCI_BASE0,
937 "the connections", cpqary3p->hba_name);