Преглед изворни кода

[ethernet] Move struct mii_if_info to mii.h

Signed-off-by: Michael Brown <mcb30@etherboot.org>
tags/v0.9.8
Daniel Verkamp пре 15 година
родитељ
комит
005fce0258
3 измењених фајлова са 21 додато и 13 уклоњено
  1. 0
    6
      src/drivers/net/pcnet32.c
  2. 0
    7
      src/drivers/net/sundance.c
  3. 21
    0
      src/include/mii.h

+ 0
- 6
src/drivers/net/pcnet32.c Прегледај датотеку

@@ -222,12 +222,6 @@ struct {
222 222
 	unsigned char rxb[RX_RING_SIZE][PKT_BUF_SZ];
223 223
 } pcnet32_bufs __shared;
224 224
 
225
-/* May need to be moved to mii.h */
226
-struct mii_if_info {
227
-	int phy_id;
228
-	int advertising;
229
-	unsigned int full_duplex:1;	/* is full duplex? */
230
-};
231 225
 
232 226
 /*
233 227
  * The first three fields of pcnet32_private are read by the ethernet device 

+ 0
- 7
src/drivers/net/sundance.c Прегледај датотеку

@@ -59,13 +59,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
59 59
 #define virt_to_le32desc(addr)  cpu_to_le32(virt_to_bus(addr))
60 60
 #define le32desc_to_virt(addr)  bus_to_virt(le32_to_cpu(addr))
61 61
 
62
-/* May need to be moved to mii.h */
63
-struct mii_if_info {
64
-	int phy_id;
65
-	int advertising;
66
-	unsigned int full_duplex:1;	/* is full duplex? */
67
-};
68
-
69 62
 /* Set the mtu */
70 63
 static int mtu = 1514;
71 64
 

+ 21
- 0
src/include/mii.h Прегледај датотеку

@@ -12,6 +12,9 @@
12 12
 
13 13
 FILE_LICENCE ( GPL2_ONLY );
14 14
 
15
+#ifndef _MII_H_
16
+#define _MII_H_
17
+
15 18
 /* Generic MII registers. */
16 19
 
17 20
 #define MII_BMCR            0x00	/* Basic mode control register */
@@ -105,3 +108,21 @@ FILE_LICENCE ( GPL2_ONLY );
105 108
 #define NWAYTEST_LOOPBACK       0x0100  /* Enable loopback for N-way   */
106 109
 #define NWAYTEST_RESV2          0xfe00  /* Unused...                   */
107 110
 
111
+#include <gpxe/netdevice.h>
112
+
113
+struct mii_if_info {
114
+        int phy_id;
115
+        int advertising;
116
+        int phy_id_mask;
117
+        int reg_num_mask;
118
+
119
+        unsigned int full_duplex : 1;   /* is full duplex? */
120
+        unsigned int force_media : 1;   /* is autoneg. disabled? */
121
+        unsigned int supports_gmii : 1; /* are GMII registers supported? */
122
+
123
+        struct net_device *dev;
124
+        int (*mdio_read) (struct net_device *dev, int phy_id, int location);
125
+        void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val);
126
+};
127
+
128
+#endif

Loading…
Откажи
Сачувај