return find_prio(desc);
}
-int bootprio_find_usb(int bdf, u64 path)
+int bootprio_find_usb(struct pci_device *pci, u64 path)
{
if (!CONFIG_BOOTORDER)
return -1;
// Find usb - for example: /pci@i0cf8/usb@1,2/hub@1/network@0/ethernet@0
int i;
char desc[256], *p;
- p = build_pci_path(desc, sizeof(desc), "usb", find_pci(bdf));
+ p = build_pci_path(desc, sizeof(desc), "usb", pci);
for (i=56; i>0; i-=8) {
int port = (path >> i) & 0xff;
if (port != 0xff)
void boot_add_cd(struct drive_s *drive_g, const char *desc, int prio);
void boot_add_cbfs(void *data, const char *desc, int prio);
void boot_prep(void);
+struct pci_device;
int bootprio_find_pci_device(int bdf);
int bootprio_find_ata_device(int bdf, int chanid, int slave);
int bootprio_find_fdc_device(int bdf, int port, int fdid);
int bootprio_find_pci_rom(int bdf, int instance);
int bootprio_find_named_rom(const char *name, int instance);
-int bootprio_find_usb(int bdf, u64 path);
+int bootprio_find_usb(struct pci_device *pci, u64 path);
#endif // __BOOT_H
#include "blockcmd.h" // cdb_read
#include "disk.h" // DTYPE_USB
#include "boot.h" // boot_add_hd
-#include "pci.h" // struct pci_device
struct usbdrive_s {
struct drive_s drive;
op->drive_g->sectors = (u64)-1;
struct usb_pipe *pipe = container_of(
op->drive_g, struct usbdrive_s, drive)->bulkout;
- int prio = bootprio_find_usb(pipe->cntl->pci->bdf, pipe->path);
+ int prio = bootprio_find_usb(pipe->cntl->pci, pipe->path);
boot_add_cd(op->drive_g, desc, prio);
return 0;
}
// Register with bcv system.
struct usb_pipe *pipe = container_of(
op->drive_g, struct usbdrive_s, drive)->bulkout;
- int prio = bootprio_find_usb(pipe->cntl->pci->bdf, pipe->path);
+ int prio = bootprio_find_usb(pipe->cntl->pci, pipe->path);
boot_add_hd(op->drive_g, desc, prio);
return 0;