ksz9563_driver.h File Reference

KSZ9563 Ethernet switch. More...

#include "core/nic.h"

Go to the source code of this file.

Macros

#define KSZ9563_PORT1   1
 
#define KSZ9563_PORT2   2
 
#define KSZ9563_SPI_CMD_WRITE   0x40000000
 
#define KSZ9563_SPI_CMD_READ   0x60000000
 
#define KSZ9563_SPI_CMD_ADDR   0x001FFFE0
 
#define KSZ9563_PHY_REG_BMCR   0x00
 
#define KSZ9563_PHY_REG_BMSR   0x01
 
#define KSZ9563_PHY_REG_PHYIDR1   0x02
 
#define KSZ9563_PHY_REG_PHYIDR2   0x03
 
#define KSZ9563_PHY_REG_ANAR   0x04
 
#define KSZ9563_PHY_REG_ANLPAR   0x05
 
#define KSZ9563_PHY_REG_ANER   0x06
 
#define KSZ9563_PHY_REG_ANNPTR   0x07
 
#define KSZ9563_PHY_REG_LPNPAR   0x08
 
#define KSZ9563_PHY_REG_1000BT_CTRL   0x09
 
#define KSZ9563_PHY_REG_1000BT_STATUS   0x0A
 
#define KSZ9563_PHY_REG_MMD_CTRL   0x0D
 
#define KSZ9563_PHY_REG_MMD_DATA   0x0E
 
#define KSZ9563_PHY_REG_EXT_STATUS   0x0F
 
#define KSZ9563_PHY_REG_RLB   0x11
 
#define KSZ9563_PHY_REG_LINKMDCD   0x12
 
#define KSZ9563_PHY_REG_DPMAPCSS   0x13
 
#define KSZ9563_PHY_REG_RXERCTR   0x15
 
#define KSZ9563_PHY_REG_ICSR   0x1B
 
#define KSZ9563_PHY_REG_AUTOMDI   0x1C
 
#define KSZ9563_PHY_REG_PHYCON   0x1F
 
#define BMCR_SOFT_RESET   (1 << 15)
 
#define BMCR_LOOPBACK   (1 << 14)
 
#define BMCR_SPEED_SEL_LSB   (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 BMCR_SPEED_SEL_MSB   (1 << 6)
 
#define BMSR_100BT4   (1 << 15)
 
#define BMSR_100BTX_FD   (1 << 14)
 
#define BMSR_100BTX_HD   (1 << 13)
 
#define BMSR_10BT_FD   (1 << 12)
 
#define BMSR_10BT_HD   (1 << 11)
 
#define BMSR_EXTENDED_STATUS   (1 << 8)
 
#define BMSR_MF_PREAMBLE_SUPPR   (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_HD   (1 << 7)
 
#define ANAR_10BT_FD   (1 << 6)
 
#define ANAR_10BT_HD   (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_HD   (1 << 7)
 
#define ANLPAR_10BT_FD   (1 << 6)
 
#define ANLPAR_10BT_HD   (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 _1000BT_CTRL_TEST_MODE2   (1 << 15)
 
#define _1000BT_CTRL_TEST_MODE1   (1 << 14)
 
#define _1000BT_CTRL_TEST_MODE0   (1 << 13)
 
#define _1000BT_CTRL_MS_MAN_CONF_EN   (1 << 12)
 
#define _1000BT_CTRL_MS_MAN_CONF_VAL   (1 << 11)
 
#define _1000BT_CTRL_PORT_TYPE   (1 << 10)
 
#define _1000BT_CTRL_1000BT_FD   (1 << 9)
 
#define _1000BT_CTRL_1000BT_HD   (1 << 8)
 
#define _1000BT_STATUS_MS_CONF_FAULT   (1 << 15)
 
#define _1000BT_STATUS_MS_CONF_RES   (1 << 14)
 
#define _1000BT_STATUS_LOC_REC_STATUS   (1 << 13)
 
#define _1000BT_STATUS_REM_REC_STATUS   (1 << 12)
 
#define _1000BT_STATUS_LP_1000BT_FD   (1 << 11)
 
#define _1000BT_STATUS_LP_1000BT_HD   (1 << 10)
 
#define _1000BT_STATUS_IDLE_ERR_CTR7   (1 << 7)
 
#define _1000BT_STATUS_IDLE_ERR_CTR6   (1 << 6)
 
#define _1000BT_STATUS_IDLE_ERR_CTR5   (1 << 5)
 
#define _1000BT_STATUS_IDLE_ERR_CTR4   (1 << 4)
 
#define _1000BT_STATUS_IDLE_ERR_CTR3   (1 << 3)
 
#define _1000BT_STATUS_IDLE_ERR_CTR2   (1 << 2)
 
#define _1000BT_STATUS_IDLE_ERR_CTR1   (1 << 1)
 
#define _1000BT_STATUS_IDLE_ERR_CTR0   (1 << 0)
 
#define MMD_CTRL_DEVICE_OP_MODE1   (1 << 15)
 
#define MMD_CTRL_DEVICE_OP_MODE0   (1 << 14)
 
#define MMD_CTRL_DEVICE_ADDR4   (1 << 4)
 
#define MMD_CTRL_DEVICE_ADDR3   (1 << 3)
 
#define MMD_CTRL_DEVICE_ADDR2   (1 << 2)
 
#define MMD_CTRL_DEVICE_ADDR1   (1 << 1)
 
#define MMD_CTRL_DEVICE_ADDR0   (1 << 0)
 
#define EXT_STATUS_1000BX_FD   (1 << 15)
 
#define EXT_STATUS_1000BX_HD   (1 << 14)
 
#define EXT_STATUS_1000BT_FD   (1 << 13)
 
#define EXT_STATUS_1000BT_HD   (1 << 12)
 
#define RLB_REMOTE_LOOPBACK   (1 << 8)
 
#define LINKMDCD_CDT_EN   (1 << 15)
 
#define LINKMDCD_CDT_PAIR1   (1 << 13)
 
#define LINKMDCD_CDT_PAIR0   (1 << 12)
 
#define LINKMDCD_CDT_STATUS1   (1 << 9)
 
#define LINKMDCD_CDT_STATUS0   (1 << 8)
 
#define DPMAPCSS_1000BT_LINK_STATUS   (1 << 2)
 
#define DPMAPCSS_100BTX_LINK_STATUS   (1 << 1)
 
#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 AUTOMDI_MDI_SEL   (1 << 7)
 
#define AUTOMDI_SWAP_OFF   (1 << 6)
 
