megasas: LSI Megaraid SAS emulation
PATCH 1/1 megasas: LSI Megaraid SAS emulation
This patch adds an emulation for the LSI Megaraid SAS HBA.
Signed-off-by Hannes Reinecke <[email protected]>
--- Makefile.objs | 2 +- hw/megasas.c | 1826 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ hw/mfi.h | 1197 +++++++++++++++++++++++++++++++++++++ hw/pci_ids.h | 2 + hw/scsi.h | 1 + 5 files changed, 3027 insertions(+), 1 deletions(-) create mode 100644 hw/megasas.c create mode 100644 hw/mfi.h
Makefile.objs +1 -1
@@ -231,7 +231,7 @@ hw-obj-$(CONFIG_IDE_MACIO) += ide/macio.o hw-obj-$(CONFIG_IDE_VIA) += ide/via.o # SCSI layer -hw-obj-y += lsi53c895a.o +hw-obj-y += lsi53c895a.o megasas.o hw-obj-$(CONFIG_ESP) += esp.o hw-obj-y += dma-helpers.o sysbus.o isa-bus.o
hw/megasas.c new file +1826 -0
1,826 lines not on this page · raw message
hw/mfi.h new file +1197 -0
1,166 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.6.0.2
Part of the diff is not shown here. View the raw message.
On Mon, Nov 22, 2010 at 10:15 AM, Hannes Reinecke <[email protected]> wrote:
Not a full review but two small things I noticed:
hw/megasas.c line 148
Quoted 11 lines
hw/megasas.c new file +11
-0+#define megasas_frame_set_cmd_status (f,v) \ + stb_phys((f) + offsetof(struct mfi_frame_header, cmd_status), v); + +#define megasas_frame_set_scsi_status (f,v) \ + stb_phys((f) + offsetof(struct mfi_frame_header, scsi_status), v); + +#define megasas_frame_get_cmd (f) \ + ldub_phys((f) + offsetof(struct mfi_frame_header, frame_cmd)) + +#define megasas_frame_get_context (f) \ + ldl_phys(frame_addr + offsetof(struct mfi_frame_header, context));
These macros include a semicolon. They should be wrapped in:
do { ... } while (0)
hw/megasas.c line 1729
Quoted 5 lines
hw/megasas.c new file +5
-0+static int megasas_scsi_uninit (PCIDevice *d) +{ + MPTState *s = DO_UPCAST(MPTState, dev, d); + + cpu_unregister_io_memory(s->mmio_io_addr);
Missing cpu_unregister_io_memory(s->io_addr) andcpu_unregister_io_memory(s->queue_addr)?
Stefan