• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/scsi/

Lines Matching refs:CCB

167 	struct BusLogic_CCB *CCB = (struct BusLogic_CCB *) BlockPointer;
170 CCB->AllocationGroupHead = BlockPointerHandle;
171 CCB->AllocationGroupSize = BlockSize;
173 CCB->Status = BusLogic_CCB_Free;
174 CCB->HostAdapter = HostAdapter;
175 CCB->DMA_Handle = (u32) BlockPointerHandle + offset;
177 CCB->CallbackFunction = BusLogic_QueueCompletedCCB;
178 CCB->BaseAddress = HostAdapter->FlashPointInfo.BaseAddress;
180 CCB->Next = HostAdapter->Free_CCBs;
181 CCB->NextAll = HostAdapter->All_CCBs;
182 HostAdapter->Free_CCBs = CCB;
183 HostAdapter->All_CCBs = CCB;
185 CCB++;
203 BusLogic_Error("UNABLE TO ALLOCATE CCB GROUP - DETACHING\n", HostAdapter);
218 struct BusLogic_CCB *NextCCB = HostAdapter->All_CCBs, *CCB, *Last_CCB = NULL;
221 while ((CCB = NextCCB) != NULL) {
222 NextCCB = CCB->NextAll;
223 if (CCB->AllocationGroupHead) {
226 Last_CCB = CCB;
268 BusLogic_AllocateCCB allocates a CCB from Host Adapter's free list,
277 struct BusLogic_CCB *CCB;
278 CCB = HostAdapter->Free_CCBs;
279 if (CCB != NULL) {
280 CCB->SerialNumber = ++SerialNumber;
281 HostAdapter->Free_CCBs = CCB->Next;
282 CCB->Next = NULL;
285 return CCB;
288 CCB = HostAdapter->Free_CCBs;
289 if (CCB == NULL)
291 CCB->SerialNumber = ++SerialNumber;
292 HostAdapter->Free_CCBs = CCB->Next;
293 CCB->Next = NULL;
294 return CCB;
299 BusLogic_DeallocateCCB deallocates a CCB, returning it to the Host Adapter's
304 static void BusLogic_DeallocateCCB(struct BusLogic_CCB *CCB)
306 struct BusLogic_HostAdapter *HostAdapter = CCB->HostAdapter;
307 struct scsi_cmnd *cmd = CCB->Command;
314 pci_unmap_single(HostAdapter->PCI_Device, CCB->DataPointer,
315 CCB->DataLength, cmd->sc_data_direction);
317 pci_unmap_single(HostAdapter->PCI_Device, CCB->SenseDataPointer,
318 CCB->SenseDataLength, PCI_DMA_FROMDEVICE);
320 CCB->Command = NULL;
321 CCB->Status = BusLogic_CCB_Free;
322 CCB->Next = HostAdapter->Free_CCBs;
323 HostAdapter->Free_CCBs = CCB;
1567 Queue Depth (internal CCB capacity), as it is more efficient to have the
1930 Initialize the Bus Device Reset Pending CCB, Tagged Queuing Active,
1985 For Host Adapters that support Extended LUN Format CCBs, issue the Set CCB
1991 return BusLogic_Failure(HostAdapter, "SET CCB FORMAT");
2353 Adapter Configuration, Resource Acquisition, CCB Creation, Host
2412 BusLogic_QueueCompletedCCB queues CCB for completion processing.
2415 static void BusLogic_QueueCompletedCCB(struct BusLogic_CCB *CCB)
2417 struct BusLogic_HostAdapter *HostAdapter = CCB->HostAdapter;
2418 CCB->Status = BusLogic_CCB_Completed;
2419 CCB->Next = NULL;
2421 HostAdapter->FirstCompletedCCB = CCB;
2422 HostAdapter->LastCompletedCCB = CCB;
2424 HostAdapter->LastCompletedCCB->Next = CCB;
2425 HostAdapter->LastCompletedCCB = CCB;
2427 HostAdapter->ActiveCommands[CCB->TargetID]--;
2493 CCB and SCSI Command issued, command completion processing is performed
2498 CCB had already completed or been aborted before the current Abort request
2512 struct BusLogic_CCB *CCB = (struct BusLogic_CCB *) Bus_to_Virtual(NextIncomingMailbox->CCB);
2514 if (CCB->Status == BusLogic_CCB_Active || CCB->Status == BusLogic_CCB_Reset) {
2516 Save the Completion Code for this CCB and queue the CCB
2519 CCB->CompletionCode = CompletionCode;
2520 BusLogic_QueueCompletedCCB(CCB);
2523 If a CCB ever appears in an Incoming Mailbox and is not marked
2527 BusLogic_Warning("Illegal CCB #%ld status %d in " "Incoming Mailbox\n", HostAdapter, CCB->SerialNumber, CCB->Status);
2551 struct BusLogic_CCB *CCB = HostAdapter->FirstCompletedCCB;
2552 struct scsi_cmnd *Command = CCB->Command;
2553 HostAdapter->FirstCompletedCCB = CCB->Next;
2557 Process the Completed CCB.
2559 if (CCB->Opcode == BusLogic_BusDeviceReset) {
2560 int TargetID = CCB->TargetID;
2561 BusLogic_Warning("Bus Device Reset CCB #%ld to Target " "%d Completed\n", HostAdapter, CCB->SerialNumber, TargetID);
2567 Place CCB back on the Host Adapter's free list.
2569 BusLogic_DeallocateCCB(CCB);
2574 for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll)
2575 if (CCB->Status == BusLogic_CCB_Reset && CCB->TargetID == TargetID) {
2576 Command = CCB->Command;
2577 BusLogic_DeallocateCCB(CCB);
2588 switch (CCB->CompletionCode) {
2592 BusLogic_Warning("CCB #%ld to Target %d Impossible State\n", HostAdapter, CCB->SerialNumber, CCB->TargetID);
2595 HostAdapter->TargetStatistics[CCB->TargetID]
2597 HostAdapter->TargetFlags[CCB->TargetID]
2602 BusLogic_Warning("CCB #%ld to Target %d Aborted\n", HostAdapter, CCB->SerialNumber, CCB->TargetID);
2603 BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[CCB->TargetID]
2608 Command->result = BusLogic_ComputeResultCode(HostAdapter, CCB->HostAdapterStatus, CCB->TargetDeviceStatus);
2609 if (CCB->HostAdapterStatus != BusLogic_SCSISelectionTimeout) {
2610 HostAdapter->TargetStatistics[CCB->TargetID]
2614 BusLogic_Notice("CCB #%ld Target %d: Result %X Host "
2615 "Adapter Status %02X " "Target Status %02X\n", HostAdapter, CCB->SerialNumber, CCB->TargetID, Command->result, CCB->HostAdapterStatus, CCB->TargetDeviceStatus);
2617 for (i = 0; i < CCB->CDB_Length; i++)
2618 BusLogic_Notice(" %02X", HostAdapter, CCB->CDB[i]);
2621 for (i = 0; i < CCB->SenseDataLength; i++)
2633 if (CCB->CDB[0] == INQUIRY && CCB->CDB[1] == 0 && CCB->HostAdapterStatus == BusLogic_CommandCompletedNormally) {
2634 struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[CCB->TargetID];
2641 Place CCB back on the Host Adapter's free list.
2643 BusLogic_DeallocateCCB(CCB);
2740 BusLogic_WriteOutgoingMailbox places CCB and Action Code into an Outgoing
2746 *HostAdapter, enum BusLogic_ActionCode ActionCode, struct BusLogic_CCB *CCB)
2751 CCB->Status = BusLogic_CCB_Active;
2753 The CCB field must be written before the Action Code field since
2757 NextOutgoingMailbox->CCB = CCB->DMA_Handle;
2764 HostAdapter->ActiveCommands[CCB->TargetID]++;
2765 if (CCB->Opcode != BusLogic_BusDeviceReset)
2766 HostAdapter->TargetStatistics[CCB->TargetID].CommandsAttempted++;
2793 BusLogic_QueueCommand creates a CCB for Command and places it into an
2809 struct BusLogic_CCB *CCB;
2821 Allocate a CCB from the Host Adapter's free list. In the unlikely event
2826 CCB = BusLogic_AllocateCCB(HostAdapter);
2827 if (CCB == NULL) {
2831 CCB = BusLogic_AllocateCCB(HostAdapter);
2832 if (CCB == NULL) {
2839 Initialize the fields in the BusLogic Command Control Block (CCB).
2842 CCB->Opcode = BusLogic_InitiatorCCB;
2843 CCB->DataLength = BufferLength;
2844 CCB->DataPointer = pci_map_single(HostAdapter->PCI_Device,
2853 CCB->Opcode = BusLogic_InitiatorCCB_ScatterGather;
2854 CCB->DataLength = Count * sizeof(struct BusLogic_ScatterGatherSegment);
2856 CCB->DataPointer = (unsigned int) CCB->DMA_Handle + ((unsigned long) &CCB->ScatterGatherList - (unsigned long) CCB);
2858 CCB->DataPointer = Virtual_to_32Bit_Virtual(CCB->ScatterGatherList);
2860 CCB->ScatterGatherList[Segment].SegmentByteCount = sg_dma_len(ScatterList + Segment);
2861 CCB->ScatterGatherList[Segment].SegmentDataPointer = sg_dma_address(ScatterList + Segment);
2864 CCB->Opcode = BusLogic_InitiatorCCB;
2865 CCB->DataLength = BufferLength;
2866 CCB->DataPointer = 0;
2871 CCB->DataDirection = BusLogic_DataInLengthChecked;
2878 CCB->DataDirection = BusLogic_DataOutLengthChecked;
2884 CCB->DataDirection = BusLogic_UncheckedDataTransfer;
2887 CCB->CDB_Length = CDB_Length;
2888 CCB->HostAdapterStatus = 0;
2889 CCB->TargetDeviceStatus = 0;
2890 CCB->TargetID = TargetID;
2891 CCB->LogicalUnit = LogicalUnit;
2892 CCB->TagEnable = false;
2893 CCB->LegacyTagEnable = false;
2935 CCB->TagEnable = true;
2936 CCB->QueueTag = QueueTag;
2938 CCB->LegacyTagEnable = true;
2939 CCB->LegacyQueueTag = QueueTag;
2942 memcpy(CCB->CDB, CDB, CDB_Length);
2943 CCB->SenseDataLength = sizeof(Command->sense_buffer);
2944 CCB->SenseDataPointer = pci_map_single(HostAdapter->PCI_Device, Command->sense_buffer, CCB->SenseDataLength, PCI_DMA_FROMDEVICE);
2945 CCB->Command = Command;
2949 Place the CCB in an Outgoing Mailbox. The higher levels of the SCSI
2956 if (!BusLogic_WriteOutgoingMailbox(HostAdapter, BusLogic_MailboxStartCommand, CCB)) {
2961 if (!BusLogic_WriteOutgoingMailbox(HostAdapter, BusLogic_MailboxStartCommand, CCB)) {
2963 BusLogic_DeallocateCCB(CCB);
2970 Call the FlashPoint SCCB Manager to start execution of the CCB.
2972 CCB->Status = BusLogic_CCB_Active;
2975 FlashPoint_StartCCB(HostAdapter->CardHandle, CCB);
2980 if (CCB->Status == BusLogic_CCB_Completed)
2994 struct BusLogic_CCB *CCB;
3010 for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll)
3011 if (CCB->Status == BusLogic_CCB_Active)
3012 BusLogic_DeallocateCCB(CCB);