Lines Matching refs:cmd
517 static void __unmap_scsi_data(struct device *dev, struct scsi_cmnd *cmd) in __unmap_scsi_data() argument
519 struct ncr_cmd_priv *cmd_priv = scsi_cmd_priv(cmd); in __unmap_scsi_data()
523 scsi_dma_unmap(cmd); in __unmap_scsi_data()
529 static int __map_scsi_sg_data(struct device *dev, struct scsi_cmnd *cmd) in __map_scsi_sg_data() argument
531 struct ncr_cmd_priv *cmd_priv = scsi_cmd_priv(cmd); in __map_scsi_sg_data()
534 use_sg = scsi_dma_map(cmd); in __map_scsi_sg_data()
544 #define unmap_scsi_data(np, cmd) __unmap_scsi_data(np->dev, cmd) argument
545 #define map_scsi_sg_data(np, cmd) __map_scsi_sg_data(np->dev, cmd) argument
1131 u_long cmd; member
1485 struct scr_tblmove cmd ; member
1537 struct scsi_cmnd *cmd; /* SCSI command */ member
1914 static struct ccb *ncr_get_ccb (struct ncb *np, struct scsi_cmnd *cmd);
1928 static int ncr_scatter (struct ncb *np, struct ccb *cp, struct scsi_cmnd *cmd);
1940 static void insert_into_waiting_list(struct ncb *np, struct scsi_cmnd *cmd);
2151 offsetof (struct dsb, cmd),
3637 #define PRINT_ADDR(cmd, arg...) dev_info(&cmd->device->sdev_gendev , ## arg) argument
3641 PRINT_ADDR(cp->cmd, "%s: ", label); in ncr_print_msg()
3991 static inline void ncr_queue_done_cmd(struct ncb *np, struct scsi_cmnd *cmd) in ncr_queue_done_cmd() argument
3993 unmap_scsi_data(np, cmd); in ncr_queue_done_cmd()
3994 cmd->host_scribble = (char *) np->done_list; in ncr_queue_done_cmd()
3995 np->done_list = cmd; in ncr_queue_done_cmd()
4000 struct scsi_cmnd *cmd; in ncr_flush_done_cmds() local
4003 cmd = lcmd; in ncr_flush_done_cmds()
4004 lcmd = (struct scsi_cmnd *) cmd->host_scribble; in ncr_flush_done_cmds()
4005 scsi_done(cmd); in ncr_flush_done_cmds()
4082 static int ncr_queue_command (struct ncb *np, struct scsi_cmnd *cmd) in ncr_queue_command() argument
4084 struct scsi_device *sdev = cmd->device; in ncr_queue_command()
4116 if ((cmd->cmnd[0] == 0 || cmd->cmnd[0] == 0x12) && in ncr_queue_command()
4123 PRINT_ADDR(cmd, "CMD=%x ", cmd->cmnd[0]); in ncr_queue_command()
4136 if (np->settle_time && scsi_cmd_to_rq(cmd)->timeout >= HZ) { in ncr_queue_command()
4137 u_long tlimit = jiffies + scsi_cmd_to_rq(cmd)->timeout - HZ; in ncr_queue_command()
4142 if (np->settle_time || !(cp=ncr_get_ccb (np, cmd))) { in ncr_queue_command()
4143 insert_into_waiting_list(np, cmd); in ncr_queue_command()
4146 cp->cmd = cmd; in ncr_queue_command()
4176 PRINT_ADDR(cmd, in ncr_queue_command()
4188 switch (cmd->cmnd[0]) { in ncr_queue_command()
4214 direction = cmd->sc_data_direction; in ncr_queue_command()
4216 segments = ncr_scatter(np, cp, cp->cmd); in ncr_queue_command()
4337 memcpy(cp->cdb_buf, cmd->cmnd, min_t(int, cmd->cmd_len, sizeof(cp->cdb_buf))); in ncr_queue_command()
4338 cp->phys.cmd.addr = cpu_to_scr(CCB_PHYS (cp, cdb_buf[0])); in ncr_queue_command()
4339 cp->phys.cmd.size = cpu_to_scr(cmd->cmd_len); in ncr_queue_command()
4662 struct scsi_cmnd *cmd; in ncr_complete() local
4670 if (!cp || cp->magic != CCB_MAGIC || !cp->cmd) in ncr_complete()
4685 cmd = cp->cmd; in ncr_complete()
4686 cp->cmd = NULL; in ncr_complete()
4687 tp = &np->target[cmd->device->id]; in ncr_complete()
4688 lp = tp->lp[cmd->device->lun]; in ncr_complete()
4723 PRINT_ADDR(cmd, "%d parity error(s).\n",cp->parity_status); in ncr_complete()
4733 PRINT_ADDR(cmd, "extraneous data discarded.\n"); in ncr_complete()
4736 PRINT_ADDR(cmd, "invalid scsi phase (4/5).\n"); in ncr_complete()
4739 PRINT_ADDR(cmd, "extended error %d.\n", in ncr_complete()
4753 PRINT_ADDR(cmd, "ERROR: cmd=%x host_status=%x " in ncr_complete()
4754 "scsi_status=%x\n", cmd->cmnd[0], in ncr_complete()
4762 cmd->result = 0; in ncr_complete()
4771 set_status_byte(cmd, cp->scsi_status); in ncr_complete()
4784 ncr_alloc_lcb (np, cmd->device->id, cmd->device->lun); in ncr_complete()
4798 ncr_setup_tags (np, cmd->device); in ncr_complete()
4806 set_status_byte(cmd, SAM_STAT_CHECK_CONDITION); in ncr_complete()
4811 memcpy(cmd->sense_buffer, cp->sense_buf, in ncr_complete()
4816 u_char *p = cmd->sense_buffer; in ncr_complete()
4818 PRINT_ADDR(cmd, "sense data:"); in ncr_complete()
4827 set_status_byte(cmd, SAM_STAT_RESERVATION_CONFLICT); in ncr_complete()
4836 set_status_byte(cmd, cp->scsi_status); in ncr_complete()
4844 set_status_byte(cmd, cp->scsi_status); in ncr_complete()
4845 set_host_byte(cmd, DID_TIME_OUT); in ncr_complete()
4852 set_status_byte(cmd, cp->scsi_status); in ncr_complete()
4853 set_host_byte(cmd, DID_RESET); in ncr_complete()
4860 set_status_byte(cmd, cp->scsi_status); in ncr_complete()
4861 set_host_byte(cmd, DID_ABORT); in ncr_complete()
4868 PRINT_ADDR(cmd, "COMMAND FAILED (%x %x) @%p.\n", in ncr_complete()
4871 set_status_byte(cmd, cp->scsi_status); in ncr_complete()
4872 set_host_byte(cmd, DID_ERROR); in ncr_complete()
4882 PRINT_ADDR(cmd, " CMD:"); in ncr_complete()
4883 p = (u_char*) &cmd->cmnd[0]; in ncr_complete()
4884 for (i=0; i<cmd->cmd_len; i++) printk (" %x", *p++); in ncr_complete()
4893 p = (u_char*) &cmd->sense_buffer; in ncr_complete()
4926 ncr_queue_done_cmd(np, cmd); in ncr_complete()
5341 if (!cp->cmd) continue; in ncr_set_sync_wide_status()
5342 if (scmd_id(cp->cmd) != target) continue; in ncr_set_sync_wide_status()
5357 struct scsi_cmnd *cmd = cp->cmd; in ncr_setsync() local
5362 BUG_ON(target != (scmd_id(cmd) & 0xf)); in ncr_setsync()
5414 struct scsi_cmnd *cmd = cp->cmd; in ncr_setwide() local
5420 BUG_ON(target != (scmd_id(cmd) & 0xf)); in ncr_setwide()
5439 dev_info(&cmd->device->sdev_target->dev, "WIDE SCSI %sabled.\n", in ncr_setwide()
6080 u_char cmd, sbcl; in ncr_int_ma() local
6087 cmd = dbc >> 24; in ncr_int_ma()
6095 if ((cmd & 1) == 0) { in ncr_int_ma()
6123 printk ("P%x%x RL=%d D=%d SS0=%x ", cmd&7, sbcl&7, in ncr_int_ma()
6128 printk ("P%x%x RL=%d ", cmd&7, sbcl&7, rest); in ncr_int_ma()
6143 if (!(cmd & 6)) { in ncr_int_ma()
6188 (unsigned)nxtdsp, vdsp, cmd); in ncr_int_ma()
6210 if (cmd & 0x10) { /* Table indirect */ in ncr_int_ma()
6231 if (cmd != (scr_to_cpu(vdsp[0]) >> 24)) { in ncr_int_ma()
6232 PRINT_ADDR(cp->cmd, "internal error: cmd=%02x != %02x=(vdsp[0] " in ncr_int_ma()
6233 ">> 24)\n", cmd, scr_to_cpu(vdsp[0]) >> 24); in ncr_int_ma()
6254 if (cmd & 0x06) { in ncr_int_ma()
6255 PRINT_ADDR(cp->cmd, "phase change %x-%x %d@%08x resid=%d.\n", in ncr_int_ma()
6256 cmd&7, sbcl&7, (unsigned)olen, in ncr_int_ma()
6277 newcmd[0] = cpu_to_scr(((cmd & 0x0f) << 24) | rest); in ncr_int_ma()
6283 PRINT_ADDR(cp->cmd, "newcmd[%d] %x %x %x %x.\n", in ncr_int_ma()
6329 switch (cmd & 7) { in ncr_int_ma()
6368 struct scsi_cmnd *cmd = cp->cmd; in ncr_sir_to_redo() local
6369 struct tcb *tp = &np->target[cmd->device->id]; in ncr_sir_to_redo()
6370 struct lcb *lp = tp->lp[cmd->device->lun]; in ncr_sir_to_redo()
6409 PRINT_ADDR(cmd, "QUEUE FULL! %d busy, %d disconnected " in ncr_sir_to_redo()
6415 ncr_setup_tags (np, cmd->device); in ncr_sir_to_redo()
6447 cp->scsi_smsg2[0] = IDENTIFY(0, cmd->device->lun); in ncr_sir_to_redo()
6454 cp->phys.cmd.addr = cpu_to_scr(CCB_PHYS (cp, sensecmd)); in ncr_sir_to_redo()
6455 cp->phys.cmd.size = cpu_to_scr(6); in ncr_sir_to_redo()
6461 cp->sensecmd[1] = (cmd->device->lun & 0x7) << 5; in ncr_sir_to_redo()
6492 if (cmd->device->select_no_atn) in ncr_sir_to_redo()
6674 PRINT_ADDR(cp->cmd, "negotiation failed sir=%x " in ncr_int_sir()
6750 PRINT_ADDR(cp->cmd, "sync: per=%d scntl3=0x%x ofs=%d " in ncr_int_sir()
6837 PRINT_ADDR(cp->cmd, "wide: wide=%d chg=%d.\n", wide, in ncr_int_sir()
6903 PRINT_ADDR(cp->cmd, "MESSAGE_REJECT received (%x:%x).\n", in ncr_int_sir()
6934 PRINT_ADDR(cp->cmd, "IGNORE_WIDE_RESIDUE received, but not yet " in ncr_int_sir()
6947 PRINT_ADDR(cp->cmd, "DISCONNECT received, but datapointer " in ncr_int_sir()
6969 static struct ccb *ncr_get_ccb(struct ncb *np, struct scsi_cmnd *cmd) in ncr_get_ccb() argument
6971 u_char tn = cmd->device->id; in ncr_get_ccb()
6972 u_char ln = cmd->device->lun; in ncr_get_ccb()
7002 PRINT_ADDR(cmd, "ccb free list corrupted " in ncr_get_ccb()
7065 PRINT_ADDR(cmd, "ccb @%p using tag %d.\n", cp, tag); in ncr_get_ccb()
7086 PRINT_ADDR(cp->cmd, "ccb @%p freeing tag %d.\n", cp, cp->tag); in ncr_free_ccb()
7473 static int ncr_scatter(struct ncb *np, struct ccb *cp, struct scsi_cmnd *cmd) in ncr_scatter() argument
7476 int use_sg = scsi_sg_count(cmd); in ncr_scatter()
7480 use_sg = map_scsi_sg_data(np, cmd); in ncr_scatter()
7486 unmap_scsi_data(np, cmd); in ncr_scatter()
7492 scsi_for_each_sg(cmd, sg, use_sg, segment) { in ncr_scatter()
7854 static int ncr53c8xx_queue_command_lck(struct scsi_cmnd *cmd) argument
7856 struct ncr_cmd_priv *cmd_priv = scsi_cmd_priv(cmd);
7858 struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb;
7866 cmd->host_scribble = NULL;
7872 if ((sts = ncr_queue_command(np, cmd)) != DID_OK) {
7873 set_host_byte(cmd, sts);
7886 unmap_scsi_data(np, cmd);
7887 done(cmd);
7939 static int ncr53c8xx_bus_reset(struct scsi_cmnd *cmd) argument
7941 struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb;
7981 static void insert_into_waiting_list(struct ncb *np, struct scsi_cmnd *cmd) argument
7986 printk("%s: cmd %lx inserted into waiting list\n", ncr_name(np), (u_long) cmd);
7988 cmd->next_wcmd = NULL;
7989 if (!(wcmd = np->waiting_list)) np->waiting_list = cmd;
7993 wcmd->next_wcmd = (char *) cmd;