From: Vladislav B. <vs...@vl...> - 2006-09-07 09:38:06
|
wwhistory wrote: > hi, > > In the function "scst_alloc_add_tgt_dev"(scst_lib.c), we set the > &tgt_dev->tgt_dev_flags to SCST_TGT_DEV_RESETTED, as follows: > > __set_bit(SCST_TGT_DEV_RESETTED, &tgt_dev->tgt_dev_flags); > > In the function "scst_pre_exec"(scst_targ.c), we see: > > if (unlikely(test_bit(SCST_TGT_DEV_RESETTED, &tgt_dev->tgt_dev_flags)) > && scst_is_ua_command(cmd)) > { > struct scst_device *dev = cmd->dev; > int done = 0; > spin_lock_bh(&dev->dev_lock); > if (test_bit(SCST_TGT_DEV_RESETTED, &tgt_dev->tgt_dev_flags)) { > printk("SCST_TGT_DEV_RESETTED set\n"); > clear_bit(SCST_TGT_DEV_RESETTED, > &tgt_dev->tgt_dev_flags); > scst_set_cmd_error(cmd, > SCST_LOAD_SENSE(scst_sense_reset_UA)); > cmd->ua_ignore = 1; > clear_bit(SCST_CMD_ABORTED, &cmd->cmd_flags); > clear_bit(SCST_CMD_NO_RESP, &cmd->cmd_flags); > done = 1; > } > spin_unlock_bh(&dev->dev_lock); > > if (done) { > res = SCST_EXEC_COMPLETED; > /* Report the result */ > scst_cmd_done_local(cmd, SCST_CMD_STATE_DEFAULT); > goto out; > } > } > > Here I found the first commad except of INQUIRY, REQUEST_SENSE and > REPORT_LUNS will satisfy the if condition, and then scst_set_cmd_error. > Then the next command is REQUEST_SENSE. I don't know why we set the > &tgt_dev->tgt_dev_flags to SCST_TGT_DEV_RESETTED in the function > "scst_alloc_add_tgt_dev"(scst_lib.c). Can somebody help me? It's set, because according to SAM the target shall send POWER ON (aka RESET) Unit Attention on the first command after power on or reset. > ------------------------------------------------------------------------ > wwhistory > 2006-09-07 > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > ------------------------------------------------------------------------ > > _______________________________________________ > Scst-devel mailing list > Scs...@li... > https://lists.sourceforge.net/lists/listinfo/scst-devel |