ksz9477_driver.h File Reference

KSZ9477 7-port Gigabit Ethernet switch. More...

#include "core/nic.h"

Go to the source code of this file.

Macros

#define KSZ9477_PORT1   1
 
#define KSZ9477_PORT2   2
 
#define KSZ9477_PORT3   3
 
#define KSZ9477_PORT4   4
 
#define KSZ9477_PORT5   5
 
#define KSZ9477_SPI_CMD_WRITE   0x40000000
 
#define KSZ9477_SPI_CMD_READ   0x60000000
 
#define KSZ9477_SPI_CMD_ADDR   0x001FFFE0
 
#define KSZ9477_BMCR   0x00
 
#define KSZ9477_BMSR   0x01
 
#define KSZ9477_PHYID1   0x02
 
#define KSZ9477_PHYID2   0x03
 
#define KSZ9477_ANAR   0x04
 
#define KSZ9477_ANLPAR   0x05
 
#define KSZ9477_ANER   0x06
 
#define KSZ9477_ANNPR   0x07
 
#define KSZ9477_ANLPNPR   0x08
 
#define KSZ9477_GBCR   0x09
 
#define KSZ9477_GBSR   0x0A
 
#define KSZ9477_MMDACR   0x0D
 
#define KSZ9477_MMDAADR   0x0E
 
#define KSZ9477_GBESR   0x0F
 
#define KSZ9477_RLB   0x11
 
#define KSZ9477_LINKMD   0x12
 
#define KSZ9477_DPMAPCSS   0x13
 
#define KSZ9477_RXERCTR   0x15
 
#define KSZ9477_ICSR   0x1B
 
#define KSZ9477_AUTOMDI   0x1C
 
#define KSZ9477_PHYCON   0x1F
 
#define KSZ9477_CHIP_ID0   0x0000
 
#define KSZ9477_CHIP_ID1   0x0001
 
#define KSZ9477_CHIP_ID2   0x0002
 
#define KSZ9477_CHIP_ID3   0x0003
 
#define KSZ9477_SWITCH_OP   0x0300
 
#define KSZ9477_PORT1_INT_STATUS   0x101B
 
#define KSZ9477_PORT1_INT_MASK   0x101F
 
#define KSZ9477_PORT1_OP_CTRL0   0x1020
 
#define KSZ9477_PORT1_STATUS   0x1030
 
#define KSZ9477_PORT1_MSTP_STATE   0x1B04
 
#define KSZ9477_PORT2_INT_STATUS   0x201B
 
#define KSZ9477_PORT2_INT_MASK   0x201F
 
#define KSZ9477_PORT2_OP_CTRL0   0x2020
 
#define KSZ9477_PORT2_STATUS   0x2030
 
#define KSZ9477_PORT2_MSTP_STATE   0x2B04
 
#define KSZ9477_PORT3_INT_STATUS   0x301B
 
#define KSZ9477_PORT3_INT_MASK   0x301F
 
#define KSZ9477_PORT3_OP_CTRL0   0x3020
 
#define KSZ9477_PORT3_STATUS   0x3030
 
#define KSZ9477_PORT3_MSTP_STATE   0x3B04
 
#define KSZ9477_PORT4_INT_STATUS   0x401B
 
#define KSZ9477_PORT4_INT_MASK   0x401F
 
#define KSZ9477_PORT4_OP_CTRL0   0x4020
 
#define KSZ9477_PORT4_STATUS   0x4030
 
#define KSZ9477_PORT4_MSTP_STATE   0x4B04
 
#define KSZ9477_PORT5_INT_STATUS   0x501B
 
#define KSZ9477_PORT5_INT_MASK   0x501F
 
#define KSZ9477_PORT5_OP_CTRL0   0x5020
 
#define KSZ9477_PORT5_STATUS   0x5030
 
#define KSZ9477_PORT5_MSTP_STATE   0x5B04
 
#define KSZ9477_PORT6_INT_STATUS   0x601B
 
#define KSZ9477_PORT6_INT_MASK   0x601F
 
#define KSZ9477_PORT6_OP_CTRL0   0x6020
 
#define KSZ9477_PORT6_STATUS   0x6030
 
#define KSZ9477_PORT6_XMII_CTRL0   0x6300
 
#define KSZ9477_PORT6_XMII_CTRL1   0x6301
 
#define KSZ9477_PORT6_MSTP_STATE   0x6B04
 
#define KSZ9477_PORT7_INT_STATUS   0x701B
 
#define KSZ9477_PORT7_INT_MASK   0x701F
 
#define KSZ9477_PORT7_OP_CTRL0   0x7020
 
#define KSZ9477_PORT7_STATUS   0x7030
 
#define KSZ9477_PORT7_XMII_CTRL0   0x7300
 
#define KSZ9477_PORT7_XMII_CTRL1   0x7301
 
#define KSZ9477_PORT7_MSTP_STATE   0x7B04
 
#define KSZ9477_PORTn_INT_STATUS(port)   (0x001B + ((port) * 0x1000))
 
#define KSZ9477_PORTn_INT_MASK(port)   (0x001F + ((port) * 0x1000))
 
#define KSZ9477_PORTn_OP_CTRL0(port)   (0x0020 + ((port) * 0x1000))
 
#define KSZ9477_PORTn_STATUS(port)   (0x0030 + ((port) * 0x1000))
 
#define KSZ9477_PORTn_XMII_CTRL0(port)   (0x0300 + ((port) * 0x1000))
 
#define KSZ9477_PORTn_XMII_CTRL1(port)   (0x0301 + ((port) * 0x1000))
 
#define KSZ9477_PORTn_MSTP_STATE(port)   (0x0B04 + ((port) * 0x1000))
 
#define KSZ9477_PORTn_ETH_PHY_REG(port, addr)   (0x0100 + ((port) * 0x1000) + ((addr) * 2))
 
#define KSZ9477_BMCR_RESET   0x8000
 
#define KSZ9477_BMCR_LOOPBACK   0x4000
 
#define KSZ9477_BMCR_SPEED_SEL_LSB   0x2000
 
#define KSZ9477_BMCR_AN_EN   0x1000
 
#define KSZ9477_BMCR_POWER_DOWN   0x0800
 
#define KSZ9477_BMCR_ISOLATE   0x0400
 
#define KSZ9477_BMCR_RESTART_AN   0x0200
 
#define KSZ9477_BMCR_DUPLEX_MODE   0x0100
 
#define KSZ9477_BMCR_COL_TEST   0x0080
 
#define KSZ9477_BMCR_SPEED_SEL_MSB   0x0040
 
#define KSZ9477_BMSR_100BT4   0x8000
 
#define KSZ9477_BMSR_100BTX_FD   0x4000
 
#define KSZ9477_BMSR_100BTX_HD   0x2000
 
#define KSZ9477_BMSR_10BT_FD   0x1000
 
#define KSZ9477_BMSR_10BT_HD   0x0800
 
#define KSZ9477_BMSR_EXTENDED_STATUS   0x0100
 
#define KSZ9477_BMSR_MF_PREAMBLE_SUPPR   0x0040
 
#define KSZ9477_BMSR_AN_COMPLETE   0x0020
 
#define KSZ9477_BMSR_REMOTE_FAULT   0x0010
 
#define KSZ9477_BMSR_AN_CAPABLE   0x0008
 
#define KSZ9477_BMSR_LINK_STATUS   0x0004
 
#define KSZ9477_BMSR_JABBER_DETECT   0x0002
 
#define KSZ9477_BMSR_EXTENDED_CAPABLE   0x0001
 
#define KSZ9477_PHYID1_DEFAULT   0x0022
 
#define KSZ9477_PHYID2_DEFAULT   0x1631
 
#define KSZ9477_ANAR_NEXT_PAGE   0x8000
 
#define KSZ9477_ANAR_REMOTE_FAULT   0x2000
 
#define KSZ9477_ANAR_PAUSE   0x0C00
 
#define KSZ9477_ANAR_100BT4   0x0200
 
#define KSZ9477_ANAR_100BTX_FD   0x0100
 
#define KSZ9477_ANAR_100BTX_HD   0x0080
 
#define KSZ9477_ANAR_10BT_FD   0x0040
 
#define KSZ9477_ANAR_10BT_HD   0x0020
 
#define KSZ9477_ANAR_SELECTOR   0x001F
 
#define KSZ9477_ANAR_SELECTOR_DEFAULT   0x0001
 
