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
10FILE_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 */
41enum {
42 /** MII clock */
44 /** MII data */
46 /** MII data direction */
48};
49
50/** Delay between MDC transitions */
51#define MII_BIT_UDELAY 1
52
53extern void init_mii_bit_basher ( struct mii_bit_basher *miibit );
54
55#endif /* _IPXE_MII_BIT_H */
Bit-bashing interfaces.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
Media Independent Interface.
void init_mii_bit_basher(struct mii_bit_basher *miibit)
Initialise bit-bashing interface.
Definition mii_bit.c:160
@ MII_BIT_MDC
MII clock.
Definition mii_bit.h:43
@ MII_BIT_MDIO
MII data.
Definition mii_bit.h:45
@ MII_BIT_DRIVE
MII data direction.
Definition mii_bit.h:47
A bit-bashing interface.
Definition bitbash.h:56
A bit-bashing MII interface.
Definition mii_bit.h:33
struct bit_basher basher
Bit-bashing interface.
Definition mii_bit.h:37
struct mii_interface mdio
MII interface.
Definition mii_bit.h:35
An MII interface.
Definition mii.h:44