func: static int arcmsr_polling_ccbdone(struct AdapterControlBlock struct CommandControlBlock *poll_ccb) switch ( acb -> adapter_type )  rtn = arcmsr_hbaD_polling_ccbdone ( acb , poll_ccb ); static int arcmsr_hbaD_polling_ccbdone(struct AdapterControlBlock struct CommandControlBlock *poll_ccb) bool error ; uint32_t poll_ccb_done = 0 , poll_count = 0 , flag_ccb , ccb_cdb_phy ; int rtn , doneq_index , index_stripped , outbound_write_pointer , toggle ; struct ARCMSR_CDB * arcmsr_cdb ; struct CommandControlBlock * pCCB ; struct MessageUnit_D * pmu = acb -> pmuD ; poll_count ++; while ( 1 )  outbound_write_pointer = pmu -> done_qbuffer [ 0 ] . addressLow + 1; doneq_index = pmu -> doneq_index; if ( ( outbound_write_pointer & 0xFFF ) == ( doneq_index & 0xFFF ) )  if ( poll_ccb_done )  if ( poll_count > 40 )  toggle = doneq_index & 0x4000; index_stripped = ( doneq_index & 0xFFF ) + 1; index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE; pmu -> doneq_index = index_stripped ? ( index_stripped | toggle ) : ( ( toggle ^ 0x4000 ) + 1 ); doneq_index = pmu -> doneq_index; flag_ccb = pmu -> done_qbuffer [ doneq_index & 0xFFF ] . addressLow; ccb_cdb_phy = ( flag_ccb & 0xFFFFFFF0 ); arcmsr_cdb = ( struct ARCMSR_CDB * ) ( acb -> vir2phy_offset + ccb_cdb_phy ); pCCB = container_of ( arcmsr_cdb , struct CommandControlBlock arcmsr_cdb ) poll_ccb_done |= ( pCCB == poll_ccb ) ? 1 : 0; if ( ( pCCB -> acb != acb ) || ( pCCB -> startdone != ARCMSR_CCB_START ) )  error = ( flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE1 ) ? true : false; arcmsr_report_ccb_state ( acb , pCCB , error ); static void arcmsr_report_ccb_state(struct AdapterControlBlock struct CommandControlBlock *ccb, bool error) if ( ! error )  switch ( ccb -> arcmsr_cdb . DeviceStatus )  ccb -> pcmd -> result = DID_BAD_TARGET << 16; arcmsr_report_sense_info ( ccb ); static void arcmsr_report_sense_info(struct CommandControlBlock *ccb) struct scsi_cmnd * pcmd = ccb -> pcmd ; struct SENSE_DATA * sensebuffer = ( struct SENSE_DATA * ) pcmd -> sense_buffer ; if ( sensebuffer )  memset ( sensebuffer , 0 , SCSI_SENSE_BUFFERSIZE ); memcpy ( sensebuffer , ccb -> arcmsr_cdb . SenseData , sense_data_length ); sensebuffer -> ErrorCode = SCSI_SENSE_CURRENT_ERRORS; sensebuffer -> Valid = 1; 