#define PHYCON_JABBER_EN   (1 << 9)
 
#define PHYCON_SPEED_1000BT   (1 << 6)
 
#define PHYCON_SPEED_100BTX   (1 << 5)
 
#define PHYCON_SPEED_10BT   (1 << 4)
 
#define PHYCON_DUPLEX_STATUS   (1 << 3)
 
#define PHYCON_1000BT_MS_STATUS   (1 << 2)
 
#define KSZ9563_SW_REG_CHIP_ID0   0x0000
 
#define KSZ9563_SW_REG_CHIP_ID1   0x0001
 
#define KSZ9563_SW_REG_CHIP_ID2   0x0002
 
#define KSZ9563_SW_REG_CHIP_ID3   0x0003
 
#define KSZ9563_SW_REG_SWITCH_OP   0x0300
 
#define KSZ9563_SW_REG_PORT_OP_CTRL0(n)   (0x0020 + ((n) * 0x1000))
 
#define KSZ9563_SW_REG_XMII_PORT_CTRL0(n)   (0x0300 + ((n) * 0x1000))
 
#define KSZ9563_SW_REG_XMII_PORT_CTRL1(n)   (0x0301 + ((n) * 0x1000))
 
#define KSZ9563_SW_REG_PORT_MSTP_STATE(n)   (0x0B04 + ((n) * 0x1000))
 
#define CHIP_ID1_CHIP_ID_MSB   0xFF
 
#define CHIP_ID1_CHIP_ID_MSB_DEFAULT   0x98
 
#define CHIP_ID2_CHIP_ID_LSB   0xFF
 
#define CHIP_ID2_CHIP_ID_LSB_DEFAULT   0x93
 
#define SWITCH_OP_DOUBLE_TAG_EN   (1 << 7)
 
#define SWITCH_OP_SOFT_RESET   (1 << 1)
 
#define SWITCH_OP_START_SWITCH   (1 << 0)
 
#define PORT_OP_CTRL0_LOCAL_LOOPBACK   (1 << 7)
 
#define PORT_OP_CTRL0_REMOTE_LOOPBACK   (1 << 6)
 
#define PORT_OP_CTRL0_TAIL_TAG_EN   (1 << 2)
 
#define PORT_OP_CTRL0_TX_QUEUE_SPLIT_EN1   (1 << 1)
 
#define PORT_OP_CTRL0_TX_QUEUE_SPLIT_EN0   (1 << 0)
 
#define XMII_PORT_CTRL0_PORT_DUPLEX   (1 << 6)
 
#define XMII_PORT_CTRL0_PORT_TX_FLOW_CTRL_EN   (1 << 5)
 
#define XMII_PORT_CTRL0_PORT_SPEED_10_100   (1 << 4)
 
#define XMII_PORT_CTRL0_PORT_RX_FLOW_CTRL_EN   (1 << 3)
 
#define XMII_PORT_CTRL1_PORT_SPEED_1000   (1 << 6)
 
#define XMII_PORT_CTRL1_RGMII_ID_IG   (1 << 4)
 
#define XMII_PORT_CTRL1_RGMII_ID_EG   (1 << 3)
 
#define XMII_PORT_CTRL1_MII_RMII_MODE   (1 << 2)
 
#define XMII_PORT_CTRL1_PORT_IF_TYPE1   (1 << 1)
 
#define XMII_PORT_CTRL1_PORT_IF_TYPE0   (1 << 0)
 
#define PORT_MSTP_STATE_TRANSMIT_EN   (1 << 2)
 
#define PORT_MSTP_STATE_RECEIVE_EN   (1 << 1)
 
#define PORT_MSTP_STATE_LEARNING_DIS   (1 << 0)
 
#define KSZ9563_SW_REG_PORT_ETH_PHY(n, a)   (0x0100 + ((n) * 0x1000) + ((a) * 2))
 
#define KSZ9563_TAIL_TAG_ENCODE(port)   (0x20 | ((port) & 0x03))
 
#define KSZ9563_TAIL_TAG_DECODE(tag)   (((tag) & 0x01) + 1)
 

Functions

error_t ksz9563Init (NetInterface *interface)
 KSZ9563 Ethernet switch initialization. More...
 
bool_t ksz9563GetLinkState (NetInterface *interface, uint8_t port)
 Get link state. More...
 
void ksz9563Tick (NetInterface *interface)
 KSZ9563 timer handler. More...
 
void ksz9563EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void ksz9563DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void ksz9563EventHandler (NetInterface *interface)
 KSZ9563 event handler. More...
 
error_t ksz9563TagFrame (NetInterface *interface, NetBuffer *buffer, size_t *offset, uint8_t port, uint16_t *type)
 Add tail tag to Ethernet frame. More...
 
error_t ksz9563UntagFrame (NetInterface *interface, uint8_t **frame, size_t *length, uint8_t *port)
 Decode tail tag from incoming Ethernet frame. More...
 
