Skip to contentSkip to conversation

usb: fix boot paths

PATCH In review Paolo Bonzini 2 participants 4 messages Nov 18, 2011 – Nov 22, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: fix boot paths

The fw paths for USB devices that SeaBIOS computes are off-by-one, because QEMU builds those paths with a numbering that starts from one (see usb_fill_port and usb_hub_initfn in QEMU). Fix that so that the numbering agrees.

---
 src/boot.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
src/boot.c +2 -2
index 946850d..434bf80 100644
@@ -205,9 +205,9 @@ int bootprio_find_usb(struct pci_device *pci, u64 path)
     for (i=56; i>0; i-=8) {
         int port = (path >> i) & 0xff;
         if (port != 0xff)
-            p += snprintf(p, desc+sizeof(desc)-p, "/hub@%x", port);
+            p += snprintf(p, desc+sizeof(desc)-p, "/hub@%x", port+1);
     }
-    snprintf(p, desc+sizeof(desc)-p, "/*@%x", (u32)(path & 0xff));
+    snprintf(p, desc+sizeof(desc)-p, "/*@%x", (u32)(path & 0xff)+1);
     return find_prio(desc);
 }
 
Signature · 1 line
1.7.7.1
#1 lore raw
Quoted 4 lines · Paolo Bonzini

The fw paths for USB devices that SeaBIOS computes are off-by-one, because QEMU builds those paths with a numbering that starts from one (see usb_fill_port and usb_hub_initfn in QEMU). Fix that so that the numbering agrees.

/me goes to configure the seabios repo...

Paolo

#2 lore raw
Quoted 7 lines · Paolo Bonzini
Quoted 4 lines · Paolo Bonzini

The fw paths for USB devices that SeaBIOS computes are off-by-one, because QEMU builds those paths with a numbering that starts from one (see usb_fill_port and usb_hub_initfn in QEMU). Fix that so that the numbering agrees.

Hi Kevin,

a very early ping, because we would like this patch to be upstream before including it in QEMU 1.0.

Thanks!

Paolo

#3 lore raw
Quoted 7 lines · Paolo Bonzini
Quoted 6 lines · Paolo Bonzini
Quoted 4 lines · Paolo Bonzini

The fw paths for USB devices that SeaBIOS computes are off-by-one, because QEMU builds those paths with a numbering that starts from one (see usb_fill_port and usb_hub_initfn in QEMU). Fix that so that the numbering agrees.

Quoted 6 lines
Quoted 1 line

Hi Kevin,

a very early ping, because we would like this patch to be upstream before including it in QEMU 1.0.

I just pushed the change (to git.seabios.org -- linuxtogo seems to be having issues).

-Kevin