--- src/boot.c | 4 ++-- src/boot.h | 3 ++- src/usb-msc.c | 5 ++--- 3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/boot.c b/src/boot.c index fcc95ab..58fb70b 100644 --- a/src/boot.c +++ b/src/boot.c @@ -193,14 +193,14 @@ int bootprio_find_named_rom(const char *name, int instance) 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) diff --git a/src/boot.h b/src/boot.h index a6f358f..6495002 100644 --- a/src/boot.h +++ b/src/boot.h @@ -12,11 +12,12 @@ void boot_add_hd(struct drive_s *drive_g, const char *desc, int prio); 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 diff --git a/src/usb-msc.c b/src/usb-msc.c index a57e4d2..13ef93e 100644 --- a/src/usb-msc.c +++ b/src/usb-msc.c @@ -12,7 +12,6 @@ #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; @@ -146,7 +145,7 @@ setup_drive_cdrom(struct disk_op_s *op, char *desc) 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; } @@ -174,7 +173,7 @@ setup_drive_hd(struct disk_op_s *op, char *desc) // 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;