#define KSZ9477_ANLPAR_NEXT_PAGE   0x8000
 
#define KSZ9477_ANLPAR_ACK   0x4000
 
#define KSZ9477_ANLPAR_REMOTE_FAULT   0x2000
 
#define KSZ9477_ANLPAR_PAUSE   0x0C00
 
#define KSZ9477_ANLPAR_100BT4   0x0200
 
#define KSZ9477_ANLPAR_100BTX_FD   0x0100
 
#define KSZ9477_ANLPAR_100BTX_HD   0x0080
 
#define KSZ9477_ANLPAR_10BT_FD   0x0040
 
#define KSZ9477_ANLPAR_10BT_HD   0x0020
 
#define KSZ9477_ANLPAR_SELECTOR   0x001F
 
#define KSZ9477_ANLPAR_SELECTOR_DEFAULT   0x0001
 
#define KSZ9477_ANER_PAR_DETECT_FAULT   0x0010
 
#define KSZ9477_ANER_LP_NEXT_PAGE_ABLE   0x0008
 
#define KSZ9477_ANER_NEXT_PAGE_ABLE   0x0004
 
#define KSZ9477_ANER_PAGE_RECEIVED   0x0002
 
#define KSZ9477_ANER_LP_AN_ABLE   0x0001
 
#define KSZ9477_ANNPR_NEXT_PAGE   0x8000
 
#define KSZ9477_ANNPR_MSG_PAGE   0x2000
 
#define KSZ9477_ANNPR_ACK2   0x1000
 
#define KSZ9477_ANNPR_TOGGLE   0x0800
 
#define KSZ9477_ANNPR_MESSAGE   0x07FF
 
#define KSZ9477_ANLPNPR_NEXT_PAGE   0x8000
 
#define KSZ9477_ANLPNPR_ACK   0x4000
 
#define KSZ9477_ANLPNPR_MSG_PAGE   0x2000
 
#define KSZ9477_ANLPNPR_ACK2   0x1000
 
#define KSZ9477_ANLPNPR_TOGGLE   0x0800
 
#define KSZ9477_ANLPNPR_MESSAGE   0x07FF
 
#define KSZ9477_GBCR_TEST_MODE   0xE000
 
#define KSZ9477_GBCR_MS_MAN_CONF_EN   0x1000
 
#define KSZ9477_GBCR_MS_MAN_CONF_VAL   0x0800
 
#define KSZ9477_GBCR_PORT_TYPE   0x0400
 
#define KSZ9477_GBCR_1000BT_FD   0x0200
 
#define KSZ9477_GBCR_1000BT_HD   0x0100
 
#define KSZ9477_GBSR_MS_CONF_FAULT   0x8000
 
#define KSZ9477_GBSR_MS_CONF_RES   0x4000
 
#define KSZ9477_GBSR_LOCAL_RECEIVER_STATUS   0x2000
 
#define KSZ9477_GBSR_REMOTE_RECEIVER_STATUS   0x1000
 
#define KSZ9477_GBSR_LP_1000BT_FD   0x0800
 
#define KSZ9477_GBSR_LP_1000BT_HD   0x0400
 
#define KSZ9477_GBSR_IDLE_ERR_COUNT   0x00FF
 
#define KSZ9477_MMDACR_FUNC   0xC000
 
#define KSZ9477_MMDACR_FUNC_ADDR   0x0000
 
#define KSZ9477_MMDACR_FUNC_DATA_NO_POST_INC   0x4000
 
#define KSZ9477_MMDACR_FUNC_DATA_POST_INC_RW   0x8000
 
#define KSZ9477_MMDACR_FUNC_DATA_POST_INC_W   0xC000
 
#define KSZ9477_MMDACR_DEVAD   0x001F
 
#define KSZ9477_GBESR_1000BX_FD   0x8000
 
#define KSZ9477_GBESR_1000BX_HD   0x4000
 
#define KSZ9477_GBESR_1000BT_FD   0x2000
 
#define KSZ9477_GBESR_1000BT_HD   0x1000
 
#define KSZ9477_RLB_REMOTE_LOOPBACK   0x0100
 
#define KSZ9477_LINKMD_TEST_EN   0x8000
 
#define KSZ9477_LINKMD_PAIR   0x3000
 
#define KSZ9477_LINKMD_PAIR_A   0x0000
 
#define KSZ9477_LINKMD_PAIR_B   0x1000
 
#define KSZ9477_LINKMD_PAIR_C   0x2000
 
#define KSZ9477_LINKMD_PAIR_D   0x3000
 
#define KSZ9477_LINKMD_STATUS   0x0300
 
#define KSZ9477_LINKMD_STATUS_NORMAL   0x0000
 
#define KSZ9477_LINKMD_STATUS_OPEN   0x0100
 
#define KSZ9477_LINKMD_STATUS_SHORT   0x0200
 
#define KSZ9477_LINKMD_RESULT   0x00FF
 
#define KSZ9477_DPMAPCSS_1000BT_LINK_STATUS   0x0002
 
#define KSZ9477_DPMAPCSS_100BTX_LINK_STATUS   0x0001
 
#define KSZ9477_ICSR_JABBER_IE   0x8000
 
#define KSZ9477_ICSR_RECEIVE_ERROR_IE   0x4000
 
#define KSZ9477_ICSR_PAGE_RECEIVED_IE   0x2000
 
#define KSZ9477_ICSR_PAR_DETECT_FAULT_IE   0x1000
 
#define KSZ9477_ICSR_LP_ACK_IE   0x0800
 
#define KSZ9477_ICSR_LINK_DOWN_IE   0x0400
 
#define KSZ9477_ICSR_REMOTE_FAULT_IE   0x0200
 
#define KSZ9477_ICSR_LINK_UP_IE   0x0100
 
#define KSZ9477_ICSR_JABBER_IF   0x0080
 
#define KSZ9477_ICSR_RECEIVE_ERROR_IF   0x0040
 
#define KSZ9477_ICSR_PAGE_RECEIVED_IF   0x0020
 
#define KSZ9477_ICSR_PAR_DETECT_FAULT_IF   0x0010
 
#define KSZ9477_ICSR_LP_ACK_IF   0x0008
 
#define KSZ9477_ICSR_LINK_DOWN_IF   0x0004
 
#define KSZ9477_ICSR_REMOTE_FAULT_IF   0x0002
 
#define KSZ9477_ICSR_LINK_UP_IF   0x0001
 
#define KSZ9477_AUTOMDI_MDI_SET   0x0080
 
#define KSZ9477_AUTOMDI_SWAP_OFF   0x0040
 
#define KSZ9477_PHYCON_JABBER_EN   0x0200
 
#define KSZ9477_PHYCON_SPEED_1000BT   0x0040
 
#define KSZ9477_PHYCON_SPEED_100BTX   0x0020
 
#define KSZ9477_PHYCON_SPEED_10BT   0x0010
 
#define KSZ9477_PHYCON_DUPLEX_STATUS   0x0008
 
#define KSZ9477_PHYCON_1000BT_MS_STATUS   0x0004
 
#define KSZ9477_CHIP_ID0_DEFAULT   0x00
 
#define KSZ9477_CHIP_ID1_DEFAULT   0x94
 
#define KSZ9477_CHIP_ID2_DEFAULT   0x77
 
#define KSZ9477_CHIP_ID3_REVISION_ID   0xF0
 
#define KSZ9477_CHIP_ID3_GLOBAL_SOFT_RESET   0x01
 
#define KSZ9477_SWITCH_OP_DOUBLE_TAG_EN   0x80
 
#define KSZ9477_SWITCH_OP_SOFT_HARD_RESET   0x02
 
#define KSZ9477_SWITCH_OP_START_SWITCH   0x01
 
#define KSZ9477_PORTn_INT_STATUS_SGMII_AN_DONE   0x08
 
#define KSZ9477_PORTn_INT_STATUS_PTP   0x04
 
#define KSZ9477_PORTn_INT_STATUS_PHY   0x02
 
#define KSZ9477_PORTn_INT_STATUS_ACL   0x01
 
#define KSZ9477_PORTn_INT_MASK_SGMII_AN_DONE   0x08
 
#define KSZ9477_PORTn_INT_MASK_PTP   0x04
 
#define KSZ9477_PORTn_INT_MASK_PHY   0x02
 
#define KSZ9477_PORTn_INT_MASK_ACL   0x01
 
