Lines Matching refs:CCB

229   BusLogic_CCB_T *CCB = (BusLogic_CCB_T *) BlockPointer;  in BusLogic_InitializeCCBs()  local
231 CCB->AllocationGroupHead = true; in BusLogic_InitializeCCBs()
234 CCB->Status = BusLogic_CCB_Free; in BusLogic_InitializeCCBs()
235 CCB->HostAdapter = HostAdapter; in BusLogic_InitializeCCBs()
238 CCB->CallbackFunction = BusLogic_QueueCompletedCCB; in BusLogic_InitializeCCBs()
239 CCB->BaseAddress = HostAdapter->FlashPointInfo.BaseAddress; in BusLogic_InitializeCCBs()
241 CCB->Next = HostAdapter->Free_CCBs; in BusLogic_InitializeCCBs()
242 CCB->NextAll = HostAdapter->All_CCBs; in BusLogic_InitializeCCBs()
243 HostAdapter->Free_CCBs = CCB; in BusLogic_InitializeCCBs()
244 HostAdapter->All_CCBs = CCB; in BusLogic_InitializeCCBs()
246 CCB++; in BusLogic_InitializeCCBs()
282 BusLogic_CCB_T *NextCCB = HostAdapter->All_CCBs, *CCB; in BusLogic_DestroyCCBs() local
285 while ((CCB = NextCCB) != NULL) in BusLogic_DestroyCCBs()
287 NextCCB = CCB->NextAll; in BusLogic_DestroyCCBs()
288 if (CCB->AllocationGroupHead) in BusLogic_DestroyCCBs()
289 kfree(CCB); in BusLogic_DestroyCCBs()
347 BusLogic_CCB_T *CCB; in BusLogic_AllocateCCB() local
348 CCB = HostAdapter->Free_CCBs; in BusLogic_AllocateCCB()
349 if (CCB != NULL) in BusLogic_AllocateCCB()
351 CCB->SerialNumber = ++SerialNumber; in BusLogic_AllocateCCB()
352 HostAdapter->Free_CCBs = CCB->Next; in BusLogic_AllocateCCB()
353 CCB->Next = NULL; in BusLogic_AllocateCCB()
358 return CCB; in BusLogic_AllocateCCB()
363 CCB = HostAdapter->Free_CCBs; in BusLogic_AllocateCCB()
364 if (CCB == NULL) return NULL; in BusLogic_AllocateCCB()
365 CCB->SerialNumber = ++SerialNumber; in BusLogic_AllocateCCB()
366 HostAdapter->Free_CCBs = CCB->Next; in BusLogic_AllocateCCB()
367 CCB->Next = NULL; in BusLogic_AllocateCCB()
368 return CCB; in BusLogic_AllocateCCB()
378 static void BusLogic_DeallocateCCB(BusLogic_CCB_T *CCB) in BusLogic_DeallocateCCB() argument
380 BusLogic_HostAdapter_T *HostAdapter = CCB->HostAdapter; in BusLogic_DeallocateCCB()
381 CCB->Command = NULL; in BusLogic_DeallocateCCB()
382 CCB->Status = BusLogic_CCB_Free; in BusLogic_DeallocateCCB()
383 CCB->Next = HostAdapter->Free_CCBs; in BusLogic_DeallocateCCB()
384 HostAdapter->Free_CCBs = CCB; in BusLogic_DeallocateCCB()
2903 static void BusLogic_QueueCompletedCCB(BusLogic_CCB_T *CCB) in BusLogic_QueueCompletedCCB() argument
2905 BusLogic_HostAdapter_T *HostAdapter = CCB->HostAdapter; in BusLogic_QueueCompletedCCB()
2906 CCB->Status = BusLogic_CCB_Completed; in BusLogic_QueueCompletedCCB()
2907 CCB->Next = NULL; in BusLogic_QueueCompletedCCB()
2910 HostAdapter->FirstCompletedCCB = CCB; in BusLogic_QueueCompletedCCB()
2911 HostAdapter->LastCompletedCCB = CCB; in BusLogic_QueueCompletedCCB()
2915 HostAdapter->LastCompletedCCB->Next = CCB; in BusLogic_QueueCompletedCCB()
2916 HostAdapter->LastCompletedCCB = CCB; in BusLogic_QueueCompletedCCB()
2918 HostAdapter->ActiveCommands[CCB->TargetID]--; in BusLogic_QueueCompletedCCB()
3006 BusLogic_CCB_T *CCB = (BusLogic_CCB_T *) in BusLogic_ScanIncomingMailboxes() local
3007 Bus_to_Virtual(NextIncomingMailbox->CCB); in BusLogic_ScanIncomingMailboxes()
3010 if (CCB->Status == BusLogic_CCB_Active || in BusLogic_ScanIncomingMailboxes()
3011 CCB->Status == BusLogic_CCB_Reset) in BusLogic_ScanIncomingMailboxes()
3017 CCB->CompletionCode = CompletionCode; in BusLogic_ScanIncomingMailboxes()
3018 BusLogic_QueueCompletedCCB(CCB); in BusLogic_ScanIncomingMailboxes()
3029 CCB->SerialNumber, CCB->Status); in BusLogic_ScanIncomingMailboxes()
3053 BusLogic_CCB_T *CCB = HostAdapter->FirstCompletedCCB; in BusLogic_ProcessCompletedCCBs() local
3054 SCSI_Command_T *Command = CCB->Command; in BusLogic_ProcessCompletedCCBs()
3055 HostAdapter->FirstCompletedCCB = CCB->Next; in BusLogic_ProcessCompletedCCBs()
3061 if (CCB->Opcode == BusLogic_BusDeviceReset) in BusLogic_ProcessCompletedCCBs()
3063 int TargetID = CCB->TargetID; in BusLogic_ProcessCompletedCCBs()
3066 CCB->SerialNumber, TargetID); in BusLogic_ProcessCompletedCCBs()
3075 BusLogic_DeallocateCCB(CCB); in BusLogic_ProcessCompletedCCBs()
3095 for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll) in BusLogic_ProcessCompletedCCBs()
3096 if (CCB->Status == BusLogic_CCB_Reset && CCB->TargetID == TargetID) in BusLogic_ProcessCompletedCCBs()
3098 Command = CCB->Command; in BusLogic_ProcessCompletedCCBs()
3099 BusLogic_DeallocateCCB(CCB); in BusLogic_ProcessCompletedCCBs()
3112 switch (CCB->CompletionCode) in BusLogic_ProcessCompletedCCBs()
3118 HostAdapter, CCB->SerialNumber, CCB->TargetID); in BusLogic_ProcessCompletedCCBs()
3121 HostAdapter->TargetStatistics[CCB->TargetID] in BusLogic_ProcessCompletedCCBs()
3123 HostAdapter->TargetFlags[CCB->TargetID] in BusLogic_ProcessCompletedCCBs()
3129 HostAdapter, CCB->SerialNumber, CCB->TargetID); in BusLogic_ProcessCompletedCCBs()
3131 &HostAdapter->TargetStatistics[CCB->TargetID] in BusLogic_ProcessCompletedCCBs()
3138 CCB->HostAdapterStatus, in BusLogic_ProcessCompletedCCBs()
3139 CCB->TargetDeviceStatus); in BusLogic_ProcessCompletedCCBs()
3140 if (CCB->HostAdapterStatus != BusLogic_SCSISelectionTimeout) in BusLogic_ProcessCompletedCCBs()
3142 HostAdapter->TargetStatistics[CCB->TargetID] in BusLogic_ProcessCompletedCCBs()
3150 HostAdapter, CCB->SerialNumber, in BusLogic_ProcessCompletedCCBs()
3151 CCB->TargetID, Command->result, in BusLogic_ProcessCompletedCCBs()
3152 CCB->HostAdapterStatus, in BusLogic_ProcessCompletedCCBs()
3153 CCB->TargetDeviceStatus); in BusLogic_ProcessCompletedCCBs()
3155 for (i = 0; i < CCB->CDB_Length; i++) in BusLogic_ProcessCompletedCCBs()
3156 BusLogic_Notice(" %02X", HostAdapter, CCB->CDB[i]); in BusLogic_ProcessCompletedCCBs()
3159 for (i = 0; i < CCB->SenseDataLength; i++) in BusLogic_ProcessCompletedCCBs()
3172 if (CCB->CDB[0] == INQUIRY && CCB->CDB[1] == 0 && in BusLogic_ProcessCompletedCCBs()
3173 CCB->HostAdapterStatus == BusLogic_CommandCompletedNormally) in BusLogic_ProcessCompletedCCBs()
3176 &HostAdapter->TargetFlags[CCB->TargetID]; in BusLogic_ProcessCompletedCCBs()
3186 BusLogic_DeallocateCCB(CCB); in BusLogic_ProcessCompletedCCBs()
3296 BusLogic_CCB_T *CCB) in BusLogic_WriteOutgoingMailbox() argument
3302 CCB->Status = BusLogic_CCB_Active; in BusLogic_WriteOutgoingMailbox()
3308 NextOutgoingMailbox->CCB = Virtual_to_Bus(CCB); in BusLogic_WriteOutgoingMailbox()
3316 HostAdapter->ActiveCommands[CCB->TargetID]++; in BusLogic_WriteOutgoingMailbox()
3317 if (CCB->Opcode != BusLogic_BusDeviceReset) in BusLogic_WriteOutgoingMailbox()
3318 HostAdapter->TargetStatistics[CCB->TargetID].CommandsAttempted++; in BusLogic_WriteOutgoingMailbox()
3348 BusLogic_CCB_T *CCB; in BusLogic_QueueCommand() local
3370 CCB = BusLogic_AllocateCCB(HostAdapter); in BusLogic_QueueCommand()
3371 if (CCB == NULL) in BusLogic_QueueCommand()
3374 CCB = BusLogic_AllocateCCB(HostAdapter); in BusLogic_QueueCommand()
3375 if (CCB == NULL) in BusLogic_QueueCommand()
3387 CCB->Opcode = BusLogic_InitiatorCCB; in BusLogic_QueueCommand()
3388 CCB->DataLength = BufferLength; in BusLogic_QueueCommand()
3389 CCB->DataPointer = Virtual_to_Bus(BufferPointer); in BusLogic_QueueCommand()
3395 CCB->Opcode = BusLogic_InitiatorCCB_ScatterGather; in BusLogic_QueueCommand()
3396 CCB->DataLength = SegmentCount * sizeof(BusLogic_ScatterGatherSegment_T); in BusLogic_QueueCommand()
3398 CCB->DataPointer = Virtual_to_Bus(CCB->ScatterGatherList); in BusLogic_QueueCommand()
3399 else CCB->DataPointer = Virtual_to_32Bit_Virtual(CCB->ScatterGatherList); in BusLogic_QueueCommand()
3402 CCB->ScatterGatherList[Segment].SegmentByteCount = in BusLogic_QueueCommand()
3404 CCB->ScatterGatherList[Segment].SegmentDataPointer = in BusLogic_QueueCommand()
3412 CCB->DataDirection = BusLogic_DataInLengthChecked; in BusLogic_QueueCommand()
3421 CCB->DataDirection = BusLogic_DataOutLengthChecked; in BusLogic_QueueCommand()
3429 CCB->DataDirection = BusLogic_UncheckedDataTransfer; in BusLogic_QueueCommand()
3432 CCB->CDB_Length = CDB_Length; in BusLogic_QueueCommand()
3433 CCB->SenseDataLength = sizeof(Command->sense_buffer); in BusLogic_QueueCommand()
3434 CCB->HostAdapterStatus = 0; in BusLogic_QueueCommand()
3435 CCB->TargetDeviceStatus = 0; in BusLogic_QueueCommand()
3436 CCB->TargetID = TargetID; in BusLogic_QueueCommand()
3437 CCB->LogicalUnit = LogicalUnit; in BusLogic_QueueCommand()
3438 CCB->TagEnable = false; in BusLogic_QueueCommand()
3439 CCB->LegacyTagEnable = false; in BusLogic_QueueCommand()
3490 CCB->TagEnable = true; in BusLogic_QueueCommand()
3491 CCB->QueueTag = QueueTag; in BusLogic_QueueCommand()
3495 CCB->LegacyTagEnable = true; in BusLogic_QueueCommand()
3496 CCB->LegacyQueueTag = QueueTag; in BusLogic_QueueCommand()
3499 memcpy(CCB->CDB, CDB, CDB_Length); in BusLogic_QueueCommand()
3500 CCB->SenseDataPointer = Virtual_to_Bus(&Command->sense_buffer); in BusLogic_QueueCommand()
3501 CCB->Command = Command; in BusLogic_QueueCommand()
3514 HostAdapter, BusLogic_MailboxStartCommand, CCB)) in BusLogic_QueueCommand()
3520 HostAdapter, BusLogic_MailboxStartCommand, CCB)) in BusLogic_QueueCommand()
3524 BusLogic_DeallocateCCB(CCB); in BusLogic_QueueCommand()
3535 CCB->Status = BusLogic_CCB_Active; in BusLogic_QueueCommand()
3538 FlashPoint_StartCCB(HostAdapter->CardHandle, CCB); in BusLogic_QueueCommand()
3543 if (CCB->Status == BusLogic_CCB_Completed) in BusLogic_QueueCommand()
3565 BusLogic_CCB_T *CCB; in BusLogic_AbortCommand() local
3587 for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll) in BusLogic_AbortCommand()
3588 if (CCB->Command == Command) break; in BusLogic_AbortCommand()
3589 if (CCB == NULL) in BusLogic_AbortCommand()
3596 else if (CCB->Status == BusLogic_CCB_Completed) in BusLogic_AbortCommand()
3603 else if (CCB->Status == BusLogic_CCB_Reset) in BusLogic_AbortCommand()
3627 HostAdapter, CCB->SerialNumber, TargetID); in BusLogic_AbortCommand()
3631 HostAdapter, BusLogic_MailboxAbortCommand, CCB)) in BusLogic_AbortCommand()
3634 HostAdapter, CCB->SerialNumber, TargetID); in BusLogic_AbortCommand()
3643 HostAdapter, CCB->SerialNumber, TargetID); in BusLogic_AbortCommand()
3653 HostAdapter, CCB->SerialNumber, TargetID); in BusLogic_AbortCommand()
3656 FlashPoint_AbortCCB(HostAdapter->CardHandle, CCB); in BusLogic_AbortCommand()
3663 if (CCB->Status == BusLogic_CCB_Completed) in BusLogic_AbortCommand()
3688 BusLogic_CCB_T *CCB; in BusLogic_ResetHostAdapter() local
3727 for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll) in BusLogic_ResetHostAdapter()
3728 if (CCB->Command == Command) break; in BusLogic_ResetHostAdapter()
3729 if (CCB == NULL) in BusLogic_ResetHostAdapter()
3736 else if (CCB->Status == BusLogic_CCB_Completed) in BusLogic_ResetHostAdapter()
3743 else if (CCB->Status == BusLogic_CCB_Reset && in BusLogic_ResetHostAdapter()
3786 for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll) in BusLogic_ResetHostAdapter()
3787 if (CCB->Status == BusLogic_CCB_Active) in BusLogic_ResetHostAdapter()
3788 CCB->Status = BusLogic_CCB_Reset; in BusLogic_ResetHostAdapter()
3810 for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll) in BusLogic_ResetHostAdapter()
3811 if (CCB->Status == BusLogic_CCB_Reset) in BusLogic_ResetHostAdapter()
3813 Command = CCB->Command; in BusLogic_ResetHostAdapter()
3814 BusLogic_DeallocateCCB(CCB); in BusLogic_ResetHostAdapter()
3849 BusLogic_CCB_T *CCB, *XCCB; in BusLogic_SendBusDeviceReset() local
3871 for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll) in BusLogic_SendBusDeviceReset()
3872 if (CCB->Command == Command) break; in BusLogic_SendBusDeviceReset()
3873 if (CCB == NULL) in BusLogic_SendBusDeviceReset()
3880 else if (CCB->Status == BusLogic_CCB_Completed) in BusLogic_SendBusDeviceReset()
3887 else if (CCB->Status == BusLogic_CCB_Reset) in BusLogic_SendBusDeviceReset()
3908 if ((CCB = HostAdapter->BusDeviceResetPendingCCB[TargetID]) != NULL) in BusLogic_SendBusDeviceReset()
3910 Command->reset_chain = CCB->Command; in BusLogic_SendBusDeviceReset()
3911 CCB->Command = Command; in BusLogic_SendBusDeviceReset()
3937 CCB = BusLogic_AllocateCCB(HostAdapter); in BusLogic_SendBusDeviceReset()
3938 if (CCB == NULL) goto Done; in BusLogic_SendBusDeviceReset()
3940 HostAdapter, CCB->SerialNumber, TargetID); in BusLogic_SendBusDeviceReset()
3941 CCB->Opcode = BusLogic_BusDeviceReset; in BusLogic_SendBusDeviceReset()
3942 CCB->TargetID = TargetID; in BusLogic_SendBusDeviceReset()
3950 CCB->Command = Command; in BusLogic_SendBusDeviceReset()
3960 HostAdapter, BusLogic_MailboxStartCommand, CCB))) in BusLogic_SendBusDeviceReset()
3964 BusLogic_DeallocateCCB(CCB); in BusLogic_SendBusDeviceReset()
3973 CCB->Status = BusLogic_CCB_Active; in BusLogic_SendBusDeviceReset()
3975 FlashPoint_StartCCB(HostAdapter->CardHandle, CCB); in BusLogic_SendBusDeviceReset()
3995 HostAdapter->BusDeviceResetPendingCCB[TargetID] = CCB; in BusLogic_SendBusDeviceReset()
4007 if (CCB->Status == BusLogic_CCB_Completed) in BusLogic_SendBusDeviceReset()