Skip to content

Commit

Permalink
[ethernet] Move struct mii_if_info to mii.h
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Brown <mcb30@etherboot.org>
  • Loading branch information
danielverkamp authored and Michael Brown committed May 26, 2009
1 parent 3c06277 commit 005fce0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
6 changes: 0 additions & 6 deletions src/drivers/net/pcnet32.c
Expand Up @@ -222,12 +222,6 @@ struct {
unsigned char rxb[RX_RING_SIZE][PKT_BUF_SZ];
} pcnet32_bufs __shared;

/* May need to be moved to mii.h */
struct mii_if_info {
int phy_id;
int advertising;
unsigned int full_duplex:1; /* is full duplex? */
};

/*
* The first three fields of pcnet32_private are read by the ethernet device
Expand Down
7 changes: 0 additions & 7 deletions src/drivers/net/sundance.c
Expand Up @@ -59,13 +59,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
#define virt_to_le32desc(addr) cpu_to_le32(virt_to_bus(addr))
#define le32desc_to_virt(addr) bus_to_virt(le32_to_cpu(addr))

/* May need to be moved to mii.h */
struct mii_if_info {
int phy_id;
int advertising;
unsigned int full_duplex:1; /* is full duplex? */
};

/* Set the mtu */
static int mtu = 1514;

Expand Down
21 changes: 21 additions & 0 deletions src/include/mii.h
Expand Up @@ -12,6 +12,9 @@

FILE_LICENCE ( GPL2_ONLY );

#ifndef _MII_H_
#define _MII_H_

/* Generic MII registers. */

#define MII_BMCR 0x00 /* Basic mode control register */
Expand Down Expand Up @@ -105,3 +108,21 @@ FILE_LICENCE ( GPL2_ONLY );
#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
#define NWAYTEST_RESV2 0xfe00 /* Unused... */

#include <gpxe/netdevice.h>

struct mii_if_info {
int phy_id;
int advertising;
int phy_id_mask;
int reg_num_mask;

unsigned int full_duplex : 1; /* is full duplex? */
unsigned int force_media : 1; /* is autoneg. disabled? */
unsigned int supports_gmii : 1; /* are GMII registers supported? */

struct net_device *dev;
int (*mdio_read) (struct net_device *dev, int phy_id, int location);
void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val);
};

#endif

0 comments on commit 005fce0

Please sign in to comment.