From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4280] Revert v4260, breaks Sparc32
Date: Tue, 29 Apr 2008 16:08:55 +0000 [thread overview]
Message-ID: <E1JqsNy-00029c-W8@cvs.savannah.gnu.org> (raw)
Revision: 4280
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4280
Author: blueswir1
Date: 2008-04-29 16:08:54 +0000 (Tue, 29 Apr 2008)
Log Message:
-----------
Revert v4260, breaks Sparc32
Modified Paths:
--------------
trunk/hw/scsi-disk.c
Modified: trunk/hw/scsi-disk.c
===================================================================
--- trunk/hw/scsi-disk.c 2008-04-29 05:58:01 UTC (rev 4279)
+++ trunk/hw/scsi-disk.c 2008-04-29 16:08:54 UTC (rev 4280)
@@ -34,18 +34,6 @@
#define SENSE_HARDWARE_ERROR 4
#define SENSE_ILLEGAL_REQUEST 5
-#define SCSI_OK 0
-#define SCSI_CHECK_COND 0x2
-#define SCSI_COND_MET 0x4
-#define SCSI_BUSY 0x8
-#define SCSI_INTERMEDIATE 0x10
-#define SCSI_INTER_MET 0x14
-#define SCSI_RES_CONFLICT 0x18
-#define SCSI_CMD_TERMINATED 0x22
-#define SCSI_QUEUE_FULL 0x28
-#define SCSI_ACA_ACTIVE 0x30
-#define SCSI_TASK_ABORTED 0x40
-
#define SCSI_DMA_BUF_SIZE 65536
typedef struct SCSIRequest {
@@ -136,7 +124,7 @@
}
/* Helper function for command completion. */
-static void scsi_command_complete(SCSIRequest *r, int status, int sense)
+static void scsi_command_complete(SCSIRequest *r, int sense)
{
SCSIDeviceState *s = r->dev;
uint32_t tag;
@@ -144,7 +132,7 @@
s->sense = sense;
tag = r->tag;
scsi_remove_request(r);
- s->completion(s->opaque, SCSI_REASON_DONE, tag, status);
+ s->completion(s->opaque, SCSI_REASON_DONE, tag, sense);
}
/* Cancel a pending data transfer. */
@@ -169,7 +157,7 @@
if (ret) {
DPRINTF("IO error\n");
- scsi_command_complete(r, SCSI_CHECK_COND, SENSE_HARDWARE_ERROR);
+ scsi_command_complete(r, SENSE_HARDWARE_ERROR);
return;
}
DPRINTF("Data ready tag=0x%x len=%d\n", r->tag, r->buf_len);
@@ -187,7 +175,8 @@
r = scsi_find_request(s, tag);
if (!r) {
BADF("Bad read tag 0x%x\n", tag);
- scsi_command_complete(r, SCSI_CHECK_COND, SENSE_HARDWARE_ERROR);
+ /* ??? This is the wrong error. */
+ scsi_command_complete(r, SENSE_HARDWARE_ERROR);
return;
}
if (r->sector_count == (uint32_t)-1) {
@@ -198,7 +187,7 @@
}
DPRINTF("Read sector_count=%d\n", r->sector_count);
if (r->sector_count == 0) {
- scsi_command_complete(r, SCSI_OK, SENSE_NO_SENSE);
+ scsi_command_complete(r, SENSE_NO_SENSE);
return;
}
@@ -210,7 +199,7 @@
r->aiocb = bdrv_aio_read(s->bdrv, r->sector, r->dma_buf, n,
scsi_read_complete, r);
if (r->aiocb == NULL)
- scsi_command_complete(r, SCSI_CHECK_COND, SENSE_HARDWARE_ERROR);
+ scsi_command_complete(r, SENSE_HARDWARE_ERROR);
r->sector += n;
r->sector_count -= n;
}
@@ -228,7 +217,7 @@
r->aiocb = NULL;
if (r->sector_count == 0) {
- scsi_command_complete(r, SCSI_OK, SENSE_NO_SENSE);
+ scsi_command_complete(r, SENSE_NO_SENSE);
} else {
len = r->sector_count * 512;
if (len > SCSI_DMA_BUF_SIZE) {
@@ -252,7 +241,7 @@
r = scsi_find_request(s, tag);
if (!r) {
BADF("Bad write tag 0x%x\n", tag);
- scsi_command_complete(r, SCSI_CHECK_COND, SENSE_HARDWARE_ERROR);
+ scsi_command_complete(r, SENSE_HARDWARE_ERROR);
return 1;
}
if (r->aiocb)
@@ -262,7 +251,7 @@
r->aiocb = bdrv_aio_write(s->bdrv, r->sector, r->dma_buf, n,
scsi_write_complete, r);
if (r->aiocb == NULL)
- scsi_command_complete(r, SCSI_CHECK_COND, SENSE_HARDWARE_ERROR);
+ scsi_command_complete(r, SENSE_HARDWARE_ERROR);
r->sector += n;
r->sector_count -= n;
} else {
@@ -612,7 +601,7 @@
outbuf[7] = 0;
r->buf_len = 8;
} else {
- scsi_command_complete(r, SCSI_CHECK_COND, SENSE_NOT_READY);
+ scsi_command_complete(r, SENSE_NOT_READY);
return 0;
}
break;
@@ -699,11 +688,11 @@
default:
DPRINTF("Unknown SCSI command (%2.2x)\n", buf[0]);
fail:
- scsi_command_complete(r, SCSI_CHECK_COND, SENSE_ILLEGAL_REQUEST);
+ scsi_command_complete(r, SENSE_ILLEGAL_REQUEST);
return 0;
}
if (r->sector_count == 0 && r->buf_len == 0) {
- scsi_command_complete(r, SCSI_OK, SENSE_NO_SENSE);
+ scsi_command_complete(r, SENSE_NO_SENSE);
}
len = r->sector_count * 512 + r->buf_len;
if (is_write) {
reply other threads:[~2008-04-29 16:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1JqsNy-00029c-W8@cvs.savannah.gnu.org \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).