Patchwork esp: correctly fill bus id with requested lun

login
register
mail settings
Submitter Hervé Poussineau
Date July 2, 2011, 3:23 p.m.
Message ID <1309620180-12652-1-git-send-email-hpoussin@reactos.org>
Download mbox | patch
Permalink /patch/102994/
State New
Headers show

Comments

Hervé Poussineau - July 2, 2011, 3:23 p.m.
This bug showed up after 1455084ea2c48abf23c4e4e15e378ee43457f381, and
may be seen only on operating systems *not* using DMA to give commands
to SCSI adapter.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/esp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Blue Swirl - July 2, 2011, 8:38 p.m.
Thanks, applied.

2011/7/2 Hervé Poussineau <hpoussin@reactos.org>:
> This bug showed up after 1455084ea2c48abf23c4e4e15e378ee43457f381, and
> may be seen only on operating systems *not* using DMA to give commands
> to SCSI adapter.
>
> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
> ---
>  hw/esp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/esp.c b/hw/esp.c
> index 6d3f5d2..8e95672 100644
> --- a/hw/esp.c
> +++ b/hw/esp.c
> @@ -211,7 +211,7 @@ static uint32_t get_cmd(ESPState *s, uint8_t *buf)
>     } else {
>         dmalen = s->ti_size;
>         memcpy(buf, s->ti_buf, dmalen);
> -        buf[0] = 0;
> +        buf[0] = buf[2] >> 5;
>     }
>     DPRINTF("get_cmd: len %d target %d\n", dmalen, target);
>
> --
> 1.7.5.4
>
>
>
Artyom Tarasenko - July 21, 2011, 11:22 p.m.
2011/7/2 Hervé Poussineau <hpoussin@reactos.org>:
> This bug showed up after 1455084ea2c48abf23c4e4e15e378ee43457f381, and
> may be seen only on operating systems *not* using DMA to give commands
> to SCSI adapter.
>
> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
> ---
>  hw/esp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/esp.c b/hw/esp.c
> index 6d3f5d2..8e95672 100644
> --- a/hw/esp.c
> +++ b/hw/esp.c
> @@ -211,7 +211,7 @@ static uint32_t get_cmd(ESPState *s, uint8_t *buf)
>     } else {
>         dmalen = s->ti_size;
>         memcpy(buf, s->ti_buf, dmalen);
> -        buf[0] = 0;
> +        buf[0] = buf[2] >> 5;

why this byte needs to be overwritten? Doesn't ti_buf have a bus id?

>     }
>     DPRINTF("get_cmd: len %d target %d\n", dmalen, target);
>
> --
> 1.7.5.4
>
>
>

Patch

diff --git a/hw/esp.c b/hw/esp.c
index 6d3f5d2..8e95672 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -211,7 +211,7 @@  static uint32_t get_cmd(ESPState *s, uint8_t *buf)
     } else {
         dmalen = s->ti_size;
         memcpy(buf, s->ti_buf, dmalen);
-        buf[0] = 0;
+        buf[0] = buf[2] >> 5;
     }
     DPRINTF("get_cmd: len %d target %d\n", dmalen, target);