Ksz8851snl
[Drivers]

The low level communication between EFM32 chips and the ethernet controller Micrel KSZ8851 SNL is realized by the functions from this file. More...

Collaboration diagram for Ksz8851snl:

Defines

#define KSZ8851SNL_DEBUG   0
 DEBUG macros.
#define DEBUG_PRINT(...)   (void)0
 DEBUG macro for printf function.
#define LOW_QMU_MAC_REG   0x10
 MAC Address Low.
#define MID_QMU_MAC_REG   0x12
 MAC Address Middle.
#define HIGH_QMU_MAC_REG   0x14
 MAC Address High.
#define OBC_REG   0x20
 On-Chip Bus Control Register.
#define GLOBAL_RESET_REG   0x26
 Global Reset Register.
#define TX_FLOW_CTRL_REG   0x70
 Transmit Flow Control Register.
#define RX_FLOW_CTRL1_REG   0x74
 Receive Flow Control Register 1.
#define RX_FLOW_CTRL2_REG   0x76
 Receive Flow Control Register 2.
#define TX_MEM_INFO_REG   0x78
 TXQ Memory Information Register.
#define RX_FRH_STAT_REG   0x7C
 Receive Frame Header Status Register.
#define RX_FRH_BC_REG   0x7E
 Receive Frame Header Bytecount Register.
#define TXQ_CMD_REG   0x80
 TXQ Command Register.
#define RXQ_CMD_REG   0x82
 RXQ Command Register.
#define TX_FD_PTR_REG   0x84
 TX Frame Data Pointer Register.
#define RX_FD_PTR_REG   0x86
 RX Frame Data Pointer Register.
#define INT_ENABLE_REG   0x90
 Interrupt Enable Register.
#define INT_STATUS_REG   0x92
 Interrupt Status Register.
#define RX_FRAME_THRES_REG   0x9C
 RX Frame Count & Threshold Register.
#define TX_NEXT_FRS_REG   0x9E
 TX Next Frame size register.
#define FLOW_CTRL_LOW_WATERMARK   0xB0
 Configure Low Watermark to 6KByte.
#define FLOW_CTRL_HIGH_WATERMARK   0xB2
 Configure High Watermark to 4KByte.
#define CIDER_REG   0xC0
 Chip ID and Enable Register.
#define IND_ACC_CTRL_REG   0xC8
 Indirect access control Register.
#define IND_ACC_DATA_LOW_REG   0xD0
 Indirect access data low Register.
#define IND_ACC_DATA_HIGH_REG   0xD2
 Indirect access data low Register.
#define PHY_RST_REG   0xD8
 PHY Reset Register.
#define PHY1_CTRL_REG   0xE4
 PHY1 MII-Register Basic Control Register.
#define PORT1_CTRL_REG   0xF6
 Port 1 Control Register.
#define KSZ8851SNL_CHIP_ID   0x8870
 Default Chip ID for KSZ8851SNL.
#define CHIP_ID_MASK   0xFFF0
 Used to mask the revision ID.
#define ONE_FRAME_THRES   0x0001
 RX INT after one frame.
#define FD_PTR_AUTO_INC   0x4000
 Used to reset the FD pointer.
#define CLEAR_INT   0xFFFF
 Used to clear INT_STATUS_REG.
#define NO_INT   0x0000
 Used to disable the interupts.
#define TX_MEM_AVAIL_MASK   0x1FFF
 Used to mask the reserved bits.
#define frameId_MASK   0x003F
 Used to mask the reserved bits.
#define RECEIVE_VALID_FRAME_MASK   0x3C17
 CRC OK for ICMP, IP, TCP, UDP; / MII error; / Frame too long error.
#define RECEIVED_FRAME_VALID_POS   0x0010
 Received valid frame byte pos.
#define RX_BYTE_CNT_MASK   0x0FFF
 Used to mask the reserved bits.
#define LSB_MASK   0x00FF
 Used to mask the LSB.
#define MSB_POS   0x0008
 Used to mark the MSB pos.
#define TX_INT_on_COMPLETION   0x8000
 TX INT on completion.
#define WORD_SIZE   0x0004
 Word size in # of bytes.
#define EXTRA_SIZE   0x0008
 Needed for the frame header.
#define BLOCKING_RECEIVE   0
 Determines if receive will block.
#define WATERMARK_6KB   0x0600
 6KByte Watermark
#define WATERMARK_4KB   0x0400
 4KByte Watermark
#define HIGH_QMU_MAC_H   0xD0
 1st segment of the MAC address
#define HIGH_QMU_MAC_L   0xCF
 2nd segment of the MAC address
#define MID_QMU_MAC_H   0x5E
 3rd segment of the MAC address
#define MID_QMU_MAC_L   0x00
 4th segment of the MAC address
#define LOW_QMU_MAC_H   0x00
 5th segment of the MAC address
#define LOW_QMU_MAC_L   0x00
 6th segment of the MAC address
#define BYTE_MASK   0x00FF
 Used to mask the LSB.
#define BYTE_SIZE   0x0008
 Used to mark the MSB pos.
#define TX_FLOW_CTRL_ICMP_CHECKSUM   0x0100
 Enable Transmit Checksum Generation for ICMP.
#define TX_FLOW_CTRL_UDP_CHECKSUM   0x0080
 Enable Transmit Checksum Generation for UDP.
#define TX_FLOW_CTRL_TCP_CHECKSUM   0x0040
 Enable Transmit Checksum Generation for TCP.
#define TX_FLOW_CTRL_IP_CHECKSUM   0x0020
 Enable Transmit Checksum Generation for IP.
#define TX_FLOW_CTRL_FLUSH_QUEUE   0x0010
 Flush Transmit Queue.
#define TX_FLOW_CTRL_FLOW_ENABLE   0x0008
 Transmit flow control enable.
#define TX_FLOW_CTRL_PAD_ENABLE   0x0004
 Transmit Padding enable.
#define TX_FLOW_CTRL_CRC_ENABLE   0x0002
 Transmit CRC Enable.
#define TX_FLOW_CTRL_ENABLE   0x0001
 Enable tranmsit.
#define TX_FLOW_CTRL_EXAMPLE
 TX FLOW CONTROL Initialization collection.
#define TXQ_AUTO_ENQUEUE   0x0004
 Enable Auto-Enqueue TXQ Frame.
#define TXQ_MEM_AVAILABLE_INT   0x0002
 Enable INT generation when TXQ Memory Available.
