Lines Matching defs:srb
222 static inline void mts_show_command(struct scsi_cmnd *srb)
226 switch (srb->cmnd[0]) {
296 MTS_DEBUG( "Command %s (%d bytes)\n", what, srb->cmd_len);
299 MTS_DEBUG( " %10ph\n", srb->cmnd);
333 static int mts_scsi_abort(struct scsi_cmnd *srb)
335 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]);
344 static int mts_scsi_host_reset(struct scsi_cmnd *srb)
346 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]);
361 mts_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *srb);
392 set_host_byte(context->srb, DID_ERROR);
404 context->final_callback(context->srb);
411 context->srb->result &= MTS_SCSI_ERR_MASK;
412 context->srb->result |= (unsigned)(*context->scsi_status)<<1;
438 scsi_set_resid(context->srb, context->data_length -
441 set_host_byte(context->srb, (status == -ENOENT ? DID_ABORT : DID_ERROR));
458 set_host_byte(context->srb, DID_ABORT);
463 set_host_byte(context->srb, DID_ERROR);
470 if (context->srb->cmnd[0] == REQUEST_SENSE) {
473 context->srb->sense_buffer,
481 scsi_sg_count(context->srb) > 1 ?
495 scsi_sg_count(context->srb));
498 set_host_byte(context->srb, (status == -ENOENT ? DID_ABORT : DID_ERROR));
524 mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc)
531 desc->context.srb = srb;
533 if (!scsi_bufflen(srb)) {
538 desc->context.curr_sg = scsi_sglist(srb);
544 /* can't rely on srb->sc_data_direction */
548 if ( !memcmp( srb->cmnd, mts_read_image_sig, mts_read_image_sig_len )
552 } else if ( MTS_DIRECTION_IS_IN(srb->cmnd[0]) ) {
566 mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback)
568 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]);
572 mts_show_command(srb);
575 if ( srb->device->lun || srb->device->id || srb->device->channel ) {
577 MTS_DEBUG("Command to LUN=%d ID=%d CHANNEL=%d from SCSI layer\n",(int)srb->device->lun,(int)srb->device->id, (int)srb->device->channel );
581 set_host_byte(srb, DID_BAD_TARGET);
584 callback(srb);
593 srb->cmnd,
594 srb->cmd_len,
600 mts_build_transfer_context( srb, desc );
608 set_host_byte(srb, DID_ERROR);
611 callback(srb);