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) unsigned short use_sg ; int retvalue = 0 , transfer_len = 0 ; 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 ); if ( use_sg > 1 )  transfer_len += sg -> length; if ( transfer_len > sizeof ( struct CMD_MESSAGE_FIELD ) )  switch ( controlcode )  unsigned char * ver_addr ; uint8_t * ptmpQbuffer ; ver_addr = kmalloc ( ARCMSR_API_DATA_BUFLEN , GFP_ATOMIC ); if ( ! ver_addr )  ptmpQbuffer = ver_addr; if ( acb -> rqbuf_getIndex != acb -> rqbuf_putIndex )  unsigned int tail = acb -> rqbuf_getIndex ; unsigned int head = acb -> rqbuf_putIndex ; unsigned int cnt_to_end = CIRC_CNT_TO_END ( head , tail , ARCMSR_MAX_QBUFFER ) ; allxfer_len = CIRC_CNT ( head , tail , ARCMSR_MAX_QBUFFER ); if ( allxfer_len > ARCMSR_API_DATA_BUFLEN )  allxfer_len = ARCMSR_API_DATA_BUFLEN; if ( allxfer_len <= cnt_to_end )  memcpy ( ptmpQbuffer , acb -> rqbuffer + tail , allxfer_len ); 