#include <linux/module.h>#include <linux/version.h>#include <linux/kernel.h>#include <linux/sched.h>#include <linux/string.h>#include <linux/timer.h>#include <linux/errno.h>#include <linux/ioport.h>#include <linux/malloc.h>#include <linux/interrupt.h>#include <linux/pci.h>#include <linux/netdevice.h>#include <linux/etherdevice.h>#include <linux/skbuff.h>#include <asm/processor.h>#include <asm/bitops.h>#include <asm/io.h>#include <linux/delay.h>#include <linux/bios32.h>Include dependency graph for rtl8139.c:

Go to the source code of this file.
Data Structures | |
| struct | pci_id_info |
Defines | |
| #define | rtl8129_debug debug |
| #define | MAX_UNITS 8 |
| #define | RX_BUF_LEN_IDX 3 |
| #define | RX_BUF_LEN (8192 << RX_BUF_LEN_IDX) |
| #define | TX_BUF_SIZE 1536 |
| #define | TX_FIFO_THRESH 256 |
| #define | RX_FIFO_THRESH 4 |
| #define | RX_DMA_BURST 4 |
| #define | TX_DMA_BURST 4 |
| #define | TX_TIMEOUT (4*HZ) |
| #define | RUN_AT(x) (jiffies + (x)) |
| #define | test_and_set_bit(val, addr) set_bit(val, addr) |
| #define | net_device_stats enet_statistics |
| #define | PCI_SUPPORT_VER1 |
| #define | dev_free_skb(skb) dev_kfree_skb(skb, FREE_WRITE); |
| #define | RTL8129_TOTAL_SIZE 0x80 |
| #define | NUM_TX_DESC 4 |
| #define | EE_SHIFT_CLK 0x04 |
| #define | EE_CS 0x08 |
| #define | EE_DATA_WRITE 0x02 |
| #define | EE_WRITE_0 0x00 |
| #define | EE_WRITE_1 0x02 |
| #define | EE_DATA_READ 0x01 |
| #define | EE_ENB (0x80 | EE_CS) |
| #define | eeprom_delay() inl(ee_addr) |
| #define | EE_WRITE_CMD (5 << 6) |
| #define | EE_READ_CMD (6 << 6) |
| #define | EE_ERASE_CMD (7 << 6) |
| #define | MDIO_DIR 0x80 |
| #define | MDIO_DATA_OUT 0x04 |
| #define | MDIO_DATA_IN 0x02 |
| #define | MDIO_CLK 0x01 |
| #define | MDIO_WRITE0 (MDIO_DIR) |
| #define | MDIO_WRITE1 (MDIO_DIR | MDIO_DATA_OUT) |
| #define | mdio_delay() inb(mdio_addr) |
Enumerations | |
| enum | pci_flags_bit { PCI_USES_IO = 1, PCI_USES_MEM = 2, PCI_USES_MASTER = 4, PCI_ADDR0 = 0x10<<0, PCI_ADDR1 = 0x10<<1, PCI_ADDR2 = 0x10<<2, PCI_ADDR3 = 0x10<<3 } |
| enum | { HAS_MII_XCVR = 0x01, HAS_CHIP_XCVR = 0x02, HAS_LNK_CHNG = 0x04 } |
| enum | RTL8129_registers { MAC0 = 0, MAR0 = 8, TxStatus0 = 0x10, TxAddr0 = 0x20, RxBuf = 0x30, RxEarlyCnt = 0x34, RxEarlyStatus = 0x36, ChipCmd = 0x37, RxBufPtr = 0x38, RxBufAddr = 0x3A, IntrMask = 0x3C, IntrStatus = 0x3E, TxConfig = 0x40, RxConfig = 0x44, Timer = 0x48, RxMissed = 0x4C, Cfg9346 = 0x50, Config0 = 0x51, Config1 = 0x52, FlashReg = 0x54, GPPinData = 0x58, GPPinDir = 0x59, MII_SMI = 0x5A, HltClk = 0x5B, MultiIntr = 0x5C, TxSummary = 0x60, MII_BMCR = 0x62, MII_BMSR = 0x64, NWayAdvert = 0x66, NWayLPAR = 0x68, NWayExpansion = 0x6A, FIFOTMS = 0x70, CSCR = 0x74, PARA78 = 0x78, PARA7c = 0x7c } |
| enum | ChipCmdBits { CmdReset = 0x10, CmdRxEnb = 0x08, CmdTxEnb = 0x04, RxBufEmpty = 0x01 } |
| enum | IntrStatusBits { PCIErr = 0x8000, PCSTimeout = 0x4000, RxFIFOOver = 0x40, RxUnderrun = 0x20, RxOverflow = 0x10, TxErr = 0x08, TxOK = 0x04, RxErr = 0x02, RxOK = 0x01 } |
| enum | TxStatusBits { TxHostOwns = 0x2000, TxUnderrun = 0x4000, TxStatOK = 0x8000, TxOutOfWindow = 0x20000000, TxAborted = 0x40000000, TxCarrierLost = 0x80000000 } |
| enum | RxStatusBits { RxMulticast = 0x8000, RxPhysical = 0x4000, RxBroadcast = 0x2000, RxBadSymbol = 0x0020, RxRunt = 0x0010, RxTooLong = 0x0008, RxCRCErr = 0x0004, RxBadAlign = 0x0002, RxStatusOK = 0x0001 } |
| enum | CSCRBits { CSCR_LinkOKBit = 0x0400, CSCR_LinkChangeBit = 0x0800, CSCR_LinkStatusBits = 0x0f000, CSCR_LinkDownOffCmd = 0x003c0, CSCR_LinkDownCmd = 0x0f3c0 } |
| enum | rx_mode_bits { AcceptErr = 0x20, AcceptRunt = 0x10, AcceptBroadcast = 0x08, AcceptMulticast = 0x04, AcceptMyPhys = 0x02, AcceptAllPhys = 0x01 } |
Functions | |
| static struct device * | rtl8129_probe1 (int pci_bus, int pci_devfn, struct device *dev, long ioaddr, int irq, int chp_idx, int fnd_cnt) |
| static int | rtl8129_open (struct device *dev) |
| static int | read_eeprom (long ioaddr, int location) |
| static int | mdio_read (struct device *dev, int phy_id, int location) |
| static void | mdio_write (struct device *dev, int phy_id, int location, int val) |
| static void | rtl8129_timer (unsigned long data) |
| static void | rtl8129_tx_timeout (struct device *dev) |
| static void | rtl8129_init_ring (struct device *dev) |
| static int | rtl8129_start_xmit (struct sk_buff *skb, struct device *dev) |
| static int | rtl8129_rx (struct device *dev) |
| static void | rtl8129_interrupt (int irq, void *dev_instance, struct pt_regs *regs) |
| static int | rtl8129_close (struct device *dev) |
| static int | mii_ioctl (struct device *dev, struct ifreq *rq, int cmd) |
| static struct enet_statistics * | rtl8129_get_stats (struct device *dev) |
| static u32 | ether_crc (int length, unsigned char *data) |
| static void | set_rx_mode (struct device *dev) |
| int | rtl8139_probe (struct device *dev) |
| static void | mdio_sync (long mdio_addr) |
Variables | |
| static const char * | version |
| static int | max_interrupt_work = 20 |
| static int | rtl8129_debug = 1 |
| static int | multicast_filter_limit = 32 |
| static int | options [MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1} |
| static int | full_duplex [MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1} |
| static struct pci_id_info | pci_tbl [] |
| static int | rtl_cap_tbl [] |
| unsigned long | param [4][4] |
| static struct device * | root_rtl8129_dev = NULL |
| static char | mii_2_8139_map [8] |
| static unsigned const | ethernet_polynomial = 0x04c11db7U |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 28 of file rtl8139.c. Referenced by rtl8129_close(), rtl8129_interrupt(), rtl8129_open(), rtl8129_probe1(), rtl8129_rx(), rtl8129_start_xmit(), rtl8129_timer(), rtl8129_tx_timeout(), and set_rx_mode(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
Definition at line 601 of file rtl8139.c. References i, inb, inw, MDIO_CLK, MDIO_DATA_IN, MDIO_DATA_OUT, mdio_delay, MDIO_DIR, mdio_sync(), MII_SMI, and outb. Here is the call graph for this function: ![]() |
|
|
Definition at line 589 of file rtl8139.c. References i, MDIO_CLK, mdio_delay, MDIO_WRITE1, and outb. |
|
||||||||||||||||||||
|
Definition at line 634 of file rtl8139.c. References i, MDIO_CLK, mdio_delay, mdio_sync(), MDIO_WRITE0, MDIO_WRITE1, MII_SMI, outb, and outw. Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Definition at line 1352 of file rtl8139.c. References CAP_NET_ADMIN, capable, data, EOPNOTSUPP, EPERM, mdio_read(), mdio_write(), rtl8129_private::phys, SIOCDEVPRIVATE, tp, u16, and x1f. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 536 of file rtl8139.c. References Cfg9346, EE_CS, EE_DATA_READ, EE_DATA_WRITE, EE_ENB, EE_READ_CMD, EE_SHIFT_CLK, eeprom_delay, i, inb, outb, and read_cmd. |
|
|
Definition at line 1307 of file rtl8139.c. References Cfg9346, ChipCmd, Config1, del_timer(), dev_free_skb, free_irq(), HltClk, i, inl, IntrMask, IntrStatus, inw, ioaddr, KERN_DEBUG, kfree(), MOD_DEC_USE_COUNT, NUM_TX_DESC, outb, outl, outw, printk, rtl8129_debug, rtl8129_private::rx_ring, RxMissed, rtl8129_private::stats, rtl8129_private::timer, tp, rtl8129_private::tx_bufs, rtl8129_private::tx_skbuff, x00, and x03. Referenced by rtl8129_probe1(). Here is the call graph for this function: ![]() |
|
|
Definition at line 1375 of file rtl8139.c. References inl, ioaddr, outl, RxMissed, rtl8129_private::stats, and tp. Referenced by rtl8129_probe1(). |
|
|
Definition at line 944 of file rtl8139.c. References rtl8129_private::cur_rx, rtl8129_private::cur_tx, rtl8129_private::dirty_tx, i, NUM_TX_DESC, tp, rtl8129_private::tx_buf, TX_BUF_SIZE, rtl8129_private::tx_bufs, rtl8129_private::tx_full, and rtl8129_private::tx_skbuff. Referenced by rtl8129_open(). |
|
||||||||||||||||
|
Definition at line 1013 of file rtl8139.c. References Cfg9346, rtl8129_private::chip_id, ChipCmd, clear_bit, CmdRxEnb, CmdTxEnb, Config1, CSCR, CSCR_LinkChangeBit, rtl8129_private::cur_rx, rtl8129_private::cur_tx, dev, dev_free_skb, device, rtl8129_private::dirty_tx, entry, rtl8129_private::full_duplex, HAS_LNK_CHNG, inl, IntrStatus, inw, ioaddr, KERN_DEBUG, KERN_ERR, KERN_NOTICE, KERN_WARNING, mark_bh, max_interrupt_work, NET_BH, NUM_TX_DESC, NWayLPAR, outb, outl, outw, rtl8129_private::pci_bus, PCI_COMMAND, rtl8129_private::pci_devfn, pcibios_read_config_dword(), PCIErr, PCSTimeout, printk, rtl8129_debug, rtl8129_rx(), rtl_cap_tbl, RX_BUF_LEN, RX_BUF_LEN_IDX, RX_DMA_BURST, RX_FIFO_THRESH, RxBufAddr, RxBufPtr, RxConfig, RxErr, RxFIFOOver, RxMissed, RxOK, RxOverflow, RxUnderrun, rtl8129_private::stats, status, test_and_set_bit, tp, TX_DMA_BURST, rtl8129_private::tx_flag, rtl8129_private::tx_full, rtl8129_private::tx_skbuff, TxAborted, TxCarrierLost, TxConfig, TxErr, TxOK, TxOutOfWindow, TxStatOK, TxStatus0, TxUnderrun, u32, x00, x20, x60, xffff, and xffffffff. Referenced by rtl8129_open(), and rtl8129_timer(). Here is the call graph for this function: ![]() |
|
|
Definition at line 667 of file rtl8139.c. References add_timer(), Cfg9346, rtl8129_private::chip_id, ChipCmd, CmdReset, CmdRxEnb, CmdTxEnb, Config1, timer_list::data, rtl8129_private::duplex_lock, EAGAIN, ENOMEM, timer_list::expires, free_irq(), rtl8129_private::full_duplex, timer_list::function, GPPinData, HAS_MII_XCVR, HZ, i, inb, init_timer(), IntrMask, ioaddr, KERN_DEBUG, KERN_ERR, KERN_INFO, kfree(), kmalloc(), long, MAC0, mdio_read(), MOD_INC_USE_COUNT, NULL, NUM_TX_DESC, outb, outl, outw, PCIErr, PCSTimeout, rtl8129_private::phys, printk, request_irq(), rtl8129_debug, rtl8129_init_ring(), rtl8129_interrupt(), rtl8129_timer(), rtl_cap_tbl, RUN_AT, RX_BUF_LEN, RX_BUF_LEN_IDX, RX_DMA_BURST, RX_FIFO_THRESH, rtl8129_private::rx_ring, RxBuf, RxConfig, RxErr, RxFIFOOver, RxMissed, RxOK, RxOverflow, RxUnderrun, SA_SHIRQ, set_rx_mode(), rtl8129_private::timer, tp, TX_BUF_SIZE, rtl8129_private::tx_bufs, TX_DMA_BURST, TX_FIFO_THRESH, rtl8129_private::tx_flag, TxConfig, TxErr, TxOK, u16, virt_to_bus, x00, x20, x60, and xffff. Referenced by rtl8129_probe1(). Here is the call graph for this function: ![]() |
|
||||||||||||||||||||||||||||||||
|
Definition at line 408 of file rtl8139.c. References Cfg9346, Config1, full_duplex, HAS_MII_XCVR, HltClk, i, inb, init_etherdev(), KERN_INFO, kmalloc(), le16_to_cpu, MAC0, MAX_UNITS, mdio_read(), mdio_write(), memset, mii_ioctl(), mii_status(), pci_id_info::name, outb, phys, printk, read_eeprom(), request_region, rtl8129_close(), rtl8129_debug, rtl8129_get_stats(), rtl8129_open(), rtl8129_start_xmit(), rtl_cap_tbl, set_rx_mode(), tp, u16, version, x00, x03, and xffff. Here is the call graph for this function: ![]() |
|
|
Definition at line 1196 of file rtl8139.c. References ChipCmd, CmdRxEnb, CmdTxEnb, rtl8129_private::cur_rx, sk_buff::dev, eth_copy_and_sum(), eth_type_trans(), i, inb, inw, ioaddr, KERN_DEBUG, KERN_NOTICE, KERN_WARNING, le32_to_cpu, memcpy, memset, netif_rx(), NULL, outb, outl, outw, printk, sk_buff::protocol, rtl8129_debug, RX_BUF_LEN, RX_BUF_LEN_IDX, RX_DMA_BURST, RX_FIFO_THRESH, rtl8129_private::rx_ring, rx_ring, RxBadAlign, RxBadSymbol, RxBufAddr, RxBufPtr, RxConfig, RxCRCErr, RxRunt, RxTooLong, rtl8129_private::stats, tp, u16, u32, and xcc. Referenced by rtl8129_interrupt(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 960 of file rtl8139.c. References clear_bit, rtl8129_private::cur_tx, sk_buff::data, rtl8129_private::dirty_tx, entry, ETH_ZLEN, ioaddr, jiffies, KERN_DEBUG, sk_buff::len, memcpy, NULL, NUM_TX_DESC, outl, printk, rtl8129_debug, rtl8129_tx_timeout(), test_and_set_bit, tp, rtl8129_private::tx_buf, rtl8129_private::tx_flag, rtl8129_private::tx_full, rtl8129_private::tx_skbuff, TX_TIMEOUT, TxAddr0, TxStatus0, and virt_to_bus. Referenced by rtl8129_probe1(). Here is the call graph for this function: ![]() |
|
|
Definition at line 763 of file rtl8139.c. References add_timer(), Cfg9346, rtl8129_private::chip_id, Config0, Config1, CSCR, CSCR_LinkDownCmd, CSCR_LinkDownOffCmd, CSCR_LinkOKBit, CSCR_LinkStatusBits, dev, device, rtl8129_private::duplex_lock, timer_list::expires, FIFOTMS, rtl8129_private::full_duplex, GPPinData, HAS_MII_XCVR, HZ, inb, inl, IntrMask, IntrStatus, inw, ioaddr, jiffies, KERN_DEBUG, KERN_ERR, KERN_INFO, mdio_read(), next_tick, NWayLPAR, outb, outl, outw, PARA78, PARA78_default, PARA7c, PARA7c_default, PARA7c_xxx, param, rtl8129_private::phys, printk, rtl8129_debug, rtl8129_interrupt(), rtl8129_tx_timeout(), rtl_cap_tbl, RUN_AT, RxEarlyStatus, RxOK, status, rtl8129_private::timer, tp, rtl8129_private::twist_cnt, rtl8129_private::twistie, TX_TIMEOUT, TxOK, x00, x1000, x20, x60, and xffff. Referenced by rtl8129_open(). Here is the call graph for this function: ![]() |