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()
496 scsi_sg_count(context->srb)); in mts_do_sg()
499 context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; in mts_do_sg()
503 sg = scsi_sglist(context->srb); in mts_do_sg()
509 context->fragment + 1 == scsi_sg_count(context->srb) ? in mts_do_sg()
526 mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc) in mts_build_transfer_context() argument
534 desc->context.srb = srb; in mts_build_transfer_context()
537 if (!scsi_bufflen(srb)) { in mts_build_transfer_context()
542 sg = scsi_sglist(srb); in mts_build_transfer_context()
552 if ( !memcmp( srb->cmnd, mts_read_image_sig, mts_read_image_sig_len ) in mts_build_transfer_context()
556 } else if ( MTS_DIRECTION_IS_IN(srb->cmnd[0]) ) { in mts_build_transfer_context()
570 mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback) in mts_scsi_queuecommand_lck() argument
572 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); in mts_scsi_queuecommand_lck()
577 mts_show_command(srb); in mts_scsi_queuecommand_lck()
580 if ( srb->device->lun || srb->device->id || srb->device->channel ) { in mts_scsi_queuecommand_lck()
582 …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()
586 srb->result = DID_BAD_TARGET << 16; in mts_scsi_queuecommand_lck()
589 callback(srb); in mts_scsi_queuecommand_lck()
598 srb->cmnd, in mts_scsi_queuecommand_lck()
599 srb->cmd_len, in mts_scsi_queuecommand_lck()
605 mts_build_transfer_context( srb, desc ); in mts_scsi_queuecommand_lck()
613 srb->result = DID_ERROR << 16; in mts_scsi_queuecommand_lck()
616 callback(srb); in mts_scsi_queuecommand_lck()