lan9303_driver.h File Reference

LAN9303 Ethernet switch. More...

#include "core/nic.h"

Go to the source code of this file.

Macros

#define LAN9303_PORT1   1
 
#define LAN9303_PORT2   2
 
#define LAN9303_PHY_REG_BMCR   0x00
 
#define LAN9303_PHY_REG_BMSR   0x01
 
#define LAN9303_PHY_REG_PHYIDR1   0x02
 
#define LAN9303_PHY_REG_PHYIDR2   0x03
 
#define LAN9303_PHY_REG_ANAR   0x04
 
#define LAN9303_PHY_REG_ANLPAR   0x05
 
#define LAN9303_PHY_REG_ANER   0x06
 
#define LAN9303_PHY_REG_MCSR   0x11
 
#define LAN9303_PHY_REG_SMR   0x12
 
#define LAN9303_PHY_REG_SCSIR   0x1B
 
#define LAN9303_PHY_REG_PISR   0x1D
 
#define LAN9303_PHY_REG_PIMR   0x1E
 
#define LAN9303_PHY_REG_PSCSR   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_100BT2_FD   (1 << 10)
 
#define BMSR_100BT2   (1 << 9)
 
#define BMSR_EXTENTED_STATUS   (1 << 8)
 
#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_RF   (1 << 13)
 
#define ANAR_PAUSE1   (1 << 11)
 
#define ANAR_PAUSE0   (1 << 10)
 
#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_NP   (1 << 15)
 
#define ANLPAR_ACK   (1 << 14)
 
#define ANLPAR_RF   (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_PDF   (1 << 4)
 
#define ANER_LP_NP_ABLE   (1 << 3)
 
#define ANER_NP_ABLE   (1 << 2)
 
#define ANER_PAGE_RX   (1 << 1)
 
#define ANER_LP_AN_ABLE   (1 << 0)
 
#define MCSR_EDPWRDOWN   (1 << 13)
 
#define MCSR_ENERGYON   (1 << 1)
 
#define SMR_MODE2   (1 << 7)
 
#define SMR_MODE1   (1 << 6)
 
#define SMR_MODE0   (1 << 5)
 
#define SMR_PHYAD4   (1 << 4)
 
#define SMR_PHYAD3   (1 << 3)
 
#define SMR_PHYAD2   (1 << 2)
 
#define SMR_PHYAD1   (1 << 1)
 
#define SMR_PHYAD0   (1 << 0)
 
#define SCSIR_AMDIXCTRL   (1 << 15)
 
#define SCSIR_AMDIXEN   (1 << 14)
 
#define SCSIR_AMDIXSTATE   (1 << 13)
 
#define SCSIR_SQEOFF   (1 << 11)
 
#define SCSIR_VCOOFF_LP   (1 << 10)
 
#define SCSIR_XPOL   (1 << 4)
 
#define ISR_ENERGYON   (1 << 7)
 
#define ISR_AN_COMPLETE   (1 << 6)
 
#define ISR_REMOTE_FAULT   (1 << 5)
 
#define ISR_LINK_DOWN   (1 << 4)
 
#define ISR_AN_LP_ACK   (1 << 3)
 
#define ISR_PD_FAULT   (1 << 2)
 
#define ISR_AN_PAGE_RECEIVED   (1 << 1)
 
#define IMR_ENERGYON   (1 << 7)
 
#define IMR_AN_COMPLETE   (1 << 6)
 
#define IMR_REMOTE_FAULT   (1 << 5)
 
#define IMR_LINK_DOWN   (1 << 4)
 
#define IMR_AN_LP_ACK   (1 << 3)
 
#define IMR_PD_FAULT   (1 << 2)
 
#define IMR_AN_PAGE_RECEIVED   (1 << 1)
 
#define PSCSR_AUTODONE   (1 << 12)
 
#define PSCSR_HCDSPEED2   (1 << 4)
 
#define PSCSR_HCDSPEED1   (1 << 3)
 
