iPXE
Data Structures | Macros | Functions | Variables
rhine.h File Reference

VIA Rhine network driver. More...

Go to the source code of this file.

Data Structures

struct  rhine_descriptor
 Rhine descriptor format. More...
 
struct  rhine_ring
 A VIA Rhine descriptor ring. More...
 
struct  rhine_nic
 A VIA Rhine network card. More...
 

Macros

#define RHINE_BAR_SIZE   256
 Rhine BAR size. More...
 
#define RHINE_TIMEOUT_US   10000
 Default timeout. More...
 
#define RHINE_DES0_OWN   (1 << 31) /*< Owned descriptor */
 
#define RHINE_DES1_IC   (1 << 23) /*< Generate interrupt */
 
#define RHINE_TDES1_EDP   (1 << 22) /*< End of packet */
 
#define RHINE_TDES1_STP   (1 << 21) /*< Start of packet */
 
#define RHINE_TDES1_TCPCK   (1 << 20) /*< HW TCP checksum */
 
#define RHINE_TDES1_UDPCK   (1 << 19) /*< HW UDP checksum */
 
#define RHINE_TDES1_IPCK   (1 << 18) /*< HW IP checksum */
 
#define RHINE_TDES1_TAG   (1 << 17) /*< Tagged frame */
 
#define RHINE_TDES1_CRC   (1 << 16) /*< No CRC */
 
#define RHINE_DES1_CHAIN   (1 << 15) /*< Chained descriptor */
 
#define RHINE_DES1_SIZE(_x)   ((_x) & 0x7ff) /*< Frame size */
 
#define RHINE_DES0_GETSIZE(_x)   (((_x) >> 16) & 0x7ff)
 
#define RHINE_RDES0_RXOK   (1 << 15)
 
#define RHINE_RDES0_VIDHIT   (1 << 14)
 
#define RHINE_RDES0_MAR   (1 << 13)
 
#define RHINE_RDES0_BAR   (1 << 12)
 
#define RHINE_RDES0_PHY   (1 << 11)
 
#define RHINE_RDES0_CHN   (1 << 10)
 
#define RHINE_RDES0_STP   (1 << 9)
 
#define RHINE_RDES0_EDP   (1 << 8)
 
#define RHINE_RDES0_BUFF   (1 << 7)
 
#define RHINE_RDES0_FRAG   (1 << 6)
 
#define RHINE_RDES0_RUNT   (1 << 5)
 
#define RHINE_RDES0_LONG   (1 << 4)
 
#define RHINE_RDES0_FOV   (1 << 3)
 
#define RHINE_RDES0_FAE   (1 << 2)
 
#define RHINE_RDES0_CRCE   (1 << 1)
 
#define RHINE_RDES0_RERR   (1 << 0)
 
#define RHINE_TDES0_TERR   (1 << 15)
 
#define RHINE_TDES0_UDF   (1 << 11)
 
#define RHINE_TDES0_CRS   (1 << 10)
 
#define RHINE_TDES0_OWC   (1 << 9)
 
#define RHINE_TDES0_ABT   (1 << 8)
 
#define RHINE_TDES0_CDH   (1 << 7)
 
#define RHINE_TDES0_COLS   (1 << 4)
 
#define RHINE_TDES0_NCR(_x)   ((_x) & 0xf)
 
#define RHINE_RING_ALIGN   4
 
#define RHINE_RXDESC_NUM   4
 Rhine descriptor rings sizes. More...
 
#define RHINE_TXDESC_NUM   8
 
#define RHINE_RX_MAX_LEN   1536
 
#define RHINE_MAC   0x00
 Rhine MAC address registers. More...
 
#define RHINE_RCR   0x06
 Receive control register. More...
 
#define RHINE_RCR_FIFO_TRSH(_x)   (((_x) & 0x7) << 5) /*< RX FIFO threshold */
 
#define RHINE_RCR_PHYS_ACCEPT   (1 << 4) /*< Accept matching PA */
 
#define RHINE_RCR_BCAST_ACCEPT   (1 << 3) /*< Accept broadcast */
 