#define TXQ_ENQUEUE   0x0001
 Enable Manual Engueue TXQ Frame.
#define RX_FLOW_CTRL_FLUSH_QUEUE   0x8000
 Flush Receive Queue.
#define RX_FLOW_CTRL_UDP_CHECKSUM   0x4000
 Enable Receive UDP Frame Checksum Check.
#define RX_FLOW_CTRL_TCP_CHECKSUM   0x2000
 Enable Receive TCP Frame Checksum Check.
#define RX_FLOW_CTRL_IP_CHECKSUM   0x1000
 Enable Receive IP Frame Checksum Check.
#define RX_FLOW_CTRL_MAC_FILTER   0x0800
 Receive Physical Address Filtering with MAC Address Enable.
#define RX_FLOW_CTRL_FLOW_ENABLE   0x0400
 Enable Receive Flow Control.
#define RX_FLOW_CTRL_BAD_PACKET   0x0200
 Enable Receive Error Frames.
#define RX_FLOW_CTRL_MULTICAST   0x0100
 Receive Multicast Address Filtering with MAC Address Enable.
#define RX_FLOW_CTRL_BROADCAST   0x0080
 Enable Receive Broadcast frames.
#define RX_FLOW_CTRL_ALL_MULTICAST   0x0040
 Enable Receive Multicast frames.
#define RX_FLOW_CTRL_UNICAST   0x0020
 Enable Receive Unicast frames.
#define RX_FLOW_CTRL_PROMISCUOUS   0x0012
 Receive all incoming frames.
#define RX_FLOW_CTRL_INVERSE_FILTER   0x0002
 Receive Inverse Filtering.
#define RX_FLOW_CTRL_ENABLE   0x0001
 Enable receive.
#define RX_FLOW_CTRL1_EXAMPLE
 RX FLOW CONTROL1 Initialization collection.
#define RX_FLOW_CTRL_BURST_LEN_MASK   0x00E0
 Receive Flow Control Burst Length mask.
#define RX_FLOW_CTRL_BURST_LEN_4   0x0000
 4 bytes length
#define RX_FLOW_CTRL_BURST_LEN_8   0x0020
 8 Bytes length
#define RX_FLOW_CTRL_BURST_LEN_16   0x0040
 16 Bytes length
#define RX_FLOW_CTRL_BURST_LEN_32   0x0060
 32 Bytes length
#define RX_FLOW_CTRL_BURST_LEN_FRAME   0x0080
 Full frame length.
#define RX_FLOW_CTRL_IPV6_UDP_FRAG_PASS   0x0010
 IPV4/IPV6/UDP Fragment Frame Pass.
#define RX_FLOW_CTRL_IPV6_UDP_ZERO_PASS   0x0008
 IPV4/IPV6/UDP Frame Checksum Equal Zero.
#define RX_FLOW_CTRL_UDP_LITE_CHECKSUM   0x0004
 Enable UDP Lite frame.
#define RX_FLOW_CTRL_ICMP_CHECKSUM   0x0002
 Enable ICMP frame.
#define RX_FLOW_CTRL_BLOCK_MAC   0x0001
 Receive Source Address Filtering.
#define RX_FLOW_CTRL2_EXAMPLE
 RX FLOW CONTROL2 Initialization collection.
#define RXQ_ON_TIME_INT   0x1000
 RX interrupt is occured on timer duration.
#define RXQ_ON_BYTE_CNT_INT   0x0800
 RX interrupt is occured on byte count threshold.
#define RXQ_ON_FRAME_CNT_INT   0x0400
 RX interrupt is occured on frame count threshold.
#define RXQ_TWOBYTE_OFFSET   0x0200
 Enable adding 2-bytes offset before IP frame header.
#define RXQ_EN_ON_TIME_INT   0x0080
 Enable RX interrupt on timer duration.
#define RXQ_EN_ON_BYTE_CNT_INT   0x0040
 Enable RX interrupt on byte count threshold.
#define RXQ_EN_ON_FRAME_CNT_INT   0x0020
 Enable RX interrupt on frame count threshold.
#define RXQ_AUTO_DEQUEUE   0x0010
 Enable Auto Dequeue RXQ Frame.
#define RXQ_START   0x0008
 Start QMU transfer operation.
#define RXQ_RELEASE_CUR_FR   0x0001
 Release RX Error Frame.
#define RXQ_CMD_EXAMPLE
 RX COMMAND Initialization collection.
#define PORT1_LED_OFF   0x8000
 Turn off port LEDs.
#define PORT1_TX_DISABLE   0x4000
 Disable port transmit.
#define PORT1_AUTO_NEG_RESTART   0x2000
 Restart auto-negotiation.
#define PORT1_POWER_DOWN   0x0800
 Set port power-down.
#define PORT1_AUTO_MDIX_DISABLE   0x0400
 Disable auto MDI/MDI-X.
#define PORT1_FORCE_MDIX   0x0200
 Force MDI-X.
#define PORT1_AUTO_NEG_ENABLE   0x0080
 Enable auto-negotiation.
#define PORT1_FORCE_100_MBIT   0x0040
 Force PHY 100Mbps.
#define PORT1_FORCE_FULL_DUPLEX   0x0020
 Force PHY in full duplex mode.
#define PORT1_AUTO_NEG_SYM_PAUSE   0x0010
 Advertise flow control capability.
#define PORT1_AUTO_NEG_100BTX_FD   0x0008
 Advertise 100BT full-duplex capability.
#define PORT1_AUTO_NEG_100BTX   0x0004
 Advertise 100BT half-duplex capability.
#define PORT1_AUTO_NEG_10BT_FD   0x0002
 Advertise 10BT full-duplex capability.
#define PORT1_AUTO_NEG_10BT   0x0001
 Advertise 10BT half-duplex capability.
#define INT_LINK_CHANGE   0x8000
 Enable link change interrupt.
#define INT_TX_DONE   0x4000
 Enable transmit done interrupt.
#define INT_RX_DONE   0x2000
 Enable receive interrupt.
#define INT_RX_OVERRUN   0x0800
 Enable receive overrun interrupt.
#define INT_TX_STOPPED   0x0200
 Enable transmit process stopped interrupt.
#define INT_RX_STOPPED   0x0100
 Enable receive process stopped interrupt.
#define INT_TX_SPACE   0x0040
 Enable transmit space available interrupt.
#define INT_RX_WOL_FRAME   0x0020
 Enable WOL on receive wake-up frame detect interrupt.
