summaryrefslogtreecommitdiffstats
path: root/perl-install/c
diff options
context:
space:
mode:
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