#define KSZ9477_PORTn_OP_CTRL0_LOCAL_LOOPBACK   0x80
 
#define KSZ9477_PORTn_OP_CTRL0_REMOTE_LOOPBACK   0x40
 
#define KSZ9477_PORTn_OP_CTRL0_TAIL_TAG_EN   0x04
 
#define KSZ9477_PORTn_OP_CTRL0_TX_QUEUE_SPLIT_EN   0x03
 
#define KSZ9477_PORTn_STATUS_SPEED   0x18
 
#define KSZ9477_PORTn_STATUS_SPEED_10MBPS   0x00
 
#define KSZ9477_PORTn_STATUS_SPEED_100MBPS   0x08
 
#define KSZ9477_PORTn_STATUS_SPEED_1000MBPS   0x10
 
#define KSZ9477_PORTn_STATUS_DUPLEX   0x04
 
#define KSZ9477_PORTn_STATUS_TX_FLOW_CTRL_EN   0x02
 
#define KSZ9477_PORTn_STATUS_RX_FLOW_CTRL_EN   0x01
 
#define KSZ9477_PORTn_XMII_CTRL0_DUPLEX   0x40
 
#define KSZ9477_PORTn_XMII_CTRL0_TX_FLOW_CTRL_EN   0x20
 
#define KSZ9477_PORTn_XMII_CTRL0_SPEED_10_100   0x10
 
#define KSZ9477_PORTn_XMII_CTRL0_RX_FLOW_CTRL_EN   0x08
 
#define KSZ9477_PORTn_XMII_CTRL1_SPEED_1000   0x40
 
#define KSZ9477_PORTn_XMII_CTRL1_RGMII_ID_IG   0x10
 
#define KSZ9477_PORTn_XMII_CTRL1_RGMII_ID_EG   0x08
 
#define KSZ9477_PORTn_XMII_CTRL1_MII_RMII_MODE   0x04
 
#define KSZ9477_PORTn_XMII_CTRL1_IF_TYPE   0x03
 
#define KSZ9477_PORTn_XMII_CTRL1_IF_TYPE_RGMII   0x00
 
#define KSZ9477_PORTn_XMII_CTRL1_IF_TYPE_RMII   0x01
 
#define KSZ9477_PORTn_XMII_CTRL1_IF_TYPE_MII   0x03
 
#define KSZ9477_PORTn_MSTP_STATE_TRANSMIT_EN   0x04
 
#define KSZ9477_PORTn_MSTP_STATE_RECEIVE_EN   0x02
 
#define KSZ9477_PORTn_MSTP_STATE_LEARNING_DIS   0x01
 
#define KSZ9477_TAIL_TAG_ENCODE(port)   HTONS(0x0200 | (1 << (((port) - 1) & 0x0007)))
 
#define KSZ9477_TAIL_TAG_DECODE(tag)   (((tag) & 0x07) + 1)
 

Functions

error_t ksz9477Init (NetInterface *interface)
 KSZ9477 Ethernet switch initialization. More...
 
bool_t ksz9477GetLinkState (NetInterface *interface, uint8_t port)
 Get link state. More...
 
void ksz9477Tick (NetInterface *interface)
 KSZ9477 timer handler. More...
 
void ksz9477EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void ksz9477DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void ksz9477EventHandler (NetInterface *interface)
 KSZ9477 event handler. More...
 
error_t ksz9477TagFrame (NetInterface *interface, NetBuffer *buffer, size_t *offset, uint8_t port, uint16_t *type)
 Add tail tag to Ethernet frame. More...
 
error_t ksz9477UntagFrame (NetInterface *interface, uint8_t **frame, size_t *length, uint8_t *port)
 Decode tail tag from incoming Ethernet frame. More...
 