#define INT_MAGIC   0x0010
 Enable magic packet detect interrupt.
#define INT_LINKUP   0x0008
 Enable link up detect interrupt.
#define INT_ENERGY   0x0004
 Enable detect interrupt.
#define INT_SPI_ERROR   0x0002
 Enable receive SPI bus error interrupt.
#define INT_MASK_EXAMPLE
 Interrupt mask initialization collection.
#define QMU_MODULE_SOFT_RESET   0x0002
 QMU Reset.
#define GLOBAL_SOFT_RESET   0x0001
 Global reset.
#define PHY_RESET   0x0001
 PHY Reset Register Options.
#define DIGITAL_LOOPBACK   0x4000
 Enable Digital loopback mode.
#define FORCE_100   0x2000
 Force the speed to 100MBps.
#define AUTO_NEG   0x1000
 Force auto negotiation.
#define RESTART_AUTO_NEG   0x0200
 Restart auto negotiation.
#define FORCE_FULL_DUPLEX   0x0100
 Force full duplex.
#define MIB_MASK   0x1C00
 MIB Mask.
#define MIB_RxByte   0x00
 # of received bytes
#define MIB_XXX   0x01
 MIB Reserved byte.
#define MIB_RxUndersizePkt   0x02
 # of received undersized packets
#define MIB_RxFragments   0x03
 # of received fragments
#define MIB_RxOversize   0x04
 # of received oversized packets
#define MIB_RxJabbers   0x05
 # of received jabbers
#define MIB_RxSynbolError   0x06
 # of received error symbols
#define MIB_RxCRCError   0x07
 # of received packets with CRC error
#define MIB_RxAlignmentError   0x08
 # of received missaligned packets
#define MIB_RxControl8808Pkts   0x09
 # of received control packets
#define MIB_RxPausePkts   0x0A
 # of received pause packets
#define MIB_RxBroadcast   0x0B
 # of received broadcast packets
#define MIB_RxMulticast   0x0C
 # of received multicast packets
#define MIB_RxUnicast   0x0D
 # of received unicast packets
#define MIB_Rx64Octets   0x0E
 # of received packets with size of 64 bytes
#define MIB_Rx65to127Octets   0x0F
 # of received packets with size between 65 and 127 bytes
#define MIB_Rx128to255Octets   0x10
 # of received packets with size between 128 and 255 bytes
#define MIB_Rx256to511Octets   0x11
 # of received packets with size between 256 and 511 bytes
#define MIB_Rx512to1023Octets   0x12
 # of received packets with size between 512 and 1023 bytes
#define MIB_Rx1024to1521Octets   0x13
 # of received packets with size between 1024 and 1521 bytes
#define MIB_Rx1522to2000Octets   0x14
 # of received packets with size between 1522 and 2000 bytes
#define MIB_TxByte   0x15
 # of transmitted bytes
#define MIB_TxLateCollision   0x16
 # of transmitted late collision packets
#define MIB_TxPausePkts   0x17
 # of transmitted pause packets
#define MIB_TxBroadcastPkts   0x18
 # of transmitted broadcast packets
#define MIB_TxMulticastPkts   0x19
 # of transmitted multicast packets
#define MIB_TxUnicastPkts   0x1A
 # of transmitted unicast packets
#define MIB_TxDeferred   0x1B
 # of transmitted deferred packets
#define MIB_TxTotalCollision   0x1C
 # of transmitted total collisions
#define MIB_TxExcessiveCollision   0x1D
 # of transmitted excessive collisions
#define MIB_TxSingleCollision   0x1E
 # of transmitted single collisions
#define MIB_TxMultipleCollision   0x1F
 # of transmitted multiple collisions

Enumerations

enum  exceptionType_e {
  ERROR,
  INFO
}
 

enumeration used for exception handling

More...

Functions

void KSZ8851SNL_Init (void)
 Initialize the registers of the ethernet controller.
void KSZ8851SNL_Send (uint16_t packetLength, uint8_t *packetData)
 Performs the actual transmit of a raw frame over the network.
uint16_t KSZ8851SNL_Receive (uint8_t *pRXData, uint16_t *pRXLength)
 Performs the actual receive of a raw frame over the network.
void KSZ8851SNL_GetMacAddress (uint8_t *macAddress)
 Get the MAC address of the current board.
void KSZ8851SNL_ReadMIBCounters (char *param)
 Dumps the Management Information Base Counters.
uint16_t KSZ8851SNL_CheckIrqStat (void)
 Checks for any interrrupts and if found, clears their status and prepair for interrupt handler routines.
uint16_t KSZ8851SNL_CurrFrameSize (void)
 Returns the size of the currently received frame.
void KSZ8851SNL_TerminateLongTransmit (uint16_t pTXLength, uint8_t *pTXData)
 Performs the clean up procedures after the transmission of a long raw frame over the network.
void KSZ8851SNL_InitiateLongTransmit (uint16_t pTXLength)
 Performs the initialisation of the transmission of a long raw frame over the network.
void KSZ8851SNL_LongTransmit (uint16_t pTXLength, uint8_t *pTXData)
 Performs the actual transmission of a long raw frame over the network.
void KSZ8851SNL_EnableInterupts (void)
 enables the chip interrupts

Detailed Description

The low level communication between EFM32 chips and the ethernet controller Micrel KSZ8851 SNL is realized by the functions from this file.

The file contains all the necesarry functions to be used as a stand alone program to send/receive raw ethernet frames or can be incorporated into a higher layer to be used with an IP stack.


Define Documentation

#define AUTO_NEG   0x1000

Force auto negotiation.

Definition at line 349 of file ksz8851snl.h.

#define BLOCKING_RECEIVE   0

Determines if receive will block.

Definition at line 120 of file ksz8851snl.h.

#define BYTE_MASK   0x00FF

Used to mask the LSB.

Definition at line 130 of file ksz8851snl.h.

#define BYTE_SIZE   0x0008

Used to mark the MSB pos.

Definition at line 131 of file ksz8851snl.h.

Referenced by KSZ8851SNL_GetMacAddress().

#define CHIP_ID_MASK   0xFFF0

Used to mask the revision ID.

Definition at line 103 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define CIDER_REG   0xC0

Chip ID and Enable Register.

Definition at line 93 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define CLEAR_INT   0xFFFF

Used to clear INT_STATUS_REG.

Definition at line 106 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define DEBUG_PRINT ( ...   )     (void)0

DEBUG macro for printf function.

Definition at line 68 of file ksz8851snl.h.