void ksz9563WritePhyReg (NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t ksz9563ReadPhyReg (NetInterface *interface, uint8_t port, uint8_t address)
 Read PHY register. More...
 
void ksz9563DumpPhyReg (NetInterface *interface, uint8_t port)
 Dump PHY registers for debugging purpose. More...
 
void ksz9563WriteSwitchReg (NetInterface *interface, uint16_t address, uint8_t data)
 Write switch register. More...
 
uint8_t ksz9563ReadSwitchReg (NetInterface *interface, uint16_t address)
 Read switch register. More...
 
void ksz9563DumpSwitchReg (NetInterface *interface)
 Dump switch registers for debugging purpose. More...
 

Variables

const PhyDriver ksz9563PhyDriver
 KSZ9563 Ethernet switch driver. More...
 

Detailed Description

KSZ9563 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.2

Definition in file ksz9563_driver.h.

Macro Definition Documentation

◆ _1000BT_CTRL_1000BT_FD

#define _1000BT_CTRL_1000BT_FD   (1 << 9)

Definition at line 178 of file ksz9563_driver.h.

◆ _1000BT_CTRL_1000BT_HD

#define _1000BT_CTRL_1000BT_HD   (1 << 8)

Definition at line 179 of file ksz9563_driver.h.

◆ _1000BT_CTRL_MS_MAN_CONF_EN

#define _1000BT_CTRL_MS_MAN_CONF_EN   (1 << 12)

Definition at line 175 of file ksz9563_driver.h.

◆ _1000BT_CTRL_MS_MAN_CONF_VAL

#define _1000BT_CTRL_MS_MAN_CONF_VAL   (1 << 11)

Definition at line 176 of file ksz9563_driver.h.

◆ _1000BT_CTRL_PORT_TYPE

#define _1000BT_CTRL_PORT_TYPE   (1 << 10)

Definition at line 177 of file ksz9563_driver.h.

◆ _1000BT_CTRL_TEST_MODE0

#define _1000BT_CTRL_TEST_MODE0   (1 << 13)

Definition at line 174 of file ksz9563_driver.h.

◆ _1000BT_CTRL_TEST_MODE1

#define _1000BT_CTRL_TEST_MODE1   (1 << 14)

Definition at line 173 of file ksz9563_driver.h.

◆ _1000BT_CTRL_TEST_MODE2

#define _1000BT_CTRL_TEST_MODE2   (1 << 15)

Definition at line 172 of file ksz9563_driver.h.

◆ _1000BT_STATUS_IDLE_ERR_CTR0

#define _1000BT_STATUS_IDLE_ERR_CTR0   (1 << 0)

Definition at line 195 of file ksz9563_driver.h.

◆ _1000BT_STATUS_IDLE_ERR_CTR1

#define _1000BT_STATUS_IDLE_ERR_CTR1   (1 << 1)

Definition at line 194 of file ksz9563_driver.h.

◆ _1000BT_STATUS_IDLE_ERR_CTR2

#define _1000BT_STATUS_IDLE_ERR_CTR2   (1 << 2)

Definition at line 193 of file ksz9563_driver.h.

◆ _1000BT_STATUS_IDLE_ERR_CTR3

#define _1000BT_STATUS_IDLE_ERR_CTR3   (1 << 3)

Definition at line 192 of file ksz9563_driver.h.

◆ _1000BT_STATUS_IDLE_ERR_CTR4

#define _1000BT_STATUS_IDLE_ERR_CTR4   (1 << 4)

Definition at line 191 of file ksz9563_driver.h.

◆ _1000BT_STATUS_IDLE_ERR_CTR5

#define _1000BT_STATUS_IDLE_ERR_CTR5   (1 << 5)

Definition at line 190 of file ksz9563_driver.h.

◆ _1000BT_STATUS_IDLE_ERR_CTR6

#define _1000BT_STATUS_IDLE_ERR_CTR6   (1 << 6)

Definition at line 189 of file ksz9563_driver.h.

◆ _1000BT_STATUS_IDLE_ERR_CTR7

#define _1000BT_STATUS_IDLE_ERR_CTR7   (1 << 7)

Definition at line 188 of file ksz9563_driver.h.

◆ _1000BT_STATUS_LOC_REC_STATUS

#define _1000BT_STATUS_LOC_REC_STATUS   (1 << 13)

Definition at line 184 of file ksz9563_driver.h.

◆ _1000BT_STATUS_LP_1000BT_FD

#define _1000BT_STATUS_LP_1000BT_FD   (1 << 11)

Definition at line 186 of file ksz9563_driver.h.

◆ _1000BT_STATUS_LP_1000BT_HD

#define _1000BT_STATUS_LP_1000BT_HD   (1 << 10)

Definition at line 187 of file ksz9563_driver.h.

◆ _1000BT_STATUS_MS_CONF_FAULT

#define _1000BT_STATUS_MS_CONF_FAULT   (1 << 15)

Definition at line 182 of file ksz9563_driver.h.

◆ _1000BT_STATUS_MS_CONF_RES

#define _1000BT_STATUS_MS_CONF_RES   (1 << 14)

Definition at line 183 of file ksz9563_driver.h.

◆ _1000BT_STATUS_REM_REC_STATUS

#define _1000BT_STATUS_REM_REC_STATUS   (1 << 12)

Definition at line 185 of file ksz9563_driver.h.

◆ ANAR_100BT4

#define ANAR_100BT4   (1 << 9)

Definition at line 101 of file ksz9563_driver.h.

◆ ANAR_100BTX_FD

#define ANAR_100BTX_FD   (1 << 8)

Definition at line 102 of file ksz9563_driver.h.

◆ ANAR_100BTX_HD

#define ANAR_100BTX_HD   (1 << 7)

Definition at line 103 of file ksz9563_driver.h.

◆ ANAR_10BT_FD

#define ANAR_10BT_FD   (1 << 6)

Definition at line 104 of file ksz9563_driver.h.

◆ ANAR_10BT_HD

#define ANAR_10BT_HD   (1 << 5)

Definition at line 105 of file ksz9563_driver.h.

◆ ANAR_NEXT_PAGE

#define ANAR_NEXT_PAGE   (1 << 15)

Definition at line 97 of file ksz9563_driver.h.

◆ ANAR_PAUSE0

#define ANAR_PAUSE0   (1 << 10)

Definition at line 100 of file ksz9563_driver.h.

◆ ANAR_PAUSE1

#define ANAR_PAUSE1   (1 << 11)

Definition at line 99 of file ksz9563_driver.h.

◆ ANAR_REMOTE_FAULT

#define ANAR_REMOTE_FAULT   (1 << 13)

Definition at line 98 of file ksz9563_driver.h.

◆ ANAR_SELECTOR0

#define ANAR_SELECTOR0   (1 << 0)

Definition at line 110 of file ksz9563_driver.h.

◆ ANAR_SELECTOR1

#define ANAR_SELECTOR1   (1 << 1)

Definition at line 109 of file ksz9563_driver.h.

◆ ANAR_SELECTOR2

#define ANAR_SELECTOR2   (1 << 2)

Definition at line 108 of file ksz9563_driver.h.

◆ ANAR_SELECTOR3

#define ANAR_SELECTOR3   (1 << 3)

Definition at line 107 of file ksz9563_driver.h.

◆ ANAR_SELECTOR4

#define ANAR_SELECTOR4   (1 << 4)

Definition at line 106 of file ksz9563_driver.h.

◆ ANER_LP_AN_ABLE

#define ANER_LP_AN_ABLE   (1 << 0)

Definition at line 134 of file ksz9563_driver.h.

◆ ANER_LP_NEXT_PAGE_ABLE

#define ANER_LP_NEXT_PAGE_ABLE   (1 << 3)

Definition at line 131 of file ksz9563_driver.h.

◆ ANER_NEXT_PAGE_ABLE

#define ANER_NEXT_PAGE_ABLE   (1 << 2)

Definition at line 132 of file ksz9563_driver.h.

◆ ANER_PAGE_RECEIVED

#define ANER_PAGE_RECEIVED   (1 << 1)

Definition at line 133 of file ksz9563_driver.h.

◆ ANER_PAR_DET_FAULT

#define ANER_PAR_DET_FAULT   (1 << 4)

Definition at line 130 of file ksz9563_driver.h.

◆ ANLPAR_100BT4

#define ANLPAR_100BT4   (1 << 9)

Definition at line 118 of file ksz9563_driver.h.

◆ ANLPAR_100BTX_FD

#define ANLPAR_100BTX_FD   (1 << 8)

Definition at line 119 of file ksz9563_driver.h.

◆ ANLPAR_100BTX_HD

#define ANLPAR_100BTX_HD   (1 << 7)

Definition at line 120 of file ksz9563_driver.h.

◆ ANLPAR_10BT_FD

#define ANLPAR_10BT_FD   (1 << 6)

Definition at line 121 of file ksz9563_driver.h.

◆ ANLPAR_10BT_HD

#define ANLPAR_10BT_HD   (1 << 5)

Definition at line 122 of file ksz9563_driver.h.

◆ ANLPAR_LP_ACK

#define ANLPAR_LP_ACK   (1 << 14)

Definition at line 114 of file ksz9563_driver.h.

◆ ANLPAR_NEXT_PAGE

#define ANLPAR_NEXT_PAGE   (1 << 15)

Definition at line 113 of file ksz9563_driver.h.

◆ ANLPAR_PAUSE0

#define ANLPAR_PAUSE0   (1 << 10)

Definition at line 117 of file ksz9563_driver.h.

◆ ANLPAR_PAUSE1

#define ANLPAR_PAUSE1   (1 << 11)

Definition at line 116 of file ksz9563_driver.h.

◆ ANLPAR_REMOTE_FAULT

#define ANLPAR_REMOTE_FAULT   (1 << 13)

Definition at line 115 of file ksz9563_driver.h.

◆ ANLPAR_SELECTOR0

#define ANLPAR_SELECTOR0   (1 << 0)

Definition at line 127 of file ksz9563_driver.h.

◆ ANLPAR_SELECTOR1

#define ANLPAR_SELECTOR1   (1 << 1)

Definition at line 126 of file ksz9563_driver.h.

◆ ANLPAR_SELECTOR2

#define ANLPAR_SELECTOR2   (1 << 2)

Definition at line 125 of file ksz9563_driver.h.

◆ ANLPAR_SELECTOR3

#define ANLPAR_SELECTOR3   (1 << 3)

Definition at line 124 of file ksz9563_driver.h.

◆ ANLPAR_SELECTOR4

#define ANLPAR_SELECTOR4   (1 << 4)

Definition at line 123 of file ksz9563_driver.h.

◆ ANNPTR_ACK2

#define ANNPTR_ACK2   (1 << 12)

Definition at line 139 of file ksz9563_driver.h.

◆ ANNPTR_MESSAGE0

#define ANNPTR_MESSAGE0   (1 << 0)

Definition at line 151 of file ksz9563_driver.h.

◆ ANNPTR_MESSAGE1

#define ANNPTR_MESSAGE1   (1 << 1)

Definition at line 150 of file ksz9563_driver.h.

◆ ANNPTR_MESSAGE10

#define ANNPTR_MESSAGE10   (1 << 10)

Definition at line 141 of file ksz9563_driver.h.

◆ ANNPTR_MESSAGE2

#define ANNPTR_MESSAGE2   (1 << 2)

Definition at line 149 of file ksz9563_driver.h.

◆ ANNPTR_MESSAGE3

#define ANNPTR_MESSAGE3   (1 << 3)

Definition at line 148 of file ksz9563_driver.h.

◆ ANNPTR_MESSAGE4

#define ANNPTR_MESSAGE4   (1 << 4)

Definition at line 147 of file ksz9563_driver.h.

◆ ANNPTR_MESSAGE5

#define ANNPTR_MESSAGE5   (1 << 5)

Definition at line 146 of file ksz9563_driver.h.

◆ ANNPTR_MESSAGE6

#define ANNPTR_MESSAGE6   (1 << 6)

Definition at line 145 of file ksz9563_driver.h.

◆ ANNPTR_MESSAGE7

#define ANNPTR_MESSAGE7   (1 << 7)

Definition at line 144 of file ksz9563_driver.h.

◆ ANNPTR_MESSAGE8

#define ANNPTR_MESSAGE8   (1 << 8)

Definition at line 143 of file ksz9563_driver.h.

◆ ANNPTR_MESSAGE9

#define ANNPTR_MESSAGE9   (1 << 9)

Definition at line 142 of file ksz9563_driver.h.

◆ ANNPTR_MSG_PAGE

#define ANNPTR_MSG_PAGE   (1 << 13)

Definition at line 138 of file ksz9563_driver.h.

◆ ANNPTR_NEXT_PAGE

#define ANNPTR_NEXT_PAGE   (1 << 15)

Definition at line 137 of file ksz9563_driver.h.

◆ ANNPTR_TOGGLE

#define ANNPTR_TOGGLE   (1 << 11)

Definition at line 140 of file ksz9563_driver.h.

◆ AUTOMDI_MDI_SEL

#define AUTOMDI_MDI_SEL   (1 << 7)

Definition at line 245 of file ksz9563_driver.h.

◆ AUTOMDI_SWAP_OFF

#define AUTOMDI_SWAP_OFF   (1 << 6)

Definition at line 246 of file ksz9563_driver.h.

◆ BMCR_AN_EN

#define BMCR_AN_EN   (1 << 12)

Definition at line 73 of file ksz9563_driver.h.

◆ BMCR_COL_TEST

#define BMCR_COL_TEST   (1 << 7)

Definition at line 78 of file ksz9563_driver.h.

◆ BMCR_DUPLEX_MODE

#define BMCR_DUPLEX_MODE   (1 << 8)

Definition at line 77 of file ksz9563_driver.h.

◆ BMCR_ISOLATE

#define BMCR_ISOLATE   (1 << 10)

Definition at line 75 of file ksz9563_driver.h.

◆ BMCR_LOOPBACK

#define BMCR_LOOPBACK   (1 << 14)

Definition at line 71 of file ksz9563_driver.h.

◆ BMCR_POWER_DOWN

#define BMCR_POWER_DOWN   (1 << 11)

Definition at line 74 of file ksz9563_driver.h.

◆ BMCR_RESTART_AN

#define BMCR_RESTART_AN   (1 << 9)

Definition at line 76 of file ksz9563_driver.h.

◆ BMCR_SOFT_RESET

#define BMCR_SOFT_RESET   (1 << 15)

Definition at line 70 of file ksz9563_driver.h.

◆ BMCR_SPEED_SEL_LSB

#define BMCR_SPEED_SEL_LSB   (1 << 13)

Definition at line 72 of file ksz9563_driver.h.

◆ BMCR_SPEED_SEL_MSB

#define BMCR_SPEED_SEL_MSB   (1 << 6)

Definition at line 79 of file ksz9563_driver.h.

◆ BMSR_100BT4

#define BMSR_100BT4   (1 << 15)

Definition at line 82 of file ksz9563_driver.h.

◆ BMSR_100BTX_FD

#define BMSR_100BTX_FD   (1 << 14)

Definition at line 83 of file ksz9563_driver.h.

◆ BMSR_100BTX_HD

#define BMSR_100BTX_HD   (1 << 13)

Definition at line 84 of file ksz9563_driver.h.

◆ BMSR_10BT_FD

#define BMSR_10BT_FD   (1 << 12)

Definition at line 85 of file ksz9563_driver.h.

◆ BMSR_10BT_HD

#define BMSR_10BT_HD   (1 << 11)

Definition at line 86 of file ksz9563_driver.h.

◆ BMSR_AN_ABLE

#define BMSR_AN_ABLE   (1 << 3)

Definition at line 91 of file ksz9563_driver.h.

◆ BMSR_AN_COMPLETE

#define BMSR_AN_COMPLETE   (1 << 5)

Definition at line 89 of file ksz9563_driver.h.

◆ BMSR_EXTENDED_CAP

#define BMSR_EXTENDED_CAP   (1 << 0)

Definition at line 94 of file ksz9563_driver.h.

◆ BMSR_EXTENDED_STATUS

#define BMSR_EXTENDED_STATUS   (1 << 8)

Definition at line 87 of file ksz9563_driver.h.

◆ BMSR_JABBER_DETECT

#define BMSR_JABBER_DETECT   (1 << 1)

Definition at line 93 of file ksz9563_driver.h.

◆ BMSR_LINK_STATUS

#define BMSR_LINK_STATUS   (1 << 2)

Definition at line 92 of file ksz9563_driver.h.

◆ BMSR_MF_PREAMBLE_SUPPR

#define BMSR_MF_PREAMBLE_SUPPR   (1 << 6)

Definition at line 88 of file ksz9563_driver.h.

◆ BMSR_REMOTE_FAULT

#define BMSR_REMOTE_FAULT   (1 << 4)

Definition at line 90 of file ksz9563_driver.h.

◆ CHIP_ID1_CHIP_ID_MSB

#define CHIP_ID1_CHIP_ID_MSB   0xFF

Definition at line 268 of file ksz9563_driver.h.

◆ CHIP_ID1_CHIP_ID_MSB_DEFAULT

#define CHIP_ID1_CHIP_ID_MSB_DEFAULT   0x98

Definition at line 269 of file ksz9563_driver.h.

◆ CHIP_ID2_CHIP_ID_LSB

#define CHIP_ID2_CHIP_ID_LSB   0xFF

Definition at line 272 of file ksz9563_driver.h.

◆ CHIP_ID2_CHIP_ID_LSB_DEFAULT

#define CHIP_ID2_CHIP_ID_LSB_DEFAULT   0x93

Definition at line 273 of file ksz9563_driver.h.

◆ DPMAPCSS_1000BT_LINK_STATUS

#define DPMAPCSS_1000BT_LINK_STATUS   (1 << 2)

Definition at line 223 of file ksz9563_driver.h.

◆ DPMAPCSS_100BTX_LINK_STATUS

#define DPMAPCSS_100BTX_LINK_STATUS   (1 << 1)

Definition at line 224 of file ksz9563_driver.h.

◆ EXT_STATUS_1000BT_FD

#define EXT_STATUS_1000BT_FD   (1 << 13)

Definition at line 209 of file ksz9563_driver.h.

◆ EXT_STATUS_1000BT_HD

#define EXT_STATUS_1000BT_HD   (1 << 12)

Definition at line 210 of file ksz9563_driver.h.

◆ EXT_STATUS_1000BX_FD

#define EXT_STATUS_1000BX_FD   (1 << 15)

Definition at line 207 of file ksz9563_driver.h.

◆ EXT_STATUS_1000BX_HD

#define EXT_STATUS_1000BX_HD   (1 << 14)

Definition at line 208 of file ksz9563_driver.h.

◆ ICSR_JABBER_IE

#define ICSR_JABBER_IE   (1 << 15)

Definition at line 227 of file ksz9563_driver.h.

◆ ICSR_JABBER_IF

#define ICSR_JABBER_IF   (1 << 7)

Definition at line 235 of file ksz9563_driver.h.

◆ ICSR_LINK_DOWN_IE

#define ICSR_LINK_DOWN_IE   (1 << 10)

Definition at line 232 of file ksz9563_driver.h.

◆ ICSR_LINK_DOWN_IF

#define ICSR_LINK_DOWN_IF   (1 << 2)

Definition at line 240 of file ksz9563_driver.h.

◆ ICSR_LINK_UP_IE

#define ICSR_LINK_UP_IE   (1 << 8)

Definition at line 234 of file ksz9563_driver.h.

◆ ICSR_LINK_UP_IF

#define ICSR_LINK_UP_IF   (1 << 0)

Definition at line 242 of file ksz9563_driver.h.

◆ ICSR_LP_ACK_IE

#define ICSR_LP_ACK_IE   (1 << 11)

Definition at line 231 of file ksz9563_driver.h.

◆ ICSR_LP_ACK_IF

#define ICSR_LP_ACK_IF   (1 << 3)

Definition at line 239 of file ksz9563_driver.h.

◆ ICSR_PAGE_RECEIVED_IE

#define ICSR_PAGE_RECEIVED_IE   (1 << 13)

Definition at line 229 of file ksz9563_driver.h.

◆ ICSR_PAGE_RECEIVED_IF

#define ICSR_PAGE_RECEIVED_IF   (1 << 5)

Definition at line 237 of file ksz9563_driver.h.

◆ ICSR_PAR_DET_FAULT_IE

#define ICSR_PAR_DET_FAULT_IE   (1 << 12)

Definition at line 230 of file ksz9563_driver.h.

◆ ICSR_PAR_DET_FAULT_IF

#define ICSR_PAR_DET_FAULT_IF   (1 << 4)

Definition at line 238 of file ksz9563_driver.h.

◆ ICSR_RECEIVE_ERROR_IE

#define ICSR_RECEIVE_ERROR_IE   (1 << 14)

Definition at line 228 of file ksz9563_driver.h.

◆ ICSR_RECEIVE_ERROR_IF

#define ICSR_RECEIVE_ERROR_IF   (1 << 6)

Definition at line 236 of file ksz9563_driver.h.

◆ ICSR_REMOTE_FAULT_IE

#define ICSR_REMOTE_FAULT_IE   (1 << 9)

Definition at line 233 of file ksz9563_driver.h.

◆ ICSR_REMOTE_FAULT_IF

#define ICSR_REMOTE_FAULT_IF   (1 << 1)

Definition at line 241 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_1000BT_CTRL

#define KSZ9563_PHY_REG_1000BT_CTRL   0x09

Definition at line 56 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_1000BT_STATUS

#define KSZ9563_PHY_REG_1000BT_STATUS   0x0A

Definition at line 57 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_ANAR

#define KSZ9563_PHY_REG_ANAR   0x04

Definition at line 51 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_ANER

#define KSZ9563_PHY_REG_ANER   0x06

Definition at line 53 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_ANLPAR

#define KSZ9563_PHY_REG_ANLPAR   0x05

Definition at line 52 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_ANNPTR

#define KSZ9563_PHY_REG_ANNPTR   0x07

Definition at line 54 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_AUTOMDI

#define KSZ9563_PHY_REG_AUTOMDI   0x1C

Definition at line 66 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_BMCR

#define KSZ9563_PHY_REG_BMCR   0x00

Definition at line 47 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_BMSR

#define KSZ9563_PHY_REG_BMSR   0x01

Definition at line 48 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_DPMAPCSS

#define KSZ9563_PHY_REG_DPMAPCSS   0x13

Definition at line 63 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_EXT_STATUS

#define KSZ9563_PHY_REG_EXT_STATUS   0x0F

Definition at line 60 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_ICSR

#define KSZ9563_PHY_REG_ICSR   0x1B

Definition at line 65 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_LINKMDCD

#define KSZ9563_PHY_REG_LINKMDCD   0x12

Definition at line 62 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_LPNPAR

#define KSZ9563_PHY_REG_LPNPAR   0x08

Definition at line 55 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_MMD_CTRL

#define KSZ9563_PHY_REG_MMD_CTRL   0x0D

Definition at line 58 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_MMD_DATA

#define KSZ9563_PHY_REG_MMD_DATA   0x0E

Definition at line 59 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_PHYCON

#define KSZ9563_PHY_REG_PHYCON   0x1F

Definition at line 67 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_PHYIDR1

#define KSZ9563_PHY_REG_PHYIDR1   0x02

Definition at line 49 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_PHYIDR2

#define KSZ9563_PHY_REG_PHYIDR2   0x03

Definition at line 50 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_RLB

#define KSZ9563_PHY_REG_RLB   0x11

Definition at line 61 of file ksz9563_driver.h.

◆ KSZ9563_PHY_REG_RXERCTR

#define KSZ9563_PHY_REG_RXERCTR   0x15

Definition at line 64 of file ksz9563_driver.h.

◆ KSZ9563_PORT1

#define KSZ9563_PORT1   1

Definition at line 38 of file ksz9563_driver.h.

◆ KSZ9563_PORT2

#define KSZ9563_PORT2   2

Definition at line 39 of file ksz9563_driver.h.

◆ KSZ9563_SPI_CMD_ADDR

#define KSZ9563_SPI_CMD_ADDR   0x001FFFE0

Definition at line 44 of file ksz9563_driver.h.

◆ KSZ9563_SPI_CMD_READ

#define KSZ9563_SPI_CMD_READ   0x60000000

Definition at line 43 of file ksz9563_driver.h.

◆ KSZ9563_SPI_CMD_WRITE

#define KSZ9563_SPI_CMD_WRITE   0x40000000

Definition at line 42 of file ksz9563_driver.h.

◆ KSZ9563_SW_REG_CHIP_ID0

#define KSZ9563_SW_REG_CHIP_ID0   0x0000

Definition at line 257 of file ksz9563_driver.h.

◆ KSZ9563_SW_REG_CHIP_ID1

#define KSZ9563_SW_REG_CHIP_ID1   0x0001

Definition at line 258 of file ksz9563_driver.h.

◆ KSZ9563_SW_REG_CHIP_ID2

#define KSZ9563_SW_REG_CHIP_ID2   0x0002

Definition at line 259 of file ksz9563_driver.h.

◆ KSZ9563_SW_REG_CHIP_ID3

#define KSZ9563_SW_REG_CHIP_ID3   0x0003

Definition at line 260 of file ksz9563_driver.h.

◆ KSZ9563_SW_REG_PORT_ETH_PHY

#define KSZ9563_SW_REG_PORT_ETH_PHY (   n,
  a 
)    (0x0100 + ((n) * 0x1000) + ((a) * 2))

