rtl8211_driver.h File Reference

RTL8211 Ethernet PHY transceiver. More...

#include "core/nic.h"

Go to the source code of this file.

Macros

#define RTL8211_PHY_ADDR   1
 
#define RTL8211_PHY_REG_BMCR   0x00
 
#define RTL8211_PHY_REG_BMSR   0x01
 
#define RTL8211_PHY_REG_PHYIDR1   0x02
 
#define RTL8211_PHY_REG_PHYIDR2   0x03
 
#define RTL8211_PHY_REG_ANAR   0x04
 
#define RTL8211_PHY_REG_ANLPAR   0x05
 
#define RTL8211_PHY_REG_ANER   0x06
 
#define RTL8211_PHY_REG_ANNPRR   0x07
 
#define RTL8211_PHY_REG_LPNPAR   0x08
 
#define RTL8211_PHY_REG_GBCR   0x09
 
#define RTL8211_PHY_REG_GBSR   0x0A
 
#define RTL8211_PHY_REG_MACR   0x0D
 
#define RTL8211_PHY_REG_MAADR   0x0E
 
#define RTL8211_PHY_REG_GBESR   0x0F
 
#define RTL8211_PHY_REG_PHYCR   0x10
 
#define RTL8211_PHY_REG_PHYSR   0x11
 
#define RTL8211_PHY_REG_INER   0x12
 
#define RTL8211_PHY_REG_INSR   0x13
 
#define RTL8211_PHY_REG_RXERC   0x18
 
#define RTL8211_PHY_REG_LDPSR   0x1B
 
#define RTL8211_PHY_REG_EPAGSR   0x1E
 
#define RTL8211_PHY_REG_PAGSEL   0x1F
 
#define BMCR_RESET   (1 << 15)
 
#define BMCR_LOOPBACK   (1 << 14)
 
#define BMCR_SPEED_SEL   (1 << 13)
 
#define BMCR_AN_EN   (1 << 12)
 
#define BMCR_POWER_DOWN   (1 << 11)
 
#define BMCR_ISOLATE   (1 << 10)
 
#define BMCR_RESTART_AN   (1 << 9)
 
#define BMCR_DUPLEX_MODE   (1 << 8)
 
#define BMCR_COL_TEST   (1 << 7)
 
#define BMSR_100BT4   (1 << 15)
 
#define BMSR_100BTX_FD   (1 << 14)
 
#define BMSR_100BTX   (1 << 13)
 
#define BMSR_10BT_FD   (1 << 12)
 
#define BMSR_10BT   (1 << 11)
 
#define BMSR_NO_PREAMBLE   (1 << 6)
 
#define BMSR_AN_COMPLETE   (1 << 5)
 
#define BMSR_REMOTE_FAULT   (1 << 4)
 
#define BMSR_AN_ABLE   (1 << 3)
 
#define BMSR_LINK_STATUS   (1 << 2)
 
#define BMSR_JABBER_DETECT   (1 << 1)
 
#define BMSR_EXTENDED_CAP   (1 << 0)
 
#define ANAR_NEXT_PAGE   (1 << 15)
 
#define ANAR_REMOTE_FAULT   (1 << 13)
 
#define ANAR_PAUSE1   (1 << 11)
 
#define ANAR_PAUSE0   (1 << 10)
 
#define ANAR_100BT4   (1 << 9)
 
#define ANAR_100BTX_FD   (1 << 8)
 
#define ANAR_100BTX   (1 << 7)
 
#define ANAR_10BT_FD   (1 << 6)
 
#define ANAR_10BT   (1 << 5)
 
#define ANAR_SELECTOR4   (1 << 4)
 
#define ANAR_SELECTOR3   (1 << 3)
 
#define ANAR_SELECTOR2   (1 << 2)
 
#define ANAR_SELECTOR1   (1 << 1)
 
#define ANAR_SELECTOR0   (1 << 0)
 
#define ANLPAR_NEXT_PAGE   (1 << 15)
 
#define ANLPAR_LP_ACK   (1 << 14)
 
#define ANLPAR_REMOTE_FAULT   (1 << 13)
 
#define ANLPAR_PAUSE1   (1 << 11)
 
#define ANLPAR_PAUSE0   (1 << 10)
 
#define ANLPAR_100BT4   (1 << 9)
 
#define ANLPAR_100BTX_FD   (1 << 8)
 
#define ANLPAR_100BTX   (1 << 7)
 
#define ANLPAR_10BT_FD   (1 << 6)
 
#define ANLPAR_10BT   (1 << 5)
 
#define ANLPAR_SELECTOR4   (1 << 4)
 
#define ANLPAR_SELECTOR3   (1 << 3)
 
#define ANLPAR_SELECTOR2   (1 << 2)
 
#define ANLPAR_SELECTOR1   (1 << 1)
 
#define ANLPAR_SELECTOR0   (1 << 0)
 
#define ANER_PAR_DET_FAULT   (1 << 4)
 
#define ANER_LP_NEXT_PAGE_ABLE   (1 << 3)
 
#define ANER_NEXT_PAGE_ABLE   (1 << 2)
 
#define ANER_PAGE_RECEIVED   (1 << 1)
 
#define ANER_LP_AN_ABLE   (1 << 0)
 
#define ANNPTR_NEXT_PAGE   (1 << 15)
 
#define ANNPTR_MSG_PAGE   (1 << 13)
 
#define ANNPTR_ACK2   (1 << 12)
 
#define ANNPTR_TOGGLE   (1 << 11)
 
#define ANNPTR_MESSAGE10   (1 << 10)
 
#define ANNPTR_MESSAGE9   (1 << 9)
 
#define ANNPTR_MESSAGE8   (1 << 8)
 