Referenced by KSZ8851SNL_ExceptionHandler(), and KSZ8851SNL_ReadMIBCounters().

#define DIGITAL_LOOPBACK   0x4000

Enable Digital loopback mode.

Definition at line 345 of file ksz8851snl.h.

#define EXTRA_SIZE   0x0008

Needed for the frame header.

Definition at line 119 of file ksz8851snl.h.

Referenced by KSZ8851SNL_InitiateLongTransmit(), and KSZ8851SNL_Send().

#define FD_PTR_AUTO_INC   0x4000

Used to reset the FD pointer.

Definition at line 105 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init(), and KSZ8851SNL_Receive().

#define FLOW_CTRL_HIGH_WATERMARK   0xB2

Configure High Watermark to 4KByte.

Definition at line 92 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define FLOW_CTRL_LOW_WATERMARK   0xB0

Configure Low Watermark to 6KByte.

Definition at line 91 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define FORCE_100   0x2000

Force the speed to 100MBps.

Definition at line 347 of file ksz8851snl.h.

#define FORCE_FULL_DUPLEX   0x0100

Force full duplex.

Definition at line 353 of file ksz8851snl.h.

#define frameId_MASK   0x003F

Used to mask the reserved bits.

Definition at line 109 of file ksz8851snl.h.

Referenced by KSZ8851SNL_InitiateLongTransmit(), and KSZ8851SNL_Send().

#define GLOBAL_RESET_REG   0x26

Global Reset Register.

Definition at line 76 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define GLOBAL_SOFT_RESET   0x0001

Global reset.

Definition at line 338 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define HIGH_QMU_MAC_H   0xD0

1st segment of the MAC address

Definition at line 124 of file ksz8851snl.h.

Referenced by KSZ8851SNL_GetMacAddress().

#define HIGH_QMU_MAC_L   0xCF

2nd segment of the MAC address

Definition at line 125 of file ksz8851snl.h.

Referenced by KSZ8851SNL_GetMacAddress().

#define HIGH_QMU_MAC_REG   0x14

MAC Address High.

Definition at line 74 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define IND_ACC_CTRL_REG   0xC8

Indirect access control Register.

Definition at line 94 of file ksz8851snl.h.

Referenced by KSZ8851SNL_ReadMIBCounters().

#define IND_ACC_DATA_HIGH_REG   0xD2

Indirect access data low Register.

Definition at line 96 of file ksz8851snl.h.

Referenced by KSZ8851SNL_ReadMIBCounters().

#define IND_ACC_DATA_LOW_REG   0xD0

Indirect access data low Register.

Definition at line 95 of file ksz8851snl.h.

Referenced by KSZ8851SNL_ReadMIBCounters().

#define INT_ENABLE_REG   0x90
#define INT_ENERGY   0x0004

Enable detect interrupt.

Definition at line 322 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat().

#define INT_LINK_CHANGE   0x8000

Enable link change interrupt.

Definition at line 302 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat().

#define INT_LINKUP   0x0008

Enable link up detect interrupt.

Definition at line 320 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat().

#define INT_MAGIC   0x0010

Enable magic packet detect interrupt.

Definition at line 318 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat().

#define INT_MASK_EXAMPLE
#define INT_RX_DONE   0x2000

Enable receive interrupt.

Definition at line 306 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat().

#define INT_RX_OVERRUN   0x0800

Enable receive overrun interrupt.

Definition at line 308 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat().

#define INT_RX_STOPPED   0x0100

Enable receive process stopped interrupt.

Definition at line 312 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat().

#define INT_RX_WOL_FRAME   0x0020

Enable WOL on receive wake-up frame detect interrupt.

Definition at line 316 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat().

#define INT_SPI_ERROR   0x0002

Enable receive SPI bus error interrupt.

Definition at line 324 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat().

#define INT_STATUS_REG   0x92

Interrupt Status Register.

Definition at line 88 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat(), KSZ8851SNL_Init(), KSZ8851SNL_InitiateLongTransmit(), and KSZ8851SNL_Send().

#define INT_TX_DONE   0x4000

Enable transmit done interrupt.

Definition at line 304 of file ksz8851snl.h.

#define INT_TX_SPACE   0x0040

Enable transmit space available interrupt.

Definition at line 314 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat(), KSZ8851SNL_InitiateLongTransmit(), and KSZ8851SNL_Send().

#define INT_TX_STOPPED   0x0200

Enable transmit process stopped interrupt.

Definition at line 310 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat().

#define KSZ8851SNL_CHIP_ID   0x8870

Default Chip ID for KSZ8851SNL.

Definition at line 102 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define KSZ8851SNL_DEBUG   0

DEBUG macros.

Definition at line 60 of file ksz8851snl.h.

#define LOW_QMU_MAC_H   0x00

5th segment of the MAC address

Definition at line 128 of file ksz8851snl.h.

#define LOW_QMU_MAC_L   0x00

6th segment of the MAC address

Definition at line 129 of file ksz8851snl.h.

#define LOW_QMU_MAC_REG   0x10

MAC Address Low.

Definition at line 72 of file ksz8851snl.h.

#define LSB_MASK   0x00FF

Used to mask the LSB.

Definition at line 115 of file ksz8851snl.h.

Referenced by KSZ8851SNL_InitiateLongTransmit(), and KSZ8851SNL_Send().

#define MIB_MASK   0x1C00

MIB Mask.

Definition at line 356 of file ksz8851snl.h.

Referenced by KSZ8851SNL_ReadMIBCounters().

#define MIB_Rx1024to1521Octets   0x13

# of received packets with size between 1024 and 1521 bytes

Definition at line 376 of file ksz8851snl.h.

#define MIB_Rx128to255Octets   0x10

# of received packets with size between 128 and 255 bytes

Definition at line 373 of file ksz8851snl.h.

#define MIB_Rx1522to2000Octets   0x14

# of received packets with size between 1522 and 2000 bytes

Definition at line 377 of file ksz8851snl.h.

#define MIB_Rx256to511Octets   0x11

# of received packets with size between 256 and 511 bytes

Definition at line 374 of file ksz8851snl.h.

#define MIB_Rx512to1023Octets   0x12

# of received packets with size between 512 and 1023 bytes

Definition at line 375 of file ksz8851snl.h.

#define MIB_Rx64Octets   0x0E

# of received packets with size of 64 bytes

Definition at line 371 of file ksz8851snl.h.

#define MIB_Rx65to127Octets   0x0F