Definition at line 307 of file ksz9563_driver.h.

◆ KSZ9563_SW_REG_PORT_MSTP_STATE

#define KSZ9563_SW_REG_PORT_MSTP_STATE (   n)    (0x0B04 + ((n) * 0x1000))

Definition at line 265 of file ksz9563_driver.h.

◆ KSZ9563_SW_REG_PORT_OP_CTRL0

#define KSZ9563_SW_REG_PORT_OP_CTRL0 (   n)    (0x0020 + ((n) * 0x1000))

Definition at line 262 of file ksz9563_driver.h.

◆ KSZ9563_SW_REG_SWITCH_OP

#define KSZ9563_SW_REG_SWITCH_OP   0x0300

Definition at line 261 of file ksz9563_driver.h.

◆ KSZ9563_SW_REG_XMII_PORT_CTRL0

#define KSZ9563_SW_REG_XMII_PORT_CTRL0 (   n)    (0x0300 + ((n) * 0x1000))

Definition at line 263 of file ksz9563_driver.h.

◆ KSZ9563_SW_REG_XMII_PORT_CTRL1

#define KSZ9563_SW_REG_XMII_PORT_CTRL1 (   n)    (0x0301 + ((n) * 0x1000))

Definition at line 264 of file ksz9563_driver.h.

