diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-01-26 00:10:20 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-01-26 00:10:20 +0000 |
commit | 6e49a11b0b3ecb74006ed3c8a26d5f78933db3c9 (patch) | |
tree | 18f5db824d1306c6fcf368a35046e311dfc7f085 /perl-install/c | |
parent | 3e6118c4f48de04dfe09cbcadcf5e6472628ba06 (diff) | |
download | drakx-6e49a11b0b3ecb74006ed3c8a26d5f78933db3c9.tar drakx-6e49a11b0b3ecb74006ed3c8a26d5f78933db3c9.tar.gz drakx-6e49a11b0b3ecb74006ed3c8a26d5f78933db3c9.tar.bz2 drakx-6e49a11b0b3ecb74006ed3c8a26d5f78933db3c9.tar.xz drakx-6e49a11b0b3ecb74006ed3c8a26d5f78933db3c9.zip |
(getNetDriver) introduce getHwIDs() alias that return pci/usb/... hw
addr (or "N/A" for some isapnp cards due to lack of support from
drivers)
Diffstat (limited to 'perl-install/c')
-rw-r--r-- | perl-install/c/stuff.xs.pl | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index ec4047b0c..252e889b7 100644 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -484,6 +484,8 @@ hasNetDevice(device) char* getNetDriver(char* device) + ALIAS: + getHwIDs = 1 CODE: struct ifreq ifr; struct ethtool_drvinfo drvinfo; @@ -495,9 +497,16 @@ getNetDriver(char* device) drvinfo.cmd = ETHTOOL_GDRVINFO; ifr.ifr_data = (caddr_t) &drvinfo; - if (ioctl(s, SIOCETHTOOL, &ifr) != -1) - RETVAL = strdup(drvinfo.driver); - else { perror("SIOCETHTOOL"); RETVAL = strdup(""); } + if (ioctl(s, SIOCETHTOOL, &ifr) != -1) { + switch (ix) { + case 0: + RETVAL = strdup(drvinfo.driver); + break; + case 1: + RETVAL = strdup(drvinfo.bus_info); + break; + } + } else { perror("SIOCETHTOOL"); RETVAL = strdup(""); } OUTPUT: RETVAL |