rewrote get_net_intf_description() to use sysfs
do not use plip as net device any more
This commit is contained in:
parent
a205119533
commit
b05b01a7b3
22
probing.c
22
probing.c
@ -88,11 +88,17 @@ void net_discovered_interface(char * intf_name)
|
|||||||
|
|
||||||
char * get_net_intf_description(char * intf_name)
|
char * get_net_intf_description(char * intf_name)
|
||||||
{
|
{
|
||||||
int i;
|
char dev[SYSFS_PATH_MAX];
|
||||||
for (i = 0; i < net_descr_number ; i++)
|
char drv[SYSFS_PATH_MAX];
|
||||||
if (!strcmp(net_descriptions[i].intf_name, intf_name))
|
ssize_t i;
|
||||||
return net_descriptions[i].intf_description;
|
|
||||||
|
snprintf(dev, SYSFS_PATH_MAX, "/sys/class/net/%s/device/driver", intf_name);
|
||||||
|
if ((i = readlink(dev, drv, SYSFS_PATH_MAX)) > 0) {
|
||||||
|
drv[i] = '\0';
|
||||||
|
return strdup(basename(drv));
|
||||||
|
} else {
|
||||||
return strdup("unknown");
|
return strdup("unknown");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -237,13 +243,6 @@ void get_medias(enum media_type media, char *** names, char *** models)
|
|||||||
}
|
}
|
||||||
#endif /* DISABLE_MEDIAS */
|
#endif /* DISABLE_MEDIAS */
|
||||||
|
|
||||||
void probe_hiddev()
|
|
||||||
{
|
|
||||||
/* FIXME
|
|
||||||
usb_probe(HID_DEVICES);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef DISABLE_NETWORK
|
#ifndef DISABLE_NETWORK
|
||||||
static int net_device_available(char * device)
|
static int net_device_available(char * device)
|
||||||
{
|
{
|
||||||
@ -271,7 +270,6 @@ char ** get_net_devices(void)
|
|||||||
char * devices[] = {
|
char * devices[] = {
|
||||||
"eth0", "eth1", "eth2", "eth3", "eth4", "eth5",
|
"eth0", "eth1", "eth2", "eth3", "eth4", "eth5",
|
||||||
"tr0",
|
"tr0",
|
||||||
"plip0", "plip1", "plip2",
|
|
||||||
"fddi0",
|
"fddi0",
|
||||||
#ifdef ENABLE_USBNET
|
#ifdef ENABLE_USBNET
|
||||||
"usb0", "usb1", "usb2", "usb3",
|
"usb0", "usb1", "usb2", "usb3",
|
||||||
|
@ -24,8 +24,6 @@
|
|||||||
|
|
||||||
enum media_type { CDROM, DISK, FLOPPY, TAPE, UNKNOWN_MEDIA };
|
enum media_type { CDROM, DISK, FLOPPY, TAPE, UNKNOWN_MEDIA };
|
||||||
|
|
||||||
enum driver_type { IDE_ADAPTERS, SCSI_ADAPTERS, RAID_ADAPTERS, MEDIA_ADAPTERS, NETWORK_DEVICES, HID_DEVICES, USB_CONTROLLERS, BRIDGE_OTHER, ANY_DRIVER_TYPE };
|
|
||||||
|
|
||||||
void get_medias(enum media_type media, char *** names, char *** models);
|
void get_medias(enum media_type media, char *** names, char *** models);
|
||||||
void probe_hiddev();
|
void probe_hiddev();
|
||||||
char ** get_net_devices(void);
|
char ** get_net_devices(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user