2005-04-16 22:20:36 +00:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
Linux PCMCIA ethernet adapter driver for the New Media Ethernet LAN.
|
|
|
|
nmclan_cs.c,v 0.16 1995/07/01 06:42:17 rpao Exp rpao
|
|
|
|
|
|
|
|
The Ethernet LAN uses the Advanced Micro Devices (AMD) Am79C940 Media
|
|
|
|
Access Controller for Ethernet (MACE). It is essentially the Am2150
|
|
|
|
PCMCIA Ethernet card contained in the Am2150 Demo Kit.
|
|
|
|
|
|
|
|
Written by Roger C. Pao <rpao@paonet.org>
|
|
|
|
Copyright 1995 Roger C. Pao
|
|
|
|
Linux 2.5 cleanups Copyright Red Hat 2003
|
|
|
|
|
|
|
|
This software may be used and distributed according to the terms of
|
|
|
|
the GNU General Public License.
|
|
|
|
|
|
|
|
Ported to Linux 1.3.* network driver environment by
|
|
|
|
Matti Aarnio <mea@utu.fi>
|
|
|
|
|
|
|
|
References
|
|
|
|
|
|
|
|
Am2150 Technical Reference Manual, Revision 1.0, August 17, 1993
|
|
|
|
Am79C940 (MACE) Data Sheet, 1994
|
|
|
|
Am79C90 (C-LANCE) Data Sheet, 1994
|
|
|
|
Linux PCMCIA Programmer's Guide v1.17
|
|
|
|
/usr/src/linux/net/inet/dev.c, Linux kernel 1.2.8
|
|
|
|
|
|
|
|
Eric Mears, New Media Corporation
|
|
|
|
Tom Pollard, New Media Corporation
|
|
|
|
Dean Siasoyco, New Media Corporation
|
|
|
|
Ken Lesniak, Silicon Graphics, Inc. <lesniak@boston.sgi.com>
|
|
|
|
Donald Becker <becker@scyld.com>
|
|
|
|
David Hinds <dahinds@users.sourceforge.net>
|
|
|
|
|
|
|
|
The Linux client driver is based on the 3c589_cs.c client driver by
|
|
|
|
David Hinds.
|
|
|
|
|
|
|
|
The Linux network driver outline is based on the 3c589_cs.c driver,
|
|
|
|
the 8390.c driver, and the example skeleton.c kernel code, which are
|
|
|
|
by Donald Becker.
|
|
|
|
|
|
|
|
The Am2150 network driver hardware interface code is based on the
|
|
|
|
OS/9000 driver for the New Media Ethernet LAN by Eric Mears.
|
|
|
|
|
|
|
|
Special thanks for testing and help in debugging this driver goes
|
|
|
|
to Ken Lesniak.
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Driver Notes and Issues
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
1. Developed on a Dell 320SLi
|
|
|
|
PCMCIA Card Services 2.6.2
|
|
|
|
Linux dell 1.2.10 #1 Thu Jun 29 20:23:41 PDT 1995 i386
|
|
|
|
|
|
|
|
2. rc.pcmcia may require loading pcmcia_core with io_speed=300:
|
|
|
|
'insmod pcmcia_core.o io_speed=300'.
|
|
|
|
This will avoid problems with fast systems which causes rx_framecnt
|
|
|
|
to return random values.
|
|
|
|
|
|
|
|
3. If hot extraction does not work for you, use 'ifconfig eth0 down'
|
|
|
|
before extraction.
|
|
|
|
|
|
|
|
4. There is a bad slow-down problem in this driver.
|
|
|
|
|
|
|
|
5. Future: Multicast processing. In the meantime, do _not_ compile your
|
|
|
|
kernel with multicast ip enabled.
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
History
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Log: nmclan_cs.c,v
|
2008-10-14 02:01:08 +00:00
|
|
|
* 2.5.75-ac1 2003/07/11 Alan Cox <alan@lxorguk.ukuu.org.uk>
|
2005-04-16 22:20:36 +00:00
|
|
|
* Fixed hang on card eject as we probe it
|
|
|
|
* Cleaned up to use new style locking.
|
|
|
|
*
|
|
|
|
* Revision 0.16 1995/07/01 06:42:17 rpao
|
|
|
|
* Bug fix: nmclan_reset() called CardServices incorrectly.
|
|
|
|
*
|
|
|
|
* Revision 0.15 1995/05/24 08:09:47 rpao
|
|
|
|
* Re-implement MULTI_TX dev->tbusy handling.
|
|
|
|
*
|
|
|
|
* Revision 0.14 1995/05/23 03:19:30 rpao
|
|
|
|
* Added, in nmclan_config(), "tuple.Attributes = 0;".
|
|
|
|
* Modified MACE ID check to ignore chip revision level.
|
|
|
|
* Avoid tx_free_frames race condition between _start_xmit and _interrupt.
|
|
|
|
*
|
|
|
|
* Revision 0.13 1995/05/18 05:56:34 rpao
|
|
|
|
* Statistics changes.
|
|
|
|
* Bug fix: nmclan_reset did not enable TX and RX: call restore_multicast_list.
|
|
|
|
* Bug fix: mace_interrupt checks ~MACE_IMR_DEFAULT. Fixes driver lockup.
|
|
|
|
*
|
|
|
|
* Revision 0.12 1995/05/14 00:12:23 rpao
|
|
|
|
* Statistics overhaul.
|
|
|
|
*
|
|
|
|
|
|
|
|
95/05/13 rpao V0.10a
|
|
|
|
Bug fix: MACE statistics counters used wrong I/O ports.
|
|
|
|
Bug fix: mace_interrupt() needed to allow statistics to be
|
|
|
|
processed without RX or TX interrupts pending.
|
|
|
|
95/05/11 rpao V0.10
|
|
|
|
Multiple transmit request processing.
|
|
|
|
Modified statistics to use MACE counters where possible.
|
|
|
|
95/05/10 rpao V0.09 Bug fix: Must use IO_DATA_PATH_WIDTH_AUTO.
|
|
|
|
*Released
|
|
|
|
95/05/10 rpao V0.08
|
|
|
|
Bug fix: Make all non-exported functions private by using
|
|
|
|
static keyword.
|
|
|
|
Bug fix: Test IntrCnt _before_ reading MACE_IR.
|
|
|
|
95/05/10 rpao V0.07 Statistics.
|
|
|
|
95/05/09 rpao V0.06 Fix rx_framecnt problem by addition of PCIC wait states.
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
|
2010-08-12 12:22:51 +00:00
|
|
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#define DRV_NAME "nmclan_cs"
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
Conditional Compilation Options
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
#define MULTI_TX 0
|
|
|
|
#define RESET_ON_TIMEOUT 1
|
|
|
|
#define TX_INTERRUPTABLE 1
|
|
|
|
#define RESET_XILINX 0
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
Include Files
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/ptrace.h>
|
|
|
|
#include <linux/slab.h>
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <linux/timer.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/in.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/ethtool.h>
|
|
|
|
#include <linux/netdevice.h>
|
|
|
|
#include <linux/etherdevice.h>
|
|
|
|
#include <linux/skbuff.h>
|
|
|
|
#include <linux/if_arp.h>
|
|
|
|
#include <linux/ioport.h>
|
|
|
|
#include <linux/bitops.h>
|
|
|
|
|
|
|
|
#include <pcmcia/cisreg.h>
|
|
|
|
#include <pcmcia/cistpl.h>
|
|
|
|
#include <pcmcia/ds.h>
|
|
|
|
|
2016-12-24 19:46:01 +00:00
|
|
|
#include <linux/uaccess.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <asm/io.h>
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
Defines
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
#define MACE_LADRF_LEN 8
|
|
|
|
/* 8 bytes in Logical Address Filter */
|
|
|
|
|
|
|
|
/* Loop Control Defines */
|
|
|
|
#define MACE_MAX_IR_ITERATIONS 10
|
|
|
|
#define MACE_MAX_RX_ITERATIONS 12
|
|
|
|
/*
|
|
|
|
TBD: Dean brought this up, and I assumed the hardware would
|
|
|
|
handle it:
|
|
|
|
|
|
|
|
If MACE_MAX_RX_ITERATIONS is > 1, rx_framecnt may still be
|
|
|
|
non-zero when the isr exits. We may not get another interrupt
|
|
|
|
to process the remaining packets for some time.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
The Am2150 has a Xilinx XC3042 field programmable gate array (FPGA)
|
|
|
|
which manages the interface between the MACE and the PCMCIA bus. It
|
|
|
|
also includes buffer management for the 32K x 8 SRAM to control up to
|
|
|
|
four transmit and 12 receive frames at a time.
|
|
|
|
*/
|
|
|
|
#define AM2150_MAX_TX_FRAMES 4
|
|
|
|
#define AM2150_MAX_RX_FRAMES 12
|
|
|
|
|
|
|
|
/* Am2150 Ethernet Card I/O Mapping */
|
|
|
|
#define AM2150_RCV 0x00
|
|
|
|
#define AM2150_XMT 0x04
|
|
|
|
#define AM2150_XMT_SKIP 0x09
|
|
|
|
#define AM2150_RCV_NEXT 0x0A
|
|
|
|
#define AM2150_RCV_FRAME_COUNT 0x0B
|
|
|
|
#define AM2150_MACE_BANK 0x0C
|
|
|
|
#define AM2150_MACE_BASE 0x10
|
|
|
|
|
|
|
|
/* MACE Registers */
|
|
|
|
#define MACE_RCVFIFO 0
|
|
|
|
#define MACE_XMTFIFO 1
|
|
|
|
#define MACE_XMTFC 2
|
|
|
|
#define MACE_XMTFS 3
|
|
|
|
#define MACE_XMTRC 4
|
|
|
|
#define MACE_RCVFC 5
|
|
|
|
#define MACE_RCVFS 6
|
|
|
|
#define MACE_FIFOFC 7
|
|
|
|
#define MACE_IR 8
|
|
|
|
#define MACE_IMR 9
|
|
|
|
#define MACE_PR 10
|
|
|
|
#define MACE_BIUCC 11
|
|
|
|
#define MACE_FIFOCC 12
|
|
|
|
#define MACE_MACCC 13
|
|
|
|
#define MACE_PLSCC 14
|
|
|
|
#define MACE_PHYCC 15
|
|
|
|
#define MACE_CHIPIDL 16
|
|
|
|
#define MACE_CHIPIDH 17
|
|
|
|
#define MACE_IAC 18
|
|
|
|
/* Reserved */
|
|
|
|
#define MACE_LADRF 20
|
|
|
|
#define MACE_PADR 21
|
|
|
|
/* Reserved */
|
|
|
|
/* Reserved */
|
|
|
|
#define MACE_MPC 24
|
|
|
|
/* Reserved */
|
|
|
|
#define MACE_RNTPC 26
|
|
|
|
#define MACE_RCVCC 27
|
|
|
|
/* Reserved */
|
|
|
|
#define MACE_UTR 29
|
|
|
|
#define MACE_RTR1 30
|
|
|
|
#define MACE_RTR2 31
|
|
|
|
|
|
|
|
/* MACE Bit Masks */
|
|
|
|
#define MACE_XMTRC_EXDEF 0x80
|
|
|
|
#define MACE_XMTRC_XMTRC 0x0F
|
|
|
|
|
|
|
|
#define MACE_XMTFS_XMTSV 0x80
|
|
|
|
#define MACE_XMTFS_UFLO 0x40
|
|
|
|
#define MACE_XMTFS_LCOL 0x20
|
|
|
|
#define MACE_XMTFS_MORE 0x10
|
|
|
|
#define MACE_XMTFS_ONE 0x08
|
|
|
|
#define MACE_XMTFS_DEFER 0x04
|
|
|
|
#define MACE_XMTFS_LCAR 0x02
|
|
|
|
#define MACE_XMTFS_RTRY 0x01
|
|
|
|
|
|
|
|
#define MACE_RCVFS_RCVSTS 0xF000
|
|
|
|
#define MACE_RCVFS_OFLO 0x8000
|
|
|
|
#define MACE_RCVFS_CLSN 0x4000
|
|
|
|
#define MACE_RCVFS_FRAM 0x2000
|
|
|
|
#define MACE_RCVFS_FCS 0x1000
|
|
|
|
|
|
|
|
#define MACE_FIFOFC_RCVFC 0xF0
|
|
|
|
#define MACE_FIFOFC_XMTFC 0x0F
|
|
|
|
|
|
|
|
#define MACE_IR_JAB 0x80
|
|
|
|
#define MACE_IR_BABL 0x40
|
|
|
|
#define MACE_IR_CERR 0x20
|
|
|
|
#define MACE_IR_RCVCCO 0x10
|
|
|
|
#define MACE_IR_RNTPCO 0x08
|
|
|
|
#define MACE_IR_MPCO 0x04
|
|
|
|
#define MACE_IR_RCVINT 0x02
|
|
|
|
#define MACE_IR_XMTINT 0x01
|
|
|
|
|
|
|
|
#define MACE_MACCC_PROM 0x80
|
|
|
|
#define MACE_MACCC_DXMT2PD 0x40
|
|
|
|
#define MACE_MACCC_EMBA 0x20
|
|
|
|
#define MACE_MACCC_RESERVED 0x10
|
|
|
|
#define MACE_MACCC_DRCVPA 0x08
|
|
|
|
#define MACE_MACCC_DRCVBC 0x04
|
|
|
|
#define MACE_MACCC_ENXMT 0x02
|
|
|
|
#define MACE_MACCC_ENRCV 0x01
|
|
|
|
|
|
|
|
#define MACE_PHYCC_LNKFL 0x80
|
|
|
|
#define MACE_PHYCC_DLNKTST 0x40
|
|
|
|
#define MACE_PHYCC_REVPOL 0x20
|
|
|
|
#define MACE_PHYCC_DAPC 0x10
|
|
|
|
#define MACE_PHYCC_LRT 0x08
|
|
|
|
#define MACE_PHYCC_ASEL 0x04
|
|
|
|
#define MACE_PHYCC_RWAKE 0x02
|
|
|
|
#define MACE_PHYCC_AWAKE 0x01
|
|
|
|
|
|
|
|
#define MACE_IAC_ADDRCHG 0x80
|
|
|
|
#define MACE_IAC_PHYADDR 0x04
|
|
|
|
#define MACE_IAC_LOGADDR 0x02
|
|
|
|
|
|
|
|
#define MACE_UTR_RTRE 0x80
|
|
|
|
#define MACE_UTR_RTRD 0x40
|
|
|
|
#define MACE_UTR_RPA 0x20
|
|
|
|
#define MACE_UTR_FCOLL 0x10
|
|
|
|
#define MACE_UTR_RCVFCSE 0x08
|
|
|
|
#define MACE_UTR_LOOP_INCL_MENDEC 0x06
|
|
|
|
#define MACE_UTR_LOOP_NO_MENDEC 0x04
|
|
|
|
#define MACE_UTR_LOOP_EXTERNAL 0x02
|
|
|
|
#define MACE_UTR_LOOP_NONE 0x00
|
|
|
|
#define MACE_UTR_RESERVED 0x01
|
|
|
|
|
|
|
|
/* Switch MACE register bank (only 0 and 1 are valid) */
|
|
|
|
#define MACEBANK(win_num) outb((win_num), ioaddr + AM2150_MACE_BANK)
|
|
|
|
|
|
|
|
#define MACE_IMR_DEFAULT \
|
|
|
|
(0xFF - \
|
|
|
|
( \
|
|
|
|
MACE_IR_CERR | \
|
|
|
|
MACE_IR_RCVCCO | \
|
|
|
|
MACE_IR_RNTPCO | \
|
|
|
|
MACE_IR_MPCO | \
|
|
|
|
MACE_IR_RCVINT | \
|
|
|
|
MACE_IR_XMTINT \
|
|
|
|
) \
|
|
|
|
)
|
|
|
|
#undef MACE_IMR_DEFAULT
|
|
|
|
#define MACE_IMR_DEFAULT 0x00 /* New statistics handling: grab everything */
|
|
|
|
|
|
|
|
#define TX_TIMEOUT ((400*HZ)/1000)
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
Type Definitions
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
typedef struct _mace_statistics {
|
|
|
|
/* MACE_XMTFS */
|
|
|
|
int xmtsv;
|
|
|
|
int uflo;
|
|
|
|
int lcol;
|
|
|
|
int more;
|
|
|
|
int one;
|
|
|
|
int defer;
|
|
|
|
int lcar;
|
|
|
|
int rtry;
|
|
|
|
|
|
|
|
/* MACE_XMTRC */
|
|
|
|
int exdef;
|
|
|
|
int xmtrc;
|
|
|
|
|
|
|
|
/* RFS1--Receive Status (RCVSTS) */
|
|
|
|
int oflo;
|
|
|
|
int clsn;
|
|
|
|
int fram;
|
|
|
|
int fcs;
|
|
|
|
|
|
|
|
/* RFS2--Runt Packet Count (RNTPC) */
|
|
|
|
int rfs_rntpc;
|
|
|
|
|
|
|
|
/* RFS3--Receive Collision Count (RCVCC) */
|
|
|
|
int rfs_rcvcc;
|
|
|
|
|
|
|
|
/* MACE_IR */
|
|
|
|
int jab;
|
|
|
|
int babl;
|
|
|
|
int cerr;
|
|
|
|
int rcvcco;
|
|
|
|
int rntpco;
|
|
|
|
int mpco;
|
|
|
|
|
|
|
|
/* MACE_MPC */
|
|
|
|
int mpc;
|
|
|
|
|
|
|
|
/* MACE_RNTPC */
|
|
|
|
int rntpc;
|
|
|
|
|
|
|
|
/* MACE_RCVCC */
|
|
|
|
int rcvcc;
|
|
|
|
} mace_statistics;
|
|
|
|
|
|
|
|
typedef struct _mace_private {
|
2006-03-05 09:45:09 +00:00
|
|
|
struct pcmcia_device *p_dev;
|
2005-04-16 22:20:36 +00:00
|
|
|
mace_statistics mace_stats; /* MACE chip statistics counters */
|
|
|
|
|
|
|
|
/* restore_multicast_list() state variables */
|
|
|
|
int multicast_ladrf[MACE_LADRF_LEN]; /* Logical address filter */
|
|
|
|
int multicast_num_addrs;
|
|
|
|
|
|
|
|
char tx_free_frames; /* Number of free transmit frame buffers */
|
|
|
|
char tx_irq_disabled; /* MACE TX interrupt disabled */
|
2020-02-24 08:53:06 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
spinlock_t bank_lock; /* Must be held if you step off bank 0 */
|
|
|
|
} mace_private;
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
Private Global Variables
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
|
2006-03-04 02:33:57 +00:00
|
|
|
static const char *if_names[]={
|
2005-04-16 22:20:36 +00:00
|
|
|
"Auto", "10baseT", "BNC",
|
|
|
|
};
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
Parameters
|
|
|
|
These are the parameters that can be set during loading with
|
|
|
|
'insmod'.
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
MODULE_DESCRIPTION("New Media PCMCIA ethernet driver");
|
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
|
|
|
|
#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0)
|
|
|
|
|
|
|
|
/* 0=auto, 1=10baseT, 2 = 10base2, default=auto */
|
|
|
|
INT_MODULE_PARM(if_port, 0);
|
|
|
|
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
Function Prototypes
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
|
2006-03-31 15:26:06 +00:00
|
|
|
static int nmclan_config(struct pcmcia_device *link);
|
2006-03-31 15:21:06 +00:00
|
|
|
static void nmclan_release(struct pcmcia_device *link);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
static void nmclan_reset(struct net_device *dev);
|
|
|
|
static int mace_config(struct net_device *dev, struct ifmap *map);
|
|
|
|
static int mace_open(struct net_device *dev);
|
|
|
|
static int mace_close(struct net_device *dev);
|
2009-08-31 19:50:49 +00:00
|
|
|
static netdev_tx_t mace_start_xmit(struct sk_buff *skb,
|
|
|
|
struct net_device *dev);
|
netdev: pass the stuck queue to the timeout handler
This allows incrementing the correct timeout statistic without any mess.
Down the road, devices can learn to reset just the specific queue.
The patch was generated with the following script:
use strict;
use warnings;
our $^I = '.bak';
my @work = (
["arch/m68k/emu/nfeth.c", "nfeth_tx_timeout"],
["arch/um/drivers/net_kern.c", "uml_net_tx_timeout"],
["arch/um/drivers/vector_kern.c", "vector_net_tx_timeout"],
["arch/xtensa/platforms/iss/network.c", "iss_net_tx_timeout"],
["drivers/char/pcmcia/synclink_cs.c", "hdlcdev_tx_timeout"],
["drivers/infiniband/ulp/ipoib/ipoib_main.c", "ipoib_timeout"],
["drivers/infiniband/ulp/ipoib/ipoib_main.c", "ipoib_timeout"],
["drivers/message/fusion/mptlan.c", "mpt_lan_tx_timeout"],
["drivers/misc/sgi-xp/xpnet.c", "xpnet_dev_tx_timeout"],
["drivers/net/appletalk/cops.c", "cops_timeout"],
["drivers/net/arcnet/arcdevice.h", "arcnet_timeout"],
["drivers/net/arcnet/arcnet.c", "arcnet_timeout"],
["drivers/net/arcnet/com20020.c", "arcnet_timeout"],
["drivers/net/ethernet/3com/3c509.c", "el3_tx_timeout"],
["drivers/net/ethernet/3com/3c515.c", "corkscrew_timeout"],
["drivers/net/ethernet/3com/3c574_cs.c", "el3_tx_timeout"],
["drivers/net/ethernet/3com/3c589_cs.c", "el3_tx_timeout"],
["drivers/net/ethernet/3com/3c59x.c", "vortex_tx_timeout"],
["drivers/net/ethernet/3com/3c59x.c", "vortex_tx_timeout"],
["drivers/net/ethernet/3com/typhoon.c", "typhoon_tx_timeout"],
["drivers/net/ethernet/8390/8390.h", "ei_tx_timeout"],
["drivers/net/ethernet/8390/8390.h", "eip_tx_timeout"],
["drivers/net/ethernet/8390/8390.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/8390p.c", "eip_tx_timeout"],
["drivers/net/ethernet/8390/ax88796.c", "ax_ei_tx_timeout"],
["drivers/net/ethernet/8390/axnet_cs.c", "axnet_tx_timeout"],
["drivers/net/ethernet/8390/etherh.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/hydra.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/mac8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/mcf8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/lib8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/ne2k-pci.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/pcnet_cs.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/smc-ultra.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/wd.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/zorro8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/adaptec/starfire.c", "tx_timeout"],
["drivers/net/ethernet/agere/et131x.c", "et131x_tx_timeout"],
["drivers/net/ethernet/allwinner/sun4i-emac.c", "emac_timeout"],
["drivers/net/ethernet/alteon/acenic.c", "ace_watchdog"],
["drivers/net/ethernet/amazon/ena/ena_netdev.c", "ena_tx_timeout"],
["drivers/net/ethernet/amd/7990.h", "lance_tx_timeout"],
["drivers/net/ethernet/amd/7990.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/a2065.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/am79c961a.c", "am79c961_timeout"],
["drivers/net/ethernet/amd/amd8111e.c", "amd8111e_tx_timeout"],
["drivers/net/ethernet/amd/ariadne.c", "ariadne_tx_timeout"],
["drivers/net/ethernet/amd/atarilance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/au1000_eth.c", "au1000_tx_timeout"],
["drivers/net/ethernet/amd/declance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/lance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/mvme147.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/ni65.c", "ni65_timeout"],
["drivers/net/ethernet/amd/nmclan_cs.c", "mace_tx_timeout"],
["drivers/net/ethernet/amd/pcnet32.c", "pcnet32_tx_timeout"],
["drivers/net/ethernet/amd/sunlance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/xgbe/xgbe-drv.c", "xgbe_tx_timeout"],
["drivers/net/ethernet/apm/xgene-v2/main.c", "xge_timeout"],
["drivers/net/ethernet/apm/xgene/xgene_enet_main.c", "xgene_enet_timeout"],
["drivers/net/ethernet/apple/macmace.c", "mace_tx_timeout"],
["drivers/net/ethernet/atheros/ag71xx.c", "ag71xx_tx_timeout"],
["drivers/net/ethernet/atheros/alx/main.c", "alx_tx_timeout"],
["drivers/net/ethernet/atheros/atl1c/atl1c_main.c", "atl1c_tx_timeout"],
["drivers/net/ethernet/atheros/atl1e/atl1e_main.c", "atl1e_tx_timeout"],
["drivers/net/ethernet/atheros/atlx/atl.c", "atlx_tx_timeout"],
["drivers/net/ethernet/atheros/atlx/atl1.c", "atlx_tx_timeout"],
["drivers/net/ethernet/atheros/atlx/atl2.c", "atl2_tx_timeout"],
["drivers/net/ethernet/broadcom/b44.c", "b44_tx_timeout"],
["drivers/net/ethernet/broadcom/bcmsysport.c", "bcm_sysport_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2.c", "bnx2_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h", "bnx2x_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c", "bnx2x_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", "bnx2x_tx_timeout"],
["drivers/net/ethernet/broadcom/bnxt/bnxt.c", "bnxt_tx_timeout"],
["drivers/net/ethernet/broadcom/genet/bcmgenet.c", "bcmgenet_timeout"],
["drivers/net/ethernet/broadcom/sb1250-mac.c", "sbmac_tx_timeout"],
["drivers/net/ethernet/broadcom/tg3.c", "tg3_tx_timeout"],
["drivers/net/ethernet/calxeda/xgmac.c", "xgmac_tx_timeout"],
["drivers/net/ethernet/cavium/liquidio/lio_main.c", "liquidio_tx_timeout"],
["drivers/net/ethernet/cavium/liquidio/lio_vf_main.c", "liquidio_tx_timeout"],
["drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c", "lio_vf_rep_tx_timeout"],
["drivers/net/ethernet/cavium/thunder/nicvf_main.c", "nicvf_tx_timeout"],
["drivers/net/ethernet/cirrus/cs89x0.c", "net_timeout"],
["drivers/net/ethernet/cisco/enic/enic_main.c", "enic_tx_timeout"],
["drivers/net/ethernet/cisco/enic/enic_main.c", "enic_tx_timeout"],
["drivers/net/ethernet/cortina/gemini.c", "gmac_tx_timeout"],
["drivers/net/ethernet/davicom/dm9000.c", "dm9000_timeout"],
["drivers/net/ethernet/dec/tulip/de2104x.c", "de_tx_timeout"],
["drivers/net/ethernet/dec/tulip/tulip_core.c", "tulip_tx_timeout"],
["drivers/net/ethernet/dec/tulip/winbond-840.c", "tx_timeout"],
["drivers/net/ethernet/dlink/dl2k.c", "rio_tx_timeout"],
["drivers/net/ethernet/dlink/sundance.c", "tx_timeout"],
["drivers/net/ethernet/emulex/benet/be_main.c", "be_tx_timeout"],
["drivers/net/ethernet/ethoc.c", "ethoc_tx_timeout"],
["drivers/net/ethernet/faraday/ftgmac100.c", "ftgmac100_tx_timeout"],
["drivers/net/ethernet/fealnx.c", "fealnx_tx_timeout"],
["drivers/net/ethernet/freescale/dpaa/dpaa_eth.c", "dpaa_tx_timeout"],
["drivers/net/ethernet/freescale/fec_main.c", "fec_timeout"],
["drivers/net/ethernet/freescale/fec_mpc52xx.c", "mpc52xx_fec_tx_timeout"],
["drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c", "fs_timeout"],
["drivers/net/ethernet/freescale/gianfar.c", "gfar_timeout"],
["drivers/net/ethernet/freescale/ucc_geth.c", "ucc_geth_timeout"],
["drivers/net/ethernet/fujitsu/fmvj18x_cs.c", "fjn_tx_timeout"],
["drivers/net/ethernet/google/gve/gve_main.c", "gve_tx_timeout"],
["drivers/net/ethernet/hisilicon/hip04_eth.c", "hip04_timeout"],
["drivers/net/ethernet/hisilicon/hix5hd2_gmac.c", "hix5hd2_net_timeout"],
["drivers/net/ethernet/hisilicon/hns/hns_enet.c", "hns_nic_net_timeout"],
["drivers/net/ethernet/hisilicon/hns3/hns3_enet.c", "hns3_nic_net_timeout"],
["drivers/net/ethernet/huawei/hinic/hinic_main.c", "hinic_tx_timeout"],
["drivers/net/ethernet/i825xx/82596.c", "i596_tx_timeout"],
["drivers/net/ethernet/i825xx/ether1.c", "ether1_timeout"],
["drivers/net/ethernet/i825xx/lib82596.c", "i596_tx_timeout"],
["drivers/net/ethernet/i825xx/sun3_82586.c", "sun3_82586_timeout"],
["drivers/net/ethernet/ibm/ehea/ehea_main.c", "ehea_tx_watchdog"],
["drivers/net/ethernet/ibm/emac/core.c", "emac_tx_timeout"],
["drivers/net/ethernet/ibm/emac/core.c", "emac_tx_timeout"],
["drivers/net/ethernet/ibm/ibmvnic.c", "ibmvnic_tx_timeout"],
["drivers/net/ethernet/intel/e100.c", "e100_tx_timeout"],
["drivers/net/ethernet/intel/e1000/e1000_main.c", "e1000_tx_timeout"],
["drivers/net/ethernet/intel/e1000e/netdev.c", "e1000_tx_timeout"],
["drivers/net/ethernet/intel/fm10k/fm10k_netdev.c", "fm10k_tx_timeout"],
["drivers/net/ethernet/intel/i40e/i40e_main.c", "i40e_tx_timeout"],
["drivers/net/ethernet/intel/iavf/iavf_main.c", "iavf_tx_timeout"],
["drivers/net/ethernet/intel/ice/ice_main.c", "ice_tx_timeout"],
["drivers/net/ethernet/intel/ice/ice_main.c", "ice_tx_timeout"],
["drivers/net/ethernet/intel/igb/igb_main.c", "igb_tx_timeout"],
["drivers/net/ethernet/intel/igbvf/netdev.c", "igbvf_tx_timeout"],
["drivers/net/ethernet/intel/ixgb/ixgb_main.c", "ixgb_tx_timeout"],
["drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c", "adapter->netdev->netdev_ops->ndo_tx_timeout(adapter->netdev);"],
["drivers/net/ethernet/intel/ixgbe/ixgbe_main.c", "ixgbe_tx_timeout"],
["drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c", "ixgbevf_tx_timeout"],
["drivers/net/ethernet/jme.c", "jme_tx_timeout"],
["drivers/net/ethernet/korina.c", "korina_tx_timeout"],
["drivers/net/ethernet/lantiq_etop.c", "ltq_etop_tx_timeout"],
["drivers/net/ethernet/marvell/mv643xx_eth.c", "mv643xx_eth_tx_timeout"],
["drivers/net/ethernet/marvell/pxa168_eth.c", "pxa168_eth_tx_timeout"],
["drivers/net/ethernet/marvell/skge.c", "skge_tx_timeout"],
["drivers/net/ethernet/marvell/sky2.c", "sky2_tx_timeout"],
["drivers/net/ethernet/marvell/sky2.c", "sky2_tx_timeout"],
["drivers/net/ethernet/mediatek/mtk_eth_soc.c", "mtk_tx_timeout"],
["drivers/net/ethernet/mellanox/mlx4/en_netdev.c", "mlx4_en_tx_timeout"],
["drivers/net/ethernet/mellanox/mlx4/en_netdev.c", "mlx4_en_tx_timeout"],
["drivers/net/ethernet/mellanox/mlx5/core/en_main.c", "mlx5e_tx_timeout"],
["drivers/net/ethernet/micrel/ks8842.c", "ks8842_tx_timeout"],
["drivers/net/ethernet/micrel/ksz884x.c", "netdev_tx_timeout"],
["drivers/net/ethernet/microchip/enc28j60.c", "enc28j60_tx_timeout"],
["drivers/net/ethernet/microchip/encx24j600.c", "encx24j600_tx_timeout"],
["drivers/net/ethernet/natsemi/sonic.h", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/sonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/jazzsonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/macsonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/natsemi.c", "ns_tx_timeout"],
["drivers/net/ethernet/natsemi/ns83820.c", "ns83820_tx_timeout"],
["drivers/net/ethernet/natsemi/xtsonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/neterion/s2io.h", "s2io_tx_watchdog"],
["drivers/net/ethernet/neterion/s2io.c", "s2io_tx_watchdog"],
["drivers/net/ethernet/neterion/vxge/vxge-main.c", "vxge_tx_watchdog"],
["drivers/net/ethernet/netronome/nfp/nfp_net_common.c", "nfp_net_tx_timeout"],
["drivers/net/ethernet/nvidia/forcedeth.c", "nv_tx_timeout"],
["drivers/net/ethernet/nvidia/forcedeth.c", "nv_tx_timeout"],
["drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c", "pch_gbe_tx_timeout"],
["drivers/net/ethernet/packetengines/hamachi.c", "hamachi_tx_timeout"],
["drivers/net/ethernet/packetengines/yellowfin.c", "yellowfin_tx_timeout"],
["drivers/net/ethernet/pensando/ionic/ionic_lif.c", "ionic_tx_timeout"],
["drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c", "netxen_tx_timeout"],
["drivers/net/ethernet/qlogic/qla3xxx.c", "ql3xxx_tx_timeout"],
["drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c", "qlcnic_tx_timeout"],
["drivers/net/ethernet/qualcomm/emac/emac.c", "emac_tx_timeout"],
["drivers/net/ethernet/qualcomm/qca_spi.c", "qcaspi_netdev_tx_timeout"],
["drivers/net/ethernet/qualcomm/qca_uart.c", "qcauart_netdev_tx_timeout"],
["drivers/net/ethernet/rdc/r6040.c", "r6040_tx_timeout"],
["drivers/net/ethernet/realtek/8139cp.c", "cp_tx_timeout"],
["drivers/net/ethernet/realtek/8139too.c", "rtl8139_tx_timeout"],
["drivers/net/ethernet/realtek/atp.c", "tx_timeout"],
["drivers/net/ethernet/realtek/r8169_main.c", "rtl8169_tx_timeout"],
["drivers/net/ethernet/renesas/ravb_main.c", "ravb_tx_timeout"],
["drivers/net/ethernet/renesas/sh_eth.c", "sh_eth_tx_timeout"],
["drivers/net/ethernet/renesas/sh_eth.c", "sh_eth_tx_timeout"],
["drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c", "sxgbe_tx_timeout"],
["drivers/net/ethernet/seeq/ether3.c", "ether3_timeout"],
["drivers/net/ethernet/seeq/sgiseeq.c", "timeout"],
["drivers/net/ethernet/sfc/efx.c", "efx_watchdog"],
["drivers/net/ethernet/sfc/falcon/efx.c", "ef4_watchdog"],
["drivers/net/ethernet/sgi/ioc3-eth.c", "ioc3_timeout"],
["drivers/net/ethernet/sgi/meth.c", "meth_tx_timeout"],
["drivers/net/ethernet/silan/sc92031.c", "sc92031_tx_timeout"],
["drivers/net/ethernet/sis/sis190.c", "sis190_tx_timeout"],
["drivers/net/ethernet/sis/sis900.c", "sis900_tx_timeout"],
["drivers/net/ethernet/smsc/epic100.c", "epic_tx_timeout"],
["drivers/net/ethernet/smsc/smc911x.c", "smc911x_timeout"],
["drivers/net/ethernet/smsc/smc9194.c", "smc_timeout"],
["drivers/net/ethernet/smsc/smc91c92_cs.c", "smc_tx_timeout"],
["drivers/net/ethernet/smsc/smc91x.c", "smc_timeout"],
["drivers/net/ethernet/stmicro/stmmac/stmmac_main.c", "stmmac_tx_timeout"],
["drivers/net/ethernet/sun/cassini.c", "cas_tx_timeout"],
["drivers/net/ethernet/sun/ldmvsw.c", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/sun/niu.c", "niu_tx_timeout"],
["drivers/net/ethernet/sun/sunbmac.c", "bigmac_tx_timeout"],
["drivers/net/ethernet/sun/sungem.c", "gem_tx_timeout"],
["drivers/net/ethernet/sun/sunhme.c", "happy_meal_tx_timeout"],
["drivers/net/ethernet/sun/sunqe.c", "qe_tx_timeout"],
["drivers/net/ethernet/sun/sunvnet.c", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/sun/sunvnet_common.c", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/sun/sunvnet_common.h", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/synopsys/dwc-xlgmac-net.c", "xlgmac_tx_timeout"],
["drivers/net/ethernet/ti/cpmac.c", "cpmac_tx_timeout"],
["drivers/net/ethernet/ti/cpsw.c", "cpsw_ndo_tx_timeout"],
["drivers/net/ethernet/ti/cpsw_priv.c", "cpsw_ndo_tx_timeout"],
["drivers/net/ethernet/ti/cpsw_priv.h", "cpsw_ndo_tx_timeout"],
["drivers/net/ethernet/ti/davinci_emac.c", "emac_dev_tx_timeout"],
["drivers/net/ethernet/ti/netcp_core.c", "netcp_ndo_tx_timeout"],
["drivers/net/ethernet/ti/tlan.c", "tlan_tx_timeout"],
["drivers/net/ethernet/toshiba/ps3_gelic_net.h", "gelic_net_tx_timeout"],
["drivers/net/ethernet/toshiba/ps3_gelic_net.c", "gelic_net_tx_timeout"],
["drivers/net/ethernet/toshiba/ps3_gelic_wireless.c", "gelic_net_tx_timeout"],
["drivers/net/ethernet/toshiba/spider_net.c", "spider_net_tx_timeout"],
["drivers/net/ethernet/toshiba/tc35815.c", "tc35815_tx_timeout"],
["drivers/net/ethernet/via/via-rhine.c", "rhine_tx_timeout"],
["drivers/net/ethernet/wiznet/w5100.c", "w5100_tx_timeout"],
["drivers/net/ethernet/wiznet/w5300.c", "w5300_tx_timeout"],
["drivers/net/ethernet/xilinx/xilinx_emaclite.c", "xemaclite_tx_timeout"],
["drivers/net/ethernet/xircom/xirc2ps_cs.c", "xirc_tx_timeout"],
["drivers/net/fjes/fjes_main.c", "fjes_tx_retry"],
["drivers/net/slip/slip.c", "sl_tx_timeout"],
["include/linux/usb/usbnet.h", "usbnet_tx_timeout"],
["drivers/net/usb/aqc111.c", "usbnet_tx_timeout"],
["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
["drivers/net/usb/ax88172a.c", "usbnet_tx_timeout"],
["drivers/net/usb/ax88179_178a.c", "usbnet_tx_timeout"],
["drivers/net/usb/catc.c", "catc_tx_timeout"],
["drivers/net/usb/cdc_mbim.c", "usbnet_tx_timeout"],
["drivers/net/usb/cdc_ncm.c", "usbnet_tx_timeout"],
["drivers/net/usb/dm9601.c", "usbnet_tx_timeout"],
["drivers/net/usb/hso.c", "hso_net_tx_timeout"],
["drivers/net/usb/int51x1.c", "usbnet_tx_timeout"],
["drivers/net/usb/ipheth.c", "ipheth_tx_timeout"],
["drivers/net/usb/kaweth.c", "kaweth_tx_timeout"],
["drivers/net/usb/lan78xx.c", "lan78xx_tx_timeout"],
["drivers/net/usb/mcs7830.c", "usbnet_tx_timeout"],
["drivers/net/usb/pegasus.c", "pegasus_tx_timeout"],
["drivers/net/usb/qmi_wwan.c", "usbnet_tx_timeout"],
["drivers/net/usb/r8152.c", "rtl8152_tx_timeout"],
["drivers/net/usb/rndis_host.c", "usbnet_tx_timeout"],
["drivers/net/usb/rtl8150.c", "rtl8150_tx_timeout"],
["drivers/net/usb/sierra_net.c", "usbnet_tx_timeout"],
["drivers/net/usb/smsc75xx.c", "usbnet_tx_timeout"],
["drivers/net/usb/smsc95xx.c", "usbnet_tx_timeout"],
["drivers/net/usb/sr9700.c", "usbnet_tx_timeout"],
["drivers/net/usb/sr9800.c", "usbnet_tx_timeout"],
["drivers/net/usb/usbnet.c", "usbnet_tx_timeout"],
["drivers/net/vmxnet3/vmxnet3_drv.c", "vmxnet3_tx_timeout"],
["drivers/net/wan/cosa.c", "cosa_net_timeout"],
["drivers/net/wan/farsync.c", "fst_tx_timeout"],
["drivers/net/wan/fsl_ucc_hdlc.c", "uhdlc_tx_timeout"],
["drivers/net/wan/lmc/lmc_main.c", "lmc_driver_timeout"],
["drivers/net/wan/x25_asy.c", "x25_asy_timeout"],
["drivers/net/wimax/i2400m/netdev.c", "i2400m_tx_timeout"],
["drivers/net/wireless/intel/ipw2x00/ipw2100.c", "ipw2100_tx_timeout"],
["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
["drivers/net/wireless/intersil/orinoco/main.c", "orinoco_tx_timeout"],
["drivers/net/wireless/intersil/orinoco/orinoco_usb.c", "orinoco_tx_timeout"],
["drivers/net/wireless/intersil/orinoco/orinoco.h", "orinoco_tx_timeout"],
["drivers/net/wireless/intersil/prism54/islpci_dev.c", "islpci_eth_tx_timeout"],
["drivers/net/wireless/intersil/prism54/islpci_eth.c", "islpci_eth_tx_timeout"],
["drivers/net/wireless/intersil/prism54/islpci_eth.h", "islpci_eth_tx_timeout"],
["drivers/net/wireless/marvell/mwifiex/main.c", "mwifiex_tx_timeout"],
["drivers/net/wireless/quantenna/qtnfmac/core.c", "qtnf_netdev_tx_timeout"],
["drivers/net/wireless/quantenna/qtnfmac/core.h", "qtnf_netdev_tx_timeout"],
["drivers/net/wireless/rndis_wlan.c", "usbnet_tx_timeout"],
["drivers/net/wireless/wl3501_cs.c", "wl3501_tx_timeout"],
["drivers/net/wireless/zydas/zd1201.c", "zd1201_tx_timeout"],
["drivers/s390/net/qeth_core.h", "qeth_tx_timeout"],
["drivers/s390/net/qeth_core_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l2_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l2_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l3_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l3_main.c", "qeth_tx_timeout"],
["drivers/staging/ks7010/ks_wlan_net.c", "ks_wlan_tx_timeout"],
["drivers/staging/qlge/qlge_main.c", "qlge_tx_timeout"],
["drivers/staging/rtl8192e/rtl8192e/rtl_core.c", "_rtl92e_tx_timeout"],
["drivers/staging/rtl8192u/r8192U_core.c", "tx_timeout"],
["drivers/staging/unisys/visornic/visornic_main.c", "visornic_xmit_timeout"],
["drivers/staging/wlan-ng/p80211netdev.c", "p80211knetdev_tx_timeout"],
["drivers/tty/n_gsm.c", "gsm_mux_net_tx_timeout"],
["drivers/tty/synclink.c", "hdlcdev_tx_timeout"],
["drivers/tty/synclink_gt.c", "hdlcdev_tx_timeout"],
["drivers/tty/synclinkmp.c", "hdlcdev_tx_timeout"],
["net/atm/lec.c", "lec_tx_timeout"],
["net/bluetooth/bnep/netdev.c", "bnep_net_timeout"]
);
for my $p (@work) {
my @pair = @$p;
my $file = $pair[0];
my $func = $pair[1];
print STDERR $file , ": ", $func,"\n";
our @ARGV = ($file);
while (<ARGV>) {
if (m/($func\s*\(struct\s+net_device\s+\*[A-Za-z_]?[A-Za-z-0-9_]*)(\))/) {
print STDERR "found $1+$2 in $file\n";
}
if (s/($func\s*\(struct\s+net_device\s+\*[A-Za-z_]?[A-Za-z-0-9_]*)(\))/$1, unsigned int txqueue$2/) {
print STDERR "$func found in $file\n";
}
print;
}
}
where the list of files and functions is simply from:
git grep ndo_tx_timeout, with manual addition of headers
in the rare cases where the function is from a header,
then manually changing the few places which actually
call ndo_tx_timeout.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Shannon Nelson <snelson@pensando.io>
Reviewed-by: Martin Habets <mhabets@solarflare.com>
changes from v9:
fixup a forward declaration
changes from v9:
more leftovers from v3 change
changes from v8:
fix up a missing direct call to timeout
rebased on net-next
changes from v7:
fixup leftovers from v3 change
changes from v6:
fix typo in rtl driver
changes from v5:
add missing files (allow any net device argument name)
changes from v4:
add a missing driver header
changes from v3:
change queue # to unsigned
Changes from v2:
added headers
Changes from v1:
Fix errors found by kbuild:
generalize the pattern a bit, to pick up
a couple of instances missed by the previous
version.
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-12-10 14:23:51 +00:00
|
|
|
static void mace_tx_timeout(struct net_device *dev, unsigned int txqueue);
|
IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.
The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).
Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.
Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.
I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.
This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
struct pt_regs *old_regs = set_irq_regs(regs);
And put the old one back at the end:
set_irq_regs(old_regs);
Don't pass regs through to generic_handle_irq() or __do_IRQ().
In timer_interrupt(), this sort of change will be necessary:
- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);
I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().
Some notes on the interrupt handling in the drivers:
(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.
(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.
(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.
Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-05 13:55:46 +00:00
|
|
|
static irqreturn_t mace_interrupt(int irq, void *dev_id);
|
2005-04-16 22:20:36 +00:00
|
|
|
static struct net_device_stats *mace_get_stats(struct net_device *dev);
|
|
|
|
static int mace_rx(struct net_device *dev, unsigned char RxCnt);
|
|
|
|
static void restore_multicast_list(struct net_device *dev);
|
|
|
|
static void set_multicast_list(struct net_device *dev);
|
2006-09-13 18:30:00 +00:00
|
|
|
static const struct ethtool_ops netdev_ethtool_ops;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
|
2005-11-14 20:23:14 +00:00
|
|
|
static void nmclan_detach(struct pcmcia_device *p_dev);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2009-03-20 19:36:05 +00:00
|
|
|
static const struct net_device_ops mace_netdev_ops = {
|
|
|
|
.ndo_open = mace_open,
|
|
|
|
.ndo_stop = mace_close,
|
|
|
|
.ndo_start_xmit = mace_start_xmit,
|
|
|
|
.ndo_tx_timeout = mace_tx_timeout,
|
|
|
|
.ndo_set_config = mace_config,
|
|
|
|
.ndo_get_stats = mace_get_stats,
|
2011-08-16 06:29:01 +00:00
|
|
|
.ndo_set_rx_mode = set_multicast_list,
|
2009-03-20 19:36:05 +00:00
|
|
|
.ndo_set_mac_address = eth_mac_addr,
|
|
|
|
.ndo_validate_addr = eth_validate_addr,
|
|
|
|
};
|
|
|
|
|
2006-03-31 15:26:06 +00:00
|
|
|
static int nmclan_probe(struct pcmcia_device *link)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
mace_private *lp;
|
|
|
|
struct net_device *dev;
|
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
dev_dbg(&link->dev, "nmclan_attach()\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* Create new ethernet device */
|
|
|
|
dev = alloc_etherdev(sizeof(mace_private));
|
|
|
|
if (!dev)
|
2005-11-14 20:25:51 +00:00
|
|
|
return -ENOMEM;
|
2005-04-16 22:20:36 +00:00
|
|
|
lp = netdev_priv(dev);
|
2006-03-31 15:21:06 +00:00
|
|
|
lp->p_dev = link;
|
2005-04-16 22:20:36 +00:00
|
|
|
link->priv = dev;
|
2020-02-24 08:53:06 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
spin_lock_init(&lp->bank_lock);
|
2010-07-24 15:23:51 +00:00
|
|
|
link->resource[0]->end = 32;
|
|
|
|
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
|
2010-07-29 17:27:09 +00:00
|
|
|
link->config_flags |= CONF_ENABLE_IRQ;
|
2010-07-29 16:35:47 +00:00
|
|
|
link->config_index = 1;
|
|
|
|
link->config_regs = PRESENT_OPTION;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
lp->tx_free_frames=AM2150_MAX_TX_FRAMES;
|
|
|
|
|
2009-03-20 19:36:05 +00:00
|
|
|
dev->netdev_ops = &mace_netdev_ops;
|
2014-05-11 00:12:32 +00:00
|
|
|
dev->ethtool_ops = &netdev_ethtool_ops;
|
2005-04-16 22:20:36 +00:00
|
|
|
dev->watchdog_timeo = TX_TIMEOUT;
|
|
|
|
|
2006-03-31 15:26:06 +00:00
|
|
|
return nmclan_config(link);
|
2005-04-16 22:20:36 +00:00
|
|
|
} /* nmclan_attach */
|
|
|
|
|
2006-03-31 15:21:06 +00:00
|
|
|
static void nmclan_detach(struct pcmcia_device *link)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
struct net_device *dev = link->priv;
|
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
dev_dbg(&link->dev, "nmclan_detach\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2010-03-20 18:39:26 +00:00
|
|
|
unregister_netdev(dev);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-03-01 23:09:29 +00:00
|
|
|
nmclan_release(link);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
free_netdev(dev);
|
|
|
|
} /* nmclan_detach */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
mace_read
|
|
|
|
Reads a MACE register. This is bank independent; however, the
|
|
|
|
caller must ensure that this call is not interruptable. We are
|
|
|
|
assuming that during normal operation, the MACE is always in
|
|
|
|
bank 0.
|
|
|
|
---------------------------------------------------------------------------- */
|
2008-02-05 06:27:35 +00:00
|
|
|
static int mace_read(mace_private *lp, unsigned int ioaddr, int reg)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
int data = 0xFF;
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
switch (reg >> 4) {
|
|
|
|
case 0: /* register 0-15 */
|
|
|
|
data = inb(ioaddr + AM2150_MACE_BASE + reg);
|
|
|
|
break;
|
|
|
|
case 1: /* register 16-31 */
|
|
|
|
spin_lock_irqsave(&lp->bank_lock, flags);
|
|
|
|
MACEBANK(1);
|
|
|
|
data = inb(ioaddr + AM2150_MACE_BASE + (reg & 0x0F));
|
|
|
|
MACEBANK(0);
|
|
|
|
spin_unlock_irqrestore(&lp->bank_lock, flags);
|
|
|
|
break;
|
|
|
|
}
|
2010-09-23 05:40:09 +00:00
|
|
|
return data & 0xFF;
|
2005-04-16 22:20:36 +00:00
|
|
|
} /* mace_read */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
mace_write
|
|
|
|
Writes to a MACE register. This is bank independent; however,
|
|
|
|
the caller must ensure that this call is not interruptable. We
|
|
|
|
are assuming that during normal operation, the MACE is always in
|
|
|
|
bank 0.
|
|
|
|
---------------------------------------------------------------------------- */
|
2008-02-05 06:27:35 +00:00
|
|
|
static void mace_write(mace_private *lp, unsigned int ioaddr, int reg,
|
|
|
|
int data)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
switch (reg >> 4) {
|
|
|
|
case 0: /* register 0-15 */
|
|
|
|
outb(data & 0xFF, ioaddr + AM2150_MACE_BASE + reg);
|
|
|
|
break;
|
|
|
|
case 1: /* register 16-31 */
|
|
|
|
spin_lock_irqsave(&lp->bank_lock, flags);
|
|
|
|
MACEBANK(1);
|
|
|
|
outb(data & 0xFF, ioaddr + AM2150_MACE_BASE + (reg & 0x0F));
|
|
|
|
MACEBANK(0);
|
|
|
|
spin_unlock_irqrestore(&lp->bank_lock, flags);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} /* mace_write */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
mace_init
|
|
|
|
Resets the MACE chip.
|
|
|
|
---------------------------------------------------------------------------- */
|
2008-02-05 06:27:35 +00:00
|
|
|
static int mace_init(mace_private *lp, unsigned int ioaddr, char *enet_addr)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int ct = 0;
|
|
|
|
|
|
|
|
/* MACE Software reset */
|
|
|
|
mace_write(lp, ioaddr, MACE_BIUCC, 1);
|
|
|
|
while (mace_read(lp, ioaddr, MACE_BIUCC) & 0x01) {
|
|
|
|
/* Wait for reset bit to be cleared automatically after <= 200ns */;
|
|
|
|
if(++ct > 500)
|
|
|
|
{
|
2010-08-12 12:22:51 +00:00
|
|
|
pr_err("reset failed, card removed?\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
udelay(1);
|
|
|
|
}
|
|
|
|
mace_write(lp, ioaddr, MACE_BIUCC, 0);
|
|
|
|
|
|
|
|
/* The Am2150 requires that the MACE FIFOs operate in burst mode. */
|
|
|
|
mace_write(lp, ioaddr, MACE_FIFOCC, 0x0F);
|
|
|
|
|
|
|
|
mace_write(lp,ioaddr, MACE_RCVFC, 0); /* Disable Auto Strip Receive */
|
|
|
|
mace_write(lp, ioaddr, MACE_IMR, 0xFF); /* Disable all interrupts until _open */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Bit 2-1 PORTSEL[1-0] Port Select.
|
|
|
|
* 00 AUI/10Base-2
|
|
|
|
* 01 10Base-T
|
|
|
|
* 10 DAI Port (reserved in Am2150)
|
|
|
|
* 11 GPSI
|
|
|
|
* For this card, only the first two are valid.
|
|
|
|
* So, PLSCC should be set to
|
|
|
|
* 0x00 for 10Base-2
|
|
|
|
* 0x02 for 10Base-T
|
|
|
|
* Or just set ASEL in PHYCC below!
|
|
|
|
*/
|
|
|
|
switch (if_port) {
|
|
|
|
case 1:
|
|
|
|
mace_write(lp, ioaddr, MACE_PLSCC, 0x02);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
mace_write(lp, ioaddr, MACE_PLSCC, 0x00);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
mace_write(lp, ioaddr, MACE_PHYCC, /* ASEL */ 4);
|
|
|
|
/* ASEL Auto Select. When set, the PORTSEL[1-0] bits are overridden,
|
|
|
|
and the MACE device will automatically select the operating media
|
|
|
|
interface port. */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
mace_write(lp, ioaddr, MACE_IAC, MACE_IAC_ADDRCHG | MACE_IAC_PHYADDR);
|
|
|
|
/* Poll ADDRCHG bit */
|
|
|
|
ct = 0;
|
|
|
|
while (mace_read(lp, ioaddr, MACE_IAC) & MACE_IAC_ADDRCHG)
|
|
|
|
{
|
|
|
|
if(++ ct > 500)
|
|
|
|
{
|
2010-08-12 12:22:51 +00:00
|
|
|
pr_err("ADDRCHG timeout, card removed?\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* Set PADR register */
|
2011-11-16 09:38:03 +00:00
|
|
|
for (i = 0; i < ETH_ALEN; i++)
|
2005-04-16 22:20:36 +00:00
|
|
|
mace_write(lp, ioaddr, MACE_PADR, enet_addr[i]);
|
|
|
|
|
|
|
|
/* MAC Configuration Control Register should be written last */
|
|
|
|
/* Let set_multicast_list set this. */
|
|
|
|
/* mace_write(lp, ioaddr, MACE_MACCC, MACE_MACCC_ENXMT | MACE_MACCC_ENRCV); */
|
|
|
|
mace_write(lp, ioaddr, MACE_MACCC, 0x00);
|
|
|
|
return 0;
|
|
|
|
} /* mace_init */
|
|
|
|
|
2006-03-31 15:26:06 +00:00
|
|
|
static int nmclan_config(struct pcmcia_device *link)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
struct net_device *dev = link->priv;
|
|
|
|
mace_private *lp = netdev_priv(dev);
|
2009-10-18 21:54:24 +00:00
|
|
|
u8 *buf;
|
|
|
|
size_t len;
|
2009-10-24 13:51:05 +00:00
|
|
|
int i, ret;
|
2008-02-05 06:27:35 +00:00
|
|
|
unsigned int ioaddr;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
dev_dbg(&link->dev, "nmclan_config\n");
|
|
|
|
|
2010-07-24 15:23:51 +00:00
|
|
|
link->io_lines = 5;
|
|
|
|
ret = pcmcia_request_io(link);
|
2009-10-24 13:51:05 +00:00
|
|
|
if (ret)
|
|
|
|
goto failed;
|
2014-09-18 09:33:41 +00:00
|
|
|
ret = pcmcia_request_irq(link, mace_interrupt);
|
2009-10-24 13:51:05 +00:00
|
|
|
if (ret)
|
|
|
|
goto failed;
|
2010-07-29 17:27:09 +00:00
|
|
|
ret = pcmcia_enable_device(link);
|
2009-10-24 13:51:05 +00:00
|
|
|
if (ret)
|
|
|
|
goto failed;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2010-03-07 11:21:16 +00:00
|
|
|
dev->irq = link->irq;
|
2010-07-24 13:58:54 +00:00
|
|
|
dev->base_addr = link->resource[0]->start;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
ioaddr = dev->base_addr;
|
|
|
|
|
|
|
|
/* Read the ethernet address from the CIS. */
|
2009-10-18 21:54:24 +00:00
|
|
|
len = pcmcia_get_tuple(link, 0x80, &buf);
|
2011-11-16 09:38:03 +00:00
|
|
|
if (!buf || len < ETH_ALEN) {
|
2009-10-18 21:54:24 +00:00
|
|
|
kfree(buf);
|
|
|
|
goto failed;
|
|
|
|
}
|
2011-11-16 09:38:03 +00:00
|
|
|
memcpy(dev->dev_addr, buf, ETH_ALEN);
|
2009-10-18 21:54:24 +00:00
|
|
|
kfree(buf);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* Verify configuration by reading the MACE ID. */
|
|
|
|
{
|
|
|
|
char sig[2];
|
|
|
|
|
|
|
|
sig[0] = mace_read(lp, ioaddr, MACE_CHIPIDL);
|
|
|
|
sig[1] = mace_read(lp, ioaddr, MACE_CHIPIDH);
|
|
|
|
if ((sig[0] == 0x40) && ((sig[1] & 0x0F) == 0x09)) {
|
2009-10-24 13:51:05 +00:00
|
|
|
dev_dbg(&link->dev, "nmclan_cs configured: mace id=%x %x\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
sig[0], sig[1]);
|
|
|
|
} else {
|
2010-08-12 12:22:51 +00:00
|
|
|
pr_notice("mace id not found: %x %x should be 0x40 0x?9\n",
|
|
|
|
sig[0], sig[1]);
|
2006-03-31 15:26:06 +00:00
|
|
|
return -ENODEV;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(mace_init(lp, ioaddr, dev->dev_addr) == -1)
|
|
|
|
goto failed;
|
|
|
|
|
|
|
|
/* The if_port symbol can be set when the module is loaded */
|
|
|
|
if (if_port <= 2)
|
|
|
|
dev->if_port = if_port;
|
|
|
|
else
|
2010-08-12 12:22:51 +00:00
|
|
|
pr_notice("invalid if_port requested\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2009-11-03 09:27:34 +00:00
|
|
|
SET_NETDEV_DEV(dev, &link->dev);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
i = register_netdev(dev);
|
|
|
|
if (i != 0) {
|
2010-08-12 12:22:51 +00:00
|
|
|
pr_notice("register_netdev() failed\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
goto failed;
|
|
|
|
}
|
|
|
|
|
2010-08-12 12:22:51 +00:00
|
|
|
netdev_info(dev, "nmclan: port %#3lx, irq %d, %s port, hw_addr %pM\n",
|
|
|
|
dev->base_addr, dev->irq, if_names[dev->if_port], dev->dev_addr);
|
2006-03-31 15:26:06 +00:00
|
|
|
return 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
failed:
|
2006-03-31 15:26:06 +00:00
|
|
|
nmclan_release(link);
|
|
|
|
return -ENODEV;
|
2005-04-16 22:20:36 +00:00
|
|
|
} /* nmclan_config */
|
|
|
|
|
2006-03-31 15:21:06 +00:00
|
|
|
static void nmclan_release(struct pcmcia_device *link)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2009-10-24 13:51:05 +00:00
|
|
|
dev_dbg(&link->dev, "nmclan_release\n");
|
2006-03-31 15:21:06 +00:00
|
|
|
pcmcia_disable_device(link);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2006-03-31 15:21:06 +00:00
|
|
|
static int nmclan_suspend(struct pcmcia_device *link)
|
2005-11-14 20:21:18 +00:00
|
|
|
{
|
|
|
|
struct net_device *dev = link->priv;
|
|
|
|
|
2006-03-01 23:09:29 +00:00
|
|
|
if (link->open)
|
2006-03-01 23:02:33 +00:00
|
|
|
netif_device_detach(dev);
|
2005-11-14 20:21:18 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-03-31 15:21:06 +00:00
|
|
|
static int nmclan_resume(struct pcmcia_device *link)
|
2005-11-14 20:21:18 +00:00
|
|
|
{
|
|
|
|
struct net_device *dev = link->priv;
|
|
|
|
|
2006-03-01 23:09:29 +00:00
|
|
|
if (link->open) {
|
2006-03-01 23:02:33 +00:00
|
|
|
nmclan_reset(dev);
|
|
|
|
netif_device_attach(dev);
|
2005-11-14 20:21:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
nmclan_reset
|
|
|
|
Reset and restore all of the Xilinx and MACE registers.
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
static void nmclan_reset(struct net_device *dev)
|
|
|
|
{
|
|
|
|
mace_private *lp = netdev_priv(dev);
|
|
|
|
|
|
|
|
#if RESET_XILINX
|
2006-03-31 15:21:06 +00:00
|
|
|
struct pcmcia_device *link = &lp->link;
|
2010-07-24 10:23:21 +00:00
|
|
|
u8 OrigCorValue;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* Save original COR value */
|
2010-07-24 10:23:21 +00:00
|
|
|
pcmcia_read_config_byte(link, CISREG_COR, &OrigCorValue);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* Reset Xilinx */
|
2010-07-24 10:23:21 +00:00
|
|
|
dev_dbg(&link->dev, "nmclan_reset: OrigCorValue=0x%x, resetting...\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
OrigCorValue);
|
2010-07-24 10:23:21 +00:00
|
|
|
pcmcia_write_config_byte(link, CISREG_COR, COR_SOFT_RESET);
|
2005-04-16 22:20:36 +00:00
|
|
|
/* Need to wait for 20 ms for PCMCIA to finish reset. */
|
|
|
|
|
|
|
|
/* Restore original COR configuration index */
|
2010-07-24 10:23:21 +00:00
|
|
|
pcmcia_write_config_byte(link, CISREG_COR,
|
|
|
|
(COR_LEVEL_REQ | (OrigCorValue & COR_CONFIG_MASK)));
|
2005-04-16 22:20:36 +00:00
|
|
|
/* Xilinx is now completely reset along with the MACE chip. */
|
|
|
|
lp->tx_free_frames=AM2150_MAX_TX_FRAMES;
|
|
|
|
|
|
|
|
#endif /* #if RESET_XILINX */
|
|
|
|
|
|
|
|
/* Xilinx is now completely reset along with the MACE chip. */
|
|
|
|
lp->tx_free_frames=AM2150_MAX_TX_FRAMES;
|
|
|
|
|
|
|
|
/* Reinitialize the MACE chip for operation. */
|
|
|
|
mace_init(lp, dev->base_addr, dev->dev_addr);
|
|
|
|
mace_write(lp, dev->base_addr, MACE_IMR, MACE_IMR_DEFAULT);
|
|
|
|
|
|
|
|
/* Restore the multicast list and enable TX and RX. */
|
|
|
|
restore_multicast_list(dev);
|
|
|
|
} /* nmclan_reset */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
mace_config
|
|
|
|
[Someone tell me what this is supposed to do? Is if_port a defined
|
|
|
|
standard? If so, there should be defines to indicate 1=10Base-T,
|
|
|
|
2=10Base-2, etc. including limited automatic detection.]
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
static int mace_config(struct net_device *dev, struct ifmap *map)
|
|
|
|
{
|
|
|
|
if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) {
|
|
|
|
if (map->port <= 2) {
|
|
|
|
dev->if_port = map->port;
|
2010-08-12 12:22:51 +00:00
|
|
|
netdev_info(dev, "switched to %s port\n", if_names[dev->if_port]);
|
2005-04-16 22:20:36 +00:00
|
|
|
} else
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
} /* mace_config */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
mace_open
|
|
|
|
Open device driver.
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
static int mace_open(struct net_device *dev)
|
|
|
|
{
|
2008-02-05 06:27:35 +00:00
|
|
|
unsigned int ioaddr = dev->base_addr;
|
2005-04-16 22:20:36 +00:00
|
|
|
mace_private *lp = netdev_priv(dev);
|
2006-03-31 15:21:06 +00:00
|
|
|
struct pcmcia_device *link = lp->p_dev;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-03-05 10:04:33 +00:00
|
|
|
if (!pcmcia_dev_present(link))
|
2005-04-16 22:20:36 +00:00
|
|
|
return -ENODEV;
|
|
|
|
|
|
|
|
link->open++;
|
|
|
|
|
|
|
|
MACEBANK(0);
|
|
|
|
|
|
|
|
netif_start_queue(dev);
|
|
|
|
nmclan_reset(dev);
|
|
|
|
|
|
|
|
return 0; /* Always succeed */
|
|
|
|
} /* mace_open */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
mace_close
|
|
|
|
Closes device driver.
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
static int mace_close(struct net_device *dev)
|
|
|
|
{
|
2008-02-05 06:27:35 +00:00
|
|
|
unsigned int ioaddr = dev->base_addr;
|
2005-04-16 22:20:36 +00:00
|
|
|
mace_private *lp = netdev_priv(dev);
|
2006-03-31 15:21:06 +00:00
|
|
|
struct pcmcia_device *link = lp->p_dev;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
dev_dbg(&link->dev, "%s: shutting down ethercard.\n", dev->name);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* Mask off all interrupts from the MACE chip. */
|
|
|
|
outb(0xFF, ioaddr + AM2150_MACE_BASE + MACE_IMR);
|
|
|
|
|
|
|
|
link->open--;
|
|
|
|
netif_stop_queue(dev);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
} /* mace_close */
|
|
|
|
|
|
|
|
static void netdev_get_drvinfo(struct net_device *dev,
|
|
|
|
struct ethtool_drvinfo *info)
|
|
|
|
{
|
2011-11-15 14:59:53 +00:00
|
|
|
strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
|
|
|
|
snprintf(info->bus_info, sizeof(info->bus_info),
|
|
|
|
"PCMCIA 0x%lx", dev->base_addr);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2006-09-13 18:30:00 +00:00
|
|
|
static const struct ethtool_ops netdev_ethtool_ops = {
|
2005-04-16 22:20:36 +00:00
|
|
|
.get_drvinfo = netdev_get_drvinfo,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
mace_start_xmit
|
|
|
|
This routine begins the packet transmit function. When completed,
|
|
|
|
it will generate a transmit interrupt.
|
|
|
|
|
|
|
|
According to /usr/src/linux/net/inet/dev.c, if _start_xmit
|
|
|
|
returns 0, the "packet is now solely the responsibility of the
|
|
|
|
driver." If _start_xmit returns non-zero, the "transmission
|
|
|
|
failed, put skb back into a list."
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
|
netdev: pass the stuck queue to the timeout handler
This allows incrementing the correct timeout statistic without any mess.
Down the road, devices can learn to reset just the specific queue.
The patch was generated with the following script:
use strict;
use warnings;
our $^I = '.bak';
my @work = (
["arch/m68k/emu/nfeth.c", "nfeth_tx_timeout"],
["arch/um/drivers/net_kern.c", "uml_net_tx_timeout"],
["arch/um/drivers/vector_kern.c", "vector_net_tx_timeout"],
["arch/xtensa/platforms/iss/network.c", "iss_net_tx_timeout"],
["drivers/char/pcmcia/synclink_cs.c", "hdlcdev_tx_timeout"],
["drivers/infiniband/ulp/ipoib/ipoib_main.c", "ipoib_timeout"],
["drivers/infiniband/ulp/ipoib/ipoib_main.c", "ipoib_timeout"],
["drivers/message/fusion/mptlan.c", "mpt_lan_tx_timeout"],
["drivers/misc/sgi-xp/xpnet.c", "xpnet_dev_tx_timeout"],
["drivers/net/appletalk/cops.c", "cops_timeout"],
["drivers/net/arcnet/arcdevice.h", "arcnet_timeout"],
["drivers/net/arcnet/arcnet.c", "arcnet_timeout"],
["drivers/net/arcnet/com20020.c", "arcnet_timeout"],
["drivers/net/ethernet/3com/3c509.c", "el3_tx_timeout"],
["drivers/net/ethernet/3com/3c515.c", "corkscrew_timeout"],
["drivers/net/ethernet/3com/3c574_cs.c", "el3_tx_timeout"],
["drivers/net/ethernet/3com/3c589_cs.c", "el3_tx_timeout"],
["drivers/net/ethernet/3com/3c59x.c", "vortex_tx_timeout"],
["drivers/net/ethernet/3com/3c59x.c", "vortex_tx_timeout"],
["drivers/net/ethernet/3com/typhoon.c", "typhoon_tx_timeout"],
["drivers/net/ethernet/8390/8390.h", "ei_tx_timeout"],
["drivers/net/ethernet/8390/8390.h", "eip_tx_timeout"],
["drivers/net/ethernet/8390/8390.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/8390p.c", "eip_tx_timeout"],
["drivers/net/ethernet/8390/ax88796.c", "ax_ei_tx_timeout"],
["drivers/net/ethernet/8390/axnet_cs.c", "axnet_tx_timeout"],
["drivers/net/ethernet/8390/etherh.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/hydra.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/mac8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/mcf8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/lib8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/ne2k-pci.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/pcnet_cs.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/smc-ultra.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/wd.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/zorro8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/adaptec/starfire.c", "tx_timeout"],
["drivers/net/ethernet/agere/et131x.c", "et131x_tx_timeout"],
["drivers/net/ethernet/allwinner/sun4i-emac.c", "emac_timeout"],
["drivers/net/ethernet/alteon/acenic.c", "ace_watchdog"],
["drivers/net/ethernet/amazon/ena/ena_netdev.c", "ena_tx_timeout"],
["drivers/net/ethernet/amd/7990.h", "lance_tx_timeout"],
["drivers/net/ethernet/amd/7990.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/a2065.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/am79c961a.c", "am79c961_timeout"],
["drivers/net/ethernet/amd/amd8111e.c", "amd8111e_tx_timeout"],
["drivers/net/ethernet/amd/ariadne.c", "ariadne_tx_timeout"],
["drivers/net/ethernet/amd/atarilance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/au1000_eth.c", "au1000_tx_timeout"],
["drivers/net/ethernet/amd/declance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/lance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/mvme147.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/ni65.c", "ni65_timeout"],
["drivers/net/ethernet/amd/nmclan_cs.c", "mace_tx_timeout"],
["drivers/net/ethernet/amd/pcnet32.c", "pcnet32_tx_timeout"],
["drivers/net/ethernet/amd/sunlance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/xgbe/xgbe-drv.c", "xgbe_tx_timeout"],
["drivers/net/ethernet/apm/xgene-v2/main.c", "xge_timeout"],
["drivers/net/ethernet/apm/xgene/xgene_enet_main.c", "xgene_enet_timeout"],
["drivers/net/ethernet/apple/macmace.c", "mace_tx_timeout"],
["drivers/net/ethernet/atheros/ag71xx.c", "ag71xx_tx_timeout"],
["drivers/net/ethernet/atheros/alx/main.c", "alx_tx_timeout"],
["drivers/net/ethernet/atheros/atl1c/atl1c_main.c", "atl1c_tx_timeout"],
["drivers/net/ethernet/atheros/atl1e/atl1e_main.c", "atl1e_tx_timeout"],
["drivers/net/ethernet/atheros/atlx/atl.c", "atlx_tx_timeout"],
["drivers/net/ethernet/atheros/atlx/atl1.c", "atlx_tx_timeout"],
["drivers/net/ethernet/atheros/atlx/atl2.c", "atl2_tx_timeout"],
["drivers/net/ethernet/broadcom/b44.c", "b44_tx_timeout"],
["drivers/net/ethernet/broadcom/bcmsysport.c", "bcm_sysport_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2.c", "bnx2_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h", "bnx2x_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c", "bnx2x_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", "bnx2x_tx_timeout"],
["drivers/net/ethernet/broadcom/bnxt/bnxt.c", "bnxt_tx_timeout"],
["drivers/net/ethernet/broadcom/genet/bcmgenet.c", "bcmgenet_timeout"],
["drivers/net/ethernet/broadcom/sb1250-mac.c", "sbmac_tx_timeout"],
["drivers/net/ethernet/broadcom/tg3.c", "tg3_tx_timeout"],
["drivers/net/ethernet/calxeda/xgmac.c", "xgmac_tx_timeout"],
["drivers/net/ethernet/cavium/liquidio/lio_main.c", "liquidio_tx_timeout"],
["drivers/net/ethernet/cavium/liquidio/lio_vf_main.c", "liquidio_tx_timeout"],
["drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c", "lio_vf_rep_tx_timeout"],
["drivers/net/ethernet/cavium/thunder/nicvf_main.c", "nicvf_tx_timeout"],
["drivers/net/ethernet/cirrus/cs89x0.c", "net_timeout"],
["drivers/net/ethernet/cisco/enic/enic_main.c", "enic_tx_timeout"],
["drivers/net/ethernet/cisco/enic/enic_main.c", "enic_tx_timeout"],
["drivers/net/ethernet/cortina/gemini.c", "gmac_tx_timeout"],
["drivers/net/ethernet/davicom/dm9000.c", "dm9000_timeout"],
["drivers/net/ethernet/dec/tulip/de2104x.c", "de_tx_timeout"],
["drivers/net/ethernet/dec/tulip/tulip_core.c", "tulip_tx_timeout"],
["drivers/net/ethernet/dec/tulip/winbond-840.c", "tx_timeout"],
["drivers/net/ethernet/dlink/dl2k.c", "rio_tx_timeout"],
["drivers/net/ethernet/dlink/sundance.c", "tx_timeout"],
["drivers/net/ethernet/emulex/benet/be_main.c", "be_tx_timeout"],
["drivers/net/ethernet/ethoc.c", "ethoc_tx_timeout"],
["drivers/net/ethernet/faraday/ftgmac100.c", "ftgmac100_tx_timeout"],
["drivers/net/ethernet/fealnx.c", "fealnx_tx_timeout"],
["drivers/net/ethernet/freescale/dpaa/dpaa_eth.c", "dpaa_tx_timeout"],
["drivers/net/ethernet/freescale/fec_main.c", "fec_timeout"],
["drivers/net/ethernet/freescale/fec_mpc52xx.c", "mpc52xx_fec_tx_timeout"],
["drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c", "fs_timeout"],
["drivers/net/ethernet/freescale/gianfar.c", "gfar_timeout"],
["drivers/net/ethernet/freescale/ucc_geth.c", "ucc_geth_timeout"],
["drivers/net/ethernet/fujitsu/fmvj18x_cs.c", "fjn_tx_timeout"],
["drivers/net/ethernet/google/gve/gve_main.c", "gve_tx_timeout"],
["drivers/net/ethernet/hisilicon/hip04_eth.c", "hip04_timeout"],
["drivers/net/ethernet/hisilicon/hix5hd2_gmac.c", "hix5hd2_net_timeout"],
["drivers/net/ethernet/hisilicon/hns/hns_enet.c", "hns_nic_net_timeout"],
["drivers/net/ethernet/hisilicon/hns3/hns3_enet.c", "hns3_nic_net_timeout"],
["drivers/net/ethernet/huawei/hinic/hinic_main.c", "hinic_tx_timeout"],
["drivers/net/ethernet/i825xx/82596.c", "i596_tx_timeout"],
["drivers/net/ethernet/i825xx/ether1.c", "ether1_timeout"],
["drivers/net/ethernet/i825xx/lib82596.c", "i596_tx_timeout"],
["drivers/net/ethernet/i825xx/sun3_82586.c", "sun3_82586_timeout"],
["drivers/net/ethernet/ibm/ehea/ehea_main.c", "ehea_tx_watchdog"],
["drivers/net/ethernet/ibm/emac/core.c", "emac_tx_timeout"],
["drivers/net/ethernet/ibm/emac/core.c", "emac_tx_timeout"],
["drivers/net/ethernet/ibm/ibmvnic.c", "ibmvnic_tx_timeout"],
["drivers/net/ethernet/intel/e100.c", "e100_tx_timeout"],
["drivers/net/ethernet/intel/e1000/e1000_main.c", "e1000_tx_timeout"],
["drivers/net/ethernet/intel/e1000e/netdev.c", "e1000_tx_timeout"],
["drivers/net/ethernet/intel/fm10k/fm10k_netdev.c", "fm10k_tx_timeout"],
["drivers/net/ethernet/intel/i40e/i40e_main.c", "i40e_tx_timeout"],
["drivers/net/ethernet/intel/iavf/iavf_main.c", "iavf_tx_timeout"],
["drivers/net/ethernet/intel/ice/ice_main.c", "ice_tx_timeout"],
["drivers/net/ethernet/intel/ice/ice_main.c", "ice_tx_timeout"],
["drivers/net/ethernet/intel/igb/igb_main.c", "igb_tx_timeout"],
["drivers/net/ethernet/intel/igbvf/netdev.c", "igbvf_tx_timeout"],
["drivers/net/ethernet/intel/ixgb/ixgb_main.c", "ixgb_tx_timeout"],
["drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c", "adapter->netdev->netdev_ops->ndo_tx_timeout(adapter->netdev);"],
["drivers/net/ethernet/intel/ixgbe/ixgbe_main.c", "ixgbe_tx_timeout"],
["drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c", "ixgbevf_tx_timeout"],
["drivers/net/ethernet/jme.c", "jme_tx_timeout"],
["drivers/net/ethernet/korina.c", "korina_tx_timeout"],
["drivers/net/ethernet/lantiq_etop.c", "ltq_etop_tx_timeout"],
["drivers/net/ethernet/marvell/mv643xx_eth.c", "mv643xx_eth_tx_timeout"],
["drivers/net/ethernet/marvell/pxa168_eth.c", "pxa168_eth_tx_timeout"],
["drivers/net/ethernet/marvell/skge.c", "skge_tx_timeout"],
["drivers/net/ethernet/marvell/sky2.c", "sky2_tx_timeout"],
["drivers/net/ethernet/marvell/sky2.c", "sky2_tx_timeout"],
["drivers/net/ethernet/mediatek/mtk_eth_soc.c", "mtk_tx_timeout"],
["drivers/net/ethernet/mellanox/mlx4/en_netdev.c", "mlx4_en_tx_timeout"],
["drivers/net/ethernet/mellanox/mlx4/en_netdev.c", "mlx4_en_tx_timeout"],
["drivers/net/ethernet/mellanox/mlx5/core/en_main.c", "mlx5e_tx_timeout"],
["drivers/net/ethernet/micrel/ks8842.c", "ks8842_tx_timeout"],
["drivers/net/ethernet/micrel/ksz884x.c", "netdev_tx_timeout"],
["drivers/net/ethernet/microchip/enc28j60.c", "enc28j60_tx_timeout"],
["drivers/net/ethernet/microchip/encx24j600.c", "encx24j600_tx_timeout"],
["drivers/net/ethernet/natsemi/sonic.h", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/sonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/jazzsonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/macsonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/natsemi.c", "ns_tx_timeout"],
["drivers/net/ethernet/natsemi/ns83820.c", "ns83820_tx_timeout"],
["drivers/net/ethernet/natsemi/xtsonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/neterion/s2io.h", "s2io_tx_watchdog"],
["drivers/net/ethernet/neterion/s2io.c", "s2io_tx_watchdog"],
["drivers/net/ethernet/neterion/vxge/vxge-main.c", "vxge_tx_watchdog"],
["drivers/net/ethernet/netronome/nfp/nfp_net_common.c", "nfp_net_tx_timeout"],
["drivers/net/ethernet/nvidia/forcedeth.c", "nv_tx_timeout"],
["drivers/net/ethernet/nvidia/forcedeth.c", "nv_tx_timeout"],
["drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c", "pch_gbe_tx_timeout"],
["drivers/net/ethernet/packetengines/hamachi.c", "hamachi_tx_timeout"],
["drivers/net/ethernet/packetengines/yellowfin.c", "yellowfin_tx_timeout"],
["drivers/net/ethernet/pensando/ionic/ionic_lif.c", "ionic_tx_timeout"],
["drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c", "netxen_tx_timeout"],
["drivers/net/ethernet/qlogic/qla3xxx.c", "ql3xxx_tx_timeout"],
["drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c", "qlcnic_tx_timeout"],
["drivers/net/ethernet/qualcomm/emac/emac.c", "emac_tx_timeout"],
["drivers/net/ethernet/qualcomm/qca_spi.c", "qcaspi_netdev_tx_timeout"],
["drivers/net/ethernet/qualcomm/qca_uart.c", "qcauart_netdev_tx_timeout"],
["drivers/net/ethernet/rdc/r6040.c", "r6040_tx_timeout"],
["drivers/net/ethernet/realtek/8139cp.c", "cp_tx_timeout"],
["drivers/net/ethernet/realtek/8139too.c", "rtl8139_tx_timeout"],
["drivers/net/ethernet/realtek/atp.c", "tx_timeout"],
["drivers/net/ethernet/realtek/r8169_main.c", "rtl8169_tx_timeout"],
["drivers/net/ethernet/renesas/ravb_main.c", "ravb_tx_timeout"],
["drivers/net/ethernet/renesas/sh_eth.c", "sh_eth_tx_timeout"],
["drivers/net/ethernet/renesas/sh_eth.c", "sh_eth_tx_timeout"],
["drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c", "sxgbe_tx_timeout"],
["drivers/net/ethernet/seeq/ether3.c", "ether3_timeout"],
["drivers/net/ethernet/seeq/sgiseeq.c", "timeout"],
["drivers/net/ethernet/sfc/efx.c", "efx_watchdog"],
["drivers/net/ethernet/sfc/falcon/efx.c", "ef4_watchdog"],
["drivers/net/ethernet/sgi/ioc3-eth.c", "ioc3_timeout"],
["drivers/net/ethernet/sgi/meth.c", "meth_tx_timeout"],
["drivers/net/ethernet/silan/sc92031.c", "sc92031_tx_timeout"],
["drivers/net/ethernet/sis/sis190.c", "sis190_tx_timeout"],
["drivers/net/ethernet/sis/sis900.c", "sis900_tx_timeout"],
["drivers/net/ethernet/smsc/epic100.c", "epic_tx_timeout"],
["drivers/net/ethernet/smsc/smc911x.c", "smc911x_timeout"],
["drivers/net/ethernet/smsc/smc9194.c", "smc_timeout"],
["drivers/net/ethernet/smsc/smc91c92_cs.c", "smc_tx_timeout"],
["drivers/net/ethernet/smsc/smc91x.c", "smc_timeout"],
["drivers/net/ethernet/stmicro/stmmac/stmmac_main.c", "stmmac_tx_timeout"],
["drivers/net/ethernet/sun/cassini.c", "cas_tx_timeout"],
["drivers/net/ethernet/sun/ldmvsw.c", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/sun/niu.c", "niu_tx_timeout"],
["drivers/net/ethernet/sun/sunbmac.c", "bigmac_tx_timeout"],
["drivers/net/ethernet/sun/sungem.c", "gem_tx_timeout"],
["drivers/net/ethernet/sun/sunhme.c", "happy_meal_tx_timeout"],
["drivers/net/ethernet/sun/sunqe.c", "qe_tx_timeout"],
["drivers/net/ethernet/sun/sunvnet.c", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/sun/sunvnet_common.c", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/sun/sunvnet_common.h", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/synopsys/dwc-xlgmac-net.c", "xlgmac_tx_timeout"],
["drivers/net/ethernet/ti/cpmac.c", "cpmac_tx_timeout"],
["drivers/net/ethernet/ti/cpsw.c", "cpsw_ndo_tx_timeout"],
["drivers/net/ethernet/ti/cpsw_priv.c", "cpsw_ndo_tx_timeout"],
["drivers/net/ethernet/ti/cpsw_priv.h", "cpsw_ndo_tx_timeout"],
["drivers/net/ethernet/ti/davinci_emac.c", "emac_dev_tx_timeout"],
["drivers/net/ethernet/ti/netcp_core.c", "netcp_ndo_tx_timeout"],
["drivers/net/ethernet/ti/tlan.c", "tlan_tx_timeout"],
["drivers/net/ethernet/toshiba/ps3_gelic_net.h", "gelic_net_tx_timeout"],
["drivers/net/ethernet/toshiba/ps3_gelic_net.c", "gelic_net_tx_timeout"],
["drivers/net/ethernet/toshiba/ps3_gelic_wireless.c", "gelic_net_tx_timeout"],
["drivers/net/ethernet/toshiba/spider_net.c", "spider_net_tx_timeout"],
["drivers/net/ethernet/toshiba/tc35815.c", "tc35815_tx_timeout"],
["drivers/net/ethernet/via/via-rhine.c", "rhine_tx_timeout"],
["drivers/net/ethernet/wiznet/w5100.c", "w5100_tx_timeout"],
["drivers/net/ethernet/wiznet/w5300.c", "w5300_tx_timeout"],
["drivers/net/ethernet/xilinx/xilinx_emaclite.c", "xemaclite_tx_timeout"],
["drivers/net/ethernet/xircom/xirc2ps_cs.c", "xirc_tx_timeout"],
["drivers/net/fjes/fjes_main.c", "fjes_tx_retry"],
["drivers/net/slip/slip.c", "sl_tx_timeout"],
["include/linux/usb/usbnet.h", "usbnet_tx_timeout"],
["drivers/net/usb/aqc111.c", "usbnet_tx_timeout"],
["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
["drivers/net/usb/ax88172a.c", "usbnet_tx_timeout"],
["drivers/net/usb/ax88179_178a.c", "usbnet_tx_timeout"],
["drivers/net/usb/catc.c", "catc_tx_timeout"],
["drivers/net/usb/cdc_mbim.c", "usbnet_tx_timeout"],
["drivers/net/usb/cdc_ncm.c", "usbnet_tx_timeout"],
["drivers/net/usb/dm9601.c", "usbnet_tx_timeout"],
["drivers/net/usb/hso.c", "hso_net_tx_timeout"],
["drivers/net/usb/int51x1.c", "usbnet_tx_timeout"],
["drivers/net/usb/ipheth.c", "ipheth_tx_timeout"],
["drivers/net/usb/kaweth.c", "kaweth_tx_timeout"],
["drivers/net/usb/lan78xx.c", "lan78xx_tx_timeout"],
["drivers/net/usb/mcs7830.c", "usbnet_tx_timeout"],
["drivers/net/usb/pegasus.c", "pegasus_tx_timeout"],
["drivers/net/usb/qmi_wwan.c", "usbnet_tx_timeout"],
["drivers/net/usb/r8152.c", "rtl8152_tx_timeout"],
["drivers/net/usb/rndis_host.c", "usbnet_tx_timeout"],
["drivers/net/usb/rtl8150.c", "rtl8150_tx_timeout"],
["drivers/net/usb/sierra_net.c", "usbnet_tx_timeout"],
["drivers/net/usb/smsc75xx.c", "usbnet_tx_timeout"],
["drivers/net/usb/smsc95xx.c", "usbnet_tx_timeout"],
["drivers/net/usb/sr9700.c", "usbnet_tx_timeout"],
["drivers/net/usb/sr9800.c", "usbnet_tx_timeout"],
["drivers/net/usb/usbnet.c", "usbnet_tx_timeout"],
["drivers/net/vmxnet3/vmxnet3_drv.c", "vmxnet3_tx_timeout"],
["drivers/net/wan/cosa.c", "cosa_net_timeout"],
["drivers/net/wan/farsync.c", "fst_tx_timeout"],
["drivers/net/wan/fsl_ucc_hdlc.c", "uhdlc_tx_timeout"],
["drivers/net/wan/lmc/lmc_main.c", "lmc_driver_timeout"],
["drivers/net/wan/x25_asy.c", "x25_asy_timeout"],
["drivers/net/wimax/i2400m/netdev.c", "i2400m_tx_timeout"],
["drivers/net/wireless/intel/ipw2x00/ipw2100.c", "ipw2100_tx_timeout"],
["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
["drivers/net/wireless/intersil/orinoco/main.c", "orinoco_tx_timeout"],
["drivers/net/wireless/intersil/orinoco/orinoco_usb.c", "orinoco_tx_timeout"],
["drivers/net/wireless/intersil/orinoco/orinoco.h", "orinoco_tx_timeout"],
["drivers/net/wireless/intersil/prism54/islpci_dev.c", "islpci_eth_tx_timeout"],
["drivers/net/wireless/intersil/prism54/islpci_eth.c", "islpci_eth_tx_timeout"],
["drivers/net/wireless/intersil/prism54/islpci_eth.h", "islpci_eth_tx_timeout"],
["drivers/net/wireless/marvell/mwifiex/main.c", "mwifiex_tx_timeout"],
["drivers/net/wireless/quantenna/qtnfmac/core.c", "qtnf_netdev_tx_timeout"],
["drivers/net/wireless/quantenna/qtnfmac/core.h", "qtnf_netdev_tx_timeout"],
["drivers/net/wireless/rndis_wlan.c", "usbnet_tx_timeout"],
["drivers/net/wireless/wl3501_cs.c", "wl3501_tx_timeout"],
["drivers/net/wireless/zydas/zd1201.c", "zd1201_tx_timeout"],
["drivers/s390/net/qeth_core.h", "qeth_tx_timeout"],
["drivers/s390/net/qeth_core_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l2_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l2_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l3_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l3_main.c", "qeth_tx_timeout"],
["drivers/staging/ks7010/ks_wlan_net.c", "ks_wlan_tx_timeout"],
["drivers/staging/qlge/qlge_main.c", "qlge_tx_timeout"],
["drivers/staging/rtl8192e/rtl8192e/rtl_core.c", "_rtl92e_tx_timeout"],
["drivers/staging/rtl8192u/r8192U_core.c", "tx_timeout"],
["drivers/staging/unisys/visornic/visornic_main.c", "visornic_xmit_timeout"],
["drivers/staging/wlan-ng/p80211netdev.c", "p80211knetdev_tx_timeout"],
["drivers/tty/n_gsm.c", "gsm_mux_net_tx_timeout"],
["drivers/tty/synclink.c", "hdlcdev_tx_timeout"],
["drivers/tty/synclink_gt.c", "hdlcdev_tx_timeout"],
["drivers/tty/synclinkmp.c", "hdlcdev_tx_timeout"],
["net/atm/lec.c", "lec_tx_timeout"],
["net/bluetooth/bnep/netdev.c", "bnep_net_timeout"]
);
for my $p (@work) {
my @pair = @$p;
my $file = $pair[0];
my $func = $pair[1];
print STDERR $file , ": ", $func,"\n";
our @ARGV = ($file);
while (<ARGV>) {
if (m/($func\s*\(struct\s+net_device\s+\*[A-Za-z_]?[A-Za-z-0-9_]*)(\))/) {
print STDERR "found $1+$2 in $file\n";
}
if (s/($func\s*\(struct\s+net_device\s+\*[A-Za-z_]?[A-Za-z-0-9_]*)(\))/$1, unsigned int txqueue$2/) {
print STDERR "$func found in $file\n";
}
print;
}
}
where the list of files and functions is simply from:
git grep ndo_tx_timeout, with manual addition of headers
in the rare cases where the function is from a header,
then manually changing the few places which actually
call ndo_tx_timeout.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Shannon Nelson <snelson@pensando.io>
Reviewed-by: Martin Habets <mhabets@solarflare.com>
changes from v9:
fixup a forward declaration
changes from v9:
more leftovers from v3 change
changes from v8:
fix up a missing direct call to timeout
rebased on net-next
changes from v7:
fixup leftovers from v3 change
changes from v6:
fix typo in rtl driver
changes from v5:
add missing files (allow any net device argument name)
changes from v4:
add a missing driver header
changes from v3:
change queue # to unsigned
Changes from v2:
added headers
Changes from v1:
Fix errors found by kbuild:
generalize the pattern a bit, to pick up
a couple of instances missed by the previous
version.
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-12-10 14:23:51 +00:00
|
|
|
static void mace_tx_timeout(struct net_device *dev, unsigned int txqueue)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
mace_private *lp = netdev_priv(dev);
|
2006-03-31 15:21:06 +00:00
|
|
|
struct pcmcia_device *link = lp->p_dev;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2010-08-12 12:22:51 +00:00
|
|
|
netdev_notice(dev, "transmit timed out -- ");
|
2005-04-16 22:20:36 +00:00
|
|
|
#if RESET_ON_TIMEOUT
|
2010-08-12 12:22:51 +00:00
|
|
|
pr_cont("resetting card\n");
|
2008-08-31 13:20:26 +00:00
|
|
|
pcmcia_reset_card(link->socket);
|
2005-04-16 22:20:36 +00:00
|
|
|
#else /* #if RESET_ON_TIMEOUT */
|
2010-08-12 12:22:51 +00:00
|
|
|
pr_cont("NOT resetting card\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif /* #if RESET_ON_TIMEOUT */
|
2016-05-03 14:33:13 +00:00
|
|
|
netif_trans_update(dev); /* prevent tx timeout */
|
2005-04-16 22:20:36 +00:00
|
|
|
netif_wake_queue(dev);
|
|
|
|
}
|
|
|
|
|
2009-08-31 19:50:49 +00:00
|
|
|
static netdev_tx_t mace_start_xmit(struct sk_buff *skb,
|
|
|
|
struct net_device *dev)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
mace_private *lp = netdev_priv(dev);
|
2008-02-05 06:27:35 +00:00
|
|
|
unsigned int ioaddr = dev->base_addr;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
netif_stop_queue(dev);
|
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("%s: mace_start_xmit(length = %ld) called.\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
dev->name, (long)skb->len);
|
|
|
|
|
|
|
|
#if (!TX_INTERRUPTABLE)
|
|
|
|
/* Disable MACE TX interrupts. */
|
|
|
|
outb(MACE_IMR_DEFAULT | MACE_IR_XMTINT,
|
|
|
|
ioaddr + AM2150_MACE_BASE + MACE_IMR);
|
|
|
|
lp->tx_irq_disabled=1;
|
|
|
|
#endif /* #if (!TX_INTERRUPTABLE) */
|
|
|
|
|
|
|
|
{
|
|
|
|
/* This block must not be interrupted by another transmit request!
|
|
|
|
mace_tx_timeout will take care of timer-based retransmissions from
|
|
|
|
the upper layers. The interrupt handler is guaranteed never to
|
|
|
|
service a transmit interrupt while we are in here.
|
|
|
|
*/
|
|
|
|
|
2017-04-07 08:17:32 +00:00
|
|
|
dev->stats.tx_bytes += skb->len;
|
2005-04-16 22:20:36 +00:00
|
|
|
lp->tx_free_frames--;
|
|
|
|
|
|
|
|
/* WARNING: Write the _exact_ number of bytes written in the header! */
|
|
|
|
/* Put out the word header [must be an outw()] . . . */
|
|
|
|
outw(skb->len, ioaddr + AM2150_XMT);
|
|
|
|
/* . . . and the packet [may be any combination of outw() and outb()] */
|
|
|
|
outsw(ioaddr + AM2150_XMT, skb->data, skb->len >> 1);
|
|
|
|
if (skb->len & 1) {
|
|
|
|
/* Odd byte transfer */
|
|
|
|
outb(skb->data[skb->len-1], ioaddr + AM2150_XMT);
|
|
|
|
}
|
|
|
|
|
|
|
|
#if MULTI_TX
|
|
|
|
if (lp->tx_free_frames > 0)
|
|
|
|
netif_start_queue(dev);
|
|
|
|
#endif /* #if MULTI_TX */
|
|
|
|
}
|
|
|
|
|
|
|
|
#if (!TX_INTERRUPTABLE)
|
|
|
|
/* Re-enable MACE TX interrupts. */
|
|
|
|
lp->tx_irq_disabled=0;
|
|
|
|
outb(MACE_IMR_DEFAULT, ioaddr + AM2150_MACE_BASE + MACE_IMR);
|
|
|
|
#endif /* #if (!TX_INTERRUPTABLE) */
|
|
|
|
|
|
|
|
dev_kfree_skb(skb);
|
|
|
|
|
2009-06-23 06:03:08 +00:00
|
|
|
return NETDEV_TX_OK;
|
2005-04-16 22:20:36 +00:00
|
|
|
} /* mace_start_xmit */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
mace_interrupt
|
|
|
|
The interrupt handler.
|
|
|
|
---------------------------------------------------------------------------- */
|
IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.
The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).
Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.
Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.
I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.
This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
struct pt_regs *old_regs = set_irq_regs(regs);
And put the old one back at the end:
set_irq_regs(old_regs);
Don't pass regs through to generic_handle_irq() or __do_IRQ().
In timer_interrupt(), this sort of change will be necessary:
- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);
I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().
Some notes on the interrupt handling in the drivers:
(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.
(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.
(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.
Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-05 13:55:46 +00:00
|
|
|
static irqreturn_t mace_interrupt(int irq, void *dev_id)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
struct net_device *dev = (struct net_device *) dev_id;
|
|
|
|
mace_private *lp = netdev_priv(dev);
|
2008-02-05 06:27:35 +00:00
|
|
|
unsigned int ioaddr;
|
2005-04-16 22:20:36 +00:00
|
|
|
int status;
|
|
|
|
int IntrCnt = MACE_MAX_IR_ITERATIONS;
|
|
|
|
|
|
|
|
if (dev == NULL) {
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("mace_interrupt(): irq 0x%X for unknown device.\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
irq);
|
|
|
|
return IRQ_NONE;
|
|
|
|
}
|
|
|
|
|
2007-07-24 02:44:56 +00:00
|
|
|
ioaddr = dev->base_addr;
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
if (lp->tx_irq_disabled) {
|
2010-08-12 12:22:51 +00:00
|
|
|
const char *msg;
|
|
|
|
if (lp->tx_irq_disabled)
|
|
|
|
msg = "Interrupt with tx_irq_disabled";
|
|
|
|
else
|
|
|
|
msg = "Re-entering the interrupt handler";
|
|
|
|
netdev_notice(dev, "%s [isr=%02X, imr=%02X]\n",
|
|
|
|
msg,
|
|
|
|
inb(ioaddr + AM2150_MACE_BASE + MACE_IR),
|
|
|
|
inb(ioaddr + AM2150_MACE_BASE + MACE_IMR));
|
2005-04-16 22:20:36 +00:00
|
|
|
/* WARNING: MACE_IR has been read! */
|
|
|
|
return IRQ_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!netif_device_present(dev)) {
|
2010-08-12 12:22:51 +00:00
|
|
|
netdev_dbg(dev, "interrupt from dead card\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
return IRQ_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
do {
|
|
|
|
/* WARNING: MACE_IR is a READ/CLEAR port! */
|
|
|
|
status = inb(ioaddr + AM2150_MACE_BASE + MACE_IR);
|
2015-01-28 14:15:04 +00:00
|
|
|
if (!(status & ~MACE_IMR_DEFAULT) && IntrCnt == MACE_MAX_IR_ITERATIONS)
|
|
|
|
return IRQ_NONE;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("mace_interrupt: irq 0x%X status 0x%X.\n", irq, status);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (status & MACE_IR_RCVINT) {
|
|
|
|
mace_rx(dev, MACE_MAX_RX_ITERATIONS);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (status & MACE_IR_XMTINT) {
|
|
|
|
unsigned char fifofc;
|
|
|
|
unsigned char xmtrc;
|
|
|
|
unsigned char xmtfs;
|
|
|
|
|
|
|
|
fifofc = inb(ioaddr + AM2150_MACE_BASE + MACE_FIFOFC);
|
|
|
|
if ((fifofc & MACE_FIFOFC_XMTFC)==0) {
|
2017-04-07 08:17:32 +00:00
|
|
|
dev->stats.tx_errors++;
|
2005-04-16 22:20:36 +00:00
|
|
|
outb(0xFF, ioaddr + AM2150_XMT_SKIP);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Transmit Retry Count (XMTRC, reg 4) */
|
|
|
|
xmtrc = inb(ioaddr + AM2150_MACE_BASE + MACE_XMTRC);
|
|
|
|
if (xmtrc & MACE_XMTRC_EXDEF) lp->mace_stats.exdef++;
|
|
|
|
lp->mace_stats.xmtrc += (xmtrc & MACE_XMTRC_XMTRC);
|
|
|
|
|
|
|
|
if (
|
|
|
|
(xmtfs = inb(ioaddr + AM2150_MACE_BASE + MACE_XMTFS)) &
|
|
|
|
MACE_XMTFS_XMTSV /* Transmit Status Valid */
|
|
|
|
) {
|
|
|
|
lp->mace_stats.xmtsv++;
|
|
|
|
|
|
|
|
if (xmtfs & ~MACE_XMTFS_XMTSV) {
|
|
|
|
if (xmtfs & MACE_XMTFS_UFLO) {
|
|
|
|
/* Underflow. Indicates that the Transmit FIFO emptied before
|
|
|
|
the end of frame was reached. */
|
|
|
|
lp->mace_stats.uflo++;
|
|
|
|
}
|
|
|
|
if (xmtfs & MACE_XMTFS_LCOL) {
|
|
|
|
/* Late Collision */
|
|
|
|
lp->mace_stats.lcol++;
|
|
|
|
}
|
|
|
|
if (xmtfs & MACE_XMTFS_MORE) {
|
|
|
|
/* MORE than one retry was needed */
|
|
|
|
lp->mace_stats.more++;
|
|
|
|
}
|
|
|
|
if (xmtfs & MACE_XMTFS_ONE) {
|
|
|
|
/* Exactly ONE retry occurred */
|
|
|
|
lp->mace_stats.one++;
|
|
|
|
}
|
|
|
|
if (xmtfs & MACE_XMTFS_DEFER) {
|
|
|
|
/* Transmission was defered */
|
|
|
|
lp->mace_stats.defer++;
|
|
|
|
}
|
|
|
|
if (xmtfs & MACE_XMTFS_LCAR) {
|
|
|
|
/* Loss of carrier */
|
|
|
|
lp->mace_stats.lcar++;
|
|
|
|
}
|
|
|
|
if (xmtfs & MACE_XMTFS_RTRY) {
|
|
|
|
/* Retry error: transmit aborted after 16 attempts */
|
|
|
|
lp->mace_stats.rtry++;
|
|
|
|
}
|
|
|
|
} /* if (xmtfs & ~MACE_XMTFS_XMTSV) */
|
|
|
|
|
|
|
|
} /* if (xmtfs & MACE_XMTFS_XMTSV) */
|
|
|
|
|
2017-04-07 08:17:32 +00:00
|
|
|
dev->stats.tx_packets++;
|
2005-04-16 22:20:36 +00:00
|
|
|
lp->tx_free_frames++;
|
|
|
|
netif_wake_queue(dev);
|
|
|
|
} /* if (status & MACE_IR_XMTINT) */
|
|
|
|
|
|
|
|
if (status & ~MACE_IMR_DEFAULT & ~MACE_IR_RCVINT & ~MACE_IR_XMTINT) {
|
|
|
|
if (status & MACE_IR_JAB) {
|
|
|
|
/* Jabber Error. Excessive transmit duration (20-150ms). */
|
|
|
|
lp->mace_stats.jab++;
|
|
|
|
}
|
|
|
|
if (status & MACE_IR_BABL) {
|
|
|
|
/* Babble Error. >1518 bytes transmitted. */
|
|
|
|
lp->mace_stats.babl++;
|
|
|
|
}
|
|
|
|
if (status & MACE_IR_CERR) {
|
|
|
|
/* Collision Error. CERR indicates the absence of the
|
|
|
|
Signal Quality Error Test message after a packet
|
|
|
|
transmission. */
|
|
|
|
lp->mace_stats.cerr++;
|
|
|
|
}
|
|
|
|
if (status & MACE_IR_RCVCCO) {
|
|
|
|
/* Receive Collision Count Overflow; */
|
|
|
|
lp->mace_stats.rcvcco++;
|
|
|
|
}
|
|
|
|
if (status & MACE_IR_RNTPCO) {
|
|
|
|
/* Runt Packet Count Overflow */
|
|
|
|
lp->mace_stats.rntpco++;
|
|
|
|
}
|
|
|
|
if (status & MACE_IR_MPCO) {
|
|
|
|
/* Missed Packet Count Overflow */
|
|
|
|
lp->mace_stats.mpco++;
|
|
|
|
}
|
|
|
|
} /* if (status & ~MACE_IMR_DEFAULT & ~MACE_IR_RCVINT & ~MACE_IR_XMTINT) */
|
|
|
|
|
|
|
|
} while ((status & ~MACE_IMR_DEFAULT) && (--IntrCnt));
|
|
|
|
|
|
|
|
return IRQ_HANDLED;
|
|
|
|
} /* mace_interrupt */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
mace_rx
|
|
|
|
Receives packets.
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
static int mace_rx(struct net_device *dev, unsigned char RxCnt)
|
|
|
|
{
|
|
|
|
mace_private *lp = netdev_priv(dev);
|
2008-02-05 06:27:35 +00:00
|
|
|
unsigned int ioaddr = dev->base_addr;
|
2005-04-16 22:20:36 +00:00
|
|
|
unsigned char rx_framecnt;
|
|
|
|
unsigned short rx_status;
|
|
|
|
|
|
|
|
while (
|
|
|
|
((rx_framecnt = inb(ioaddr + AM2150_RCV_FRAME_COUNT)) > 0) &&
|
|
|
|
(rx_framecnt <= 12) && /* rx_framecnt==0xFF if card is extracted. */
|
|
|
|
(RxCnt--)
|
|
|
|
) {
|
|
|
|
rx_status = inw(ioaddr + AM2150_RCV);
|
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("%s: in mace_rx(), framecnt 0x%X, rx_status"
|
2005-04-16 22:20:36 +00:00
|
|
|
" 0x%X.\n", dev->name, rx_framecnt, rx_status);
|
|
|
|
|
|
|
|
if (rx_status & MACE_RCVFS_RCVSTS) { /* Error, update stats. */
|
2017-04-07 08:17:32 +00:00
|
|
|
dev->stats.rx_errors++;
|
2005-04-16 22:20:36 +00:00
|
|
|
if (rx_status & MACE_RCVFS_OFLO) {
|
|
|
|
lp->mace_stats.oflo++;
|
|
|
|
}
|
|
|
|
if (rx_status & MACE_RCVFS_CLSN) {
|
|
|
|
lp->mace_stats.clsn++;
|
|
|
|
}
|
|
|
|
if (rx_status & MACE_RCVFS_FRAM) {
|
|
|
|
lp->mace_stats.fram++;
|
|
|
|
}
|
|
|
|
if (rx_status & MACE_RCVFS_FCS) {
|
|
|
|
lp->mace_stats.fcs++;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
short pkt_len = (rx_status & ~MACE_RCVFS_RCVSTS) - 4;
|
|
|
|
/* Auto Strip is off, always subtract 4 */
|
|
|
|
struct sk_buff *skb;
|
|
|
|
|
|
|
|
lp->mace_stats.rfs_rntpc += inb(ioaddr + AM2150_RCV);
|
|
|
|
/* runt packet count */
|
|
|
|
lp->mace_stats.rfs_rcvcc += inb(ioaddr + AM2150_RCV);
|
|
|
|
/* rcv collision count */
|
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" receiving packet size 0x%X rx_status"
|
2005-04-16 22:20:36 +00:00
|
|
|
" 0x%X.\n", pkt_len, rx_status);
|
|
|
|
|
2012-02-05 02:49:09 +00:00
|
|
|
skb = netdev_alloc_skb(dev, pkt_len + 2);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (skb != NULL) {
|
|
|
|
skb_reserve(skb, 2);
|
|
|
|
insw(ioaddr + AM2150_RCV, skb_put(skb, pkt_len), pkt_len>>1);
|
|
|
|
if (pkt_len & 1)
|
2007-04-20 03:29:13 +00:00
|
|
|
*(skb_tail_pointer(skb) - 1) = inb(ioaddr + AM2150_RCV);
|
2005-04-16 22:20:36 +00:00
|
|
|
skb->protocol = eth_type_trans(skb, dev);
|
2020-02-24 08:53:06 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
netif_rx(skb); /* Send the packet to the upper (protocol) layers. */
|
|
|
|
|
2017-04-07 08:17:32 +00:00
|
|
|
dev->stats.rx_packets++;
|
|
|
|
dev->stats.rx_bytes += pkt_len;
|
2005-04-16 22:20:36 +00:00
|
|
|
outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */
|
|
|
|
continue;
|
|
|
|
} else {
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("%s: couldn't allocate a sk_buff of size"
|
2005-04-16 22:20:36 +00:00
|
|
|
" %d.\n", dev->name, pkt_len);
|
2017-04-07 08:17:32 +00:00
|
|
|
dev->stats.rx_dropped++;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */
|
|
|
|
} /* while */
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
} /* mace_rx */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
pr_linux_stats
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
static void pr_linux_stats(struct net_device_stats *pstats)
|
|
|
|
{
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("pr_linux_stats\n");
|
|
|
|
pr_debug(" rx_packets=%-7ld tx_packets=%ld\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
(long)pstats->rx_packets, (long)pstats->tx_packets);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" rx_errors=%-7ld tx_errors=%ld\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
(long)pstats->rx_errors, (long)pstats->tx_errors);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" rx_dropped=%-7ld tx_dropped=%ld\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
(long)pstats->rx_dropped, (long)pstats->tx_dropped);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" multicast=%-7ld collisions=%ld\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
(long)pstats->multicast, (long)pstats->collisions);
|
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" rx_length_errors=%-7ld rx_over_errors=%ld\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
(long)pstats->rx_length_errors, (long)pstats->rx_over_errors);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" rx_crc_errors=%-7ld rx_frame_errors=%ld\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
(long)pstats->rx_crc_errors, (long)pstats->rx_frame_errors);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" rx_fifo_errors=%-7ld rx_missed_errors=%ld\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
(long)pstats->rx_fifo_errors, (long)pstats->rx_missed_errors);
|
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" tx_aborted_errors=%-7ld tx_carrier_errors=%ld\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
(long)pstats->tx_aborted_errors, (long)pstats->tx_carrier_errors);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" tx_fifo_errors=%-7ld tx_heartbeat_errors=%ld\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
(long)pstats->tx_fifo_errors, (long)pstats->tx_heartbeat_errors);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" tx_window_errors=%ld\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
(long)pstats->tx_window_errors);
|
|
|
|
} /* pr_linux_stats */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
pr_mace_stats
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
static void pr_mace_stats(mace_statistics *pstats)
|
|
|
|
{
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("pr_mace_stats\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" xmtsv=%-7d uflo=%d\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pstats->xmtsv, pstats->uflo);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" lcol=%-7d more=%d\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pstats->lcol, pstats->more);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" one=%-7d defer=%d\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pstats->one, pstats->defer);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" lcar=%-7d rtry=%d\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pstats->lcar, pstats->rtry);
|
|
|
|
|
|
|
|
/* MACE_XMTRC */
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" exdef=%-7d xmtrc=%d\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pstats->exdef, pstats->xmtrc);
|
|
|
|
|
|
|
|
/* RFS1--Receive Status (RCVSTS) */
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" oflo=%-7d clsn=%d\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pstats->oflo, pstats->clsn);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" fram=%-7d fcs=%d\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pstats->fram, pstats->fcs);
|
|
|
|
|
|
|
|
/* RFS2--Runt Packet Count (RNTPC) */
|
|
|
|
/* RFS3--Receive Collision Count (RCVCC) */
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" rfs_rntpc=%-7d rfs_rcvcc=%d\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pstats->rfs_rntpc, pstats->rfs_rcvcc);
|
|
|
|
|
|
|
|
/* MACE_IR */
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" jab=%-7d babl=%d\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pstats->jab, pstats->babl);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" cerr=%-7d rcvcco=%d\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pstats->cerr, pstats->rcvcco);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" rntpco=%-7d mpco=%d\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pstats->rntpco, pstats->mpco);
|
|
|
|
|
|
|
|
/* MACE_MPC */
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" mpc=%d\n", pstats->mpc);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* MACE_RNTPC */
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" rntpc=%d\n", pstats->rntpc);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* MACE_RCVCC */
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug(" rcvcc=%d\n", pstats->rcvcc);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
} /* pr_mace_stats */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
update_stats
|
|
|
|
Update statistics. We change to register window 1, so this
|
|
|
|
should be run single-threaded if the device is active. This is
|
|
|
|
expected to be a rare operation, and it's simpler for the rest
|
|
|
|
of the driver to assume that window 0 is always valid rather
|
|
|
|
than use a special window-state variable.
|
|
|
|
|
|
|
|
oflo & uflo should _never_ occur since it would mean the Xilinx
|
|
|
|
was not able to transfer data between the MACE FIFO and the
|
|
|
|
card's SRAM fast enough. If this happens, something is
|
|
|
|
seriously wrong with the hardware.
|
|
|
|
---------------------------------------------------------------------------- */
|
2008-02-05 06:27:35 +00:00
|
|
|
static void update_stats(unsigned int ioaddr, struct net_device *dev)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
mace_private *lp = netdev_priv(dev);
|
|
|
|
|
|
|
|
lp->mace_stats.rcvcc += mace_read(lp, ioaddr, MACE_RCVCC);
|
|
|
|
lp->mace_stats.rntpc += mace_read(lp, ioaddr, MACE_RNTPC);
|
|
|
|
lp->mace_stats.mpc += mace_read(lp, ioaddr, MACE_MPC);
|
|
|
|
/* At this point, mace_stats is fully updated for this call.
|
2017-04-07 08:17:32 +00:00
|
|
|
We may now update the netdev stats. */
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2017-04-07 08:17:32 +00:00
|
|
|
/* The MACE has no equivalent for netdev stats field which are commented
|
2005-04-16 22:20:36 +00:00
|
|
|
out. */
|
|
|
|
|
2017-04-07 08:17:32 +00:00
|
|
|
/* dev->stats.multicast; */
|
|
|
|
dev->stats.collisions =
|
2005-04-16 22:20:36 +00:00
|
|
|
lp->mace_stats.rcvcco * 256 + lp->mace_stats.rcvcc;
|
|
|
|
/* Collision: The MACE may retry sending a packet 15 times
|
|
|
|
before giving up. The retry count is in XMTRC.
|
|
|
|
Does each retry constitute a collision?
|
|
|
|
If so, why doesn't the RCVCC record these collisions? */
|
|
|
|
|
|
|
|
/* detailed rx_errors: */
|
2017-04-07 08:17:32 +00:00
|
|
|
dev->stats.rx_length_errors =
|
2005-04-16 22:20:36 +00:00
|
|
|
lp->mace_stats.rntpco * 256 + lp->mace_stats.rntpc;
|
2017-04-07 08:17:32 +00:00
|
|
|
/* dev->stats.rx_over_errors */
|
|
|
|
dev->stats.rx_crc_errors = lp->mace_stats.fcs;
|
|
|
|
dev->stats.rx_frame_errors = lp->mace_stats.fram;
|
|
|
|
dev->stats.rx_fifo_errors = lp->mace_stats.oflo;
|
|
|
|
dev->stats.rx_missed_errors =
|
2005-04-16 22:20:36 +00:00
|
|
|
lp->mace_stats.mpco * 256 + lp->mace_stats.mpc;
|
|
|
|
|
|
|
|
/* detailed tx_errors */
|
2017-04-07 08:17:32 +00:00
|
|
|
dev->stats.tx_aborted_errors = lp->mace_stats.rtry;
|
|
|
|
dev->stats.tx_carrier_errors = lp->mace_stats.lcar;
|
2005-04-16 22:20:36 +00:00
|
|
|
/* LCAR usually results from bad cabling. */
|
2017-04-07 08:17:32 +00:00
|
|
|
dev->stats.tx_fifo_errors = lp->mace_stats.uflo;
|
|
|
|
dev->stats.tx_heartbeat_errors = lp->mace_stats.cerr;
|
|
|
|
/* dev->stats.tx_window_errors; */
|
2005-04-16 22:20:36 +00:00
|
|
|
} /* update_stats */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
mace_get_stats
|
|
|
|
Gathers ethernet statistics from the MACE chip.
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
static struct net_device_stats *mace_get_stats(struct net_device *dev)
|
|
|
|
{
|
|
|
|
mace_private *lp = netdev_priv(dev);
|
|
|
|
|
|
|
|
update_stats(dev->base_addr, dev);
|
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("%s: updating the statistics.\n", dev->name);
|
2017-04-07 08:17:32 +00:00
|
|
|
pr_linux_stats(&dev->stats);
|
2005-04-16 22:20:36 +00:00
|
|
|
pr_mace_stats(&lp->mace_stats);
|
|
|
|
|
2017-04-07 08:17:32 +00:00
|
|
|
return &dev->stats;
|
2005-04-16 22:20:36 +00:00
|
|
|
} /* net_device_stats */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
updateCRC
|
|
|
|
Modified from Am79C90 data sheet.
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
#ifdef BROKEN_MULTICAST
|
|
|
|
|
|
|
|
static void updateCRC(int *CRC, int bit)
|
|
|
|
{
|
2010-12-21 10:16:10 +00:00
|
|
|
static const int poly[]={
|
2005-04-16 22:20:36 +00:00
|
|
|
1,1,1,0, 1,1,0,1,
|
|
|
|
1,0,1,1, 1,0,0,0,
|
|
|
|
1,0,0,0, 0,0,1,1,
|
|
|
|
0,0,1,0, 0,0,0,0
|
|
|
|
}; /* CRC polynomial. poly[n] = coefficient of the x**n term of the
|
|
|
|
CRC generator polynomial. */
|
|
|
|
|
|
|
|
int j;
|
|
|
|
|
|
|
|
/* shift CRC and control bit (CRC[32]) */
|
|
|
|
for (j = 32; j > 0; j--)
|
|
|
|
CRC[j] = CRC[j-1];
|
|
|
|
CRC[0] = 0;
|
|
|
|
|
|
|
|
/* If bit XOR(control bit) = 1, set CRC = CRC XOR polynomial. */
|
|
|
|
if (bit ^ CRC[32])
|
|
|
|
for (j = 0; j < 32; j++)
|
|
|
|
CRC[j] ^= poly[j];
|
|
|
|
} /* updateCRC */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
BuildLAF
|
|
|
|
Build logical address filter.
|
|
|
|
Modified from Am79C90 data sheet.
|
|
|
|
|
|
|
|
Input
|
|
|
|
ladrf: logical address filter (contents initialized to 0)
|
|
|
|
adr: ethernet address
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
static void BuildLAF(int *ladrf, int *adr)
|
|
|
|
{
|
|
|
|
int CRC[33]={1}; /* CRC register, 1 word/bit + extra control bit */
|
|
|
|
|
|
|
|
int i, byte; /* temporary array indices */
|
|
|
|
int hashcode; /* the output object */
|
|
|
|
|
|
|
|
CRC[32]=0;
|
|
|
|
|
|
|
|
for (byte = 0; byte < 6; byte++)
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
updateCRC(CRC, (adr[byte] >> i) & 1);
|
|
|
|
|
|
|
|
hashcode = 0;
|
|
|
|
for (i = 0; i < 6; i++)
|
|
|
|
hashcode = (hashcode << 1) + CRC[i];
|
|
|
|
|
|
|
|
byte = hashcode >> 3;
|
|
|
|
ladrf[byte] |= (1 << (hashcode & 7));
|
|
|
|
|
|
|
|
#ifdef PCMCIA_DEBUG
|
2009-10-24 13:51:05 +00:00
|
|
|
if (0)
|
2009-07-06 20:05:40 +00:00
|
|
|
printk(KERN_DEBUG " adr =%pM\n", adr);
|
|
|
|
printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode);
|
|
|
|
for (i = 0; i < 8; i++)
|
2010-08-12 12:22:51 +00:00
|
|
|
pr_cont(" %02X", ladrf[i]);
|
|
|
|
pr_cont("\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif
|
|
|
|
} /* BuildLAF */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
restore_multicast_list
|
|
|
|
Restores the multicast filter for MACE chip to the last
|
|
|
|
set_multicast_list() call.
|
|
|
|
|
|
|
|
Input
|
|
|
|
multicast_num_addrs
|
|
|
|
multicast_ladrf[]
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
static void restore_multicast_list(struct net_device *dev)
|
|
|
|
{
|
|
|
|
mace_private *lp = netdev_priv(dev);
|
|
|
|
int num_addrs = lp->multicast_num_addrs;
|
|
|
|
int *ladrf = lp->multicast_ladrf;
|
2008-02-05 06:27:35 +00:00
|
|
|
unsigned int ioaddr = dev->base_addr;
|
2005-04-16 22:20:36 +00:00
|
|
|
int i;
|
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("%s: restoring Rx mode to %d addresses.\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
dev->name, num_addrs);
|
|
|
|
|
|
|
|
if (num_addrs > 0) {
|
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("Attempt to restore multicast list detected.\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
mace_write(lp, ioaddr, MACE_IAC, MACE_IAC_ADDRCHG | MACE_IAC_LOGADDR);
|
|
|
|
/* Poll ADDRCHG bit */
|
|
|
|
while (mace_read(lp, ioaddr, MACE_IAC) & MACE_IAC_ADDRCHG)
|
|
|
|
;
|
|
|
|
/* Set LADRF register */
|
|
|
|
for (i = 0; i < MACE_LADRF_LEN; i++)
|
|
|
|
mace_write(lp, ioaddr, MACE_LADRF, ladrf[i]);
|
|
|
|
|
|
|
|
mace_write(lp, ioaddr, MACE_UTR, MACE_UTR_RCVFCSE | MACE_UTR_LOOP_EXTERNAL);
|
|
|
|
mace_write(lp, ioaddr, MACE_MACCC, MACE_MACCC_ENXMT | MACE_MACCC_ENRCV);
|
|
|
|
|
|
|
|
} else if (num_addrs < 0) {
|
|
|
|
|
|
|
|
/* Promiscuous mode: receive all packets */
|
|
|
|
mace_write(lp, ioaddr, MACE_UTR, MACE_UTR_LOOP_EXTERNAL);
|
|
|
|
mace_write(lp, ioaddr, MACE_MACCC,
|
|
|
|
MACE_MACCC_PROM | MACE_MACCC_ENXMT | MACE_MACCC_ENRCV
|
|
|
|
);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
/* Normal mode */
|
|
|
|
mace_write(lp, ioaddr, MACE_UTR, MACE_UTR_LOOP_EXTERNAL);
|
|
|
|
mace_write(lp, ioaddr, MACE_MACCC, MACE_MACCC_ENXMT | MACE_MACCC_ENRCV);
|
|
|
|
|
|
|
|
}
|
|
|
|
} /* restore_multicast_list */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
set_multicast_list
|
|
|
|
Set or clear the multicast filter for this adaptor.
|
|
|
|
|
|
|
|
Input
|
|
|
|
num_addrs == -1 Promiscuous mode, receive all packets
|
|
|
|
num_addrs == 0 Normal mode, clear multicast list
|
|
|
|
num_addrs > 0 Multicast mode, receive normal and MC packets, and do
|
|
|
|
best-effort filtering.
|
|
|
|
Output
|
|
|
|
multicast_num_addrs
|
|
|
|
multicast_ladrf[]
|
|
|
|
---------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
static void set_multicast_list(struct net_device *dev)
|
|
|
|
{
|
|
|
|
mace_private *lp = netdev_priv(dev);
|
2011-11-16 09:38:03 +00:00
|
|
|
int adr[ETH_ALEN] = {0}; /* Ethernet address */
|
2010-04-01 21:22:57 +00:00
|
|
|
struct netdev_hw_addr *ha;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#ifdef PCMCIA_DEBUG
|
2009-10-24 13:51:05 +00:00
|
|
|
{
|
2005-04-16 22:20:36 +00:00
|
|
|
static int old;
|
2010-02-08 04:30:35 +00:00
|
|
|
if (netdev_mc_count(dev) != old) {
|
|
|
|
old = netdev_mc_count(dev);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("%s: setting Rx mode to %d addresses.\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
dev->name, old);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Set multicast_num_addrs. */
|
2010-02-08 04:30:35 +00:00
|
|
|
lp->multicast_num_addrs = netdev_mc_count(dev);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* Set multicast_ladrf. */
|
|
|
|
if (num_addrs > 0) {
|
|
|
|
/* Calculate multicast logical address filter */
|
|
|
|
memset(lp->multicast_ladrf, 0, MACE_LADRF_LEN);
|
2010-04-01 21:22:57 +00:00
|
|
|
netdev_for_each_mc_addr(ha, dev) {
|
2011-11-16 09:38:03 +00:00
|
|
|
memcpy(adr, ha->addr, ETH_ALEN);
|
2005-04-16 22:20:36 +00:00
|
|
|
BuildLAF(lp->multicast_ladrf, adr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
restore_multicast_list(dev);
|
|
|
|
|
|
|
|
} /* set_multicast_list */
|
|
|
|
|
|
|
|
#endif /* BROKEN_MULTICAST */
|
|
|
|
|
|
|
|
static void restore_multicast_list(struct net_device *dev)
|
|
|
|
{
|
2008-02-05 06:27:35 +00:00
|
|
|
unsigned int ioaddr = dev->base_addr;
|
2005-04-16 22:20:36 +00:00
|
|
|
mace_private *lp = netdev_priv(dev);
|
|
|
|
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("%s: restoring Rx mode to %d addresses.\n", dev->name,
|
2005-04-16 22:20:36 +00:00
|
|
|
lp->multicast_num_addrs);
|
|
|
|
|
|
|
|
if (dev->flags & IFF_PROMISC) {
|
|
|
|
/* Promiscuous mode: receive all packets */
|
|
|
|
mace_write(lp,ioaddr, MACE_UTR, MACE_UTR_LOOP_EXTERNAL);
|
|
|
|
mace_write(lp, ioaddr, MACE_MACCC,
|
|
|
|
MACE_MACCC_PROM | MACE_MACCC_ENXMT | MACE_MACCC_ENRCV
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
/* Normal mode */
|
|
|
|
mace_write(lp, ioaddr, MACE_UTR, MACE_UTR_LOOP_EXTERNAL);
|
|
|
|
mace_write(lp, ioaddr, MACE_MACCC, MACE_MACCC_ENXMT | MACE_MACCC_ENRCV);
|
|
|
|
}
|
|
|
|
} /* restore_multicast_list */
|
|
|
|
|
|
|
|
static void set_multicast_list(struct net_device *dev)
|
|
|
|
{
|
|
|
|
mace_private *lp = netdev_priv(dev);
|
|
|
|
|
|
|
|
#ifdef PCMCIA_DEBUG
|
2009-10-24 13:51:05 +00:00
|
|
|
{
|
2005-04-16 22:20:36 +00:00
|
|
|
static int old;
|
2010-02-08 04:30:35 +00:00
|
|
|
if (netdev_mc_count(dev) != old) {
|
|
|
|
old = netdev_mc_count(dev);
|
2009-10-24 13:51:05 +00:00
|
|
|
pr_debug("%s: setting Rx mode to %d addresses.\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
dev->name, old);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-02-08 04:30:35 +00:00
|
|
|
lp->multicast_num_addrs = netdev_mc_count(dev);
|
2005-04-16 22:20:36 +00:00
|
|
|
restore_multicast_list(dev);
|
|
|
|
|
|
|
|
} /* set_multicast_list */
|
|
|
|
|
2011-05-04 02:29:01 +00:00
|
|
|
static const struct pcmcia_device_id nmclan_ids[] = {
|
2005-06-27 23:28:23 +00:00
|
|
|
PCMCIA_DEVICE_PROD_ID12("New Media Corporation", "Ethernet", 0x085a850b, 0x00b2e941),
|
2005-07-28 08:07:24 +00:00
|
|
|
PCMCIA_DEVICE_PROD_ID12("Portable Add-ons", "Ethernet+", 0xebf1d60, 0xad673aaf),
|
2005-06-27 23:28:23 +00:00
|
|
|
PCMCIA_DEVICE_NULL,
|
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(pcmcia, nmclan_ids);
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
static struct pcmcia_driver nmclan_cs_driver = {
|
|
|
|
.owner = THIS_MODULE,
|
2010-08-08 09:36:26 +00:00
|
|
|
.name = "nmclan_cs",
|
2006-03-31 15:26:06 +00:00
|
|
|
.probe = nmclan_probe,
|
2005-11-14 20:23:14 +00:00
|
|
|
.remove = nmclan_detach,
|
2005-06-27 23:28:23 +00:00
|
|
|
.id_table = nmclan_ids,
|
2005-11-14 20:21:18 +00:00
|
|
|
.suspend = nmclan_suspend,
|
|
|
|
.resume = nmclan_resume,
|
2005-04-16 22:20:36 +00:00
|
|
|
};
|
2013-03-06 18:27:43 +00:00
|
|
|
module_pcmcia_driver(nmclan_cs_driver);
|