[util] Add ability to dump PCI device ID list

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2015-04-13 16:22:35 +01:00
parent ae01462b79
commit 452aa157be
2 changed files with 24 additions and 0 deletions
+20
View File
@@ -529,6 +529,26 @@ sub new {
return $hash;
}
sub device_list {
my $hash = shift;
my $self = tied(%$hash);
my $device_list = $hash->{device_list};
return undef unless $device_list;
my @ids;
my $offset = ( $self->{offset} + $device_list );
while ( 1 ) {
my $raw = substr ( ${$self->{data}}, $offset, 2 );
my $id = unpack ( "S", $raw );
last unless $id;
push @ids, $id;
$offset += 2;
}
return @ids;
}
##############################################################################
#
# Option::ROM::PnP