◆ KSZ9563_TAIL_TAG_DECODE

#define KSZ9563_TAIL_TAG_DECODE (   tag)    (((tag) & 0x01) + 1)

Definition at line 312 of file ksz9563_driver.h.

◆ KSZ9563_TAIL_TAG_ENCODE

#define KSZ9563_TAIL_TAG_ENCODE (   port)    (0x20 | ((port) & 0x03))

Definition at line 310 of file ksz9563_driver.h.

◆ LINKMDCD_CDT_EN

#define LINKMDCD_CDT_EN   (1 << 15)

Definition at line 216 of file ksz9563_driver.h.

◆ LINKMDCD_CDT_PAIR0

#define LINKMDCD_CDT_PAIR0   (1 << 12)

Definition at line 218 of file ksz9563_driver.h.

◆ LINKMDCD_CDT_PAIR1

#define LINKMDCD_CDT_PAIR1   (1 << 13)

Definition at line 217 of file ksz9563_driver.h.

◆ LINKMDCD_CDT_STATUS0

#define LINKMDCD_CDT_STATUS0   (1 << 8)

Definition at line 220 of file ksz9563_driver.h.

◆ LINKMDCD_CDT_STATUS1

#define LINKMDCD_CDT_STATUS1   (1 << 9)

Definition at line 219 of file ksz9563_driver.h.

