--- kudzu-1.1.107/macio.c~ 2004-05-19 22:06:36.000000000 +0100 +++ kudzu-1.1.107/macio.c 2005-02-17 15:01:10.000000000 +0000 @@ -66,6 +66,7 @@ struct device *macioProbe( enum deviceCl // check for airport if (probeClass & CLASS_NETWORK) { struct macioDevice *airport; + struct macioDevice *bmac; struct pathNode *n; int ret = 0; @@ -93,6 +94,48 @@ struct device *macioProbe( enum deviceCl airport->next = devlist; devlist = (struct device *)airport; } + + ret = 0; + minifind("/proc/device-tree", "ethernet", list); + + // Supported + for (n = list->result->next; n != list->result; n = n->next) + { + int fd; + char buf[256]; + + if (!n->path) + continue; + + buf[255] = 0; + snprintf(buf, 255, "%s/compatible", n->path); + + fd = open(buf, O_RDONLY); + if (fd < 0) + continue; + + if (read (fd, buf, 256) < 0) { + close(fd); + continue; + } + /* Check for bmac or bmac+ */ + if (!strncmp(buf, "bmac", 4)) + ret = 1; + + close(fd); + } + + if (ret) + { + bmac = macioNewDevice(NULL); + bmac->type = CLASS_NETWORK; + bmac->device = strdup("eth"); + bmac->desc = strdup("Apple Computer Inc.|BMAC/BMAC+"); + bmac->driver = strdup("bmac"); + bmac->next = devlist; + devlist = (struct device *)bmac; + } + } if (probeClass & CLASS_AUDIO) { struct macioDevice *dmasound;