#define ANNPTR_MESSAGE7   (1 << 7)
 
#define ANNPTR_MESSAGE6   (1 << 6)
 
#define ANNPTR_MESSAGE5   (1 << 5)
 
#define ANNPTR_MESSAGE4   (1 << 4)
 
#define ANNPTR_MESSAGE3   (1 << 3)
 
#define ANNPTR_MESSAGE2   (1 << 2)
 
#define ANNPTR_MESSAGE1   (1 << 1)
 
#define ANNPTR_MESSAGE0   (1 << 0)
 
#define ANNPRR_NEXT_PAGE   (1 << 15)
 
#define ANNPRR_ACK   (1 << 14)
 
#define ANNPRR_MSG_PAGE   (1 << 13)
 
#define ANNPRR_ACK2   (1 << 12)
 
#define ANNPRR_TOGGLE   (1 << 11)
 
#define ANNPRR_MESSAGE10   (1 << 10)
 
#define ANNPRR_MESSAGE9   (1 << 9)
 
#define ANNPRR_MESSAGE8   (1 << 8)
 
#define ANNPRR_MESSAGE7   (1 << 7)
 
#define ANNPRR_MESSAGE6   (1 << 6)
 
#define ANNPRR_MESSAGE5   (1 << 5)
 
#define ANNPRR_MESSAGE4   (1 << 4)
 
#define ANNPRR_MESSAGE3   (1 << 3)
 
#define ANNPRR_MESSAGE2   (1 << 2)
 
#define ANNPRR_MESSAGE1   (1 << 1)
 
#define ANNPRR_MESSAGE0   (1 << 0)
 
#define GBCR_TEST_MODE2   (1 << 15)
 
#define GBCR_TEST_MODE1   (1 << 14)
 
#define GBCR_TEST_MODE0   (1 << 13)
 
#define GBCR_MS_MAN_CONF_EN   (1 << 12)
 
#define GBCR_MS_MAN_CONF_VAL   (1 << 11)
 
#define GBCR_PORT_TYPE   (1 << 10)
 
#define GBCR_1000BT_FD   (1 << 9)
 
#define GBCR_1000BT_HD   (1 << 8)
 
#define GBSR_MS_CONF_FAULT   (1 << 15)
 
#define GBSR_MS_CONF_RES   (1 << 14)
 
#define GBSR_LOC_REC_STATUS   (1 << 13)
 
#define GBSR_REM_REC_STATUS   (1 << 12)
 
#define GBSR_LP_1000BT_FD   (1 << 11)
 
#define GBSR_LP_1000BT_HD   (1 << 10)
 
#define GBSR_IDLE_ERR_CTR7   (1 << 7)
 
#define GBSR_IDLE_ERR_CTR6   (1 << 6)
 
#define GBSR_IDLE_ERR_CTR5   (1 << 5)
 
#define GBSR_IDLE_ERR_CTR4   (1 << 4)
 
#define GBSR_IDLE_ERR_CTR3   (1 << 3)
 
#define GBSR_IDLE_ERR_CTR2   (1 << 2)
 
#define GBSR_IDLE_ERR_CTR1   (1 << 1)
 
#define GBSR_IDLE_ERR_CTR0   (1 << 0)
 
#define MACR_FUNCTION1   (1 << 15)
 
#define MACR_FUNCTION0   (1 << 14)
 
#define MACR_DEVAD4   (1 << 4)
 
#define MACR_DEVAD3   (1 << 3)
 
#define MACR_DEVAD2   (1 << 2)
 
#define MACR_DEVAD1   (1 << 1)
 
#define MACR_DEVAD0   (1 << 0)
 
#define GBESR_1000BX_FD   (1 << 15)
 
#define GBESR_1000BX_HD   (1 << 14)
 
#define GBESR_1000BT_FD   (1 << 13)
 
#define GBESR_1000BT_HD   (1 << 12)
 
#define PHYCR_DISABLE_RXC   (1 << 15)
 
#define PHYCR_FPR_FAIL_SEL2   (1 << 14)
 
#define PHYCR_FPR_FAIL_SEL1   (1 << 13)
 
#define PHYCR_FPR_FAIL_SEL0   (1 << 12)
 
#define PHYCR_ASSERT_CRS_ON_TX   (1 << 11)
 
#define PHYCR_FORCE_LINK_GOOD   (1 << 10)
 
#define PHYCR_ENABLE_CROSSOVER   (1 << 6)
 
#define PHYCR_MDI_MODE   (1 << 5)
 
#define PHYCR_DISABLE   CLK125 (1 << 4)
 
#define PHYCR_DISABLE_JABBER   (1 << 0)
 
#define PHYSR_SPEED1   (1 << 15)
 
#define PHYSR_SPEED0   (1 << 14)
 
#define PHYSR_DUPLEX   (1 << 13)
 
#define PHYSR_PAGE_RECEIVED   (1 << 12)
 
#define PHYSR_SPEED_DUPLEX_RESOLVED   (1 << 11)
 
#define PHYSR_LINK   (1 << 10)
 
#define PHYSR_MDI_CROSSOVER_STATUS   (1 << 6)
 
#define PHYSR_RE_LINK_OK   (1 << 1)
 
#define PHYSR_JABBER   (1 << 0)
 
#define PHYSR_SPEED_MASK   (3 << 14)
 
#define PHYSR_SPEED_10   (0 << 14)
 
#define PHYSR_SPEED_100   (1 << 14)
 
#define PHYSR_SPEED_1000   (2 << 14)
 
#define INER_AN_ERROR   (1 << 15)
 
#define INER_PAGE_RECEIVED   (1 << 12)
 
