aboutsummaryrefslogtreecommitdiffstats
path: root/src/hw/lsi-scsi.c
Commit message (Collapse)AuthorAgeFilesLines
* geometry: Apply LCHS values for boot devicesSam Eiderman2019-11-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Boot devices which use overriden LCHS values are: * ata * ahci * scsi * esp * lsi * megasas * mpt * pvscsi * virtio * virtio-blk We use these values in get_translation() and setup_translation() by introducing a new translation type: "TRANSLATION_HOST". We treat this translation as TRANSLATION_NONE in fill_ata_edd(), although this does not really matter since now the translation between physical and logical geometry does not exist. Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com> Reviewed-by: Arbel Moshe <arbel.moshe@oracle.com> Signed-off-by: Sam Eiderman <shmuel.eiderman@oracle.com> Message-Id: <20190626123816.8907-6-shmuel.eiderman@oracle.com>
* Revert "geometry: Apply LCHS values for boot devices"Gerd Hoffmann2019-11-181-2/+0
| | | | This reverts commit 9caa19be0e534c687081fbdfcd301406e728c98c.
* geometry: Apply LCHS values for boot devicesSam Eiderman2019-11-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Boot devices which use overriden LCHS values are: * ata * ahci * scsi * esp * lsi * megasas * mpt * pvscsi * virtio * virtio-blk We use these values in get_translation() and setup_translation() by introducing a new translation type: "TRANSLATION_MACHINE". We treat this translation as TRANSLATION_NONE in fill_ata_edd(), although this does not really matter since now the translation between physical and logical geometry does not exist. Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com> Reviewed-by: Arbel Moshe <arbel.moshe@oracle.com> Signed-off-by: Sam Eiderman <shmuel.eiderman@oracle.com> Message-Id: <20190612093704.47175-6-shmuel.eiderman@oracle.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* block: Rename disk_op_s->drive_gf to drive_flKevin O'Connor2017-09-271-1/+1
| | | | | | | | | | Now that the drive_s struct does not need to be in the f-segment, rename references to drive_gf in the generic drive code to drive_fl. This is just variable renames - no code changes. Tested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Revert "lsi-scsi: reset in case of a serious problem"Roman Kagan2017-06-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 11277846e819b9eef3db5ac833a6a47f95f5ef15. It was originally introduced to deal with the case when REPORT_LUNS caused an error in QEMU implementation of lsi53c895a and left it in a "confused" state making further interaction impossible. However the remedy was worse than the disease: the reset was controller-wide causing all luns to reset, losing all in-flight requests; upon that all luns lit up unit_attention condition, so that any non-informational request would fail with check_condition status. As a result, the lun enumeration succeeded and I saw the respective entries in the boot menu during my testing, but the read from those luns ended with an error and booting failed, which I didn't bother to test. So this reverts to the original error handling behavior. The problem with the failing REPORT_LUNS is addressed in the preceding patch, by making it unlikely to fail. Reported-by: Maciej Józefczyk <maciej.jozefczyk@corp.ovh.com> Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* lsi-scsi: try to enumerate luns with REPORT LUNSRoman Kagan2017-05-021-11/+26
| | | | | | | | | | | | | | Enumerate active luns with REPORT LUNS and, if that fails[*], fall back to sequentially enumerating them up to (arbitrarily chosen) #8 [**]. [*] in current QEMU, REPORT LUNS does fail in lsi53c895a because the returned data is smaller than the allocation length which is (wrongly) considered an underflow [**] in current QEMU, luns above 0 are not supported in lsi53c895a, so this patch is here only for completeness. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* lsi-scsi: reset in case of a serious problemRoman Kagan2017-05-021-0/+2
| | | | | | | | | | | | When the device reports a serious problem via SIST[01] registers, it needs to be reset, otherwise the following requests will most likely fail, too. In particular, REPORT LUNS which fails (wrongly) with underflow in QEMU makes all the following requests fail, too, rendering the device unusable. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* scsi: Launch a thread when scanning for drives in the scsi driversKevin O'Connor2016-04-061-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* scsi: Always use MAXDESCSIZE when building drive descriptionKevin O'Connor2016-02-031-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pci: Split low-level pci code from higher-level 'struct pci_device' codeKevin O'Connor2016-02-031-1/+1
| | | | | | | | | Split pci.c into pci.c and pcidevice.c. The low-level code that interacts directly with the PCI devices remains in pci.c, while functions dealing with the higher level pci_device cache move to pcidevice.c. Only pci.c is needed in 16bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pci: Implement '%pP' printf handler for 'struct pci_device' pointersKevin O'Connor2016-02-031-6/+2
| | | | | | | Handle '%pP' format descriptions as a pointer to a 'struct pci_device' and display it in bus:device.function (%02x:%02x.%x) format. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lsi-scsi: Convert to new PCI BAR helper functionsKevin O'Connor2016-02-021-7/+6
| | | | | | | | | Use the pci_enable_x() functions. The lsi-scsi controller code will now explicitly set PCI_COMMAND_IO instead of assuming it has already been enabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* blockcmd: Convert cdb_is_read() to scsi_is_read()Kevin O'Connor2015-07-141-1/+1
| | | | | | | Convert the cdb_is_read() function to a new function scsi_is_read() which takes a 'struct disk_op_s' as a paramter. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lsi-scsi: Handle LSI drives directly via 'struct disk_op_s' requestsKevin O'Connor2015-07-141-18/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Convert op->drive_g from a 16bit pointer to a 32 bit "GLOBALFLAT" pointer.Kevin O'Connor2013-10-261-7/+8
| | | | | | | | | | | | The "drive" structure is always malloc'ed and therefore always starts off described as a 32-bit "flat" pointer. Instead of switching to/from 16bit pointers, make all the code use the 32bit pointer. This eliminates the confusing 16/32 bit pointer switches. This patch also removes the "_g" suffixes on local variables in functions that are always called in 32bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Merge bmp.h, boot.h, jpeg.h, and post.h into util.h.Kevin O'Connor2013-09-181-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Split disk.h into block.h and std/disk.h.Kevin O'Connor2013-09-181-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move function definitions for output.c from util.h to new file output.h.Kevin O'Connor2013-09-181-7/+8
| | | | | | Also, sort the order of include files in the c files. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move malloc code from pmm.c to new files malloc.c and malloc.h.Kevin O'Connor2013-09-181-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Rename util.c to string.c and introduce string.h.Kevin O'Connor2013-09-181-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move code cenetered around firmware initialization to src/fw/Kevin O'Connor2013-09-021-1/+1
| | | | | | Move many C files from the src/ directory to the new src/fw/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move code centered around specific hardware devices to src/hw/Kevin O'Connor2013-09-021-0/+213
Move many C files from the src/ directory to the new src/hw/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>