# of received packets with size between 65 and 127 bytes

Definition at line 372 of file ksz8851snl.h.

#define MIB_RxAlignmentError   0x08

# of received missaligned packets

Definition at line 365 of file ksz8851snl.h.

#define MIB_RxBroadcast   0x0B

# of received broadcast packets

Definition at line 368 of file ksz8851snl.h.

#define MIB_RxByte   0x00

# of received bytes

Definition at line 357 of file ksz8851snl.h.

#define MIB_RxControl8808Pkts   0x09

# of received control packets

Definition at line 366 of file ksz8851snl.h.

#define MIB_RxCRCError   0x07

# of received packets with CRC error

Definition at line 364 of file ksz8851snl.h.

#define MIB_RxFragments   0x03

# of received fragments

Definition at line 360 of file ksz8851snl.h.

#define MIB_RxJabbers   0x05

# of received jabbers

Definition at line 362 of file ksz8851snl.h.

#define MIB_RxMulticast   0x0C

# of received multicast packets

Definition at line 369 of file ksz8851snl.h.

#define MIB_RxOversize   0x04

# of received oversized packets

Definition at line 361 of file ksz8851snl.h.

#define MIB_RxPausePkts   0x0A

# of received pause packets

Definition at line 367 of file ksz8851snl.h.

#define MIB_RxSynbolError   0x06

# of received error symbols

Definition at line 363 of file ksz8851snl.h.

#define MIB_RxUndersizePkt   0x02

# of received undersized packets

Definition at line 359 of file ksz8851snl.h.

#define MIB_RxUnicast   0x0D

# of received unicast packets

Definition at line 370 of file ksz8851snl.h.

#define MIB_TxBroadcastPkts   0x18

# of transmitted broadcast packets

Definition at line 381 of file ksz8851snl.h.

#define MIB_TxByte   0x15

# of transmitted bytes

Definition at line 378 of file ksz8851snl.h.

#define MIB_TxDeferred   0x1B

# of transmitted deferred packets

Definition at line 384 of file ksz8851snl.h.

#define MIB_TxExcessiveCollision   0x1D

# of transmitted excessive collisions

Definition at line 386 of file ksz8851snl.h.

#define MIB_TxLateCollision   0x16

# of transmitted late collision packets

Definition at line 379 of file ksz8851snl.h.

#define MIB_TxMulticastPkts   0x19

# of transmitted multicast packets

Definition at line 382 of file ksz8851snl.h.

#define MIB_TxMultipleCollision   0x1F

# of transmitted multiple collisions

Definition at line 388 of file ksz8851snl.h.

#define MIB_TxPausePkts   0x17

# of transmitted pause packets

Definition at line 380 of file ksz8851snl.h.

#define MIB_TxSingleCollision   0x1E

# of transmitted single collisions

Definition at line 387 of file ksz8851snl.h.

#define MIB_TxTotalCollision   0x1C

# of transmitted total collisions

Definition at line 385 of file ksz8851snl.h.

#define MIB_TxUnicastPkts   0x1A

# of transmitted unicast packets

Definition at line 383 of file ksz8851snl.h.

#define MIB_XXX   0x01

MIB Reserved byte.

Definition at line 358 of file ksz8851snl.h.

#define MID_QMU_MAC_H   0x5E

3rd segment of the MAC address

Definition at line 126 of file ksz8851snl.h.

Referenced by KSZ8851SNL_GetMacAddress().

#define MID_QMU_MAC_L   0x00

4th segment of the MAC address

Definition at line 127 of file ksz8851snl.h.

#define MID_QMU_MAC_REG   0x12

MAC Address Middle.

Definition at line 73 of file ksz8851snl.h.

#define MSB_POS   0x0008

Used to mark the MSB pos.

Definition at line 116 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init(), KSZ8851SNL_InitiateLongTransmit(), KSZ8851SNL_Receive(), and KSZ8851SNL_Send().

#define NO_INT   0x0000

Used to disable the interupts.

Definition at line 107 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CheckIrqStat(), KSZ8851SNL_ExceptionHandler(), KSZ8851SNL_InitiateLongTransmit(), and KSZ8851SNL_Send().

#define OBC_REG   0x20

On-Chip Bus Control Register.

Definition at line 75 of file ksz8851snl.h.

#define ONE_FRAME_THRES   0x0001

RX INT after one frame.

Definition at line 104 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define PHY1_CTRL_REG   0xE4

PHY1 MII-Register Basic Control Register.

Definition at line 98 of file ksz8851snl.h.

#define PHY_RESET   0x0001

PHY Reset Register Options.

Definition at line 341 of file ksz8851snl.h.

#define PHY_RST_REG   0xD8

PHY Reset Register.

Definition at line 97 of file ksz8851snl.h.

#define PORT1_AUTO_MDIX_DISABLE   0x0400

Disable auto MDI/MDI-X.

Definition at line 280 of file ksz8851snl.h.

#define PORT1_AUTO_NEG_100BTX   0x0004

Advertise 100BT half-duplex capability.

Definition at line 294 of file ksz8851snl.h.

#define PORT1_AUTO_NEG_100BTX_FD   0x0008

Advertise 100BT full-duplex capability.

Definition at line 292 of file ksz8851snl.h.

#define PORT1_AUTO_NEG_10BT   0x0001

Advertise 10BT half-duplex capability.

Definition at line 298 of file ksz8851snl.h.

#define PORT1_AUTO_NEG_10BT_FD   0x0002

Advertise 10BT full-duplex capability.

Definition at line 296 of file ksz8851snl.h.

#define PORT1_AUTO_NEG_ENABLE   0x0080

Enable auto-negotiation.

Definition at line 284 of file ksz8851snl.h.

#define PORT1_AUTO_NEG_RESTART   0x2000

Restart auto-negotiation.

Definition at line 276 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define PORT1_AUTO_NEG_SYM_PAUSE   0x0010

Advertise flow control capability.

Definition at line 290 of file ksz8851snl.h.

#define PORT1_CTRL_REG   0xF6

Port 1 Control Register.

Definition at line 99 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define PORT1_FORCE_100_MBIT   0x0040

Force PHY 100Mbps.

Definition at line 286 of file ksz8851snl.h.

#define PORT1_FORCE_FULL_DUPLEX   0x0020

Force PHY in full duplex mode.

Definition at line 288 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define PORT1_FORCE_MDIX   0x0200

Force MDI-X.

Definition at line 282 of file ksz8851snl.h.

