ksz8081_driver.h File Reference

KSZ8081 Ethernet PHY transceiver. More...

#include "core/nic.h"

Go to the source code of this file.

Macros

#define KSZ8081_PHY_ADDR   0
 
#define KSZ8081_50MHZ_CLOCK_MODE_SUPPORT   DISABLED
 
#define KSZ8081_PHY_REG_BMCR   0x00
 
#define KSZ8081_PHY_REG_BMSR   0x01
 
#define KSZ8081_PHY_REG_PHYIDR1   0x02
 
#define KSZ8081_PHY_REG_PHYIDR2   0x03
 
#define KSZ8081_PHY_REG_ANAR   0x04
 
#define KSZ8081_PHY_REG_ANLPAR   0x05
 
#define KSZ8081_PHY_REG_ANER   0x06
 
#define KSZ8081_PHY_REG_ANNPTR   0x07
 
#define KSZ8081_PHY_REG_LPNPAR   0x08
 
#define KSZ8081_PHY_REG_DRC   0x10
 
#define KSZ8081_PHY_REG_AFECON1   0x11
 
#define KSZ8081_PHY_REG_RXERCTR   0x15
 
#define KSZ8081_PHY_REG_OMSO   0x16
 
#define KSZ8081_PHY_REG_OMSS   0x17
 
#define KSZ8081_PHY_REG_EXCON   0x18
 
#define KSZ8081_PHY_REG_ICSR   0x1B
 
#define KSZ8081_PHY_REG_LINKMDCS   0x1D
 
#define KSZ8081_PHY_REG_PHYCON1   0x1E
 
#define KSZ8081_PHY_REG_PHYCON2   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 LPNPAR_NEXT_PAGE   (1 << 15)
 
#define LPNPAR_ACK   (1 << 14)
 
#define LPNPAR_MSG_PAGE   (1 << 13)
 
#define LPNPAR_ACK2   (1 << 12)
 
#define LPNPAR_TOGGLE   (1 << 11)
 
#define LPNPAR_MESSAGE10   (1 << 10)
 
#define LPNPAR_MESSAGE9   (1 << 9)
 
#define LPNPAR_MESSAGE8   (1 << 8)
 
#define LPNPAR_MESSAGE7   (1 << 7)
 
#define LPNPAR_MESSAGE6   (1 << 6)
 
#define LPNPAR_MESSAGE5   (1 << 5)
 
#define LPNPAR_MESSAGE4   (1 << 4)
 
#define LPNPAR_MESSAGE3   (1 << 3)
 
#define LPNPAR_MESSAGE2   (1 << 2)
 
#define LPNPAR_MESSAGE1   (1 << 1)
 
#define LPNPAR_MESSAGE0   (1 << 0)
 
#define DRC_PLL_OFF   (1 << 4)
 
#define AFECON1_SLOW_OSC_MODE_EN   (1 << 5)
 
#define OMSO_BCAST_OFF_OVERRIDE   (1 << 9)
 
#define OMSO_MII_BTB_OVERRIDE   (1 << 7)
 
#define OMSO_RMII_BTB_OVERRIDE   (1 << 6)
 
#define OMSO_NAND_TREE_OVERRIDE   (1 << 5)
 
#define OMSO_RMII_OVERRIDE   (1 << 1)
 
#define OMSO_MII_OVERRIDE   (1 << 0)
 
#define OMSS_PHYAD2   (1 << 15)
 
#define OMSS_PHYAD1   (1 << 14)
 
#define OMSS_PHYAD0   (1 << 13)
 
#define OMSS_RMII_STATUS   (1 << 1)
 
#define EXCON_EDPD_DIS   (1 << 11)
 
#define ICSR_JABBER_IE   (1 << 15)
 
#define ICSR_RECEIVE_ERROR_IE   (1 << 14)
 
#define ICSR_PAGE_RECEIVED_IE   (1 << 13)
 
#define ICSR_PAR_DET_FAULT_IE   (1 << 12)
 
#define ICSR_LP_ACK_IE   (1 << 11)
 
#define ICSR_LINK_DOWN_IE   (1 << 10)
 
#define ICSR_REMOTE_FAULT_IE   (1 << 9)
 
#define ICSR_LINK_UP_IE   (1 << 8)
 
#define ICSR_JABBER_IF   (1 << 7)
 
#define ICSR_RECEIVE_ERROR_IF   (1 << 6)
 
#define ICSR_PAGE_RECEIVED_IF   (1 << 5)
 
#define ICSR_PAR_DET_FAULT_IF   (1 << 4)
 
#define ICSR_LP_ACK_IF   (1 << 3)
 
#define ICSR_LINK_DOWN_IF   (1 << 2)
 
#define ICSR_REMOTE_FAULT_IF   (1 << 1)
 
#define ICSR_LINK_UP_IF   (1 << 0)
 
