On 07/03/2012 09:09 PM, Blue Swirl wrote: > On Mon, Jul 2, 2012 at 9:41 AM, Paolo Bonzini <pbonz...@redhat.com> wrote: >> From: Hannes Reinecke <h...@suse.de> >> >> This patch adds an emulation for the LSI Megaraid SAS 8708EM2 HBA. >> I've tested it to work with Linux, Windows Vista, and Windows7. >> >> Signed-off-by: Hannes Reinecke <h...@suse.de> >> [ Squashed tracing patch (no need to keep it separate) and trivial changes >> from Andreas Faerber. Rebased over IOMMU and QBus changes. - Paolo ] >> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> >> --- >> default-configs/pci.mak | 1 + >> hw/Makefile.objs | 1 + >> hw/megasas.c | 2198 >> +++++++++++++++++++++++++++++++++++++++++++++++ >> hw/pci_ids.h | 2 + >> trace-events | 79 ++ >> 5 files changed, 2281 insertions(+) >> create mode 100644 hw/megasas.c >> >> diff --git a/default-configs/pci.mak b/default-configs/pci.mak >> index 9d3e1db..4b49c00 100644 >> --- a/default-configs/pci.mak >> +++ b/default-configs/pci.mak >> @@ -10,6 +10,7 @@ CONFIG_EEPRO100_PCI=y >> CONFIG_PCNET_PCI=y >> CONFIG_PCNET_COMMON=y >> CONFIG_LSI_SCSI_PCI=y >> +CONFIG_MEGASAS_SCSI_PCI=y >> CONFIG_RTL8139_PCI=y >> CONFIG_E1000_PCI=y >> CONFIG_IDE_CORE=y >> diff --git a/hw/Makefile.objs b/hw/Makefile.objs >> index 3d77259..9a350de 100644 >> --- a/hw/Makefile.objs >> +++ b/hw/Makefile.objs >> @@ -86,6 +86,7 @@ hw-obj-$(CONFIG_OPENCORES_ETH) += opencores_eth.o >> >> # SCSI layer >> hw-obj-$(CONFIG_LSI_SCSI_PCI) += lsi53c895a.o >> +hw-obj-$(CONFIG_MEGASAS_SCSI_PCI) += megasas.o >> hw-obj-$(CONFIG_ESP) += esp.o >> >> hw-obj-y += sysbus.o isa-bus.o >> diff --git a/hw/megasas.c b/hw/megasas.c >> new file mode 100644 >> index 0000000..b48836f >> --- /dev/null >> +++ b/hw/megasas.c >> @@ -0,0 +1,2198 @@ >> +/* >> + * QEMU MegaRAID SAS 8708EM2 Host Bus Adapter emulation >> + * Based on the linux driver code at drivers/scsi/megaraid >> + * >> + * Copyright (c) 2009-2012 Hannes Reinecke, SUSE Labs >> + * >> + * This library is free software; you can redistribute it and/or >> + * modify it under the terms of the GNU Lesser General Public >> + * License as published by the Free Software Foundation; either >> + * version 2 of the License, or (at your option) any later version. >> + * >> + * This library is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >> + * Lesser General Public License for more details. >> + * >> + * You should have received a copy of the GNU Lesser General Public >> + * License along with this library; if not, see >> <http://www.gnu.org/licenses/>. >> + */ >> + >> +#include "hw.h" >> +#include "pci.h" >> +#include "dma.h" >> +#include "msix.h" >> +#include "iov.h" >> +#include "scsi.h" >> +#include "scsi-defs.h" >> +#include "block_int.h" >> +#include "trace.h" >> + >> +#include "mfi.h" > > A pointer to chip set docs would be nice. > Oh, do you have some? I would _love_ to add it, what with me having developed this thing without it ...
No, seriously: I haven't managed to get any documentation for this beast. LSI hasn't been exactly forthcoming with help here. [ .. ] >> + >> +const char *mfi_frame_desc[] = { > > Missing 'static'. > If you insist ... [ .. ] Hey, cool. Just one issue. Paolo, can you fix it up in your tree or should I re-send the patch? Cheers, Hannes -- Dr. Hannes Reinecke zSeries & Storage h...@suse.de +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)