From 000d45d58f28f8b1f73785f69671d5aa1bddfdbb Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 26 Jan 2004 21:33:12 +0000 Subject: (mapIntfToDevice) introduce it in order to map a network interface to a pci/usb/... device --- perl-install/network/ethernet.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'perl-install/network/ethernet.pm') diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm index fc9f8da44..05dbcfc94 100644 --- a/perl-install/network/ethernet.pm +++ b/perl-install/network/ethernet.pm @@ -1,6 +1,6 @@ package network::ethernet; # $Id$ - +use c; use network::network; use modules; use modules::interactive; @@ -41,6 +41,13 @@ qq( } +sub mapIntfToDevice { + my ($interface) = @_; + my ($bus, $slot, $func) = map { hex($_) } (c::getHwIDs("eth0") =~ /([0-9a-f])+:([0-9a-f])+\.([0-9a-f]+)/); + grep { $_->{pci_bus} == $bus && $_->{pci_device} == $slot } detect_devices::probeall(); +} + + #- conf_network_card_backend : configure the network cards and return the list of them, or configure one specified interface : WARNING, you have to setup the ethernet cards, by calling load_category($in, 'network/main|gigabit|usb', !$::expert, 1) or load_category_backend before calling this function. Basically, you call this function in 2 times. #- input #- $prefix -- cgit v1.2.1