summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2003-07-03 04:41:30 +0000
committerBill Nottingham <notting@redhat.com>2003-07-03 04:41:30 +0000
commitad4b0bfcf3ad8e25c3c509464e07c002f43b6dd5 (patch)
tree20a54d6f338914635490de768950d72dc8121b51 /isys
parenta2e7edb16db50a54b0d7937fd07ab78cc4da94fa (diff)
downloadanaconda-ad4b0bfcf3ad8e25c3c509464e07c002f43b6dd5.tar.gz
anaconda-ad4b0bfcf3ad8e25c3c509464e07c002f43b6dd5.tar.xz
anaconda-ad4b0bfcf3ad8e25c3c509464e07c002f43b6dd5.zip
fill in model info of net devices with their description
use this in choose-your-own-netdevice screen requires kudzu-1.1.9 or higher.
Diffstat (limited to 'isys')
-rw-r--r--isys/probe.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/isys/probe.c b/isys/probe.c
index 8da11c9b5..5ad013d13 100644
--- a/isys/probe.c
+++ b/isys/probe.c
@@ -102,11 +102,14 @@ void kdFree(struct knownDevices * devices) {
}
int kdFindNetList(struct knownDevices * devices, int code) {
- int fd;
+ int fd, i;
char *buf;
char * start, * end;
+ struct device **kdevs;
struct kddevice newDevice;
int s;
+
+ kdevs = probeDevices(CLASS_NETWORK, BUS_UNSPEC, PROBE_ALL);
if ((fd = open("/proc/net/dev", O_RDONLY)) < 0) {
fprintf(stderr, "failed to open /proc/net/dev!\n");
@@ -139,6 +142,12 @@ int kdFindNetList(struct knownDevices * devices, int code) {
if (!deviceKnown(devices, start)) {
newDevice.name = strdup(start);
newDevice.model = NULL;
+ if (kdevs) {
+ for (i = 0; kdevs[i]; i++)
+ if (kdevs[i]->device && !strcmp(kdevs[i]->device, newDevice.name))
+ newDevice.model = strdup(kdevs[i]->desc);
+
+ }
newDevice.class = CLASS_NETWORK;
newDevice.code = code;
addDevice(devices, newDevice);