License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 22:07:57 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
2005-08-20 13:53:22 +08:00
|
|
|
* Header file for sonic.c
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
|
|
|
* (C) Waldorf Electronics, Germany
|
|
|
|
* Written by Andreas Busse
|
|
|
|
*
|
|
|
|
* NOTE: most of the structure definitions here are endian dependent.
|
|
|
|
* If you want to use this driver on big endian machines, the data
|
|
|
|
* and pad structure members must be exchanged. Also, the structures
|
2006-09-14 01:24:59 +08:00
|
|
|
* need to be changed accordingly to the bus size.
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
2005-08-20 13:53:22 +08:00
|
|
|
* 981229 MSch: did just that for the 68k Mac port (32 bit, big endian)
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
2005-08-20 13:53:22 +08:00
|
|
|
* 990611 David Huggins-Daines <dhd@debian.org>: This machine abstraction
|
|
|
|
* does not cope with 16-bit bus sizes very well. Therefore I have
|
|
|
|
* rewritten it with ugly macros and evil inlines.
|
|
|
|
*
|
|
|
|
* 050625 Finn Thain: introduced more 32-bit cards and dhd's support
|
|
|
|
* for 16-bit cards (from the mac68k project).
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
2005-08-20 13:53:22 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#ifndef SONIC_H
|
|
|
|
#define SONIC_H
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SONIC register offsets
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define SONIC_CMD 0x00
|
|
|
|
#define SONIC_DCR 0x01
|
|
|
|
#define SONIC_RCR 0x02
|
|
|
|
#define SONIC_TCR 0x03
|
|
|
|
#define SONIC_IMR 0x04
|
|
|
|
#define SONIC_ISR 0x05
|
|
|
|
|
|
|
|
#define SONIC_UTDA 0x06
|
|
|
|
#define SONIC_CTDA 0x07
|
|
|
|
|
|
|
|
#define SONIC_URDA 0x0d
|
|
|
|
#define SONIC_CRDA 0x0e
|
|
|
|
#define SONIC_EOBC 0x13
|
|
|
|
#define SONIC_URRA 0x14
|
|
|
|
#define SONIC_RSA 0x15
|
|
|
|
#define SONIC_REA 0x16
|
|
|
|
#define SONIC_RRP 0x17
|
|
|
|
#define SONIC_RWP 0x18
|
|
|
|
#define SONIC_RSC 0x2b
|
|
|
|
|
|
|
|
#define SONIC_CEP 0x21
|
|
|
|
#define SONIC_CAP2 0x22
|
|
|
|
#define SONIC_CAP1 0x23
|
|
|
|
#define SONIC_CAP0 0x24
|
|
|
|
#define SONIC_CE 0x25
|
|
|
|
#define SONIC_CDP 0x26
|
|
|
|
#define SONIC_CDC 0x27
|
|
|
|
|
|
|
|
#define SONIC_WT0 0x29
|
|
|
|
#define SONIC_WT1 0x2a
|
|
|
|
|
|
|
|
#define SONIC_SR 0x28
|
|
|
|
|
|
|
|
|
|
|
|
/* test-only registers */
|
|
|
|
|
|
|
|
#define SONIC_TPS 0x08
|
|
|
|
#define SONIC_TFC 0x09
|
|
|
|
#define SONIC_TSA0 0x0a
|
|
|
|
#define SONIC_TSA1 0x0b
|
|
|
|
#define SONIC_TFS 0x0c
|
|
|
|
|
|
|
|
#define SONIC_CRBA0 0x0f
|
|
|
|
#define SONIC_CRBA1 0x10
|
|
|
|
#define SONIC_RBWC0 0x11
|
|
|
|
#define SONIC_RBWC1 0x12
|
|
|
|
#define SONIC_TTDA 0x20
|
|
|
|
#define SONIC_MDT 0x2f
|
|
|
|
|
|
|
|
#define SONIC_TRBA0 0x19
|
|
|
|
#define SONIC_TRBA1 0x1a
|
|
|
|
#define SONIC_TBWC0 0x1b
|
|
|
|
#define SONIC_TBWC1 0x1c
|
|
|
|
#define SONIC_LLFA 0x1f
|
|
|
|
|
|
|
|
#define SONIC_ADDR0 0x1d
|
|
|
|
#define SONIC_ADDR1 0x1e
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Error counters
|
|
|
|
*/
|
2005-08-20 13:53:22 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#define SONIC_CRCT 0x2c
|
|
|
|
#define SONIC_FAET 0x2d
|
|
|
|
#define SONIC_MPT 0x2e
|
|
|
|
|
|
|
|
#define SONIC_DCR2 0x3f
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SONIC command bits
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define SONIC_CR_LCAM 0x0200
|
|
|
|
#define SONIC_CR_RRRA 0x0100
|
|
|
|
#define SONIC_CR_RST 0x0080
|
|
|
|
#define SONIC_CR_ST 0x0020
|
|
|
|
#define SONIC_CR_STP 0x0010
|
|
|
|
#define SONIC_CR_RXEN 0x0008
|
|
|
|
#define SONIC_CR_RXDIS 0x0004
|
|
|
|
#define SONIC_CR_TXP 0x0002
|
|
|
|
#define SONIC_CR_HTX 0x0001
|
|
|
|
|
2020-01-23 06:07:26 +08:00
|
|
|
#define SONIC_CR_ALL (SONIC_CR_LCAM | SONIC_CR_RRRA | \
|
|
|
|
SONIC_CR_RXEN | SONIC_CR_TXP)
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* SONIC data configuration bits
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define SONIC_DCR_EXBUS 0x8000
|
|
|
|
#define SONIC_DCR_LBR 0x2000
|
|
|
|
#define SONIC_DCR_PO1 0x1000
|
|
|
|
#define SONIC_DCR_PO0 0x0800
|
|
|
|
#define SONIC_DCR_SBUS 0x0400
|
|
|
|
#define SONIC_DCR_USR1 0x0200
|
|
|
|
#define SONIC_DCR_USR0 0x0100
|
|
|
|
#define SONIC_DCR_WC1 0x0080
|
|
|
|
#define SONIC_DCR_WC0 0x0040
|
|
|
|
#define SONIC_DCR_DW 0x0020
|
|
|
|
#define SONIC_DCR_BMS 0x0010
|
|
|
|
#define SONIC_DCR_RFT1 0x0008
|
|
|
|
#define SONIC_DCR_RFT0 0x0004
|
|
|
|
#define SONIC_DCR_TFT1 0x0002
|
|
|
|
#define SONIC_DCR_TFT0 0x0001
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Constants for the SONIC receive control register.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define SONIC_RCR_ERR 0x8000
|
|
|
|
#define SONIC_RCR_RNT 0x4000
|
|
|
|
#define SONIC_RCR_BRD 0x2000
|
|
|
|
#define SONIC_RCR_PRO 0x1000
|
|
|
|
#define SONIC_RCR_AMC 0x0800
|
|
|
|
#define SONIC_RCR_LB1 0x0400
|
|
|
|
#define SONIC_RCR_LB0 0x0200
|
|
|
|
|
|
|
|
#define SONIC_RCR_MC 0x0100
|
|
|
|
#define SONIC_RCR_BC 0x0080
|
|
|
|
#define SONIC_RCR_LPKT 0x0040
|
|
|
|
#define SONIC_RCR_CRS 0x0020
|
|
|
|
#define SONIC_RCR_COL 0x0010
|
|
|
|
#define SONIC_RCR_CRCR 0x0008
|
|
|
|
#define SONIC_RCR_FAER 0x0004
|
|
|
|
#define SONIC_RCR_LBK 0x0002
|
|
|
|
#define SONIC_RCR_PRX 0x0001
|
|
|
|
|
|
|
|
#define SONIC_RCR_LB_OFF 0
|
|
|
|
#define SONIC_RCR_LB_MAC SONIC_RCR_LB0
|
|
|
|
#define SONIC_RCR_LB_ENDEC SONIC_RCR_LB1
|
|
|
|
#define SONIC_RCR_LB_TRANS (SONIC_RCR_LB0 | SONIC_RCR_LB1)
|
|
|
|
|
|
|
|
/* default RCR setup */
|
|
|
|
|
|
|
|
#define SONIC_RCR_DEFAULT (SONIC_RCR_BRD)
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SONIC Transmit Control register bits
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define SONIC_TCR_PINTR 0x8000
|
|
|
|
#define SONIC_TCR_POWC 0x4000
|
|
|
|
#define SONIC_TCR_CRCI 0x2000
|
|
|
|
#define SONIC_TCR_EXDIS 0x1000
|
|
|
|
#define SONIC_TCR_EXD 0x0400
|
|
|
|
#define SONIC_TCR_DEF 0x0200
|
|
|
|
#define SONIC_TCR_NCRS 0x0100
|
|
|
|
#define SONIC_TCR_CRLS 0x0080
|
|
|
|
#define SONIC_TCR_EXC 0x0040
|
2020-01-23 06:07:26 +08:00
|
|
|
#define SONIC_TCR_OWC 0x0020
|
2005-04-17 06:20:36 +08:00
|
|
|
#define SONIC_TCR_PMB 0x0008
|
|
|
|
#define SONIC_TCR_FU 0x0004
|
|
|
|
#define SONIC_TCR_BCM 0x0002
|
|
|
|
#define SONIC_TCR_PTX 0x0001
|
|
|
|
|
|
|
|
#define SONIC_TCR_DEFAULT 0x0000
|
|
|
|
|
2006-09-14 01:24:59 +08:00
|
|
|
/*
|
2005-04-17 06:20:36 +08:00
|
|
|
* Constants for the SONIC_INTERRUPT_MASK and
|
|
|
|
* SONIC_INTERRUPT_STATUS registers.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define SONIC_INT_BR 0x4000
|
|
|
|
#define SONIC_INT_HBL 0x2000
|
2005-08-20 13:53:22 +08:00
|
|
|
#define SONIC_INT_LCD 0x1000
|
|
|
|
#define SONIC_INT_PINT 0x0800
|
|
|
|
#define SONIC_INT_PKTRX 0x0400
|
|
|
|
#define SONIC_INT_TXDN 0x0200
|
|
|
|
#define SONIC_INT_TXER 0x0100
|
|
|
|
#define SONIC_INT_TC 0x0080
|
|
|
|
#define SONIC_INT_RDE 0x0040
|
|
|
|
#define SONIC_INT_RBE 0x0020
|
2005-04-17 06:20:36 +08:00
|
|
|
#define SONIC_INT_RBAE 0x0010
|
|
|
|
#define SONIC_INT_CRC 0x0008
|
|
|
|
#define SONIC_INT_FAE 0x0004
|
|
|
|
#define SONIC_INT_MP 0x0002
|
|
|
|
#define SONIC_INT_RFO 0x0001
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The interrupts we allow.
|
|
|
|
*/
|
|
|
|
|
2005-08-20 13:53:22 +08:00
|
|
|
#define SONIC_IMR_DEFAULT ( SONIC_INT_BR | \
|
|
|
|
SONIC_INT_LCD | \
|
|
|
|
SONIC_INT_RFO | \
|
2005-04-17 06:20:36 +08:00
|
|
|
SONIC_INT_PKTRX | \
|
|
|
|
SONIC_INT_TXDN | \
|
|
|
|
SONIC_INT_TXER | \
|
|
|
|
SONIC_INT_RDE | \
|
|
|
|
SONIC_INT_RBAE | \
|
|
|
|
SONIC_INT_CRC | \
|
|
|
|
SONIC_INT_FAE | \
|
|
|
|
SONIC_INT_MP)
|
|
|
|
|
|
|
|
|
2005-08-20 13:53:22 +08:00
|
|
|
#define SONIC_EOL 0x0001
|
2005-04-17 06:20:36 +08:00
|
|
|
#define CAM_DESCRIPTORS 16
|
|
|
|
|
2005-08-20 13:53:22 +08:00
|
|
|
/* Offsets in the various DMA buffers accessed by the SONIC */
|
|
|
|
|
|
|
|
#define SONIC_BITMODE16 0
|
|
|
|
#define SONIC_BITMODE32 1
|
|
|
|
#define SONIC_BUS_SCALE(bitmode) ((bitmode) ? 4 : 2)
|
|
|
|
/* Note! These are all measured in bus-size units, so use SONIC_BUS_SCALE */
|
|
|
|
#define SIZEOF_SONIC_RR 4
|
|
|
|
#define SONIC_RR_BUFADR_L 0
|
|
|
|
#define SONIC_RR_BUFADR_H 1
|
|
|
|
#define SONIC_RR_BUFSIZE_L 2
|
|
|
|
#define SONIC_RR_BUFSIZE_H 3
|
|
|
|
|
|
|
|
#define SIZEOF_SONIC_RD 7
|
|
|
|
#define SONIC_RD_STATUS 0
|
|
|
|
#define SONIC_RD_PKTLEN 1
|
|
|
|
#define SONIC_RD_PKTPTR_L 2
|
|
|
|
#define SONIC_RD_PKTPTR_H 3
|
|
|
|
#define SONIC_RD_SEQNO 4
|
|
|
|
#define SONIC_RD_LINK 5
|
|
|
|
#define SONIC_RD_IN_USE 6
|
|
|
|
|
|
|
|
#define SIZEOF_SONIC_TD 8
|
|
|
|
#define SONIC_TD_STATUS 0
|
|
|
|
#define SONIC_TD_CONFIG 1
|
|
|
|
#define SONIC_TD_PKTSIZE 2
|
|
|
|
#define SONIC_TD_FRAG_COUNT 3
|
|
|
|
#define SONIC_TD_FRAG_PTR_L 4
|
|
|
|
#define SONIC_TD_FRAG_PTR_H 5
|
|
|
|
#define SONIC_TD_FRAG_SIZE 6
|
|
|
|
#define SONIC_TD_LINK 7
|
|
|
|
|
|
|
|
#define SIZEOF_SONIC_CD 4
|
|
|
|
#define SONIC_CD_ENTRY_POINTER 0
|
|
|
|
#define SONIC_CD_CAP0 1
|
|
|
|
#define SONIC_CD_CAP1 2
|
|
|
|
#define SONIC_CD_CAP2 3
|
|
|
|
|
|
|
|
#define SIZEOF_SONIC_CDA ((CAM_DESCRIPTORS * SIZEOF_SONIC_CD) + 1)
|
|
|
|
#define SONIC_CDA_CAM_ENABLE (CAM_DESCRIPTORS * SIZEOF_SONIC_CD)
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Some tunables for the buffer areas. Power of 2 is required
|
|
|
|
* the current driver uses one receive buffer for each descriptor.
|
|
|
|
*
|
|
|
|
* MSch: use more buffer space for the slow m68k Macs!
|
|
|
|
*/
|
2005-08-20 13:53:22 +08:00
|
|
|
#define SONIC_NUM_RRS 16 /* number of receive resources */
|
|
|
|
#define SONIC_NUM_RDS SONIC_NUM_RRS /* number of receive descriptors */
|
|
|
|
#define SONIC_NUM_TDS 16 /* number of transmit descriptors */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2020-01-23 06:07:26 +08:00
|
|
|
#define SONIC_RRS_MASK (SONIC_NUM_RRS - 1)
|
|
|
|
#define SONIC_RDS_MASK (SONIC_NUM_RDS - 1)
|
|
|
|
#define SONIC_TDS_MASK (SONIC_NUM_TDS - 1)
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-20 13:53:22 +08:00
|
|
|
#define SONIC_RBSIZE 1520 /* size of one resource buffer */
|
|
|
|
|
|
|
|
/* Again, measured in bus size units! */
|
|
|
|
#define SIZEOF_SONIC_DESC (SIZEOF_SONIC_CDA \
|
|
|
|
+ (SIZEOF_SONIC_TD * SONIC_NUM_TDS) \
|
|
|
|
+ (SIZEOF_SONIC_RD * SONIC_NUM_RDS) \
|
|
|
|
+ (SIZEOF_SONIC_RR * SONIC_NUM_RRS))
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* Information that need to be kept for each board. */
|
|
|
|
struct sonic_local {
|
2005-08-20 13:53:22 +08:00
|
|
|
/* Bus size. 0 == 16 bits, 1 == 32 bits. */
|
|
|
|
int dma_bitmode;
|
|
|
|
/* Register offset within the longword (independent of endianness,
|
|
|
|
and varies from one type of Macintosh SONIC to another
|
|
|
|
(Aarrgh)) */
|
|
|
|
int reg_offset;
|
|
|
|
void *descriptors;
|
|
|
|
/* Crud. These areas have to be within the same 64K. Therefore
|
|
|
|
we allocate a desriptors page, and point these to places within it. */
|
|
|
|
void *cda; /* CAM descriptor area */
|
|
|
|
void *tda; /* Transmit descriptor area */
|
|
|
|
void *rra; /* Receive resource area */
|
|
|
|
void *rda; /* Receive descriptor area */
|
|
|
|
struct sk_buff* volatile rx_skb[SONIC_NUM_RRS]; /* packets to be received */
|
|
|
|
struct sk_buff* volatile tx_skb[SONIC_NUM_TDS]; /* packets to be transmitted */
|
|
|
|
unsigned int tx_len[SONIC_NUM_TDS]; /* lengths of tx DMA mappings */
|
|
|
|
/* Logical DMA addresses on MIPS, bus addresses on m68k
|
|
|
|
* (so "laddr" is a bit misleading) */
|
|
|
|
dma_addr_t descriptors_laddr;
|
|
|
|
u32 cda_laddr; /* logical DMA address of CDA */
|
|
|
|
u32 tda_laddr; /* logical DMA address of TDA */
|
|
|
|
u32 rra_laddr; /* logical DMA address of RRA */
|
|
|
|
u32 rda_laddr; /* logical DMA address of RDA */
|
|
|
|
dma_addr_t rx_laddr[SONIC_NUM_RRS]; /* logical DMA addresses of rx skbuffs */
|
|
|
|
dma_addr_t tx_laddr[SONIC_NUM_TDS]; /* logical DMA addresses of tx skbuffs */
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned int cur_rx;
|
2005-08-20 13:53:22 +08:00
|
|
|
unsigned int cur_tx; /* first unacked transmit packet */
|
|
|
|
unsigned int eol_rx;
|
|
|
|
unsigned int eol_tx; /* last unacked transmit packet */
|
2018-02-25 07:27:25 +08:00
|
|
|
int msg_enable;
|
2005-08-20 13:53:22 +08:00
|
|
|
struct device *device; /* generic device */
|
2005-04-17 06:20:36 +08:00
|
|
|
struct net_device_stats stats;
|
2020-01-23 06:07:26 +08:00
|
|
|
spinlock_t lock;
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2005-08-20 13:53:22 +08:00
|
|
|
#define TX_TIMEOUT (3 * HZ)
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* Index to functions, as function prototypes. */
|
|
|
|
|
|
|
|
static int sonic_open(struct net_device *dev);
|
|
|
|
static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev);
|
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 21:55:46 +08:00
|
|
|
static irqreturn_t sonic_interrupt(int irq, void *dev_id);
|
2005-04-17 06:20:36 +08:00
|
|
|
static void sonic_rx(struct net_device *dev);
|
|
|
|
static int sonic_close(struct net_device *dev);
|
|
|
|
static struct net_device_stats *sonic_get_stats(struct net_device *dev);
|
|
|
|
static void sonic_multicast_list(struct net_device *dev);
|
|
|
|
static int sonic_init(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 22:23:51 +08:00
|
|
|
static void sonic_tx_timeout(struct net_device *dev, unsigned int txqueue);
|
2018-02-25 07:27:25 +08:00
|
|
|
static void sonic_msg_init(struct net_device *dev);
|
2020-02-16 05:03:32 +08:00
|
|
|
static int sonic_alloc_descriptors(struct net_device *dev);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-20 13:53:22 +08:00
|
|
|
/* Internal inlines for reading/writing DMA buffers. Note that bus
|
|
|
|
size and endianness matter here, whereas they don't for registers,
|
|
|
|
as far as we can tell. */
|
|
|
|
/* OpenBSD calls this "SWO". I'd like to think that sonic_buf_put()
|
|
|
|
is a much better name. */
|
2020-01-23 06:07:26 +08:00
|
|
|
static inline void sonic_buf_put(u16 *base, int bitmode,
|
2005-08-20 13:53:22 +08:00
|
|
|
int offset, __u16 val)
|
|
|
|
{
|
|
|
|
if (bitmode)
|
|
|
|
#ifdef __BIG_ENDIAN
|
2020-01-23 06:07:26 +08:00
|
|
|
__raw_writew(val, base + (offset * 2) + 1);
|
2005-08-20 13:53:22 +08:00
|
|
|
#else
|
2020-01-23 06:07:26 +08:00
|
|
|
__raw_writew(val, base + (offset * 2) + 0);
|
2005-08-20 13:53:22 +08:00
|
|
|
#endif
|
|
|
|
else
|
2020-01-23 06:07:26 +08:00
|
|
|
__raw_writew(val, base + (offset * 1) + 0);
|
2005-08-20 13:53:22 +08:00
|
|
|
}
|
|
|
|
|
2020-01-23 06:07:26 +08:00
|
|
|
static inline __u16 sonic_buf_get(u16 *base, int bitmode,
|
2005-08-20 13:53:22 +08:00
|
|
|
int offset)
|
|
|
|
{
|
|
|
|
if (bitmode)
|
|
|
|
#ifdef __BIG_ENDIAN
|
2020-01-23 06:07:26 +08:00
|
|
|
return __raw_readw(base + (offset * 2) + 1);
|
2005-08-20 13:53:22 +08:00
|
|
|
#else
|
2020-01-23 06:07:26 +08:00
|
|
|
return __raw_readw(base + (offset * 2) + 0);
|
2005-08-20 13:53:22 +08:00
|
|
|
#endif
|
|
|
|
else
|
2020-01-23 06:07:26 +08:00
|
|
|
return __raw_readw(base + (offset * 1) + 0);
|
2005-08-20 13:53:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Inlines that you should actually use for reading/writing DMA buffers */
|
|
|
|
static inline void sonic_cda_put(struct net_device* dev, int entry,
|
|
|
|
int offset, __u16 val)
|
|
|
|
{
|
2008-11-13 15:38:36 +08:00
|
|
|
struct sonic_local *lp = netdev_priv(dev);
|
2005-08-20 13:53:22 +08:00
|
|
|
sonic_buf_put(lp->cda, lp->dma_bitmode,
|
|
|
|
(entry * SIZEOF_SONIC_CD) + offset, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline __u16 sonic_cda_get(struct net_device* dev, int entry,
|
|
|
|
int offset)
|
|
|
|
{
|
2008-11-13 15:38:36 +08:00
|
|
|
struct sonic_local *lp = netdev_priv(dev);
|
2005-08-20 13:53:22 +08:00
|
|
|
return sonic_buf_get(lp->cda, lp->dma_bitmode,
|
|
|
|
(entry * SIZEOF_SONIC_CD) + offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void sonic_set_cam_enable(struct net_device* dev, __u16 val)
|
|
|
|
{
|
2008-11-13 15:38:36 +08:00
|
|
|
struct sonic_local *lp = netdev_priv(dev);
|
2005-08-20 13:53:22 +08:00
|
|
|
sonic_buf_put(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline __u16 sonic_get_cam_enable(struct net_device* dev)
|
|
|
|
{
|
2008-11-13 15:38:36 +08:00
|
|
|
struct sonic_local *lp = netdev_priv(dev);
|
2005-08-20 13:53:22 +08:00
|
|
|
return sonic_buf_get(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void sonic_tda_put(struct net_device* dev, int entry,
|
|
|
|
int offset, __u16 val)
|
|
|
|
{
|
2008-11-13 15:38:36 +08:00
|
|
|
struct sonic_local *lp = netdev_priv(dev);
|
2005-08-20 13:53:22 +08:00
|
|
|
sonic_buf_put(lp->tda, lp->dma_bitmode,
|
|
|
|
(entry * SIZEOF_SONIC_TD) + offset, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline __u16 sonic_tda_get(struct net_device* dev, int entry,
|
|
|
|
int offset)
|
|
|
|
{
|
2008-11-13 15:38:36 +08:00
|
|
|
struct sonic_local *lp = netdev_priv(dev);
|
2005-08-20 13:53:22 +08:00
|
|
|
return sonic_buf_get(lp->tda, lp->dma_bitmode,
|
|
|
|
(entry * SIZEOF_SONIC_TD) + offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void sonic_rda_put(struct net_device* dev, int entry,
|
|
|
|
int offset, __u16 val)
|
|
|
|
{
|
2008-11-13 15:38:36 +08:00
|
|
|
struct sonic_local *lp = netdev_priv(dev);
|
2005-08-20 13:53:22 +08:00
|
|
|
sonic_buf_put(lp->rda, lp->dma_bitmode,
|
|
|
|
(entry * SIZEOF_SONIC_RD) + offset, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline __u16 sonic_rda_get(struct net_device* dev, int entry,
|
|
|
|
int offset)
|
|
|
|
{
|
2008-11-13 15:38:36 +08:00
|
|
|
struct sonic_local *lp = netdev_priv(dev);
|
2005-08-20 13:53:22 +08:00
|
|
|
return sonic_buf_get(lp->rda, lp->dma_bitmode,
|
|
|
|
(entry * SIZEOF_SONIC_RD) + offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void sonic_rra_put(struct net_device* dev, int entry,
|
|
|
|
int offset, __u16 val)
|
|
|
|
{
|
2008-11-13 15:38:36 +08:00
|
|
|
struct sonic_local *lp = netdev_priv(dev);
|
2005-08-20 13:53:22 +08:00
|
|
|
sonic_buf_put(lp->rra, lp->dma_bitmode,
|
|
|
|
(entry * SIZEOF_SONIC_RR) + offset, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline __u16 sonic_rra_get(struct net_device* dev, int entry,
|
|
|
|
int offset)
|
|
|
|
{
|
2008-11-13 15:38:36 +08:00
|
|
|
struct sonic_local *lp = netdev_priv(dev);
|
2005-08-20 13:53:22 +08:00
|
|
|
return sonic_buf_get(lp->rra, lp->dma_bitmode,
|
|
|
|
(entry * SIZEOF_SONIC_RR) + offset);
|
|
|
|
}
|
|
|
|
|
2020-01-23 06:07:26 +08:00
|
|
|
static inline u16 sonic_rr_addr(struct net_device *dev, int entry)
|
|
|
|
{
|
|
|
|
struct sonic_local *lp = netdev_priv(dev);
|
|
|
|
|
|
|
|
return lp->rra_laddr +
|
|
|
|
entry * SIZEOF_SONIC_RR * SONIC_BUS_SCALE(lp->dma_bitmode);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline u16 sonic_rr_entry(struct net_device *dev, u16 addr)
|
|
|
|
{
|
|
|
|
struct sonic_local *lp = netdev_priv(dev);
|
|
|
|
|
|
|
|
return (addr - (u16)lp->rra_laddr) / (SIZEOF_SONIC_RR *
|
|
|
|
SONIC_BUS_SCALE(lp->dma_bitmode));
|
|
|
|
}
|
|
|
|
|
2017-05-09 06:59:05 +08:00
|
|
|
static const char version[] =
|
2005-04-17 06:20:36 +08:00
|
|
|
"sonic.c:v0.92 20.9.98 tsbogend@alpha.franken.de\n";
|
|
|
|
|
|
|
|
#endif /* SONIC_H */
|