void ksz9477WritePhyReg (NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t ksz9477ReadPhyReg (NetInterface *interface, uint8_t port, uint8_t address)
 Read PHY register. More...
 
void ksz9477DumpPhyReg (NetInterface *interface, uint8_t port)
 Dump PHY registers for debugging purpose. More...
 
void ksz9477WriteSwitchReg (NetInterface *interface, uint16_t address, uint8_t data)
 Write switch register. More...
 
uint8_t ksz9477ReadSwitchReg (NetInterface *interface, uint16_t address)
 Read switch register. More...
 
void ksz9477DumpSwitchReg (NetInterface *interface)
 Dump switch registers for debugging purpose. More...
 

Variables

const PhyDriver ksz9477PhyDriver
 KSZ9477 Ethernet switch driver. More...
 

Detailed Description

KSZ9477 7-port Gigabit Ethernet switch.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2019 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.4

Definition in file ksz9477_driver.h.

Macro Definition Documentation

◆ KSZ9477_ANAR

#define KSZ9477_ANAR   0x04

Definition at line 54 of file ksz9477_driver.h.

◆ KSZ9477_ANAR_100BT4

#define KSZ9477_ANAR_100BT4   0x0200

Definition at line 165 of file ksz9477_driver.h.

◆ KSZ9477_ANAR_100BTX_FD

#define KSZ9477_ANAR_100BTX_FD   0x0100

Definition at line 166 of file ksz9477_driver.h.

◆ KSZ9477_ANAR_100BTX_HD

#define KSZ9477_ANAR_100BTX_HD   0x0080

Definition at line 167 of file ksz9477_driver.h.

◆ KSZ9477_ANAR_10BT_FD

#define KSZ9477_ANAR_10BT_FD   0x0040

Definition at line 168 of file ksz9477_driver.h.

◆ KSZ9477_ANAR_10BT_HD

#define KSZ9477_ANAR_10BT_HD   0x0020

Definition at line 169 of file ksz9477_driver.h.

◆ KSZ9477_ANAR_NEXT_PAGE

#define KSZ9477_ANAR_NEXT_PAGE   0x8000

Definition at line 162 of file ksz9477_driver.h.

◆ KSZ9477_ANAR_PAUSE

#define KSZ9477_ANAR_PAUSE   0x0C00

Definition at line 164 of file ksz9477_driver.h.

◆ KSZ9477_ANAR_REMOTE_FAULT

#define KSZ9477_ANAR_REMOTE_FAULT   0x2000

Definition at line 163 of file ksz9477_driver.h.

◆ KSZ9477_ANAR_SELECTOR

#define KSZ9477_ANAR_SELECTOR   0x001F

Definition at line 170 of file ksz9477_driver.h.

◆ KSZ9477_ANAR_SELECTOR_DEFAULT

#define KSZ9477_ANAR_SELECTOR_DEFAULT   0x0001

Definition at line 171 of file ksz9477_driver.h.

◆ KSZ9477_ANER

#define KSZ9477_ANER   0x06

Definition at line 56 of file ksz9477_driver.h.

◆ KSZ9477_ANER_LP_AN_ABLE

#define KSZ9477_ANER_LP_AN_ABLE   0x0001

Definition at line 191 of file ksz9477_driver.h.

◆ KSZ9477_ANER_LP_NEXT_PAGE_ABLE

#define KSZ9477_ANER_LP_NEXT_PAGE_ABLE   0x0008

Definition at line 188 of file ksz9477_driver.h.

◆ KSZ9477_ANER_NEXT_PAGE_ABLE

#define KSZ9477_ANER_NEXT_PAGE_ABLE   0x0004

Definition at line 189 of file ksz9477_driver.h.

◆ KSZ9477_ANER_PAGE_RECEIVED

#define KSZ9477_ANER_PAGE_RECEIVED   0x0002

Definition at line 190 of file ksz9477_driver.h.

◆ KSZ9477_ANER_PAR_DETECT_FAULT

#define KSZ9477_ANER_PAR_DETECT_FAULT   0x0010

Definition at line 187 of file ksz9477_driver.h.

◆ KSZ9477_ANLPAR

#define KSZ9477_ANLPAR   0x05

Definition at line 55 of file ksz9477_driver.h.

◆ KSZ9477_ANLPAR_100BT4

#define KSZ9477_ANLPAR_100BT4   0x0200

Definition at line 178 of file ksz9477_driver.h.

◆ KSZ9477_ANLPAR_100BTX_FD

#define KSZ9477_ANLPAR_100BTX_FD   0x0100

Definition at line 179 of file ksz9477_driver.h.

◆ KSZ9477_ANLPAR_100BTX_HD

#define KSZ9477_ANLPAR_100BTX_HD   0x0080

Definition at line 180 of file ksz9477_driver.h.

◆ KSZ9477_ANLPAR_10BT_FD

#define KSZ9477_ANLPAR_10BT_FD   0x0040

Definition at line 181 of file ksz9477_driver.h.

◆ KSZ9477_ANLPAR_10BT_HD

#define KSZ9477_ANLPAR_10BT_HD   0x0020

Definition at line 182 of file ksz9477_driver.h.

◆ KSZ9477_ANLPAR_ACK

#define KSZ9477_ANLPAR_ACK   0x4000

Definition at line 175 of file ksz9477_driver.h.

◆ KSZ9477_ANLPAR_NEXT_PAGE

#define KSZ9477_ANLPAR_NEXT_PAGE   0x8000

Definition at line 174 of file ksz9477_driver.h.

◆ KSZ9477_ANLPAR_PAUSE

#define KSZ9477_ANLPAR_PAUSE   0x0C00

Definition at line 177 of file ksz9477_driver.h.

◆ KSZ9477_ANLPAR_REMOTE_FAULT

#define KSZ9477_ANLPAR_REMOTE_FAULT   0x2000

Definition at line 176 of file ksz9477_driver.h.

◆ KSZ9477_ANLPAR_SELECTOR

#define KSZ9477_ANLPAR_SELECTOR   0x001F

Definition at line 183 of file ksz9477_driver.h.

◆ KSZ9477_ANLPAR_SELECTOR_DEFAULT

#define KSZ9477_ANLPAR_SELECTOR_DEFAULT   0x0001

Definition at line 184 of file ksz9477_driver.h.

◆ KSZ9477_ANLPNPR

#define KSZ9477_ANLPNPR   0x08

Definition at line 58 of file ksz9477_driver.h.

◆ KSZ9477_ANLPNPR_ACK

#define KSZ9477_ANLPNPR_ACK   0x4000

Definition at line 202 of file ksz9477_driver.h.

◆ KSZ9477_ANLPNPR_ACK2

#define KSZ9477_ANLPNPR_ACK2   0x1000

Definition at line 204 of file ksz9477_driver.h.

◆ KSZ9477_ANLPNPR_MESSAGE

#define KSZ9477_ANLPNPR_MESSAGE   0x07FF

Definition at line 206 of file ksz9477_driver.h.

◆ KSZ9477_ANLPNPR_MSG_PAGE

#define KSZ9477_ANLPNPR_MSG_PAGE   0x2000

Definition at line 203 of file ksz9477_driver.h.

◆ KSZ9477_ANLPNPR_NEXT_PAGE

#define KSZ9477_ANLPNPR_NEXT_PAGE   0x8000

Definition at line 201 of file ksz9477_driver.h.

◆ KSZ9477_ANLPNPR_TOGGLE

#define KSZ9477_ANLPNPR_TOGGLE   0x0800

Definition at line 205 of file ksz9477_driver.h.

◆ KSZ9477_ANNPR

#define KSZ9477_ANNPR   0x07

Definition at line 57 of file ksz9477_driver.h.

◆ KSZ9477_ANNPR_ACK2

#define KSZ9477_ANNPR_ACK2   0x1000

Definition at line 196 of file ksz9477_driver.h.

◆ KSZ9477_ANNPR_MESSAGE

#define KSZ9477_ANNPR_MESSAGE   0x07FF

Definition at line 198 of file ksz9477_driver.h.

◆ KSZ9477_ANNPR_MSG_PAGE

#define KSZ9477_ANNPR_MSG_PAGE   0x2000

Definition at line 195 of file ksz9477_driver.h.

◆ KSZ9477_ANNPR_NEXT_PAGE

#define KSZ9477_ANNPR_NEXT_PAGE   0x8000

Definition at line 194 of file ksz9477_driver.h.

◆ KSZ9477_ANNPR_TOGGLE

#define KSZ9477_ANNPR_TOGGLE   0x0800

Definition at line 197 of file ksz9477_driver.h.

◆ KSZ9477_AUTOMDI

#define KSZ9477_AUTOMDI   0x1C

Definition at line 69 of file ksz9477_driver.h.

◆ KSZ9477_AUTOMDI_MDI_SET

#define KSZ9477_AUTOMDI_MDI_SET   0x0080

Definition at line 278 of file ksz9477_driver.h.

◆ KSZ9477_AUTOMDI_SWAP_OFF

#define KSZ9477_AUTOMDI_SWAP_OFF   0x0040

Definition at line 279 of file ksz9477_driver.h.

◆ KSZ9477_BMCR

#define KSZ9477_BMCR   0x00

Definition at line 50 of file ksz9477_driver.h.

◆ KSZ9477_BMCR_AN_EN

#define KSZ9477_BMCR_AN_EN   0x1000

Definition at line 132 of file ksz9477_driver.h.

◆ KSZ9477_BMCR_COL_TEST

#define KSZ9477_BMCR_COL_TEST   0x0080

Definition at line 137 of file ksz9477_driver.h.

◆ KSZ9477_BMCR_DUPLEX_MODE

#define KSZ9477_BMCR_DUPLEX_MODE   0x0100

Definition at line 136 of file ksz9477_driver.h.

◆ KSZ9477_BMCR_ISOLATE

#define KSZ9477_BMCR_ISOLATE   0x0400

Definition at line 134 of file ksz9477_driver.h.

◆ KSZ9477_BMCR_LOOPBACK

#define KSZ9477_BMCR_LOOPBACK   0x4000

Definition at line 130 of file ksz9477_driver.h.

◆ KSZ9477_BMCR_POWER_DOWN

#define KSZ9477_BMCR_POWER_DOWN   0x0800

Definition at line 133 of file ksz9477_driver.h.

◆ KSZ9477_BMCR_RESET

#define KSZ9477_BMCR_RESET   0x8000

Definition at line 129 of file ksz9477_driver.h.

◆ KSZ9477_BMCR_RESTART_AN

#define KSZ9477_BMCR_RESTART_AN   0x0200

Definition at line 135 of file ksz9477_driver.h.

◆ KSZ9477_BMCR_SPEED_SEL_LSB

#define KSZ9477_BMCR_SPEED_SEL_LSB   0x2000

Definition at line 131 of file ksz9477_driver.h.

◆ KSZ9477_BMCR_SPEED_SEL_MSB

#define KSZ9477_BMCR_SPEED_SEL_MSB   0x0040

Definition at line 138 of file ksz9477_driver.h.

◆ KSZ9477_BMSR

#define KSZ9477_BMSR   0x01

Definition at line 51 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_100BT4

#define KSZ9477_BMSR_100BT4   0x8000

Definition at line 141 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_100BTX_FD

#define KSZ9477_BMSR_100BTX_FD   0x4000

Definition at line 142 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_100BTX_HD

#define KSZ9477_BMSR_100BTX_HD   0x2000

Definition at line 143 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_10BT_FD

#define KSZ9477_BMSR_10BT_FD   0x1000

Definition at line 144 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_10BT_HD

#define KSZ9477_BMSR_10BT_HD   0x0800

Definition at line 145 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_AN_CAPABLE

#define KSZ9477_BMSR_AN_CAPABLE   0x0008

Definition at line 150 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_AN_COMPLETE

#define KSZ9477_BMSR_AN_COMPLETE   0x0020

Definition at line 148 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_EXTENDED_CAPABLE

#define KSZ9477_BMSR_EXTENDED_CAPABLE   0x0001

Definition at line 153 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_EXTENDED_STATUS

#define KSZ9477_BMSR_EXTENDED_STATUS   0x0100

Definition at line 146 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_JABBER_DETECT

#define KSZ9477_BMSR_JABBER_DETECT   0x0002

Definition at line 152 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_LINK_STATUS

#define KSZ9477_BMSR_LINK_STATUS   0x0004

Definition at line 151 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_MF_PREAMBLE_SUPPR

#define KSZ9477_BMSR_MF_PREAMBLE_SUPPR   0x0040

Definition at line 147 of file ksz9477_driver.h.

◆ KSZ9477_BMSR_REMOTE_FAULT

#define KSZ9477_BMSR_REMOTE_FAULT   0x0010

Definition at line 149 of file ksz9477_driver.h.

◆ KSZ9477_CHIP_ID0

#define KSZ9477_CHIP_ID0   0x0000

Definition at line 73 of file ksz9477_driver.h.

◆ KSZ9477_CHIP_ID0_DEFAULT

#define KSZ9477_CHIP_ID0_DEFAULT   0x00

Definition at line 290 of file ksz9477_driver.h.

◆ KSZ9477_CHIP_ID1

#define KSZ9477_CHIP_ID1   0x0001

Definition at line 74 of file ksz9477_driver.h.

◆ KSZ9477_CHIP_ID1_DEFAULT

#define KSZ9477_CHIP_ID1_DEFAULT   0x94

Definition at line 293 of file ksz9477_driver.h.

◆ KSZ9477_CHIP_ID2

#define KSZ9477_CHIP_ID2   0x0002

Definition at line 75 of file ksz9477_driver.h.

◆ KSZ9477_CHIP_ID2_DEFAULT

#define KSZ9477_CHIP_ID2_DEFAULT   0x77

Definition at line 296 of file ksz9477_driver.h.

◆ KSZ9477_CHIP_ID3

#define KSZ9477_CHIP_ID3   0x0003

Definition at line 76 of file ksz9477_driver.h.

◆ KSZ9477_CHIP_ID3_GLOBAL_SOFT_RESET

#define KSZ9477_CHIP_ID3_GLOBAL_SOFT_RESET   0x01

Definition at line 300 of file ksz9477_driver.h.

◆ KSZ9477_CHIP_ID3_REVISION_ID

#define KSZ9477_CHIP_ID3_REVISION_ID   0xF0

Definition at line 299 of file ksz9477_driver.h.

◆ KSZ9477_DPMAPCSS

#define KSZ9477_DPMAPCSS   0x13

Definition at line 66 of file ksz9477_driver.h.

◆ KSZ9477_DPMAPCSS_1000BT_LINK_STATUS

#define KSZ9477_DPMAPCSS_1000BT_LINK_STATUS   0x0002

Definition at line 256 of file ksz9477_driver.h.

◆ KSZ9477_DPMAPCSS_100BTX_LINK_STATUS

#define KSZ9477_DPMAPCSS_100BTX_LINK_STATUS   0x0001

Definition at line 257 of file ksz9477_driver.h.

◆ KSZ9477_GBCR

#define KSZ9477_GBCR   0x09

Definition at line 59 of file ksz9477_driver.h.

◆ KSZ9477_GBCR_1000BT_FD

#define KSZ9477_GBCR_1000BT_FD   0x0200

Definition at line 213 of file ksz9477_driver.h.

◆ KSZ9477_GBCR_1000BT_HD

#define KSZ9477_GBCR_1000BT_HD   0x0100

Definition at line 214 of file ksz9477_driver.h.

◆ KSZ9477_GBCR_MS_MAN_CONF_EN

#define KSZ9477_GBCR_MS_MAN_CONF_EN   0x1000

Definition at line 210 of file ksz9477_driver.h.

◆ KSZ9477_GBCR_MS_MAN_CONF_VAL

#define KSZ9477_GBCR_MS_MAN_CONF_VAL   0x0800

Definition at line 211 of file ksz9477_driver.h.

◆ KSZ9477_GBCR_PORT_TYPE

#define KSZ9477_GBCR_PORT_TYPE   0x0400

Definition at line 212 of file ksz9477_driver.h.

◆ KSZ9477_GBCR_TEST_MODE

#define KSZ9477_GBCR_TEST_MODE   0xE000

Definition at line 209 of file ksz9477_driver.h.

◆ KSZ9477_GBESR

#define KSZ9477_GBESR   0x0F

Definition at line 63 of file ksz9477_driver.h.

◆ KSZ9477_GBESR_1000BT_FD

#define KSZ9477_GBESR_1000BT_FD   0x2000

Definition at line 236 of file ksz9477_driver.h.

◆ KSZ9477_GBESR_1000BT_HD

#define KSZ9477_GBESR_1000BT_HD   0x1000

Definition at line 237 of file ksz9477_driver.h.

◆ KSZ9477_GBESR_1000BX_FD

#define KSZ9477_GBESR_1000BX_FD   0x8000

Definition at line 234 of file ksz9477_driver.h.

◆ KSZ9477_GBESR_1000BX_HD

#define KSZ9477_GBESR_1000BX_HD   0x4000

Definition at line 235 of file ksz9477_driver.h.

◆ KSZ9477_GBSR

#define KSZ9477_GBSR   0x0A

Definition at line 60 of file ksz9477_driver.h.

◆ KSZ9477_GBSR_IDLE_ERR_COUNT

#define KSZ9477_GBSR_IDLE_ERR_COUNT   0x00FF

Definition at line 223 of file ksz9477_driver.h.

◆ KSZ9477_GBSR_LOCAL_RECEIVER_STATUS

#define KSZ9477_GBSR_LOCAL_RECEIVER_STATUS   0x2000

Definition at line 219 of file ksz9477_driver.h.

◆ KSZ9477_GBSR_LP_1000BT_FD

#define KSZ9477_GBSR_LP_1000BT_FD   0x0800

Definition at line 221 of file ksz9477_driver.h.

◆ KSZ9477_GBSR_LP_1000BT_HD

#define KSZ9477_GBSR_LP_1000BT_HD   0x0400

Definition at line 222 of file ksz9477_driver.h.

◆ KSZ9477_GBSR_MS_CONF_FAULT

#define KSZ9477_GBSR_MS_CONF_FAULT   0x8000

Definition at line 217 of file ksz9477_driver.h.

◆ KSZ9477_GBSR_MS_CONF_RES

#define KSZ9477_GBSR_MS_CONF_RES   0x4000

Definition at line 218 of file ksz9477_driver.h.

◆ KSZ9477_GBSR_REMOTE_RECEIVER_STATUS

#define KSZ9477_GBSR_REMOTE_RECEIVER_STATUS   0x1000

Definition at line 220 of file ksz9477_driver.h.

◆ KSZ9477_ICSR

#define KSZ9477_ICSR   0x1B

Definition at line 68 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_JABBER_IE

#define KSZ9477_ICSR_JABBER_IE   0x8000

Definition at line 260 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_JABBER_IF

#define KSZ9477_ICSR_JABBER_IF   0x0080

Definition at line 268 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_LINK_DOWN_IE

#define KSZ9477_ICSR_LINK_DOWN_IE   0x0400

Definition at line 265 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_LINK_DOWN_IF

#define KSZ9477_ICSR_LINK_DOWN_IF   0x0004

Definition at line 273 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_LINK_UP_IE

#define KSZ9477_ICSR_LINK_UP_IE   0x0100

Definition at line 267 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_LINK_UP_IF

#define KSZ9477_ICSR_LINK_UP_IF   0x0001

Definition at line 275 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_LP_ACK_IE

#define KSZ9477_ICSR_LP_ACK_IE   0x0800

Definition at line 264 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_LP_ACK_IF

#define KSZ9477_ICSR_LP_ACK_IF   0x0008

Definition at line 272 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_PAGE_RECEIVED_IE

#define KSZ9477_ICSR_PAGE_RECEIVED_IE   0x2000

Definition at line 262 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_PAGE_RECEIVED_IF

#define KSZ9477_ICSR_PAGE_RECEIVED_IF   0x0020

Definition at line 270 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_PAR_DETECT_FAULT_IE

#define KSZ9477_ICSR_PAR_DETECT_FAULT_IE   0x1000

Definition at line 263 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_PAR_DETECT_FAULT_IF

#define KSZ9477_ICSR_PAR_DETECT_FAULT_IF   0x0010

Definition at line 271 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_RECEIVE_ERROR_IE

#define KSZ9477_ICSR_RECEIVE_ERROR_IE   0x4000

Definition at line 261 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_RECEIVE_ERROR_IF

#define KSZ9477_ICSR_RECEIVE_ERROR_IF   0x0040

Definition at line 269 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_REMOTE_FAULT_IE

#define KSZ9477_ICSR_REMOTE_FAULT_IE   0x0200

Definition at line 266 of file ksz9477_driver.h.

◆ KSZ9477_ICSR_REMOTE_FAULT_IF

#define KSZ9477_ICSR_REMOTE_FAULT_IF   0x0002

Definition at line 274 of file ksz9477_driver.h.

◆ KSZ9477_LINKMD

#define KSZ9477_LINKMD   0x12

Definition at line 65 of file ksz9477_driver.h.

◆ KSZ9477_LINKMD_PAIR

#define KSZ9477_LINKMD_PAIR   0x3000

Definition at line 244 of file ksz9477_driver.h.

◆ KSZ9477_LINKMD_PAIR_A

#define KSZ9477_LINKMD_PAIR_A   0x0000

Definition at line 245 of file ksz9477_driver.h.

◆ KSZ9477_LINKMD_PAIR_B

#define KSZ9477_LINKMD_PAIR_B   0x1000

Definition at line 246 of file ksz9477_driver.h.

◆ KSZ9477_LINKMD_PAIR_C

#define KSZ9477_LINKMD_PAIR_C   0x2000

Definition at line 247 of file ksz9477_driver.h.

◆ KSZ9477_LINKMD_PAIR_D

#define KSZ9477_LINKMD_PAIR_D   0x3000

Definition at line 248 of file ksz9477_driver.h.

◆ KSZ9477_LINKMD_RESULT

#define KSZ9477_LINKMD_RESULT   0x00FF

Definition at line 253 of file ksz9477_driver.h.

◆ KSZ9477_LINKMD_STATUS

#define KSZ9477_LINKMD_STATUS   0x0300

Definition at line 249 of file ksz9477_driver.h.

◆ KSZ9477_LINKMD_STATUS_NORMAL

#define KSZ9477_LINKMD_STATUS_NORMAL   0x0000

Definition at line 250 of file ksz9477_driver.h.

◆ KSZ9477_LINKMD_STATUS_OPEN

#define KSZ9477_LINKMD_STATUS_OPEN   0x0100

Definition at line 251 of file ksz9477_driver.h.

◆ KSZ9477_LINKMD_STATUS_SHORT

#define KSZ9477_LINKMD_STATUS_SHORT   0x0200

Definition at line 252 of file ksz9477_driver.h.

◆ KSZ9477_LINKMD_TEST_EN

#define KSZ9477_LINKMD_TEST_EN   0x8000

Definition at line 243 of file ksz9477_driver.h.

◆ KSZ9477_MMDAADR

#define KSZ9477_MMDAADR   0x0E

Definition at line 62 of file ksz9477_driver.h.

◆ KSZ9477_MMDACR

#define KSZ9477_MMDACR   0x0D

Definition at line 61 of file ksz9477_driver.h.

◆ KSZ9477_MMDACR_DEVAD

#define KSZ9477_MMDACR_DEVAD   0x001F

Definition at line 231 of file ksz9477_driver.h.

◆ KSZ9477_MMDACR_FUNC

#define KSZ9477_MMDACR_FUNC   0xC000

Definition at line 226 of file ksz9477_driver.h.

◆ KSZ9477_MMDACR_FUNC_ADDR

#define KSZ9477_MMDACR_FUNC_ADDR   0x0000

Definition at line 227 of file ksz9477_driver.h.

◆ KSZ9477_MMDACR_FUNC_DATA_NO_POST_INC

#define KSZ9477_MMDACR_FUNC_DATA_NO_POST_INC   0x4000

Definition at line 228 of file ksz9477_driver.h.

◆ KSZ9477_MMDACR_FUNC_DATA_POST_INC_RW

#define KSZ9477_MMDACR_FUNC_DATA_POST_INC_RW   0x8000

Definition at line 229 of file ksz9477_driver.h.

◆ KSZ9477_MMDACR_FUNC_DATA_POST_INC_W

#define KSZ9477_MMDACR_FUNC_DATA_POST_INC_W   0xC000

Definition at line 230 of file ksz9477_driver.h.

◆ KSZ9477_PHYCON

#define KSZ9477_PHYCON   0x1F

Definition at line 70 of file ksz9477_driver.h.

◆ KSZ9477_PHYCON_1000BT_MS_STATUS

#define KSZ9477_PHYCON_1000BT_MS_STATUS   0x0004

Definition at line 287 of file ksz9477_driver.h.

◆ KSZ9477_PHYCON_DUPLEX_STATUS

#define KSZ9477_PHYCON_DUPLEX_STATUS   0x0008

Definition at line 286 of file ksz9477_driver.h.

◆ KSZ9477_PHYCON_JABBER_EN

#define KSZ9477_PHYCON_JABBER_EN   0x0200

Definition at line 282 of file ksz9477_driver.h.

◆ KSZ9477_PHYCON_SPEED_1000BT

#define KSZ9477_PHYCON_SPEED_1000BT   0x0040

Definition at line 283 of file ksz9477_driver.h.

◆ KSZ9477_PHYCON_SPEED_100BTX

#define KSZ9477_PHYCON_SPEED_100BTX   0x0020

Definition at line 284 of file ksz9477_driver.h.

◆ KSZ9477_PHYCON_SPEED_10BT

#define KSZ9477_PHYCON_SPEED_10BT   0x0010

Definition at line 285 of file ksz9477_driver.h.

◆ KSZ9477_PHYID1

#define KSZ9477_PHYID1   0x02

Definition at line 52 of file ksz9477_driver.h.

◆ KSZ9477_PHYID1_DEFAULT

#define KSZ9477_PHYID1_DEFAULT   0x0022

Definition at line 156 of file ksz9477_driver.h.

◆ KSZ9477_PHYID2

#define KSZ9477_PHYID2   0x03

Definition at line 53 of file ksz9477_driver.h.

◆ KSZ9477_PHYID2_DEFAULT

#define KSZ9477_PHYID2_DEFAULT   0x1631

Definition at line 159 of file ksz9477_driver.h.

◆ KSZ9477_PORT1

#define KSZ9477_PORT1   1

Definition at line 38 of file ksz9477_driver.h.

◆ KSZ9477_PORT1_INT_MASK

#define KSZ9477_PORT1_INT_MASK   0x101F

Definition at line 79 of file ksz9477_driver.h.

◆ KSZ9477_PORT1_INT_STATUS

#define KSZ9477_PORT1_INT_STATUS   0x101B

Definition at line 78 of file ksz9477_driver.h.

◆ KSZ9477_PORT1_MSTP_STATE

#define KSZ9477_PORT1_MSTP_STATE   0x1B04

Definition at line 82 of file ksz9477_driver.h.

◆ KSZ9477_PORT1_OP_CTRL0

#define KSZ9477_PORT1_OP_CTRL0   0x1020

Definition at line 80 of file ksz9477_driver.h.

◆ KSZ9477_PORT1_STATUS

#define KSZ9477_PORT1_STATUS   0x1030

Definition at line 81 of file ksz9477_driver.h.

◆ KSZ9477_PORT2

#define KSZ9477_PORT2   2

Definition at line 39 of file ksz9477_driver.h.

◆ KSZ9477_PORT2_INT_MASK

#define KSZ9477_PORT2_INT_MASK   0x201F

Definition at line 84 of file ksz9477_driver.h.

◆ KSZ9477_PORT2_INT_STATUS

#define KSZ9477_PORT2_INT_STATUS   0x201B

Definition at line 83 of file ksz9477_driver.h.

◆ KSZ9477_PORT2_MSTP_STATE

#define KSZ9477_PORT2_MSTP_STATE   0x2B04

Definition at line 87 of file ksz9477_driver.h.

◆ KSZ9477_PORT2_OP_CTRL0

#define KSZ9477_PORT2_OP_CTRL0   0x2020

Definition at line 85 of file ksz9477_driver.h.

◆ KSZ9477_PORT2_STATUS

#define KSZ9477_PORT2_STATUS   0x2030

Definition at line 86 of file ksz9477_driver.h.

◆ KSZ9477_PORT3

#define KSZ9477_PORT3   3

Definition at line 40 of file ksz9477_driver.h.

◆ KSZ9477_PORT3_INT_MASK

#define KSZ9477_PORT3_INT_MASK   0x301F

Definition at line 89 of file ksz9477_driver.h.

◆ KSZ9477_PORT3_INT_STATUS

#define KSZ9477_PORT3_INT_STATUS   0x301B

Definition at line 88 of file ksz9477_driver.h.

◆ KSZ9477_PORT3_MSTP_STATE

#define KSZ9477_PORT3_MSTP_STATE   0x3B04

Definition at line 92 of file ksz9477_driver.h.

◆ KSZ9477_PORT3_OP_CTRL0

#define KSZ9477_PORT3_OP_CTRL0   0x3020

Definition at line 90 of file ksz9477_driver.h.

◆ KSZ9477_PORT3_STATUS

#define KSZ9477_PORT3_STATUS   0x3030

Definition at line 91 of file ksz9477_driver.h.

◆ KSZ9477_PORT4

#define KSZ9477_PORT4   4

Definition at line 41 of file ksz9477_driver.h.

◆ KSZ9477_PORT4_INT_MASK

#define KSZ9477_PORT4_INT_MASK   0x401F

Definition at line 94 of file ksz9477_driver.h.

◆ KSZ9477_PORT4_INT_STATUS

#define KSZ9477_PORT4_INT_STATUS   0x401B

Definition at line 93 of file ksz9477_driver.h.

◆ KSZ9477_PORT4_MSTP_STATE

#define KSZ9477_PORT4_MSTP_STATE   0x4B04

Definition at line 97 of file ksz9477_driver.h.

◆ KSZ9477_PORT4_OP_CTRL0

#define KSZ9477_PORT4_OP_CTRL0   0x4020

Definition at line 95 of file ksz9477_driver.h.

◆ KSZ9477_PORT4_STATUS

#define KSZ9477_PORT4_STATUS   0x4030

Definition at line 96 of file ksz9477_driver.h.

◆ KSZ9477_PORT5

#define KSZ9477_PORT5   5

Definition at line 42 of file ksz9477_driver.h.

◆ KSZ9477_PORT5_INT_MASK

#define KSZ9477_PORT5_INT_MASK   0x501F

Definition at line 99 of file ksz9477_driver.h.

◆ KSZ9477_PORT5_INT_STATUS

#define KSZ9477_PORT5_INT_STATUS   0x501B

Definition at line 98 of file ksz9477_driver.h.

◆ KSZ9477_PORT5_MSTP_STATE

#define KSZ9477_PORT5_MSTP_STATE   0x5B04

Definition at line 102 of file ksz9477_driver.h.

◆ KSZ9477_PORT5_OP_CTRL0

#define KSZ9477_PORT5_OP_CTRL0   0x5020

Definition at line 100 of file ksz9477_driver.h.

◆ KSZ9477_PORT5_STATUS

#define KSZ9477_PORT5_STATUS   0x5030

Definition at line 101 of file ksz9477_driver.h.

◆ KSZ9477_PORT6_INT_MASK

#define KSZ9477_PORT6_INT_MASK   0x601F

Definition at line 104 of file ksz9477_driver.h.

◆ KSZ9477_PORT6_INT_STATUS

#define KSZ9477_PORT6_INT_STATUS   0x601B

Definition at line 103 of file ksz9477_driver.h.

◆ KSZ9477_PORT6_MSTP_STATE

#define KSZ9477_PORT6_MSTP_STATE   0x6B04

Definition at line 109 of file ksz9477_driver.h.

◆ KSZ9477_PORT6_OP_CTRL0

#define KSZ9477_PORT6_OP_CTRL0   0x6020

Definition at line 105 of file ksz9477_driver.h.

◆ KSZ9477_PORT6_STATUS

#define KSZ9477_PORT6_STATUS   0x6030

Definition at line 106 of file ksz9477_driver.h.

◆ KSZ9477_PORT6_XMII_CTRL0

#define KSZ9477_PORT6_XMII_CTRL0   0x6300

Definition at line 107 of file ksz9477_driver.h.

◆ KSZ9477_PORT6_XMII_CTRL1

#define KSZ9477_PORT6_XMII_CTRL1   0x6301

Definition at line 108 of file ksz9477_driver.h.

◆ KSZ9477_PORT7_INT_MASK

#define KSZ9477_PORT7_INT_MASK   0x701F

Definition at line 111 of file ksz9477_driver.h.

◆ KSZ9477_PORT7_INT_STATUS

#define KSZ9477_PORT7_INT_STATUS   0x701B

Definition at line 110 of file ksz9477_driver.h.

◆ KSZ9477_PORT7_MSTP_STATE

#define KSZ9477_PORT7_MSTP_STATE   0x7B04

Definition at line 116 of file ksz9477_driver.h.

◆ KSZ9477_PORT7_OP_CTRL0

#define KSZ9477_PORT7_OP_CTRL0   0x7020

Definition at line 112 of file ksz9477_driver.h.

◆ KSZ9477_PORT7_STATUS

#define KSZ9477_PORT7_STATUS   0x7030

Definition at line 113 of file ksz9477_driver.h.

◆ KSZ9477_PORT7_XMII_CTRL0

#define KSZ9477_PORT7_XMII_CTRL0   0x7300

Definition at line 114 of file ksz9477_driver.h.

◆ KSZ9477_PORT7_XMII_CTRL1

#define KSZ9477_PORT7_XMII_CTRL1   0x7301

Definition at line 115 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_ETH_PHY_REG

#define KSZ9477_PORTn_ETH_PHY_REG (   port,
  addr 
)    (0x0100 + ((port) * 0x1000) + ((addr) * 2))