◆ LPNPAR_ACK

#define LPNPAR_ACK   (1 << 14)

Definition at line 155 of file ksz9563_driver.h.

◆ LPNPAR_ACK2

#define LPNPAR_ACK2   (1 << 12)

Definition at line 157 of file ksz9563_driver.h.

◆ LPNPAR_MESSAGE0

#define LPNPAR_MESSAGE0   (1 << 0)

Definition at line 169 of file ksz9563_driver.h.

◆ LPNPAR_MESSAGE1

#define LPNPAR_MESSAGE1   (1 << 1)

Definition at line 168 of file ksz9563_driver.h.

◆ LPNPAR_MESSAGE10

#define LPNPAR_MESSAGE10   (1 << 10)

Definition at line 159 of file ksz9563_driver.h.

◆ LPNPAR_MESSAGE2

#define LPNPAR_MESSAGE2   (1 << 2)

Definition at line 167 of file ksz9563_driver.h.

◆ LPNPAR_MESSAGE3

#define LPNPAR_MESSAGE3   (1 << 3)

Definition at line 166 of file ksz9563_driver.h.

◆ LPNPAR_MESSAGE4

#define LPNPAR_MESSAGE4   (1 << 4)

Definition at line 165 of file ksz9563_driver.h.

◆ LPNPAR_MESSAGE5