#define INER_AN_COMPLETE   (1 << 11)
 
#define INER_LINK_STATUS   (1 << 10)
 
#define INER_SYMBOL_ERROR   (1 << 9)
 
#define INER_FALSE_CARRIER   (1 << 8)
 
#define INER_JABBER   (1 << 0)
 
#define INSR_AN_ERROR   (1 << 15)
 
#define INSR_PAGE_RECEIVED   (1 << 12)
 
#define INSR_AN_COMPLETE   (1 << 11)
 
#define INSR_LINK_STATUS   (1 << 10)
 
#define INSR_SYMBOL_ERROR   (1 << 9)
 
#define INSR_FALSE_CARRIER   (1 << 8)
 
#define INSR_JABBER   (1 << 0)
 
#define LDPSR_POWER_SAVE_MODE   (1 << 0)
 
#define EPAGSR_EXT_PAGE_SEL7   (1 << 7)
 
#define EPAGSR_EXT_PAGE_SEL6   (1 << 6)
 
#define EPAGSR_EXT_PAGE_SEL5   (1 << 5)
 
#define EPAGSR_EXT_PAGE_SEL4   (1 << 4)
 
#define EPAGSR_EXT_PAGE_SEL3   (1 << 3)
 
#define EPAGSR_EXT_PAGE_SEL2   (1 << 2)
 
#define EPAGSR_EXT_PAGE_SEL1   (1 << 1)
 
#define EPAGSR_EXT_PAGE_SEL0   (1 << 0)
 
#define PAGSEL_PAGE_SEL2   (1 << 2)
 
#define PAGSEL_PAGE_SEL1   (1 << 1)
 
#define PAGSEL_PAGE_SEL0   (1 << 0)
 

Functions

error_t rtl8211Init (NetInterface *interface)
 RTL8211 PHY transceiver initialization. More...
 
void rtl8211Tick (NetInterface *interface)
 RTL8211 timer handler. More...
 
void rtl8211EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void rtl8211DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void rtl8211EventHandler (NetInterface *interface)
 RTL8211 event handler. More...
 
void rtl8211WritePhyReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t rtl8211ReadPhyReg (NetInterface *interface, uint8_t address)
 Read PHY register. More...
 
void rtl8211DumpPhyReg (NetInterface *interface)
 Dump PHY registers for debugging purpose. More...
 

Variables

const PhyDriver rtl8211PhyDriver
 RTL8211 Ethernet PHY driver. More...
 

Detailed Description

RTL8211 Ethernet PHY transceiver.

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file rtl8211_driver.h.

Macro Definition Documentation

◆ ANAR_100BT4

#define ANAR_100BT4   (1 << 9)

Definition at line 96 of file rtl8211_driver.h.

◆ ANAR_100BTX

#define ANAR_100BTX   (1 << 7)

Definition at line 98 of file rtl8211_driver.h.

◆ ANAR_100BTX_FD

#define ANAR_100BTX_FD   (1 << 8)

Definition at line 97 of file rtl8211_driver.h.

◆ ANAR_10BT

#define ANAR_10BT   (1 << 5)

Definition at line 100 of file rtl8211_driver.h.

◆ ANAR_10BT_FD

#define ANAR_10BT_FD   (1 << 6)

Definition at line 99 of file rtl8211_driver.h.

◆ ANAR_NEXT_PAGE

#define ANAR_NEXT_PAGE   (1 << 15)

Definition at line 92 of file rtl8211_driver.h.

◆ ANAR_PAUSE0

#define ANAR_PAUSE0   (1 << 10)

Definition at line 95 of file rtl8211_driver.h.

◆ ANAR_PAUSE1

#define ANAR_PAUSE1   (1 << 11)

Definition at line 94 of file rtl8211_driver.h.

◆ ANAR_REMOTE_FAULT

#define ANAR_REMOTE_FAULT   (1 << 13)

Definition at line 93 of file rtl8211_driver.h.

◆ ANAR_SELECTOR0

#define ANAR_SELECTOR0   (1 << 0)

Definition at line 105 of file rtl8211_driver.h.

◆ ANAR_SELECTOR1

#define ANAR_SELECTOR1   (1 << 1)

Definition at line 104 of file rtl8211_driver.h.

◆ ANAR_SELECTOR2

#define ANAR_SELECTOR2   (1 << 2)

Definition at line 103 of file rtl8211_driver.h.

◆ ANAR_SELECTOR3

#define ANAR_SELECTOR3   (1 << 3)

Definition at line 102 of file rtl8211_driver.h.

◆ ANAR_SELECTOR4

#define ANAR_SELECTOR4   (1 << 4)

Definition at line 101 of file rtl8211_driver.h.

◆ ANER_LP_AN_ABLE

#define ANER_LP_AN_ABLE   (1 << 0)

Definition at line 129 of file rtl8211_driver.h.

◆ ANER_LP_NEXT_PAGE_ABLE

#define ANER_LP_NEXT_PAGE_ABLE   (1 << 3)

Definition at line 126 of file rtl8211_driver.h.

◆ ANER_NEXT_PAGE_ABLE

#define ANER_NEXT_PAGE_ABLE   (1 << 2)

Definition at line 127 of file rtl8211_driver.h.

◆ ANER_PAGE_RECEIVED

#define ANER_PAGE_RECEIVED   (1 << 1)

Definition at line 128 of file rtl8211_driver.h.

◆ ANER_PAR_DET_FAULT

#define ANER_PAR_DET_FAULT   (1 << 4)

Definition at line 125 of file rtl8211_driver.h.

◆ ANLPAR_100BT4

#define ANLPAR_100BT4   (1 << 9)

Definition at line 113 of file rtl8211_driver.h.