Definition at line 126 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_INT_MASK

#define KSZ9477_PORTn_INT_MASK (   port)    (0x001F + ((port) * 0x1000))

Definition at line 120 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_INT_MASK_ACL

#define KSZ9477_PORTn_INT_MASK_ACL   0x01

Definition at line 317 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_INT_MASK_PHY

#define KSZ9477_PORTn_INT_MASK_PHY   0x02

Definition at line 316 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_INT_MASK_PTP

#define KSZ9477_PORTn_INT_MASK_PTP   0x04

Definition at line 315 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_INT_MASK_SGMII_AN_DONE

#define KSZ9477_PORTn_INT_MASK_SGMII_AN_DONE   0x08

Definition at line 314 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_INT_STATUS

#define KSZ9477_PORTn_INT_STATUS (   port)    (0x001B + ((port) * 0x1000))

Definition at line 119 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_INT_STATUS_ACL

#define KSZ9477_PORTn_INT_STATUS_ACL   0x01

Definition at line 311 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_INT_STATUS_PHY

#define KSZ9477_PORTn_INT_STATUS_PHY   0x02

Definition at line 310 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_INT_STATUS_PTP

#define KSZ9477_PORTn_INT_STATUS_PTP   0x04

Definition at line 309 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_INT_STATUS_SGMII_AN_DONE

