iPXE
|
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <byteswap.h>
#include <errno.h>
#include <ipxe/ethernet.h>
#include <ipxe/if_ether.h>
#include <ipxe/io.h>
#include <ipxe/iobuf.h>
#include <ipxe/malloc.h>
#include <ipxe/netdevice.h>
#include <ipxe/crypto.h>
#include <ipxe/pci.h>
#include <ipxe/timer.h>
#include <mii.h>
#include "forcedeth.h"
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER) | |
static void | pci_push (void *ioaddr) |
static int | reg_delay (struct forcedeth_private *priv, int offset, u32 mask, u32 target, int delay, int delaymax, const char *msg) |
static int | mii_rw (struct forcedeth_private *priv, int addr, int miireg, int value) |
static void | nv_txrx_gate (struct forcedeth_private *priv, int gate) |
static void | nv_mac_reset (struct forcedeth_private *priv) |
static void | nv_init_tx_ring (struct forcedeth_private *priv) |
static void | nv_alloc_rx (struct forcedeth_private *priv) |
nv_alloc_rx - Allocates iobufs for every Rx descriptor that doesn't have one and isn't in use by the hardware More... | |
static void | nv_init_rx_ring (struct forcedeth_private *priv) |
static int | nv_init_rings (struct forcedeth_private *priv) |
nv_init_rings - Allocate and intialize descriptor rings More... | |
static void | nv_free_rxtx_resources (struct forcedeth_private *priv) |
static void | nv_txrx_reset (struct forcedeth_private *priv) |
static void | nv_disable_hw_interrupts (struct forcedeth_private *priv) |
static void | nv_enable_hw_interrupts (struct forcedeth_private *priv) |
static void | nv_start_rx (struct forcedeth_private *priv) |
static void | nv_stop_rx (struct forcedeth_private *priv) |
static void | nv_start_tx (struct forcedeth_private *priv) |
static void | nv_stop_tx (struct forcedeth_private *priv) |
static void | nv_update_pause (struct forcedeth_private *priv, u32 pause_flags) |
static int | nv_update_linkspeed (struct forcedeth_private *priv) |
static int | forcedeth_open (struct net_device *netdev) |
open - Called when a network interface is made active More... | |
static int | forcedeth_transmit (struct net_device *netdev, struct io_buffer *iobuf) |
transmit - Transmit a packet More... | |
static void | nv_process_tx_packets (struct net_device *netdev) |
nv_process_tx_packets - Checks for successfully sent packets, reports them to iPXE with netdev_tx_complete() More... | |
static void | nv_process_rx_packets (struct net_device *netdev) |
nv_process_rx_packets - Checks for received packets, reports them to iPXE with netdev_rx() or netdev_rx_err() if there was an error receiving the packet More... | |
static void | forcedeth_link_status (struct net_device *netdev) |
check_link - Check for link status change More... | |
static void | forcedeth_poll (struct net_device *netdev) |
poll - Poll for received packets More... | |
static void | forcedeth_close (struct net_device *netdev) |
close - Disable network interface More... | |
static void | forcedeth_irq (struct net_device *netdev, int action) |
irq - enable or disable interrupts More... | |
static int | nv_setup_mac_addr (struct forcedeth_private *priv) |
static int | nv_mgmt_acquire_sema (struct forcedeth_private *priv) |
static void | nv_mgmt_release_sema (struct forcedeth_private *priv) |
static int | nv_mgmt_get_version (struct forcedeth_private *priv) |
static int | phy_reset (struct forcedeth_private *priv, u32 bmcr_setup) |
static int | phy_init (struct forcedeth_private *priv) |
static int | nv_setup_phy (struct forcedeth_private *priv) |
nv_setup_phy - Find PHY and initialize it More... | |
static int | forcedeth_map_regs (struct forcedeth_private *priv) |
forcedeth_map_regs - Find a suitable BAR for the NIC and map the registers in memory More... | |
static int | forcedeth_probe (struct pci_device *pdev) |
probe - Initial configuration of NIC More... | |
static void | nv_restore_phy (struct forcedeth_private *priv) |
static void | forcedeth_remove (struct pci_device *pdev) |
remove - Device Removal Routine More... | |
Variables | |
static struct net_device_operations | forcedeth_operations |
static struct pci_device_id | forcedeth_nics [] |
struct pci_driver forcedeth_driver | __pci_driver |
FILE_LICENCE | ( | GPL2_OR_LATER | ) |
|
inlinestatic |
Definition at line 62 of file forcedeth.c.
References ioaddr, readl(), and wmb().
Referenced by forcedeth_open(), forcedeth_transmit(), nv_disable_hw_interrupts(), nv_mac_reset(), nv_start_rx(), nv_start_tx(), nv_txrx_reset(), nv_update_linkspeed(), and reg_delay().
|
static |
Definition at line 70 of file forcedeth.c.
References DBG, delay, ioaddr, msg(), offset, pci_push(), priv, readl(), and udelay().
Referenced by forcedeth_open(), mii_rw(), nv_stop_rx(), and nv_stop_tx().
|
static |
Definition at line 91 of file forcedeth.c.
References addr, DBG, ioaddr, MII_READ, NULL, NV_MIIBUSY_DELAY, NV_MIIPHY_DELAY, NV_MIIPHY_DELAYMAX, NVREG_MIICTL_ADDRSHIFT, NVREG_MIICTL_INUSE, NVREG_MIICTL_WRITE, NVREG_MIISTAT_ERROR, NVREG_MIISTAT_MASK_RW, NvRegMIIControl, NvRegMIIData, NvRegMIIStatus, priv, readl(), reg, reg_delay(), retval, udelay(), value, and writel().
Referenced by forcedeth_open(), nv_restore_phy(), nv_setup_phy(), nv_update_linkspeed(), phy_init(), and phy_reset().
|
static |
Definition at line 136 of file forcedeth.c.
References DEV_HAS_POWER_CNTRL, ioaddr, NVREG_POWERSTATE2_GATE_CLOCKS, NvRegPowerState2, priv, readl(), and writel().
Referenced by forcedeth_close(), and forcedeth_open().
|
static |
Definition at line 153 of file forcedeth.c.
References ioaddr, NV_MAC_RESET_DELAY, NVREG_MAC_RESET_ASSERT, NVREG_TXRXCTL_BIT2, NVREG_TXRXCTL_DESC_1, NVREG_TXRXCTL_RESET, NvRegMacAddrA, NvRegMacAddrB, NvRegMacReset, NvRegTransmitPoll, NvRegTxRxControl, pci_push(), priv, readl(), udelay(), and writel().
Referenced by forcedeth_open().
|
static |
Definition at line 185 of file forcedeth.c.
References NULL, priv, and TX_RING_SIZE.
Referenced by nv_init_rings().
|
static |
nv_alloc_rx - Allocates iobufs for every Rx descriptor that doesn't have one and isn't in use by the hardware
priv | Driver private structure |
Definition at line 207 of file forcedeth.c.
References alloc_iob(), ring_desc::buf, cpu_to_le32, DBG, DBGP, ring_desc::flaglen, le32_to_cpu, NULL, NV_RX_AVAIL, priv, RX_BUF_SZ, RX_RING_SIZE, status, virt_to_bus(), and wmb().
Referenced by nv_init_rings(), and nv_process_rx_packets().
|
static |
Definition at line 242 of file forcedeth.c.
References NULL, priv, and RX_RING_SIZE.
Referenced by nv_init_rings().
|
static |
nv_init_rings - Allocate and intialize descriptor rings
priv | Driver private structure |
rc | Return status code |
Definition at line 263 of file forcedeth.c.
References cpu_to_le32, DBG, ENOMEM, ioaddr, malloc_phys(), nv_alloc_rx(), nv_init_rx_ring(), nv_init_tx_ring(), NVREG_RINGSZ_RXSHIFT, NVREG_RINGSZ_TXSHIFT, NvRegRingSizes, NvRegRxRingPhysAddr, NvRegTxRingPhysAddr, priv, rc, RX_RING_SIZE, RXTX_RING_SIZE, TX_RING_SIZE, virt_to_bus(), and writel().
Referenced by forcedeth_open().
|
static |
Definition at line 305 of file forcedeth.c.
References DBGP, free_iob(), free_phys(), NULL, priv, RX_RING_SIZE, and RXTX_RING_SIZE.
Referenced by forcedeth_close().
|
static |
Definition at line 320 of file forcedeth.c.
References ioaddr, NV_TXRX_RESET_DELAY, NVREG_TXRXCTL_BIT2, NVREG_TXRXCTL_DESC_1, NVREG_TXRXCTL_RESET, NvRegTxRxControl, pci_push(), priv, udelay(), and writel().
Referenced by forcedeth_close(), and forcedeth_open().
|
static |
Definition at line 334 of file forcedeth.c.
References ioaddr, NvRegIrqMask, pci_push(), priv, and writel().
Referenced by forcedeth_close(), forcedeth_irq(), and forcedeth_open().
|
static |
Definition at line 343 of file forcedeth.c.
References ioaddr, NVREG_IRQMASK_THROUGHPUT, NvRegIrqMask, priv, and writel().
Referenced by forcedeth_irq().
|
static |
Definition at line 351 of file forcedeth.c.
References DBG, DBGP, tlan_private::duplex, ioaddr, NVREG_RCVCTL_RX_PATH_EN, NVREG_RCVCTL_START, NvRegLinkSpeed, NvRegReceiverControl, pci_push(), priv, readl(), and writel().
Referenced by forcedeth_open(), and nv_update_linkspeed().
|
static |
Definition at line 375 of file forcedeth.c.
References DBGP, ioaddr, NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX, NV_RXSTOP_DELAY2, NVREG_RCVCTL_RX_PATH_EN, NVREG_RCVCTL_START, NVREG_RCVSTAT_BUSY, NvRegLinkSpeed, NvRegReceiverControl, NvRegReceiverStatus, priv, readl(), reg_delay(), udelay(), and writel().
Referenced by forcedeth_close(), and nv_update_linkspeed().
|
static |
Definition at line 396 of file forcedeth.c.
References DBGP, ioaddr, NVREG_XMITCTL_START, NVREG_XMITCTL_TX_PATH_EN, NvRegTransmitterControl, pci_push(), priv, readl(), and writel().
Referenced by forcedeth_open(), and nv_update_linkspeed().
|
static |
Definition at line 410 of file forcedeth.c.
References DBGP, ioaddr, NV_TXSTOP_DELAY1, NV_TXSTOP_DELAY1MAX, NV_TXSTOP_DELAY2, NVREG_TRANSMITPOLL_MAC_ADDR_REV, NVREG_XMITCTL_START, NVREG_XMITCTL_TX_PATH_EN, NVREG_XMITSTAT_BUSY, NvRegTransmitPoll, NvRegTransmitterControl, NvRegTransmitterStatus, priv, readl(), reg_delay(), udelay(), and writel().
Referenced by forcedeth_close(), and nv_update_linkspeed().
|
static |
Definition at line 435 of file forcedeth.c.
References DEV_HAS_PAUSEFRAME_TX_V2, DEV_HAS_PAUSEFRAME_TX_V3, ioaddr, NV_PAUSEFRAME_RX_CAPABLE, NV_PAUSEFRAME_RX_ENABLE, NV_PAUSEFRAME_TX_CAPABLE, NV_PAUSEFRAME_TX_ENABLE, NVREG_MISC1_PAUSE_TX, NVREG_PFF_PAUSE_RX, NVREG_TX_PAUSEFRAME_DISABLE, NVREG_TX_PAUSEFRAME_ENABLE_V1, NVREG_TX_PAUSEFRAME_ENABLE_V2, NVREG_TX_PAUSEFRAME_ENABLE_V3, NVREG_TX_PAUSEFRAMELIMIT_ENABLE, NvRegMisc1, NvRegPacketFilterFlags, NvRegTxPauseFrame, NvRegTxPauseFrameLimit, priv, readl(), and writel().
Referenced by nv_update_linkspeed().
|
static |
Definition at line 475 of file forcedeth.c.
References ADVERTISE_1000FULL, ADVERTISE_PAUSE_ASYM, ADVERTISE_PAUSE_CAP, BMSR_ANEGCOMPLETE, BMSR_LSTATUS, DBG, DEV_HAS_COLLISION_FIX, tlan_private::duplex, EXPANSION_NWAY, ioaddr, LPA_1000FULL, LPA_100FULL, LPA_100HALF, LPA_10FULL, LPA_10HALF, LPA_PAUSE_ASYM, LPA_PAUSE_CAP, MII_ADVERTISE, MII_BMSR, MII_CTRL1000, MII_EXPANSION, MII_LPA, MII_READ, mii_rw(), MII_STAT1000, NV_PAUSEFRAME_AUTONEG, NV_PAUSEFRAME_RX_ENABLE, NV_PAUSEFRAME_TX_ENABLE, NV_PAUSEFRAME_TX_REQ, NV_RESTART_RX, NV_RESTART_TX, nv_start_rx(), nv_start_tx(), nv_stop_rx(), nv_stop_tx(), nv_update_pause(), NVREG_LINKSPEED_10, NVREG_LINKSPEED_100, NVREG_LINKSPEED_1000, NVREG_LINKSPEED_FORCE, NVREG_LINKSPEED_MASK, NVREG_MISC1_FORCE, NVREG_MISC1_HD, NVREG_RCVCTL_START, NVREG_SLOTTIME_1000_FULL, NVREG_SLOTTIME_10_100_FULL, NVREG_TX_DEFERRAL_DEFAULT, NVREG_TX_DEFERRAL_MII_STRETCH, NVREG_TX_DEFERRAL_RGMII_1000, NVREG_TX_DEFERRAL_RGMII_10_100, NVREG_TX_DEFERRAL_RGMII_STRETCH_10, NVREG_TX_DEFERRAL_RGMII_STRETCH_100, NVREG_TX_WM_DESC1_DEFAULT, NVREG_XMITCTL_START, NvRegLinkSpeed, NvRegMisc1, NvRegPhyInterface, NvRegReceiverControl, NvRegSlotTime, NvRegTransmitterControl, NvRegTxDeferral, NvRegTxWatermark, pci_push(), PHY_100, PHY_1000, PHY_GIGABIT, PHY_HALF, PHY_RGMII, priv, readl(), retval, and writel().
Referenced by forcedeth_link_status(), and forcedeth_open().
|
static |
open - Called when a network interface is made active
netdev | Network device |
rc | Return status code, 0 on success, negative value on failure |
Definition at line 678 of file forcedeth.c.
References BMCR_PDOWN, DBGP, DEV_HAS_POWER_CNTRL, ioaddr, low, MII_BMCR, MII_READ, mii_rw(), netdev, nv_disable_hw_interrupts(), nv_init_rings(), nv_mac_reset(), NV_SETUP5_DELAY, NV_SETUP5_DELAYMAX, nv_start_rx(), nv_start_tx(), nv_txrx_gate(), nv_txrx_reset(), nv_update_linkspeed(), NVREG_ADAPTCTL_PHYSHIFT, NVREG_ADAPTCTL_PHYVALID, NVREG_ADAPTCTL_RUNNING, NVREG_IRQSTAT_MASK, NVREG_MCASTMASKA_NONE, NVREG_MCASTMASKB_NONE, NVREG_MII_LINKCHANGE, NVREG_MIIDELAY, NVREG_MIISPEED_BIT8, NVREG_MIISTAT_MASK_ALL, NVREG_MISC1_FORCE, NVREG_MISC1_HD, NVREG_PFF_PROMISC, NVREG_POLL_DEFAULT_THROUGHPUT, NVREG_POWERSTATE_POWEREDUP, NVREG_POWERSTATE_VALID, NVREG_RX_DEFERRAL_DEFAULT, NVREG_SLOTTIME_DEFAULT, NVREG_SLOTTIME_MASK, NVREG_TRANSMITPOLL_MAC_ADDR_REV, NVREG_TX_DEFERRAL_DEFAULT, NVREG_TX_WM_DESC1_DEFAULT, NVREG_TXRXCTL_BIT1, NVREG_TXRXCTL_DESC_1, NVREG_UNKSETUP5_BIT31, NVREG_UNKSETUP6_VAL, NvRegAdapterControl, NvRegIrqStatus, NvRegLinkSpeed, NvRegMIIMask, NvRegMIISpeed, NvRegMIIStatus, NvRegMisc1, NvRegMulticastAddrA, NvRegMulticastAddrB, NvRegMulticastMaskA, NvRegMulticastMaskB, NvRegOffloadConfig, NvRegPacketFilterFlags, NvRegPollingInterval, NvRegPowerState, NvRegReceiverControl, NvRegReceiverStatus, NvRegRxDeferral, NvRegSlotTime, NvRegTransmitPoll, NvRegTransmitterControl, NvRegTransmitterStatus, NvRegTxDeferral, NvRegTxRxControl, NvRegTxWatermark, NvRegUnknownSetupReg5, NvRegUnknownSetupReg6, NvRegVlanControl, pci_push(), priv, net_device::priv, random(), rc, readl(), reg_delay(), RX_BUF_SZ, udelay(), and writel().
|
static |
transmit - Transmit a packet
netdev | Network device |
iobuf | I/O buffer |
rc | Returns 0 on success, negative on failure |
Definition at line 795 of file forcedeth.c.
References ring_desc::buf, cpu_to_le32, io_buffer::data, DBG, DBGP, ENOBUFS, ETH_ZLEN, ring_desc::flaglen, ioaddr, iob_len(), iob_pad(), netdev, NV_TX_LASTPACKET, NV_TX_VALID, NVREG_TXRXCTL_DESC_1, NVREG_TXRXCTL_KICK, NvRegTxRxControl, pci_push(), priv, net_device::priv, size, TX_RING_SIZE, virt_to_bus(), wmb(), and writel().
|
static |
nv_process_tx_packets - Checks for successfully sent packets, reports them to iPXE with netdev_tx_complete()
netdev | Network device |
Definition at line 854 of file forcedeth.c.
References DBG, DBGP, ring_desc::flaglen, le32_to_cpu, memset(), netdev, netdev_tx_complete(), NV_TX_VALID, priv, net_device::priv, rmb, and TX_RING_SIZE.
Referenced by forcedeth_poll().
|
static |
nv_process_rx_packets - Checks for received packets, reports them to iPXE with netdev_rx() or netdev_rx_err() if there was an error receiving the packet
netdev | Network device |
Definition at line 900 of file forcedeth.c.
References DBG, DBGP, EINVAL, ring_desc::flaglen, flags, iob_put, le32_to_cpu, len, LEN_MASK_V1, memset(), netdev, netdev_rx(), netdev_rx_err(), NULL, nv_alloc_rx(), NV_RX_AVAIL, NV_RX_DESCRIPTORVALID, NV_RX_ERROR, priv, net_device::priv, rmb, and RX_RING_SIZE.
Referenced by forcedeth_poll().
|
static |
check_link - Check for link status change
netdev | Network device |
Definition at line 961 of file forcedeth.c.
References ioaddr, netdev, netdev_link_down(), netdev_link_up(), nv_update_linkspeed(), NVREG_MIISTAT_LINKCHANGE, NvRegMIIStatus, priv, net_device::priv, readl(), and writel().
Referenced by forcedeth_poll(), and forcedeth_probe().
|
static |
poll - Poll for received packets
netdev | Network device |
Definition at line 982 of file forcedeth.c.
References DBG, DBGP, forcedeth_link_status(), ioaddr, netdev, netdev_link_ok(), nv_process_rx_packets(), nv_process_tx_packets(), NVREG_IRQ_LINK, NVREG_IRQSTAT_MASK, NvRegIrqStatus, priv, net_device::priv, readl(), status, and writel().
|
static |
close - Disable network interface
netdev | network interface device structure |
Definition at line 1019 of file forcedeth.c.
References DBGP, netdev, nv_disable_hw_interrupts(), nv_free_rxtx_resources(), nv_stop_rx(), nv_stop_tx(), nv_txrx_gate(), nv_txrx_reset(), priv, and net_device::priv.
|
static |
irq - enable or disable interrupts
netdev | network adapter |
action | requested interrupt action |
Definition at line 1046 of file forcedeth.c.
References DBGP, netdev, nv_disable_hw_interrupts(), nv_enable_hw_interrupts(), priv, and net_device::priv.
|
static |
Definition at line 1071 of file forcedeth.c.
References DBG, net_device::dev, DEV_HAS_CORRECT_MACADDR, EADDRNOTAVAIL, eth_ntoa(), ioaddr, is_valid_ether_addr(), NVREG_TRANSMITPOLL_MAC_ADDR_REV, NvRegMacAddrA, NvRegMacAddrB, NvRegTransmitPoll, priv, and readl().
Referenced by forcedeth_probe().
|
static |
Definition at line 1111 of file forcedeth.c.
References ioaddr, mdelay(), NVREG_XMITCTL_HOST_SEMA_ACQ, NVREG_XMITCTL_HOST_SEMA_MASK, NVREG_XMITCTL_MGMT_SEMA_FREE, NVREG_XMITCTL_MGMT_SEMA_MASK, NvRegTransmitterControl, priv, readl(), udelay(), and writel().
Referenced by nv_setup_phy().
|
static |
Definition at line 1150 of file forcedeth.c.
References DEV_HAS_MGMT_UNIT, ioaddr, NVREG_XMITCTL_HOST_SEMA_ACQ, NvRegTransmitterControl, priv, readl(), and writel().
Referenced by forcedeth_remove().
|
static |
Definition at line 1165 of file forcedeth.c.
References currticks(), ioaddr, mdelay(), NVREG_MGMTUNITGETVERSION, NVREG_MGMTUNITVERSION, NVREG_XMITCTL_DATA_ERROR, NVREG_XMITCTL_DATA_READY, NVREG_XMITCTL_DATA_START, NvRegMgmtUnitGetVersion, NvRegMgmtUnitVersion, NvRegTransmitterControl, priv, readl(), start, TICKS_PER_SEC, and writel().
Referenced by nv_setup_phy().
|
static |
Definition at line 1201 of file forcedeth.c.
References BMCR_RESET, mdelay(), MII_BMCR, MII_READ, mii_rw(), and priv.
Referenced by phy_init().
|
static |
Definition at line 1224 of file forcedeth.c.
References ADVERTISE_1000FULL, ADVERTISE_1000HALF, ADVERTISE_100FULL, ADVERTISE_100HALF, ADVERTISE_10FULL, ADVERTISE_10HALF, ADVERTISE_PAUSE_ASYM, ADVERTISE_PAUSE_CAP, BMCR_ANENABLE, BMCR_ANRESTART, DBG, DEV_NEED_PHY_INIT_FIX, ioaddr, mdelay(), MII_ADVERTISE, MII_BMCR, MII_BMSR, MII_CTRL1000, MII_NCONFIG, MII_READ, MII_RESV1, mii_rw(), MII_SREVISION, NVREG_POWERSTATE2_PHY_RESET, NvRegPhyInterface, NvRegPowerState2, PHY_CICADA_INIT1, PHY_CICADA_INIT2, PHY_CICADA_INIT3, PHY_CICADA_INIT4, PHY_CICADA_INIT5, PHY_CICADA_INIT6, PHY_ERROR, PHY_GIGABIT, PHY_MARVELL_E3016_INITMASK, PHY_MODEL_MARVELL_E3016, PHY_MODEL_REALTEK_8201, PHY_MODEL_REALTEK_8211, PHY_OUI_CICADA, PHY_OUI_REALTEK, PHY_OUI_VITESSE, PHY_REALTEK_INIT1, PHY_REALTEK_INIT10, PHY_REALTEK_INIT11, PHY_REALTEK_INIT2, PHY_REALTEK_INIT3, PHY_REALTEK_INIT4, PHY_REALTEK_INIT5, PHY_REALTEK_INIT6, PHY_REALTEK_INIT7, PHY_REALTEK_INIT9, PHY_REALTEK_INIT_MSK1, PHY_REALTEK_INIT_REG1, PHY_REALTEK_INIT_REG2, PHY_REALTEK_INIT_REG3, PHY_REALTEK_INIT_REG4, PHY_REALTEK_INIT_REG5, PHY_REALTEK_INIT_REG6, PHY_REALTEK_INIT_REG7, phy_reset(), PHY_REV_REALTEK_8211B, PHY_REV_REALTEK_8211C, PHY_RGMII, PHY_VITESSE_INIT1, PHY_VITESSE_INIT10, PHY_VITESSE_INIT2, PHY_VITESSE_INIT3, PHY_VITESSE_INIT4, PHY_VITESSE_INIT5, PHY_VITESSE_INIT6, PHY_VITESSE_INIT7, PHY_VITESSE_INIT8, PHY_VITESSE_INIT9, PHY_VITESSE_INIT_MSK1, PHY_VITESSE_INIT_MSK2, PHY_VITESSE_INIT_REG1, PHY_VITESSE_INIT_REG2, PHY_VITESSE_INIT_REG3, PHY_VITESSE_INIT_REG4, priv, readl(), reg, and writel().
Referenced by nv_setup_phy().
|
static |
nv_setup_phy - Find PHY and initialize it
priv | Driver private structure |
rc | Return status code |
Definition at line 1609 of file forcedeth.c.
References DBG, DEV_HAS_MGMT_UNIT, DEV_HAS_POWER_CNTRL, DEV_NEED_LOW_POWER_FIX, ENODEV, ioaddr, MII_BMSR, MII_PHYSID1, MII_PHYSID2, MII_READ, MII_RESV1, mii_rw(), nv_mgmt_acquire_sema(), nv_mgmt_get_version(), NVREG_ADAPTCTL_RUNNING, NVREG_MGMTUNITCONTROL_INUSE, NVREG_MIISTAT_MASK_ALL, NVREG_POWERSTATE2_POWERUP_MASK, NVREG_POWERSTATE2_POWERUP_REV_A3, NVREG_XMITCTL_MGMT_ST, NVREG_XMITCTL_SYNC_MASK, NVREG_XMITCTL_SYNC_PHY_INIT, NvRegAdapterControl, NvRegMgmtUnitControl, NvRegMIIMask, NvRegMIIStatus, NvRegPowerState2, NvRegTransmitterControl, PHY_GIGABIT, phy_init(), PHY_MODEL_REALTEK_8211, PHY_OUI_REALTEK, PHY_OUI_REALTEK2, PHY_REV_MASK, PHYID1_OUI_MASK, PHYID1_OUI_SHFT, PHYID2_MODEL_MASK, PHYID2_OUI_MASK, PHYID2_OUI_SHFT, priv, rc, readl(), and writel().
Referenced by forcedeth_probe().
|
static |
forcedeth_map_regs - Find a suitable BAR for the NIC and map the registers in memory
priv | Driver private structure |
rc | Return status code |
Definition at line 1726 of file forcedeth.c.
References addr, DBG, DEV_HAS_MSI_X, DEV_HAS_POWER_CNTRL, DEV_HAS_STATISTICS_V1, DEV_HAS_STATISTICS_V2, DEV_HAS_STATISTICS_V3, DEV_HAS_VLAN, EINVAL, ENOMEM, ioaddr, NV_PCI_REGSZ_VER1, NV_PCI_REGSZ_VER2, NV_PCI_REGSZ_VER3, pci_bar_size(), pci_bar_start(), PCI_BASE_ADDRESS_0, PCI_BASE_ADDRESS_5, PCI_BASE_ADDRESS_SPACE_IO, pci_ioremap(), pci_read_config_dword(), priv, rc, and reg.
Referenced by forcedeth_probe().
|
static |
probe - Initial configuration of NIC
pdev | PCI device |
ent | PCI IDs |
rc | Return status code |
Definition at line 1789 of file forcedeth.c.
References adjust_pci_device(), alloc_etherdev(), DBG, DBGP, pci_device::dev, net_device::dev, DEV_HAS_PAUSEFRAME_TX_V1, DEV_HAS_PAUSEFRAME_TX_V2, DEV_HAS_PAUSEFRAME_TX_V3, pci_device_id::device, pci_device_id::driver_data, tlan_private::duplex, ENOMEM, forcedeth_link_status(), forcedeth_map_regs(), forcedeth_operations, pci_device::id, ioaddr, iounmap(), pci_device_id::name, netdev, netdev_init(), netdev_nullify(), netdev_put(), NV_PAUSEFRAME_AUTONEG, NV_PAUSEFRAME_RX_CAPABLE, NV_PAUSEFRAME_RX_REQ, NV_PAUSEFRAME_TX_CAPABLE, NV_PAUSEFRAME_TX_REQ, nv_setup_mac_addr(), nv_setup_phy(), NVREG_LINKSPEED_10, NVREG_LINKSPEED_FORCE, NVREG_TX_PAUSEFRAME_DISABLE, NvRegTxPauseFrame, NvRegWakeUpFlags, pci_set_drvdata(), priv, net_device::priv, rc, register_netdev(), pci_device_id::vendor, and writel().
|
static |
Definition at line 1881 of file forcedeth.c.
References BMCR_ANENABLE, BMCR_ANRESTART, MII_BMCR, MII_READ, mii_rw(), PHY_MODEL_REALTEK_8201, PHY_OUI_REALTEK, PHY_REALTEK_INIT1, PHY_REALTEK_INIT3, PHY_REALTEK_INIT8, PHY_REALTEK_INIT_MSK1, PHY_REALTEK_INIT_REG1, PHY_REALTEK_INIT_REG2, and priv.
Referenced by forcedeth_remove().
|
static |
remove - Device Removal Routine
pdev | PCI device information struct |
Definition at line 1911 of file forcedeth.c.
References DBGP, iounmap(), netdev, netdev_nullify(), netdev_put(), nv_mgmt_release_sema(), nv_restore_phy(), pci_get_drvdata(), priv, net_device::priv, and unregister_netdev().
|
static |
Definition at line 1062 of file forcedeth.c.
Referenced by forcedeth_probe().
|
static |
Definition at line 1930 of file forcedeth.c.
struct pci_driver forcedeth_driver __pci_driver |
Definition at line 1973 of file forcedeth.c.