#define LINKMDCS_CABLE_DIAG_EN   (1 << 15)
 
#define LINKMDCS_CABLE_DIAG_RES1   (1 << 14)
 
#define LINKMDCS_CABLE_DIAG_RES0   (1 << 13)
 
#define LINKMDCS_SHORT_CABLE   (1 << 12)
 
#define LINKMDCS_CABLE_FAULT_CNT8   (1 << 8)
 
#define LINKMDCS_CABLE_FAULT_CNT7   (1 << 7)
 
#define LINKMDCS_CABLE_FAULT_CNT6   (1 << 6)
 
#define LINKMDCS_CABLE_FAULT_CNT5   (1 << 5)
 
#define LINKMDCS_CABLE_FAULT_CNT4   (1 << 4)
 
#define LINKMDCS_CABLE_FAULT_CNT3   (1 << 3)
 
#define LINKMDCS_CABLE_FAULT_CNT2   (1 << 2)
 
#define LINKMDCS_CABLE_FAULT_CNT1   (1 << 1)
 
#define LINKMDCS_CABLE_FAULT_CNT0   (1 << 0)
 
#define PHYCON1_PAUSE_EN   (1 << 9)
 
#define PHYCON1_LINK_STATUS   (1 << 8)
 
#define PHYCON1_POL_STATUS   (1 << 7)
 
#define PHYCON1_MDIX_STATE   (1 << 5)
 
#define PHYCON1_ENERGY_DETECT   (1 << 4)
 
#define PHYCON1_ISOLATE   (1 << 3)
 
#define PHYCON1_OP_MODE2   (1 << 2)
 
#define PHYCON1_OP_MODE1   (1 << 1)
 
#define PHYCON1_OP_MODE0   (1 << 0)
 
#define PHYCON1_OP_MODE_MASK   (7 << 0)
 
#define PHYCON1_OP_MODE_AN   (0 << 0)
 
#define PHYCON1_OP_MODE_10BT   (1 << 0)
 
#define PHYCON1_OP_MODE_100BTX   (2 << 0)
 
#define PHYCON1_OP_MODE_10BT_FD   (5 << 0)
 
#define PHYCON1_OP_MODE_100BTX_FD   (6 << 0)
 
#define PHYCON2_HP_MDIX   (1 << 15)
 
#define PHYCON2_MDIX_SEL   (1 << 14)
 
#define PHYCON2_PAIR_SWAP_DIS   (1 << 13)
 
#define PHYCON2_FORCE_LINK   (1 << 11)
 
#define PHYCON2_POWER_SAVING   (1 << 10)
 
#define PHYCON2_INT_LEVEL   (1 << 9)
 
#define PHYCON2_JABBER_EN   (1 << 8)
 
#define PHYCON2_RMII_REF_CLK_SEL   (1 << 7)
 
#define PHYCON2_LED_MODE1   (1 << 5)
 
#define PHYCON2_LED_MODE0   (1 << 4)
 
#define PHYCON2_TX_DIS   (1 << 3)
 
#define PHYCON2_REMOTE_LOOPBACK   (1 << 2)
 
#define PHYCON2_SCRAMBLER_DIS   (1 << 0)
 

Functions

error_t ksz8081Init (NetInterface *interface)
 KSZ8081 PHY transceiver initialization. More...
 
void ksz8081Tick (NetInterface *interface)
 KSZ8081 timer handler. More...
 
void ksz8081EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void ksz8081DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void ksz8081EventHandler (NetInterface *interface)
 KSZ8081 event handler. More...
 
void ksz8081WritePhyReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t ksz8081ReadPhyReg (NetInterface *interface, uint8_t address)
 Read PHY register. More...
 
void ksz8081DumpPhyReg (NetInterface *interface)
 Dump PHY registers for debugging purpose. More...
 

Variables

const PhyDriver ksz8081PhyDriver
 KSZ8081 Ethernet PHY driver. More...
 

Detailed Description

KSZ8081 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 ksz8081_driver.h.

Macro Definition Documentation

◆ AFECON1_SLOW_OSC_MODE_EN

#define AFECON1_SLOW_OSC_MODE_EN   (1 << 5)

Definition at line 174 of file ksz8081_driver.h.

◆ ANAR_100BT4

#define ANAR_100BT4   (1 << 9)

Definition at line 100 of file ksz8081_driver.h.

◆ ANAR_100BTX

#define ANAR_100BTX   (1 << 7)

Definition at line 102 of file ksz8081_driver.h.

◆ ANAR_100BTX_FD

#define ANAR_100BTX_FD   (1 << 8)

Definition at line 101 of file ksz8081_driver.h.

◆ ANAR_10BT

#define ANAR_10BT   (1 << 5)

Definition at line 104 of file ksz8081_driver.h.

◆ ANAR_10BT_FD

#define ANAR_10BT_FD   (1 << 6)

