iPXE
mii_bit.h
Go to the documentation of this file.
1 #ifndef _IPXE_MII_BIT_H
2 #define _IPXE_MII_BIT_H
3 
4 /** @file
5  *
6  * MII bit-bashing interface
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <ipxe/mii.h>
13 #include <ipxe/bitbash.h>
14 
15 #define MII_BIT_START 0xffffffff /**< Start */
16 #define MII_BIT_START_MASK 0x80000000 /**< Start mask */
17 
18 #define MII_BIT_CMD_MASK 0x00000008 /**< Command mask */
19 #define MII_BIT_CMD_READ 0x00000006 /**< Command read */
20 #define MII_BIT_CMD_WRITE 0x00000005 /**< Command write */
21 #define MII_BIT_CMD_RW 0x00000001 /**< Command read or write */
22 
23 #define MII_BIT_PHY_MASK 0x00000010 /**< PHY mask */
24 
25 #define MII_BIT_REG_MASK 0x00000010 /**< Register mask */
26 
27 #define MII_BIT_SWITCH 0x00000002 /**< Switch */
28 #define MII_BIT_SWITCH_MASK 0x00000002 /**< Switch mask */
29 
30 #define MII_BIT_DATA_MASK 0x00008000 /**< Data mask */
31 
32 /** A bit-bashing MII interface */
34  /** MII interface */
36  /** Bit-bashing interface */
38 };
39 
40 /** Bit indices used for MII bit-bashing interface */
41 enum {
42  /** MII clock */
44  /** MII data */
46  /** MII data direction */
48 };
49 
50 /** Delay between MDC transitions */
51 #define MII_BIT_UDELAY 1
52 
53 extern void init_mii_bit_basher ( struct mii_bit_basher *miibit );
54 
55 #endif /* _IPXE_MII_BIT_H */
struct mii_interface mdio
MII interface.
Definition: mii_bit.h:35
MII data direction.
Definition: mii_bit.h:47
MII data.
Definition: mii_bit.h:45
MII clock.
Definition: mii_bit.h:43
Bit-bashing interfaces.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
A bit-bashing interface.
Definition: bitbash.h:55
Media Independent Interface.
struct bit_basher basher
Bit-bashing interface.
Definition: mii_bit.h:37
An MII interface.
Definition: mii.h:43
A bit-bashing MII interface.
Definition: mii_bit.h:33
void init_mii_bit_basher(struct mii_bit_basher *miibit)
Initialise bit-bashing interface.
Definition: mii_bit.c:160