#define KSZ9477_PORTn_INT_STATUS_SGMII_AN_DONE   0x08

Definition at line 308 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_MSTP_STATE

#define KSZ9477_PORTn_MSTP_STATE (   port)    (0x0B04 + ((port) * 0x1000))

Definition at line 125 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_MSTP_STATE_LEARNING_DIS

#define KSZ9477_PORTn_MSTP_STATE_LEARNING_DIS   0x01

Definition at line 353 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_MSTP_STATE_RECEIVE_EN

#define KSZ9477_PORTn_MSTP_STATE_RECEIVE_EN   0x02

Definition at line 352 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_MSTP_STATE_TRANSMIT_EN

#define KSZ9477_PORTn_MSTP_STATE_TRANSMIT_EN   0x04

Definition at line 351 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_OP_CTRL0

#define KSZ9477_PORTn_OP_CTRL0 (   port)    (0x0020 + ((port) * 0x1000))

Definition at line 121 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_OP_CTRL0_LOCAL_LOOPBACK

#define KSZ9477_PORTn_OP_CTRL0_LOCAL_LOOPBACK   0x80

Definition at line 320 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_OP_CTRL0_REMOTE_LOOPBACK

#define KSZ9477_PORTn_OP_CTRL0_REMOTE_LOOPBACK   0x40

