|
@@ -58,6 +58,16 @@ struct mii_dev {
|
|
static struct list_head mii_devs;
|
|
static struct list_head mii_devs;
|
|
static struct mii_dev *current_mii;
|
|
static struct mii_dev *current_mii;
|
|
|
|
|
|
|
|
+/*****************************************************************************
|
|
|
|
+ *
|
|
|
|
+ * Initialize global data. Need to be called before any other miiphy routine.
|
|
|
|
+ */
|
|
|
|
+void miiphy_init()
|
|
|
|
+{
|
|
|
|
+ INIT_LIST_HEAD(&mii_devs);
|
|
|
|
+ current_mii = NULL;
|
|
|
|
+}
|
|
|
|
+
|
|
/*****************************************************************************
|
|
/*****************************************************************************
|
|
*
|
|
*
|
|
* Register read and write MII access routines for the device <name>.
|
|
* Register read and write MII access routines for the device <name>.
|
|
@@ -71,15 +81,8 @@ void miiphy_register(char *name,
|
|
struct list_head *entry;
|
|
struct list_head *entry;
|
|
struct mii_dev *new_dev;
|
|
struct mii_dev *new_dev;
|
|
struct mii_dev *miidev;
|
|
struct mii_dev *miidev;
|
|
- static int head_initialized = 0;
|
|
|
|
unsigned int name_len;
|
|
unsigned int name_len;
|
|
|
|
|
|
- if (head_initialized == 0) {
|
|
|
|
- INIT_LIST_HEAD(&mii_devs);
|
|
|
|
- current_mii = NULL;
|
|
|
|
- head_initialized = 1;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/* check if we have unique name */
|
|
/* check if we have unique name */
|
|
list_for_each(entry, &mii_devs) {
|
|
list_for_each(entry, &mii_devs) {
|
|
miidev = list_entry(entry, struct mii_dev, link);
|
|
miidev = list_entry(entry, struct mii_dev, link);
|