iPXE
|
#include <stdint.h>
#include <byteswap.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <ipxe/ethernet.h>
#include <ipxe/if_ether.h>
#include <ipxe/iobuf.h>
#include <ipxe/malloc.h>
#include <ipxe/pci.h>
#include <ipxe/spi_bit.h>
#include <ipxe/timer.h>
#include <ipxe/nvs.h>
#include <ipxe/threewire.h>
#include <ipxe/netdevice.h>
#include "eepro100.h"
Go to the source code of this file.
Macros | |
#define | INTERRUPT_MASK ( SCBMaskEarlyRx | SCBMaskFlowCtl ) |
#define | RFD_STATUS |
Functions | |
FILE_LICENCE (GPL2_OR_LATER) | |
static int | ifec_pci_probe (struct pci_device *pci) |
static void | ifec_pci_remove (struct pci_device *pci) |
static void | ifec_net_close (struct net_device *netdev) |
static void | ifec_net_irq (struct net_device *netdev, int enable) |
static int | ifec_net_open (struct net_device *netdev) |
static void | ifec_net_poll (struct net_device *netdev) |
static int | ifec_net_transmit (struct net_device *netdev, struct io_buffer *iobuf) |
static int | ifec_spi_read_bit (struct bit_basher *basher, unsigned int bit_id) |
static void | ifec_spi_write_bit (struct bit_basher *basher, unsigned int bit_id, unsigned long data) |
static void | ifec_init_eeprom (struct net_device *netdev) |
static int | ifec_mdio_read (struct net_device *netdev, int phy_id, int location) |
static void | ifec_mdio_setup (struct net_device *netdev, int options) |
static int | ifec_mdio_write (struct net_device *netdev, int phy_id, int location, int value) |
static void | ifec_reset (struct net_device *netdev) |
static void | ifec_free (struct net_device *netdev) |
static void | ifec_rfd_init (struct ifec_rfd *rfd, s16 command, u32 link) |
static void | ifec_reprime_ru (struct net_device *netdev) |
static void | ifec_check_ru_status (struct net_device *netdev, unsigned short intr_status) |
static void | ifec_rx_process (struct net_device *netdev) |
static int | ifec_get_rx_desc (struct net_device *netdev, int cur, int cmd, int link) |
static void | ifec_refill_rx_ring (struct net_device *netdev) |
static int | ifec_rx_setup (struct net_device *netdev) |
static int | ifec_scb_cmd (struct net_device *netdev, u32 ptr, u8 cmd) |
static int | ifec_scb_cmd_wait (struct net_device *netdev) |
static void | ifec_tx_process (struct net_device *netdev) |
static int | ifec_tx_setup (struct net_device *netdev) |
void | ifec_tx_wake (struct net_device *netdev) |
Variables | |
static struct ifec_cfg | ifec_cfg |
static struct net_device_operations | ifec_operations |
static const uint16_t | ifec_ee_bits [] |
static struct bit_basher_operations | ifec_basher_ops |
static struct pci_device_id | ifec_nics [] |
struct pci_driver ifec_driver | __pci_driver |
#define INTERRUPT_MASK ( SCBMaskEarlyRx | SCBMaskFlowCtl ) |
Definition at line 280 of file eepro100.c.
#define RFD_STATUS |
Definition at line 785 of file eepro100.c.
FILE_LICENCE | ( | GPL2_OR_LATER | ) |
|
static |
Definition at line 171 of file eepro100.c.
References adjust_pci_device(), alloc_etherdev(), DBGP, pci_device::dev, net_device::dev, EEPROM_ADDR_MAC_0, EEPROM_ADDR_MDIO_REGISTER, EINVAL, ENOMEM, error, ETH_ALEN, net_device::hw_addr, ifec_init_eeprom(), ifec_operations, ifec_reset(), pci_device::ioaddr, memset(), netdev, netdev_init(), netdev_link_up(), netdev_nullify(), netdev_put(), nvs_read(), pci_set_drvdata(), priv, net_device::priv, rc, and register_netdev().
|
static |
Definition at line 236 of file eepro100.c.
References DBGP, ifec_reset(), netdev, netdev_nullify(), netdev_put(), pci_get_drvdata(), and unregister_netdev().
|
static |
Definition at line 257 of file eepro100.c.
References DBGP, ifec_free(), ifec_net_irq(), ifec_reset(), inw(), ioaddr, netdev, outw, priv, net_device::priv, and SCBStatus.
|
static |
Definition at line 290 of file eepro100.c.
References DBGP, INTERRUPT_MASK, ioaddr, netdev, outw, priv, net_device::priv, SCBCmd, and SCBMaskAll.
Referenced by ifec_net_close(), ifec_net_open(), and ifec_reset().
|
static |
Definition at line 309 of file eepro100.c.
References CB_ALIGN, cfg, CmdIASetup, ifec_ias::command, CUCmdBase, CUStart, CUStatsAddr, DBG, DBG2, DBGP, ENOMEM, error, ETH_ALEN, free_phys(), ifec_ias::ia, ifec_free(), ifec_mdio_setup(), ifec_net_irq(), ifec_reset(), ifec_rx_setup(), ifec_scb_cmd(), ifec_scb_cmd_wait(), ifec_tx_setup(), ifec_ias::link, net_device::ll_addr, malloc_phys(), mdelay(), memcpy(), netdev, NULL, options, priv, net_device::priv, rc, RUAddrLoad, RUStart, ifec_ias::status, and virt_to_bus().
|
static |
Definition at line 400 of file eepro100.c.
References DBG2, DBGP, ifec_check_ru_status(), ifec_rx_process(), ifec_tx_process(), INTERRUPT_MASK, inw(), netdev, outw, priv, net_device::priv, and SCBStatus.
|
static |
Definition at line 436 of file eepro100.c.
References CmdSuspend, CmdTx, CmdTxFlex, ifec_tcb::command, ifec_tcb::count, io_buffer::data, DBG, DBG2, DBGP, ENOBUFS, ifec_tx_wake(), inw(), ioaddr, ifec_tcb::iob, iob_len(), netdev, priv, net_device::priv, SCBCmd, ifec_tcb::status, ifec_tcb::tbd_addr0, ifec_tcb::tbd_size0, and virt_to_bus().
|
static |
Definition at line 485 of file eepro100.c.
References spi_bit_basher::basher, container_of, CSREeprom, DBGP, ifec_ee_bits, inw(), priv, and ifec_private::spi.
|
static |
Definition at line 510 of file eepro100.c.
References spi_bit_basher::basher, container_of, CSREeprom, data, DBGP, ifec_ee_bits, inw(), outw, priv, ifec_private::spi, and val.
|
static |
Definition at line 540 of file eepro100.c.
References DBGP, ifec_basher_ops, init_spi_bit_basher(), netdev, priv, net_device::priv, SPI_MODE_THREEWIRE, and threewire_detect_address_len().
Referenced by ifec_pci_probe().
|
static |
Definition at line 571 of file eepro100.c.
References CSRCtrlMDI, DBG, DBGP, inl(), ioaddr, netdev, outl, priv, net_device::priv, udelay(), and val.
Referenced by ifec_mdio_setup().
|
static |
Definition at line 603 of file eepro100.c.
References CONGENB, DBG2, DBGP, DP83840, DP83840A, ifec_mdio_read(), ifec_mdio_write(), ifec_private::mdio_register, netdev, options, priv, and net_device::priv.
Referenced by ifec_net_open().
|
static |
Definition at line 635 of file eepro100.c.
References CSRCtrlMDI, DBG, DBGP, inl(), ioaddr, netdev, outl, priv, net_device::priv, udelay(), val, and value.
Referenced by ifec_mdio_setup().
|
static |
Definition at line 665 of file eepro100.c.
References CSRPort, DBGP, ifec_net_irq(), inw(), ioaddr, netdev, outl, PortPartialReset, PortReset, priv, net_device::priv, SCBStatus, and udelay().
Referenced by ifec_net_close(), ifec_net_open(), ifec_pci_probe(), and ifec_pci_remove().
|
static |
Definition at line 691 of file eepro100.c.
References DBGP, free_iob(), free_phys(), netdev, NULL, priv, net_device::priv, RFD_COUNT, and TX_RING_BYTES.
Referenced by ifec_net_close(), and ifec_net_open().
Definition at line 718 of file eepro100.c.
References command, ifec_rfd::command, ifec_rfd::count, DBGP, link, ifec_rfd::link, RFD_PACKET_LEN, ifec_rfd::rx_buf_addr, ifec_rfd::size, and ifec_rfd::status.
Referenced by ifec_get_rx_desc().
|
static |
Definition at line 735 of file eepro100.c.
References cur_rx, tlan_private::cur_rx, DBGP, ifec_scb_cmd(), ifec_scb_cmd_wait(), netdev, NULL, priv, net_device::priv, RUStart, and virt_to_bus().
Referenced by ifec_check_ru_status().
|
static |
Definition at line 754 of file eepro100.c.
References DBG, DBGP, ifec_reprime_ru(), inw(), netdev, priv, net_device::priv, and SCBStatus.
Referenced by ifec_net_poll(), and ifec_refill_rx_ring().
|
static |
Definition at line 793 of file eepro100.c.
References ifec_rfd::count, cur_rx, tlan_private::cur_rx, DBG, DBG2, DBGIO_HD, DBGP, EINVAL, ifec_refill_rx_ring(), iob_put, netdev, netdev_rx(), netdev_rx_err(), NULL, ifec_rfd::packet, priv, net_device::priv, RFD_COUNT, RFD_OK, RFD_STATUS, RFDMaskCount, RFDShort, status, and ifec_rfd::status.
Referenced by ifec_net_poll().
|
static |
Definition at line 847 of file eepro100.c.
References alloc_iob(), cmd, DBG, DBGP, ENOMEM, ifec_rfd_init(), iob_reserve, link, netdev, NULL, priv, net_device::priv, and RFD_HEADER_LEN.
Referenced by ifec_refill_rx_ring().
|
static |
Definition at line 875 of file eepro100.c.
References CmdEndOfList, CmdSuspend, ifec_rfd::command, cur_rx, tlan_private::cur_rx, DBG2, DBGP, ifec_check_ru_status(), ifec_get_rx_desc(), inw(), ifec_rfd::link, netdev, NULL, priv, net_device::priv, RFD_COUNT, SCBStatus, and virt_to_bus().
Referenced by ifec_rx_process(), and ifec_rx_setup().
|
static |
Definition at line 915 of file eepro100.c.
References tlan_private::cur_rx, DBGP, ifec_refill_rx_ring(), netdev, NULL, priv, net_device::priv, and RFD_COUNT.
Referenced by ifec_net_open().
|
static |
Definition at line 942 of file eepro100.c.
References cmd, DBGP, ifec_scb_cmd_wait(), ioaddr, netdev, outb, outl, priv, net_device::priv, rc, SCBCmd, and SCBPointer.
Referenced by ifec_net_open(), ifec_reprime_ru(), and ifec_tx_wake().
|
static |
Definition at line 964 of file eepro100.c.
References CU_CMD_TIMEOUT, DBG, DBGP, inb(), netdev, priv, net_device::priv, rc, SCBCmd, and udelay().
Referenced by ifec_net_open(), ifec_reprime_ru(), ifec_scb_cmd(), and ifec_tx_wake().
|
static |
Definition at line 985 of file eepro100.c.
References DBG, DBG2, DBGP, EINVAL, ifec_tcb::iob, netdev, netdev_tx_complete(), netdev_tx_complete_err(), ifec_tcb::next, NULL, priv, net_device::priv, status, ifec_tcb::status, and TCB_U.
Referenced by ifec_net_poll().
|
static |
Definition at line 1019 of file eepro100.c.
References CB_ALIGN, ifec_tcb::count, DBG, DBGP, ENOMEM, ifec_tcb::iob, ifec_tcb::link, malloc_phys(), netdev, ifec_tcb::next, NULL, priv, net_device::priv, ifec_tcb::status, ifec_tcb::tbd_addr0, ifec_tcb::tbda_addr, TCB_COUNT, TX_RING_BYTES, and virt_to_bus().
Referenced by ifec_net_open().
void ifec_tx_wake | ( | struct net_device * | netdev | ) |
Definition at line 1072 of file eepro100.c.
References CmdSuspend, CUResume, CUStart, DBG2, DBGP, ifec_scb_cmd(), ifec_scb_cmd_wait(), inw(), ioaddr, netdev, outb, outl, priv, net_device::priv, SCBCmd, SCBPointer, SCBStatus, and virt_to_bus().
Referenced by ifec_net_transmit().
Definition at line 126 of file eepro100.c.
|
static |
Definition at line 151 of file eepro100.c.
Referenced by ifec_pci_probe().
|
static |
Definition at line 471 of file eepro100.c.
Referenced by ifec_spi_read_bit(), and ifec_spi_write_bit().
|
static |
Definition at line 530 of file eepro100.c.
Referenced by ifec_init_eeprom().
|
static |
Definition at line 1112 of file eepro100.c.
struct pci_driver ifec_driver __pci_driver |
Definition at line 1151 of file eepro100.c.