Definition at line 321 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_OP_CTRL0_TAIL_TAG_EN

#define KSZ9477_PORTn_OP_CTRL0_TAIL_TAG_EN   0x04

Definition at line 322 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_OP_CTRL0_TX_QUEUE_SPLIT_EN

#define KSZ9477_PORTn_OP_CTRL0_TX_QUEUE_SPLIT_EN   0x03

Definition at line 323 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_STATUS

#define KSZ9477_PORTn_STATUS (   port)    (0x0030 + ((port) * 0x1000))

Definition at line 122 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_STATUS_DUPLEX

#define KSZ9477_PORTn_STATUS_DUPLEX   0x04

Definition at line 330 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_STATUS_RX_FLOW_CTRL_EN

#define KSZ9477_PORTn_STATUS_RX_FLOW_CTRL_EN   0x01

Definition at line 332 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_STATUS_SPEED

#define KSZ9477_PORTn_STATUS_SPEED   0x18

Definition at line 326 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_STATUS_SPEED_1000MBPS

#define KSZ9477_PORTn_STATUS_SPEED_1000MBPS   0x10

Definition at line 329 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_STATUS_SPEED_100MBPS

#define KSZ9477_PORTn_STATUS_SPEED_100MBPS   0x08

Definition at line 328 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_STATUS_SPEED_10MBPS

