From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] ESP: fix CFG2 register
Date: Fri, 25 Apr 2008 10:42:19 +0200 [thread overview]
Message-ID: <4811996B.30506@reactos.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 199 bytes --]
Hi,
In ESP SCSI adapter, all bits of CFG2 register should be writable.
Exception is that bits 7 and 6 can only be reset by an adapter reset.
Attached patch implements this behaviour.
Hervé
[-- Attachment #2: esp_cfg2.diff --]
[-- Type: text/plain, Size: 1030 bytes --]
Index: hw/esp.c
===================================================================
--- hw/esp.c (revision 4252)
+++ hw/esp.c (working copy)
@@ -139,7 +139,11 @@
#define CFG1_RESREPT 0x40
-#define CFG2_MASK 0x15
+enum {
+ CFG2_S2FE = 0x08, /* SCSI-2 Features Enable */
+ CFG2_LSP = 0x40, /* Latch SCSI Phase */
+ CFG2_DAE = 0x80, /* Data Alignment Enable */
+};
#define TCHI_FAS100A 0x4
@@ -202,6 +206,8 @@
int32_t datalen;
int lun;
+ /* XXX: Check if SCSI-2 commands are enabled (CFG2_S2FE) */
+
DPRINTF("do_cmd: busid 0x%x\n", buf[0]);
lun = buf[0] & 7;
datalen = s->current_dev->send_command(s->current_dev, 0, &buf[1], lun);
@@ -548,7 +554,8 @@
case ESP_WCCF ... ESP_WTEST:
break;
case ESP_CFG2:
- s->rregs[saddr] = val & CFG2_MASK;
+ /* CFG2_DAE and CFG2_LSP can't be reset */
+ s->rregs[saddr] = val | (s->rregs[saddr] & (CFG2_DAE | CFG2_LSP));
break;
case ESP_CFG3 ... ESP_RES4:
s->rregs[saddr] = val;
reply other threads:[~2008-04-25 8:42 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=4811996B.30506@reactos.org \
--to=hpoussin@reactos.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.