• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/scsi/

Lines Matching refs:CCB

168 	struct BusLogic_CCB *CCB = (struct BusLogic_CCB *) BlockPointer;
171 CCB->AllocationGroupHead = BlockPointerHandle;
172 CCB->AllocationGroupSize = BlockSize;
174 CCB->Status = BusLogic_CCB_Free;
175 CCB->HostAdapter = HostAdapter;
176 CCB->DMA_Handle = (u32) BlockPointerHandle + offset;
178 CCB->CallbackFunction = BusLogic_QueueCompletedCCB;
179 CCB->BaseAddress = HostAdapter->FlashPointInfo.BaseAddress;
181 CCB->Next = HostAdapter->Free_CCBs;
182 CCB->NextAll = HostAdapter->All_CCBs;
183 HostAdapter->Free_CCBs = CCB;
184 HostAdapter->All_CCBs = CCB;
186 CCB++;
204 BusLogic_Error("UNABLE TO ALLOCATE CCB GROUP - DETACHING\n", HostAdapter);
219 struct BusLogic_CCB *NextCCB = HostAdapter->All_CCBs, *CCB, *Last_CCB = NULL;
222 while ((CCB = NextCCB) != NULL) {
223 NextCCB = CCB->NextAll;
224 if (CCB->AllocationGroupHead) {
227 Last_CCB = CCB;
269 BusLogic_AllocateCCB allocates a CCB from Host Adapter's free list,
278 struct BusLogic_CCB *CCB;
279 CCB = HostAdapter->Free_CCBs;
280 if (CCB != NULL) {
281 CCB->SerialNumber = ++SerialNumber;
282 HostAdapter->Free_CCBs = CCB->Next;
283 CCB->Next = NULL;
286 return CCB;
289 CCB = HostAdapter->Free_CCBs;
290 if (CCB == NULL)
292 CCB->SerialNumber = ++SerialNumber;
293 HostAdapter->Free_CCBs = CCB->Next;
294 CCB->Next = NULL;
295 return CCB;
300 BusLogic_DeallocateCCB deallocates a CCB, returning it to the Host Adapter's
305 static void BusLogic_DeallocateCCB(struct BusLogic_CCB *CCB)
307 struct BusLogic_HostAdapter *HostAdapter = CCB->HostAdapter;
309 scsi_dma_unmap(CCB->Command);
310 pci_unmap_single(HostAdapter->PCI_Device, CCB->SenseDataPointer,
311 CCB->SenseDataLength, PCI_DMA_FROMDEVICE);
313 CCB->Command = NULL;
314 CCB->Status = BusLogic_CCB_Free;
315 CCB->Next = HostAdapter->Free_CCBs;
316 HostAdapter->Free_CCBs = CCB;
1563 Queue Depth (internal CCB capacity), as it is more efficient to have the
1926 Initialize the Bus Device Reset Pending CCB, Tagged Queuing Active,
1981 For Host Adapters that support Extended LUN Format CCBs, issue the Set CCB
1987 return BusLogic_Failure(HostAdapter, "SET CCB FORMAT");
2349 Adapter Configuration, Resource Acquisition, CCB Creation, Host
2408 BusLogic_QueueCompletedCCB queues CCB for completion processing.
2411 static void BusLogic_QueueCompletedCCB(struct BusLogic_CCB *CCB)
2413 struct BusLogic_HostAdapter *HostAdapter = CCB->HostAdapter;
2414 CCB->Status = BusLogic_CCB_Completed;
2415 CCB->Next = NULL;
2417 HostAdapter->FirstCompletedCCB = CCB;
2418 HostAdapter->LastCompletedCCB = CCB;
2420 HostAdapter->LastCompletedCCB->Next = CCB;
2421 HostAdapter->LastCompletedCCB = CCB;
2423 HostAdapter->ActiveCommands[CCB->TargetID]--;
2489 CCB and SCSI Command issued, command completion processing is performed
2494 CCB had already completed or been aborted before the current Abort request
2508 struct BusLogic_CCB *CCB = (struct BusLogic_CCB *) Bus_to_Virtual(NextIncomingMailbox->CCB);
2510 if (CCB->Status == BusLogic_CCB_Active || CCB->Status == BusLogic_CCB_Reset) {
2512 Save the Completion Code for this CCB and queue the CCB
2515 CCB->CompletionCode = CompletionCode;
2516 BusLogic_QueueCompletedCCB(CCB);
2519 If a CCB ever appears in an Incoming Mailbox and is not marked
2523 BusLogic_Warning("Illegal CCB #%ld status %d in " "Incoming Mailbox\n", HostAdapter, CCB->SerialNumber, CCB->Status);
2547 struct BusLogic_CCB *CCB = HostAdapter->FirstCompletedCCB;
2548 struct scsi_cmnd *Command = CCB->Command;
2549 HostAdapter->FirstCompletedCCB = CCB->Next;
2553 Process the Completed CCB.
2555 if (CCB->Opcode == BusLogic_BusDeviceReset) {
2556 int TargetID = CCB->TargetID;
2557 BusLogic_Warning("Bus Device Reset CCB #%ld to Target " "%d Completed\n", HostAdapter, CCB->SerialNumber, TargetID);
2563 Place CCB back on the Host Adapter's free list.
2565 BusLogic_DeallocateCCB(CCB);
2570 for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll)
2571 if (CCB->Status == BusLogic_CCB_Reset && CCB->TargetID == TargetID) {
2572 Command = CCB->Command;
2573 BusLogic_DeallocateCCB(CCB);
2584 switch (CCB->CompletionCode) {
2588 BusLogic_Warning("CCB #%ld to Target %d Impossible State\n", HostAdapter, CCB->SerialNumber, CCB->TargetID);
2591 HostAdapter->TargetStatistics[CCB->TargetID]
2593 HostAdapter->TargetFlags[CCB->TargetID]
2598 BusLogic_Warning("CCB #%ld to Target %d Aborted\n", HostAdapter, CCB->SerialNumber, CCB->TargetID);
2599 BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[CCB->TargetID]
2604 Command->result = BusLogic_ComputeResultCode(HostAdapter, CCB->HostAdapterStatus, CCB->TargetDeviceStatus);
2605 if (CCB->HostAdapterStatus != BusLogic_SCSISelectionTimeout) {
2606 HostAdapter->TargetStatistics[CCB->TargetID]
2610 BusLogic_Notice("CCB #%ld Target %d: Result %X Host "
2611 "Adapter Status %02X " "Target Status %02X\n", HostAdapter, CCB->SerialNumber, CCB->TargetID, Command->result, CCB->HostAdapterStatus, CCB->TargetDeviceStatus);
2613 for (i = 0; i < CCB->CDB_Length; i++)
2614 BusLogic_Notice(" %02X", HostAdapter, CCB->CDB[i]);
2617 for (i = 0; i < CCB->SenseDataLength; i++)
2629 if (CCB->CDB[0] == INQUIRY && CCB->CDB[1] == 0 && CCB->HostAdapterStatus == BusLogic_CommandCompletedNormally) {
2630 struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[CCB->TargetID];
2638 Place CCB back on the Host Adapter's free list.
2640 BusLogic_DeallocateCCB(CCB);
2737 BusLogic_WriteOutgoingMailbox places CCB and Action Code into an Outgoing
2743 *HostAdapter, enum BusLogic_ActionCode ActionCode, struct BusLogic_CCB *CCB)
2748 CCB->Status = BusLogic_CCB_Active;
2750 The CCB field must be written before the Action Code field since
2754 NextOutgoingMailbox->CCB = CCB->DMA_Handle;
2761 HostAdapter->ActiveCommands[CCB->TargetID]++;
2762 if (CCB->Opcode != BusLogic_BusDeviceReset)
2763 HostAdapter->TargetStatistics[CCB->TargetID].CommandsAttempted++;
2790 BusLogic_QueueCommand creates a CCB for Command and places it into an
2805 struct BusLogic_CCB *CCB;
2817 Allocate a CCB from the Host Adapter's free list. In the unlikely event
2822 CCB = BusLogic_AllocateCCB(HostAdapter);
2823 if (CCB == NULL) {
2827 CCB = BusLogic_AllocateCCB(HostAdapter);
2828 if (CCB == NULL) {
2836 Initialize the fields in the BusLogic Command Control Block (CCB).
2844 CCB->Opcode = BusLogic_InitiatorCCB_ScatterGather;
2845 CCB->DataLength = Count * sizeof(struct BusLogic_ScatterGatherSegment);
2847 CCB->DataPointer = (unsigned int) CCB->DMA_Handle + ((unsigned long) &CCB->ScatterGatherList - (unsigned long) CCB);
2849 CCB->DataPointer = Virtual_to_32Bit_Virtual(CCB->ScatterGatherList);
2852 CCB->ScatterGatherList[i].SegmentByteCount =
2854 CCB->ScatterGatherList[i].SegmentDataPointer =
2858 CCB->Opcode = BusLogic_InitiatorCCB;
2859 CCB->DataLength = BufferLength;
2860 CCB->DataPointer = 0;
2866 CCB->DataDirection = BusLogic_DataInLengthChecked;
2873 CCB->DataDirection = BusLogic_DataOutLengthChecked;
2879 CCB->DataDirection = BusLogic_UncheckedDataTransfer;
2882 CCB->CDB_Length = CDB_Length;
2883 CCB->HostAdapterStatus = 0;
2884 CCB->TargetDeviceStatus = 0;
2885 CCB->TargetID = TargetID;
2886 CCB->LogicalUnit = LogicalUnit;
2887 CCB->TagEnable = false;
2888 CCB->LegacyTagEnable = false;
2930 CCB->TagEnable = true;
2931 CCB->QueueTag = QueueTag;
2933 CCB->LegacyTagEnable = true;
2934 CCB->LegacyQueueTag = QueueTag;
2937 memcpy(CCB->CDB, CDB, CDB_Length);
2938 CCB->SenseDataLength = SCSI_SENSE_BUFFERSIZE;
2939 CCB->SenseDataPointer = pci_map_single(HostAdapter->PCI_Device, Command->sense_buffer, CCB->SenseDataLength, PCI_DMA_FROMDEVICE);
2940 CCB->Command = Command;
2944 Place the CCB in an Outgoing Mailbox. The higher levels of the SCSI
2951 if (!BusLogic_WriteOutgoingMailbox(HostAdapter, BusLogic_MailboxStartCommand, CCB)) {
2956 if (!BusLogic_WriteOutgoingMailbox(HostAdapter, BusLogic_MailboxStartCommand, CCB)) {
2958 BusLogic_DeallocateCCB(CCB);
2965 Call the FlashPoint SCCB Manager to start execution of the CCB.
2967 CCB->Status = BusLogic_CCB_Active;
2970 FlashPoint_StartCCB(HostAdapter->CardHandle, CCB);
2975 if (CCB->Status == BusLogic_CCB_Completed)
2989 struct BusLogic_CCB *CCB;
3005 for (CCB = HostAdapter->All_CCBs; CCB != NULL; CCB = CCB->NextAll)
3006 if (CCB->Status == BusLogic_CCB_Active)
3007 BusLogic_DeallocateCCB(CCB);