Definition at line 103 of file ksz8081_driver.h.

◆ ANAR_NEXT_PAGE

#define ANAR_NEXT_PAGE   (1 << 15)

Definition at line 96 of file ksz8081_driver.h.

◆ ANAR_PAUSE0

#define ANAR_PAUSE0   (1 << 10)

Definition at line 99 of file ksz8081_driver.h.

◆ ANAR_PAUSE1

#define ANAR_PAUSE1   (1 << 11)

Definition at line 98 of file ksz8081_driver.h.

◆ ANAR_REMOTE_FAULT

#define ANAR_REMOTE_FAULT   (1 << 13)

Definition at line 97 of file ksz8081_driver.h.

◆ ANAR_SELECTOR0

#define ANAR_SELECTOR0   (1 << 0)

Definition at line 109 of file ksz8081_driver.h.

◆ ANAR_SELECTOR1

#define ANAR_SELECTOR1   (1 << 1)

Definition at line 108 of file ksz8081_driver.h.

◆ ANAR_SELECTOR2

#define ANAR_SELECTOR2   (1 << 2)

Definition at line 107 of file ksz8081_driver.h.

◆ ANAR_SELECTOR3

#define ANAR_SELECTOR3   (1 << 3)

Definition at line 106 of file ksz8081_driver.h.

◆ ANAR_SELECTOR4

#define ANAR_SELECTOR4   (1 << 4)

Definition at line 105 of file ksz8081_driver.h.

◆ ANER_LP_AN_ABLE

#define ANER_LP_AN_ABLE   (1 << 0)

Definition at line 133 of file ksz8081_driver.h.

◆ ANER_LP_NEXT_PAGE_ABLE

#define ANER_LP_NEXT_PAGE_ABLE   (1 << 3)

Definition at line 130 of file ksz8081_driver.h.

◆ ANER_NEXT_PAGE_ABLE

#define ANER_NEXT_PAGE_ABLE   (1 << 2)

Definition at line 131 of file ksz8081_driver.h.

◆ ANER_PAGE_RECEIVED

#define ANER_PAGE_RECEIVED   (1 << 1)

Definition at line 132 of file ksz8081_driver.h.

◆ ANER_PAR_DET_FAULT

#define ANER_PAR_DET_FAULT   (1 << 4)

Definition at line 129 of file ksz8081_driver.h.

◆ ANLPAR_100BT4

#define ANLPAR_100BT4   (1 << 9)

Definition at line 117 of file ksz8081_driver.h.

◆ ANLPAR_100BTX

#define ANLPAR_100BTX   (1 << 7)

Definition at line 119 of file ksz8081_driver.h.

◆ ANLPAR_100BTX_FD

#define ANLPAR_100BTX_FD   (1 << 8)

Definition at line 118 of file ksz8081_driver.h.

◆ ANLPAR_10BT

#define ANLPAR_10BT   (1 << 5)

Definition at line 121 of file ksz8081_driver.h.

◆ ANLPAR_10BT_FD

#define ANLPAR_10BT_FD   (1 << 6)

Definition at line 120 of file ksz8081_driver.h.

◆ ANLPAR_LP_ACK

#define ANLPAR_LP_ACK   (1 << 14)

Definition at line 113 of file ksz8081_driver.h.

◆ ANLPAR_NEXT_PAGE

#define ANLPAR_NEXT_PAGE   (1 << 15)

Definition at line 112 of file ksz8081_driver.h.

◆ ANLPAR_PAUSE0

#define ANLPAR_PAUSE0   (1 << 10)

Definition at line 116 of file ksz8081_driver.h.

◆ ANLPAR_PAUSE1

#define ANLPAR_PAUSE1   (1 << 11)

Definition at line 115 of file ksz8081_driver.h.

◆ ANLPAR_REMOTE_FAULT

#define ANLPAR_REMOTE_FAULT   (1 << 13)

Definition at line 114 of file ksz8081_driver.h.

◆ ANLPAR_SELECTOR0

#define ANLPAR_SELECTOR0   (1 << 0)

Definition at line 126 of file ksz8081_driver.h.

◆ ANLPAR_SELECTOR1

#define ANLPAR_SELECTOR1   (1 << 1)

Definition at line 125 of file ksz8081_driver.h.

◆ ANLPAR_SELECTOR2

#define ANLPAR_SELECTOR2   (1 << 2)

Definition at line 124 of file ksz8081_driver.h.

◆ ANLPAR_SELECTOR3

#define ANLPAR_SELECTOR3   (1 << 3)

Definition at line 123 of file ksz8081_driver.h.

◆ ANLPAR_SELECTOR4

#define ANLPAR_SELECTOR4   (1 << 4)

Definition at line 122 of file ksz8081_driver.h.

◆ ANNPTR_ACK2

#define ANNPTR_ACK2   (1 << 12)

Definition at line 138 of file ksz8081_driver.h.