◆ ANLPAR_100BTX

#define ANLPAR_100BTX   (1 << 7)

Definition at line 115 of file rtl8211_driver.h.

◆ ANLPAR_100BTX_FD

#define ANLPAR_100BTX_FD   (1 << 8)

Definition at line 114 of file rtl8211_driver.h.

◆ ANLPAR_10BT

#define ANLPAR_10BT   (1 << 5)

Definition at line 117 of file rtl8211_driver.h.

◆ ANLPAR_10BT_FD

#define ANLPAR_10BT_FD   (1 << 6)

Definition at line 116 of file rtl8211_driver.h.

◆ ANLPAR_LP_ACK

#define ANLPAR_LP_ACK   (1 << 14)

Definition at line 109 of file rtl8211_driver.h.

◆ ANLPAR_NEXT_PAGE

#define ANLPAR_NEXT_PAGE   (1 << 15)

Definition at line 108 of file rtl8211_driver.h.

◆ ANLPAR_PAUSE0

#define ANLPAR_PAUSE0   (1 << 10)

Definition at line 112 of file rtl8211_driver.h.

◆ ANLPAR_PAUSE1

#define ANLPAR_PAUSE1   (1 << 11)

Definition at line 111 of file rtl8211_driver.h.

◆ ANLPAR_REMOTE_FAULT

#define ANLPAR_REMOTE_FAULT   (1 << 13)

Definition at line 110 of file rtl8211_driver.h.

◆ ANLPAR_SELECTOR0

#define ANLPAR_SELECTOR0   (1 << 0)

Definition at line 122 of file rtl8211_driver.h.

◆ ANLPAR_SELECTOR1

#define ANLPAR_SELECTOR1   (1 << 1)

Definition at line 121 of file rtl8211_driver.h.

◆ ANLPAR_SELECTOR2

#define ANLPAR_SELECTOR2   (1 << 2)

Definition at line 120 of file rtl8211_driver.h.

◆ ANLPAR_SELECTOR3

#define ANLPAR_SELECTOR3   (1 << 3)

Definition at line 119 of file rtl8211_driver.h.

◆ ANLPAR_SELECTOR4

#define ANLPAR_SELECTOR4   (1 << 4)

Definition at line 118 of file rtl8211_driver.h.

◆ ANNPRR_ACK

#define ANNPRR_ACK   (1 << 14)

Definition at line 150 of file rtl8211_driver.h.

◆ ANNPRR_ACK2

#define ANNPRR_ACK2   (1 << 12)

Definition at line 152 of file rtl8211_driver.h.

◆ ANNPRR_MESSAGE0

#define ANNPRR_MESSAGE0   (1 << 0)

Definition at line 164 of file rtl8211_driver.h.

◆ ANNPRR_MESSAGE1

#define ANNPRR_MESSAGE1   (1 << 1)

Definition at line 163 of file rtl8211_driver.h.

◆ ANNPRR_MESSAGE10

#define ANNPRR_MESSAGE10   (1 << 10)

Definition at line 154 of file rtl8211_driver.h.

◆ ANNPRR_MESSAGE2

#define ANNPRR_MESSAGE2   (1 << 2)

Definition at line 162 of file rtl8211_driver.h.

◆ ANNPRR_MESSAGE3

#define ANNPRR_MESSAGE3   (1 << 3)

Definition at line 161 of file rtl8211_driver.h.

◆ ANNPRR_MESSAGE4

#define ANNPRR_MESSAGE4   (1 << 4)

Definition at line 160 of file rtl8211_driver.h.

◆ ANNPRR_MESSAGE5

#define ANNPRR_MESSAGE5   (1 << 5)

Definition at line 159 of file rtl8211_driver.h.

◆ ANNPRR_MESSAGE6

#define ANNPRR_MESSAGE6   (1 << 6)

Definition at line 158 of file rtl8211_driver.h.

◆ ANNPRR_MESSAGE7

#define ANNPRR_MESSAGE7   (1 << 7)

Definition at line 157 of file rtl8211_driver.h.

◆ ANNPRR_MESSAGE8

#define ANNPRR_MESSAGE8   (1 << 8)

Definition at line 156 of file rtl8211_driver.h.

◆ ANNPRR_MESSAGE9

#define ANNPRR_MESSAGE9   (1 << 9)

Definition at line 155 of file rtl8211_driver.h.

◆ ANNPRR_MSG_PAGE

#define ANNPRR_MSG_PAGE   (1 << 13)

Definition at line 151 of file rtl8211_driver.h.

◆ ANNPRR_NEXT_PAGE

#define ANNPRR_NEXT_PAGE   (1 << 15)

Definition at line 149 of file rtl8211_driver.h.

◆ ANNPRR_TOGGLE

#define ANNPRR_TOGGLE   (1 << 11)

Definition at line 153 of file rtl8211_driver.h.

◆ ANNPTR_ACK2

#define ANNPTR_ACK2   (1 << 12)

Definition at line 134 of file rtl8211_driver.h.

◆ ANNPTR_MESSAGE0

#define ANNPTR_MESSAGE0   (1 << 0)

Definition at line 146 of file rtl8211_driver.h.

◆ ANNPTR_MESSAGE1

#define ANNPTR_MESSAGE1   (1 << 1)

Definition at line 145 of file rtl8211_driver.h.

◆ ANNPTR_MESSAGE10

#define ANNPTR_MESSAGE10   (1 << 10)

Definition at line 136 of file rtl8211_driver.h.

◆ ANNPTR_MESSAGE2

#define ANNPTR_MESSAGE2   (1 << 2)

Definition at line 144 of file rtl8211_driver.h.

◆ ANNPTR_MESSAGE3