#define PORT1_LED_OFF   0x8000

Turn off port LEDs.

Definition at line 272 of file ksz8851snl.h.

#define PORT1_POWER_DOWN   0x0800

Set port power-down.

Definition at line 278 of file ksz8851snl.h.

#define PORT1_TX_DISABLE   0x4000

Disable port transmit.

Definition at line 274 of file ksz8851snl.h.

#define QMU_MODULE_SOFT_RESET   0x0002

QMU Reset.

Definition at line 336 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define RECEIVE_VALID_FRAME_MASK   0x3C17

CRC OK for ICMP, IP, TCP, UDP; / MII error; / Frame too long error.

Definition at line 110 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Receive().

#define RECEIVED_FRAME_VALID_POS   0x0010

Received valid frame byte pos.

Definition at line 113 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Receive().

#define RESTART_AUTO_NEG   0x0200

Restart auto negotiation.

Definition at line 351 of file ksz8851snl.h.

#define RX_BYTE_CNT_MASK   0x0FFF

Used to mask the reserved bits.

Definition at line 114 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CurrFrameSize(), and KSZ8851SNL_Receive().

#define RX_FD_PTR_REG   0x86

RX Frame Data Pointer Register.

Definition at line 86 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init(), and KSZ8851SNL_Receive().

#define RX_FLOW_CTRL1_EXAMPLE
#define RX_FLOW_CTRL1_REG   0x74

Receive Flow Control Register 1.

Definition at line 78 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define RX_FLOW_CTRL2_EXAMPLE
Value:

RX FLOW CONTROL2 Initialization collection.

Definition at line 238 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define RX_FLOW_CTRL2_REG   0x76

Receive Flow Control Register 2.

Definition at line 79 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define RX_FLOW_CTRL_ALL_MULTICAST   0x0040

Enable Receive Multicast frames.

Definition at line 192 of file ksz8851snl.h.

#define RX_FLOW_CTRL_BAD_PACKET   0x0200

Enable Receive Error Frames.

Definition at line 186 of file ksz8851snl.h.

#define RX_FLOW_CTRL_BLOCK_MAC   0x0001

Receive Source Address Filtering.

Definition at line 235 of file ksz8851snl.h.

#define RX_FLOW_CTRL_BROADCAST   0x0080

Enable Receive Broadcast frames.

Definition at line 190 of file ksz8851snl.h.

#define RX_FLOW_CTRL_BURST_LEN_16   0x0040

16 Bytes length

Definition at line 221 of file ksz8851snl.h.

#define RX_FLOW_CTRL_BURST_LEN_32   0x0060

32 Bytes length

Definition at line 223 of file ksz8851snl.h.

#define RX_FLOW_CTRL_BURST_LEN_4   0x0000

4 bytes length

Definition at line 217 of file ksz8851snl.h.

#define RX_FLOW_CTRL_BURST_LEN_8   0x0020

8 Bytes length

Definition at line 219 of file ksz8851snl.h.

#define RX_FLOW_CTRL_BURST_LEN_FRAME   0x0080

Full frame length.

Definition at line 225 of file ksz8851snl.h.

#define RX_FLOW_CTRL_BURST_LEN_MASK   0x00E0

Receive Flow Control Burst Length mask.

Definition at line 215 of file ksz8851snl.h.

#define RX_FLOW_CTRL_ENABLE   0x0001

Enable receive.

Definition at line 200 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define RX_FLOW_CTRL_FLOW_ENABLE   0x0400

Enable Receive Flow Control.

Definition at line 184 of file ksz8851snl.h.

#define RX_FLOW_CTRL_FLUSH_QUEUE   0x8000

Flush Receive Queue.

Definition at line 174 of file ksz8851snl.h.

#define RX_FLOW_CTRL_ICMP_CHECKSUM   0x0002

Enable ICMP frame.

Definition at line 233 of file ksz8851snl.h.

#define RX_FLOW_CTRL_INVERSE_FILTER   0x0002

Receive Inverse Filtering.

Definition at line 198 of file ksz8851snl.h.

#define RX_FLOW_CTRL_IP_CHECKSUM   0x1000

Enable Receive IP Frame Checksum Check.

Definition at line 180 of file ksz8851snl.h.

#define RX_FLOW_CTRL_IPV6_UDP_FRAG_PASS   0x0010

IPV4/IPV6/UDP Fragment Frame Pass.

Definition at line 227 of file ksz8851snl.h.

#define RX_FLOW_CTRL_IPV6_UDP_ZERO_PASS   0x0008

IPV4/IPV6/UDP Frame Checksum Equal Zero.

Definition at line 229 of file ksz8851snl.h.

#define RX_FLOW_CTRL_MAC_FILTER   0x0800

Receive Physical Address Filtering with MAC Address Enable.

Definition at line 182 of file ksz8851snl.h.

#define RX_FLOW_CTRL_MULTICAST   0x0100

Receive Multicast Address Filtering with MAC Address Enable.

Definition at line 188 of file ksz8851snl.h.

#define RX_FLOW_CTRL_PROMISCUOUS   0x0012

Receive all incoming frames.

Definition at line 196 of file ksz8851snl.h.

#define RX_FLOW_CTRL_TCP_CHECKSUM   0x2000

Enable Receive TCP Frame Checksum Check.

Definition at line 178 of file ksz8851snl.h.

#define RX_FLOW_CTRL_UDP_CHECKSUM   0x4000

Enable Receive UDP Frame Checksum Check.

Definition at line 176 of file ksz8851snl.h.

#define RX_FLOW_CTRL_UDP_LITE_CHECKSUM   0x0004

Enable UDP Lite frame.

Definition at line 231 of file ksz8851snl.h.

#define RX_FLOW_CTRL_UNICAST   0x0020

Enable Receive Unicast frames.

Definition at line 194 of file ksz8851snl.h.

#define RX_FRAME_THRES_REG   0x9C

RX Frame Count & Threshold Register.

Definition at line 89 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init(), and KSZ8851SNL_Receive().

#define RX_FRH_BC_REG   0x7E

Receive Frame Header Bytecount Register.

Definition at line 82 of file ksz8851snl.h.

Referenced by KSZ8851SNL_CurrFrameSize(), and KSZ8851SNL_Receive().

#define RX_FRH_STAT_REG   0x7C

Receive Frame Header Status Register.

Definition at line 81 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Receive().

#define RXQ_AUTO_DEQUEUE   0x0010

Enable Auto Dequeue RXQ Frame.