◆ ANNPTR_MESSAGE0

#define ANNPTR_MESSAGE0   (1 << 0)

Definition at line 150 of file ksz8081_driver.h.

◆ ANNPTR_MESSAGE1

#define ANNPTR_MESSAGE1   (1 << 1)

Definition at line 149 of file ksz8081_driver.h.

◆ ANNPTR_MESSAGE10

#define ANNPTR_MESSAGE10   (1 << 10)

Definition at line 140 of file ksz8081_driver.h.

◆ ANNPTR_MESSAGE2

#define ANNPTR_MESSAGE2   (1 << 2)

Definition at line 148 of file ksz8081_driver.h.

◆ ANNPTR_MESSAGE3

#define ANNPTR_MESSAGE3   (1 << 3)

Definition at line 147 of file ksz8081_driver.h.

◆ ANNPTR_MESSAGE4

#define ANNPTR_MESSAGE4   (1 << 4)

Definition at line 146 of file ksz8081_driver.h.

◆ ANNPTR_MESSAGE5

#define ANNPTR_MESSAGE5   (1 << 5)

Definition at line 145 of file ksz8081_driver.h.

◆ ANNPTR_MESSAGE6

#define ANNPTR_MESSAGE6   (1 << 6)

Definition at line 144 of file ksz8081_driver.h.

◆ ANNPTR_MESSAGE7

#define ANNPTR_MESSAGE7   (1 << 7)

Definition at line 143 of file ksz8081_driver.h.

◆ ANNPTR_MESSAGE8

#define ANNPTR_MESSAGE8   (1 << 8)

Definition at line 142 of file ksz8081_driver.h.

◆ ANNPTR_MESSAGE9

#define ANNPTR_MESSAGE9   (1 << 9)

Definition at line 141 of file ksz8081_driver.h.

◆ ANNPTR_MSG_PAGE

#define ANNPTR_MSG_PAGE   (1 << 13)

Definition at line 137 of file ksz8081_driver.h.

◆ ANNPTR_NEXT_PAGE

#define ANNPTR_NEXT_PAGE   (1 << 15)

Definition at line 136 of file ksz8081_driver.h.

◆ ANNPTR_TOGGLE

#define ANNPTR_TOGGLE   (1 << 11)

Definition at line 139 of file ksz8081_driver.h.

◆ BMCR_AN_EN

#define BMCR_AN_EN   (1 << 12)

Definition at line 74 of file ksz8081_driver.h.

◆ BMCR_COL_TEST

#define BMCR_COL_TEST   (1 << 7)

Definition at line 79 of file ksz8081_driver.h.

◆ BMCR_DUPLEX_MODE

#define BMCR_DUPLEX_MODE   (1 << 8)

Definition at line 78 of file ksz8081_driver.h.

◆ BMCR_ISOLATE

#define BMCR_ISOLATE   (1 << 10)

Definition at line 76 of file ksz8081_driver.h.

◆ BMCR_LOOPBACK

#define BMCR_LOOPBACK   (1 << 14)

Definition at line 72 of file ksz8081_driver.h.

◆ BMCR_POWER_DOWN

#define BMCR_POWER_DOWN   (1 << 11)

Definition at line 75 of file ksz8081_driver.h.

◆ BMCR_RESET

#define BMCR_RESET   (1 << 15)

Definition at line 71 of file ksz8081_driver.h.

◆ BMCR_RESTART_AN

#define BMCR_RESTART_AN   (1 << 9)

Definition at line 77 of file ksz8081_driver.h.

◆ BMCR_SPEED_SEL

#define BMCR_SPEED_SEL   (1 << 13)

Definition at line 73 of file ksz8081_driver.h.

◆ BMSR_100BT4

#define BMSR_100BT4   (1 << 15)

Definition at line 82 of file ksz8081_driver.h.

◆ BMSR_100BTX

#define BMSR_100BTX   (1 << 13)

Definition at line 84 of file ksz8081_driver.h.

◆ BMSR_100BTX_FD

#define BMSR_100BTX_FD   (1 << 14)

Definition at line 83 of file ksz8081_driver.h.

◆ BMSR_10BT

#define BMSR_10BT   (1 << 11)

Definition at line 86 of file ksz8081_driver.h.

◆ BMSR_10BT_FD

#define BMSR_10BT_FD   (1 << 12)

Definition at line 85 of file ksz8081_driver.h.

◆ BMSR_AN_ABLE

#define BMSR_AN_ABLE   (1 << 3)

Definition at line 90 of file ksz8081_driver.h.

◆ BMSR_AN_COMPLETE

#define BMSR_AN_COMPLETE   (1 << 5)

Definition at line 88 of file ksz8081_driver.h.

◆ BMSR_EXTENDED_CAP

#define BMSR_EXTENDED_CAP   (1 << 0)

Definition at line 93 of file ksz8081_driver.h.