#define ANNPTR_MESSAGE3   (1 << 3)

Definition at line 143 of file rtl8211_driver.h.

◆ ANNPTR_MESSAGE4

#define ANNPTR_MESSAGE4   (1 << 4)

Definition at line 142 of file rtl8211_driver.h.

◆ ANNPTR_MESSAGE5

#define ANNPTR_MESSAGE5   (1 << 5)

Definition at line 141 of file rtl8211_driver.h.

◆ ANNPTR_MESSAGE6

#define ANNPTR_MESSAGE6   (1 << 6)

Definition at line 140 of file rtl8211_driver.h.

◆ ANNPTR_MESSAGE7

#define ANNPTR_MESSAGE7   (1 << 7)

Definition at line 139 of file rtl8211_driver.h.

◆ ANNPTR_MESSAGE8

#define ANNPTR_MESSAGE8   (1 << 8)

Definition at line 138 of file rtl8211_driver.h.

◆ ANNPTR_MESSAGE9

#define ANNPTR_MESSAGE9   (1 << 9)

Definition at line 137 of file rtl8211_driver.h.

◆ ANNPTR_MSG_PAGE

#define ANNPTR_MSG_PAGE   (1 << 13)

Definition at line 133 of file rtl8211_driver.h.

◆ ANNPTR_NEXT_PAGE

#define ANNPTR_NEXT_PAGE   (1 << 15)

Definition at line 132 of file rtl8211_driver.h.

◆ ANNPTR_TOGGLE

#define ANNPTR_TOGGLE   (1 << 11)

Definition at line 135 of file rtl8211_driver.h.

◆ BMCR_AN_EN

#define BMCR_AN_EN   (1 << 12)

Definition at line 70 of file rtl8211_driver.h.

◆ BMCR_COL_TEST

#define BMCR_COL_TEST   (1 << 7)

Definition at line 75 of file rtl8211_driver.h.

◆ BMCR_DUPLEX_MODE

#define BMCR_DUPLEX_MODE   (1 << 8)

Definition at line 74 of file rtl8211_driver.h.

◆ BMCR_ISOLATE

#define BMCR_ISOLATE   (1 << 10)

Definition at line 72 of file rtl8211_driver.h.

◆ BMCR_LOOPBACK

#define BMCR_LOOPBACK   (1 << 14)

Definition at line 68 of file rtl8211_driver.h.

◆ BMCR_POWER_DOWN

#define BMCR_POWER_DOWN   (1 << 11)

Definition at line 71 of file rtl8211_driver.h.

◆ BMCR_RESET

#define BMCR_RESET   (1 << 15)

Definition at line 67 of file rtl8211_driver.h.

◆ BMCR_RESTART_AN

#define BMCR_RESTART_AN   (1 << 9)

Definition at line 73 of file rtl8211_driver.h.

◆ BMCR_SPEED_SEL

#define BMCR_SPEED_SEL   (1 << 13)

Definition at line 69 of file rtl8211_driver.h.

◆ BMSR_100BT4

#define BMSR_100BT4   (1 << 15)

Definition at line 78 of file rtl8211_driver.h.

◆ BMSR_100BTX

#define BMSR_100BTX   (1 << 13)

Definition at line 80 of file rtl8211_driver.h.

◆ BMSR_100BTX_FD

#define BMSR_100BTX_FD   (1 << 14)

Definition at line 79 of file rtl8211_driver.h.

◆ BMSR_10BT

#define BMSR_10BT   (1 << 11)

Definition at line 82 of file rtl8211_driver.h.

◆ BMSR_10BT_FD

#define BMSR_10BT_FD   (1 << 12)

Definition at line 81 of file rtl8211_driver.h.

◆ BMSR_AN_ABLE

#define BMSR_AN_ABLE   (1 << 3)

Definition at line 86 of file rtl8211_driver.h.

◆ BMSR_AN_COMPLETE

#define BMSR_AN_COMPLETE   (1 << 5)

Definition at line 84 of file rtl8211_driver.h.

◆ BMSR_EXTENDED_CAP

#define BMSR_EXTENDED_CAP   (1 << 0)

Definition at line 89 of file rtl8211_driver.h.

◆ BMSR_JABBER_DETECT

#define BMSR_JABBER_DETECT   (1 << 1)

Definition at line 88 of file rtl8211_driver.h.

◆ BMSR_LINK_STATUS

#define BMSR_LINK_STATUS   (1 << 2)

Definition at line 87 of file rtl8211_driver.h.

◆ BMSR_NO_PREAMBLE

#define BMSR_NO_PREAMBLE   (1 << 6)

Definition at line 83 of file rtl8211_driver.h.

◆ BMSR_REMOTE_FAULT

#define BMSR_REMOTE_FAULT   (1 << 4)

Definition at line 85 of file rtl8211_driver.h.

◆ EPAGSR_EXT_PAGE_SEL0

#define EPAGSR_EXT_PAGE_SEL0   (1 << 0)

Definition at line 265 of file rtl8211_driver.h.

◆ EPAGSR_EXT_PAGE_SEL1

#define EPAGSR_EXT_PAGE_SEL1   (1 << 1)

Definition at line 264 of file rtl8211_driver.h.

◆ EPAGSR_EXT_PAGE_SEL2

#define EPAGSR_EXT_PAGE_SEL2   (1 << 2)

Definition at line 263 of file rtl8211_driver.h.

◆ EPAGSR_EXT_PAGE_SEL3

#define EPAGSR_EXT_PAGE_SEL3   (1 << 3)

Definition at line 262 of file rtl8211_driver.h.

◆ EPAGSR_EXT_PAGE_SEL4

