Lines Matching refs:srb

222 static inline void mts_show_command(struct scsi_cmnd *srb)  in mts_show_command()  argument
226 switch (srb->cmnd[0]) { in mts_show_command()
296 MTS_DEBUG( "Command %s (%d bytes)\n", what, srb->cmd_len); in mts_show_command()
299 MTS_DEBUG( " %10ph\n", srb->cmnd); in mts_show_command()
333 static int mts_scsi_abort(struct scsi_cmnd *srb) in mts_scsi_abort() argument
335 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); in mts_scsi_abort()
344 static int mts_scsi_host_reset(struct scsi_cmnd *srb) in mts_scsi_host_reset() argument
346 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); in mts_scsi_host_reset()
361 mts_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *srb);
392 context->srb->result = DID_ERROR << 16; in mts_int_submit_urb()
404 context->final_callback(context->srb); in mts_transfer_cleanup()
411 context->srb->result &= MTS_SCSI_ERR_MASK; in mts_transfer_done()
412 context->srb->result |= (unsigned)(*context->scsi_status)<<1; in mts_transfer_done()
438 scsi_set_resid(context->srb, context->data_length - in mts_data_done()
441 context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; in mts_data_done()
458 context->srb->result = DID_ABORT<<16; in mts_command_done()
463 context->srb->result = DID_ERROR<<16; in mts_command_done()
470 if (context->srb->cmnd[0] == REQUEST_SENSE) { in mts_command_done()
473 context->srb->sense_buffer, in mts_command_done()
481 scsi_sg_count(context->srb) > 1 ? in mts_command_done()
495 scsi_sg_count(context->srb)); in mts_do_sg()
498 context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; in mts_do_sg()
524 mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc) in mts_build_transfer_context() argument
531 desc->context.srb = srb; in mts_build_transfer_context()
533 if (!scsi_bufflen(srb)) { in mts_build_transfer_context()
538 desc->context.curr_sg = scsi_sglist(srb); in mts_build_transfer_context()
548 if ( !memcmp( srb->cmnd, mts_read_image_sig, mts_read_image_sig_len ) in mts_build_transfer_context()
552 } else if ( MTS_DIRECTION_IS_IN(srb->cmnd[0]) ) { in mts_build_transfer_context()
566 mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback) in mts_scsi_queuecommand_lck() argument
568 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); in mts_scsi_queuecommand_lck()
573 mts_show_command(srb); in mts_scsi_queuecommand_lck()
576 if ( srb->device->lun || srb->device->id || srb->device->channel ) { in mts_scsi_queuecommand_lck()
578 …d to LUN=%d ID=%d CHANNEL=%d from SCSI layer\n",(int)srb->device->lun,(int)srb->device->id, (int)s… in mts_scsi_queuecommand_lck()
582 srb->result = DID_BAD_TARGET << 16; in mts_scsi_queuecommand_lck()
585 callback(srb); in mts_scsi_queuecommand_lck()
594 srb->cmnd, in mts_scsi_queuecommand_lck()
595 srb->cmd_len, in mts_scsi_queuecommand_lck()
601 mts_build_transfer_context( srb, desc ); in mts_scsi_queuecommand_lck()
609 srb->result = DID_ERROR << 16; in mts_scsi_queuecommand_lck()
612 callback(srb); in mts_scsi_queuecommand_lck()