Definition at line 259 of file ksz8851snl.h.

#define RXQ_CMD_EXAMPLE
Value:

RX COMMAND Initialization collection.

Definition at line 266 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define RXQ_CMD_REG   0x82
#define RXQ_EN_ON_BYTE_CNT_INT   0x0040

Enable RX interrupt on byte count threshold.

Definition at line 255 of file ksz8851snl.h.

#define RXQ_EN_ON_FRAME_CNT_INT   0x0020

Enable RX interrupt on frame count threshold.

Definition at line 257 of file ksz8851snl.h.

#define RXQ_EN_ON_TIME_INT   0x0080

Enable RX interrupt on timer duration.

Definition at line 253 of file ksz8851snl.h.

#define RXQ_ON_BYTE_CNT_INT   0x0800

RX interrupt is occured on byte count threshold.

Definition at line 247 of file ksz8851snl.h.

#define RXQ_ON_FRAME_CNT_INT   0x0400

RX interrupt is occured on frame count threshold.

Definition at line 249 of file ksz8851snl.h.

#define RXQ_ON_TIME_INT   0x1000

RX interrupt is occured on timer duration.

Definition at line 245 of file ksz8851snl.h.

#define RXQ_RELEASE_CUR_FR   0x0001

Release RX Error Frame.

Definition at line 263 of file ksz8851snl.h.

Referenced by KSZ8851SNL_ReleaseIncosistentFrame().

#define RXQ_START   0x0008

Start QMU transfer operation.

Definition at line 261 of file ksz8851snl.h.

Referenced by KSZ8851SNL_InitiateLongTransmit(), KSZ8851SNL_Receive(), KSZ8851SNL_Send(), and KSZ8851SNL_TerminateLongTransmit().

#define RXQ_TWOBYTE_OFFSET   0x0200

Enable adding 2-bytes offset before IP frame header.

Definition at line 251 of file ksz8851snl.h.

#define TX_FD_PTR_REG   0x84

TX Frame Data Pointer Register.

Definition at line 85 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define TX_FLOW_CTRL_CRC_ENABLE   0x0002

Transmit CRC Enable.

Definition at line 150 of file ksz8851snl.h.

#define TX_FLOW_CTRL_ENABLE   0x0001

Enable tranmsit.

Definition at line 152 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define TX_FLOW_CTRL_EXAMPLE
#define TX_FLOW_CTRL_FLOW_ENABLE   0x0008

Transmit flow control enable.

Definition at line 146 of file ksz8851snl.h.

#define TX_FLOW_CTRL_FLUSH_QUEUE   0x0010

Flush Transmit Queue.

Definition at line 144 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define TX_FLOW_CTRL_ICMP_CHECKSUM   0x0100

Enable Transmit Checksum Generation for ICMP.

Definition at line 136 of file ksz8851snl.h.

#define TX_FLOW_CTRL_IP_CHECKSUM   0x0020

Enable Transmit Checksum Generation for IP.

Definition at line 142 of file ksz8851snl.h.

#define TX_FLOW_CTRL_PAD_ENABLE   0x0004

Transmit Padding enable.

Definition at line 148 of file ksz8851snl.h.

#define TX_FLOW_CTRL_REG   0x70

Transmit Flow Control Register.

Definition at line 77 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define TX_FLOW_CTRL_TCP_CHECKSUM   0x0040

Enable Transmit Checksum Generation for TCP.

Definition at line 140 of file ksz8851snl.h.

#define TX_FLOW_CTRL_UDP_CHECKSUM   0x0080

Enable Transmit Checksum Generation for UDP.

Definition at line 138 of file ksz8851snl.h.

#define TX_INT_on_COMPLETION   0x8000

TX INT on completion.

Definition at line 117 of file ksz8851snl.h.

Referenced by KSZ8851SNL_InitiateLongTransmit(), and KSZ8851SNL_Send().

#define TX_MEM_AVAIL_MASK   0x1FFF

Used to mask the reserved bits.

Definition at line 108 of file ksz8851snl.h.

Referenced by KSZ8851SNL_InitiateLongTransmit(), and KSZ8851SNL_Send().

#define TX_MEM_INFO_REG   0x78

TXQ Memory Information Register.

Definition at line 80 of file ksz8851snl.h.

Referenced by KSZ8851SNL_InitiateLongTransmit(), and KSZ8851SNL_Send().

#define TX_NEXT_FRS_REG   0x9E

TX Next Frame size register.

Definition at line 90 of file ksz8851snl.h.

Referenced by KSZ8851SNL_InitiateLongTransmit(), and KSZ8851SNL_Send().

#define TXQ_AUTO_ENQUEUE   0x0004

Enable Auto-Enqueue TXQ Frame.

Definition at line 165 of file ksz8851snl.h.

#define TXQ_CMD_REG   0x80

TXQ Command Register.

Definition at line 83 of file ksz8851snl.h.

Referenced by KSZ8851SNL_InitiateLongTransmit(), KSZ8851SNL_Send(), and KSZ8851SNL_TerminateLongTransmit().

#define TXQ_ENQUEUE   0x0001

Enable Manual Engueue TXQ Frame.

Definition at line 169 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Send(), and KSZ8851SNL_TerminateLongTransmit().

#define TXQ_MEM_AVAILABLE_INT   0x0002

Enable INT generation when TXQ Memory Available.

Definition at line 167 of file ksz8851snl.h.

Referenced by KSZ8851SNL_InitiateLongTransmit(), and KSZ8851SNL_Send().

#define WATERMARK_4KB   0x0400

4KByte Watermark

Definition at line 122 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define WATERMARK_6KB   0x0600

6KByte Watermark

Definition at line 121 of file ksz8851snl.h.

Referenced by KSZ8851SNL_Init().

#define WORD_SIZE   0x0004

Word size in # of bytes.

Definition at line 118 of file ksz8851snl.h.


Enumeration Type Documentation

enumeration used for exception handling

Definition at line 391 of file ksz8851snl.h.


Function Documentation

uint16_t KSZ8851SNL_CheckIrqStat ( void   ) 

Checks for any interrrupts and if found, clears their status and prepair for interrupt handler routines.

Note:
Programmer needs to re-enable the KSZ8851SNL interrupts after calling this function
Returns:
found interrupts

Definition at line 75 of file ksz8851snl.c.

