forked from pool/hwinfo
303 lines
8.9 KiB
Diff
303 lines
8.9 KiB
Diff
inst-sys:/ # modprobe -v -r ehea
|
|
rmmod /lib/modules/2.6.25.9-20080626_modalias-ppc64/updates/initrd/ehea.ko
|
|
inst-sys:/ # hwinfo --netcard
|
|
10: ? 00.0: 0200 Ethernet controller
|
|
[Created at pci.1122]
|
|
Unique ID: Pyta.bJrzPJGSxI8
|
|
SysFS ID: /devices/ibmebus/23c00100.lhea
|
|
SysFS BusID: 23c00100.lhea
|
|
Hardware Class: network
|
|
Model: "IBM Host Ethernet Adapter"
|
|
Vendor: pci 0x1014 "IBM"
|
|
Device: "IBM Host Ethernet Adapter"
|
|
Module Alias: "of:NlheaT<NULL>CIBM,lhea"
|
|
Driver Info #0:
|
|
Driver Status: ehea is not active
|
|
Driver Activation Cmd: "modprobe ehea"
|
|
Config Status: cfg=new, avail=yes, need=no, active=unknown
|
|
inst-sys:/ # modprobe -v ehea
|
|
insmod /lib/modules/2.6.25.9-20080626_modalias-ppc64/updates/initrd/ehea.ko
|
|
inst-sys:/ # hwinfo --netcard
|
|
10: None 01.0: 0200 Ethernet controller
|
|
[Created at pci.1142]
|
|
Unique ID: e2Ms.lXJfK+8R0b3
|
|
SysFS ID: /devices/ibmebus/23c00100.lhea/port1
|
|
SysFS BusID: port1
|
|
Hardware Class: network
|
|
Model: "IBM Host Ethernet Adapter Port 1 'port1'"
|
|
Vendor: pci 0x1014 "IBM"
|
|
Device: "IBM Host Ethernet Adapter Port 1 'port1'"
|
|
Device File: eth1
|
|
HW Address: 00:1a:64:44:48:c9
|
|
Link detected: yes
|
|
Module Alias: "of:NethernetTnetworkCIBM,lhea-ethernet"
|
|
Config Status: cfg=new, avail=yes, need=no, active=unknown
|
|
|
|
11: None 00.0: 0200 Ethernet controller
|
|
[Created at pci.1142]
|
|
Unique ID: At5o.LOQaFIQZMm5
|
|
SysFS ID: /devices/ibmebus/23c00100.lhea/port0
|
|
SysFS BusID: port0
|
|
Hardware Class: network
|
|
Model: "IBM Host Ethernet Adapter Port 0 'port0'"
|
|
Vendor: pci 0x1014 "IBM"
|
|
Device: "IBM Host Ethernet Adapter Port 0 'port0'"
|
|
Device File: eth0
|
|
HW Address: 00:1a:64:44:48:c8
|
|
Link detected: yes
|
|
Module Alias: "of:NethernetTnetworkCIBM,lhea-ethernet"
|
|
Config Status: cfg=new, avail=yes, need=no, active=unknown
|
|
|
|
12: ? 00.0: 0200 Ethernet controller
|
|
[Created at pci.1122]
|
|
Unique ID: Pyta.bJrzPJGSxI8
|
|
SysFS ID: /devices/ibmebus/23c00100.lhea
|
|
SysFS BusID: 23c00100.lhea
|
|
Hardware Class: network
|
|
Model: "IBM Host Ethernet Adapter"
|
|
Vendor: pci 0x1014 "IBM"
|
|
Device: "IBM Host Ethernet Adapter"
|
|
Driver: "ehea"
|
|
Module Alias: "of:NlheaT<NULL>CIBM,lhea"
|
|
Driver Info #0:
|
|
Driver Status: ehea is active
|
|
Driver Activation Cmd: "modprobe ehea"
|
|
Config Status: cfg=new, avail=yes, need=no, active=unknown
|
|
inst-sys:/ #
|
|
|
|
---
|
|
src/hd/hd.h | 2 -
|
|
src/hd/pci.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
src/hd/prom.c | 78 ----------------------------------------------------
|
|
src/ids/src/special | 6 ----
|
|
4 files changed, 79 insertions(+), 85 deletions(-)
|
|
|
|
--- a/src/hd/hd.h
|
|
+++ b/src/hd/hd.h
|
|
@@ -294,7 +294,7 @@ typedef enum bus_types {
|
|
/** outside the range of the PCI values */
|
|
bus_ps2 = 0x80, bus_serial, bus_parallel, bus_floppy, bus_scsi, bus_ide, bus_usb,
|
|
bus_adb, bus_raid, bus_sbus, bus_i2o, bus_vio, bus_ccw, bus_iucv, bus_ps3_system_bus,
|
|
- bus_virtio
|
|
+ bus_virtio, bus_ibmebus
|
|
} hd_bus_types_t;
|
|
|
|
/** @} */
|
|
--- a/src/hd/pci.c
|
|
+++ b/src/hd/pci.c
|
|
@@ -58,6 +58,7 @@ static void hd_read_of_platform(hd_data_
|
|
static void add_xen_network(hd_data_t *hd_data);
|
|
static void add_xen_storage(hd_data_t *hd_data);
|
|
static void hd_read_virtio(hd_data_t *hd_data);
|
|
+static void hd_read_ibmebus(hd_data_t *hd_data);
|
|
|
|
void hd_scan_sysfs_pci(hd_data_t *hd_data)
|
|
{
|
|
@@ -103,6 +104,9 @@ void hd_scan_sysfs_pci(hd_data_t *hd_dat
|
|
|
|
PROGRESS(10, 0, "virtio");
|
|
hd_read_virtio(hd_data);
|
|
+
|
|
+ PROGRESS(11, 0, "ibmebus");
|
|
+ hd_read_ibmebus(hd_data);
|
|
}
|
|
|
|
|
|
@@ -1085,6 +1089,80 @@ void hd_read_ps3_system_bus(hd_data_t *h
|
|
free_str_list(sf_bus);
|
|
}
|
|
|
|
+void hd_read_ibmebus(hd_data_t *hd_data)
|
|
+{
|
|
+ char *sf_dev, *s, *modalias;
|
|
+ str_list_t *sf_bus, *sf_bus_e;
|
|
+ hd_t *hd;
|
|
+
|
|
+ sf_bus = reverse_str_list(read_dir("/sys/bus/ibmebus/devices", 'l'));
|
|
+
|
|
+ if(!sf_bus) {
|
|
+ ADD2LOG("sysfs: no such bus: ibmebus\n");
|
|
+ return;
|
|
+ }
|
|
+ for(sf_bus_e = sf_bus; sf_bus_e; sf_bus_e = sf_bus_e->next) {
|
|
+ sf_dev = new_str(hd_read_sysfs_link("/sys/bus/ibmebus/devices", sf_bus_e->str));
|
|
+
|
|
+ ADD2LOG(
|
|
+ " ibmebus device: name = %s\n path = %s\n",
|
|
+ sf_bus_e->str,
|
|
+ hd_sysfs_id(sf_dev)
|
|
+ );
|
|
+
|
|
+ if((modalias = get_sysfs_attr_by_path(sf_dev, "modalias"))) {
|
|
+ int len = strlen(modalias);
|
|
+ if (len > 0 && modalias[len - 1] == '\n')
|
|
+ modalias[len - 1] = '\0';
|
|
+
|
|
+ ADD2LOG(" modalias = \"%s\"\n", modalias);
|
|
+
|
|
+ if(0);
|
|
+ else if(strstr(modalias, "Nlhea") && strstr(modalias, "CIBM,lhea")) {
|
|
+ /* ==> 23c00100.lhea/modalias <==
|
|
+ * of:NlheaT<NULL>CIBM,lhea
|
|
+ * ehea
|
|
+ */
|
|
+ hd = add_hd_entry(hd_data, __LINE__, 0);
|
|
+
|
|
+ hd->bus.id = bus_ibmebus;
|
|
+ hd->vendor.id = MAKE_ID(TAG_PCI, 0x1014); /* IBM */
|
|
+ hd->base_class.id = bc_network;
|
|
+ hd->sub_class.id = 0; /* ethernet */
|
|
+ str_printf(&hd->device.name, 0, "IBM Host Ethernet Adapter");
|
|
+
|
|
+ hd->modalias = new_str(modalias);
|
|
+
|
|
+ hd->sysfs_id = new_str(hd_sysfs_id(sf_dev));
|
|
+ hd->sysfs_bus_id = new_str(sf_bus_e->str);
|
|
+ s = hd_sysfs_find_driver(hd_data, hd->sysfs_id, 1);
|
|
+ if(s) add_str_list(&hd->drivers, s);
|
|
+ }
|
|
+ else if(strstr(modalias, "Nethernet") && strstr(modalias, "CIBM,lhea-ethernet")) {
|
|
+ /* ==> port1/modalias <==
|
|
+ * of:NethernetTnetworkCIBM,lhea-ethernet
|
|
+ * eth1
|
|
+ */
|
|
+ hd = add_hd_entry(hd_data, __LINE__, 0);
|
|
+ hd->modalias = new_str(modalias);
|
|
+ hd->sysfs_id = new_str(hd_sysfs_id(sf_dev));
|
|
+ hd->sysfs_bus_id = new_str(sf_bus_e->str);
|
|
+ hd->vendor.id = MAKE_ID(TAG_PCI, 0x1014); /* IBM */
|
|
+ hd->base_class.id = bc_network;
|
|
+ hd->sub_class.id = 0; /* ethernet */
|
|
+ s = strpbrk(hd->sysfs_bus_id, "0123456789");
|
|
+ if(s) {
|
|
+ hd->slot = strtol(s, NULL, 10);
|
|
+ str_printf(&hd->device.name, 0, "IBM Host Ethernet Adapter Port %d", hd->slot);
|
|
+ }
|
|
+
|
|
+ s = hd_sysfs_find_driver(hd_data, hd->sysfs_id, 1);
|
|
+ if(s) add_str_list(&hd->drivers, s);
|
|
+ }
|
|
+ }
|
|
+ free_mem(sf_dev);
|
|
+ }
|
|
+}
|
|
|
|
/*
|
|
* Get xen (network & storage) data from sysfs.
|
|
--- a/src/hd/prom.c
|
|
+++ b/src/hd/prom.c
|
|
@@ -29,9 +29,6 @@ static void read_str(char *path, char *n
|
|
static void read_mem(char *path, char *name, unsigned char **mem, unsigned len);
|
|
static void read_int(char *path, char *name, int *val);
|
|
static void read_devtree(hd_data_t *hd_data);
|
|
-static void add_legacy_prom_devices(hd_data_t *hd_data, devtree_t *dt);
|
|
-static void add_prom_ehea(hd_data_t *hd_data, devtree_t *dt);
|
|
-static void add_devices(hd_data_t *hd_data);
|
|
static void dump_devtree_data(hd_data_t *hd_data);
|
|
|
|
static unsigned veth_cnt, vscsi_cnt;
|
|
@@ -373,7 +370,6 @@ void hd_scan_prom(hd_data_t *hd_data)
|
|
fclose(f);
|
|
}
|
|
if(hd_data->debug) dump_devtree_data(hd_data);
|
|
- add_devices(hd_data);
|
|
|
|
PROGRESS(2, 0, "color");
|
|
|
|
@@ -542,80 +538,6 @@ void read_devtree(hd_data_t *hd_data)
|
|
|
|
}
|
|
|
|
-void add_legacy_prom_devices(hd_data_t *hd_data, devtree_t *dt)
|
|
-{
|
|
- if(dt->pci) return;
|
|
-
|
|
- add_prom_ehea(hd_data, dt);
|
|
-}
|
|
-
|
|
-void add_prom_ehea(hd_data_t *hd_data, devtree_t *dt)
|
|
-{
|
|
- hd_t *hd;
|
|
- hd_res_t *res;
|
|
- char *path = NULL;
|
|
- unsigned char *hw_addr_bin = NULL;
|
|
- char *hw_addr = NULL;
|
|
- int slot;
|
|
-
|
|
- if(
|
|
- dt->device_type &&
|
|
- dt->compatible &&
|
|
- !strcmp(dt->device_type, "network") &&
|
|
- !strcmp(dt->compatible, "IBM,lhea-ethernet")
|
|
- ) {
|
|
- str_printf(&path, 0, PROC_PROM "/%s", dt->path);
|
|
-
|
|
- ADD2LOG(" ehea: %s\n", path);
|
|
-
|
|
- hd = add_hd_entry(hd_data, __LINE__, 0);
|
|
- hd->bus.id = bus_none;
|
|
- hd->base_class.id = bc_network;
|
|
- hd->sub_class.id = 0; /* ethernet */
|
|
-
|
|
- hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x6001);
|
|
- hd->device.id = MAKE_ID(TAG_SPECIAL, 0x1003);
|
|
- hd->rom_id = new_str(dt->path);
|
|
-
|
|
- read_int(path, "ibm,hea-port-no", &slot);
|
|
- hd->slot = slot;
|
|
-
|
|
- read_str(path, "ibm,fw-adapter-name", &hd->device.name);
|
|
- if(!hd->device.name) {
|
|
- hd->device.name = new_str("IBM Host Ethernet Adapter");
|
|
- }
|
|
-
|
|
- // "mac-address" or "local-mac-address" ?
|
|
- read_mem(path, "local-mac-address", &hw_addr_bin, 6);
|
|
-
|
|
- if(hw_addr_bin) {
|
|
- str_printf(
|
|
- &hw_addr, 0, "%02x:%02x:%02x:%02x:%02x:%02x",
|
|
- hw_addr_bin[0], hw_addr_bin[1],
|
|
- hw_addr_bin[2], hw_addr_bin[3],
|
|
- hw_addr_bin[4], hw_addr_bin[5]
|
|
- );
|
|
- res = new_mem(sizeof *res);
|
|
- res->hwaddr.type = res_hwaddr;
|
|
- res->hwaddr.addr = new_str(hw_addr);
|
|
- add_res_entry(&hd->res, res);
|
|
- }
|
|
- }
|
|
-
|
|
- free_mem(hw_addr_bin);
|
|
- free_mem(hw_addr);
|
|
- free_mem(path);
|
|
-}
|
|
-
|
|
-void add_devices(hd_data_t *hd_data)
|
|
-{
|
|
- devtree_t *dt;
|
|
-
|
|
- for(dt = hd_data->devtree; dt; dt = dt->next) {
|
|
- if(!dt->pci) add_legacy_prom_devices(hd_data, dt);
|
|
- }
|
|
-}
|
|
-
|
|
void dump_devtree_data(hd_data_t *hd_data)
|
|
{
|
|
unsigned u;
|
|
--- a/src/ids/src/special
|
|
+++ b/src/ids/src/special
|
|
@@ -623,12 +623,6 @@
|
|
&device.id special 0x3004
|
|
+device.name MyriCOM MyriNET Gigabit Ethernet
|
|
|
|
-# IBM ehea
|
|
- vendor.id special 0x6001
|
|
-&device.id special 0x1003
|
|
-+driver.module.modprobe ehea
|
|
-
|
|
-
|
|
# UML veth
|
|
vendor.id special 0x6010
|
|
+vendor.name UML
|