#include "pcidevice.h" // foreachpci
#include "pci_ids.h" // PCI_DEVICE_ID
#include "pci_regs.h" // PCI_VENDOR_ID
+#include "stacks.h" // run_thread
#include "std/disk.h" // DISK_RET_SUCCESS
#include "string.h" // memset
#include "util.h" // usleep
}
static void
-init_esp_scsi(struct pci_device *pci)
+init_esp_scsi(void *data)
{
+ struct pci_device *pci = data;
u32 iobase = pci_enable_iobar(pci, PCI_BASE_ADDRESS_0);
if (!iobase)
return;
int i;
for (i = 0; i <= 7; i++)
esp_scsi_scan_target(pci, iobase, i);
-
- return;
}
void
if (pci->vendor != PCI_VENDOR_ID_AMD
|| pci->device != PCI_DEVICE_ID_AMD_SCSI)
continue;
- init_esp_scsi(pci);
+ run_thread(init_esp_scsi, pci);
}
}
#include "pcidevice.h" // foreachpci
#include "pci_ids.h" // PCI_DEVICE_ID_VIRTIO_BLK
#include "pci_regs.h" // PCI_VENDOR_ID
+#include "stacks.h" // run_thread
#include "std/disk.h" // DISK_RET_SUCCESS
#include "string.h" // memset
#include "util.h" // usleep
}
static void
-init_lsi_scsi(struct pci_device *pci)
+init_lsi_scsi(void *data)
{
+ struct pci_device *pci = data;
u32 iobase = pci_enable_iobar(pci, PCI_BASE_ADDRESS_0);
if (!iobase)
return;
int i;
for (i = 0; i < 7; i++)
lsi_scsi_scan_target(pci, iobase, i);
-
- return;
}
void
if (pci->vendor != PCI_VENDOR_ID_LSI_LOGIC
|| pci->device != PCI_DEVICE_ID_LSI_53C895A)
continue;
- init_lsi_scsi(pci);
+ run_thread(init_lsi_scsi, pci);
}
}
}
static void
-init_megasas(struct pci_device *pci)
+init_megasas(void *data)
{
+ struct pci_device *pci = data;
u32 bar = PCI_BASE_ADDRESS_2;
if (!(pci_config_readl(pci->bdf, bar) & PCI_BASE_ADDRESS_IO_MASK))
bar = PCI_BASE_ADDRESS_0;
// reset
if (megasas_transition_to_ready(pci, iobase) == 0)
megasas_scan_target(pci, iobase);
-
- return;
}
void
pci->device == PCI_DEVICE_ID_DELL_PERC5 ||
pci->device == PCI_DEVICE_ID_LSI_SAS2208 ||
pci->device == PCI_DEVICE_ID_LSI_SAS3108)
- init_megasas(pci);
+ run_thread(init_megasas, pci);
}
}
#include "pcidevice.h" // foreachpci
#include "pci_ids.h" // PCI_DEVICE_ID
#include "pci_regs.h" // PCI_VENDOR_ID
+#include "stacks.h" // run_thread
#include "std/disk.h" // DISK_RET_SUCCESS
#include "string.h" // memset
#include "util.h" // usleep
}
static void
-init_mpt_scsi(struct pci_device *pci, const char *dev_name)
+init_mpt_scsi(void *data)
{
+ struct pci_device *pci = data;
u16 *msg_in_p;
u32 iobase = pci_enable_iobar(pci, PCI_BASE_ADDRESS_0);
if (!iobase)
struct MptIOCInitReply MptIOCInitReply;
pci_enable_busmaster(pci);
- dprintf(1, "found %s at %pP, io @ %x\n", dev_name, pci, iobase);
+ dprintf(1, "found mpt-scsi(%04x) at %pP, io @ %x\n"
+ , pci->device, pci, iobase);
// reset
mpt_out_doorbell(MPT_DOORBELL_MSG_RESET, 0, iobase);
struct pci_device *pci;
foreachpci(pci) {
- if (pci->vendor == PCI_VENDOR_ID_LSI_LOGIC) {
- if (pci->device == PCI_DEVICE_ID_LSI_53C1030) {
- init_mpt_scsi(pci, "lsi53c1030");
- }
- if (pci->device == PCI_DEVICE_ID_LSI_SAS1068) {
- init_mpt_scsi(pci, "sas1068");
- }
- if (pci->device == PCI_DEVICE_ID_LSI_SAS1068E) {
- init_mpt_scsi(pci, "sas1068e");
- }
- }
+ if (pci->vendor == PCI_VENDOR_ID_LSI_LOGIC
+ && (pci->device == PCI_DEVICE_ID_LSI_53C1030
+ || pci->device == PCI_DEVICE_ID_LSI_SAS1068
+ || pci->device == PCI_DEVICE_ID_LSI_SAS1068E))
+ run_thread(init_mpt_scsi, pci);
}
}
#include "pci_ids.h" // PCI_DEVICE_ID_VMWARE_PVSCSI
#include "pci_regs.h" // PCI_VENDOR_ID
#include "pvscsi.h" // pvscsi_setup
+#include "stacks.h" // run_thread
#include "std/disk.h" // DISK_RET_SUCCESS
#include "string.h" // memset
#include "util.h" // usleep
}
static void
-init_pvscsi(struct pci_device *pci)
+init_pvscsi(void *data)
{
+ struct pci_device *pci = data;
void *iobase = pci_enable_membar(pci, PCI_BASE_ADDRESS_0);
if (!iobase)
return;
int i;
for (i = 0; i < 7; i++)
pvscsi_scan_target(pci, iobase, ring_dsc, i);
-
- return;
}
void
if (pci->vendor != PCI_VENDOR_ID_VMWARE
|| pci->device != PCI_DEVICE_ID_VMWARE_PVSCSI)
continue;
- init_pvscsi(pci);
+ run_thread(init_pvscsi, pci);
}
}