#define LPNPAR_MESSAGE5   (1 << 5)

Definition at line 164 of file ksz9563_driver.h.

◆ LPNPAR_MESSAGE6

#define LPNPAR_MESSAGE6   (1 << 6)

Definition at line 163 of file ksz9563_driver.h.

◆ LPNPAR_MESSAGE7

#define LPNPAR_MESSAGE7   (1 << 7)

Definition at line 162 of file ksz9563_driver.h.

◆ LPNPAR_MESSAGE8

#define LPNPAR_MESSAGE8   (1 << 8)

Definition at line 161 of file ksz9563_driver.h.

◆ LPNPAR_MESSAGE9

#define LPNPAR_MESSAGE9   (1 << 9)

Definition at line 160 of file ksz9563_driver.h.

◆ LPNPAR_MSG_PAGE

#define LPNPAR_MSG_PAGE   (1 << 13)

Definition at line 156 of file ksz9563_driver.h.

◆ LPNPAR_NEXT_PAGE

#define LPNPAR_NEXT_PAGE   (1 << 15)

Definition at line 154 of file ksz9563_driver.h.

◆ LPNPAR_TOGGLE

#define LPNPAR_TOGGLE   (1 << 11)

Definition at line 158 of file ksz9563_driver.h.

◆ MMD_CTRL_DEVICE_ADDR0

#define MMD_CTRL_DEVICE_ADDR0   (1 << 0)

Definition at line 204 of file ksz9563_driver.h.

◆ MMD_CTRL_DEVICE_ADDR1

#define MMD_CTRL_DEVICE_ADDR1   (1 << 1)

Definition at line 203 of file ksz9563_driver.h.

◆ MMD_CTRL_DEVICE_ADDR2

#define MMD_CTRL_DEVICE_ADDR2   (1 << 2)

Definition at line 202 of file ksz9563_driver.h.

◆ MMD_CTRL_DEVICE_ADDR3

#define MMD_CTRL_DEVICE_ADDR3   (1 << 3)

Definition at line 201 of file ksz9563_driver.h.

◆ MMD_CTRL_DEVICE_ADDR4

#define MMD_CTRL_DEVICE_ADDR4   (1 << 4)

Definition at line 200 of file ksz9563_driver.h.

◆ MMD_CTRL_DEVICE_OP_MODE0

#define MMD_CTRL_DEVICE_OP_MODE0   (1 << 14)

Definition at line 199 of file ksz9563_driver.h.

◆ MMD_CTRL_DEVICE_OP_MODE1

#define MMD_CTRL_DEVICE_OP_MODE1   (1 << 15)

Definition at line 198 of file ksz9563_driver.h.

◆ PHYCON_1000BT_MS_STATUS

#define PHYCON_1000BT_MS_STATUS   (1 << 2)

Definition at line 254 of file ksz9563_driver.h.

◆ PHYCON_DUPLEX_STATUS

#define PHYCON_DUPLEX_STATUS   (1 << 3)

Definition at line 253 of file ksz9563_driver.h.

◆ PHYCON_JABBER_EN

#define PHYCON_JABBER_EN   (1 << 9)

Definition at line 249 of file ksz9563_driver.h.

◆ PHYCON_SPEED_1000BT

#define PHYCON_SPEED_1000BT   (1 << 6)

Definition at line 250 of file ksz9563_driver.h.

◆ PHYCON_SPEED_100BTX

#define PHYCON_SPEED_100BTX   (1 << 5)

Definition at line 251 of file ksz9563_driver.h.

◆ PHYCON_SPEED_10BT

#define PHYCON_SPEED_10BT   (1 << 4)

Definition at line 252 of file ksz9563_driver.h.

◆ PORT_MSTP_STATE_LEARNING_DIS

#define PORT_MSTP_STATE_LEARNING_DIS   (1 << 0)

Definition at line 304 of file ksz9563_driver.h.

◆ PORT_MSTP_STATE_RECEIVE_EN

#define PORT_MSTP_STATE_RECEIVE_EN   (1 << 1)

Definition at line 303 of file ksz9563_driver.h.

◆ PORT_MSTP_STATE_TRANSMIT_EN

#define PORT_MSTP_STATE_TRANSMIT_EN   (1 << 2)

Definition at line 302 of file ksz9563_driver.h.