◆ BMSR_JABBER_DETECT

#define BMSR_JABBER_DETECT   (1 << 1)

Definition at line 92 of file ksz8081_driver.h.

◆ BMSR_LINK_STATUS

#define BMSR_LINK_STATUS   (1 << 2)

Definition at line 91 of file ksz8081_driver.h.

◆ BMSR_NO_PREAMBLE

#define BMSR_NO_PREAMBLE   (1 << 6)

Definition at line 87 of file ksz8081_driver.h.

◆ BMSR_REMOTE_FAULT

#define BMSR_REMOTE_FAULT   (1 << 4)

Definition at line 89 of file ksz8081_driver.h.

◆ DRC_PLL_OFF

#define DRC_PLL_OFF   (1 << 4)

Definition at line 171 of file ksz8081_driver.h.

◆ EXCON_EDPD_DIS

#define EXCON_EDPD_DIS   (1 << 11)

Definition at line 191 of file ksz8081_driver.h.

◆ ICSR_JABBER_IE

#define ICSR_JABBER_IE   (1 << 15)

Definition at line 194 of file ksz8081_driver.h.

◆ ICSR_JABBER_IF

#define ICSR_JABBER_IF   (1 << 7)

Definition at line 202 of file ksz8081_driver.h.

◆ ICSR_LINK_DOWN_IE

#define ICSR_LINK_DOWN_IE   (1 << 10)

Definition at line 199 of file ksz8081_driver.h.

◆ ICSR_LINK_DOWN_IF

#define ICSR_LINK_DOWN_IF   (1 << 2)

Definition at line 207 of file ksz8081_driver.h.

◆ ICSR_LINK_UP_IE

#define ICSR_LINK_UP_IE   (1 << 8)

Definition at line 201 of file ksz8081_driver.h.

◆ ICSR_LINK_UP_IF

#define ICSR_LINK_UP_IF   (1 << 0)

Definition at line 209 of file ksz8081_driver.h.

◆ ICSR_LP_ACK_IE

#define ICSR_LP_ACK_IE   (1 << 11)

Definition at line 198 of file ksz8081_driver.h.

◆ ICSR_LP_ACK_IF

#define ICSR_LP_ACK_IF   (1 << 3)

Definition at line 206 of file ksz8081_driver.h.

◆ ICSR_PAGE_RECEIVED_IE

#define ICSR_PAGE_RECEIVED_IE   (1 << 13)

Definition at line 196 of file ksz8081_driver.h.

◆ ICSR_PAGE_RECEIVED_IF

#define ICSR_PAGE_RECEIVED_IF   (1 << 5)

Definition at line 204 of file ksz8081_driver.h.

◆ ICSR_PAR_DET_FAULT_IE

#define ICSR_PAR_DET_FAULT_IE   (1 << 12)

Definition at line 197 of file ksz8081_driver.h.

◆ ICSR_PAR_DET_FAULT_IF

#define ICSR_PAR_DET_FAULT_IF   (1 << 4)

Definition at line 205 of file ksz8081_driver.h.

◆ ICSR_RECEIVE_ERROR_IE

#define ICSR_RECEIVE_ERROR_IE   (1 << 14)

Definition at line 195 of file ksz8081_driver.h.

◆ ICSR_RECEIVE_ERROR_IF

#define ICSR_RECEIVE_ERROR_IF   (1 << 6)

Definition at line 203 of file ksz8081_driver.h.

◆ ICSR_REMOTE_FAULT_IE

#define ICSR_REMOTE_FAULT_IE   (1 << 9)

Definition at line 200 of file ksz8081_driver.h.

◆ ICSR_REMOTE_FAULT_IF

#define ICSR_REMOTE_FAULT_IF   (1 << 1)

Definition at line 208 of file ksz8081_driver.h.

◆ KSZ8081_50MHZ_CLOCK_MODE_SUPPORT

#define KSZ8081_50MHZ_CLOCK_MODE_SUPPORT   DISABLED

Definition at line 44 of file ksz8081_driver.h.

◆ KSZ8081_PHY_ADDR

#define KSZ8081_PHY_ADDR   0

Definition at line 37 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_AFECON1

#define KSZ8081_PHY_REG_AFECON1   0x11

Definition at line 60 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_ANAR

#define KSZ8081_PHY_REG_ANAR   0x04

Definition at line 54 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_ANER

#define KSZ8081_PHY_REG_ANER   0x06

Definition at line 56 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_ANLPAR

#define KSZ8081_PHY_REG_ANLPAR   0x05

Definition at line 55 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_ANNPTR

#define KSZ8081_PHY_REG_ANNPTR   0x07

Definition at line 57 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_BMCR

#define KSZ8081_PHY_REG_BMCR   0x00

Definition at line 50 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_BMSR

#define KSZ8081_PHY_REG_BMSR   0x01

Definition at line 51 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_DRC

