summaryrefslogtreecommitdiffstats
path: root/perl-install/c
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-01-26 00:10:20 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-01-26 00:10:20 +0000
commit6e49a11b0b3ecb74006ed3c8a26d5f78933db3c9 (patch)
tree18f5db824d1306c6fcf368a35046e311dfc7f085 /perl-install/c
parent3e6118c4f48de04dfe09cbcadcf5e6472628ba06 (diff)
downloaddrakx-backup-do-not-use-6e49a11b0b3ecb74006ed3c8a26d5f78933db3c9.tar
drakx-backup-do-not-use-6e49a11b0b3ecb74006ed3c8a26d5f78933db3c9.tar.gz
drakx-backup-do-not-use-6e49a11b0b3ecb74006ed3c8a26d5f78933db3c9.tar.bz2
drakx-backup-do-not-use-6e49a11b0b3ecb74006ed3c8a26d5f78933db3c9.tar.xz
drakx-backup-do-not-use-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.pl15
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