#define PSCSR_HCDSPEED0   (1 << 2)
 
#define PSCSR_HCDSPEED_MASK   (7 << 2)
 
#define PSCSR_HCDSPEED_10BT   (1 << 2)
 
#define PSCSR_HCDSPEED_100BTX   (2 << 2)
 
#define PSCSR_HCDSPEED_10BT_FD   (5 << 2)
 
#define PSCSR_HCDSPEED_100BTX_FD   (6 << 2)
 

Functions

error_t lan9303Init (NetInterface *interface)
 LAN9303 Ethernet switch initialization. More...
 
bool_t lan9303GetLinkState (NetInterface *interface, uint8_t port)
 Get link state. More...
 
void lan9303Tick (NetInterface *interface)
 LAN9303 timer handler. More...
 
void lan9303EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void lan9303DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void lan9303EventHandler (NetInterface *interface)
 LAN9303 event handler. More...
 
void lan9303WritePhyReg (NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t lan9303ReadPhyReg (NetInterface *interface, uint8_t port, uint8_t address)
 Read PHY register. More...
 
void lan9303DumpPhyReg (NetInterface *interface, uint8_t port)
 Dump PHY registers for debugging purpose. More...
 
void lan9303WriteSmiReg (NetInterface *interface, uint16_t address, uint32_t data)
 Write SMI register. More...
 
uint32_t lan9303ReadSmiReg (NetInterface *interface, uint16_t address)
 Read SMI register. More...
 
void lan9303DumpSmiReg (NetInterface *interface)
 Dump SMI registers for debugging purpose. More...
 

Variables

const PhyDriver lan9303PhyDriver
 LAN9303 Ethernet switch driver. More...
 

Detailed Description

LAN9303 Ethernet switch.

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 lan9303_driver.h.

Macro Definition Documentation

◆ ANAR_100BTX

#define ANAR_100BTX   (1 << 7)

Definition at line 86 of file lan9303_driver.h.

◆ ANAR_100BTX_FD

#define ANAR_100BTX_FD   (1 << 8)

Definition at line 85 of file lan9303_driver.h.

◆ ANAR_10BT

#define ANAR_10BT   (1 << 5)

Definition at line 88 of file lan9303_driver.h.

◆ ANAR_10BT_FD

#define ANAR_10BT_FD   (1 << 6)

Definition at line 87 of file lan9303_driver.h.

◆ ANAR_PAUSE0

#define ANAR_PAUSE0   (1 << 10)

Definition at line 84 of file lan9303_driver.h.

◆ ANAR_PAUSE1

#define ANAR_PAUSE1   (1 << 11)

Definition at line 83 of file lan9303_driver.h.

◆ ANAR_RF

#define ANAR_RF   (1 << 13)

Definition at line 82 of file lan9303_driver.h.

◆ ANAR_SELECTOR0

#define ANAR_SELECTOR0   (1 << 0)

Definition at line 93 of file lan9303_driver.h.

◆ ANAR_SELECTOR1

#define ANAR_SELECTOR1   (1 << 1)

Definition at line 92 of file lan9303_driver.h.

◆ ANAR_SELECTOR2

#define ANAR_SELECTOR2   (1 << 2)

Definition at line 91 of file lan9303_driver.h.

◆ ANAR_SELECTOR3

#define ANAR_SELECTOR3   (1 << 3)

Definition at line 90 of file lan9303_driver.h.

◆ ANAR_SELECTOR4

#define ANAR_SELECTOR4   (1 << 4)

Definition at line 89 of file lan9303_driver.h.

◆ ANER_LP_AN_ABLE

#define ANER_LP_AN_ABLE   (1 << 0)

Definition at line 117 of file lan9303_driver.h.

◆ ANER_LP_NP_ABLE

#define ANER_LP_NP_ABLE   (1 << 3)

Definition at line 114 of file lan9303_driver.h.

◆ ANER_NP_ABLE

#define ANER_NP_ABLE   (1 << 2)

Definition at line 115 of file lan9303_driver.h.

◆ ANER_PAGE_RX

#define ANER_PAGE_RX   (1 << 1)

Definition at line 116 of file lan9303_driver.h.

◆ ANER_PDF

#define ANER_PDF   (1 << 4)

Definition at line 113 of file lan9303_driver.h.

◆ ANLPAR_100BT4

#define ANLPAR_100BT4   (1 << 9)

Definition at line 101 of file lan9303_driver.h.

◆ ANLPAR_100BTX

#define ANLPAR_100BTX   (1 << 7)

Definition at line 103 of file lan9303_driver.h.

◆ ANLPAR_100BTX_FD

#define ANLPAR_100BTX_FD   (1 << 8)

Definition at line 102 of file lan9303_driver.h.

◆ ANLPAR_10BT

#define ANLPAR_10BT   (1 << 5)

Definition at line 105 of file lan9303_driver.h.

◆ ANLPAR_10BT_FD

#define ANLPAR_10BT_FD   (1 << 6)

Definition at line 104 of file lan9303_driver.h.

◆ ANLPAR_ACK

#define ANLPAR_ACK   (1 << 14)

Definition at line 97 of file lan9303_driver.h.

◆ ANLPAR_NP

#define ANLPAR_NP   (1 << 15)

Definition at line 96 of file lan9303_driver.h.

◆ ANLPAR_PAUSE0

#define ANLPAR_PAUSE0   (1 << 10)

Definition at line 100 of file lan9303_driver.h.

◆ ANLPAR_PAUSE1

#define ANLPAR_PAUSE1   (1 << 11)

Definition at line 99 of file lan9303_driver.h.

◆ ANLPAR_RF

#define ANLPAR_RF   (1 << 13)

Definition at line 98 of file lan9303_driver.h.

◆ ANLPAR_SELECTOR0

#define ANLPAR_SELECTOR0   (1 << 0)

Definition at line 110 of file lan9303_driver.h.

◆ ANLPAR_SELECTOR1

#define ANLPAR_SELECTOR1   (1 << 1)

Definition at line 109 of file lan9303_driver.h.

◆ ANLPAR_SELECTOR2

#define ANLPAR_SELECTOR2   (1 << 2)

Definition at line 108 of file lan9303_driver.h.

◆ ANLPAR_SELECTOR3

#define ANLPAR_SELECTOR3   (1 << 3)

Definition at line 107 of file lan9303_driver.h.

◆ ANLPAR_SELECTOR4

#define ANLPAR_SELECTOR4   (1 << 4)

Definition at line 106 of file lan9303_driver.h.

◆ BMCR_AN_EN

#define BMCR_AN_EN   (1 << 12)

Definition at line 58 of file lan9303_driver.h.

◆ BMCR_COL_TEST

#define BMCR_COL_TEST   (1 << 7)

Definition at line 63 of file lan9303_driver.h.

◆ BMCR_DUPLEX_MODE

#define BMCR_DUPLEX_MODE   (1 << 8)

Definition at line 62 of file lan9303_driver.h.

◆ BMCR_ISOLATE

#define BMCR_ISOLATE   (1 << 10)

Definition at line 60 of file lan9303_driver.h.

◆ BMCR_LOOPBACK

#define BMCR_LOOPBACK   (1 << 14)

Definition at line 56 of file lan9303_driver.h.

◆ BMCR_POWER_DOWN

#define BMCR_POWER_DOWN   (1 << 11)

Definition at line 59 of file lan9303_driver.h.

◆ BMCR_RESET

#define BMCR_RESET   (1 << 15)

Definition at line 55 of file lan9303_driver.h.

◆ BMCR_RESTART_AN

#define BMCR_RESTART_AN   (1 << 9)

Definition at line 61 of file lan9303_driver.h.

◆ BMCR_SPEED_SEL

#define BMCR_SPEED_SEL   (1 << 13)

Definition at line 57 of file lan9303_driver.h.

◆ BMSR_100BT2

#define BMSR_100BT2   (1 << 9)

Definition at line 72 of file lan9303_driver.h.

◆ BMSR_100BT2_FD

#define BMSR_100BT2_FD   (1 << 10)

Definition at line 71 of file lan9303_driver.h.

◆ BMSR_100BT4

#define BMSR_100BT4   (1 << 15)

Definition at line 66 of file lan9303_driver.h.

◆ BMSR_100BTX

#define BMSR_100BTX   (1 << 13)

Definition at line 68 of file lan9303_driver.h.

◆ BMSR_100BTX_FD

#define BMSR_100BTX_FD   (1 << 14)

Definition at line 67 of file lan9303_driver.h.

◆ BMSR_10BT

#define BMSR_10BT   (1 << 11)

Definition at line 70 of file lan9303_driver.h.

◆ BMSR_10BT_FD

#define BMSR_10BT_FD   (1 << 12)

Definition at line 69 of file lan9303_driver.h.

◆ BMSR_AN_ABLE

#define BMSR_AN_ABLE   (1 << 3)

Definition at line 76 of file lan9303_driver.h.

◆ BMSR_AN_COMPLETE

#define BMSR_AN_COMPLETE   (1 << 5)

Definition at line 74 of file lan9303_driver.h.

◆ BMSR_EXTENDED_CAP

#define BMSR_EXTENDED_CAP   (1 << 0)

Definition at line 79 of file lan9303_driver.h.

◆ BMSR_EXTENTED_STATUS

#define BMSR_EXTENTED_STATUS   (1 << 8)

Definition at line 73 of file lan9303_driver.h.

◆ BMSR_JABBER_DETECT

#define BMSR_JABBER_DETECT   (1 << 1)

Definition at line 78 of file lan9303_driver.h.

◆ BMSR_LINK_STATUS

#define BMSR_LINK_STATUS   (1 << 2)

Definition at line 77 of file lan9303_driver.h.

◆ BMSR_REMOTE_FAULT

#define BMSR_REMOTE_FAULT   (1 << 4)

Definition at line 75 of file lan9303_driver.h.

◆ IMR_AN_COMPLETE

#define IMR_AN_COMPLETE   (1 << 6)

Definition at line 152 of file lan9303_driver.h.

◆ IMR_AN_LP_ACK

#define IMR_AN_LP_ACK   (1 << 3)

Definition at line 155 of file lan9303_driver.h.

◆ IMR_AN_PAGE_RECEIVED

#define IMR_AN_PAGE_RECEIVED   (1 << 1)

Definition at line 157 of file lan9303_driver.h.

◆ IMR_ENERGYON

#define IMR_ENERGYON   (1 << 7)

Definition at line 151 of file lan9303_driver.h.

◆ IMR_LINK_DOWN

#define IMR_LINK_DOWN   (1 << 4)

Definition at line 154 of file lan9303_driver.h.

◆ IMR_PD_FAULT

#define IMR_PD_FAULT   (1 << 2)

Definition at line 156 of file lan9303_driver.h.

◆ IMR_REMOTE_FAULT

#define IMR_REMOTE_FAULT   (1 << 5)

Definition at line 153 of file lan9303_driver.h.

◆ ISR_AN_COMPLETE

#define ISR_AN_COMPLETE   (1 << 6)

Definition at line 143 of file lan9303_driver.h.

◆ ISR_AN_LP_ACK

#define ISR_AN_LP_ACK   (1 << 3)

Definition at line 146 of file lan9303_driver.h.

◆ ISR_AN_PAGE_RECEIVED

#define ISR_AN_PAGE_RECEIVED   (1 << 1)

Definition at line 148 of file lan9303_driver.h.

◆ ISR_ENERGYON

#define ISR_ENERGYON   (1 << 7)

Definition at line 142 of file lan9303_driver.h.

◆ ISR_LINK_DOWN

#define ISR_LINK_DOWN   (1 << 4)

Definition at line 145 of file lan9303_driver.h.

◆ ISR_PD_FAULT

#define ISR_PD_FAULT   (1 << 2)

Definition at line 147 of file lan9303_driver.h.

◆ ISR_REMOTE_FAULT

#define ISR_REMOTE_FAULT   (1 << 5)

Definition at line 144 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_ANAR

#define LAN9303_PHY_REG_ANAR   0x04

Definition at line 44 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_ANER

#define LAN9303_PHY_REG_ANER   0x06

Definition at line 46 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_ANLPAR

#define LAN9303_PHY_REG_ANLPAR   0x05

Definition at line 45 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_BMCR

#define LAN9303_PHY_REG_BMCR   0x00

Definition at line 40 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_BMSR

#define LAN9303_PHY_REG_BMSR   0x01

Definition at line 41 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_MCSR

#define LAN9303_PHY_REG_MCSR   0x11

Definition at line 47 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_PHYIDR1

#define LAN9303_PHY_REG_PHYIDR1   0x02

Definition at line 42 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_PHYIDR2

#define LAN9303_PHY_REG_PHYIDR2   0x03

Definition at line 43 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_PIMR

#define LAN9303_PHY_REG_PIMR   0x1E

Definition at line 51 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_PISR

#define LAN9303_PHY_REG_PISR   0x1D

Definition at line 50 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_PSCSR

#define LAN9303_PHY_REG_PSCSR   0x1F

Definition at line 52 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_SCSIR

#define LAN9303_PHY_REG_SCSIR   0x1B

Definition at line 49 of file lan9303_driver.h.

◆ LAN9303_PHY_REG_SMR

#define LAN9303_PHY_REG_SMR   0x12

Definition at line 48 of file lan9303_driver.h.

◆ LAN9303_PORT1

#define LAN9303_PORT1   1

Definition at line 36 of file lan9303_driver.h.

◆ LAN9303_PORT2

#define LAN9303_PORT2   2

Definition at line 37 of file lan9303_driver.h.

◆ MCSR_EDPWRDOWN

#define MCSR_EDPWRDOWN   (1 << 13)

Definition at line 120 of file lan9303_driver.h.

◆ MCSR_ENERGYON

#define MCSR_ENERGYON   (1 << 1)

Definition at line 121 of file lan9303_driver.h.

◆ PSCSR_AUTODONE

#define PSCSR_AUTODONE   (1 << 12)

Definition at line 160 of file lan9303_driver.h.

◆ PSCSR_HCDSPEED0

#define PSCSR_HCDSPEED0   (1 << 2)

Definition at line 163 of file lan9303_driver.h.

◆ PSCSR_HCDSPEED1

#define PSCSR_HCDSPEED1   (1 << 3)

Definition at line 162 of file lan9303_driver.h.

◆ PSCSR_HCDSPEED2

#define PSCSR_HCDSPEED2   (1 << 4)

Definition at line 161 of file lan9303_driver.h.

◆ PSCSR_HCDSPEED_100BTX

#define PSCSR_HCDSPEED_100BTX   (2 << 2)

Definition at line 168 of file lan9303_driver.h.

◆ PSCSR_HCDSPEED_100BTX_FD

#define PSCSR_HCDSPEED_100BTX_FD   (6 << 2)

Definition at line 170 of file lan9303_driver.h.

◆ PSCSR_HCDSPEED_10BT

#define PSCSR_HCDSPEED_10BT   (1 << 2)

Definition at line 167 of file lan9303_driver.h.

◆ PSCSR_HCDSPEED_10BT_FD

#define PSCSR_HCDSPEED_10BT_FD   (5 << 2)

Definition at line 169 of file lan9303_driver.h.

◆ PSCSR_HCDSPEED_MASK

#define PSCSR_HCDSPEED_MASK   (7 << 2)

Definition at line 166 of file lan9303_driver.h.

◆ SCSIR_AMDIXCTRL

#define SCSIR_AMDIXCTRL   (1 << 15)

Definition at line 134 of file lan9303_driver.h.

◆ SCSIR_AMDIXEN

#define SCSIR_AMDIXEN   (1 << 14)

Definition at line 135 of file lan9303_driver.h.

◆ SCSIR_AMDIXSTATE

#define SCSIR_AMDIXSTATE   (1 << 13)

Definition at line 136 of file lan9303_driver.h.

◆ SCSIR_SQEOFF

#define SCSIR_SQEOFF   (1 << 11)

Definition at line 137 of file lan9303_driver.h.

◆ SCSIR_VCOOFF_LP

#define SCSIR_VCOOFF_LP   (1 << 10)

Definition at line 138 of file lan9303_driver.h.

◆ SCSIR_XPOL

#define SCSIR_XPOL   (1 << 4)

Definition at line 139 of file lan9303_driver.h.

◆ SMR_MODE0

#define SMR_MODE0   (1 << 5)

Definition at line 126 of file lan9303_driver.h.

◆ SMR_MODE1

#define SMR_MODE1   (1 << 6)

Definition at line 125 of file lan9303_driver.h.

◆ SMR_MODE2

#define SMR_MODE2   (1 << 7)

Definition at line 124 of file lan9303_driver.h.

◆ SMR_PHYAD0

#define SMR_PHYAD0   (1 << 0)

Definition at line 131 of file lan9303_driver.h.

◆ SMR_PHYAD1

#define SMR_PHYAD1   (1 << 1)

Definition at line 130 of file lan9303_driver.h.

◆ SMR_PHYAD2

#define SMR_PHYAD2   (1 << 2)

Definition at line 129 of file lan9303_driver.h.

◆ SMR_PHYAD3

#define SMR_PHYAD3   (1 << 3)

Definition at line 128 of file lan9303_driver.h.

◆ SMR_PHYAD4

#define SMR_PHYAD4   (1 << 4)

Definition at line 127 of file lan9303_driver.h.

Function Documentation

◆ lan9303DisableIrq()

void lan9303DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 185 of file lan9303_driver.c.

◆ lan9303DumpPhyReg()

void lan9303DumpPhyReg ( NetInterface interface,
uint8_t  port 
)

Dump PHY registers for debugging purpose.

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

Definition at line 278 of file lan9303_driver.c.

◆ lan9303DumpSmiReg()

void lan9303DumpSmiReg ( NetInterface interface)

Dump SMI registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 369 of file lan9303_driver.c.

◆ lan9303EnableIrq()

void lan9303EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 175 of file lan9303_driver.c.

◆ lan9303EventHandler()

void lan9303EventHandler ( NetInterface interface)

LAN9303 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 195 of file lan9303_driver.c.

◆ lan9303GetLinkState()

bool_t lan9303GetLinkState ( NetInterface interface,
uint8_t  port 
)

Get link state.

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

Definition at line 91 of file lan9303_driver.c.

◆ lan9303Init()

error_t lan9303Init ( NetInterface interface)

LAN9303 Ethernet switch initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 58 of file lan9303_driver.c.

◆ lan9303ReadPhyReg()

uint16_t lan9303ReadPhyReg ( 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 264 of file lan9303_driver.c.

◆ lan9303ReadSmiReg()

uint32_t lan9303ReadSmiReg ( NetInterface interface,
uint16_t  address 
)

Read SMI register.

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

Definition at line 335 of file lan9303_driver.c.

◆ lan9303Tick()

void lan9303Tick ( NetInterface interface)

LAN9303 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 125 of file lan9303_driver.c.

◆ lan9303WritePhyReg()

void lan9303WritePhyReg ( 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 248 of file lan9303_driver.c.

◆ lan9303WriteSmiReg()

void lan9303WriteSmiReg ( NetInterface interface,
uint16_t  address,
uint32_t  data 
)

Write SMI register.

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

Definition at line 302 of file lan9303_driver.c.

Variable Documentation

◆ lan9303PhyDriver

const PhyDriver lan9303PhyDriver

LAN9303 Ethernet switch driver.

Definition at line 42 of file lan9303_driver.c.