#define RHINE_RCR_MCAST_ACCEPT   (1 << 2) /*< Accept multicast */
 
#define RHINE_RCR_RUNT_ACCEPT   (1 << 1) /*< Accept runt frames */
 
#define RHINE_RCR_ERR_ACCEPT   (1 << 0) /*< Accept erroneous frames */
 
#define RHINE_TCR   0x07
 Transmit control register. More...
 
#define RHINE_TCR_LOOPBACK(_x)   (((_x) & 0x3) << 1) /*< Transmit loop mode */
 
#define RHINE_TCR_TAGGING   (1 << 0) /*< 802.1P/Q packet tagging */
 
#define RHINE_CR0   0x08
 Command 0 register. More...
 
#define RHINE_CR0_RXSTART   (1 << 6)
 
#define RHINE_CR0_TXSTART   (1 << 5)
 
#define RHINE_CR0_TXEN   (1 << 4) /*< Transmit enable */
 
#define RHINE_CR0_RXEN   (1 << 3) /*< Receive enable */
 
#define RHINE_CR0_STOPNIC   (1 << 2) /*< Stop NIC */
 
#define RHINE_CR0_STARTNIC   (1 << 1) /*< Start NIC */
 
#define RHINE_CR1   0x09
 Command 1 register. More...
 
#define RHINE_CR1_RESET   (1 << 7) /*< Software reset */
 
#define RHINE_CR1_RXPOLL   (1 << 6) /*< Receive poll demand */
 
#define RHINE_CR1_TXPOLL   (1 << 5) /*< Xmit poll demand */
 
#define RHINE_CR1_AUTOPOLL   (1 << 3) /*< Disable autopoll */
 
#define RHINE_CR1_FDX   (1 << 2) /*< Full duplex */
 
#define RIHNE_CR1_ACCUNI   (1 << 1) /*< Disable accept unicast */
 
#define RHINE_TXQUEUE_WAKE   0x0a
 Transmit queue wake register. More...
 
#define RHINE_ISR0   0x0c
 Interrupt service 0. More...
 
#define RHINE_ISR0_MIBOVFL   (1 << 7)
 
#define RHINE_ISR0_PCIERR   (1 << 6)
 
#define RHINE_ISR0_RXRINGERR   (1 << 5)
 
#define RHINE_ISR0_TXRINGERR   (1 << 4)
 
#define RHINE_ISR0_TXERR   (1 << 3)
 
#define RHINE_ISR0_RXERR   (1 << 2)
 
#define RHINE_ISR0_TXDONE   (1 << 1)
 
#define RHINE_ISR0_RXDONE   (1 << 0)
 
#define RHINE_ISR1   0x0d
 Interrupt service 1. More...
 
#define RHINE_ISR1_GPI   (1 << 7)
 
#define RHINE_ISR1_PORTSTATE   (1 << 6)
 
#define RHINE_ISR1_TXABORT   (1 << 5)
 
#define RHINE_ISR1_RXNOBUF   (1 << 4)
 
#define RHINE_ISR1_RXFIFOOVFL   (1 << 3)
 
#define RHINE_ISR1_RXFIFOUNFL   (1 << 2)
 
#define RHINE_ISR1_TXFIFOUNFL   (1 << 1)
 
#define RHINE_ISR1_EARLYRX   (1 << 0)
 
#define RHINE_IMR0   0x0e
 Interrupt enable mask register 0. More...
 
#define RHINE_IMR1   0x0f
 Interrupt enable mask register 1. More...
 
#define RHINE_RXQUEUE_BASE   0x18
 RX queue descriptor base address. More...
 
#define RHINE_TXQUEUE_BASE   0x1c
 TX queue 0 descriptor base address. More...
 
#define RHINE_MII_CFG   0x6c
 MII configuration. More...
 
#define RHINE_MII_SR   0x6d
 MII status register. More...
 
#define RHINE_MII_SR_PHYRST   (1 << 7) /*< PHY reset */
 
#define RHINE_MII_SR_LINKNWAY   (1 << 4) /*< Link status after N-Way */
 
#define RHINE_MII_SR_PHYERR   (1 << 3) /*< PHY device error */
 
#define RHINE_MII_SR_DUPLEX   (1 << 2) /*< Duplex mode after N-Way */
 
#define RHINE_MII_SR_LINKPOLL   (1 << 1) /*< Link status after poll */
 
#define RHINE_MII_SR_LINKSPD   (1 << 0) /*< Link speed after N-Way */
 
#define RHINE_MII_BCR0   0x6e
 MII bus control 0 register. More...
 
#define RHINE_MII_BCR1   0x6f
 MII bus control 1 register. More...
 
#define RHINE_MII_CR   0x70
 MII control register. More...
 
#define RHINE_MII_CR_AUTOPOLL   (1 << 7) /*< MII auto polling */
 
#define RHINE_MII_CR_RDEN   (1 << 6) /*< PHY read enable */
 
#define RHINE_MII_CR_WREN   (1 << 5) /*< PHY write enable */
 
#define RHINE_MII_CR_DIRECT   (1 << 4) /*< Direct programming mode */
 
#define RHINE_MII_CR_MDIOOUT   (1 << 3) /*< MDIO output enable */
 
#define RHINE_MII_ADDR   0x71
 MII port address. More...
 
#define RHINE_MII_ADDR_MSRCEN   (1 << 6)
 
#define RHINE_MII_ADDR_MDONE   (1 << 5)
 
#define RHINE_MII_RDWR   0x72
 MII read/write data. More...
 
#define RHINE_EEPROM_CTRL   0x74
 EERPOM control/status register. More...
 
#define RHINE_EEPROM_CTRL_STATUS   (1 << 7) /*< EEPROM status */
 
#define RHINE_EEPROM_CTRL_RELOAD   (1 << 5) /*< EEPROM reload */
 
#define RHINE_CHIPCFG_A   0x78
 Chip configuration A. More...
 
#define RHINE_CHIPCFG_A_MMIO   (1 << 5)
 
#define RHINE_CHIPCFG_B   0x79
 Chip configuration B. More...
 
#define RHINE_CHIPCFG_C   0x7a
 Chip configuation C. More...
 
#define RHINE_CHIPCFG_D   0x7b
 Chip configuration D. More...
 
#define RHINE_CHIPCFG_D_MMIO   (1 << 7)
 
#define RHINE_REVISION_OLD   0x20
 

Functions

 FILE_LICENCE (GPL2_OR_LATER)
 
struct rhine_descriptor __attribute__ ((packed))
 