#define KSZ9477_PORTn_STATUS_SPEED_10MBPS   0x00

Definition at line 327 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_STATUS_TX_FLOW_CTRL_EN

#define KSZ9477_PORTn_STATUS_TX_FLOW_CTRL_EN   0x02

Definition at line 331 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL0

#define KSZ9477_PORTn_XMII_CTRL0 (   port)    (0x0300 + ((port) * 0x1000))

Definition at line 123 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL0_DUPLEX

#define KSZ9477_PORTn_XMII_CTRL0_DUPLEX   0x40

Definition at line 335 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL0_RX_FLOW_CTRL_EN

#define KSZ9477_PORTn_XMII_CTRL0_RX_FLOW_CTRL_EN   0x08

Definition at line 338 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL0_SPEED_10_100

#define KSZ9477_PORTn_XMII_CTRL0_SPEED_10_100   0x10

Definition at line 337 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL0_TX_FLOW_CTRL_EN

#define KSZ9477_PORTn_XMII_CTRL0_TX_FLOW_CTRL_EN   0x20

Definition at line 336 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL1

#define KSZ9477_PORTn_XMII_CTRL1 (   port)    (0x0301 + ((port) * 0x1000))

Definition at line 124 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL1_IF_TYPE

#define KSZ9477_PORTn_XMII_CTRL1_IF_TYPE   0x03

Definition at line 345 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL1_IF_TYPE_MII

#define KSZ9477_PORTn_XMII_CTRL1_IF_TYPE_MII   0x03

Definition at line 348 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL1_IF_TYPE_RGMII

#define KSZ9477_PORTn_XMII_CTRL1_IF_TYPE_RGMII   0x00

Definition at line 346 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL1_IF_TYPE_RMII

#define KSZ9477_PORTn_XMII_CTRL1_IF_TYPE_RMII   0x01

Definition at line 347 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL1_MII_RMII_MODE

#define KSZ9477_PORTn_XMII_CTRL1_MII_RMII_MODE   0x04

Definition at line 344 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL1_RGMII_ID_EG

#define KSZ9477_PORTn_XMII_CTRL1_RGMII_ID_EG   0x08

Definition at line 343 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL1_RGMII_ID_IG

#define KSZ9477_PORTn_XMII_CTRL1_RGMII_ID_IG   0x10

Definition at line 342 of file ksz9477_driver.h.

◆ KSZ9477_PORTn_XMII_CTRL1_SPEED_1000

#define KSZ9477_PORTn_XMII_CTRL1_SPEED_1000   0x40

Definition at line 341 of file ksz9477_driver.h.

◆ KSZ9477_RLB

#define KSZ9477_RLB   0x11

Definition at line 64 of file ksz9477_driver.h.

◆ KSZ9477_RLB_REMOTE_LOOPBACK

#define KSZ9477_RLB_REMOTE_LOOPBACK   0x0100

Definition at line 240 of file ksz9477_driver.h.

◆ KSZ9477_RXERCTR

#define KSZ9477_RXERCTR   0x15

Definition at line 67 of file ksz9477_driver.h.

◆ KSZ9477_SPI_CMD_ADDR

#define KSZ9477_SPI_CMD_ADDR   0x001FFFE0

Definition at line 47 of file ksz9477_driver.h.

◆ KSZ9477_SPI_CMD_READ

#define KSZ9477_SPI_CMD_READ   0x60000000

Definition at line 46 of file ksz9477_driver.h.

◆ KSZ9477_SPI_CMD_WRITE

#define KSZ9477_SPI_CMD_WRITE   0x40000000

Definition at line 45 of file ksz9477_driver.h.

◆ KSZ9477_SWITCH_OP

#define KSZ9477_SWITCH_OP   0x0300

Definition at line 77 of file ksz9477_driver.h.

◆ KSZ9477_SWITCH_OP_DOUBLE_TAG_EN

#define KSZ9477_SWITCH_OP_DOUBLE_TAG_EN   0x80

Definition at line 303 of file ksz9477_driver.h.

◆ KSZ9477_SWITCH_OP_SOFT_HARD_RESET

#define KSZ9477_SWITCH_OP_SOFT_HARD_RESET   0x02

Definition at line 304 of file ksz9477_driver.h.

◆ KSZ9477_SWITCH_OP_START_SWITCH

#define KSZ9477_SWITCH_OP_START_SWITCH   0x01

Definition at line 305 of file ksz9477_driver.h.

◆ KSZ9477_TAIL_TAG_DECODE

#define KSZ9477_TAIL_TAG_DECODE (   tag)    (((tag) & 0x07) + 1)

Definition at line 358 of file ksz9477_driver.h.

◆ KSZ9477_TAIL_TAG_ENCODE

#define KSZ9477_TAIL_TAG_ENCODE (   port)    HTONS(0x0200 | (1 << (((port) - 1) & 0x0007)))

Definition at line 356 of file ksz9477_driver.h.

Function Documentation

◆ ksz9477DisableIrq()

void ksz9477DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 307 of file ksz9477_driver.c.

◆ ksz9477DumpPhyReg()

void ksz9477DumpPhyReg ( NetInterface interface,
uint8_t  port 
)

Dump PHY registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface
[in]portPort number

Definition at line 654 of file ksz9477_driver.c.

◆ ksz9477DumpSwitchReg()

void ksz9477DumpSwitchReg ( NetInterface interface)

Dump switch registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 766 of file ksz9477_driver.c.

◆ ksz9477EnableIrq()

void ksz9477EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 297 of file ksz9477_driver.c.

◆ ksz9477EventHandler()

void ksz9477EventHandler ( NetInterface interface)

KSZ9477 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 317 of file ksz9477_driver.c.

◆ ksz9477GetLinkState()

bool_t ksz9477GetLinkState ( NetInterface interface,
uint8_t  port 
)

Get link state.

Parameters
[in]interfaceUnderlying network interface
[in]portPort number
Returns
Link state

Definition at line 178 of file ksz9477_driver.c.

◆ ksz9477Init()

error_t ksz9477Init ( NetInterface interface)

KSZ9477 Ethernet switch initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 78 of file ksz9477_driver.c.

◆ ksz9477ReadPhyReg()

uint16_t ksz9477ReadPhyReg ( NetInterface interface,
uint8_t  port,
uint8_t  address 
)

Read PHY register.

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

Definition at line 607 of file ksz9477_driver.c.

◆ ksz9477ReadSwitchReg()

uint8_t ksz9477ReadSwitchReg ( NetInterface interface,
uint16_t  address 
)

Read switch register.

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

Definition at line 721 of file ksz9477_driver.c.

◆ ksz9477TagFrame()

error_t ksz9477TagFrame ( NetInterface interface,
NetBuffer buffer,
size_t *  offset,
uint8_t  port,
uint16_t *  type 
)

Add tail tag to Ethernet frame.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the payload
[in,out]offsetOffset to the first payload byte
[in]portSwitch port identifier
[in,out]typeEthernet type
Returns
Error code

Definition at line 465 of file ksz9477_driver.c.

◆ ksz9477Tick()

void ksz9477Tick ( NetInterface interface)

KSZ9477 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 216 of file ksz9477_driver.c.

◆ ksz9477UntagFrame()

error_t ksz9477UntagFrame ( NetInterface interface,
uint8_t **  frame,
size_t *  length,
uint8_t *  port 
)

Decode tail tag from incoming Ethernet frame.

Parameters
[in]interfaceUnderlying network interface
[in,out]framePointer to the received Ethernet frame
[in,out]lengthLength of the frame, in bytes
[out]portSwitch port identifier
Returns
Error code

Definition at line 517 of file ksz9477_driver.c.

◆ ksz9477WritePhyReg()

void ksz9477WritePhyReg ( NetInterface interface,
uint8_t  port,
uint8_t  address,
uint16_t  data 
)

Write PHY register.

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

Definition at line 562 of file ksz9477_driver.c.

◆ ksz9477WriteSwitchReg()

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

Write switch register.

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

Definition at line 678 of file ksz9477_driver.c.

Variable Documentation

◆ ksz9477PhyDriver

const PhyDriver ksz9477PhyDriver

KSZ9477 Ethernet switch driver.

Definition at line 45 of file ksz9477_driver.c.