* Added miibus_linkchg and miibus_mediainit methods to device_set_driver(); this was the actual
reason the MII bus did not work as mediainit was never called. * Got rid of the delayed MII bus scanning again; not only did it not solve the problem, it was also completely unnecessary. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22812 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Hugo Santos, [email protected]. All Rights Reserved.
|
* Copyright 2007, Hugo Santos, [email protected]. All Rights Reserved.
|
||||||
|
* Copyright 2007, Axel Dörfler, [email protected]. All Rights Reserved.
|
||||||
* Copyright 2004, Marcus Overhagen. All Rights Reserved.
|
* Copyright 2004, Marcus Overhagen. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
@@ -310,6 +311,10 @@ device_set_driver(device_t dev, driver_t *driver)
|
|||||||
dev->methods.miibus_writereg = (void *)mth->method;
|
dev->methods.miibus_writereg = (void *)mth->method;
|
||||||
else if (strcmp(mth->name, "miibus_statchg") == 0)
|
else if (strcmp(mth->name, "miibus_statchg") == 0)
|
||||||
dev->methods.miibus_statchg = (void *)mth->method;
|
dev->methods.miibus_statchg = (void *)mth->method;
|
||||||
|
else if (!strcmp(mth->name, "miibus_linkchg"))
|
||||||
|
dev->methods.miibus_linkchg = (void *)mth->method;
|
||||||
|
else if (!strcmp(mth->name, "miibus_mediainit"))
|
||||||
|
dev->methods.miibus_mediainit = (void *)mth->method;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -393,19 +398,11 @@ __haiku_probe_miibus(device_t dev, driver_t *drivers[], int count)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
__haiku_scan_miibus(device_t dev)
|
bus_generic_attach(device_t dev)
|
||||||
{
|
{
|
||||||
device_t miibus = NULL;
|
|
||||||
device_t child = NULL;
|
device_t child = NULL;
|
||||||
|
|
||||||
// find miibus
|
while ((child = list_get_next_item(&dev->children, child)) != NULL) {
|
||||||
|
|
||||||
while ((miibus = list_get_next_item(&dev->children, miibus)) != NULL) {
|
|
||||||
if (miibus->driver == &miibus_driver)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((child = list_get_next_item(&miibus->children, child)) != NULL) {
|
|
||||||
if (child->driver == NULL) {
|
if (child->driver == NULL) {
|
||||||
driver_t *driver = __haiku_select_miibus_driver(child);
|
driver_t *driver = __haiku_select_miibus_driver(child);
|
||||||
if (driver) {
|
if (driver) {
|
||||||
@@ -417,18 +414,7 @@ __haiku_scan_miibus(device_t dev)
|
|||||||
device_printf(dev, "No PHY module found (%x/%x)!\n", ma->mii_id1,
|
device_printf(dev, "No PHY module found (%x/%x)!\n", ma->mii_id1,
|
||||||
ma->mii_id2);
|
ma->mii_id2);
|
||||||
}
|
}
|
||||||
}
|
} else if (child->driver == &miibus_driver)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
bus_generic_attach(device_t dev)
|
|
||||||
{
|
|
||||||
device_t child = NULL;
|
|
||||||
|
|
||||||
while ((child = list_get_next_item(&dev->children, child)) != NULL) {
|
|
||||||
if (child->driver == &miibus_driver)
|
|
||||||
child->methods.probe(child);
|
child->methods.probe(child);
|
||||||
|
|
||||||
if (child->driver != NULL)
|
if (child->driver != NULL)
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ void _fbsd_uninit_driver(driver_t *);
|
|||||||
extern const char gDriverName[];
|
extern const char gDriverName[];
|
||||||
driver_t *__haiku_select_miibus_driver(device_t dev);
|
driver_t *__haiku_select_miibus_driver(device_t dev);
|
||||||
driver_t *__haiku_probe_miibus(device_t dev, driver_t *drivers[], int count);
|
driver_t *__haiku_probe_miibus(device_t dev, driver_t *drivers[], int count);
|
||||||
void __haiku_scan_miibus(device_t dev);
|
|
||||||
|
|
||||||
/* we define the driver methods with HAIKU_FBSD_DRIVER_GLUE to
|
/* we define the driver methods with HAIKU_FBSD_DRIVER_GLUE to
|
||||||
* force the rest of the stuff to be linked back with the driver.
|
* force the rest of the stuff to be linked back with the driver.
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Hugo Santos. All Rights Reserved.
|
* Copyright 2007, Hugo Santos. All Rights Reserved.
|
||||||
|
* Copyright 2004, Marcus Overhagen. All Rights Reserved.
|
||||||
|
*
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
|
||||||
* Authors:
|
|
||||||
* Hugo Santos, [email protected]
|
|
||||||
*
|
|
||||||
* Some of this code is based on previous work by Marcus Overhagen.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
@@ -127,8 +124,6 @@ compat_open(const char *name, uint32 flags, void **cookie)
|
|||||||
struct ifnet *ifp = dev->ifp;
|
struct ifnet *ifp = dev->ifp;
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
|
|
||||||
__haiku_scan_miibus(DEVNET(dev));
|
|
||||||
|
|
||||||
ifp->if_flags &= ~IFF_UP;
|
ifp->if_flags &= ~IFF_UP;
|
||||||
ifp->if_ioctl(ifp, SIOCSIFFLAGS, NULL);
|
ifp->if_ioctl(ifp, SIOCSIFFLAGS, NULL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user