Read PCI device header type
This commit is contained in:
parent
a0c62937ff
commit
5179b5881b
@ -33,6 +33,7 @@ struct Pci
|
||||
ubyte subclass_id;
|
||||
ubyte if_id;
|
||||
bool multifunction;
|
||||
ubyte header_type;
|
||||
|
||||
void initialize(Address address, ushort vendor_id, ushort device_id)
|
||||
{
|
||||
@ -46,11 +47,9 @@ struct Pci
|
||||
vendor_id, device_id,
|
||||
class_id, subclass_id, if_id,
|
||||
address.bus_nr, address.device_nr, address.function_nr);
|
||||
if (address.function_nr == 0u)
|
||||
{
|
||||
uint reg3 = read_config_register(address, 3u);
|
||||
multifunction = (reg3 & (1u << 23u)) != 0u;
|
||||
}
|
||||
header_type = (reg3 >> 16u) & 0x7Fu;
|
||||
multifunction = (address.function_nr == 0u) && ((reg3 & (1u << 23u)) != 0u);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user