func: static int arcmsr_queue_command_lck(struct scsi_cmnd void (* done)(struct scsi_cmnd *)) struct Scsi_Host * host = cmd -> device -> host ; struct AdapterControlBlock * acb = ( struct AdapterControlBlock * ) host -> hostdata ; int target = cmd -> device -> id ; uint8_t scsicmd = cmd -> cmnd [ 0 ] ; if ( ( scsicmd == SYNCHRONIZE_CACHE ) || ( scsicmd == SEND_DIAGNOSTIC ) )  if ( target == 16 )  arcmsr_handle_virtual_command ( acb , cmd ); static void arcmsr_handle_virtual_command(struct AdapterControlBlock struct scsi_cmnd *cmd) switch ( cmd -> cmnd [ 0 ] )  if ( arcmsr_iop_message_xfer ( acb , cmd ) )  static int arcmsr_iop_message_xfer(struct AdapterControlBlock struct scsi_cmnd *cmd) char * buffer ; unsigned short use_sg ; int retvalue = 0 , transfer_len = 0 ; struct CMD_MESSAGE_FIELD * pcmdmessagefld ; uint32_t controlcode = ( uint32_t ) cmd -> cmnd [ 5 ] << 24 | ( uint32_t ) cmd -> cmnd [ 6 ] << 16 | ( uint32_t ) cmd -> cmnd [ 7 ] << 8 | ( uint32_t ) cmd -> cmnd [ 8 ] ; struct scatterlist * sg ; use_sg = scsi_sg_count ( cmd ); sg = scsi_sglist ( cmd ); buffer = kmap_atomic ( sg_page ( sg ) ) + sg -> offset; if ( use_sg > 1 )  transfer_len += sg -> length; if ( transfer_len > sizeof ( struct CMD_MESSAGE_FIELD ) )  pcmdmessagefld = ( struct CMD_MESSAGE_FIELD * ) buffer; switch ( controlcode )  acb -> acb_flags |= ACB_F_MESSAGE_RQBUFFER_CLEARED; acb -> rqbuf_getIndex = 0; acb -> rqbuf_putIndex = 0; acb -> acb_flags |= ( ACB_F_MESSAGE_WQBUFFER_CLEARED | ACB_F_MESSAGE_WQBUFFER_READED ); acb -> wqbuf_getIndex = 0; acb -> wqbuf_putIndex = 0; acb -> acb_flags |= ACB_F_MESSAGE_RQBUFFER_CLEARED; acb -> rqbuf_getIndex = 0; acb -> rqbuf_putIndex = 0; acb -> acb_flags |= ( ACB_F_MESSAGE_WQBUFFER_CLEARED | ACB_F_MESSAGE_WQBUFFER_READED ); acb -> wqbuf_getIndex = 0; acb -> wqbuf_putIndex = 0; if ( acb -> fw_flag == FW_DEADLOCK )  pcmdmessagefld -> cmdmessage . ReturnCode = ARCMSR_MESSAGE_RETURNCODE_3F; int8_t * hello_string = "Hello! I am ARCMSR" ; if ( acb -> fw_flag == FW_DEADLOCK )  pcmdmessagefld -> cmdmessage . ReturnCode = ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; pcmdmessagefld -> cmdmessage . ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK; memcpy ( pcmdmessagefld -> messagedatabuffer , hello_string , ( int16_t ) strlen ( hello_string ) ); pcmdmessagefld -> cmdmessage . ReturnCode = ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; 