From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Cc: "Blue Swirl" <blauwirbel@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Kevin Wolf" <kwolf@redhat.com>
Subject: [Qemu-devel] [PATCH v3 06/10] esp: use hba_private field instead of a complex cast
Date: Mon, 9 Jul 2012 12:02:27 +0200 [thread overview]
Message-ID: <1341828152-15199-7-git-send-email-hpoussin@reactos.org> (raw)
In-Reply-To: <1341828152-15199-1-git-send-email-hpoussin@reactos.org>
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
hw/esp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/esp.c b/hw/esp.c
index a1f5b8a..d9dd2aa 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -186,7 +186,7 @@ static void esp_dma_enable(void *opaque, int irq, int level)
static void esp_request_cancelled(SCSIRequest *req)
{
- ESPState *s = DO_UPCAST(ESPState, busdev.qdev, req->bus->qbus.parent);
+ ESPState *s = req->hba_private;
if (req == s->current_req) {
scsi_req_unref(s->current_req);
@@ -242,7 +242,7 @@ static void do_busid_cmd(ESPState *s, uint8_t *buf, uint8_t busid)
trace_esp_do_busid_cmd(busid);
lun = busid & 7;
current_lun = scsi_device_find(&s->bus, 0, s->current_dev->id, lun);
- s->current_req = scsi_req_new(current_lun, 0, lun, buf, NULL);
+ s->current_req = scsi_req_new(current_lun, 0, lun, buf, s);
datalen = scsi_req_enqueue(s->current_req);
s->ti_size = datalen;
if (datalen != 0) {
@@ -396,7 +396,7 @@ static void esp_do_dma(ESPState *s)
static void esp_command_complete(SCSIRequest *req, uint32_t status,
size_t resid)
{
- ESPState *s = DO_UPCAST(ESPState, busdev.qdev, req->bus->qbus.parent);
+ ESPState *s = req->hba_private;
trace_esp_command_complete();
if (s->ti_size != 0) {
@@ -420,7 +420,7 @@ static void esp_command_complete(SCSIRequest *req, uint32_t status,
static void esp_transfer_data(SCSIRequest *req, uint32_t len)
{
- ESPState *s = DO_UPCAST(ESPState, busdev.qdev, req->bus->qbus.parent);
+ ESPState *s = req->hba_private;
trace_esp_transfer_data(s->dma_left, s->ti_size);
s->async_len = len;
--
1.7.10.4
next prev parent reply other threads:[~2012-07-09 10:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-09 10:02 [Qemu-devel] [PATCH v3 00/10] esp: add AMD PCscsi emulation Hervé Poussineau
2012-07-09 10:02 ` [Qemu-devel] [PATCH v3 01/10] esp: execute select commands immediately when it is a non-dma command Hervé Poussineau
2012-07-09 10:02 ` [Qemu-devel] [PATCH v3 02/10] esp: delay Transfer Information command if dma is not enabled Hervé Poussineau
2012-07-09 10:02 ` [Qemu-devel] [PATCH v3 03/10] esp: implement Disable selection command Hervé Poussineau
2012-07-09 10:02 ` [Qemu-devel] [PATCH v3 04/10] esp: implement Reset ATN command Hervé Poussineau
2012-07-09 10:02 ` [Qemu-devel] [PATCH v3 05/10] esp: support future change of chip_id Hervé Poussineau
2012-07-09 10:02 ` Hervé Poussineau [this message]
2012-07-09 10:02 ` [Qemu-devel] [PATCH v3 07/10] esp: split esp code into generic chip emulation and sysbus layer Hervé Poussineau
2012-07-09 10:02 ` [Qemu-devel] [PATCH v3 08/10] esp: use trace framework instead of stderr output Hervé Poussineau
2012-07-09 10:02 ` [Qemu-devel] [PATCH v3 09/10] pci: add some stubs Hervé Poussineau
2012-07-09 10:02 ` [Qemu-devel] [PATCH v3 10/10] esp: add AMD PCscsi emulation (PCI SCSI adapter) Hervé Poussineau
2012-07-14 12:18 ` [Qemu-devel] [PATCH v3 00/10] esp: add AMD PCscsi emulation Blue Swirl
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=1341828152-15199-7-git-send-email-hpoussin@reactos.org \
--to=hpoussin@reactos.org \
--cc=blauwirbel@gmail.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.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).