iPXE
|
#include <stdint.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 <byteswap.h>
#include <mii.h>
#include "sky2.h"
Go to the source code of this file.
Macros | |
#define | DRV_NAME "sky2" |
#define | DRV_VERSION "1.22" |
#define | PFX DRV_NAME " " |
#define | RX_LE_SIZE 128 |
#define | RX_LE_BYTES (RX_LE_SIZE*sizeof(struct sky2_rx_le)) |
#define | RX_RING_ALIGN 4096 |
#define | RX_PENDING (RX_LE_SIZE/6 - 2) |
#define | TX_RING_SIZE 128 |
#define | TX_PENDING (TX_RING_SIZE - 1) |
#define | TX_RING_ALIGN 4096 |
#define | MAX_SKB_TX_LE 4 |
#define | STATUS_RING_SIZE 512 /* 2 ports * (TX + RX) */ |
#define | STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le)) |
#define | STATUS_RING_ALIGN 4096 |
#define | PHY_RETRIES 1000 |
#define | SKY2_EEPROM_MAGIC 0x9955aabb |
#define | RING_NEXT(x, s) (((x)+1) & ((s)-1)) |
Functions | |
FILE_LICENCE (GPL2_ONLY) | |
static void | sky2_set_multicast (struct net_device *dev) |
static int | gm_phy_write (struct sky2_hw *hw, unsigned port, u16 reg, u16 val) |
static int | __gm_phy_read (struct sky2_hw *hw, unsigned port, u16 reg, u16 *val) |
static u16 | gm_phy_read (struct sky2_hw *hw, unsigned port, u16 reg) |
static void | sky2_power_on (struct sky2_hw *hw) |
static void | sky2_power_aux (struct sky2_hw *hw) |
static void | sky2_gmac_reset (struct sky2_hw *hw, unsigned port) |
static void | sky2_phy_init (struct sky2_hw *hw, unsigned port) |
static void | sky2_phy_power_up (struct sky2_hw *hw, unsigned port) |
static void | sky2_phy_power_down (struct sky2_hw *hw, unsigned port) |
static void | sky2_set_tx_stfwd (struct sky2_hw *hw, unsigned port) |
static void | sky2_mac_init (struct sky2_hw *hw, unsigned port) |
static void | sky2_ramset (struct sky2_hw *hw, u16 q, u32 start, u32 space) |
static void | sky2_qset (struct sky2_hw *hw, u16 q) |
static void | sky2_prefetch_init (struct sky2_hw *hw, u32 qaddr, u64 addr, u32 last) |
static struct sky2_tx_le * | get_tx_le (struct sky2_port *sky2) |
static void | tx_init (struct sky2_port *sky2) |
static struct tx_ring_info * | tx_le_re (struct sky2_port *sky2, struct sky2_tx_le *le) |
static void | sky2_put_idx (struct sky2_hw *hw, unsigned q, u16 idx) |
static struct sky2_rx_le * | sky2_next_rx (struct sky2_port *sky2) |
static void | sky2_rx_add (struct sky2_port *sky2, u8 op, u32 map, unsigned len) |
static void | sky2_rx_submit (struct sky2_port *sky2, const struct rx_ring_info *re) |
static void | sky2_rx_map_iob (struct pci_device *pdev __unused, struct rx_ring_info *re, unsigned size __unused) |
static void | rx_set_checksum (struct sky2_port *sky2) |
static void | sky2_rx_stop (struct sky2_port *sky2) |
static void | sky2_rx_clean (struct sky2_port *sky2) |
static struct io_buffer * | sky2_rx_alloc (struct sky2_port *sky2) |
static void | sky2_rx_update (struct sky2_port *sky2, unsigned rxq) |
static int | sky2_rx_start (struct sky2_port *sky2) |
static void | sky2_free_rings (struct sky2_port *sky2) |
static int | sky2_up (struct net_device *dev) |
static int | tx_dist (unsigned tail, unsigned head) |
static int | tx_avail (const struct sky2_port *sky2) |
static int | sky2_xmit_frame (struct net_device *dev, struct io_buffer *iob) |
static void | sky2_tx_complete (struct sky2_port *sky2, u16 done) |
static void | sky2_tx_clean (struct net_device *dev) |
static void | sky2_down (struct net_device *dev) |
static u16 | sky2_phy_speed (const struct sky2_hw *hw, u16 aux) |
static void | sky2_link_up (struct sky2_port *sky2) |
static void | sky2_link_down (struct sky2_port *sky2) |
static int | sky2_autoneg_done (struct sky2_port *sky2, u16 aux) |
static void | sky2_phy_intr (struct sky2_hw *hw, unsigned port) |
static struct io_buffer * | receive_new (struct sky2_port *sky2, struct rx_ring_info *re, unsigned int length) |
static struct io_buffer * | sky2_receive (struct net_device *dev, u16 length, u32 status) |
static void | sky2_tx_done (struct net_device *dev, u16 last) |
static void | sky2_status_intr (struct sky2_hw *hw, u16 idx) |
static void | sky2_hw_error (struct sky2_hw *hw, unsigned port, u32 status) |
static void | sky2_hw_intr (struct sky2_hw *hw) |
static void | sky2_mac_intr (struct sky2_hw *hw, unsigned port) |
static void | sky2_le_error (struct sky2_hw *hw, unsigned port, u16 q, unsigned ring_size __unused) |
static void | sky2_err_intr (struct sky2_hw *hw, u32 status) |
static void | sky2_poll (struct net_device *dev) |
static u32 | sky2_mhz (const struct sky2_hw *hw) |
static u32 | sky2_us2clk (const struct sky2_hw *hw, u32 us) |
static u32 | sky2_clk2us (const struct sky2_hw *hw, u32 clk) |
static int | sky2_init (struct sky2_hw *hw) |
static void | sky2_reset (struct sky2_hw *hw) |
static u32 | sky2_supported_modes (const struct sky2_hw *hw) |
static struct net_device * | sky2_init_netdev (struct sky2_hw *hw, unsigned port) |
static void | sky2_show_addr (struct net_device *dev) |
static void | sky2_net_irq (struct net_device *dev, int enable) |
static int | sky2_probe (struct pci_device *pdev) |
static void | sky2_remove (struct pci_device *pdev) |
Variables | |
static struct pci_device_id | sky2_id_table [] |
static const unsigned | txqaddr [] = { Q_XA1, Q_XA2 } |
static const unsigned | rxqaddr [] = { Q_R1, Q_R2 } |
static const u32 | portirq_msk [] = { Y2_IS_PORT_1, Y2_IS_PORT_2 } |
static const u16 | copper_fc_adv [] |
static const u16 | fiber_fc_adv [] |
static const u16 | gm_fc_disable [] |
static const u32 | phy_power [] = { PCI_Y2_PHY1_POWD, PCI_Y2_PHY2_POWD } |
static const u32 | coma_mode [] = { PCI_Y2_PHY1_COMA, PCI_Y2_PHY2_COMA } |
static struct net_device_operations | sky2_operations |
struct pci_driver sky2_driver | __pci_driver |
#define RX_LE_BYTES (RX_LE_SIZE*sizeof(struct sky2_rx_le)) |
#define RX_PENDING (RX_LE_SIZE/6 - 2) |
#define TX_PENDING (TX_RING_SIZE - 1) |
#define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le)) |
FILE_LICENCE | ( | GPL2_ONLY | ) |
|
static |
Definition at line 2153 of file sky2.c.
References filter, GM_MC_ADDR_H1, GM_MC_ADDR_H2, GM_MC_ADDR_H3, GM_MC_ADDR_H4, GM_RX_CTRL, GM_RXCR_UCF_ENA, gma_read16(), gma_write16(), sky2_port::hw, memset(), port, sky2_port::port, net_device::priv, and reg.
Referenced by sky2_up().
Definition at line 131 of file sky2.c.
References ctrl, DBG, EIO, ETIMEDOUT, GM_SMI_CT_BUSY, GM_SMI_CT_PHY_AD, GM_SMI_CT_REG_AD, GM_SMI_CTRL, GM_SMI_DATA, gma_read16(), gma_write16(), PFX, PHY_ADDR_MARV, PHY_RETRIES, port, reg, udelay(), and val.
Referenced by sky2_link_down(), sky2_link_up(), sky2_phy_init(), sky2_phy_power_down(), and sky2_phy_power_up().
Definition at line 158 of file sky2.c.
References ctrl, DBG, EIO, ETIMEDOUT, GM_SMI_CT_OP_RD, GM_SMI_CT_PHY_AD, GM_SMI_CT_RD_VAL, GM_SMI_CT_REG_AD, GM_SMI_CTRL, GM_SMI_DATA, gma_read16(), gma_write16(), PFX, PHY_ADDR_MARV, PHY_RETRIES, port, reg, udelay(), and val.
Referenced by gm_phy_read().
Definition at line 185 of file sky2.c.
References __gm_phy_read(), port, and reg.
Referenced by sky2_autoneg_done(), sky2_mac_init(), sky2_phy_init(), sky2_phy_intr(), and sky2_phy_power_down().
|
static |
Definition at line 193 of file sky2.c.
References B0_POWER_CTRL, B2_GP_IO, B2_Y2_CLK_CTRL, B2_Y2_CLK_GATE, CHIP_ID_YUKON_XL, GLB_GPIO_STAT_RACE_DIS, P_ASPM_CONTROL_MSK, P_CTL_TIM_VMAIN_AV_MSK, PC_VAUX_ENA, PC_VAUX_OFF, PC_VCC_ENA, PC_VCC_ON, PCI_CFG_REG_1, PCI_DEV_REG3, PCI_DEV_REG4, PCI_DEV_REG5, reg, SKY2_HW_ADV_POWER_CTL, sky2_pci_read32(), sky2_pci_write32(), sky2_read32(), sky2_write32(), sky2_write8(), Y2_CLK_DIV_DIS, Y2_CLK_GAT_LNK1_DIS, Y2_CLK_GAT_LNK2_DIS, Y2_COR_CLK_LNK1_DIS, Y2_COR_CLK_LNK2_DIS, Y2_PCI_CLK_LNK1_DIS, and Y2_PCI_CLK_LNK2_DIS.
Referenced by sky2_reset().
|
static |
Definition at line 237 of file sky2.c.
References B0_CTST, B0_POWER_CTRL, B2_Y2_CLK_GATE, CHIP_ID_YUKON_XL, PC_VAUX_ENA, PC_VAUX_ON, PC_VCC_ENA, PC_VCC_OFF, sky2_read32(), sky2_write8(), Y2_CLK_GAT_LNK1_DIS, Y2_CLK_GAT_LNK2_DIS, Y2_COR_CLK_LNK1_DIS, Y2_COR_CLK_LNK2_DIS, Y2_PCI_CLK_LNK1_DIS, Y2_PCI_CLK_LNK2_DIS, and Y2_VAUX_AVAIL.
Referenced by sky2_remove().
|
static |
Definition at line 255 of file sky2.c.
References GM_MC_ADDR_H1, GM_MC_ADDR_H2, GM_MC_ADDR_H3, GM_MC_ADDR_H4, GM_RX_CTRL, GM_RXCR_MCF_ENA, GM_RXCR_UCF_ENA, gma_read16(), gma_write16(), GMAC_IRQ_MSK, port, reg, SK_REG, and sky2_write8().
Referenced by sky2_down(), and sky2_reset().
|
static |
Definition at line 297 of file sky2.c.
References ADVERTISED_1000baseT_Full, ADVERTISED_1000baseT_Half, ADVERTISED_100baseT_Full, ADVERTISED_100baseT_Half, ADVERTISED_10baseT_Full, ADVERTISED_10baseT_Half, sky2_port::advertising, sky2_port::autoneg, AUTONEG_DISABLE, AUTONEG_ENABLE, BLINK_84MS, CHIP_ID_YUKON_EC, CHIP_ID_YUKON_EC_U, CHIP_ID_YUKON_EX, CHIP_ID_YUKON_FE, CHIP_ID_YUKON_FE_P, CHIP_ID_YUKON_SUPR, CHIP_ID_YUKON_UL_2, CHIP_ID_YUKON_XL, CHIP_REV_YU_FE2_A0, copper_fc_adv, ctrl, sky2_port::duplex, DUPLEX_FULL, FC_NONE, FC_RX, fiber_fc_adv, sky2_port::flow_mode, gm_fc_disable, GM_GP_CTRL, GM_GPCR_AU_ALL_DIS, GM_GPCR_DUP_FULL, GM_GPCR_SPEED_100, GM_GPCR_SPEED_1000, gm_phy_read(), gm_phy_write(), gma_write16(), GMAC_CTRL, GMC_PAUSE_OFF, GMC_PAUSE_ON, LED_PAR_CTRL_ACT_BL, LED_PAR_CTRL_LINK, LED_PAR_CTRL_SPEED, MAC_TX_CLK_25_MHZ, MO_LED_OFF, MO_LED_ON, PHY_AN_CSMA, PHY_CT_ANE, PHY_CT_DUP_MD, PHY_CT_RE_CFG, PHY_CT_RESET, PHY_CT_SP100, PHY_CT_SP1000, PHY_M_1000C_AFD, PHY_M_1000C_AHD, PHY_M_1000C_MSE, PHY_M_AN_1000X_AFD, PHY_M_AN_1000X_AHD, PHY_M_AN_100_FD, PHY_M_AN_100_HD, PHY_M_AN_10_FD, PHY_M_AN_10_HD, PHY_M_DEF_MSK, PHY_M_EC_DOWN_S_ENA, PHY_M_EC_DSC_2, PHY_M_EC_M_DSC, PHY_M_EC_M_DSC_MSK, PHY_M_EC_MAC_S, PHY_M_EC_MAC_S_MSK, PHY_M_EC_S_DSC, PHY_M_EC_S_DSC_MSK, PHY_M_FELP_LED0_CTRL, PHY_M_FELP_LED1_CTRL, PHY_M_FELP_LED1_MSK, PHY_M_FELP_LED2_CTRL, PHY_M_FESC_SEL_CL_A, PHY_M_FIB_SIGD_POL, PHY_M_IS_AN_COMPL, PHY_M_LED_BLINK_RT, PHY_M_LED_MO_100, PHY_M_LED_MO_RX, PHY_M_LED_PULS_DUR, PHY_M_LEDC_INIT_CTRL, PHY_M_LEDC_LOS_CTRL, PHY_M_LEDC_STA0_CTRL, PHY_M_LEDC_STA1_CTRL, PHY_M_LEDC_TX_CTRL, PHY_M_MAC_MD_1000BX, PHY_M_MAC_MD_MSK, PHY_M_MAC_MODE_SEL, PHY_M_PC_DIS_SCRAMB, PHY_M_PC_DOWN_S_ENA, PHY_M_PC_DSC, PHY_M_PC_DSC_MSK, PHY_M_PC_EN_DET_MSK, PHY_M_PC_ENA_AUTO, PHY_M_PC_ENA_ENE_DT, PHY_M_PC_ENA_LIP_NP, PHY_M_PC_MDI_XMODE, PHY_M_PC_MDIX_MSK, PHY_M_POLC_INIT_CTRL, PHY_M_POLC_IS0_P_MIX, PHY_M_POLC_LOS_CTRL, PHY_M_POLC_LS1_P_MIX, PHY_M_POLC_STA0_CTRL, PHY_M_POLC_STA1_CTRL, PHY_MARV_1000T_CTRL, PHY_MARV_AUNE_ADV, PHY_MARV_CTRL, PHY_MARV_EXT_ADR, PHY_MARV_EXT_CTRL, PHY_MARV_FE_LED_PAR, PHY_MARV_FE_SPEC_2, PHY_MARV_INT_MASK, PHY_MARV_LED_CTRL, PHY_MARV_LED_OVER, PHY_MARV_PAGE_ADDR, PHY_MARV_PAGE_DATA, PHY_MARV_PHY_CTRL, PHY_MARV_PHY_STAT, port, PULS_170MS, reg, SK_REG, SKY2_HW_FIBRE_PHY, SKY2_HW_GIGABIT, SKY2_HW_NEWER_PHY, sky2_is_copper(), sky2_write8(), spec, sky2_port::speed, SPEED_100, and SPEED_1000.
Referenced by sky2_link_down(), and sky2_mac_init().
|
static |
Definition at line 595 of file sky2.c.
References B2_TST_CTRL1, CHIP_ID_YUKON_FE, CHIP_ID_YUKON_XL, coma_mode, gm_phy_write(), GPC_RST_CLR, GPHY_CTRL, PCI_DEV_REG1, PHY_CT_ANE, PHY_MARV_CTRL, phy_power, port, SK_REG, SKY2_HW_ADV_POWER_CTL, sky2_pci_read32(), sky2_pci_write32(), sky2_write8(), TST_CFG_WRITE_OFF, and TST_CFG_WRITE_ON.
Referenced by sky2_mac_init().
|
static |
Definition at line 616 of file sky2.c.
References B2_TST_CTRL1, CHIP_ID_YUKON_EC, CHIP_ID_YUKON_EC_U, ctrl, GM_GP_CTRL, GM_GPCR_AU_ALL_DIS, GM_GPCR_FL_PASS, GM_GPCR_SPEED_100, gm_phy_read(), gm_phy_write(), gma_write16(), GMAC_CTRL, GMC_RST_CLR, GPC_RST_CLR, GPHY_CTRL, PCI_DEV_REG1, PHY_CT_PDOWN, PHY_M_MAC_GMIF_PUP, PHY_M_PC_POW_D_ENA, PHY_MARV_CTRL, PHY_MARV_EXT_ADR, PHY_MARV_PHY_CTRL, phy_power, port, SK_REG, SKY2_HW_NEWER_PHY, sky2_pci_read32(), sky2_pci_write32(), sky2_write8(), TST_CFG_WRITE_OFF, and TST_CFG_WRITE_ON.
Referenced by sky2_down().
|
static |
Definition at line 669 of file sky2.c.
References CHIP_ID_YUKON_EX, CHIP_ID_YUKON_FE_P, CHIP_ID_YUKON_SUPR, CHIP_REV_YU_EX_A0, port, SK_REG, sky2_write32(), TX_GMF_CTRL_T, TX_JUMBO_DIS, and TX_STFW_ENA.
Referenced by sky2_mac_init().
|
static |
Definition at line 683 of file sky2.c.
References addr, CHIP_ID_YUKON_EX, CHIP_ID_YUKON_FE_P, CHIP_ID_YUKON_XL, CHIP_REV_YU_FE2_A0, DATA_BLIND_DEF, DATA_BLIND_VAL, GM_MIB_CNT_BASE, GM_MIB_CNT_END, GM_PAR_MIB_CLR, GM_PHY_ADDR, gm_phy_read(), GM_RX_CTRL, GM_RX_IRQ_MSK, GM_RXCR_CRC_DIS, GM_RXCR_MCF_ENA, GM_RXCR_UCF_ENA, GM_SERIAL_MODE, GM_SMOD_VLAN_ENA, GM_SRC_ADDR_1L, GM_SRC_ADDR_2L, GM_TR_IRQ_MSK, GM_TX_CTRL, GM_TX_FLOW_CTRL, GM_TX_IRQ_MSK, GM_TX_PARAM, gma_read16(), gma_set_addr(), gma_write16(), GMAC_CTRL, GMAC_DEF_MSK, GMAC_IRQ_MSK, GMAC_IRQ_SRC, GMC_RST_CLR, GMC_RST_SET, GMF_OPER_ON, GMF_RST_CLR, GMF_RX_F_FL_ON, GMF_RX_OVER_ON, GMR_FS_ANY_ERR, GPC_RST_CLR, GPC_RST_SET, GPHY_CTRL, IPG_DATA_DEF, IPG_DATA_VAL, PHY_MARV_ID0, PHY_MARV_ID0_VAL, PHY_MARV_ID1, PHY_MARV_ID1_Y2, PHY_MARV_INT_MASK, port, reg, RX_GMF_CTRL_T, RX_GMF_FL_MSK, RX_GMF_FL_THR, RX_GMF_FL_THR_DEF, RX_GMF_LP_THR, RX_GMF_UP_THR, SK_REG, SKY2_HW_RAM_BUFFER, sky2_phy_init(), sky2_phy_power_up(), sky2_read16(), sky2_set_tx_stfwd(), sky2_write16(), sky2_write32(), sky2_write8(), TX_BACK_OFF_LIM, TX_BOF_LIM_DEF, TX_COL_DEF, TX_COL_THR, TX_DYN_WM_ENA, TX_GMF_CTRL_T, TX_GMF_EA, TX_IPG_JAM_DATA, TX_IPG_JAM_DEF, TX_JAM_IPG_DEF, TX_JAM_IPG_VAL, TX_JAM_LEN_DEF, and TX_JAM_LEN_VAL.
Referenced by sky2_up().
Definition at line 804 of file sky2.c.
References end, Q_R1, Q_R2, RB_ADDR, RB_CTRL, RB_ENA_OP_MD, RB_ENA_STFWD, RB_END, RB_RP, RB_RST_CLR, RB_RX_LTHP, RB_RX_LTPP, RB_RX_UTHP, RB_RX_UTPP, RB_START, RB_WP, sky2_read8(), sky2_write32(), sky2_write8(), start, and tp.
Referenced by sky2_up().
Definition at line 844 of file sky2.c.
References BMU_CLR_RESET, BMU_FIFO_OP_ON, BMU_OPER_INIT, BMU_WM_DEFAULT, Q_ADDR, Q_CSR, Q_WM, and sky2_write32().
Referenced by sky2_rx_start(), and sky2_up().
Definition at line 855 of file sky2.c.
References addr, PREF_UNIT_ADDR_HI, PREF_UNIT_ADDR_LO, PREF_UNIT_CTRL, PREF_UNIT_LAST_IDX, PREF_UNIT_OP_ON, PREF_UNIT_RST_CLR, PREF_UNIT_RST_SET, sky2_read32(), sky2_write16(), sky2_write32(), and Y2_QADDR.
Referenced by sky2_rx_start(), and sky2_up().
|
inlinestatic |
Definition at line 868 of file sky2.c.
References sky2_tx_le::ctrl, RING_NEXT, sky2_port::tx_le, sky2_port::tx_prod, and TX_RING_SIZE.
Referenced by sky2_xmit_frame(), and tx_init().
|
static |
Definition at line 877 of file sky2.c.
References sky2_tx_le::addr, get_tx_le(), HW_OWNER, OP_ADDR64, sky2_tx_le::opcode, sky2_port::tx_cons, and sky2_port::tx_prod.
Referenced by sky2_up().
|
inlinestatic |
Definition at line 888 of file sky2.c.
References sky2_port::tx_le, and sky2_port::tx_ring.
Referenced by sky2_xmit_frame().
Definition at line 895 of file sky2.c.
References DBGIO, PFX, PREF_UNIT_PUT_IDX, sky2_write16(), wmb(), and Y2_QADDR.
Referenced by sky2_rx_update(), and sky2_xmit_frame().
|
inlinestatic |
Definition at line 904 of file sky2.c.
References sky2_rx_le::ctrl, RING_NEXT, sky2_port::rx_le, RX_LE_SIZE, and sky2_port::rx_put.
Referenced by rx_set_checksum(), and sky2_rx_add().
Definition at line 914 of file sky2.c.
References sky2_rx_le::addr, cpu_to_le16, cpu_to_le32, HW_OWNER, len, sky2_rx_le::length, map, op, sky2_rx_le::opcode, and sky2_next_rx().
Referenced by sky2_rx_submit().
|
static |
Definition at line 926 of file sky2.c.
References rx_ring_info::data_addr, OP_PACKET, sky2_port::rx_data_size, and sky2_rx_add().
Referenced by sky2_receive(), and sky2_rx_start().
|
static |
Definition at line 933 of file sky2.c.
References io_buffer::data, rx_ring_info::data_addr, rx_ring_info::iob, and virt_to_bus().
Referenced by receive_new(), and sky2_rx_start().
|
static |
Definition at line 943 of file sky2.c.
References sky2_rx_le::addr, BMU_DIS_RX_CHKSUM, cpu_to_le32, sky2_rx_le::ctrl, ETH_HLEN, sky2_port::hw, HW_OWNER, OP_TCPSTART, sky2_rx_le::opcode, sky2_port::port, Q_ADDR, Q_CSR, rxqaddr, sky2_next_rx(), and sky2_write32().
Referenced by sky2_rx_start().
|
static |
Definition at line 966 of file sky2.c.
References BMU_FIFO_RST, BMU_RST_SET, DBG, sky2_port::hw, net_device::name, sky2_port::netdev, PFX, sky2_port::port, PREF_UNIT_CTRL, PREF_UNIT_RST_SET, Q_ADDR, Q_CSR, Q_RL, Q_RSL, RB_ADDR, RB_CTRL, RB_DIS_OP_MD, rxqaddr, sky2_read8(), sky2_write32(), sky2_write8(), wmb(), and Y2_QADDR.
Referenced by sky2_down().
|
static |
Definition at line 990 of file sky2.c.
References free_iob(), rx_ring_info::iob, memset(), NULL, sky2_port::rx_le, RX_LE_BYTES, RX_PENDING, and sky2_port::rx_ring.
Referenced by sky2_down(), and sky2_rx_start().
Definition at line 1008 of file sky2.c.
References alloc_iob(), ETH_DATA_ALIGN, sky2_hw::flags, sky2_port::hw, iob_reserve, NULL, sky2_port::rx_data_size, and SKY2_HW_RAM_BUFFER.
Referenced by receive_new(), and sky2_rx_start().
|
inlinestatic |
Definition at line 1034 of file sky2.c.
References sky2_port::hw, sky2_port::rx_put, and sky2_put_idx().
Referenced by sky2_rx_start(), and sky2_status_intr().
|
static |
Definition at line 1045 of file sky2.c.
References BMU_WM_PEX, CHIP_ID_YUKON_EC_U, CHIP_REV_YU_EC_U_A1, CHIP_REV_YU_EC_U_B0, ENOMEM, ETH_FRAME_LEN, F_M_RX_RAM_DIS, sky2_port::hw, rx_ring_info::iob, PCI_CAP_ID_EXP, pci_find_capability(), sky2_port::port, Q_ADDR, Q_TEST, Q_WM, sky2_port::rx_data_size, RX_GMF_CTRL_T, RX_GMF_TR_THR, sky2_port::rx_le_map, RX_LE_SIZE, sky2_port::rx_next, RX_PENDING, sky2_port::rx_put, sky2_port::rx_ring, rx_set_checksum(), RX_TRUNC_OFF, RX_TRUNC_ON, rxqaddr, size, SK_REG, SKY2_HW_NEW_LE, sky2_prefetch_init(), sky2_qset(), sky2_rx_alloc(), sky2_rx_clean(), sky2_rx_map_iob(), sky2_rx_submit(), sky2_rx_update(), sky2_write16(), and sky2_write32().
Referenced by sky2_up().
|
static |
Definition at line 1113 of file sky2.c.
References free, free_phys(), NULL, sky2_port::rx_le, RX_LE_BYTES, sky2_port::rx_ring, sky2_port::tx_le, sky2_port::tx_ring, and TX_RING_SIZE.
Referenced by sky2_down(), and sky2_up().
|
static |
Definition at line 1129 of file sky2.c.
References B0_IMSK, B2_E_0, CHIP_ID_YUKON_EC_U, CHIP_ID_YUKON_EX, CHIP_REV_YU_EC_U_A0, CHIP_REV_YU_EX_B0, DBG2, DBGIO, sky2_hw::dev, ECU_TXFF_LEV, ENOMEM, F_TX_CHK_AUTO_OFF, sky2_port::hw, malloc_phys(), memset(), net_device::name, netdev_link_down(), PFX, port, sky2_port::port, portirq_msk, net_device::priv, Q_ADDR, Q_AL, Q_TEST, Q_XS1, Q_XS2, RB_ADDR, RB_CTRL, RB_RST_SET, sky2_port::rx_le, RX_LE_BYTES, sky2_port::rx_le_map, RX_PENDING, sky2_port::rx_ring, RX_RING_ALIGN, rxqaddr, sky2_free_rings(), SKY2_HW_RAM_BUFFER, sky2_mac_init(), sky2_prefetch_init(), sky2_qset(), sky2_ramset(), sky2_read32(), sky2_read8(), sky2_rx_start(), sky2_set_multicast(), sky2_write16(), sky2_write32(), sky2_write8(), tx_init(), sky2_port::tx_le, sky2_port::tx_le_map, sky2_port::tx_ring, TX_RING_ALIGN, TX_RING_SIZE, txqaddr, virt_to_bus(), and zalloc().
|
inlinestatic |
Definition at line 1220 of file sky2.c.
References head, and TX_RING_SIZE.
Referenced by tx_avail().
|
inlinestatic |
Definition at line 1226 of file sky2.c.
References sky2_port::tx_cons, tx_dist(), TX_PENDING, and sky2_port::tx_prod.
Referenced by sky2_xmit_frame().
|
static |
Definition at line 1238 of file sky2.c.
References sky2_tx_le::addr, cpu_to_le16, cpu_to_le32, ctrl, sky2_tx_le::ctrl, io_buffer::data, DBGIO, EBUSY, EOP, get_tx_le(), sky2_port::hw, HW_OWNER, tx_ring_info::iob, iob_len(), len, sky2_tx_le::length, net_device::name, NULL, OP_PACKET, sky2_tx_le::opcode, PFX, sky2_port::port, net_device::priv, sky2_put_idx(), tx_avail(), tx_le_re(), sky2_port::tx_prod, txqaddr, and virt_to_bus().
Definition at line 1281 of file sky2.c.
References assert(), sky2_tx_le::ctrl, DBGIO, net_device::dev, done, EOP, tx_ring_info::iob, mb(), net_device::name, sky2_port::netdev, netdev_tx_complete(), PFX, RING_NEXT, sky2_port::tx_cons, sky2_port::tx_le, sky2_port::tx_ring, and TX_RING_SIZE.
Referenced by sky2_tx_clean(), and sky2_tx_done().
|
static |
Definition at line 1304 of file sky2.c.
References net_device::priv, sky2_tx_complete(), and sky2_port::tx_prod.
Referenced by sky2_down().
|
static |
Definition at line 1312 of file sky2.c.
References B0_IMSK, B0_Y2LED, BMU_FIFO_RST, BMU_RST_SET, BMU_STOP, CHIP_ID_YUKON_XL, ctrl, DBG2, sky2_hw::dev, GM_GP_CTRL, GM_GPCR_RX_ENA, GM_GPCR_TX_ENA, gma_read16(), gma_write16(), GMAC_CTRL, GMC_RST_SET, GMF_RST_SET, GPC_RST_SET, GPHY_CTRL, sky2_port::hw, LED_STAT_OFF, net_device::name, PFX, port, sky2_port::port, portirq_msk, PREF_UNIT_CTRL, PREF_UNIT_RST_SET, net_device::priv, Q_ADDR, Q_CSR, RB_ADDR, RB_CTRL, RB_DIS_OP_MD, RB_RST_SET, RX_GMF_CTRL_T, SK_REG, sky2_free_rings(), sky2_gmac_reset(), sky2_phy_power_down(), sky2_read32(), sky2_rx_clean(), sky2_rx_stop(), sky2_tx_clean(), sky2_write16(), sky2_write32(), sky2_write8(), TX_GMF_CTRL_T, sky2_port::tx_le, TXA_CTRL, TXA_DIS_ALLOC, TXA_DIS_FSYNC, TXA_ITI_INI, TXA_LIM_INI, TXA_STOP_RC, txqaddr, and Y2_QADDR.
Definition at line 1387 of file sky2.c.
References PHY_M_PS_SPEED_100, PHY_M_PS_SPEED_1000, PHY_M_PS_SPEED_MSK, SKY2_HW_FIBRE_PHY, SKY2_HW_GIGABIT, SPEED_10, SPEED_100, and SPEED_1000.
Referenced by sky2_autoneg_done(), and sky2_phy_intr().
|
static |
Definition at line 1409 of file sky2.c.
References DBG, sky2_port::duplex, DUPLEX_FULL, FC_BOTH, FC_NONE, FC_RX, FC_TX, sky2_port::flow_status, GM_GP_CTRL, GM_GPCR_RX_ENA, GM_GPCR_TX_ENA, gm_phy_write(), gma_read16(), gma_write16(), sky2_port::hw, LINKLED_BLINK_OFF, LINKLED_LINKSYNC_OFF, LINKLED_ON, LNK_LED_REG, net_device::name, sky2_port::netdev, netdev_link_up(), PFX, PHY_M_DEF_MSK, PHY_MARV_INT_MASK, port, sky2_port::port, reg, SK_REG, sky2_write8(), and sky2_port::speed.
Referenced by sky2_phy_intr().
|
static |
Definition at line 1440 of file sky2.c.
References DBG, GM_GP_CTRL, GM_GPCR_RX_ENA, GM_GPCR_TX_ENA, gm_phy_write(), gma_read16(), gma_write16(), sky2_port::hw, LINKLED_OFF, LNK_LED_REG, net_device::name, sky2_port::netdev, netdev_link_down(), PFX, PHY_MARV_INT_MASK, port, sky2_port::port, reg, SK_REG, sky2_phy_init(), and sky2_write8().
Referenced by sky2_phy_intr().
Definition at line 1462 of file sky2.c.
References ADVERTISE_PAUSE_ASYM, ADVERTISE_PAUSE_CAP, CHIP_ID_YUKON_EC_U, CHIP_ID_YUKON_EX, DBG, sky2_port::duplex, DUPLEX_FULL, DUPLEX_HALF, FC_BOTH, FC_NONE, FC_RX, FC_TX, sky2_port::flow_status, gm_phy_read(), GMAC_CTRL, GMC_PAUSE_OFF, GMC_PAUSE_ON, sky2_port::hw, if(), LPA_PAUSE_ASYM, LPA_PAUSE_CAP, net_device::name, sky2_port::netdev, PFX, PHY_M_AN_RF, PHY_M_PS_FULL_DUP, PHY_M_PS_SPDUP_RES, PHY_MARV_AUNE_ADV, PHY_MARV_AUNE_LP, port, sky2_port::port, SK_REG, sky2_phy_speed(), sky2_write8(), sky2_port::speed, and SPEED_1000.
Referenced by sky2_phy_intr().
|
static |
Definition at line 1511 of file sky2.c.
References sky2_port::autoneg, AUTONEG_ENABLE, DBGIO, net_device::dev, sky2_port::duplex, DUPLEX_FULL, DUPLEX_HALF, gm_phy_read(), net_device::name, sky2_port::netdev, PFX, PHY_M_IS_AN_COMPL, PHY_M_IS_DUP_CHANGE, PHY_M_IS_LSP_CHANGE, PHY_M_IS_LST_CHANGE, PHY_M_PS_FULL_DUP, PHY_M_PS_LINK_UP, PHY_MARV_INT_STAT, PHY_MARV_PHY_STAT, port, net_device::priv, sky2_autoneg_done(), sky2_link_down(), sky2_link_up(), sky2_phy_speed(), and sky2_port::speed.
Referenced by sky2_poll().
|
static |
Definition at line 1545 of file sky2.c.
References sky2_port::hw, rx_ring_info::iob, iob_put, length, NULL, sky2_hw::pdev, sky2_port::rx_data_size, sky2_rx_alloc(), and sky2_rx_map_iob().
Referenced by sky2_receive().
|
static |
Definition at line 1570 of file sky2.c.
References sky2_hw::chip_id, CHIP_ID_YUKON_FE_P, sky2_hw::chip_rev, CHIP_REV_YU_FE2_A0, count, DBG2, DBGIO, EBUSY, EINVAL, EIO, error, GMR_FS_ANY_ERR, GMR_FS_LEN, GMR_FS_RX_FF_OV, GMR_FS_RX_OK, sky2_port::hw, length, net_device::name, netdev_rx_err(), NULL, PFX, net_device::priv, receive_new(), sky2_port::rx_next, RX_PENDING, sky2_port::rx_ring, sky2_rx_submit(), and status.
Referenced by sky2_status_intr().
|
inlinestatic |
Definition at line 1635 of file sky2.c.
References net_device::priv, and sky2_tx_complete().
Referenced by sky2_status_intr().
Definition at line 1643 of file sky2.c.
References assert(), sky2_status_le::css, CSS_LINK_BIT, DBG, DBG2, net_device::dev, ENOMEM, HW_OWNER, le16_to_cpu, le32_to_cpu, length, sky2_status_le::length, netdev_rx(), netdev_rx_err(), NULL, OP_RXCHKS, OP_RXSTAT, OP_TXINDEXLE, opcode, sky2_status_le::opcode, PFX, port, Q_R1, Q_R2, RING_NEXT, rmb, rx, SC_STAT_CLR_IRQ, sky2_receive(), sky2_rx_update(), sky2_tx_done(), sky2_write32(), STAT_CTRL, status, sky2_status_le::status, STATUS_RING_SIZE, and TX_RING_SIZE.
Referenced by sky2_poll().
Definition at line 1709 of file sky2.c.
References B3_RI_CTRL, BMU_CLR_IRQ_PAR, BMU_CLR_IRQ_TCP, DBG, DBGIO, net_device::dev, GMF_CLI_TX_PE, device::name, PFX, port, Q_ADDR, Q_CSR, RAM_BUFFER, RI_CLR_RD_PERR, RI_CLR_WR_PERR, rxqaddr, SK_REG, sky2_write16(), sky2_write32(), sky2_write8(), status, TX_GMF_CTRL_T, txqaddr, Y2_IS_PAR_MAC1, Y2_IS_PAR_RD1, Y2_IS_PAR_RX1, Y2_IS_PAR_WR1, and Y2_IS_TCP_TXA1.
Referenced by sky2_hw_intr().
|
static |
Definition at line 1742 of file sky2.c.
References B0_HWE_IMSK, B0_HWE_ISRC, B2_TST_CTRL1, DBG, GMAC_TI_ST_CTRL, GMT_ST_CLR_IRQ, PCI_ERR_UNCOR_STATUS, PCI_STATUS, PCI_STATUS_ERROR_BITS, PFX, sky2_hw_error(), sky2_pci_read16(), sky2_pci_write16(), sky2_read32(), sky2_write32(), sky2_write8(), status, TST_CFG_WRITE_OFF, TST_CFG_WRITE_ON, Y2_CFG_AER, Y2_HWE_L1_MASK, Y2_IS_IRQ_STAT, Y2_IS_MST_ERR, Y2_IS_PCI_EXP, and Y2_IS_TIST_OV.
Referenced by sky2_err_intr().
|
static |
Definition at line 1785 of file sky2.c.
References DBGIO, net_device::dev, GM_IS_RX_CO_OV, GM_IS_RX_FF_OR, GM_IS_TX_CO_OV, GM_IS_TX_FF_UR, GM_RX_IRQ_SRC, GM_TX_IRQ_SRC, gma_read16(), GMAC_IRQ_SRC, GMF_CLI_RX_FO, GMF_CLI_TX_FU, device::name, PFX, port, RX_GMF_CTRL_T, SK_REG, sky2_read8(), sky2_write8(), status, and TX_GMF_CTRL_T.
Referenced by sky2_err_intr().
|
static |
Definition at line 1808 of file sky2.c.
References BMU_CLR_IRQ_CHK, DBG, net_device::dev, net_device::name, PFX, port, PREF_UNIT_GET_IDX, PREF_UNIT_LAST_IDX, PREF_UNIT_PUT_IDX, net_device::priv, Q_ADDR, Q_CSR, Q_R1, Q_R2, sky2_port::rx_le, sky2_port::rx_put, sky2_read16(), sky2_write32(), sky2_port::tx_le, sky2_port::tx_prod, and Y2_QADDR.
Referenced by sky2_err_intr().
Definition at line 1828 of file sky2.c.
References DBG, PFX, Q_R1, Q_R2, Q_XA1, Q_XA2, RX_LE_SIZE, sky2_hw_intr(), sky2_le_error(), sky2_mac_intr(), status, TX_RING_SIZE, Y2_IS_CHK_RX1, Y2_IS_CHK_RX2, Y2_IS_CHK_TXA1, Y2_IS_CHK_TXA2, Y2_IS_HW_ERR, Y2_IS_IRQ_MAC1, and Y2_IS_IRQ_MAC2.
Referenced by sky2_poll().
|
static |
Definition at line 1854 of file sky2.c.
References B0_Y2_SP_EISR, B0_Y2_SP_LISR, sky2_port::hw, net_device::priv, sky2_err_intr(), sky2_phy_intr(), sky2_read16(), sky2_read32(), sky2_read8(), sky2_status_intr(), sky2_write8(), STAT_PUT_IDX, STAT_TX_TIMER_CTRL, status, TIM_START, TIM_STOP, Y2_IS_ERROR, Y2_IS_IRQ_PHY1, and Y2_IS_IRQ_PHY2.
Definition at line 1885 of file sky2.c.
References CHIP_ID_YUKON_EC, CHIP_ID_YUKON_EC_U, CHIP_ID_YUKON_EX, CHIP_ID_YUKON_FE, CHIP_ID_YUKON_FE_P, CHIP_ID_YUKON_SUPR, CHIP_ID_YUKON_UL_2, CHIP_ID_YUKON_XL, DBG, and PFX.
Referenced by sky2_clk2us(), and sky2_us2clk().
|
static |
Definition at line 1920 of file sky2.c.
References B0_CTST, B2_CHIP_ID, B2_MAC_CFG, B2_PMD_TYP, B2_Y2_CLK_GATE, B2_Y2_HW_RES, CFG_CHIP_R_MSK, CFG_DUAL_MAC_MSK, CHIP_ID_YUKON_EC, CHIP_ID_YUKON_EC_U, CHIP_ID_YUKON_EX, CHIP_ID_YUKON_FE, CHIP_ID_YUKON_FE_P, CHIP_ID_YUKON_SUPR, CHIP_ID_YUKON_UL_2, CHIP_ID_YUKON_XL, CHIP_REV_YU_EC_A1, CS_RST_CLR, DBG, EOPNOTSUPP, PCI_DEV_REG3, PFX, SKY2_HW_ADV_POWER_CTL, SKY2_HW_AUTO_TX_SUM, SKY2_HW_FIBRE_PHY, SKY2_HW_GIGABIT, SKY2_HW_NEW_LE, SKY2_HW_NEWER_PHY, sky2_pci_write32(), sky2_read8(), sky2_write8(), and Y2_STATUS_LNK2_INAC.
Referenced by sky2_probe().
|
static |
Definition at line 2001 of file sky2.c.
References B0_CTST, B0_HWE_IMSK, B0_HWE_ISRC, B0_Y2LED, B28_DPT_CTRL, B28_Y2_ASF_STAT_CMD, B2_I2C_IRQ, B2_TI_CTRL, B2_TST_CTRL1, B3_RI_CTRL, B3_RI_RTO_R1, B3_RI_RTO_R2, B3_RI_RTO_XA1, B3_RI_RTO_XA2, B3_RI_RTO_XS1, B3_RI_RTO_XS2, B3_RI_WTO_R1, B3_RI_WTO_R2, B3_RI_WTO_XA1, B3_RI_WTO_XA2, B3_RI_WTO_XS1, B3_RI_WTO_XS2, CHIP_ID_YUKON_EX, CHIP_ID_YUKON_SUPR, CHIP_ID_YUKON_XL, CS_MRST_CLR, CS_RST_CLR, CS_RST_SET, DBG, DPT_STOP, GMAC_CTRL, GMAC_LINK_CTRL, GMAC_TI_ST_CTRL, GMC_BYP_MACSECRX_ON, GMC_BYP_MACSECTX_ON, GMC_BYP_RETR_ON, GMLC_RST_CLR, GMLC_RST_SET, GMT_ST_CLR_IRQ, GMT_ST_STOP, HCU_CCSR, HCU_CCSR_AHB_RST, HCU_CCSR_CPU_RST_MODE, HCU_CCSR_UC_STATE_MSK, LED_STAT_ON, memset(), PCI_CAP_ID_EXP, PCI_ERR_UNCOR_STATUS, pci_find_capability(), PCI_STATUS, PCI_STATUS_ERROR_BITS, PFX, RAM_BUFFER, RI_RST_CLR, SC_STAT_OP_ON, SC_STAT_RST_CLR, SC_STAT_RST_SET, SK_REG, SK_RI_TO_53, sky2_gmac_reset(), sky2_pci_read16(), sky2_pci_write16(), sky2_power_on(), sky2_read16(), sky2_read32(), sky2_us2clk(), sky2_write16(), sky2_write32(), sky2_write8(), STAT_CTRL, STAT_FIFO_ISR_WM, STAT_FIFO_WM, STAT_ISR_TIMER_CTRL, STAT_ISR_TIMER_INI, STAT_LAST_IDX, STAT_LEV_TIMER_CTRL, STAT_LEV_TIMER_INI, STAT_LIST_ADDR_HI, STAT_LIST_ADDR_LO, STAT_TX_IDX_TH, STAT_TX_TIMER_CTRL, STAT_TX_TIMER_INI, status, STATUS_LE_BYTES, STATUS_RING_SIZE, TIM_CLR_IRQ, TIM_START, TIM_STOP, TST_CFG_WRITE_OFF, TST_CFG_WRITE_ON, TXA_CTRL, TXA_ENA_ARB, Y2_ASF_DISABLE, Y2_ASF_RESET, Y2_CFG_AER, Y2_HWE_ALL_MASK, and Y2_IS_PCI_EXP.
Referenced by sky2_probe().
Definition at line 2133 of file sky2.c.
References SKY2_HW_GIGABIT, sky2_is_copper(), SUPPORTED_1000baseT_Full, SUPPORTED_1000baseT_Half, SUPPORTED_100baseT_Full, SUPPORTED_100baseT_Half, SUPPORTED_10baseT_Full, SUPPORTED_10baseT_Half, SUPPORTED_Autoneg, SUPPORTED_FIBRE, and SUPPORTED_TP.
Referenced by sky2_init_netdev().
|
static |
Definition at line 2179 of file sky2.c.
References sky2_port::advertising, alloc_etherdev(), sky2_port::autoneg, AUTONEG_ENABLE, B2_MAC_1, DBG, net_device::dev, sky2_port::duplex, ETH_ALEN, FC_BOTH, sky2_port::flow_mode, sky2_port::hw, memcpy(), sky2_port::netdev, NULL, PFX, port, sky2_port::port, sky2_supported_modes(), and sky2_port::speed.
Referenced by sky2_probe().
|
static |
Definition at line 2214 of file sky2.c.
References DBG2, net_device::dev, device::name, netdev_addr(), and PFX.
Referenced by sky2_probe().
|
static |
Definition at line 2242 of file sky2.c.
References B0_IMSK, sky2_port::hw, sky2_port::port, portirq_msk, net_device::priv, sky2_read32(), and sky2_write32().
|
static |
Definition at line 2263 of file sky2.c.
References __unused, adjust_pci_device(), B0_CTST, B0_IMSK, CS_RST_SET, DBG, DBG2, net_device::dev, sky2_hw::dev, ENOMEM, free, free_phys(), iounmap(), malloc_phys(), memset(), netdev_init(), netdev_nullify(), netdev_put(), NULL, pci_bar_start(), PCI_BASE_ADDRESS_0, pci_ioremap(), pci_set_drvdata(), sky2_hw::pdev, PFX, register_netdev(), sky2_init(), sky2_init_netdev(), sky2_operations, sky2_reset(), sky2_show_addr(), sky2_write32(), sky2_write8(), STATUS_LE_BYTES, STATUS_RING_ALIGN, virt_to_bus(), Y2_IS_BASE, and zalloc().
|
static |
Definition at line 2357 of file sky2.c.
References B0_CTST, B0_IMSK, B0_Y2LED, CS_RST_SET, free, free_phys(), iounmap(), LED_STAT_OFF, netdev_nullify(), netdev_put(), NULL, pci_get_drvdata(), pci_set_drvdata(), sky2_hw::pdev, sky2_power_aux(), sky2_read8(), sky2_write16(), sky2_write32(), sky2_write8(), STATUS_LE_BYTES, and unregister_netdev().
|
static |
Definition at line 124 of file sky2.c.
Referenced by sky2_down(), sky2_hw_error(), sky2_up(), and sky2_xmit_frame().
Definition at line 125 of file sky2.c.
Referenced by rx_set_checksum(), sky2_hw_error(), sky2_rx_start(), sky2_rx_stop(), and sky2_up().
|
static |
Definition at line 126 of file sky2.c.
Referenced by sky2_down(), sky2_net_irq(), and sky2_up().
|
static |
Definition at line 273 of file sky2.c.
Referenced by sky2_phy_init().
|
static |
Definition at line 281 of file sky2.c.
Referenced by sky2_phy_init().
|
static |
Definition at line 289 of file sky2.c.
Referenced by sky2_phy_init().
|
static |
Definition at line 592 of file sky2.c.
Referenced by sky2_phy_power_down(), and sky2_phy_power_up().
|
static |
Definition at line 593 of file sky2.c.
Referenced by sky2_phy_power_up().
|
static |
Definition at line 2255 of file sky2.c.
Referenced by sky2_probe().
struct pci_driver sky2_driver __pci_driver |