mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 12:00:19 +03:00
[pci] Support systems with multiple PCI root bridges
Extend the 16-bit PCI bus:dev.fn address to a 32-bit seg:bus:dev.fn address, assuming a segment value of zero in contexts where multiple segments are unsupported by the underlying data structures (e.g. in the iBFT or BOFM tables). Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -2232,6 +2232,10 @@ static int format_busdevfn_setting ( const struct setting_type *type __unused,
|
||||
const void *raw, size_t raw_len, char *buf,
|
||||
size_t len ) {
|
||||
unsigned long busdevfn;
|
||||
unsigned int seg;
|
||||
unsigned int bus;
|
||||
unsigned int slot;
|
||||
unsigned int func;
|
||||
int check_len;
|
||||
|
||||
/* Extract numeric value */
|
||||
@@ -2240,9 +2244,14 @@ static int format_busdevfn_setting ( const struct setting_type *type __unused,
|
||||
return check_len;
|
||||
assert ( check_len == ( int ) raw_len );
|
||||
|
||||
/* Extract PCI address components */
|
||||
seg = PCI_SEG ( busdevfn );
|
||||
bus = PCI_BUS ( busdevfn );
|
||||
slot = PCI_SLOT ( busdevfn );
|
||||
func = PCI_FUNC ( busdevfn );
|
||||
|
||||
/* Format value */
|
||||
return snprintf ( buf, len, "%02lx:%02lx.%lx", PCI_BUS ( busdevfn ),
|
||||
PCI_SLOT ( busdevfn ), PCI_FUNC ( busdevfn ) );
|
||||
return snprintf ( buf, len, "%04x:%02x:%02x.%x", seg, bus, slot, func );
|
||||
}
|
||||
|
||||
/** PCI bus:dev.fn setting type */
|
||||
|
||||
Reference in New Issue
Block a user