#define KSZ8081_PHY_REG_DRC   0x10

Definition at line 59 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_EXCON

#define KSZ8081_PHY_REG_EXCON   0x18

Definition at line 64 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_ICSR

#define KSZ8081_PHY_REG_ICSR   0x1B

Definition at line 65 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_LINKMDCS

#define KSZ8081_PHY_REG_LINKMDCS   0x1D

Definition at line 66 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_LPNPAR

#define KSZ8081_PHY_REG_LPNPAR   0x08

Definition at line 58 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_OMSO

#define KSZ8081_PHY_REG_OMSO   0x16

Definition at line 62 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_OMSS

#define KSZ8081_PHY_REG_OMSS   0x17

Definition at line 63 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_PHYCON1

#define KSZ8081_PHY_REG_PHYCON1   0x1E

Definition at line 67 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_PHYCON2

#define KSZ8081_PHY_REG_PHYCON2   0x1F

Definition at line 68 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_PHYIDR1

#define KSZ8081_PHY_REG_PHYIDR1   0x02

Definition at line 52 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_PHYIDR2

#define KSZ8081_PHY_REG_PHYIDR2   0x03

Definition at line 53 of file ksz8081_driver.h.

◆ KSZ8081_PHY_REG_RXERCTR

#define KSZ8081_PHY_REG_RXERCTR   0x15

Definition at line 61 of file ksz8081_driver.h.

◆ LINKMDCS_CABLE_DIAG_EN

#define LINKMDCS_CABLE_DIAG_EN   (1 << 15)

Definition at line 212 of file ksz8081_driver.h.

◆ LINKMDCS_CABLE_DIAG_RES0

#define LINKMDCS_CABLE_DIAG_RES0   (1 << 13)

Definition at line 214 of file ksz8081_driver.h.

◆ LINKMDCS_CABLE_DIAG_RES1

#define LINKMDCS_CABLE_DIAG_RES1   (1 << 14)

Definition at line 213 of file ksz8081_driver.h.

◆ LINKMDCS_CABLE_FAULT_CNT0

#define LINKMDCS_CABLE_FAULT_CNT0   (1 << 0)

Definition at line 224 of file ksz8081_driver.h.

◆ LINKMDCS_CABLE_FAULT_CNT1

#define LINKMDCS_CABLE_FAULT_CNT1   (1 << 1)

Definition at line 223 of file ksz8081_driver.h.

◆ LINKMDCS_CABLE_FAULT_CNT2

#define LINKMDCS_CABLE_FAULT_CNT2   (1 << 2)

Definition at line 222 of file ksz8081_driver.h.

◆ LINKMDCS_CABLE_FAULT_CNT3

#define LINKMDCS_CABLE_FAULT_CNT3   (1 << 3)

Definition at line 221 of file ksz8081_driver.h.

◆ LINKMDCS_CABLE_FAULT_CNT4

#define LINKMDCS_CABLE_FAULT_CNT4   (1 << 4)

Definition at line 220 of file ksz8081_driver.h.

◆ LINKMDCS_CABLE_FAULT_CNT5

#define LINKMDCS_CABLE_FAULT_CNT5   (1 << 5)

Definition at line 219 of file ksz8081_driver.h.

◆ LINKMDCS_CABLE_FAULT_CNT6

#define LINKMDCS_CABLE_FAULT_CNT6   (1 << 6)

Definition at line 218 of file ksz8081_driver.h.

◆ LINKMDCS_CABLE_FAULT_CNT7

#define LINKMDCS_CABLE_FAULT_CNT7   (1 << 7)

Definition at line 217 of file ksz8081_driver.h.

◆ LINKMDCS_CABLE_FAULT_CNT8

#define LINKMDCS_CABLE_FAULT_CNT8   (1 << 8)

Definition at line 216 of file ksz8081_driver.h.

◆ LINKMDCS_SHORT_CABLE

#define LINKMDCS_SHORT_CABLE   (1 << 12)

Definition at line 215 of file ksz8081_driver.h.

◆ LPNPAR_ACK

#define LPNPAR_ACK   (1 << 14)

Definition at line 154 of file ksz8081_driver.h.

◆ LPNPAR_ACK2

#define LPNPAR_ACK2   (1 << 12)

Definition at line 156 of file ksz8081_driver.h.

◆ LPNPAR_MESSAGE0

#define LPNPAR_MESSAGE0   (1 << 0)

Definition at line 168 of file ksz8081_driver.h.

◆ LPNPAR_MESSAGE1

#define LPNPAR_MESSAGE1   (1 << 1)

Definition at line 167 of file ksz8081_driver.h.

◆ LPNPAR_MESSAGE10

#define LPNPAR_MESSAGE10   (1 << 10)

Definition at line 158 of file ksz8081_driver.h.

◆ LPNPAR_MESSAGE2

#define LPNPAR_MESSAGE2   (1 << 2)

