Lines Matching refs:pmcsc

163 #define AG_GET_DONE_PCCB(pccb, pmcsc)            \  argument
165 AG_LOCAL_LOCK(&pmcsc->doneLock); \
166 pccb = pmcsc->ccbDoneHead; \
169 pmcsc->ccbDoneHead = NULL; \
170 pmcsc->ccbDoneTail = NULL; \
171 AG_LOCAL_UNLOCK(&pmcsc->doneLock); \
172 agtiapi_Done(pmcsc, pccb); \
175 AG_LOCAL_UNLOCK(&pmcsc->doneLock); \
178 #define AG_GET_DONE_SMP_PCCB(pccb, pmcsc) \ argument
180 AG_LOCAL_LOCK(&pmcsc->doneSMPLock); \
181 pccb = pmcsc->smpDoneHead; \
184 pmcsc->smpDoneHead = NULL; \
185 pmcsc->smpDoneTail = NULL; \
186 AG_LOCAL_UNLOCK(&pmcsc->doneSMPLock); \
187 agtiapi_SMPDone(pmcsc, pccb); \
190 AG_LOCAL_UNLOCK(&pmcsc->doneSMPLock); \
1589 int agtiapi_alloc_requests( struct agtiapi_softc *pmcsc ) in agtiapi_alloc_requests() argument
1614 &pmcsc->pCardInfo->pmIOLock, // lockarg in agtiapi_alloc_requests()
1615 &pmcsc->buffer_dmat ) ) { in agtiapi_alloc_requests()
1638 &pmcsc->tisgl_dmat ) ) { in agtiapi_alloc_requests()
1643 if( bus_dmamem_alloc( pmcsc->tisgl_dmat, in agtiapi_alloc_requests()
1644 (void **)&pmcsc->tisgl_mem, in agtiapi_alloc_requests()
1646 &pmcsc->tisgl_map ) ) { in agtiapi_alloc_requests()
1651 bzero( pmcsc->tisgl_mem, rsize ); in agtiapi_alloc_requests()
1652 bus_dmamap_load( pmcsc->tisgl_dmat, in agtiapi_alloc_requests()
1653 pmcsc->tisgl_map, in agtiapi_alloc_requests()
1654 pmcsc->tisgl_mem, in agtiapi_alloc_requests()
1657 &pmcsc->tisgl_busaddr, in agtiapi_alloc_requests()
1660 mtx_init( &pmcsc->OS_timer_lock, "OS timer lock", NULL, MTX_DEF ); in agtiapi_alloc_requests()
1661 mtx_init( &pmcsc->IO_timer_lock, "IO timer lock", NULL, MTX_DEF ); in agtiapi_alloc_requests()
1662 mtx_init( &pmcsc->devRmTimerLock, "targ rm timer lock", NULL, MTX_DEF ); in agtiapi_alloc_requests()
1663 callout_init_mtx( &pmcsc->OS_timer, &pmcsc->OS_timer_lock, 0 ); in agtiapi_alloc_requests()
1664 callout_init_mtx( &pmcsc->IO_timer, &pmcsc->IO_timer_lock, 0 ); in agtiapi_alloc_requests()
1665 callout_init_mtx( &pmcsc->devRmTimer, in agtiapi_alloc_requests()
1666 &pmcsc->devRmTimerLock, 0); in agtiapi_alloc_requests()
1668 next_tick = pmcsc->pCardInfo->tiRscInfo.tiLoLevelResource. in agtiapi_alloc_requests()
1672 callout_reset( &pmcsc->OS_timer, next_tick, agtiapi_TITimer, pmcsc ); in agtiapi_alloc_requests()
1689 int agtiapi_alloc_ostimem( struct agtiapi_softc *pmcsc ) { in agtiapi_alloc_ostimem() argument
1709 &pmcsc->osti_dmat ) ) { in agtiapi_alloc_ostimem()
1715 if( bus_dmamem_alloc( pmcsc->osti_dmat, in agtiapi_alloc_ostimem()
1716 &pmcsc->osti_mem, in agtiapi_alloc_ostimem()
1718 &pmcsc->osti_mapp ) ) { in agtiapi_alloc_ostimem()
1725 bus_dmamap_load( pmcsc->osti_dmat, in agtiapi_alloc_ostimem()
1726 pmcsc->osti_mapp, in agtiapi_alloc_ostimem()
1727 pmcsc->osti_mem, in agtiapi_alloc_ostimem()
1730 &pmcsc->osti_busaddr, in agtiapi_alloc_ostimem()
1736 ag_card_info_t *pCardInfo = pmcsc->pCardInfo; in agtiapi_alloc_ostimem()
1741 pMem->nocache_busaddr = pmcsc->osti_busaddr + ( idx * nomsize ); in agtiapi_alloc_ostimem()
1742 pMem->nocache_mem = (void*)((U64)pmcsc->osti_mem + ( idx * nomsize )); in agtiapi_alloc_ostimem()
1765 struct agtiapi_softc *pmcsc; in agtiapi_cam_action() local
1773 pmcsc = cam_sim_softc( sim ); in agtiapi_cam_action()
1774 AGTIAPI_IO( "agtiapi_cam_action: start pmcs %p\n", pmcsc ); in agtiapi_cam_action()
1776 if (pmcsc == agNULL) in agtiapi_cam_action()
1781 mtx_assert( &(pmcsc->pCardInfo->pmIOLock), MA_OWNED ); in agtiapi_cam_action()
1783 …AGTIAPI_IO( "agtiapi_cam_action: cardNO %d func_code 0x%x\n", pmcsc->cardNo, ccb->ccb_h.func_code … in agtiapi_cam_action()
1830 if ( pmcsc->flags & AGTIAPI_SHUT_DOWN ) in agtiapi_cam_action()
1847 if (pmcsc != NULL && targetID >= 0 && targetID < maxTargets) in agtiapi_cam_action()
1849 if (pmcsc->pWWNList != NULL) in agtiapi_cam_action()
1851 TID = INDEX(pmcsc, targetID); in agtiapi_cam_action()
1854 pDevHandle = pmcsc->pDevList[TID].pDevHandle; in agtiapi_cam_action()
1860 tiINIGetDeviceInfo( &pmcsc->tiRoot, pDevHandle, &devInfo ); in agtiapi_cam_action()
1883 lRetVal = agtiapi_eh_HostReset( pmcsc, ccb ); // usually works first time in agtiapi_cam_action()
1908 agtiapi_QueueSMP( pmcsc, ccb ); in agtiapi_cam_action()
1914 if(pmcsc->dev_scan == agFALSE) in agtiapi_cam_action()
1919 if (pmcsc->flags & AGTIAPI_SHUT_DOWN) in agtiapi_cam_action()
1930 agtiapi_QueueCmnd_( pmcsc, ccb ); in agtiapi_cam_action()
1967 STATIC pccb_t agtiapi_GetCCB( struct agtiapi_softc *pmcsc ) in agtiapi_GetCCB() argument
1973 AG_LOCAL_LOCK( &pmcsc->ccbLock ); in agtiapi_GetCCB()
1976 if ((pccb = (pccb_t)pmcsc->ccbFreeList) != NULL) in agtiapi_GetCCB()
1978 pmcsc->ccbFreeList = (caddr_t *)pccb->pccbNext; in agtiapi_GetCCB()
1982 pmcsc->activeCCB++; in agtiapi_GetCCB()
1990 AG_LOCAL_UNLOCK( &pmcsc->ccbLock ); in agtiapi_GetCCB()
2007 int agtiapi_QueueCmnd_(struct agtiapi_softc *pmcsc, union ccb * ccb) in agtiapi_QueueCmnd_() argument
2039 if ((pccb = agtiapi_GetCCB(pmcsc)) == NULL) in agtiapi_QueueCmnd_()
2042 if (pmcsc != NULL) in agtiapi_QueueCmnd_()
2045 TID = INDEX(pmcsc, TID); in agtiapi_QueueCmnd_()
2046 targ = &pmcsc->pDevList[TID]; in agtiapi_QueueCmnd_()
2055 pccb->pmcsc = pmcsc; in agtiapi_QueueCmnd_()
2069 status = agtiapi_PrepareSGList(pmcsc, pccb); in agtiapi_QueueCmnd_()
2073 agtiapi_FreeCCB(pmcsc, pccb); in agtiapi_QueueCmnd_()
2158 int agtiapi_DoSoftReset (struct agtiapi_softc *pmcsc) in agtiapi_DoSoftReset() argument
2163 pmcsc->flags |= AGTIAPI_SOFT_RESET; in agtiapi_DoSoftReset()
2165 ret = agtiapi_ResetCard( pmcsc, &flags ); in agtiapi_DoSoftReset()
2188 struct agtiapi_softc *pmcsc; in agtiapi_CheckIOTimeout() local
2191 pmcsc = (struct agtiapi_softc *)data; in agtiapi_CheckIOTimeout()
2197 pccb = (pccb_t)pmcsc->ccbChainList; in agtiapi_CheckIOTimeout()
2200 if ((pccb == NULL) || (pmcsc->activeCCB == 0)) in agtiapi_CheckIOTimeout()
2207 if (pmcsc->flags & AGTIAPI_SHUT_DOWN) in agtiapi_CheckIOTimeout()
2231 status = agtiapi_StartTM(pmcsc, pccb_curr); in agtiapi_CheckIOTimeout()
2247 agtiapi_DoSoftReset (pmcsc); in agtiapi_CheckIOTimeout()
2255 callout_reset(&pmcsc->IO_timer, 1*hz, agtiapi_CheckIOTimeout, pmcsc); in agtiapi_CheckIOTimeout()
2329 pTMccb->pmcsc = pCard; in agtiapi_StartTM()
2413 static int agtiapi_PrepareSGList(struct agtiapi_softc *pmcsc, ccb_t *pccb) in agtiapi_PrepareSGList() argument
2434 error = bus_dmamap_load( pmcsc->buffer_dmat, in agtiapi_PrepareSGList()
2447 xpt_freeze_simq(pmcsc->sim, 1); in agtiapi_PrepareSGList()
2448 pmcsc->SimQFrozen = agTRUE; in agtiapi_PrepareSGList()
2489 static int agtiapi_PrepareSGList(struct agtiapi_softc *pmcsc, ccb_t *pccb) in agtiapi_PrepareSGList() argument
2509 error = bus_dmamap_load( pmcsc->buffer_dmat, in agtiapi_PrepareSGList()
2522 xpt_freeze_simq(pmcsc->sim, 1); in agtiapi_PrepareSGList()
2523 pmcsc->SimQFrozen = agTRUE; in agtiapi_PrepareSGList()
2578 struct agtiapi_softc *pmcsc; in agtiapi_PrepareSGListCB() local
2591 pmcsc = pccb->pmcsc; in agtiapi_PrepareSGListCB()
2602 bus_dmamap_unload(pmcsc->buffer_dmat, pccb->CCB_dmamap); in agtiapi_PrepareSGListCB()
2603 agtiapi_FreeCCB(pmcsc, pccb); in agtiapi_PrepareSGListCB()
2618 bus_dmamap_unload(pmcsc->buffer_dmat, pccb->CCB_dmamap); in agtiapi_PrepareSGListCB()
2619 agtiapi_FreeCCB(pmcsc, pccb); in agtiapi_PrepareSGListCB()
2787 agtiapi_FreeCCB(pmcsc, pccb); in agtiapi_PrepareSGListCB()
2793 if (INDEX(pmcsc, pccb->targetId) >= maxTargets) in agtiapi_PrepareSGListCB()
2797 agtiapi_FreeCCB(pmcsc, pccb); in agtiapi_PrepareSGListCB()
2803 pDev = &pmcsc->pDevList[INDEX(pmcsc, pccb->targetId)]; in agtiapi_PrepareSGListCB()
2806 if ((pmcsc->flags & EDC_DATA) && in agtiapi_PrepareSGListCB()
2990 bus_dmamap_sync(pmcsc->buffer_dmat, pccb->CCB_dmamap, op); in agtiapi_PrepareSGListCB()
3001 agtiapi_FreeCCB(pmcsc, pccb); in agtiapi_PrepareSGListCB()
3007 TID = INDEX(pmcsc, pccb->targetId); in agtiapi_PrepareSGListCB()
3008 if ((TID >= pmcsc->devDiscover) || in agtiapi_PrepareSGListCB()
3009 !(pccb->devHandle = pmcsc->pDevList[TID].pDevHandle)) in agtiapi_PrepareSGListCB()
3019 agtiapi_FreeCCB(pmcsc, pccb); in agtiapi_PrepareSGListCB()
3027 pccb->devHandle, pccb->targetId, TID, pmcsc->devDiscover, in agtiapi_PrepareSGListCB()
3028 pmcsc ); in agtiapi_PrepareSGListCB()
3030 if(pmcsc->encrypt && io_is_encryptable) { in agtiapi_PrepareSGListCB()
3031 agtiapi_SetupEncryptedIO(pmcsc, pccb, start_lba); in agtiapi_PrepareSGListCB()
3038 agtiapi_QueueCCB( pmcsc, &pmcsc->ccbSendHead, &pmcsc->ccbSendTail in agtiapi_PrepareSGListCB()
3039 AG_CARD_LOCAL_LOCK(&pmcsc->sendLock), pccb ); in agtiapi_PrepareSGListCB()
3040 agtiapi_StartIO(pmcsc); in agtiapi_PrepareSGListCB()
3054 STATIC void agtiapi_StartIO( struct agtiapi_softc *pmcsc ) in agtiapi_StartIO() argument
3062 AG_LOCAL_LOCK( &pmcsc->sendLock ); in agtiapi_StartIO()
3063 pccb = pmcsc->ccbSendHead; in agtiapi_StartIO()
3066 if ((pccb == NULL) || pmcsc->flags & AGTIAPI_RESET) in agtiapi_StartIO()
3068 AG_LOCAL_UNLOCK( &pmcsc->sendLock ); in agtiapi_StartIO()
3074 if (pmcsc != NULL && pccb->targetId >= 0 && pccb->targetId < maxTargets) in agtiapi_StartIO()
3076 TID = INDEX(pmcsc, pccb->targetId); in agtiapi_StartIO()
3077 targ = &pmcsc->pDevList[TID]; in agtiapi_StartIO()
3082 pmcsc->ccbSendHead = NULL; in agtiapi_StartIO()
3083 pmcsc->ccbSendTail = NULL; in agtiapi_StartIO()
3084 AG_LOCAL_UNLOCK( &pmcsc->sendLock ); in agtiapi_StartIO()
3131 agtiapi_Done( pmcsc, pccb ); in agtiapi_StartIO()
3138 status = agtiapi_FastIOTest( pmcsc, pccb ); in agtiapi_StartIO()
3140 status = tiINISuperIOStart( &pmcsc->tiRoot, in agtiapi_StartIO()
3166 agtiapi_LogEvent( pmcsc, in agtiapi_StartIO()
3175 agtiapi_Done(pmcsc, pccb); in agtiapi_StartIO()
3182 agtiapi_LogEvent( pmcsc, in agtiapi_StartIO()
3192 agtiapi_Done(pmcsc, pccb); in agtiapi_StartIO()
3199 agtiapi_LogEvent( pmcsc, in agtiapi_StartIO()
3211 agtiapi_Done(pmcsc, pccb); in agtiapi_StartIO()
3214 agtiapi_QueueCCB(pmcsc, &pmcsc->ccbSendHead, &pmcsc->ccbSendTail in agtiapi_StartIO()
3215 AG_CARD_LOCAL_LOCK(&pmcsc->sendLock), pccb); in agtiapi_StartIO()
3222 agtiapi_LogEvent(pmcsc, in agtiapi_StartIO()
3231 agtiapi_Done(pmcsc, pccb); in agtiapi_StartIO()
3237 agtiapi_LogEvent(pmcsc, in agtiapi_StartIO()
3246 agtiapi_Done(pmcsc, pccb); in agtiapi_StartIO()
3253 AG_GET_DONE_PCCB(pccb, pmcsc); in agtiapi_StartIO()
3267 STATIC void agtiapi_StartSMP(struct agtiapi_softc *pmcsc) in agtiapi_StartSMP() argument
3273 AG_LOCAL_LOCK(&pmcsc->sendSMPLock); in agtiapi_StartSMP()
3274 pccb = pmcsc->smpSendHead; in agtiapi_StartSMP()
3277 if ((pccb == NULL) || pmcsc->flags & AGTIAPI_RESET) in agtiapi_StartSMP()
3279 AG_LOCAL_UNLOCK(&pmcsc->sendSMPLock); in agtiapi_StartSMP()
3285 pmcsc->smpSendHead = NULL; in agtiapi_StartSMP()
3286 pmcsc->smpSendTail = NULL; in agtiapi_StartSMP()
3287 AG_LOCAL_UNLOCK(&pmcsc->sendSMPLock); in agtiapi_StartSMP()
3314 status = tiINISMPStart( &pmcsc->tiRoot, in agtiapi_StartSMP()
3329 agtiapi_QueueCCB(pmcsc, &pmcsc->smpSendHead, &pmcsc->smpSendTail in agtiapi_StartSMP()
3330 AG_CARD_LOCAL_LOCK(&pmcsc->sendSMPLock), pccb); in agtiapi_StartSMP()
3336 agtiapi_SMPDone(pmcsc, pccb); in agtiapi_StartSMP()
3342 agtiapi_SMPDone(pmcsc, pccb); in agtiapi_StartSMP()
3349 AG_GET_DONE_SMP_PCCB(pccb, pmcsc); in agtiapi_StartSMP()
3369 static int agtiapi_PrepareSMPSGList( struct agtiapi_softc *pmcsc, ccb_t *pccb ) in agtiapi_PrepareSMPSGList() argument
3409 error = bus_dmamap_load( pmcsc->buffer_dmat, in agtiapi_PrepareSMPSGList()
3428 xpt_freeze_simq( pmcsc->sim, 1 ); in agtiapi_PrepareSMPSGList()
3429 pmcsc->SimQFrozen = agTRUE; in agtiapi_PrepareSMPSGList()
3442 error = bus_dmamap_load( pmcsc->buffer_dmat, in agtiapi_PrepareSMPSGList()
3461 xpt_freeze_simq( pmcsc->sim, 1 ); in agtiapi_PrepareSMPSGList()
3462 pmcsc->SimQFrozen = agTRUE; in agtiapi_PrepareSMPSGList()
3501 static int agtiapi_PrepareSMPSGList( struct agtiapi_softc *pmcsc, ccb_t *pccb ) in agtiapi_PrepareSMPSGList() argument
3543 error = bus_dmamap_load( pmcsc->buffer_dmat, in agtiapi_PrepareSMPSGList()
3562 xpt_freeze_simq( pmcsc->sim, 1 ); in agtiapi_PrepareSMPSGList()
3563 pmcsc->SimQFrozen = agTRUE; in agtiapi_PrepareSMPSGList()
3576 error = bus_dmamap_load( pmcsc->buffer_dmat, in agtiapi_PrepareSMPSGList()
3595 xpt_freeze_simq( pmcsc->sim, 1 ); in agtiapi_PrepareSMPSGList()
3596 pmcsc->SimQFrozen = agTRUE; in agtiapi_PrepareSMPSGList()
3642 struct agtiapi_softc *pmcsc; in agtiapi_PrepareSMPSGListCB() local
3651 pmcsc = pccb->pmcsc; in agtiapi_PrepareSMPSGListCB()
3663 bus_dmamap_unload( pmcsc->buffer_dmat, pccb->CCB_dmamap ); in agtiapi_PrepareSMPSGListCB()
3664 agtiapi_FreeCCB( pmcsc, pccb ); in agtiapi_PrepareSMPSGListCB()
3679 bus_dmamap_unload( pmcsc->buffer_dmat, pccb->CCB_dmamap ); in agtiapi_PrepareSMPSGListCB()
3680 agtiapi_FreeCCB( pmcsc, pccb ); in agtiapi_PrepareSMPSGListCB()
3693 agtiapi_FreeCCB( pmcsc, pccb ); in agtiapi_PrepareSMPSGListCB()
3699 TID = INDEX( pmcsc, pccb->targetId ); in agtiapi_PrepareSMPSGListCB()
3700 if ( (TID >= pmcsc->devDiscover) || in agtiapi_PrepareSMPSGListCB()
3701 !(pccb->devHandle = pmcsc->pDevList[TID].pDevHandle) ) in agtiapi_PrepareSMPSGListCB()
3709 pmcsc->devDiscover, in agtiapi_PrepareSMPSGListCB()
3710 pmcsc, in agtiapi_PrepareSMPSGListCB()
3712 agtiapi_FreeCCB( pmcsc, pccb ); in agtiapi_PrepareSMPSGListCB()
3725 pmcsc->devDiscover, in agtiapi_PrepareSMPSGListCB()
3726 pmcsc ); in agtiapi_PrepareSMPSGListCB()
3728 tiExpPortalInfo = pmcsc->pDevList[TID].pPortalInfo; in agtiapi_PrepareSMPSGListCB()
3731 status = tiINIGetExpander( &pmcsc->tiRoot, in agtiapi_PrepareSMPSGListCB()
3740 agtiapi_FreeCCB( pmcsc, pccb ); in agtiapi_PrepareSMPSGListCB()
3750 agtiapi_QueueCCB( pmcsc, &pmcsc->smpSendHead, &pmcsc->smpSendTail in agtiapi_PrepareSMPSGListCB()
3751 AG_CARD_LOCAL_LOCK(&pmcsc->sendSMPLock), pccb ); in agtiapi_PrepareSMPSGListCB()
3753 agtiapi_StartSMP( pmcsc ); in agtiapi_PrepareSMPSGListCB()
3770 STATIC void agtiapi_Done(struct agtiapi_softc *pmcsc, ccb_t *pccb) in agtiapi_Done() argument
3784 if (agtiapi_CheckError(pmcsc, pccb_curr) != 0) in agtiapi_Done()
3796 CMND_DMA_UNMAP(pmcsc, ccb); in agtiapi_Done()
3800 agtiapi_FreeCCB(pmcsc, pccb_curr); in agtiapi_Done()
3820 STATIC void agtiapi_SMPDone(struct agtiapi_softc *pmcsc, ccb_t *pccb) in agtiapi_SMPDone() argument
3834 if (agtiapi_CheckSMPError(pmcsc, pccb_curr) != 0) in agtiapi_SMPDone()
3836 CMND_DMA_UNMAP(pmcsc, ccb); in agtiapi_SMPDone()
3840 agtiapi_FreeSMPCCB(pmcsc, pccb_curr); in agtiapi_SMPDone()
3905 STATIC U32 agtiapi_CheckError(struct agtiapi_softc *pmcsc, ccb_t *pccb) in agtiapi_CheckError() argument
3921 agtiapi_FreeCCB(pmcsc, pccb); in agtiapi_CheckError()
3927 if (pmcsc != NULL && pccb->targetId >= 0 && pccb->targetId < maxTargets) in agtiapi_CheckError()
3929 if (pmcsc->pWWNList != NULL) in agtiapi_CheckError()
3931 TID = INDEX(pmcsc, pccb->targetId); in agtiapi_CheckError()
3934 pDevice = &pmcsc->pDevList[TID]; in agtiapi_CheckError()
3945 agtiapi_FreeCCB(pmcsc, pccb); in agtiapi_CheckError()
3955 AG_LOCAL_LOCK(&pmcsc->freezeLock); in agtiapi_CheckError()
3956 if(pmcsc->freezeSim == agTRUE) in agtiapi_CheckError()
3958 pmcsc->freezeSim = agFALSE; in agtiapi_CheckError()
3959 xpt_release_simq(pmcsc->sim, 1); in agtiapi_CheckError()
3961 AG_LOCAL_UNLOCK(&pmcsc->freezeLock); in agtiapi_CheckError()
4018 AG_LOCAL_LOCK(&pmcsc->freezeLock); in agtiapi_CheckError()
4019 if(pmcsc->freezeSim == agFALSE) in agtiapi_CheckError()
4021 pmcsc->freezeSim = agTRUE; in agtiapi_CheckError()
4022 xpt_freeze_simq(pmcsc->sim, 1); in agtiapi_CheckError()
4024 AG_LOCAL_UNLOCK(&pmcsc->freezeLock); in agtiapi_CheckError()
4134 STATIC U32 agtiapi_CheckSMPError( struct agtiapi_softc *pmcsc, ccb_t *pccb ) in agtiapi_CheckSMPError() argument
4145 agtiapi_FreeSMPCCB(pmcsc, pccb); in agtiapi_CheckSMPError()
4206 STATIC void agtiapi_Retry(struct agtiapi_softc *pmcsc, ccb_t *pccb) in agtiapi_Retry() argument
4218 agtiapi_QueueCCB(pmcsc, &pmcsc->ccbSendHead, &pmcsc->ccbSendTail in agtiapi_Retry()
4219 AG_CARD_LOCAL_LOCK(&pmcsc->sendLock), pccb); in agtiapi_Retry()
4291 int agtiapi_eh_HostReset( struct agtiapi_softc *pmcsc, union ccb *cmnd ) in agtiapi_eh_HostReset() argument
4303 agtiapi_LogEvent( pmcsc, in agtiapi_eh_HostReset()
4311 return agtiapi_DoSoftReset( pmcsc ); in agtiapi_eh_HostReset()
4329 STATIC void agtiapi_QueueCCB( struct agtiapi_softc *pmcsc, in agtiapi_QueueCCB() argument
4374 static int agtiapi_QueueSMP(struct agtiapi_softc *pmcsc, union ccb * ccb) in agtiapi_QueueSMP() argument
4383 if ((pccb = agtiapi_GetCCB(pmcsc)) == NULL) in agtiapi_QueueSMP()
4390 pccb->pmcsc = pmcsc; in agtiapi_QueueSMP()
4396 status = agtiapi_PrepareSMPSGList(pmcsc, pccb); in agtiapi_QueueSMP()
4401 agtiapi_FreeCCB(pmcsc, pccb); in agtiapi_QueueSMP()
4469 STATIC void agtiapi_FreeCCB(struct agtiapi_softc *pmcsc, pccb_t pccb) in agtiapi_FreeCCB() argument
4474 AG_LOCAL_LOCK(&pmcsc->ccbLock); in agtiapi_FreeCCB()
4511 bus_dmamap_sync(pmcsc->buffer_dmat, pccb->CCB_dmamap, op); in agtiapi_FreeCCB()
4512 bus_dmamap_unload(pmcsc->buffer_dmat, pccb->CCB_dmamap); in agtiapi_FreeCCB()
4518 bus_dmamap_sync(pmcsc->buffer_dmat, pccb->CCB_dmamap, op); in agtiapi_FreeCCB()
4519 bus_dmamap_unload(pmcsc->buffer_dmat, pccb->CCB_dmamap); in agtiapi_FreeCCB()
4545 pci_free_consistent( pmcsc->pCardInfo->pPCIDev, in agtiapi_FreeCCB()
4564 if (pmcsc->encrypt) in agtiapi_FreeCCB()
4565 agtiapi_CleanupEncryptedIO(pmcsc, pccb); in agtiapi_FreeCCB()
4571 pccb->pccbNext = (pccb_t)pmcsc->ccbFreeList; in agtiapi_FreeCCB()
4572 pmcsc->ccbFreeList = (caddr_t *)pccb; in agtiapi_FreeCCB()
4574 pmcsc->activeCCB--; in agtiapi_FreeCCB()
4576 AG_LOCAL_UNLOCK(&pmcsc->ccbLock); in agtiapi_FreeCCB()
4647 STATIC void agtiapi_FreeSMPCCB(struct agtiapi_softc *pmcsc, pccb_t pccb) in agtiapi_FreeSMPCCB() argument
4652 AG_LOCAL_LOCK(&pmcsc->ccbLock); in agtiapi_FreeSMPCCB()
4674 bus_dmamap_sync(pmcsc->buffer_dmat, pccb->CCB_dmamap, op); in agtiapi_FreeSMPCCB()
4675 bus_dmamap_unload(pmcsc->buffer_dmat, pccb->CCB_dmamap); in agtiapi_FreeSMPCCB()
4681 bus_dmamap_sync(pmcsc->buffer_dmat, pccb->CCB_dmamap, op); in agtiapi_FreeSMPCCB()
4682 bus_dmamap_unload(pmcsc->buffer_dmat, pccb->CCB_dmamap); in agtiapi_FreeSMPCCB()
4697 pccb->pccbNext = (pccb_t)pmcsc->ccbFreeList; in agtiapi_FreeSMPCCB()
4698 pmcsc->ccbFreeList = (caddr_t *)pccb; in agtiapi_FreeSMPCCB()
4700 pmcsc->activeCCB--; in agtiapi_FreeSMPCCB()
4702 AG_LOCAL_UNLOCK(&pmcsc->ccbLock); in agtiapi_FreeSMPCCB()
4719 STATIC void agtiapi_FreeTMCCB(struct agtiapi_softc *pmcsc, pccb_t pccb) in agtiapi_FreeTMCCB() argument
4721 AG_LOCAL_LOCK(&pmcsc->ccbLock); in agtiapi_FreeTMCCB()
4735 pccb->pccbNext = (pccb_t)pmcsc->ccbFreeList; in agtiapi_FreeTMCCB()
4736 pmcsc->ccbFreeList = (caddr_t *)pccb; in agtiapi_FreeTMCCB()
4737 pmcsc->activeCCB--; in agtiapi_FreeTMCCB()
4738 AG_LOCAL_UNLOCK(&pmcsc->ccbLock); in agtiapi_FreeTMCCB()
5616 static void agtiapi_scan(struct agtiapi_softc *pmcsc) in agtiapi_scan() argument
5621 AGTIAPI_PRINTK("agtiapi_scan: start cardNO %d \n", pmcsc->cardNo); in agtiapi_scan()
5623 bus = cam_sim_path(pmcsc->sim); in agtiapi_scan()
5628 mtx_lock(&(pmcsc->pCardInfo->pmIOLock)); in agtiapi_scan()
5632 mtx_unlock(&(pmcsc->pCardInfo->pmIOLock)); in agtiapi_scan()
5638 mtx_unlock(&(pmcsc->pCardInfo->pmIOLock)); in agtiapi_scan()
5643 mtx_unlock(&(pmcsc->pCardInfo->pmIOLock)); in agtiapi_scan()
5644 pmcsc->dev_scan = agTRUE; in agtiapi_scan()