#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/spinlock.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/cpufreq.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/arch/hwregs/reg_map.h>
#include <asm/arch/hwregs/reg_rdwr.h>
#include <asm/arch/hwregs/dma.h>
#include <asm/arch/hwregs/eth_defs.h>
#include <asm/arch/hwregs/clkgen_defs.h>
#include <asm/arch/hwregs/intr_vect_defs.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/ethernet.h>
#include <asm/arch/dma.h>
#include <asm/arch/intmem.h>
#include <asm/arch/pinmux.h>
#include "eth_v32.h"
Include dependency graph for eth_v32.c:
Go to the source code of this file.
Defines | |
#define | ETH0_INTR_VECT ETH_INTR_VECT |
#define | ETH1_INTR_VECT ETH_INTR_VECT |
#define | regi_eth0 regi_eth |
#define | regi_eth1 regi_ |
#define | DEBUG(x) |
#define | GET_BIT(bit, val) (((val) >> (bit)) & 0x01) |
Functions | |
static void | update_rx_stats (struct crisv32_ethernet_local *np) |
static void | update_tx_stats (struct crisv32_ethernet_local *np) |
static int | crisv32_eth_poll (struct net_device *dev, int *budget) |
static void | crisv32_eth_setup_controller (struct net_device *dev) |
static int | crisv32_eth_request_irqdma (struct net_device *dev) |
static void | crisv32_ethernet_bug (struct net_device *dev) |
static void | crisv32_disable_tx_ints (struct crisv32_ethernet_local *np) |
static void | crisv32_enable_tx_ints (struct crisv32_ethernet_local *np) |
static void | crisv32_disable_rx_ints (struct crisv32_ethernet_local *np) |
static void | crisv32_enable_rx_ints (struct crisv32_ethernet_local *np) |
static void | crisv32_start_receiver (struct crisv32_ethernet_local *np) |
static void | crisv32_stop_receiver (struct crisv32_ethernet_local *np) |
static void | crisv32_eth_reset_rings (struct net_device *dev) |
static void | __crisv32_eth_rx_ring_advance (struct crisv32_ethernet_local *np) |
static void | crisv32_eth_rx_ring_advance (struct crisv32_ethernet_local *np) |
static void __init | crisv32_eth_init_rings (struct net_device *dev) |
static void __init | crisv32_init_leds (int ledgrp, struct net_device *dev) |
static int __init | crisv32_ethernet_init (void) |
static int __init | crisv32_ethernet_device_init (struct net_device *dev) |
static int | crisv32_eth_open (struct net_device *dev) |
static int | crisv32_eth_close (struct net_device *dev) |
static int | crisv32_eth_set_mac_address (struct net_device *dev, void *vpntr) |
static irqreturn_t | crisv32rx_eth_interrupt (int irq, void *dev_id) |
static irqreturn_t | crisv32tx_eth_interrupt (int irq, void *dev_id) |
static struct net_device_stats * | crisv32_get_stats (struct net_device *dev) |
static irqreturn_t | crisv32nw_eth_interrupt (int irq, void *dev_id) |
static void | crisv32_eth_receive_packet (struct net_device *dev) |
static int | crisv32_has_rx_work (struct crisv32_ethernet_local *np, dma_descr_data *active) |
static int | crisv32_eth_send_packet (struct sk_buff *skb, struct net_device *dev) |
static void | crisv32_eth_hw_send_packet (unsigned char *buf, int length, void *priv) |
static void | crisv32_start_dma_out (struct crisv32_ethernet_local *np) |
static void | crisv32_eth_tx_timeout (struct net_device *dev) |
static void | crisv32_eth_set_multicast_list (struct net_device *dev) |
static int | crisv32_eth_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) |
static int | crisv32_eth_get_settings (struct net_device *dev, struct ethtool_cmd *ecmd) |
static int | crisv32_eth_set_settings (struct net_device *dev, struct ethtool_cmd *ecmd) |
static void | crisv32_eth_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info) |
static int | crisv32_eth_nway_reset (struct net_device *dev) |
static int | crisv32_eth_set_config (struct net_device *dev, struct ifmap *map) |
static void | crisv32_eth_negotiate (struct net_device *dev) |
static void | crisv32_eth_check_speed (unsigned long idev) |
static void | crisv32_eth_set_speed (struct net_device *dev, unsigned long speed) |
static void | crisv32_eth_check_duplex (unsigned long idev) |
static void | crisv32_eth_set_duplex (struct net_device *dev, enum duplex new_duplex) |
static int | crisv32_eth_probe_transceiver (struct net_device *dev) |
static void | generic_check_speed (struct net_device *dev) |
static void | generic_check_duplex (struct net_device *dev) |
static void | broadcom_check_speed (struct net_device *dev) |
static void | broadcom_check_duplex (struct net_device *dev) |
static void | tdk_check_speed (struct net_device *dev) |
static void | tdk_check_duplex (struct net_device *dev) |
static void | intel_check_speed (struct net_device *dev) |
static void | intel_check_duplex (struct net_device *dev) |
static void | national_check_speed (struct net_device *dev) |
static void | national_check_duplex (struct net_device *dev) |
static void | vitesse_check_speed (struct net_device *dev) |
static void | vitesse_check_duplex (struct net_device *dev) |
static void | crisv32_eth_reset_tranceiver (struct net_device *dev) |
static unsigned short | crisv32_eth_get_mdio_reg (struct net_device *dev, unsigned char reg_num) |
static void | crisv32_eth_set_mdio_reg (struct net_device *dev, unsigned char reg, int value) |
static void | crisv32_eth_send_mdio_cmd (struct net_device *dev, unsigned short cmd, int write_cmd) |
static void | crisv32_eth_send_mdio_bit (struct net_device *dev, unsigned char bit) |
static unsigned char | crisv32_eth_receive_mdio_bit (struct net_device *dev) |
static void | crisv32_clear_network_leds (unsigned long priv) |
static void | crisv32_set_network_leds (int active, struct net_device *dev) |
static int | crisv32_init_module (void) |
static int __init | crisv32_boot_setup (char *str) |
__setup ("crisv32_eth=", crisv32_boot_setup) | |
module_init (crisv32_init_module) | |
Variables | |
static int | use_network_leds = 1 |
static const char * | cardname = "ETRAX FS built-in ethernet controller" |
static int | autoneg_normal = 1 |
transceiver_ops | transceivers [] |
static struct net_device * | crisv32_dev [2] |
static struct crisv32_eth_leds * | crisv32_leds [3] |
static struct sockaddr | default_mac_iface0 |
static struct ethtool_ops | crisv32_ethtool_ops |
#define ETH0_INTR_VECT ETH_INTR_VECT |
#define ETH1_INTR_VECT ETH_INTR_VECT |
Definition at line 60 of file eth_v32.c.
Referenced by crisv32_eth_reset_tranceiver(), crisv32_eth_send_mdio_cmd(), and crisv32_eth_set_mdio_reg().
#define regi_eth0 regi_eth |
Definition at line 55 of file eth_v32.c.
Referenced by crisv32_eth_request_irqdma(), and crisv32_ethernet_init().
#define regi_eth1 regi_ |
static void __crisv32_eth_rx_ring_advance | ( | struct crisv32_ethernet_local * | np | ) | [static] |
Definition at line 384 of file eth_v32.c.
References crisv32_ethernet_local::active_rx_desc, MAX_MEDIA_DATA_SIZE, crisv32_ethernet_local::newbuf, and crisv32_ethernet_local::prev_rx_desc.
Referenced by crisv32_eth_rx_ring_advance().
__setup | ( | ) |
static void broadcom_check_duplex | ( | struct net_device * | dev | ) | [static] |
Definition at line 2088 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), data, crisv32_ethernet_local::full_duplex, MDIO_AUX_CTRL_STATUS_REG, and MDIO_BC_FULL_DUPLEX_IND.
static void broadcom_check_speed | ( | struct net_device * | dev | ) | [static] |
Definition at line 2078 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), crisv32_ethernet_local::current_speed, data, MDIO_AUX_CTRL_STATUS_REG, and MDIO_BC_SPEED.
static int __init crisv32_boot_setup | ( | char * | str | ) | [static] |
static void crisv32_clear_network_leds | ( | unsigned long | priv | ) | [static] |
Definition at line 2324 of file eth_v32.c.
References crisv32_set_network_leds(), flags, jiffies, crisv32_eth_leds::led_active, crisv32_eth_leds::led_lock, crisv32_eth_leds::led_next_time, LED_NOACTIVITY, crisv32_ethernet_local::leds, and NET_FLASH_PAUSE.
Referenced by crisv32_init_leds().
static void crisv32_disable_rx_ints | ( | struct crisv32_ethernet_local * | np | ) | [inline, static] |
Definition at line 129 of file eth_v32.c.
References crisv32_ethernet_local::dma_in_inst.
Referenced by crisv32_eth_close(), crisv32_eth_open(), and crisv32rx_eth_interrupt().
static void crisv32_disable_tx_ints | ( | struct crisv32_ethernet_local * | np | ) | [inline, static] |
Definition at line 117 of file eth_v32.c.
References crisv32_ethernet_local::dma_out_inst.
Referenced by crisv32_eth_close(), and crisv32_eth_open().
static void crisv32_enable_rx_ints | ( | struct crisv32_ethernet_local * | np | ) | [inline, static] |
Definition at line 135 of file eth_v32.c.
References crisv32_ethernet_local::dma_in_inst.
Referenced by crisv32_eth_open(), and crisv32_eth_poll().
static void crisv32_enable_tx_ints | ( | struct crisv32_ethernet_local * | np | ) | [inline, static] |
Definition at line 123 of file eth_v32.c.
References crisv32_ethernet_local::dma_out_inst.
Referenced by crisv32_eth_open(), and crisv32_eth_tx_timeout().
static void crisv32_eth_check_duplex | ( | unsigned long | idev | ) | [static] |
Definition at line 1981 of file eth_v32.c.
References transceiver_ops::check_duplex, crisv32_ethernet_local::duplex_timer, crisv32_ethernet_local::eth_inst, crisv32_ethernet_local::full_duplex, jiffies, NET_DUPLEX_CHECK_INTERVAL, and crisv32_ethernet_local::transceiver.
Referenced by crisv32_ethernet_device_init().
static void crisv32_eth_check_speed | ( | unsigned long | idev | ) | [static] |
Definition at line 1898 of file eth_v32.c.
References transceiver_ops::check_speed, crisv32_eth_leds::clear_led_timer, crisv32_eth_get_mdio_reg(), crisv32_set_network_leds(), crisv32_ethernet_local::current_speed, data, crisv32_ethernet_local::eth_inst, flags, jiffies, LED_LINK, crisv32_eth_leds::led_lock, LED_NOLINK, crisv32_ethernet_local::leds, NET_LINK_UP_CHECK_INTERVAL, crisv32_ethernet_local::speed_timer, spin_lock, spin_unlock, crisv32_ethernet_local::transceiver, and crisv32_ethernet_local::transceiver_lock.
Referenced by crisv32_ethernet_device_init().
static int crisv32_eth_close | ( | struct net_device * | dev | ) | [static] |
Definition at line 751 of file eth_v32.c.
References crisv32_disable_rx_ints(), crisv32_disable_tx_ints(), crisv32_stop_receiver(), crisv32_ethernet_local::dma_in_inst, crisv32_ethernet_local::dma_out_inst, crisv32_ethernet_local::duplex_timer, flags, KERN_INFO, crisv32_ethernet_local::lock, printk, crisv32_ethernet_local::sender_started, crisv32_ethernet_local::speed_timer, update_rx_stats(), and update_tx_stats().
Referenced by crisv32_ethernet_device_init().
static void crisv32_eth_get_drvinfo | ( | struct net_device * | dev, | |
struct ethtool_drvinfo * | info | |||
) | [static] |
static unsigned short crisv32_eth_get_mdio_reg | ( | struct net_device * | dev, | |
unsigned char | reg_num | |||
) | [static] |
Definition at line 2218 of file eth_v32.c.
References cmd, crisv32_eth_receive_mdio_bit(), crisv32_eth_send_mdio_cmd(), data, crisv32_ethernet_local::mdio_phy_addr, MDIO_READ, and MDIO_START.
Referenced by broadcom_check_duplex(), broadcom_check_speed(), crisv32_eth_check_speed(), crisv32_eth_ioctl(), crisv32_eth_negotiate(), crisv32_eth_probe_transceiver(), crisv32_eth_reset_tranceiver(), generic_check_duplex(), generic_check_speed(), intel_check_duplex(), intel_check_speed(), national_check_duplex(), national_check_speed(), tdk_check_duplex(), tdk_check_speed(), vitesse_check_duplex(), and vitesse_check_speed().
static int crisv32_eth_get_settings | ( | struct net_device * | dev, | |
struct ethtool_cmd * | ecmd | |||
) | [static] |
Definition at line 1550 of file eth_v32.c.
References autoneg, crisv32_ethernet_local::current_duplex, crisv32_ethernet_local::current_speed, crisv32_ethernet_local::current_speed_selection, full, crisv32_ethernet_local::full_duplex, half, and crisv32_ethernet_local::mdio_phy_addr.
static void crisv32_eth_hw_send_packet | ( | unsigned char * | buf, | |
int | length, | |||
void * | priv | |||
) | [static] |
Definition at line 1290 of file eth_v32.c.
References crisv32_ethernet_local::active_tx_desc, crisv32_start_dma_out(), and crisv32_ethernet_local::prev_tx_desc.
Referenced by crisv32_eth_send_packet().
static void __init crisv32_eth_init_rings | ( | struct net_device * | dev | ) | [static] |
Definition at line 429 of file eth_v32.c.
References crisv32_eth_reset_rings(), crisv32_ethernet_local::dma_rx_descr_list, crisv32_ethernet_local::dma_tx_descr_list, MAX_MEDIA_DATA_SIZE, NBR_RX_DESC, NBR_TX_DESC, and crisv32_eth_descr::skb.
Referenced by crisv32_ethernet_init().
static int crisv32_eth_ioctl | ( | struct net_device * | dev, | |
struct ifreq * | ifr, | |||
int | cmd | |||
) | [static] |
Definition at line 1511 of file eth_v32.c.
References autoneg_normal, crisv32_eth_get_mdio_reg(), crisv32_eth_negotiate(), crisv32_eth_set_mdio_reg(), data, crisv32_ethernet_local::lock, crisv32_ethernet_local::mdio_phy_addr, spin_lock, spin_unlock, and use_network_leds.
Referenced by crisv32_ethernet_device_init().
static void crisv32_eth_negotiate | ( | struct net_device * | dev | ) | [static] |
Definition at line 1846 of file eth_v32.c.
References autoneg_normal, crisv32_eth_get_mdio_reg(), crisv32_eth_set_mdio_reg(), crisv32_ethernet_local::current_duplex, crisv32_ethernet_local::current_speed_selection, data, full, and half.
Referenced by crisv32_eth_ioctl(), crisv32_eth_nway_reset(), crisv32_eth_set_duplex(), and crisv32_eth_set_speed().
static int crisv32_eth_nway_reset | ( | struct net_device * | dev | ) | [static] |
Definition at line 1633 of file eth_v32.c.
References autoneg, crisv32_eth_negotiate(), crisv32_ethernet_local::current_duplex, and crisv32_ethernet_local::current_speed_selection.
static int crisv32_eth_open | ( | struct net_device * | dev | ) | [static] |
Definition at line 682 of file eth_v32.c.
References crisv32_disable_rx_ints(), crisv32_disable_tx_ints(), crisv32_enable_rx_ints(), crisv32_enable_tx_ints(), crisv32_eth_reset_rings(), crisv32_eth_set_mac_address(), crisv32_start_receiver(), crisv32_ethernet_local::dma_in_inst, crisv32_ethernet_local::dma_out_inst, crisv32_ethernet_local::duplex_timer, crisv32_ethernet_local::eth_inst, crisv32_ethernet_local::lock, memcpy(), crisv32_ethernet_local::speed_timer, spin_lock, and spin_unlock.
Referenced by crisv32_ethernet_device_init().
static int crisv32_eth_poll | ( | struct net_device * | dev, | |
int * | budget | |||
) | [static] |
Definition at line 1167 of file eth_v32.c.
References crisv32_ethernet_local::active_rx_desc, crisv32_enable_rx_ints(), crisv32_eth_receive_packet(), crisv32_eth_rx_ring_advance(), crisv32_has_rx_work(), crisv32_ethernet_local::dma_in_inst, crisv32_ethernet_local::new_rx_package, crisv32_ethernet_local::stats, and update_rx_stats().
Referenced by crisv32_ethernet_device_init().
static int crisv32_eth_probe_transceiver | ( | struct net_device * | dev | ) | [static] |
Definition at line 2016 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), crisv32_ethernet_local::mdio_phy_addr, transceiver_ops::oui, crisv32_ethernet_local::transceiver, and transceivers.
Referenced by crisv32_eth_setup_controller().
static unsigned char crisv32_eth_receive_mdio_bit | ( | struct net_device * | dev | ) | [static] |
Definition at line 2305 of file eth_v32.c.
References crisv32_ethernet_local::eth_inst, and udelay.
Referenced by crisv32_eth_get_mdio_reg(), and crisv32_eth_send_mdio_cmd().
static void crisv32_eth_receive_packet | ( | struct net_device * | dev | ) | [static] |
Definition at line 1055 of file eth_v32.c.
References crisv32_ethernet_local::active_rx_desc, crisv32_eth_leds::clear_led_timer, crisv32_eth_rx_ring_advance(), crisv32_set_network_leds(), DEBUG, ETHER_HEAD_LEN, flags, HZ, jiffies, KERN_NOTICE, crisv32_ethernet_local::last_rx_desc, crisv32_eth_leds::led_active, LED_ACTIVITY, crisv32_eth_leds::led_lock, crisv32_eth_leds::led_next_time, crisv32_ethernet_local::leds, length, MAX_MEDIA_DATA_SIZE, memcpy(), NET_FLASH_TIME, crisv32_ethernet_local::newbuf, printk, crisv32_eth_descr::skb, and crisv32_ethernet_local::stats.
Referenced by crisv32_eth_poll().
static int __init crisv32_eth_request_irqdma | ( | struct net_device * | dev | ) | [static] |
Definition at line 163 of file eth_v32.c.
References cardname, crisv32nw_eth_interrupt(), crisv32rx_eth_interrupt(), crisv32tx_eth_interrupt(), ETH0_INTR_VECT, ETH1_INTR_VECT, crisv32_ethernet_local::eth_inst, and regi_eth0.
Referenced by crisv32_ethernet_init().
static void crisv32_eth_reset_rings | ( | struct net_device * | dev | ) | [static] |
Definition at line 298 of file eth_v32.c.
References crisv32_ethernet_local::active_tx_desc, crisv32_ethernet_local::catch_tx_desc, crisv32_ethernet_bug(), crisv32_ethernet_local::dma_rx_descr_list, MAX_MEDIA_DATA_SIZE, NBR_RX_DESC, printk, crisv32_eth_descr::skb, and crisv32_ethernet_local::txpackets.
Referenced by crisv32_eth_init_rings(), and crisv32_eth_open().
static void crisv32_eth_reset_tranceiver | ( | struct net_device * | dev | ) | [static] |
Definition at line 2194 of file eth_v32.c.
References cmd, crisv32_eth_get_mdio_reg(), crisv32_eth_send_mdio_bit(), crisv32_eth_send_mdio_cmd(), data, GET_BIT, crisv32_ethernet_local::mdio_phy_addr, MDIO_START, and MDIO_WRITE.
Referenced by crisv32_eth_tx_timeout().
static void crisv32_eth_rx_ring_advance | ( | struct crisv32_ethernet_local * | np | ) | [inline, static] |
Definition at line 406 of file eth_v32.c.
References __crisv32_eth_rx_ring_advance(), crisv32_ethernet_local::active_rx_desc, crisv32_ethernet_local::dma_in_inst, and crisv32_ethernet_local::new_rx_package.
Referenced by crisv32_eth_poll(), and crisv32_eth_receive_packet().
static void crisv32_eth_send_mdio_bit | ( | struct net_device * | dev, | |
unsigned char | bit | |||
) | [static] |
Definition at line 2285 of file eth_v32.c.
References crisv32_ethernet_local::eth_inst, and udelay.
Referenced by crisv32_eth_reset_tranceiver(), crisv32_eth_send_mdio_cmd(), and crisv32_eth_set_mdio_reg().
static void crisv32_eth_send_mdio_cmd | ( | struct net_device * | dev, | |
unsigned short | cmd, | |||
int | write_cmd | |||
) | [static] |
Definition at line 2263 of file eth_v32.c.
References crisv32_eth_receive_mdio_bit(), crisv32_eth_send_mdio_bit(), data, GET_BIT, and MDIO_PREAMBLE.
Referenced by crisv32_eth_get_mdio_reg(), crisv32_eth_reset_tranceiver(), and crisv32_eth_set_mdio_reg().
static int crisv32_eth_send_packet | ( | struct sk_buff * | skb, | |
struct net_device * | dev | |||
) | [static] |
Definition at line 1219 of file eth_v32.c.
References crisv32_ethernet_local::active_tx_desc, buf, crisv32_ethernet_local::catch_tx_desc, crisv32_eth_leds::clear_led_timer, crisv32_eth_hw_send_packet(), crisv32_set_network_leds(), flags, HZ, jiffies, crisv32_eth_leds::led_active, LED_ACTIVITY, crisv32_eth_leds::led_lock, crisv32_eth_leds::led_next_time, crisv32_ethernet_local::leds, crisv32_ethernet_local::lock, memcpy(), NET_FLASH_TIME, printk, crisv32_eth_descr::skb, and crisv32_ethernet_local::txpackets.
Referenced by crisv32_ethernet_device_init().
static int crisv32_eth_set_config | ( | struct net_device * | dev, | |
struct ifmap * | map | |||
) | [static] |
Definition at line 1652 of file eth_v32.c.
References autoneg, crisv32_eth_set_duplex(), crisv32_eth_set_speed(), KERN_ERR, crisv32_ethernet_local::lock, printk, spin_lock, and spin_unlock.
Referenced by crisv32_ethernet_device_init().
static void crisv32_eth_set_duplex | ( | struct net_device * | dev, | |
enum duplex | new_duplex | |||
) | [static] |
Definition at line 2004 of file eth_v32.c.
References crisv32_eth_negotiate(), crisv32_ethernet_local::current_duplex, spin_lock, spin_unlock, and crisv32_ethernet_local::transceiver_lock.
Referenced by crisv32_eth_set_config(), and crisv32_eth_set_settings().
static int crisv32_eth_set_mac_address | ( | struct net_device * | dev, | |
void * | vpntr | |||
) | [static] |
Definition at line 798 of file eth_v32.c.
References crisv32_ethernet_local::eth_inst, KERN_INFO, memcpy(), and printk.
Referenced by crisv32_eth_open(), crisv32_ethernet_device_init(), and crisv32_ethernet_init().
static void crisv32_eth_set_mdio_reg | ( | struct net_device * | dev, | |
unsigned char | reg, | |||
int | value | |||
) | [static] |
Definition at line 2243 of file eth_v32.c.
References cmd, crisv32_eth_send_mdio_bit(), crisv32_eth_send_mdio_cmd(), GET_BIT, crisv32_ethernet_local::mdio_phy_addr, MDIO_START, and MDIO_WRITE.
Referenced by crisv32_eth_ioctl(), and crisv32_eth_negotiate().
static void crisv32_eth_set_multicast_list | ( | struct net_device * | dev | ) | [static] |
Definition at line 1415 of file eth_v32.c.
References crisv32_ethernet_local::eth_inst, and int.
Referenced by crisv32_ethernet_device_init().
static int crisv32_eth_set_settings | ( | struct net_device * | dev, | |
struct ethtool_cmd * | ecmd | |||
) | [static] |
Definition at line 1610 of file eth_v32.c.
References autoneg, crisv32_eth_set_duplex(), and crisv32_eth_set_speed().
static void crisv32_eth_set_speed | ( | struct net_device * | dev, | |
unsigned long | speed | |||
) | [static] |
Definition at line 1968 of file eth_v32.c.
References crisv32_eth_negotiate(), crisv32_ethernet_local::current_speed_selection, spin_lock, spin_unlock, and crisv32_ethernet_local::transceiver_lock.
Referenced by crisv32_eth_set_config(), and crisv32_eth_set_settings().
static void __init crisv32_eth_setup_controller | ( | struct net_device * | dev | ) | [static] |
Definition at line 231 of file eth_v32.c.
References crisv32_eth_probe_transceiver(), crisv32_ethernet_local::eth_inst, printk, and udelay.
Referenced by crisv32_ethernet_init().
static void crisv32_eth_tx_timeout | ( | struct net_device * | dev | ) | [static] |
Definition at line 1345 of file eth_v32.c.
References crisv32_ethernet_local::active_tx_desc, crisv32_ethernet_local::catch_tx_desc, crisv32_enable_tx_ints(), crisv32_eth_reset_tranceiver(), crisv32_ethernet_bug(), crisv32_ethernet_local::dma_out_inst, crisv32_ethernet_local::eth_inst, flags, KERN_WARNING, crisv32_ethernet_local::lock, printk, crisv32_ethernet_local::sender_started, crisv32_eth_descr::skb, crisv32_ethernet_local::stats, crisv32_ethernet_local::txpackets, and update_tx_stats().
Referenced by crisv32_ethernet_device_init().
static void crisv32_ethernet_bug | ( | struct net_device * | dev | ) | [static] |
Definition at line 2441 of file eth_v32.c.
References crisv32_ethernet_local::active_rx_desc, crisv32_ethernet_local::active_tx_desc, crisv32_ethernet_local::catch_tx_desc, crisv32_ethernet_local::dma_in_inst, crisv32_ethernet_local::dma_out_inst, crisv32_ethernet_local::dma_rx_descr_list, crisv32_ethernet_local::dma_tx_descr_list, crisv32_ethernet_local::eth_inst, crisv32_ethernet_local::last_rx_desc, NBR_TX_DESC, crisv32_ethernet_local::prev_rx_desc, printk, crisv32_eth_descr::skb, and crisv32_ethernet_local::txpackets.
Referenced by crisv32_eth_reset_rings(), and crisv32_eth_tx_timeout().
static int __init crisv32_ethernet_device_init | ( | struct net_device * | dev | ) | [static] |
Definition at line 618 of file eth_v32.c.
References autoneg, crisv32_eth_check_duplex(), crisv32_eth_check_speed(), crisv32_eth_close(), crisv32_eth_ioctl(), crisv32_eth_open(), crisv32_eth_poll(), crisv32_eth_send_packet(), crisv32_eth_set_config(), crisv32_eth_set_mac_address(), crisv32_eth_set_multicast_list(), crisv32_eth_tx_timeout(), crisv32_ethtool_ops, crisv32_get_stats(), crisv32_ethernet_local::current_duplex, crisv32_ethernet_local::current_speed, crisv32_ethernet_local::current_speed_selection, crisv32_ethernet_local::duplex_timer, crisv32_ethernet_local::full_duplex, jiffies, crisv32_ethernet_local::lock, NET_DUPLEX_CHECK_INTERVAL, NET_LINK_UP_CHECK_INTERVAL, crisv32_ethernet_local::speed_timer, spin_lock_init, and crisv32_ethernet_local::transceiver_lock.
Referenced by crisv32_ethernet_init().
static int __init crisv32_ethernet_init | ( | void | ) | [static] |
Definition at line 500 of file eth_v32.c.
References crisv32_dev, crisv32_eth_init_rings(), crisv32_eth_request_irqdma(), crisv32_eth_set_mac_address(), crisv32_eth_setup_controller(), crisv32_ethernet_device_init(), crisv32_init_leds(), default_mac_iface0, LED_GRP_0, LED_GRP_1, LED_GRP_NONE, memcpy(), printk, regi_eth0, and regi_eth1.
Referenced by crisv32_init_module().
static struct net_device_stats* crisv32_get_stats | ( | struct net_device * | dev | ) | [static] |
Definition at line 955 of file eth_v32.c.
References flags, crisv32_ethernet_local::lock, crisv32_ethernet_local::stats, update_rx_stats(), and update_tx_stats().
Referenced by crisv32_ethernet_device_init().
static int crisv32_has_rx_work | ( | struct crisv32_ethernet_local * | np, | |
dma_descr_data * | active | |||
) | [inline, static] |
Definition at line 1149 of file eth_v32.c.
References crisv32_ethernet_local::new_rx_package.
Referenced by crisv32_eth_poll().
static void __init crisv32_init_leds | ( | int | ledgrp, | |
struct net_device * | dev | |||
) | [static] |
Definition at line 469 of file eth_v32.c.
References crisv32_eth_leds::clear_led_timer, crisv32_clear_network_leds(), crisv32_leds, GFP_KERNEL, jiffies, kmalloc, crisv32_eth_leds::led_active, crisv32_eth_leds::led_next_time, crisv32_eth_leds::ledgrp, crisv32_ethernet_local::leds, and spin_lock_init.
Referenced by crisv32_ethernet_init().
static int crisv32_init_module | ( | void | ) | [static] |
static void crisv32_set_network_leds | ( | int | active, | |
struct net_device * | dev | |||
) | [static] |
Definition at line 2343 of file eth_v32.c.
References crisv32_dev, crisv32_ethernet_local::current_speed, crisv32_eth_leds::ifisup, LED_ACTIVITY, LED_GRP_NONE, LED_LINK, LED_NOACTIVITY, LED_NOLINK, crisv32_eth_leds::ledgrp, crisv32_ethernet_local::leds, and use_network_leds.
Referenced by crisv32_clear_network_leds(), crisv32_eth_check_speed(), crisv32_eth_receive_packet(), and crisv32_eth_send_packet().
static void crisv32_start_dma_out | ( | struct crisv32_ethernet_local * | np | ) | [static] |
Definition at line 1325 of file eth_v32.c.
References crisv32_ethernet_local::dma_out_inst, crisv32_ethernet_local::prev_tx_desc, and crisv32_ethernet_local::sender_started.
Referenced by crisv32_eth_hw_send_packet().
static void crisv32_start_receiver | ( | struct crisv32_ethernet_local * | np | ) | [inline, static] |
Definition at line 142 of file eth_v32.c.
References crisv32_ethernet_local::eth_inst.
Referenced by crisv32_eth_open().
static void crisv32_stop_receiver | ( | struct crisv32_ethernet_local * | np | ) | [inline, static] |
Definition at line 152 of file eth_v32.c.
References crisv32_ethernet_local::eth_inst.
Referenced by crisv32_eth_close().
static irqreturn_t crisv32nw_eth_interrupt | ( | int | irq, | |
void * | dev_id | |||
) | [static] |
Definition at line 972 of file eth_v32.c.
References crisv32_ethernet_local::active_tx_desc, crisv32_ethernet_local::catch_tx_desc, crisv32_ethernet_local::dma_out_inst, crisv32_ethernet_local::eth_inst, flags, crisv32_ethernet_local::lock, crisv32_ethernet_local::sender_started, crisv32_eth_descr::skb, crisv32_ethernet_local::stats, crisv32_ethernet_local::txpackets, update_rx_stats(), and update_tx_stats().
Referenced by crisv32_eth_request_irqdma().
static irqreturn_t crisv32rx_eth_interrupt | ( | int | irq, | |
void * | dev_id | |||
) | [static] |
Definition at line 833 of file eth_v32.c.
References crisv32_disable_rx_ints(), crisv32_ethernet_local::dma_in_inst, and printk.
Referenced by crisv32_eth_request_irqdma().
static irqreturn_t crisv32tx_eth_interrupt | ( | int | irq, | |
void * | dev_id | |||
) | [static] |
Definition at line 869 of file eth_v32.c.
References crisv32_ethernet_local::active_tx_desc, crisv32_ethernet_local::catch_tx_desc, crisv32_ethernet_local::dma_out_inst, flags, crisv32_ethernet_local::lock, printk, crisv32_eth_descr::skb, crisv32_ethernet_local::stats, and crisv32_ethernet_local::txpackets.
Referenced by crisv32_eth_request_irqdma().
static void generic_check_duplex | ( | struct net_device * | dev | ) | [static] |
Definition at line 2064 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), data, and crisv32_ethernet_local::full_duplex.
static void generic_check_speed | ( | struct net_device * | dev | ) | [static] |
Definition at line 2050 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), crisv32_ethernet_local::current_speed, and data.
static void intel_check_duplex | ( | struct net_device * | dev | ) | [static] |
Definition at line 2128 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), data, crisv32_ethernet_local::full_duplex, MDIO_INT_FULL_DUPLEX_IND, and MDIO_INT_STATUS_REG_2.
static void intel_check_speed | ( | struct net_device * | dev | ) | [static] |
Definition at line 2119 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), crisv32_ethernet_local::current_speed, data, MDIO_INT_SPEED, and MDIO_INT_STATUS_REG_2.
module_init | ( | crisv32_init_module | ) |
static void national_check_duplex | ( | struct net_device * | dev | ) | [static] |
Definition at line 2153 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), data, crisv32_ethernet_local::full_duplex, MDIO_NAT_FULL_DUPLEX_IND, and MDIO_NAT_LINK_AN_REG.
static void national_check_speed | ( | struct net_device * | dev | ) | [static] |
Definition at line 2138 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), crisv32_ethernet_local::current_speed, data, MDIO_NAT_100, MDIO_NAT_1000, and MDIO_NAT_LINK_AN_REG.
static void tdk_check_duplex | ( | struct net_device * | dev | ) | [static] |
Definition at line 2108 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), data, crisv32_ethernet_local::full_duplex, MDIO_TDK_DIAGNOSTIC_DPLX, and MDIO_TDK_DIAGNOSTIC_REG.
static void tdk_check_speed | ( | struct net_device * | dev | ) | [static] |
Definition at line 2098 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), crisv32_ethernet_local::current_speed, data, MDIO_TDK_DIAGNOSTIC_RATE, and MDIO_TDK_DIAGNOSTIC_REG.
static void update_rx_stats | ( | struct crisv32_ethernet_local * | np | ) | [static] |
Definition at line 927 of file eth_v32.c.
References crisv32_ethernet_local::eth_inst, rp, and crisv32_ethernet_local::stats.
Referenced by crisv32_eth_close(), crisv32_eth_poll(), crisv32_get_stats(), and crisv32nw_eth_interrupt().
static void update_tx_stats | ( | struct crisv32_ethernet_local * | np | ) | [static] |
Definition at line 943 of file eth_v32.c.
References crisv32_ethernet_local::eth_inst, and crisv32_ethernet_local::stats.
Referenced by crisv32_eth_close(), crisv32_eth_tx_timeout(), crisv32_get_stats(), and crisv32nw_eth_interrupt().
static void vitesse_check_duplex | ( | struct net_device * | dev | ) | [static] |
Definition at line 2181 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), data, crisv32_ethernet_local::full_duplex, and MDIO_VIT_AUX_STAT.
static void vitesse_check_speed | ( | struct net_device * | dev | ) | [static] |
Definition at line 2166 of file eth_v32.c.
References crisv32_eth_get_mdio_reg(), crisv32_ethernet_local::current_speed, data, MDIO_VIT_100, MDIO_VIT_1000, and MDIO_VIT_AUX_STAT.
int autoneg_normal = 1 [static] |
Definition at line 78 of file eth_v32.c.
Referenced by crisv32_eth_ioctl(), and crisv32_eth_negotiate().
const char* cardname = "ETRAX FS built-in ethernet controller" [static] |
struct net_device* crisv32_dev[2] [static] |
Definition at line 96 of file eth_v32.c.
Referenced by crisv32_ethernet_init(), and crisv32_set_network_leds().
struct ethtool_ops crisv32_ethtool_ops [static] |
Initial value:
{ .get_settings = crisv32_eth_get_settings, .set_settings = crisv32_eth_set_settings, .get_drvinfo = crisv32_eth_get_drvinfo, .nway_reset = crisv32_eth_nway_reset, .get_link = ethtool_op_get_link, }
Definition at line 1642 of file eth_v32.c.
Referenced by crisv32_ethernet_device_init().
struct crisv32_eth_leds* crisv32_leds[3] [static] |
struct sockaddr default_mac_iface0 [static] |
Initial value:
{0, {0x00, 0x40, 0x8C, 0xCD, 0x00, 0x00}}
Definition at line 101 of file eth_v32.c.
Referenced by crisv32_boot_setup(), and crisv32_ethernet_init().
struct transceiver_ops transceivers[] |
Initial value:
{ {0x1018, broadcom_check_speed, broadcom_check_duplex}, {0xC039, tdk_check_speed, tdk_check_duplex}, {0x039C, tdk_check_speed, tdk_check_duplex}, {0x04de, intel_check_speed, intel_check_duplex}, {0x0017, national_check_speed, national_check_duplex}, {0x01c1, vitesse_check_speed, vitesse_check_duplex}, {0x0000, generic_check_speed, generic_check_duplex} }
Definition at line 81 of file eth_v32.c.
Referenced by crisv32_eth_probe_transceiver().
int use_network_leds = 1 [static] |
Definition at line 63 of file eth_v32.c.
Referenced by crisv32_eth_ioctl(), and crisv32_set_network_leds().