Definition at line 166 of file ksz8081_driver.h.

◆ LPNPAR_MESSAGE3

#define LPNPAR_MESSAGE3   (1 << 3)

Definition at line 165 of file ksz8081_driver.h.

◆ LPNPAR_MESSAGE4

#define LPNPAR_MESSAGE4   (1 << 4)

Definition at line 164 of file ksz8081_driver.h.

◆ LPNPAR_MESSAGE5

#define LPNPAR_MESSAGE5   (1 << 5)

Definition at line 163 of file ksz8081_driver.h.

◆ LPNPAR_MESSAGE6

#define LPNPAR_MESSAGE6   (1 << 6)

Definition at line 162 of file ksz8081_driver.h.

◆ LPNPAR_MESSAGE7

#define LPNPAR_MESSAGE7   (1 << 7)

Definition at line 161 of file ksz8081_driver.h.

◆ LPNPAR_MESSAGE8

#define LPNPAR_MESSAGE8   (1 << 8)

Definition at line 160 of file ksz8081_driver.h.

◆ LPNPAR_MESSAGE9

#define LPNPAR_MESSAGE9   (1 << 9)

Definition at line 159 of file ksz8081_driver.h.

◆ LPNPAR_MSG_PAGE

#define LPNPAR_MSG_PAGE   (1 << 13)

Definition at line 155 of file ksz8081_driver.h.

◆ LPNPAR_NEXT_PAGE

#define LPNPAR_NEXT_PAGE   (1 << 15)

Definition at line 153 of file ksz8081_driver.h.

◆ LPNPAR_TOGGLE

#define LPNPAR_TOGGLE   (1 << 11)

Definition at line 157 of file ksz8081_driver.h.

◆ OMSO_BCAST_OFF_OVERRIDE

#define OMSO_BCAST_OFF_OVERRIDE   (1 << 9)

Definition at line 177 of file ksz8081_driver.h.

◆ OMSO_MII_BTB_OVERRIDE

#define OMSO_MII_BTB_OVERRIDE   (1 << 7)

Definition at line 178 of file ksz8081_driver.h.

◆ OMSO_MII_OVERRIDE

#define OMSO_MII_OVERRIDE   (1 << 0)

Definition at line 182 of file ksz8081_driver.h.

◆ OMSO_NAND_TREE_OVERRIDE

#define OMSO_NAND_TREE_OVERRIDE   (1 << 5)

Definition at line 180 of file ksz8081_driver.h.

◆ OMSO_RMII_BTB_OVERRIDE

#define OMSO_RMII_BTB_OVERRIDE   (1 << 6)

Definition at line 179 of file ksz8081_driver.h.

◆ OMSO_RMII_OVERRIDE

#define OMSO_RMII_OVERRIDE   (1 << 1)

Definition at line 181 of file ksz8081_driver.h.

◆ OMSS_PHYAD0

#define OMSS_PHYAD0   (1 << 13)

Definition at line 187 of file ksz8081_driver.h.

◆ OMSS_PHYAD1

#define OMSS_PHYAD1   (1 << 14)

Definition at line 186 of file ksz8081_driver.h.

◆ OMSS_PHYAD2

#define OMSS_PHYAD2   (1 << 15)

Definition at line 185 of file ksz8081_driver.h.

◆ OMSS_RMII_STATUS

#define OMSS_RMII_STATUS   (1 << 1)

Definition at line 188 of file ksz8081_driver.h.

◆ PHYCON1_ENERGY_DETECT

#define PHYCON1_ENERGY_DETECT   (1 << 4)

Definition at line 231 of file ksz8081_driver.h.

◆ PHYCON1_ISOLATE

#define PHYCON1_ISOLATE   (1 << 3)

Definition at line 232 of file ksz8081_driver.h.

◆ PHYCON1_LINK_STATUS

#define PHYCON1_LINK_STATUS   (1 << 8)

Definition at line 228 of file ksz8081_driver.h.

◆ PHYCON1_MDIX_STATE

#define PHYCON1_MDIX_STATE   (1 << 5)

Definition at line 230 of file ksz8081_driver.h.

◆ PHYCON1_OP_MODE0

#define PHYCON1_OP_MODE0   (1 << 0)

Definition at line 235 of file ksz8081_driver.h.

◆ PHYCON1_OP_MODE1

#define PHYCON1_OP_MODE1   (1 << 1)

Definition at line 234 of file ksz8081_driver.h.

◆ PHYCON1_OP_MODE2

#define PHYCON1_OP_MODE2   (1 << 2)

Definition at line 233 of file ksz8081_driver.h.

◆ PHYCON1_OP_MODE_100BTX

#define PHYCON1_OP_MODE_100BTX   (2 << 0)

Definition at line 241 of file ksz8081_driver.h.

◆ PHYCON1_OP_MODE_100BTX_FD

