summaryrefslogtreecommitdiffstats
path: root/src/util/Option
diff options
context:
space:
mode:
authorMichael Brown2015-04-13 17:22:35 +0200
committerMichael Brown2015-04-13 17:22:35 +0200
commit452aa157be724e92d73aceee80874c2dfff9708b (patch)
treefaa19454a35b85c20b5ef046b2d4e24a90d71f52 /src/util/Option
parent[romprefix] Allow autoboot device filter to be disabled (diff)
downloadipxe-452aa157be724e92d73aceee80874c2dfff9708b.tar.gz
ipxe-452aa157be724e92d73aceee80874c2dfff9708b.tar.xz
ipxe-452aa157be724e92d73aceee80874c2dfff9708b.zip
[util] Add ability to dump PCI device ID list
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/util/Option')
-rw-r--r--src/util/Option/ROM.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/util/Option/ROM.pm b/src/util/Option/ROM.pm
index 6c396730..232cf16b 100644
--- a/src/util/Option/ROM.pm
+++ b/src/util/Option/ROM.pm
@@ -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