References ETHSPI_ReadRegister(), ETHSPI_WriteRegister(), INT_ENABLE_REG, INT_ENERGY, INT_LINK_CHANGE, INT_LINKUP, INT_MAGIC, INT_RX_DONE, INT_RX_OVERRUN, INT_RX_STOPPED, INT_RX_WOL_FRAME, INT_SPI_ERROR, INT_STATUS_REG, INT_TX_SPACE, INT_TX_STOPPED, and NO_INT.

Here is the call graph for this function:

uint16_t KSZ8851SNL_CurrFrameSize ( void   ) 

Returns the size of the currently received frame.

Returns:
the printed string

Definition at line 195 of file ksz8851snl.c.

References ETHSPI_ReadRegister(), RX_BYTE_CNT_MASK, and RX_FRH_BC_REG.

Here is the call graph for this function:

void KSZ8851SNL_EnableInterupts ( void   ) 

enables the chip interrupts

Definition at line 56 of file ksz8851snl.c.

References ETHSPI_WriteRegister(), INT_ENABLE_REG, and INT_MASK_EXAMPLE.

Here is the call graph for this function:

void KSZ8851SNL_GetMacAddress ( uint8_t *  macAddress  ) 

Get the MAC address of the current board.

Note:
Support method used for minimizing the code size.
Parameters:
[out] macAddress data buffer to store the macAddress

Definition at line 890 of file ksz8851snl.c.

References BYTE_SIZE, HIGH_QMU_MAC_H, HIGH_QMU_MAC_L, and MID_QMU_MAC_H.

Referenced by KSZ8851SNL_Init().

Here is the caller graph for this function:

void KSZ8851SNL_Init ( void   ) 
void KSZ8851SNL_InitiateLongTransmit ( uint16_t  pTXLength  ) 

Performs the initialisation of the transmission of a long raw frame over the network.

Parameters:
pTXLength the length of the transmitted frame

Definition at line 614 of file ksz8851snl.c.

References ETHSPI_ReadRegister(), ETHSPI_StartWriteFIFO(), ETHSPI_WriteFifoContinue(), ETHSPI_WriteRegister(), EXTRA_SIZE, frameId_MASK, INT_ENABLE_REG, INT_STATUS_REG, INT_TX_SPACE, KSZ8851SNL_ExceptionHandler(), LSB_MASK, MSB_POS, NO_INT, RXQ_CMD_REG, RXQ_START, TX_INT_on_COMPLETION, TX_MEM_AVAIL_MASK, TX_MEM_INFO_REG, TX_NEXT_FRS_REG, TXQ_CMD_REG, and TXQ_MEM_AVAILABLE_INT.

Here is the call graph for this function:

void KSZ8851SNL_LongTransmit ( uint16_t  pTXLength,
uint8_t *  pTXData 
)

Performs the actual transmission of a long raw frame over the network.

Parameters:
pTXLength the length of the transmitted frame
pTXData the data of the transmitted frame

Definition at line 681 of file ksz8851snl.c.

References ETHSPI_WriteFifoContinue().

Here is the call graph for this function:

void KSZ8851SNL_ReadMIBCounters ( char *  param  ) 

Dumps the Management Information Base Counters.

Note:
Support method used for debugging.
Parameters:
param the string representing the moment of the register dump

Definition at line 264 of file ksz8851snl.c.

References DEBUG_PRINT, ETHSPI_ReadRegister(), ETHSPI_WriteRegister(), IND_ACC_CTRL_REG, IND_ACC_DATA_HIGH_REG, IND_ACC_DATA_LOW_REG, and MIB_MASK.

Here is the call graph for this function:

uint16_t KSZ8851SNL_Receive ( uint8_t *  pRXData,
uint16_t *  pRXLength 
)

Performs the actual receive of a raw frame over the network.

Parameters:
pRXLength the length of the received frame
pRXData the data of the received frame
Returns:
received packet length, 0 in case of failure

Definition at line 784 of file ksz8851snl.c.

References ETHSPI_ReadFifoContinue(), ETHSPI_ReadRegister(), ETHSPI_StartReadFIFO(), ETHSPI_StopFIFO(), ETHSPI_WriteRegister(), FD_PTR_AUTO_INC, INT_ENABLE_REG, INT_MASK_EXAMPLE, KSZ8851SNL_ReleaseIncosistentFrame(), MSB_POS, RECEIVE_VALID_FRAME_MASK, RECEIVED_FRAME_VALID_POS, RX_BYTE_CNT_MASK, RX_FD_PTR_REG, RX_FRAME_THRES_REG, RX_FRH_BC_REG, RX_FRH_STAT_REG, RXQ_CMD_REG, and RXQ_START.

Here is the call graph for this function:

void KSZ8851SNL_Send ( uint16_t  pTXLength,
uint8_t *  pTXData 
)

Performs the actual transmit of a raw frame over the network.

Parameters:
pTXLength the length of the transmitted frame
pTXData the data of the transmitted frame

Definition at line 515 of file ksz8851snl.c.

References ETHSPI_ReadRegister(), ETHSPI_StartWriteFIFO(), ETHSPI_StopFIFO(), ETHSPI_WriteFifoContinue(), ETHSPI_WriteRegister(), EXTRA_SIZE, frameId_MASK, INT_ENABLE_REG, INT_MASK_EXAMPLE, INT_STATUS_REG, INT_TX_SPACE, KSZ8851SNL_DwordAllignDiff(), KSZ8851SNL_ExceptionHandler(), LSB_MASK, MSB_POS, NO_INT, RXQ_CMD_REG, RXQ_START, TX_INT_on_COMPLETION, TX_MEM_AVAIL_MASK, TX_MEM_INFO_REG, TX_NEXT_FRS_REG, TXQ_CMD_REG, TXQ_ENQUEUE, and TXQ_MEM_AVAILABLE_INT.

Here is the call graph for this function:

void KSZ8851SNL_TerminateLongTransmit ( uint16_t  pTXLength,
uint8_t *  pTXData 
)

Performs the clean up procedures after the transmission of a long raw frame over the network.

Parameters:
pTXLength the length of the transmitted frame
pTXData the data of the transmitted frame

Definition at line 698 of file ksz8851snl.c.

References ETHSPI_ReadRegister(), ETHSPI_StopFIFO(), ETHSPI_WriteFifoContinue(), ETHSPI_WriteRegister(), INT_ENABLE_REG, INT_MASK_EXAMPLE, KSZ8851SNL_DwordAllignDiff(), RXQ_CMD_REG, RXQ_START, TXQ_CMD_REG, and TXQ_ENQUEUE.

Here is the call graph for this function: