iPXE
Data Structures | Defines | Enumerations | Functions
realtek.h File Reference

Realtek 10/100/1000 network card driver. More...

#include <ipxe/spi.h>
#include <ipxe/spi_bit.h>
#include <ipxe/nvo.h>
#include <ipxe/if_ether.h>

Go to the source code of this file.

Data Structures

struct  realtek_descriptor
 A packet descriptor. More...
struct  realtek_legacy_header
 A legacy mode receive packet header. More...
struct  realtek_ring
 A Realtek descriptor ring. More...
struct  realtek_nic
 A Realtek network card. More...

Defines

#define RTL_BAR_SIZE   0x100
 PCI memory BAR size.
#define RTL_DESC_SIZE_MASK   0x3fff
 Descriptor buffer size mask.
#define RTL_RING_ALIGN   256
 Descriptor ring alignment.
#define RTL_IDR0   0x00
 ID Register 0 (6 bytes)
#define RTL_MAR0   0x08
 Multicast Register 0 (dword)
#define RTL_MAR4   0x0c
 Multicast Register 4 (dword)
#define RTL_TSD(n)   ( 0x10 + 4 * (n) )
 Transmit Status of Descriptor N (dword, 8139 only)
#define RTL_TSD_ERTXTH(x)   ( (x) << 16 )
 Early TX threshold.
#define RTL_TSD_ERTXTH_DEFAULT   RTL_TSD_ERTXTH ( 256 / 32 )
#define RTL_TSD_OWN   0x00002000UL
 Ownership.
#define RTL_TSAD(n)   ( 0x20 + 4 * (n) )
 Transmit Start Address of Descriptor N (dword, 8139 only)
#define RTL_TNPDS   0x20
 Transmit Normal Priority Descriptors (qword)
#define RTL_NUM_TX_DESC   4
 Number of transmit descriptors.
#define RTL_RBSTART   0x30
 Receive Buffer Start Address (dword, 8139 only)
#define RTL_RXBUF_LEN   8192
 Receive buffer length.
#define RTL_RXBUF_PAD   2038 /* Allow space for WRAP */
 Receive buffer padding.
#define RTL_RXBUF_ALIGN   16
 Receive buffer alignment.
#define RTL_CR   0x37
 Command Register (byte)
#define RTL_CR_RST   0x10
 Reset.
#define RTL_CR_RE   0x08
 Receiver Enable.
#define RTL_CR_TE   0x04
 Transmit Enable.
#define RTL_CR_BUFE   0x01
 Receive buffer empty.
#define RTL_RESET_MAX_WAIT_MS   100
 Maximum time to wait for a reset, in milliseconds.
#define RTL_CAPR   0x38
 Current Address of Packet Read (word, 8139 only)
#define RTL_TPPOLL_8169   0x38
 Transmit Priority Polling Register (byte, 8169 only)
#define RTL_TPPOLL_NPQ   0x40
 Normal Priority Queue Polling.
#define RTL_IMR   0x3c
 Interrupt Mask Register (word)
#define RTL_IRQ_PUN_LINKCHG   0x0020
 Packet underrun / link change.
#define RTL_IRQ_TER   0x0008
 Transmit error.
#define RTL_IRQ_TOK   0x0004
 Transmit OK.
#define RTL_IRQ_RER   0x0002
 Receive error.
#define RTL_IRQ_ROK   0x0001
 Receive OK.
#define RTL_ISR   0x3e
 Interrupt Status Register (word)
#define RTL_TCR   0x40
 Transmit (Tx) Configuration Register (dword)
#define RTL_TCR_MXDMA(x)   ( (x) << 8 )
 Max DMA burst size.
#define RTL_TCR_MXDMA_MASK   RTL_TCR_MXDMA ( 0x7 )
#define RTL_TCR_MXDMA_DEFAULT   RTL_TCR_MXDMA ( 0x7 /* Unlimited */ )
#define RTL_RCR   0x44
 Receive (Rx) Configuration Register (dword)
#define RTL_RCR_STOP_WORKING   0x01000000UL
 Here be dragons.
#define RTL_RCR_RXFTH(x)   ( (x) << 13 )
 Receive FIFO threshold.
#define RTL_RCR_RXFTH_MASK   RTL_RCR_RXFTH ( 0x7 )
#define RTL_RCR_RXFTH_DEFAULT   RTL_RCR_RXFTH ( 0x7 /* Whole packet */ )
#define RTL_RCR_RBLEN(x)   ( (x) << 11 )
 Receive buffer length.
#define RTL_RCR_RBLEN_MASK   RTL_RCR_RBLEN ( 0x3 )
#define RTL_RCR_RBLEN_DEFAULT   RTL_RCR_RBLEN ( 0 /* 8kB */ )
#define RTL_RCR_MXDMA(x)   ( (x) << 8 )
 Max DMA burst size.
#define RTL_RCR_MXDMA_MASK   RTL_RCR_MXDMA ( 0x7 )
#define RTL_RCR_MXDMA_DEFAULT   RTL_RCR_MXDMA ( 0x7 /* Unlimited */ )
#define RTL_RCR_WRAP   0x00000080UL
 Overrun receive buffer.
#define RTL_RCR_9356SEL   0x00000040UL
 EEPROM is a 93C56.
#define RTL_RCR_AB   0x00000008UL
 Accept broadcast packets.
#define RTL_RCR_AM   0x00000004UL
 Accept multicast packets.
#define RTL_RCR_APM   0x00000002UL
 Accept physical match.
#define RTL_RCR_AAP   0x00000001UL
 Accept all packets.
#define RTL_9346CR   0x50
 93C46 (93C56) Command Register (byte)
#define RTL_9346CR_EEM(x)   ( (x) << 6 )
 Mode select.
#define RTL_9346CR_EEM_EEPROM   RTL_9346CR_EEM ( 0x2 )
 EEPROM mode.
#define RTL_9346CR_EEM_NORMAL   RTL_9346CR_EEM ( 0x0 )
 Normal mode.
#define RTL_9346CR_EECS   0x08
 Chip select.
#define RTL_9346CR_EESK   0x04
 Clock.
#define RTL_9346CR_EEDI   0x02
 Data in.
#define RTL_9346CR_EEDO   0x01
 Data out.
#define RTL_EEPROM_ID   ( 0x00 / 2 )
 Word offset of ID code word within EEPROM.
#define RTL_EEPROM_ID_MAGIC   0x8129
 EEPROM code word magic value.
#define RTL_EEPROM_MAC   ( 0x0e / 2 )
 Word offset of MAC address within EEPROM.
#define RTL_EEPROM_VPD   ( 0x40 / 2 )
 Word offset of VPD / non-volatile options within EEPROM.
#define RTL_EEPROM_VPD_LEN   0x40
 Length of VPD / non-volatile options within EEPROM.
#define RTL_CONFIG1   0x52
 Configuration Register 1 (byte)
#define RTL_CONFIG1_VPD   0x02
 Vital Product Data enabled.
#define RTL_MSR   0x58
 Media Status Register (byte, 8139 only)
#define RTL_MSR_TXFCE   0x80
 TX flow control enabled.
#define RTL_MSR_RXFCE   0x40
 RX flow control enabled.
#define RTL_MSR_AUX_STATUS   0x10
 Aux power present.
#define RTL_MSR_SPEED_10   0x08
 10Mbps
#define RTL_MSR_LINKB   0x04
 Inverse of link status.
#define RTL_MSR_TXPF   0x02
 TX pause flag.
#define RTL_MSR_RXPF   0x01
 RX pause flag.
#define RTL_PHYAR   0x60
 PHY Access Register (dword, 8169 only)
#define RTL_PHYAR_FLAG   0x80000000UL
 Read/write flag.
#define RTL_PHYAR_VALUE(flag, reg, data)   ( (flag) | ( (reg) << 16 ) | (data) )
 Construct PHY Access Register value.
#define RTL_PHYAR_DATA(value)   ( (value) & 0xffff )
 Extract PHY Access Register data.
#define RTL_MII_MAX_WAIT_US   500
 Maximum time to wait for PHY access, in microseconds.
#define RTL_PHYSTATUS   0x6c
 PHY (GMII, MII, or TBI) Status Register (byte, 8169 only)
#define RTL_PHYSTATUS_ENTBI   0x80
 TBI / GMII mode.
#define RTL_PHYSTATUS_TXFLOW   0x40
 TX flow control enabled.
#define RTL_PHYSTATUS_RXFLOW   0x20
 RX flow control enabled.
#define RTL_PHYSTATUS_1000MF   0x10
 1000Mbps full-duplex
#define RTL_PHYSTATUS_100M   0x08
 100Mbps
#define RTL_PHYSTATUS_10M   0x04
 10Mbps
#define RTL_PHYSTATUS_LINKSTS   0x02
 Link ok.
#define RTL_PHYSTATUS_FULLDUP   0x01
 Full duplex.
#define RTL_TPPOLL_8139CP   0xd9
 Transmit Priority Polling Register (byte, 8139C+ only)
#define RTL_RMS   0xda
 RX Packet Maximum Size Register (word)
#define RTL_CPCR   0xe0
 C+ Command Register (word)
#define RTL_CPCR_DAC   0x0010
 PCI Dual Address Cycle Enable.
#define RTL_CPCR_MULRW   0x0008
 PCI Multiple Read/Write Enable.
#define RTL_CPCR_CPRX   0x0002
 C+ receive enable.
#define RTL_CPCR_CPTX   0x0001
 C+ transmit enable.
#define RTL_RDSAR   0xe4
 Receive Descriptor Start Address Register (qword)
#define RTL_NUM_RX_DESC   4
 Number of receive descriptors.
#define RTL_RX_MAX_LEN   ( ETH_FRAME_LEN + 4 /* VLAN */ + 4 /* CRC */ + 4 /* extra space */ )
 Receive buffer length.

Enumerations

enum  realtek_descriptor_flags {
  RTL_DESC_OWN = 0x8000, RTL_DESC_EOR = 0x4000, RTL_DESC_FS = 0x2000, RTL_DESC_LS = 0x1000,
  RTL_DESC_RES = 0x0020
}
 Packet descriptor flags. More...
enum  realtek_legacy_status { RTL_STAT_ROK = 0x0001 }
 Legacy mode status bits. More...

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static void realtek_init_ring (struct realtek_ring *ring, unsigned int count, unsigned int reg)
 Initialise descriptor ring.

Detailed Description

Realtek 10/100/1000 network card driver.

Definition in file realtek.h.


Define Documentation

#define RTL_BAR_SIZE   0x100

PCI memory BAR size.

Definition at line 18 of file realtek.h.

Referenced by realtek_probe().

#define RTL_DESC_SIZE_MASK   0x3fff

Descriptor buffer size mask.

Definition at line 33 of file realtek.h.

Referenced by realtek_poll_rx().

#define RTL_RING_ALIGN   256

Descriptor ring alignment.

Definition at line 50 of file realtek.h.

Referenced by realtek_create_ring().

#define RTL_IDR0   0x00

ID Register 0 (6 bytes)

Definition at line 69 of file realtek.h.

Referenced by realtek_probe().

#define RTL_MAR0   0x08

Multicast Register 0 (dword)

Definition at line 72 of file realtek.h.

Referenced by realtek_open().

#define RTL_MAR4   0x0c

Multicast Register 4 (dword)

Definition at line 75 of file realtek.h.

Referenced by realtek_open().

#define RTL_TSD (   n)    ( 0x10 + 4 * (n) )

Transmit Status of Descriptor N (dword, 8139 only)

Definition at line 78 of file realtek.h.

Referenced by realtek_poll_tx(), and realtek_transmit().

#define RTL_TSD_ERTXTH (   x)    ( (x) << 16 )

Early TX threshold.

Definition at line 79 of file realtek.h.

#define RTL_TSD_ERTXTH_DEFAULT   RTL_TSD_ERTXTH ( 256 / 32 )

Definition at line 80 of file realtek.h.

Referenced by realtek_transmit().

#define RTL_TSD_OWN   0x00002000UL

Ownership.

Definition at line 81 of file realtek.h.

Referenced by realtek_poll_tx().

#define RTL_TSAD (   n)    ( 0x20 + 4 * (n) )

Transmit Start Address of Descriptor N (dword, 8139 only)

Definition at line 84 of file realtek.h.

Referenced by realtek_transmit().

#define RTL_TNPDS   0x20

Transmit Normal Priority Descriptors (qword)

Definition at line 87 of file realtek.h.

Referenced by realtek_probe().

#define RTL_NUM_TX_DESC   4

Number of transmit descriptors.

This is a hardware limit when using legacy mode.

Definition at line 93 of file realtek.h.

Referenced by realtek_poll_tx(), realtek_probe(), and realtek_transmit().

#define RTL_RBSTART   0x30

Receive Buffer Start Address (dword, 8139 only)

Definition at line 96 of file realtek.h.

Referenced by realtek_create_buffer(), and realtek_destroy_buffer().

#define RTL_RXBUF_LEN   8192

Receive buffer length.

Definition at line 99 of file realtek.h.

Referenced by realtek_create_buffer(), realtek_destroy_buffer(), and realtek_legacy_poll_rx().

#define RTL_RXBUF_PAD   2038 /* Allow space for WRAP */

Receive buffer padding.

Definition at line 102 of file realtek.h.

Referenced by realtek_create_buffer(), and realtek_destroy_buffer().

#define RTL_RXBUF_ALIGN   16

Receive buffer alignment.

Definition at line 105 of file realtek.h.

Referenced by realtek_create_buffer().

#define RTL_CR   0x37

Command Register (byte)

Definition at line 108 of file realtek.h.

Referenced by realtek_close(), realtek_legacy_poll_rx(), realtek_open(), and realtek_reset().

#define RTL_CR_RST   0x10

Reset.

Definition at line 109 of file realtek.h.

Referenced by realtek_reset().

#define RTL_CR_RE   0x08

Receiver Enable.

Definition at line 110 of file realtek.h.

Referenced by realtek_open().

#define RTL_CR_TE   0x04

Transmit Enable.

Definition at line 111 of file realtek.h.

Referenced by realtek_open().

#define RTL_CR_BUFE   0x01

Receive buffer empty.

Definition at line 112 of file realtek.h.

Referenced by realtek_legacy_poll_rx().

#define RTL_RESET_MAX_WAIT_MS   100

Maximum time to wait for a reset, in milliseconds.

Definition at line 115 of file realtek.h.

Referenced by realtek_reset().

#define RTL_CAPR   0x38

Current Address of Packet Read (word, 8139 only)

Definition at line 118 of file realtek.h.

Referenced by realtek_legacy_poll_rx().

#define RTL_TPPOLL_8169   0x38

Transmit Priority Polling Register (byte, 8169 only)

Definition at line 121 of file realtek.h.

Referenced by realtek_detect().

#define RTL_TPPOLL_NPQ   0x40

Normal Priority Queue Polling.

Definition at line 122 of file realtek.h.

Referenced by realtek_transmit().

#define RTL_IMR   0x3c

Interrupt Mask Register (word)

Definition at line 125 of file realtek.h.

Referenced by realtek_irq().

#define RTL_IRQ_PUN_LINKCHG   0x0020

Packet underrun / link change.

Definition at line 126 of file realtek.h.

Referenced by realtek_irq(), and realtek_poll().

#define RTL_IRQ_TER   0x0008

Transmit error.

Definition at line 127 of file realtek.h.

Referenced by realtek_irq(), and realtek_poll().

#define RTL_IRQ_TOK   0x0004

Transmit OK.

Definition at line 128 of file realtek.h.

Referenced by realtek_irq(), and realtek_poll().

#define RTL_IRQ_RER   0x0002

Receive error.

Definition at line 129 of file realtek.h.

Referenced by realtek_irq(), and realtek_poll().

#define RTL_IRQ_ROK   0x0001

Receive OK.

Definition at line 130 of file realtek.h.

Referenced by realtek_irq(), and realtek_poll().

#define RTL_ISR   0x3e

Interrupt Status Register (word)

Definition at line 133 of file realtek.h.

Referenced by realtek_poll().

#define RTL_TCR   0x40

Transmit (Tx) Configuration Register (dword)

Definition at line 136 of file realtek.h.

Referenced by realtek_open().

#define RTL_TCR_MXDMA (   x)    ( (x) << 8 )

Max DMA burst size.

Definition at line 137 of file realtek.h.

#define RTL_TCR_MXDMA_MASK   RTL_TCR_MXDMA ( 0x7 )

Definition at line 138 of file realtek.h.

Referenced by realtek_open().

#define RTL_TCR_MXDMA_DEFAULT   RTL_TCR_MXDMA ( 0x7 /* Unlimited */ )

Definition at line 139 of file realtek.h.

Referenced by realtek_open().

#define RTL_RCR   0x44

Receive (Rx) Configuration Register (dword)

Definition at line 142 of file realtek.h.

Referenced by realtek_init_eeprom(), and realtek_open().

#define RTL_RCR_STOP_WORKING   0x01000000UL

Here be dragons.

Definition at line 143 of file realtek.h.

Referenced by realtek_open().

#define RTL_RCR_RXFTH (   x)    ( (x) << 13 )

Receive FIFO threshold.

Definition at line 144 of file realtek.h.

#define RTL_RCR_RXFTH_MASK   RTL_RCR_RXFTH ( 0x7 )

Definition at line 145 of file realtek.h.

Referenced by realtek_open().

#define RTL_RCR_RXFTH_DEFAULT   RTL_RCR_RXFTH ( 0x7 /* Whole packet */ )

Definition at line 146 of file realtek.h.

Referenced by realtek_open().

#define RTL_RCR_RBLEN (   x)    ( (x) << 11 )

Receive buffer length.

Definition at line 147 of file realtek.h.

#define RTL_RCR_RBLEN_MASK   RTL_RCR_RBLEN ( 0x3 )

Definition at line 148 of file realtek.h.

Referenced by realtek_open().

#define RTL_RCR_RBLEN_DEFAULT   RTL_RCR_RBLEN ( 0 /* 8kB */ )

Definition at line 149 of file realtek.h.

Referenced by realtek_open().

#define RTL_RCR_MXDMA (   x)    ( (x) << 8 )

Max DMA burst size.

Definition at line 150 of file realtek.h.

#define RTL_RCR_MXDMA_MASK   RTL_RCR_MXDMA ( 0x7 )

Definition at line 151 of file realtek.h.

Referenced by realtek_open().

#define RTL_RCR_MXDMA_DEFAULT   RTL_RCR_MXDMA ( 0x7 /* Unlimited */ )

Definition at line 152 of file realtek.h.

Referenced by realtek_open().

#define RTL_RCR_WRAP   0x00000080UL

Overrun receive buffer.

Definition at line 153 of file realtek.h.

Referenced by realtek_open().

#define RTL_RCR_9356SEL   0x00000040UL

EEPROM is a 93C56.

Definition at line 154 of file realtek.h.

Referenced by realtek_init_eeprom().

#define RTL_RCR_AB   0x00000008UL

Accept broadcast packets.

Definition at line 155 of file realtek.h.

Referenced by realtek_open().

#define RTL_RCR_AM   0x00000004UL

Accept multicast packets.

Definition at line 156 of file realtek.h.

Referenced by realtek_open().

#define RTL_RCR_APM   0x00000002UL

Accept physical match.

Definition at line 157 of file realtek.h.

Referenced by realtek_open().

#define RTL_RCR_AAP   0x00000001UL

Accept all packets.

Definition at line 158 of file realtek.h.

Referenced by realtek_open().

#define RTL_9346CR   0x50

93C46 (93C56) Command Register (byte)

Definition at line 161 of file realtek.h.

Referenced by realtek_spi_close_bit(), realtek_spi_open_bit(), realtek_spi_read_bit(), and realtek_spi_write_bit().

#define RTL_9346CR_EEM (   x)    ( (x) << 6 )

Mode select.

Definition at line 162 of file realtek.h.

#define RTL_9346CR_EEM_EEPROM   RTL_9346CR_EEM ( 0x2 )

EEPROM mode.

Definition at line 163 of file realtek.h.

Referenced by realtek_spi_open_bit().

#define RTL_9346CR_EEM_NORMAL   RTL_9346CR_EEM ( 0x0 )

Normal mode.

Definition at line 164 of file realtek.h.

Referenced by realtek_spi_close_bit().

#define RTL_9346CR_EECS   0x08

Chip select.

Definition at line 165 of file realtek.h.

#define RTL_9346CR_EESK   0x04

Clock.

Definition at line 166 of file realtek.h.

#define RTL_9346CR_EEDI   0x02

Data in.

Definition at line 167 of file realtek.h.

#define RTL_9346CR_EEDO   0x01

Data out.

Definition at line 168 of file realtek.h.

#define RTL_EEPROM_ID   ( 0x00 / 2 )

Word offset of ID code word within EEPROM.

Definition at line 171 of file realtek.h.

Referenced by realtek_init_eeprom().

#define RTL_EEPROM_ID_MAGIC   0x8129

EEPROM code word magic value.

Definition at line 174 of file realtek.h.

Referenced by realtek_init_eeprom().

#define RTL_EEPROM_MAC   ( 0x0e / 2 )

Word offset of MAC address within EEPROM.

Definition at line 177 of file realtek.h.

Referenced by realtek_probe().

#define RTL_EEPROM_VPD   ( 0x40 / 2 )

Word offset of VPD / non-volatile options within EEPROM.

Definition at line 180 of file realtek.h.

Referenced by realtek_init_eeprom().

#define RTL_EEPROM_VPD_LEN   0x40

Length of VPD / non-volatile options within EEPROM.

Definition at line 183 of file realtek.h.

Referenced by realtek_init_eeprom().

#define RTL_CONFIG1   0x52

Configuration Register 1 (byte)

Definition at line 186 of file realtek.h.

Referenced by realtek_init_eeprom().

#define RTL_CONFIG1_VPD   0x02

Vital Product Data enabled.

Definition at line 187 of file realtek.h.

Referenced by realtek_init_eeprom().

#define RTL_MSR   0x58

Media Status Register (byte, 8139 only)

Definition at line 190 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_MSR_TXFCE   0x80

TX flow control enabled.

Definition at line 191 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_MSR_RXFCE   0x40

RX flow control enabled.

Definition at line 192 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_MSR_AUX_STATUS   0x10

Aux power present.

Definition at line 193 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_MSR_SPEED_10   0x08

10Mbps

Definition at line 194 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_MSR_LINKB   0x04

Inverse of link status.

Definition at line 195 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_MSR_TXPF   0x02

TX pause flag.

Definition at line 196 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_MSR_RXPF   0x01

RX pause flag.

Definition at line 197 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_PHYAR   0x60

PHY Access Register (dword, 8169 only)

Definition at line 200 of file realtek.h.

Referenced by realtek_mii_read(), and realtek_mii_write().

#define RTL_PHYAR_FLAG   0x80000000UL

Read/write flag.

Definition at line 201 of file realtek.h.

Referenced by realtek_mii_read(), and realtek_mii_write().

#define RTL_PHYAR_VALUE (   flag,
  reg,
  data 
)    ( (flag) | ( (reg) << 16 ) | (data) )

Construct PHY Access Register value.

Definition at line 204 of file realtek.h.

Referenced by realtek_mii_read(), and realtek_mii_write().

#define RTL_PHYAR_DATA (   value)    ( (value) & 0xffff )

Extract PHY Access Register data.

Definition at line 207 of file realtek.h.

Referenced by realtek_mii_read().

#define RTL_MII_MAX_WAIT_US   500

Maximum time to wait for PHY access, in microseconds.

Definition at line 210 of file realtek.h.

Referenced by realtek_mii_read(), and realtek_mii_write().

#define RTL_PHYSTATUS   0x6c

PHY (GMII, MII, or TBI) Status Register (byte, 8169 only)

Definition at line 213 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_PHYSTATUS_ENTBI   0x80

TBI / GMII mode.

Definition at line 214 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_PHYSTATUS_TXFLOW   0x40

TX flow control enabled.

Definition at line 215 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_PHYSTATUS_RXFLOW   0x20

RX flow control enabled.

Definition at line 216 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_PHYSTATUS_1000MF   0x10

1000Mbps full-duplex

Definition at line 217 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_PHYSTATUS_100M   0x08

100Mbps

Definition at line 218 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_PHYSTATUS_10M   0x04

10Mbps

Definition at line 219 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_PHYSTATUS_LINKSTS   0x02

Link ok.

Definition at line 220 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_PHYSTATUS_FULLDUP   0x01

Full duplex.

Definition at line 221 of file realtek.h.

Referenced by realtek_check_link().

#define RTL_TPPOLL_8139CP   0xd9

Transmit Priority Polling Register (byte, 8139C+ only)

Definition at line 224 of file realtek.h.

Referenced by realtek_detect().

#define RTL_RMS   0xda

RX Packet Maximum Size Register (word)

Definition at line 227 of file realtek.h.

Referenced by realtek_detect().

#define RTL_CPCR   0xe0

C+ Command Register (word)

Definition at line 230 of file realtek.h.

Referenced by realtek_detect().

#define RTL_CPCR_DAC   0x0010

PCI Dual Address Cycle Enable.

Definition at line 231 of file realtek.h.

Referenced by realtek_detect().

#define RTL_CPCR_MULRW   0x0008

PCI Multiple Read/Write Enable.

Definition at line 232 of file realtek.h.

Referenced by realtek_detect().

#define RTL_CPCR_CPRX   0x0002

C+ receive enable.

Definition at line 233 of file realtek.h.

Referenced by realtek_detect().

#define RTL_CPCR_CPTX   0x0001

C+ transmit enable.

Definition at line 234 of file realtek.h.

Referenced by realtek_detect().

#define RTL_RDSAR   0xe4

Receive Descriptor Start Address Register (qword)

Definition at line 237 of file realtek.h.

Referenced by realtek_probe().

#define RTL_NUM_RX_DESC   4

Number of receive descriptors.

Definition at line 240 of file realtek.h.

Referenced by realtek_close(), realtek_poll_rx(), realtek_probe(), and realtek_refill_rx().

#define RTL_RX_MAX_LEN   ( ETH_FRAME_LEN + 4 /* VLAN */ + 4 /* CRC */ + 4 /* extra space */ )

Receive buffer length.

Definition at line 243 of file realtek.h.

Referenced by realtek_detect(), and realtek_refill_rx().


Enumeration Type Documentation

Packet descriptor flags.

Enumerator:
RTL_DESC_OWN 

Descriptor is owned by NIC.

RTL_DESC_EOR 

End of descriptor ring.

RTL_DESC_FS 

First segment descriptor.

RTL_DESC_LS 

Last segment descriptor.

RTL_DESC_RES 

Receive error summary.

Definition at line 36 of file realtek.h.

                              {
        /** Descriptor is owned by NIC */
        RTL_DESC_OWN = 0x8000,
        /** End of descriptor ring */
        RTL_DESC_EOR = 0x4000,
        /** First segment descriptor */
        RTL_DESC_FS = 0x2000,
        /** Last segment descriptor */
        RTL_DESC_LS = 0x1000,
        /** Receive error summary */
        RTL_DESC_RES = 0x0020,
};

Legacy mode status bits.

Enumerator:
RTL_STAT_ROK 

Received OK.

Definition at line 63 of file realtek.h.

                           {
        /** Received OK */
        RTL_STAT_ROK = 0x0001,
};

Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static void realtek_init_ring ( struct realtek_ring ring,
unsigned int  count,
unsigned int  reg 
) [inline, static]

Initialise descriptor ring.

Parameters:
ringDescriptor ring
countNumber of descriptors
regDescriptor start address register

Definition at line 269 of file realtek.h.

References reg.

Referenced by realtek_probe().

                                       {
        ring->len = ( count * sizeof ( ring->desc[0] ) );
        ring->reg = reg;
}