mirror of https://github.com/ipxe/ipxe.git
[efi] Match EDK2 numbering for USB ports
The various USB specifications all use one-based numbering for ports. This scheme is applied consistently across the various relevant specifications, covering both port numbers that appear on the wire (i.e. downstream hub port numbers) and port numbers that exist only logically (i.e. root hub port numbers). The UEFI specification is ambiguous about the port numbers as used for the ParentPortNumber field within a USB_DEVICE_PATH structure. As of UEFI specification version 2.8 errata B: - section 10.3.4.5 just states "USB Parent Port Number" with no indication of being zero-based or one-based - section 17.1.1 notes that for the EFI_USB2_HC_PROTOCOL, references to PortNumber parameters are zero-based for root hub ports - section 17.1.1 also mentions a TranslatorPortNumber used by EFI_USB2_HC_PROTOCOL, with no indication of being zero-based or one-based - there are no other mentions of USB port numbering schemes. Experimentation and inspection of the EDK2 codebase reveals that at least the EDK2 reference implementation will use zero-based numbering for both root and non-root hub ports when populating a USB_DEVICE_PATH structure (though will inconsistently use one-based numbering for the TranslatorPortNumber parameter). Use zero-based numbering for both root and non-root hub ports when constructing a USB_DEVICE_PATH in order to match the behaviour of the EDK2 implementation. Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/129/head
parent
70b1a641c5
commit
fd47fa8fe1
|
@ -1100,7 +1100,7 @@ static int efi_usb_install ( struct efi_usb_device *usbdev,
|
|||
usbpath->Header.Type = MESSAGING_DEVICE_PATH;
|
||||
usbpath->Header.SubType = MSG_USB_DP;
|
||||
usbpath->Header.Length[0] = sizeof ( *usbpath );
|
||||
usbpath->ParentPortNumber = usb->port->address;
|
||||
usbpath->ParentPortNumber = ( usb->port->address - 1 );
|
||||
}
|
||||
|
||||
/* Add to list of interfaces */
|
||||
|
|
Loading…
Reference in New Issue