#define PHYCON1_OP_MODE_100BTX_FD   (6 << 0)

Definition at line 243 of file ksz8081_driver.h.

◆ PHYCON1_OP_MODE_10BT

#define PHYCON1_OP_MODE_10BT   (1 << 0)

Definition at line 240 of file ksz8081_driver.h.

◆ PHYCON1_OP_MODE_10BT_FD

#define PHYCON1_OP_MODE_10BT_FD   (5 << 0)

Definition at line 242 of file ksz8081_driver.h.

◆ PHYCON1_OP_MODE_AN

#define PHYCON1_OP_MODE_AN   (0 << 0)

Definition at line 239 of file ksz8081_driver.h.

◆ PHYCON1_OP_MODE_MASK

#define PHYCON1_OP_MODE_MASK   (7 << 0)

Definition at line 238 of file ksz8081_driver.h.

◆ PHYCON1_PAUSE_EN

#define PHYCON1_PAUSE_EN   (1 << 9)

Definition at line 227 of file ksz8081_driver.h.

◆ PHYCON1_POL_STATUS

#define PHYCON1_POL_STATUS   (1 << 7)

Definition at line 229 of file ksz8081_driver.h.

◆ PHYCON2_FORCE_LINK

#define PHYCON2_FORCE_LINK   (1 << 11)

Definition at line 249 of file ksz8081_driver.h.

◆ PHYCON2_HP_MDIX

#define PHYCON2_HP_MDIX   (1 << 15)

Definition at line 246 of file ksz8081_driver.h.

◆ PHYCON2_INT_LEVEL

#define PHYCON2_INT_LEVEL   (1 << 9)

Definition at line 251 of file ksz8081_driver.h.

◆ PHYCON2_JABBER_EN

#define PHYCON2_JABBER_EN   (1 << 8)

Definition at line 252 of file ksz8081_driver.h.

◆ PHYCON2_LED_MODE0

#define PHYCON2_LED_MODE0   (1 << 4)

Definition at line 255 of file ksz8081_driver.h.

◆ PHYCON2_LED_MODE1

#define PHYCON2_LED_MODE1   (1 << 5)

Definition at line 254 of file ksz8081_driver.h.

◆ PHYCON2_MDIX_SEL

#define PHYCON2_MDIX_SEL   (1 << 14)

Definition at line 247 of file ksz8081_driver.h.

◆ PHYCON2_PAIR_SWAP_DIS

#define PHYCON2_PAIR_SWAP_DIS   (1 << 13)

Definition at line 248 of file ksz8081_driver.h.

◆ PHYCON2_POWER_SAVING

#define PHYCON2_POWER_SAVING   (1 << 10)

Definition at line 250 of file ksz8081_driver.h.

◆ PHYCON2_REMOTE_LOOPBACK

#define PHYCON2_REMOTE_LOOPBACK   (1 << 2)

Definition at line 257 of file ksz8081_driver.h.

◆ PHYCON2_RMII_REF_CLK_SEL

#define PHYCON2_RMII_REF_CLK_SEL   (1 << 7)

Definition at line 253 of file ksz8081_driver.h.

◆ PHYCON2_SCRAMBLER_DIS

#define PHYCON2_SCRAMBLER_DIS   (1 << 0)

Definition at line 258 of file ksz8081_driver.h.

◆ PHYCON2_TX_DIS

#define PHYCON2_TX_DIS   (1 << 3)

Definition at line 256 of file ksz8081_driver.h.

Function Documentation

◆ ksz8081DisableIrq()

void ksz8081DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 157 of file ksz8081_driver.c.

◆ ksz8081DumpPhyReg()

void ksz8081DumpPhyReg ( NetInterface interface)

Dump PHY registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 288 of file ksz8081_driver.c.

◆ ksz8081EnableIrq()

void ksz8081EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 144 of file ksz8081_driver.c.

◆ ksz8081EventHandler()

void ksz8081EventHandler ( NetInterface interface)

KSZ8081 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 170 of file ksz8081_driver.c.

◆ ksz8081Init()

error_t ksz8081Init ( NetInterface interface)

KSZ8081 PHY transceiver initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 58 of file ksz8081_driver.c.

◆ ksz8081ReadPhyReg()

uint16_t ksz8081ReadPhyReg ( NetInterface interface,
uint8_t  address 
)

Read PHY register.

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

Definition at line 268 of file ksz8081_driver.c.

◆ ksz8081Tick()

void ksz8081Tick ( NetInterface interface)

KSZ8081 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 106 of file ksz8081_driver.c.

◆ ksz8081WritePhyReg()

void ksz8081WritePhyReg ( 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 246 of file ksz8081_driver.c.

Variable Documentation

◆ ksz8081PhyDriver

const PhyDriver ksz8081PhyDriver

KSZ8081 Ethernet PHY driver.

Definition at line 42 of file ksz8081_driver.c.