static __attribute__ ((always_inline)) void rhine_init_ring(struct rhine_ring *ring
 Initialise descriptor ring. More...
 

Variables

uint32_t des0
 
uint32_t des1
 
uint32_t buffer
 
uint32_t next
 
struct rhine_ring __attribute__
 
static unsigned int count
 
static unsigned int unsigned int reg
 

Detailed Description

VIA Rhine network driver.

Definition in file rhine.h.

Macro Definition Documentation

◆ RHINE_BAR_SIZE

#define RHINE_BAR_SIZE   256

Rhine BAR size.

Definition at line 13 of file rhine.h.

◆ RHINE_TIMEOUT_US

#define RHINE_TIMEOUT_US   10000

Default timeout.

Definition at line 16 of file rhine.h.

◆ RHINE_DES0_OWN

#define RHINE_DES0_OWN   (1 << 31) /*< Owned descriptor */

Definition at line 26 of file rhine.h.

◆ RHINE_DES1_IC

#define RHINE_DES1_IC   (1 << 23) /*< Generate interrupt */

Definition at line 27 of file rhine.h.

◆ RHINE_TDES1_EDP

#define RHINE_TDES1_EDP   (1 << 22) /*< End of packet */

Definition at line 28 of file rhine.h.

◆ RHINE_TDES1_STP

#define RHINE_TDES1_STP   (1 << 21) /*< Start of packet */

Definition at line 29 of file rhine.h.

◆ RHINE_TDES1_TCPCK

#define RHINE_TDES1_TCPCK   (1 << 20) /*< HW TCP checksum */

Definition at line 30 of file rhine.h.

◆ RHINE_TDES1_UDPCK

#define RHINE_TDES1_UDPCK   (1 << 19) /*< HW UDP checksum */

Definition at line 31 of file rhine.h.

◆ RHINE_TDES1_IPCK

#define RHINE_TDES1_IPCK   (1 << 18) /*< HW IP checksum */

Definition at line 32 of file rhine.h.

◆ RHINE_TDES1_TAG

#define RHINE_TDES1_TAG   (1 << 17) /*< Tagged frame */

Definition at line 33 of file rhine.h.

◆ RHINE_TDES1_CRC

#define RHINE_TDES1_CRC   (1 << 16) /*< No CRC */

Definition at line 34 of file rhine.h.

◆ RHINE_DES1_CHAIN

#define RHINE_DES1_CHAIN   (1 << 15) /*< Chained descriptor */

Definition at line 35 of file rhine.h.

◆ RHINE_DES1_SIZE

#define RHINE_DES1_SIZE (   _x)    ((_x) & 0x7ff) /*< Frame size */

Definition at line 36 of file rhine.h.

◆ RHINE_DES0_GETSIZE

#define RHINE_DES0_GETSIZE (   _x)    (((_x) >> 16) & 0x7ff)

Definition at line 37 of file rhine.h.

◆ RHINE_RDES0_RXOK

#define RHINE_RDES0_RXOK   (1 << 15)

Definition at line 39 of file rhine.h.

◆ RHINE_RDES0_VIDHIT

#define RHINE_RDES0_VIDHIT   (1 << 14)

Definition at line 40 of file rhine.h.

◆ RHINE_RDES0_MAR

#define RHINE_RDES0_MAR   (1 << 13)

Definition at line 41 of file rhine.h.

◆ RHINE_RDES0_BAR

#define RHINE_RDES0_BAR   (1 << 12)

Definition at line 42 of file rhine.h.

◆ RHINE_RDES0_PHY

#define RHINE_RDES0_PHY   (1 << 11)

Definition at line 43 of file rhine.h.

◆ RHINE_RDES0_CHN

#define RHINE_RDES0_CHN   (1 << 10)

Definition at line 44 of file rhine.h.

◆ RHINE_RDES0_STP

#define RHINE_RDES0_STP   (1 << 9)

Definition at line 45 of file rhine.h.

◆ RHINE_RDES0_EDP

#define RHINE_RDES0_EDP   (1 << 8)

Definition at line 46 of file rhine.h.

◆ RHINE_RDES0_BUFF

#define RHINE_RDES0_BUFF   (1 << 7)

Definition at line 47 of file rhine.h.

◆ RHINE_RDES0_FRAG

#define RHINE_RDES0_FRAG   (1 << 6)

Definition at line 48 of file rhine.h.

◆ RHINE_RDES0_RUNT

#define RHINE_RDES0_RUNT   (1 << 5)

Definition at line 49 of file rhine.h.

◆ RHINE_RDES0_LONG

#define RHINE_RDES0_LONG   (1 << 4)

Definition at line 50 of file rhine.h.

◆ RHINE_RDES0_FOV

#define RHINE_RDES0_FOV   (1 << 3)

Definition at line 51 of file rhine.h.

◆ RHINE_RDES0_FAE

#define RHINE_RDES0_FAE   (1 << 2)

Definition at line 52 of file rhine.h.

◆ RHINE_RDES0_CRCE

#define RHINE_RDES0_CRCE   (1 << 1)

Definition at line 53 of file rhine.h.

◆ RHINE_RDES0_RERR

#define RHINE_RDES0_RERR   (1 << 0)

Definition at line 54 of file rhine.h.

◆ RHINE_TDES0_TERR

#define RHINE_TDES0_TERR   (1 << 15)

Definition at line 56 of file rhine.h.

◆ RHINE_TDES0_UDF

#define RHINE_TDES0_UDF   (1 << 11)

Definition at line 57 of file rhine.h.

◆ RHINE_TDES0_CRS

#define RHINE_TDES0_CRS   (1 << 10)

Definition at line 58 of file rhine.h.

◆ RHINE_TDES0_OWC

#define RHINE_TDES0_OWC   (1 << 9)

Definition at line 59 of file rhine.h.

◆ RHINE_TDES0_ABT

#define RHINE_TDES0_ABT   (1 << 8)

Definition at line 60 of file rhine.h.

◆ RHINE_TDES0_CDH

#define RHINE_TDES0_CDH   (1 << 7)

Definition at line 61 of file rhine.h.

◆ RHINE_TDES0_COLS

#define RHINE_TDES0_COLS   (1 << 4)

Definition at line 62 of file rhine.h.

◆ RHINE_TDES0_NCR

#define RHINE_TDES0_NCR (   _x)    ((_x) & 0xf)

Definition at line 63 of file rhine.h.

◆ RHINE_RING_ALIGN

#define RHINE_RING_ALIGN   4

Definition at line 65 of file rhine.h.

◆ RHINE_RXDESC_NUM

#define RHINE_RXDESC_NUM   4

Rhine descriptor rings sizes.

Definition at line 68 of file rhine.h.

◆ RHINE_TXDESC_NUM

#define RHINE_TXDESC_NUM   8

Definition at line 69 of file rhine.h.

◆ RHINE_RX_MAX_LEN

#define RHINE_RX_MAX_LEN   1536

Definition at line 70 of file rhine.h.

◆ RHINE_MAC

#define RHINE_MAC   0x00

Rhine MAC address registers.

Definition at line 73 of file rhine.h.

◆ RHINE_RCR

#define RHINE_RCR   0x06

Receive control register.

Definition at line 76 of file rhine.h.

◆ RHINE_RCR_FIFO_TRSH

#define RHINE_RCR_FIFO_TRSH (   _x)    (((_x) & 0x7) << 5) /*< RX FIFO threshold */

Definition at line 77 of file rhine.h.

◆ RHINE_RCR_PHYS_ACCEPT

#define RHINE_RCR_PHYS_ACCEPT   (1 << 4) /*< Accept matching PA */

Definition at line 78 of file rhine.h.

◆ RHINE_RCR_BCAST_ACCEPT

#define RHINE_RCR_BCAST_ACCEPT   (1 << 3) /*< Accept broadcast */

Definition at line 79 of file rhine.h.

◆ RHINE_RCR_MCAST_ACCEPT

#define RHINE_RCR_MCAST_ACCEPT   (1 << 2) /*< Accept multicast */

Definition at line 80 of file rhine.h.

◆ RHINE_RCR_RUNT_ACCEPT

#define RHINE_RCR_RUNT_ACCEPT   (1 << 1) /*< Accept runt frames */

Definition at line 81 of file rhine.h.

◆ RHINE_RCR_ERR_ACCEPT

#define RHINE_RCR_ERR_ACCEPT   (1 << 0) /*< Accept erroneous frames */

Definition at line 82 of file rhine.h.

◆ RHINE_TCR

#define RHINE_TCR   0x07

Transmit control register.

Definition at line 85 of file rhine.h.

◆ RHINE_TCR_LOOPBACK

#define RHINE_TCR_LOOPBACK (   _x)    (((_x) & 0x3) << 1) /*< Transmit loop mode */

Definition at line 86 of file rhine.h.

◆ RHINE_TCR_TAGGING

#define RHINE_TCR_TAGGING   (1 << 0) /*< 802.1P/Q packet tagging */

Definition at line 87 of file rhine.h.

◆ RHINE_CR0

#define RHINE_CR0   0x08

Command 0 register.

Definition at line 90 of file rhine.h.

◆ RHINE_CR0_RXSTART

#define RHINE_CR0_RXSTART   (1 << 6)

Definition at line 91 of file rhine.h.

◆ RHINE_CR0_TXSTART

#define RHINE_CR0_TXSTART   (1 << 5)

Definition at line 92 of file rhine.h.

◆ RHINE_CR0_TXEN

#define RHINE_CR0_TXEN   (1 << 4) /*< Transmit enable */

Definition at line 93 of file rhine.h.

◆ RHINE_CR0_RXEN

#define RHINE_CR0_RXEN   (1 << 3) /*< Receive enable */

Definition at line 94 of file rhine.h.

◆ RHINE_CR0_STOPNIC

#define RHINE_CR0_STOPNIC   (1 << 2) /*< Stop NIC */

Definition at line 95 of file rhine.h.

◆ RHINE_CR0_STARTNIC

#define RHINE_CR0_STARTNIC   (1 << 1) /*< Start NIC */

Definition at line 96 of file rhine.h.

◆ RHINE_CR1

#define RHINE_CR1   0x09

Command 1 register.

Definition at line 99 of file rhine.h.

◆ RHINE_CR1_RESET

#define RHINE_CR1_RESET   (1 << 7) /*< Software reset */

Definition at line 100 of file rhine.h.

◆ RHINE_CR1_RXPOLL

#define RHINE_CR1_RXPOLL   (1 << 6) /*< Receive poll demand */

Definition at line 101 of file rhine.h.

◆ RHINE_CR1_TXPOLL

#define RHINE_CR1_TXPOLL   (1 << 5) /*< Xmit poll demand */

Definition at line 102 of file rhine.h.

◆ RHINE_CR1_AUTOPOLL

#define RHINE_CR1_AUTOPOLL   (1 << 3) /*< Disable autopoll */

Definition at line 103 of file rhine.h.

◆ RHINE_CR1_FDX

#define RHINE_CR1_FDX   (1 << 2) /*< Full duplex */

Definition at line 104 of file rhine.h.

◆ RIHNE_CR1_ACCUNI

#define RIHNE_CR1_ACCUNI   (1 << 1) /*< Disable accept unicast */

Definition at line 105 of file rhine.h.

◆ RHINE_TXQUEUE_WAKE

#define RHINE_TXQUEUE_WAKE   0x0a

Transmit queue wake register.

Definition at line 108 of file rhine.h.

◆ RHINE_ISR0

#define RHINE_ISR0   0x0c

Interrupt service 0.

Definition at line 111 of file rhine.h.

◆ RHINE_ISR0_MIBOVFL

#define RHINE_ISR0_MIBOVFL   (1 << 7)

Definition at line 112 of file rhine.h.

◆ RHINE_ISR0_PCIERR

#define RHINE_ISR0_PCIERR   (1 << 6)

Definition at line 113 of file rhine.h.

◆ RHINE_ISR0_RXRINGERR

#define RHINE_ISR0_RXRINGERR   (1 << 5)

Definition at line 114 of file rhine.h.

◆ RHINE_ISR0_TXRINGERR

#define RHINE_ISR0_TXRINGERR   (1 << 4)

Definition at line 115 of file rhine.h.

◆ RHINE_ISR0_TXERR

#define RHINE_ISR0_TXERR   (1 << 3)

Definition at line 116 of file rhine.h.

◆ RHINE_ISR0_RXERR

#define RHINE_ISR0_RXERR   (1 << 2)

Definition at line 117 of file rhine.h.

◆ RHINE_ISR0_TXDONE

#define RHINE_ISR0_TXDONE   (1 << 1)

Definition at line 118 of file rhine.h.

◆ RHINE_ISR0_RXDONE

#define RHINE_ISR0_RXDONE   (1 << 0)

Definition at line 119 of file rhine.h.

◆ RHINE_ISR1

#define RHINE_ISR1   0x0d

Interrupt service 1.

Definition at line 122 of file rhine.h.

◆ RHINE_ISR1_GPI

#define RHINE_ISR1_GPI   (1 << 7)

Definition at line 123 of file rhine.h.

◆ RHINE_ISR1_PORTSTATE

#define RHINE_ISR1_PORTSTATE   (1 << 6)

Definition at line 124 of file rhine.h.

◆ RHINE_ISR1_TXABORT

#define RHINE_ISR1_TXABORT   (1 << 5)

Definition at line 125 of file rhine.h.

◆ RHINE_ISR1_RXNOBUF

#define RHINE_ISR1_RXNOBUF   (1 << 4)

Definition at line 126 of file rhine.h.

◆ RHINE_ISR1_RXFIFOOVFL

#define RHINE_ISR1_RXFIFOOVFL   (1 << 3)

Definition at line 127 of file rhine.h.

◆ RHINE_ISR1_RXFIFOUNFL

#define RHINE_ISR1_RXFIFOUNFL   (1 << 2)

Definition at line 128 of file rhine.h.

◆ RHINE_ISR1_TXFIFOUNFL

#define RHINE_ISR1_TXFIFOUNFL   (1 << 1)

Definition at line 129 of file rhine.h.

◆ RHINE_ISR1_EARLYRX

#define RHINE_ISR1_EARLYRX   (1 << 0)

Definition at line 130 of file rhine.h.

◆ RHINE_IMR0

#define RHINE_IMR0   0x0e

Interrupt enable mask register 0.

Definition at line 133 of file rhine.h.

◆ RHINE_IMR1

#define RHINE_IMR1   0x0f

Interrupt enable mask register 1.

Definition at line 136 of file rhine.h.

◆ RHINE_RXQUEUE_BASE

#define RHINE_RXQUEUE_BASE   0x18

RX queue descriptor base address.

Definition at line 139 of file rhine.h.

◆ RHINE_TXQUEUE_BASE

#define RHINE_TXQUEUE_BASE   0x1c

TX queue 0 descriptor base address.

Definition at line 142 of file rhine.h.

◆ RHINE_MII_CFG

#define RHINE_MII_CFG   0x6c

MII configuration.

Definition at line 145 of file rhine.h.

◆ RHINE_MII_SR

#define RHINE_MII_SR   0x6d

MII status register.

Definition at line 148 of file rhine.h.

◆ RHINE_MII_SR_PHYRST

#define RHINE_MII_SR_PHYRST   (1 << 7) /*< PHY reset */

Definition at line 149 of file rhine.h.

◆ RHINE_MII_SR_LINKNWAY

#define RHINE_MII_SR_LINKNWAY   (1 << 4) /*< Link status after N-Way */

Definition at line 150 of file rhine.h.

◆ RHINE_MII_SR_PHYERR

#define RHINE_MII_SR_PHYERR   (1 << 3) /*< PHY device error */

Definition at line 151 of file rhine.h.

◆ RHINE_MII_SR_DUPLEX

#define RHINE_MII_SR_DUPLEX   (1 << 2) /*< Duplex mode after N-Way */

Definition at line 152 of file rhine.h.

◆ RHINE_MII_SR_LINKPOLL

#define RHINE_MII_SR_LINKPOLL   (1 << 1) /*< Link status after poll */

Definition at line 153 of file rhine.h.

◆ RHINE_MII_SR_LINKSPD

#define RHINE_MII_SR_LINKSPD   (1 << 0) /*< Link speed after N-Way */

Definition at line 154 of file rhine.h.

◆ RHINE_MII_BCR0

#define RHINE_MII_BCR0   0x6e

MII bus control 0 register.

Definition at line 157 of file rhine.h.

◆ RHINE_MII_BCR1

#define RHINE_MII_BCR1   0x6f

MII bus control 1 register.

Definition at line 160 of file rhine.h.

◆ RHINE_MII_CR

#define RHINE_MII_CR   0x70

MII control register.

Definition at line 163 of file rhine.h.

◆ RHINE_MII_CR_AUTOPOLL

#define RHINE_MII_CR_AUTOPOLL   (1 << 7) /*< MII auto polling */

Definition at line 164 of file rhine.h.

◆ RHINE_MII_CR_RDEN

#define RHINE_MII_CR_RDEN   (1 << 6) /*< PHY read enable */

Definition at line 165 of file rhine.h.

◆ RHINE_MII_CR_WREN

#define RHINE_MII_CR_WREN   (1 << 5) /*< PHY write enable */

Definition at line 166 of file rhine.h.

◆ RHINE_MII_CR_DIRECT

#define RHINE_MII_CR_DIRECT   (1 << 4) /*< Direct programming mode */

Definition at line 167 of file rhine.h.

◆ RHINE_MII_CR_MDIOOUT

#define RHINE_MII_CR_MDIOOUT   (1 << 3) /*< MDIO output enable */

Definition at line 168 of file rhine.h.

◆ RHINE_MII_ADDR

#define RHINE_MII_ADDR   0x71

MII port address.

Definition at line 171 of file rhine.h.

◆ RHINE_MII_ADDR_MSRCEN

#define RHINE_MII_ADDR_MSRCEN   (1 << 6)

Definition at line 172 of file rhine.h.

◆ RHINE_MII_ADDR_MDONE

#define RHINE_MII_ADDR_MDONE   (1 << 5)

Definition at line 173 of file rhine.h.

◆ RHINE_MII_RDWR

#define RHINE_MII_RDWR   0x72

MII read/write data.

Definition at line 176 of file rhine.h.

◆ RHINE_EEPROM_CTRL

#define RHINE_EEPROM_CTRL   0x74

EERPOM control/status register.

Definition at line 179 of file rhine.h.

◆ RHINE_EEPROM_CTRL_STATUS

#define RHINE_EEPROM_CTRL_STATUS   (1 << 7) /*< EEPROM status */

Definition at line 180 of file rhine.h.

◆ RHINE_EEPROM_CTRL_RELOAD

#define RHINE_EEPROM_CTRL_RELOAD   (1 << 5) /*< EEPROM reload */

Definition at line 181 of file rhine.h.

◆ RHINE_CHIPCFG_A

#define RHINE_CHIPCFG_A   0x78

Chip configuration A.

Definition at line 184 of file rhine.h.

◆ RHINE_CHIPCFG_A_MMIO

#define RHINE_CHIPCFG_A_MMIO   (1 << 5)

Definition at line 186 of file rhine.h.

◆ RHINE_CHIPCFG_B

#define RHINE_CHIPCFG_B   0x79

Chip configuration B.

Definition at line 189 of file rhine.h.

◆ RHINE_CHIPCFG_C

#define RHINE_CHIPCFG_C   0x7a

Chip configuation C.

Definition at line 192 of file rhine.h.

◆ RHINE_CHIPCFG_D

#define RHINE_CHIPCFG_D   0x7b

Chip configuration D.

Definition at line 195 of file rhine.h.

◆ RHINE_CHIPCFG_D_MMIO

#define RHINE_CHIPCFG_D_MMIO   (1 << 7)

Definition at line 197 of file rhine.h.

◆ RHINE_REVISION_OLD

#define RHINE_REVISION_OLD   0x20

Definition at line 199 of file rhine.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ __attribute__() [1/2]

struct rhine_descriptor __attribute__ ( (packed)  )

◆ __attribute__() [2/2]

static __attribute__ ( (always_inline)  )
inlinestatic

Initialise descriptor ring.

Parameters
ringDescriptor ring
countNumber of descriptors (must be a power of 2)
regRegister address

Variable Documentation

◆ des0

uint32_t des0

Definition at line 11 of file rhine.h.

Referenced by rhine_poll_rx(), rhine_poll_tx(), and velocity_poll_rx().

◆ des1

uint32_t des1

Definition at line 12 of file rhine.h.

◆ buffer

uint32_t buffer

Definition at line 13 of file rhine.h.

◆ next

uint32_t next

Definition at line 14 of file rhine.h.

◆ __attribute__

◆ count

unsigned int count

Definition at line 224 of file rhine.h.

◆ reg

ring reg
Initial value:
{
ring->count = count
static unsigned int count
Definition: rhine.h:224

Definition at line 225 of file rhine.h.