#define EPAGSR_EXT_PAGE_SEL4   (1 << 4)

Definition at line 261 of file rtl8211_driver.h.

◆ EPAGSR_EXT_PAGE_SEL5

#define EPAGSR_EXT_PAGE_SEL5   (1 << 5)

Definition at line 260 of file rtl8211_driver.h.

◆ EPAGSR_EXT_PAGE_SEL6

#define EPAGSR_EXT_PAGE_SEL6   (1 << 6)

Definition at line 259 of file rtl8211_driver.h.

◆ EPAGSR_EXT_PAGE_SEL7

#define EPAGSR_EXT_PAGE_SEL7   (1 << 7)

Definition at line 258 of file rtl8211_driver.h.

◆ GBCR_1000BT_FD

#define GBCR_1000BT_FD   (1 << 9)

Definition at line 173 of file rtl8211_driver.h.

◆ GBCR_1000BT_HD

#define GBCR_1000BT_HD   (1 << 8)

Definition at line 174 of file rtl8211_driver.h.

◆ GBCR_MS_MAN_CONF_EN

#define GBCR_MS_MAN_CONF_EN   (1 << 12)

Definition at line 170 of file rtl8211_driver.h.

◆ GBCR_MS_MAN_CONF_VAL

#define GBCR_MS_MAN_CONF_VAL   (1 << 11)

Definition at line 171 of file rtl8211_driver.h.

◆ GBCR_PORT_TYPE

#define GBCR_PORT_TYPE   (1 << 10)

Definition at line 172 of file rtl8211_driver.h.

◆ GBCR_TEST_MODE0

#define GBCR_TEST_MODE0   (1 << 13)

Definition at line 169 of file rtl8211_driver.h.

◆ GBCR_TEST_MODE1

#define GBCR_TEST_MODE1   (1 << 14)

Definition at line 168 of file rtl8211_driver.h.

◆ GBCR_TEST_MODE2

#define GBCR_TEST_MODE2   (1 << 15)

Definition at line 167 of file rtl8211_driver.h.

◆ GBESR_1000BT_FD

#define GBESR_1000BT_FD   (1 << 13)

Definition at line 204 of file rtl8211_driver.h.

◆ GBESR_1000BT_HD

#define GBESR_1000BT_HD   (1 << 12)

Definition at line 205 of file rtl8211_driver.h.

◆ GBESR_1000BX_FD

#define GBESR_1000BX_FD   (1 << 15)

Definition at line 202 of file rtl8211_driver.h.

◆ GBESR_1000BX_HD

#define GBESR_1000BX_HD   (1 << 14)

Definition at line 203 of file rtl8211_driver.h.

◆ GBSR_IDLE_ERR_CTR0

#define GBSR_IDLE_ERR_CTR0   (1 << 0)

Definition at line 190 of file rtl8211_driver.h.

◆ GBSR_IDLE_ERR_CTR1

#define GBSR_IDLE_ERR_CTR1   (1 << 1)

Definition at line 189 of file rtl8211_driver.h.

◆ GBSR_IDLE_ERR_CTR2

#define GBSR_IDLE_ERR_CTR2   (1 << 2)

Definition at line 188 of file rtl8211_driver.h.

◆ GBSR_IDLE_ERR_CTR3

#define GBSR_IDLE_ERR_CTR3   (1 << 3)

Definition at line 187 of file rtl8211_driver.h.

◆ GBSR_IDLE_ERR_CTR4

#define GBSR_IDLE_ERR_CTR4   (1 << 4)

Definition at line 186 of file rtl8211_driver.h.

◆ GBSR_IDLE_ERR_CTR5

#define GBSR_IDLE_ERR_CTR5   (1 << 5)

Definition at line 185 of file rtl8211_driver.h.

◆ GBSR_IDLE_ERR_CTR6

#define GBSR_IDLE_ERR_CTR6   (1 << 6)

Definition at line 184 of file rtl8211_driver.h.

◆ GBSR_IDLE_ERR_CTR7

#define GBSR_IDLE_ERR_CTR7   (1 << 7)

Definition at line 183 of file rtl8211_driver.h.

◆ GBSR_LOC_REC_STATUS

#define GBSR_LOC_REC_STATUS   (1 << 13)

Definition at line 179 of file rtl8211_driver.h.

◆ GBSR_LP_1000BT_FD

#define GBSR_LP_1000BT_FD   (1 << 11)

Definition at line 181 of file rtl8211_driver.h.

◆ GBSR_LP_1000BT_HD

#define GBSR_LP_1000BT_HD   (1 << 10)

Definition at line 182 of file rtl8211_driver.h.

◆ GBSR_MS_CONF_FAULT

#define GBSR_MS_CONF_FAULT   (1 << 15)

Definition at line 177 of file rtl8211_driver.h.

◆ GBSR_MS_CONF_RES

#define GBSR_MS_CONF_RES   (1 << 14)

Definition at line 178 of file rtl8211_driver.h.

◆ GBSR_REM_REC_STATUS

#define GBSR_REM_REC_STATUS   (1 << 12)

Definition at line 180 of file rtl8211_driver.h.

◆ INER_AN_COMPLETE

#define INER_AN_COMPLETE   (1 << 11)

Definition at line 239 of file rtl8211_driver.h.

◆ INER_AN_ERROR

#define INER_AN_ERROR   (1 << 15)

Definition at line 237 of file rtl8211_driver.h.

◆ INER_FALSE_CARRIER

#define INER_FALSE_CARRIER   (1 << 8)

Definition at line 242 of file rtl8211_driver.h.

◆ INER_JABBER

#define INER_JABBER   (1 << 0)

Definition at line 243 of file rtl8211_driver.h.

◆ INER_LINK_STATUS

#define INER_LINK_STATUS   (1 << 10)

Definition at line 240 of file rtl8211_driver.h.

◆ INER_PAGE_RECEIVED

#define INER_PAGE_RECEIVED   (1 << 12)

Definition at line 238 of file rtl8211_driver.h.

◆ INER_SYMBOL_ERROR

#define INER_SYMBOL_ERROR   (1 << 9)

Definition at line 241 of file rtl8211_driver.h.

◆ INSR_AN_COMPLETE

#define INSR_AN_COMPLETE   (1 << 11)

Definition at line 248 of file rtl8211_driver.h.

◆ INSR_AN_ERROR

#define INSR_AN_ERROR   (1 << 15)

Definition at line 246 of file rtl8211_driver.h.

◆ INSR_FALSE_CARRIER

#define INSR_FALSE_CARRIER   (1 << 8)

Definition at line 251 of file rtl8211_driver.h.

◆ INSR_JABBER

#define INSR_JABBER   (1 << 0)

Definition at line 252 of file rtl8211_driver.h.

◆ INSR_LINK_STATUS

#define INSR_LINK_STATUS   (1 << 10)

Definition at line 249 of file rtl8211_driver.h.

◆ INSR_PAGE_RECEIVED

#define INSR_PAGE_RECEIVED   (1 << 12)

Definition at line 247 of file rtl8211_driver.h.

◆ INSR_SYMBOL_ERROR

#define INSR_SYMBOL_ERROR   (1 << 9)

Definition at line 250 of file rtl8211_driver.h.

◆ LDPSR_POWER_SAVE_MODE

#define LDPSR_POWER_SAVE_MODE   (1 << 0)

Definition at line 255 of file rtl8211_driver.h.

◆ MACR_DEVAD0

#define MACR_DEVAD0   (1 << 0)

Definition at line 199 of file rtl8211_driver.h.

◆ MACR_DEVAD1

#define MACR_DEVAD1   (1 << 1)

Definition at line 198 of file rtl8211_driver.h.

◆ MACR_DEVAD2

#define MACR_DEVAD2   (1 << 2)

Definition at line 197 of file rtl8211_driver.h.

◆ MACR_DEVAD3

#define MACR_DEVAD3   (1 << 3)

Definition at line 196 of file rtl8211_driver.h.

◆ MACR_DEVAD4

#define MACR_DEVAD4   (1 << 4)

Definition at line 195 of file rtl8211_driver.h.

◆ MACR_FUNCTION0

#define MACR_FUNCTION0   (1 << 14)

Definition at line 194 of file rtl8211_driver.h.

◆ MACR_FUNCTION1

#define MACR_FUNCTION1   (1 << 15)

Definition at line 193 of file rtl8211_driver.h.

◆ PAGSEL_PAGE_SEL0

#define PAGSEL_PAGE_SEL0   (1 << 0)

Definition at line 270 of file rtl8211_driver.h.

◆ PAGSEL_PAGE_SEL1

#define PAGSEL_PAGE_SEL1   (1 << 1)

Definition at line 269 of file rtl8211_driver.h.

◆ PAGSEL_PAGE_SEL2

#define PAGSEL_PAGE_SEL2   (1 << 2)

Definition at line 268 of file rtl8211_driver.h.

◆ PHYCR_ASSERT_CRS_ON_TX

#define PHYCR_ASSERT_CRS_ON_TX   (1 << 11)

Definition at line 212 of file rtl8211_driver.h.

◆ PHYCR_DISABLE

#define PHYCR_DISABLE   CLK125 (1 << 4)

Definition at line 216 of file rtl8211_driver.h.

◆ PHYCR_DISABLE_JABBER

#define PHYCR_DISABLE_JABBER   (1 << 0)

Definition at line 217 of file rtl8211_driver.h.

◆ PHYCR_DISABLE_RXC

#define PHYCR_DISABLE_RXC   (1 << 15)

Definition at line 208 of file rtl8211_driver.h.

◆ PHYCR_ENABLE_CROSSOVER

#define PHYCR_ENABLE_CROSSOVER   (1 << 6)

Definition at line 214 of file rtl8211_driver.h.

◆ PHYCR_FORCE_LINK_GOOD

#define PHYCR_FORCE_LINK_GOOD   (1 << 10)

Definition at line 213 of file rtl8211_driver.h.

◆ PHYCR_FPR_FAIL_SEL0

#define PHYCR_FPR_FAIL_SEL0   (1 << 12)

Definition at line 211 of file rtl8211_driver.h.

◆ PHYCR_FPR_FAIL_SEL1

#define PHYCR_FPR_FAIL_SEL1   (1 << 13)

Definition at line 210 of file rtl8211_driver.h.

◆ PHYCR_FPR_FAIL_SEL2

#define PHYCR_FPR_FAIL_SEL2   (1 << 14)

Definition at line 209 of file rtl8211_driver.h.

◆ PHYCR_MDI_MODE

#define PHYCR_MDI_MODE   (1 << 5)

Definition at line 215 of file rtl8211_driver.h.

◆ PHYSR_DUPLEX

#define PHYSR_DUPLEX   (1 << 13)

Definition at line 222 of file rtl8211_driver.h.

◆ PHYSR_JABBER

#define PHYSR_JABBER   (1 << 0)

Definition at line 228 of file rtl8211_driver.h.

◆ PHYSR_LINK

#define PHYSR_LINK   (1 << 10)

Definition at line 225 of file rtl8211_driver.h.

◆ PHYSR_MDI_CROSSOVER_STATUS

#define PHYSR_MDI_CROSSOVER_STATUS   (1 << 6)

Definition at line 226 of file rtl8211_driver.h.

