[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/7] megasas: add MegaRAID SAS 2108 emulation
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH 3/7] megasas: add MegaRAID SAS 2108 emulation |
Date: |
Wed, 16 Apr 2014 15:42:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Am 16.04.2014 09:16, schrieb Hannes Reinecke:
> The 2108 chip supports MSI and MSI-X, so update the emulation
> to support both chips.
>
> Signed-off-by: Hannes Reinecke <address@hidden>
> ---
> hw/scsi/megasas.c | 95
> ++++++++++++++++++++++++++++++++++++++++++------
> hw/scsi/mfi.h | 7 ++++
> include/hw/pci/pci_ids.h | 1 +
> 3 files changed, 91 insertions(+), 12 deletions(-)
>
> diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
> index ae3e9d6..687115e 100644
> --- a/hw/scsi/megasas.c
> +++ b/hw/scsi/megasas.c
[...]
> @@ -1890,6 +1903,8 @@ static uint64_t megasas_mmio_read(void *opaque, hwaddr
> addr,
> unsigned size)
> {
> MegasasState *s = opaque;
> + PCIDevice *pci_dev = PCI_DEVICE(s);
> + PCIDeviceClass *pci_class = PCI_DEVICE_GET_CLASS(pci_dev);
Seeing that you don't use pci_dev elsewhere, you can just pass s to this
macro directly.
Cheers,
Andreas
> uint32_t retval = 0;
>
> switch (addr) {
> @@ -1905,7 +1920,11 @@ static uint64_t megasas_mmio_read(void *opaque, hwaddr
> addr,
> break;
> case MFI_OSTS:
> if (megasas_intr_enabled(s) && s->doorbell) {
> - retval = MFI_1078_RM | 1;
> + if (megasas_is_gen2(pci_class)) {
> + retval = MFI_GEN2_RM;
> + } else {
> + retval = MFI_1078_RM | 1;
> + }
> }
> break;
> case MFI_OMSK:
> @@ -1914,6 +1933,9 @@ static uint64_t megasas_mmio_read(void *opaque, hwaddr
> addr,
> case MFI_ODCR0:
> retval = s->doorbell;
> break;
> + case MFI_DIAG:
> + retval = s->diag;
> + break;
> default:
> trace_megasas_mmio_invalid_readl(addr);
> break;
> @@ -1922,6 +1944,8 @@ static uint64_t megasas_mmio_read(void *opaque, hwaddr
> addr,
> return retval;
> }
>
> +static int adp_reset_seq[] = {0x00, 0x04, 0x0b, 0x02, 0x07, 0x0d};
> +
> static void megasas_mmio_write(void *opaque, hwaddr addr,
> uint64_t val, unsigned size)
> {
[snip]
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH 0/7] megasas Update, Hannes Reinecke, 2014/04/16
- [Qemu-devel] [PATCH 2/7] megasas: Add MSI support, Hannes Reinecke, 2014/04/16
- [Qemu-devel] [PATCH 3/7] megasas: add MegaRAID SAS 2108 emulation, Hannes Reinecke, 2014/04/16
- Re: [Qemu-devel] [PATCH 3/7] megasas: add MegaRAID SAS 2108 emulation,
Andreas Färber <=
- [Qemu-devel] [PATCH 4/7] megasas: simplify trace event messages, Hannes Reinecke, 2014/04/16
- [Qemu-devel] [PATCH 5/7] megasas: Implement LD_LIST_QUERY, Hannes Reinecke, 2014/04/16
[Qemu-devel] [PATCH 6/7] megasas: Decode register names, Hannes Reinecke, 2014/04/16
[Qemu-devel] [PATCH 7/7] MAINTAINERS: mark megasas as maintained, Hannes Reinecke, 2014/04/16
Re: [Qemu-devel] [PATCH 0/7] megasas Update, Alexander Graf, 2014/04/16