Displaying 11 results from an estimated 11 matches for "sam_stat_check_condition".
2009 Oct 27
0
[PATCH 4/4] megasas: Add SCSI command emulation
...cmd->sense_len;
- ret = bdrv_ioctl(cmd->lun->bdrv, SG_IO, &cmd->hdr);
- if (ret) {
- DPRINTF("SCSI pthru dev %x lun %x failed with %d\n",
- target, lun, errno);
- sense_len = scsi_build_sense(cmd->sense, SENSE_IO_ERROR);
- cmd->sge_size = 0;
- scsi_status = SAM_STAT_CHECK_CONDITION;
- } else if (cmd->hdr.status) {
- sense_len = cmd->hdr.sb_len_wr;
- scsi_status = cmd->hdr.status;
- cmd->sge_size = cmd->hdr.dxfer_len;
- scsi_status = SAM_STAT_CHECK_CONDITION;
+ ret = bdrv_ioctl(cmd->lun->bdrv, SG_IO, &cmd->hdr);
+ if (ret) {
+ DPRINTF("S...
2009 Oct 27
0
[PATCH 4/4] megasas: Add SCSI command emulation
...cmd->sense_len;
- ret = bdrv_ioctl(cmd->lun->bdrv, SG_IO, &cmd->hdr);
- if (ret) {
- DPRINTF("SCSI pthru dev %x lun %x failed with %d\n",
- target, lun, errno);
- sense_len = scsi_build_sense(cmd->sense, SENSE_IO_ERROR);
- cmd->sge_size = 0;
- scsi_status = SAM_STAT_CHECK_CONDITION;
- } else if (cmd->hdr.status) {
- sense_len = cmd->hdr.sb_len_wr;
- scsi_status = cmd->hdr.status;
- cmd->sge_size = cmd->hdr.dxfer_len;
- scsi_status = SAM_STAT_CHECK_CONDITION;
+ ret = bdrv_ioctl(cmd->lun->bdrv, SG_IO, &cmd->hdr);
+ if (ret) {
+ DPRINTF("S...
2009 Oct 27
1
[PATCH 2/4] megasas: LSI MegaRAID SAS HBA emulation
......) do {} while(0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "megasas: error: " fmt , ## __VA_ARGS__);} while (0)
+#endif
+
+/* Static definitions */
+#define MEGASAS_MAX_FRAMES 64
+#define MEGASAS_MAX_SGE 8
+
+/* SCSI definitions */
+#define SAM_STAT_GOOD 0x00
+#define SAM_STAT_CHECK_CONDITION 0x02
+#define SAM_STAT_CONDITION_MET 0x04
+#define SAM_STAT_BUSY 0x08
+#define SAM_STAT_TASK_ABORTED 0x40
+
+/* Register definitions */
+#define MEGASAS_INBOUND_MSG_0 0x0010
+#define MEGASAS_INBOUND_MSG_1 0x0014
+#define MEGASAS_OUTBOUND_MSG_0 0x0018
+#define MEGASAS_OUTBOUND_...
2009 Oct 27
1
[PATCH 2/4] megasas: LSI MegaRAID SAS HBA emulation
......) do {} while(0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "megasas: error: " fmt , ## __VA_ARGS__);} while (0)
+#endif
+
+/* Static definitions */
+#define MEGASAS_MAX_FRAMES 64
+#define MEGASAS_MAX_SGE 8
+
+/* SCSI definitions */
+#define SAM_STAT_GOOD 0x00
+#define SAM_STAT_CHECK_CONDITION 0x02
+#define SAM_STAT_CONDITION_MET 0x04
+#define SAM_STAT_BUSY 0x08
+#define SAM_STAT_TASK_ABORTED 0x40
+
+/* Register definitions */
+#define MEGASAS_INBOUND_MSG_0 0x0010
+#define MEGASAS_INBOUND_MSG_1 0x0014
+#define MEGASAS_OUTBOUND_MSG_0 0x0018
+#define MEGASAS_OUTBOUND_...
2009 Sep 30
1
SCSI driver for VMware's virtual HBA - V5.
...0;
> +
> + if (sdstat != SAM_STAT_GOOD &&
> + (btstat == BTSTAT_SUCCESS ||
> + btstat == BTSTAT_LINKED_COMMAND_COMPLETED ||
> + btstat == BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG)) {
> + cmd->result = (DID_OK << 16) | sdstat;
> + if (sdstat == SAM_STAT_CHECK_CONDITION && cmd->sense_buffer)
> + cmd->result |= (DRIVER_SENSE << 24);
> + } else
> + switch (btstat) {
> + case BTSTAT_SUCCESS:
> + case BTSTAT_LINKED_COMMAND_COMPLETED:
> + case BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG:
> + /* If everything went fine, let...
2009 Sep 30
1
SCSI driver for VMware's virtual HBA - V5.
...0;
> +
> + if (sdstat != SAM_STAT_GOOD &&
> + (btstat == BTSTAT_SUCCESS ||
> + btstat == BTSTAT_LINKED_COMMAND_COMPLETED ||
> + btstat == BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG)) {
> + cmd->result = (DID_OK << 16) | sdstat;
> + if (sdstat == SAM_STAT_CHECK_CONDITION && cmd->sense_buffer)
> + cmd->result |= (DRIVER_SENSE << 24);
> + } else
> + switch (btstat) {
> + case BTSTAT_SUCCESS:
> + case BTSTAT_LINKED_COMMAND_COMPLETED:
> + case BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG:
> + /* If everything went fine, let...
2009 Oct 13
1
SCSI driver for VMware's virtual HBA - V6.
...t(adapter, ctx);
+ cmd->result = 0;
+
+ if (sdstat != SAM_STAT_GOOD &&
+ (btstat == BTSTAT_SUCCESS ||
+ btstat == BTSTAT_LINKED_COMMAND_COMPLETED ||
+ btstat == BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG)) {
+ cmd->result = (DID_OK << 16) | sdstat;
+ if (sdstat == SAM_STAT_CHECK_CONDITION && cmd->sense_buffer)
+ cmd->result |= (DRIVER_SENSE << 24);
+ } else
+ switch (btstat) {
+ case BTSTAT_SUCCESS:
+ case BTSTAT_LINKED_COMMAND_COMPLETED:
+ case BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG:
+ /* If everything went fine, let's move on.. */
+ cmd->re...
2009 Oct 13
1
SCSI driver for VMware's virtual HBA - V6.
...t(adapter, ctx);
+ cmd->result = 0;
+
+ if (sdstat != SAM_STAT_GOOD &&
+ (btstat == BTSTAT_SUCCESS ||
+ btstat == BTSTAT_LINKED_COMMAND_COMPLETED ||
+ btstat == BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG)) {
+ cmd->result = (DID_OK << 16) | sdstat;
+ if (sdstat == SAM_STAT_CHECK_CONDITION && cmd->sense_buffer)
+ cmd->result |= (DRIVER_SENSE << 24);
+ } else
+ switch (btstat) {
+ case BTSTAT_SUCCESS:
+ case BTSTAT_LINKED_COMMAND_COMPLETED:
+ case BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG:
+ /* If everything went fine, let's move on.. */
+ cmd->re...
2007 Jan 02
0
[PATCH 1/4] add scsi-target and IO_CMD_EPOLL_WAIT patches
...atus;
++ if (status) {
++ uint8_t *sense = iu->srp.rsp.data;
++
++ if (sc) {
++ iu->srp.rsp.flags |= SRP_RSP_FLAG_SNSVALID;
++ iu->srp.rsp.sense_data_len = SCSI_SENSE_BUFFERSIZE;
++ memcpy(sense, sc->sense_buffer, SCSI_SENSE_BUFFERSIZE);
++ } else {
++ iu->srp.rsp.status = SAM_STAT_CHECK_CONDITION;
++ iu->srp.rsp.flags |= SRP_RSP_FLAG_SNSVALID;
++ iu->srp.rsp.sense_data_len = SRP_RSP_SENSE_DATA_LEN;
++
++ /* Valid bit and ''current errors'' */
++ sense[0] = (0x1 << 7 | 0x70);
++ /* Sense key */
++ sense[2] = status;
++ /* Additional sense length */
+...
2020 Oct 17
10
[RFC] treewide: cleanup unreachable breaks
...ptiop.c
index 6a2561f26e38..db4c7a7ff4dd 100644
--- a/drivers/scsi/hptiop.c
+++ b/drivers/scsi/hptiop.c
@@ -756,11 +756,10 @@ static void hptiop_finish_scsi_req(struct hptiop_hba *hba, u32 tag,
scsi_set_resid(scp,
scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length));
scp->result = SAM_STAT_CHECK_CONDITION;
memcpy(scp->sense_buffer, &req->sg_list, SCSI_SENSE_BUFFERSIZE);
goto skip_resid;
- break;
default:
scp->result = DRIVER_INVALID << 24 | DID_ABORT << 16;
break;
}
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index b0aa58d117cc..e451102b9a29 10064...
2020 Oct 17
10
[RFC] treewide: cleanup unreachable breaks
...ptiop.c
index 6a2561f26e38..db4c7a7ff4dd 100644
--- a/drivers/scsi/hptiop.c
+++ b/drivers/scsi/hptiop.c
@@ -756,11 +756,10 @@ static void hptiop_finish_scsi_req(struct hptiop_hba *hba, u32 tag,
scsi_set_resid(scp,
scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length));
scp->result = SAM_STAT_CHECK_CONDITION;
memcpy(scp->sense_buffer, &req->sg_list, SCSI_SENSE_BUFFERSIZE);
goto skip_resid;
- break;
default:
scp->result = DRIVER_INVALID << 24 | DID_ABORT << 16;
break;
}
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index b0aa58d117cc..e451102b9a29 10064...