Lines Matching refs:srb

226 static inline void mts_show_command(struct scsi_cmnd *srb)
230 switch (srb->cmnd[0]) {
300 MTS_DEBUG( "Command %s (%d bytes)\n", what, srb->cmd_len);
303 MTS_DEBUG( " %10ph\n", srb->cmnd);
337 static int mts_scsi_abort(struct scsi_cmnd *srb)
339 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]);
348 static int mts_scsi_host_reset(struct scsi_cmnd *srb)
350 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]);
365 mts_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *srb);
396 set_host_byte(context->srb, DID_ERROR);
408 context->final_callback(context->srb);
415 context->srb->result &= MTS_SCSI_ERR_MASK;
416 context->srb->result |= (unsigned)(*context->scsi_status)<<1;
442 scsi_set_resid(context->srb, context->data_length -
445 set_host_byte(context->srb, (status == -ENOENT ? DID_ABORT : DID_ERROR));
462 set_host_byte(context->srb, DID_ABORT);
467 set_host_byte(context->srb, DID_ERROR);
474 if (context->srb->cmnd[0] == REQUEST_SENSE) {
477 context->srb->sense_buffer,
485 scsi_sg_count(context->srb) > 1 ?
499 scsi_sg_count(context->srb));
502 set_host_byte(context->srb, (status == -ENOENT ? DID_ABORT : DID_ERROR));
528 mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc)
535 desc->context.srb = srb;
537 if (!scsi_bufflen(srb)) {
542 desc->context.curr_sg = scsi_sglist(srb);
548 /* can't rely on srb->sc_data_direction */
552 if ( !memcmp( srb->cmnd, mts_read_image_sig, mts_read_image_sig_len )
556 } else if ( MTS_DIRECTION_IS_IN(srb->cmnd[0]) ) {
568 static int mts_scsi_queuecommand_lck(struct scsi_cmnd *srb)
571 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]);
575 mts_show_command(srb);
578 if ( srb->device->lun || srb->device->id || srb->device->channel ) {
580 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 );
584 set_host_byte(srb, DID_BAD_TARGET);
587 callback(srb);
596 srb->cmnd,
597 srb->cmd_len,
603 mts_build_transfer_context( srb, desc );
611 set_host_byte(srb, DID_ERROR);
614 callback(srb);