◆ PORT_OP_CTRL0_LOCAL_LOOPBACK

#define PORT_OP_CTRL0_LOCAL_LOOPBACK   (1 << 7)

Definition at line 281 of file ksz9563_driver.h.

◆ PORT_OP_CTRL0_REMOTE_LOOPBACK

#define PORT_OP_CTRL0_REMOTE_LOOPBACK   (1 << 6)

Definition at line 282 of file ksz9563_driver.h.

◆ PORT_OP_CTRL0_TAIL_TAG_EN

#define PORT_OP_CTRL0_TAIL_TAG_EN   (1 << 2)

Definition at line 283 of file ksz9563_driver.h.

◆ PORT_OP_CTRL0_TX_QUEUE_SPLIT_EN0

#define PORT_OP_CTRL0_TX_QUEUE_SPLIT_EN0   (1 << 0)

Definition at line 285 of file ksz9563_driver.h.

◆ PORT_OP_CTRL0_TX_QUEUE_SPLIT_EN1

#define PORT_OP_CTRL0_TX_QUEUE_SPLIT_EN1   (1 << 1)

Definition at line 284 of file ksz9563_driver.h.

◆ RLB_REMOTE_LOOPBACK

#define RLB_REMOTE_LOOPBACK   (1 << 8)

Definition at line 213 of file ksz9563_driver.h.

◆ SWITCH_OP_DOUBLE_TAG_EN

#define SWITCH_OP_DOUBLE_TAG_EN   (1 << 7)

Definition at line 276 of file ksz9563_driver.h.

◆ SWITCH_OP_SOFT_RESET

#define SWITCH_OP_SOFT_RESET   (1 << 1)

Definition at line 277 of file ksz9563_driver.h.

◆ SWITCH_OP_START_SWITCH

#define SWITCH_OP_START_SWITCH   (1 << 0)

Definition at line 278 of file ksz9563_driver.h.

◆ XMII_PORT_CTRL0_PORT_DUPLEX

#define XMII_PORT_CTRL0_PORT_DUPLEX   (1 << 6)

Definition at line 288 of file ksz9563_driver.h.

◆ XMII_PORT_CTRL0_PORT_RX_FLOW_CTRL_EN

#define XMII_PORT_CTRL0_PORT_RX_FLOW_CTRL_EN   (1 << 3)

Definition at line 291 of file ksz9563_driver.h.

◆ XMII_PORT_CTRL0_PORT_SPEED_10_100

#define XMII_PORT_CTRL0_PORT_SPEED_10_100   (1 << 4)

Definition at line 290 of file ksz9563_driver.h.

◆ XMII_PORT_CTRL0_PORT_TX_FLOW_CTRL_EN

#define XMII_PORT_CTRL0_PORT_TX_FLOW_CTRL_EN   (1 << 5)

Definition at line 289 of file ksz9563_driver.h.

◆ XMII_PORT_CTRL1_MII_RMII_MODE

#define XMII_PORT_CTRL1_MII_RMII_MODE   (1 << 2)

Definition at line 297 of file ksz9563_driver.h.

◆ XMII_PORT_CTRL1_PORT_IF_TYPE0

#define XMII_PORT_CTRL1_PORT_IF_TYPE0   (1 << 0)

Definition at line 299 of file ksz9563_driver.h.

◆ XMII_PORT_CTRL1_PORT_IF_TYPE1

#define XMII_PORT_CTRL1_PORT_IF_TYPE1   (1 << 1)

Definition at line 298 of file ksz9563_driver.h.

◆ XMII_PORT_CTRL1_PORT_SPEED_1000

#define XMII_PORT_CTRL1_PORT_SPEED_1000   (1 << 6)

Definition at line 294 of file ksz9563_driver.h.

◆ XMII_PORT_CTRL1_RGMII_ID_EG

#define XMII_PORT_CTRL1_RGMII_ID_EG   (1 << 3)

Definition at line 296 of file ksz9563_driver.h.

◆ XMII_PORT_CTRL1_RGMII_ID_IG

#define XMII_PORT_CTRL1_RGMII_ID_IG   (1 << 4)

Definition at line 295 of file ksz9563_driver.h.

Function Documentation

◆ ksz9563DisableIrq()

void ksz9563DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 313 of file ksz9563_driver.c.

◆ ksz9563DumpPhyReg()

void ksz9563DumpPhyReg ( NetInterface interface,
uint8_t  port 
)

Dump PHY registers for debugging purpose.

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

Definition at line 660 of file ksz9563_driver.c.

◆ ksz9563DumpSwitchReg()

void ksz9563DumpSwitchReg ( NetInterface interface)

Dump switch registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 772 of file ksz9563_driver.c.

◆ ksz9563EnableIrq()

void ksz9563EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 303 of file ksz9563_driver.c.

◆ ksz9563EventHandler()

void ksz9563EventHandler ( NetInterface interface)

KSZ9563 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 323 of file ksz9563_driver.c.

◆ ksz9563GetLinkState()

bool_t ksz9563GetLinkState ( NetInterface interface,
uint8_t  port 
)

Get link state.

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

Definition at line 184 of file ksz9563_driver.c.

◆ ksz9563Init()

error_t ksz9563Init ( NetInterface interface)

KSZ9563 Ethernet switch initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 75 of file ksz9563_driver.c.

◆ ksz9563ReadPhyReg()

uint16_t ksz9563ReadPhyReg ( 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 613 of file ksz9563_driver.c.

◆ ksz9563ReadSwitchReg()

uint8_t ksz9563ReadSwitchReg ( NetInterface interface,
uint16_t  address 
)

Read switch register.

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

Definition at line 727 of file ksz9563_driver.c.

◆ ksz9563TagFrame()

error_t ksz9563TagFrame ( 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 471 of file ksz9563_driver.c.

◆ ksz9563Tick()

void ksz9563Tick ( NetInterface interface)

KSZ9563 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 222 of file ksz9563_driver.c.

◆ ksz9563UntagFrame()

error_t ksz9563UntagFrame ( 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 523 of file ksz9563_driver.c.

◆ ksz9563WritePhyReg()

void ksz9563WritePhyReg ( 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 568 of file ksz9563_driver.c.

◆ ksz9563WriteSwitchReg()

void ksz9563WriteSwitchReg ( 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 684 of file ksz9563_driver.c.

Variable Documentation

◆ ksz9563PhyDriver

const PhyDriver ksz9563PhyDriver

KSZ9563 Ethernet switch driver.

Definition at line 45 of file ksz9563_driver.c.