◆ PHYSR_PAGE_RECEIVED

#define PHYSR_PAGE_RECEIVED   (1 << 12)

Definition at line 223 of file rtl8211_driver.h.

◆ PHYSR_RE_LINK_OK

#define PHYSR_RE_LINK_OK   (1 << 1)

Definition at line 227 of file rtl8211_driver.h.

◆ PHYSR_SPEED0

#define PHYSR_SPEED0   (1 << 14)

Definition at line 221 of file rtl8211_driver.h.

◆ PHYSR_SPEED1

#define PHYSR_SPEED1   (1 << 15)

Definition at line 220 of file rtl8211_driver.h.

◆ PHYSR_SPEED_10

#define PHYSR_SPEED_10   (0 << 14)

Definition at line 232 of file rtl8211_driver.h.

◆ PHYSR_SPEED_100

#define PHYSR_SPEED_100   (1 << 14)

Definition at line 233 of file rtl8211_driver.h.

◆ PHYSR_SPEED_1000

#define PHYSR_SPEED_1000   (2 << 14)

Definition at line 234 of file rtl8211_driver.h.

◆ PHYSR_SPEED_DUPLEX_RESOLVED

#define PHYSR_SPEED_DUPLEX_RESOLVED   (1 << 11)

Definition at line 224 of file rtl8211_driver.h.

◆ PHYSR_SPEED_MASK

#define PHYSR_SPEED_MASK   (3 << 14)

Definition at line 231 of file rtl8211_driver.h.

◆ RTL8211_PHY_ADDR

#define RTL8211_PHY_ADDR   1

Definition at line 37 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_ANAR

#define RTL8211_PHY_REG_ANAR   0x04

Definition at line 47 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_ANER

#define RTL8211_PHY_REG_ANER   0x06

Definition at line 49 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_ANLPAR

#define RTL8211_PHY_REG_ANLPAR   0x05

Definition at line 48 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_ANNPRR

#define RTL8211_PHY_REG_ANNPRR   0x07

Definition at line 50 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_BMCR

#define RTL8211_PHY_REG_BMCR   0x00

Definition at line 43 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_BMSR

#define RTL8211_PHY_REG_BMSR   0x01

Definition at line 44 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_EPAGSR

#define RTL8211_PHY_REG_EPAGSR   0x1E

Definition at line 63 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_GBCR

#define RTL8211_PHY_REG_GBCR   0x09

Definition at line 52 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_GBESR

#define RTL8211_PHY_REG_GBESR   0x0F

Definition at line 56 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_GBSR

#define RTL8211_PHY_REG_GBSR   0x0A

Definition at line 53 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_INER

#define RTL8211_PHY_REG_INER   0x12

Definition at line 59 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_INSR

#define RTL8211_PHY_REG_INSR   0x13

Definition at line 60 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_LDPSR

#define RTL8211_PHY_REG_LDPSR   0x1B

Definition at line 62 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_LPNPAR

#define RTL8211_PHY_REG_LPNPAR   0x08

Definition at line 51 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_MAADR

#define RTL8211_PHY_REG_MAADR   0x0E

Definition at line 55 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_MACR

#define RTL8211_PHY_REG_MACR   0x0D

Definition at line 54 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_PAGSEL

#define RTL8211_PHY_REG_PAGSEL   0x1F

Definition at line 64 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_PHYCR

#define RTL8211_PHY_REG_PHYCR   0x10

Definition at line 57 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_PHYIDR1

#define RTL8211_PHY_REG_PHYIDR1   0x02

Definition at line 45 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_PHYIDR2

#define RTL8211_PHY_REG_PHYIDR2   0x03

Definition at line 46 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_PHYSR

#define RTL8211_PHY_REG_PHYSR   0x11

Definition at line 58 of file rtl8211_driver.h.

◆ RTL8211_PHY_REG_RXERC

#define RTL8211_PHY_REG_RXERC   0x18

Definition at line 61 of file rtl8211_driver.h.

Function Documentation

◆ rtl8211DisableIrq()

void rtl8211DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 144 of file rtl8211_driver.c.

◆ rtl8211DumpPhyReg()

void rtl8211DumpPhyReg ( NetInterface interface)

Dump PHY registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 273 of file rtl8211_driver.c.

◆ rtl8211EnableIrq()

void rtl8211EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 131 of file rtl8211_driver.c.

◆ rtl8211EventHandler()

void rtl8211EventHandler ( NetInterface interface)

RTL8211 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 157 of file rtl8211_driver.c.

◆ rtl8211Init()

error_t rtl8211Init ( NetInterface interface)

RTL8211 PHY transceiver initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 58 of file rtl8211_driver.c.

◆ rtl8211ReadPhyReg()

uint16_t rtl8211ReadPhyReg ( NetInterface interface,
uint8_t  address 
)

Read PHY register.

Parameters
[in]interfaceUnderlying network interface
[in]addressPHY register address
Returns
Register value

Definition at line 253 of file rtl8211_driver.c.

◆ rtl8211Tick()

void rtl8211Tick ( NetInterface interface)

RTL8211 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 93 of file rtl8211_driver.c.

◆ rtl8211WritePhyReg()

void rtl8211WritePhyReg ( NetInterface interface,
uint8_t  address,
uint16_t  data 
)

Write PHY register.

Parameters
[in]interfaceUnderlying network interface
[in]addressPHY register address
[in]dataRegister value

Definition at line 231 of file rtl8211_driver.c.

Variable Documentation

◆ rtl8211PhyDriver

const PhyDriver rtl8211PhyDriver

RTL8211 Ethernet PHY driver.

Definition at line 42 of file rtl8211_driver.c.