Compare commits
30 Commits
stable-1.6
...
1.5.3
| Author | SHA1 | Date |
|---|---|---|
|
|
6cdb21c6f7 | |
|
|
d7a7d69071 | |
|
|
108c2a02bf | |
|
|
2640850774 | |
|
|
b4cf07e140 | |
|
|
131c468426 | |
|
|
f7d2c053bc | |
|
|
85ed1a08c5 | |
|
|
afdfadaf6f | |
|
|
afa7a839a7 | |
|
|
c2b8e2ed50 | |
|
|
8b5a6ba004 | |
|
|
4c0ac0915e | |
|
|
30b782ede2 | |
|
|
86628ea47f | |
|
|
4ad89af4d4 | |
|
|
4417467a83 | |
|
|
e5d8adf7e5 | |
|
|
b96c8d90e4 | |
|
|
10cb8b3b28 | |
|
|
0a5de833b4 | |
|
|
e0ffc95896 | |
|
|
8aee1daee3 | |
|
|
3079ece7a2 | |
|
|
6f3a174de1 | |
|
|
fddb7c883e | |
|
|
fb67d42fc7 | |
|
|
87d109b757 | |
|
|
97c7b6ed2c | |
|
|
f2a9267419 |
|
|
@ -1,93 +0,0 @@
|
|||
---
|
||||
Language: Cpp
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: AlwaysBreak
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignConsecutiveMacros: false
|
||||
AlignEscapedNewlines: DontAlign
|
||||
AlignOperands: false
|
||||
AlignTrailingComments: true
|
||||
AllowAllConstructorInitializersOnNextLine: true
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: InlineOnly
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: No
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: true
|
||||
AfterControlStatement: Never
|
||||
AfterEnum: false
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: false
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeBraces: Custom # Same as 'BraceWrapping'
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: AfterColon
|
||||
BreakInheritanceList: AfterColon
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 78
|
||||
CompactNamespaces: true
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 8
|
||||
Cpp11BracedListStyle: true
|
||||
DeriveLineEnding: true
|
||||
DerivePointerAlignment: false
|
||||
FixNamespaceComments: true
|
||||
IncludeBlocks: Preserve
|
||||
IndentAccessModifiers: true
|
||||
IndentCaseLabels: true
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 4
|
||||
InsertBraces: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: None
|
||||
PackConstructorInitializers: Never
|
||||
PointerAlignment: Right
|
||||
ReflowComments: true
|
||||
SortIncludes: false
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: true
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeCtorInitializerColon: false
|
||||
SpaceBeforeInheritanceColon: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceBeforeSquareBrackets: false
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
SpacesInAngles: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Auto
|
||||
TabWidth: 2
|
||||
UseTab: Never
|
||||
...
|
||||
|
|
@ -33,13 +33,11 @@ ethercat.spec
|
|||
examples/dc_user/ec_dc_user_example
|
||||
examples/user/ec_user_example
|
||||
examples/user/build/
|
||||
fake_lib/libfakeethercat.la
|
||||
lib/*.cmake
|
||||
lib/libethercat.la
|
||||
lib/libethercat.pc
|
||||
libtool
|
||||
master/*.o.d
|
||||
script/ethercat
|
||||
script/ethercat.service
|
||||
script/ethercatctl
|
||||
script/init.d/ethercat
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
image:
|
||||
registry.gitlab.com/etherlab.org/build-container-factory/leap-15.4:linux-syms
|
||||
registry.gitlab.com/etherlab.org/build-container-factory/leap-15.3:linux-syms
|
||||
|
||||
stages:
|
||||
- build
|
||||
|
|
@ -11,65 +11,15 @@ stages:
|
|||
variables:
|
||||
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/ethercat/${CI_COMMIT_TAG}"
|
||||
|
||||
rtai:
|
||||
stage: build
|
||||
image: registry.gitlab.com/etherlab.org/build-container-factory/ethercat-kernels:rtai
|
||||
|
||||
script:
|
||||
- ./bootstrap
|
||||
- ./configure --enable-8139too --enable-igb --enable-e100 --with-linux-dir=/usr/src/linux-obj/x86_64/0404rtai --enable-rtdm --with-rtai-dir=/usr
|
||||
- make -j8 all modules
|
||||
|
||||
xenomai2:
|
||||
stage: build
|
||||
image: registry.gitlab.com/etherlab.org/build-container-factory/ethercat-kernels:xenomai2
|
||||
|
||||
script:
|
||||
- ./bootstrap
|
||||
- ./configure --disable-8139too --with-linux-dir=/usr/src/linux-obj/x86_64/0318xenomai2 --enable-rtdm --with-xenomai-dir=/usr
|
||||
- make -j8 all modules
|
||||
|
||||
kernel 3.4:
|
||||
stage: build
|
||||
image: registry.gitlab.com/etherlab.org/build-container-factory/ethercat-kernels:k3.4-rt145
|
||||
script:
|
||||
- ./bootstrap
|
||||
- ./configure --enable-8139too --enable-e100 --enable-e1000 --enable-e1000e --enable-r8169 --with-linux-dir=/usr/src/linux-obj/x86_64/0304rt
|
||||
- make -j8 all modules
|
||||
|
||||
xenomai3:
|
||||
stage: build
|
||||
image: registry.gitlab.com/etherlab.org/build-container-factory/ethercat-kernels:xenomai3
|
||||
|
||||
script:
|
||||
- ./bootstrap
|
||||
- ./configure --enable-8139too --enable-igb --enable-e100 --with-linux-dir=/usr/src/linux-obj/x86_64/0510xenomai3 --enable-rtdm --with-xenomai-dir=/usr
|
||||
- make -j8 all modules
|
||||
|
||||
xenomai3 no eoe:
|
||||
stage: build
|
||||
image: registry.gitlab.com/etherlab.org/build-container-factory/ethercat-kernels:xenomai3
|
||||
|
||||
script:
|
||||
- ./bootstrap
|
||||
- ./configure --enable-8139too --enable-igb --enable-e100 --with-linux-dir=/usr/src/linux-obj/x86_64/0510xenomai3 --enable-rtdm --with-xenomai-dir=/usr --disable-eoe
|
||||
- make -j8 all modules
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
||||
script:
|
||||
- ./bootstrap
|
||||
- ./configure --with-linux-dir=/usr/src/linux-obj/$(uname -i)/default --enable-tty --with-devices=2 --enable-ccat --enable-fakeuserlib
|
||||
- ./configure --with-linux-dir=/usr/src/linux-obj/$(uname -i)/default --disable-8139too --enable-tty --with-devices=2 --enable-ccat
|
||||
- make -j8 all modules
|
||||
- make -C lib symbol-version-check
|
||||
- make DISTCHECK_CONFIGURE_FLAGS="--with-linux-dir=/usr/src/linux-obj/$(uname -i)/default" distcheck
|
||||
- make dist
|
||||
- mkdir test_dist && cd test_dist && tar xzf ../ethercat-*.tar.gz && cd ethercat-*/
|
||||
- mkdir build && cd build
|
||||
- ../configure --with-linux-dir=/usr/src/linux-obj/$(uname -i)/default --disable-8139too --enable-tty --with-devices=2 --enable-ccat --enable-fakeuserlib
|
||||
- make -j8 all modules
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- ethercat-*.tar.gz
|
||||
|
|
@ -113,7 +63,7 @@ doxygen:
|
|||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
script:
|
||||
- ./bootstrap
|
||||
- ./configure --with-linux-dir=/usr/src/linux-obj/$(uname -i)/default --enable-tty --with-devices=2 --enable-ccat
|
||||
- ./configure --with-linux-dir=/usr/src/linux-obj/$(uname -i)/default --disable-8139too --enable-tty --with-devices=2 --enable-ccat
|
||||
- make doc
|
||||
- mv doxygen-output/html/ html/
|
||||
artifacts:
|
||||
|
|
@ -124,14 +74,11 @@ doxygen:
|
|||
# It must be named 'pdf' and must produce a 'pdf' directory as an artifact.
|
||||
# All PDF files in this directory will be collected.
|
||||
pdf:
|
||||
needs:
|
||||
- job: commands
|
||||
artifacts: true
|
||||
stage: doc
|
||||
image: registry.gitlab.com/etherlab.org/build-container-factory/leap-15.4:texlive
|
||||
image: registry.gitlab.com/etherlab.org/build-container-factory/leap-15.3:texlive
|
||||
script:
|
||||
- cd documentation
|
||||
- git show -s --format="\def\revision{%h}\def\gitversion{%(describe)}\def\gittag{%(describe:abbrev=0)}\def\gitauthor{%an}\def\isodate#1-#2-#3x{\day=#3 \month=#2 \year=#1}\isodate %csx" HEAD > git.tex
|
||||
- git show -s --format="\def\revision{%h}\def\gitversion{%(describe)}\def\gitauthor{%an}\def\isodate#1-#2-#3x{\day=#3 \month=#2 \year=#1}\isodate %csx" HEAD > git.tex
|
||||
- make
|
||||
- make index
|
||||
- make
|
||||
|
|
@ -145,7 +92,7 @@ pdf:
|
|||
update docs server:
|
||||
stage: deploy
|
||||
rules:
|
||||
- if: ($CI_COMMIT_BRANCH == "stable-1.6" || $CI_COMMIT_TAG) && $CI_PROJECT_NAMESPACE == "etherlab.org"
|
||||
- if: $CI_COMMIT_BRANCH == "stable-1.5" && $CI_PROJECT_NAMESPACE == "etherlab.org"
|
||||
trigger: etherlab.org/docs
|
||||
|
||||
upload:
|
||||
|
|
@ -186,4 +133,4 @@ workflow:
|
|||
rules:
|
||||
- if: $CI_MERGE_REQUEST_IID
|
||||
- if: $CI_COMMIT_TAG
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH == "stable-1.6"
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH == "stable-1.5"
|
||||
|
|
|
|||
181
CONTRIBUTING.md
181
CONTRIBUTING.md
|
|
@ -1,181 +0,0 @@
|
|||
<!-- omit in toc -->
|
||||
# Contributing to the IgH EtherCAT Master
|
||||
|
||||
First off, thanks for taking the time to contribute! ❤️
|
||||
|
||||
All types of contributions are encouraged and valued. See the
|
||||
[Table of Contents](#table-of-contents) for different ways to help and details
|
||||
about how this project handles them. Please make sure to read the relevant
|
||||
section before making your contribution. It will make it a lot easier for us
|
||||
maintainers and smooth out the experience for all involved. The community looks
|
||||
forward to your contributions. 🎉
|
||||
|
||||
> And if you like the project, but just don't have time to contribute, that's
|
||||
> fine. There are other easy ways to support the project and show your
|
||||
> appreciation, which we would also be very happy about:
|
||||
> - Star the project
|
||||
> - Write something about it in the social media
|
||||
> - Refer this project in your project's readme
|
||||
> - Mention the project at local meetups and tell your friends/colleagues
|
||||
|
||||
|
||||
<!-- omit in toc -->
|
||||
## Table of Contents
|
||||
|
||||
- [I Have a Question](#i-have-a-question)
|
||||
- [I Want To Contribute](#i-want-to-contribute)
|
||||
- [Reporting Bugs](#reporting-bugs)
|
||||
- [Suggesting Enhancements](#suggesting-enhancements)
|
||||
- [Your First Code Contribution](#your-first-code-contribution)
|
||||
- [Improving The Documentation](#improving-the-documentation)
|
||||
- [Styleguides](#styleguides)
|
||||
- [Commit Messages](#commit-messages)
|
||||
- [Join The Project Team](#join-the-project-team)
|
||||
|
||||
|
||||
## I Have a Question
|
||||
|
||||
> If you want to ask a question, we assume that you have read the available
|
||||
> [Documentation](https://docs.etherlab.org).
|
||||
|
||||
Before you ask a question, it is best to search for existing
|
||||
[Issues](https://gitlab.com/etherlab.org/ethercat/issues) and in the [mailing
|
||||
list archives](https://lists.etherlab.org/mailman/listinfo) for posts that
|
||||
might help you.
|
||||
|
||||
In case you have found a suitable issue and still need clarification, you can
|
||||
write your question in this issue. It is also advisable to search the internet
|
||||
for answers first.
|
||||
|
||||
If you then still feel the need to ask a question and need clarification, we
|
||||
recommend the following:
|
||||
|
||||
- If it is a question about getting a certain device to work, please ask you
|
||||
question on our [mailing lists](https://lists.etherlab.org/mailman/listinfo).
|
||||
- If f you think the problem lies in the master itself, open an
|
||||
[Issue](https://gitlab.com/etherlab.org/ethercat/issues/new).
|
||||
- Provide as much context as you can about what you're running into.
|
||||
- Provide project and platform versions: EtherCAT master version, Linux Kernel
|
||||
version, the Linux distribution and the used Ethernet driver (generic,
|
||||
8319too, ccat, ...), depending on what seems relevant.
|
||||
|
||||
We will then take care of the issue as soon as possible.
|
||||
|
||||
|
||||
## I Want To Contribute
|
||||
|
||||
> ### Legal Notice <!-- omit in toc -->
|
||||
> When contributing to this project, you must agree that you have authored 100%
|
||||
> of the content, that you have the necessary rights to the content and that
|
||||
> the content you contribute may be provided under the project licence.
|
||||
|
||||
|
||||
### Reporting Bugs
|
||||
|
||||
<!-- omit in toc -->
|
||||
#### Before Submitting a Bug Report
|
||||
|
||||
A good bug report shouldn't leave others needing to chase you up for more
|
||||
information. Therefore, we ask you to investigate carefully, collect
|
||||
information and describe the issue in detail in your report. Please complete
|
||||
the following steps in advance to help us fix any potential bug as fast as
|
||||
possible.
|
||||
|
||||
- Make sure that you are using the latest version.
|
||||
- Determine if your bug is really a bug and not an error on your side e.g.
|
||||
using incompatible environment components/versions (Make sure that you have
|
||||
read the [documentation](https://docs.etherlab.org). If you are looking for
|
||||
support, you might want to check [this section](#i-have-a-question)).
|
||||
- To see if other users have experienced (and potentially already solved) the
|
||||
same issue you are having, check if there is not already a bug report
|
||||
existing for your bug or error in the
|
||||
[bug tracker](https://gitlab.com/etherlab.org/ethercat/issues?q=label%3Abug).
|
||||
- Also make sure to search the internet to see if
|
||||
users outside of the GitLab community have discussed the issue.
|
||||
- Collect information about the bug:
|
||||
- Stack trace (Traceback)
|
||||
- OS, Platform and Version (Linux Kernel, Distribution, x86, ARM, ...)
|
||||
- The Ethernet driver use are using (generic, 8139too, ccat, ...)
|
||||
- Can you reliably reproduce the issue? And can you also reproduce it with
|
||||
older versions?
|
||||
|
||||
|
||||
<!-- omit in toc -->
|
||||
#### How Do I Submit a Good Bug Report?
|
||||
|
||||
> You must never report security related issues, vulnerabilities or bugs
|
||||
> including sensitive information to the issue tracker, or elsewhere in public.
|
||||
> Instead sensitive bugs must be sent by email to <fp@igh.de>.
|
||||
|
||||
We use GitLab issues to track bugs and errors. If you run into an issue with
|
||||
the project:
|
||||
|
||||
- Open an [Issue](https://gitlab.com/etherlab.org/ethercat/issues/new). (Since
|
||||
we can't be sure at this point whether it is a bug or not, we ask you not to
|
||||
talk about a bug yet and not to label the issue.)
|
||||
- Explain the behavior you would expect and the actual behavior.
|
||||
- Please provide as much context as possible and describe the *reproduction
|
||||
steps* that someone else can follow to recreate the issue on their own. This
|
||||
usually includes your code. For good bug reports you should isolate the
|
||||
problem and create a reduced test case.
|
||||
- Provide the information you collected in the previous section.
|
||||
|
||||
Once it's filed:
|
||||
|
||||
- The project team will label the issue accordingly.
|
||||
|
||||
|
||||
### Suggesting Enhancements
|
||||
|
||||
This section guides you through submitting an enhancement suggestion for IgH
|
||||
EtherCAT Master, **including completely new features and minor improvements to
|
||||
existing functionality**. Following these guidelines will help maintainers and
|
||||
the community to understand your suggestion and find related suggestions.
|
||||
|
||||
|
||||
<!-- omit in toc -->
|
||||
#### Before Submitting an Enhancement
|
||||
|
||||
- Make sure that you are using the latest version.
|
||||
- Read the [documentation](https://docs.etherlab.org) carefully and find out if
|
||||
the functionality is already covered, maybe by an individual configuration.
|
||||
- Perform a [search](https://gitlab.com/etherlab.org/ethercat/issues) to see if
|
||||
the enhancement has already been suggested. If it has, add a comment to the
|
||||
existing issue instead of opening a new one.
|
||||
- Find out whether your idea fits with the scope and aims of the project. It's
|
||||
up to you to make a strong case to convince the project's developers of the
|
||||
merits of this feature. Keep in mind that we want features that will be
|
||||
useful to the majority of our users and not just a small subset. If you're
|
||||
just targeting a minority of users, consider writing an add-on/plugin
|
||||
library.
|
||||
|
||||
|
||||
<!-- omit in toc -->
|
||||
#### How Do I Submit a Good Enhancement Suggestion?
|
||||
|
||||
Enhancement suggestions are tracked as
|
||||
[GitLab issues](https://gitlab.com/etherlab.org/ethercat/issues).
|
||||
|
||||
- Use a **clear and descriptive title** for the issue to identify the
|
||||
suggestion.
|
||||
- Provide a **step-by-step description of the suggested enhancement** in as
|
||||
many details as possible.
|
||||
- **Describe the current behavior** and **explain which behavior you expected
|
||||
to see instead** and why. At this point you can also tell which alternatives
|
||||
do not work for you.
|
||||
- You may want to **include screenshots or screen recordings** which help you
|
||||
demonstrate the steps or point out the part which the suggestion is related
|
||||
to.
|
||||
- **Explain why this enhancement would be useful** to most IgH EtherCAT Master
|
||||
users. You may also want to point out the other projects that solved it
|
||||
better and which could serve as inspiration.
|
||||
|
||||
|
||||
## Styleguides
|
||||
|
||||
There is a [coding style document](CodingStyle.md) next to this guide.
|
||||
|
||||
|
||||
<!-- omit in toc -->
|
||||
## Attribution
|
||||
This guide is based on the [contributing.md](https://contributing.md/generator)!
|
||||
2950
Doxyfile.in
2950
Doxyfile.in
File diff suppressed because it is too large
Load Diff
15
INSTALL.md
15
INSTALL.md
|
|
@ -10,12 +10,12 @@ section of the
|
|||
|
||||
---
|
||||
|
||||
For the impatient, the procedure mainly consists of calling:
|
||||
For the impatient: The procedure mainly consists of calling
|
||||
|
||||
```bash
|
||||
./bootstrap # to create the configure script, if downloaded from the repo
|
||||
|
||||
./configure --sysconfdir=/etc
|
||||
./configure
|
||||
make all modules
|
||||
```
|
||||
|
||||
|
|
@ -26,11 +26,13 @@ make modules_install install
|
|||
depmod
|
||||
```
|
||||
|
||||
... and then customizing the appropriate configuration file:
|
||||
... and linking the init script and copying the sysconfig file from $PREFIX/etc
|
||||
to the appropriate locations and customizing the sysconfig file.
|
||||
|
||||
```bash
|
||||
# vi /etc/ethercat.conf # For systemd based distro
|
||||
# vi /etc/sysconfig/ethercat # For init.d based distro
|
||||
ln -s ${PREFIX}/etc/init.d/ethercat /etc/init.d/ethercat
|
||||
cp ${PREFIX}/etc/sysconfig/ethercat /etc/sysconfig/ethercat
|
||||
vi /etc/sysconfig/ethercat
|
||||
```
|
||||
|
||||
Make sure, that the 'udev' package is installed, to automatically create the
|
||||
|
|
@ -45,8 +47,7 @@ echo KERNEL==\"EtherCAT[0-9]*\", MODE=\"0664\" > /etc/udev/rules.d/99-EtherCAT.r
|
|||
Now you can start the EtherCAT master:
|
||||
|
||||
```bash
|
||||
# systemctl start ethercat # For systemd based distro
|
||||
# /etc/init.d/ethercat start # For init.d based distro
|
||||
/etc/init.d/ethercat start
|
||||
```
|
||||
|
||||
Have a look at the [examples subdirectory](examples/) for some application
|
||||
|
|
|
|||
19
Kbuild.in
19
Kbuild.in
|
|
@ -1,4 +1,6 @@
|
|||
#-----------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
#
|
||||
|
|
@ -17,9 +19,15 @@
|
|||
# with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# ---
|
||||
#
|
||||
# The license mentioned above concerns the source code only. Using the
|
||||
# EtherCAT technology and brand is only permitted in compliance with the
|
||||
# industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
#
|
||||
# vi: syntax=make
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
obj-m := examples/ master/ devices/
|
||||
|
||||
|
|
@ -27,9 +35,4 @@ ifeq (@ENABLE_TTY@,1)
|
|||
obj-m += tty/
|
||||
endif
|
||||
|
||||
ifeq (@ENABLE_RTAI@, 1)
|
||||
KBUILD_EXTRA_SYMBOLS := \
|
||||
@RTAI_MODULE_DIR@/Module.symvers
|
||||
endif
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
|
|
|
|||
12
Makefile.am
12
Makefile.am
|
|
@ -17,6 +17,12 @@
|
|||
# with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# ---
|
||||
#
|
||||
# The license mentioned above concerns the source code only. Using the
|
||||
# EtherCAT technology and brand is only permitted in compliance with the
|
||||
# industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
include $(top_srcdir)/Makefile.kbuild
|
||||
|
|
@ -24,6 +30,7 @@ include $(top_srcdir)/Makefile.kbuild
|
|||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
AM_DISTCHECK_CONFIGURE_FLAGS = \
|
||||
--disable-8139too \
|
||||
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
|
||||
|
||||
SUBDIRS = \
|
||||
|
|
@ -47,11 +54,6 @@ SUBDIRS += \
|
|||
examples
|
||||
endif
|
||||
|
||||
if ENABLE_FAKEUSERLIB
|
||||
SUBDIRS += \
|
||||
fake_lib
|
||||
endif
|
||||
|
||||
if ENABLE_TTY
|
||||
SUBDIRS += tty
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# ```
|
||||
# include $(top_srcdir)/Makefile.kbuild
|
||||
# ```
|
||||
KBUILD = $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(abs_builddir)" INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)"
|
||||
KBUILD = $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(abs_srcdir)" INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)"
|
||||
|
||||
|
||||
modules:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,441 @@
|
|||
-------------------------------------------------------------------------------
|
||||
|
||||
vim: spelllang=en spell tw=78
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes in 1.5.3:
|
||||
|
||||
* Added the ecrt_slave_config_flag() to the application interface.
|
||||
* Added SoE IDN requests in application interface.
|
||||
* Fixed FoE timeout calculation bug.
|
||||
|
||||
Changes in 1.5.2:
|
||||
|
||||
* API extensions (find the complete description in include/ecrt.h)
|
||||
* Added redundancy features; enable using --with-devices.
|
||||
* Re-designed and seamlessly integrated RTDM interface.
|
||||
* Added ecrt_sdo_request_index() method to change index and subindex.
|
||||
* Changed the data types of the shift times in ecrt_slave_config_dc()
|
||||
to int32_t to correctly display negative shift times.
|
||||
* Added API for querying CoE emergency requests.
|
||||
* Added interface to read/write register contents; re-worked register
|
||||
requests.
|
||||
* Added interface to select the reference clock and to sync to it.
|
||||
* Exported ecrt_domain_size() to userspace.
|
||||
* Added ecrt_slave_config_reg_so_entry_pos() to register non-unique
|
||||
PDO entries.
|
||||
* Ethernet drivers
|
||||
* Added 8139too driver for 3.0, 3.2, 3.4.
|
||||
* Added r8169 driver for 2.6.36 (J. Kunz), 3.2 (J. Kunz), 3.4 (F. Pose).
|
||||
* Added e1000 driver for 3.0, 3.4.
|
||||
* Added e1000e driver for 3.2 (J. Kunz), 3.4 (F. Pose).
|
||||
* Added e100 driver for 3.0, 3.4.
|
||||
* Fixes regarding 8139too driver for 2.6.36.
|
||||
* Some fixes for all e1000 and e1000e drivers.
|
||||
* General behaviour
|
||||
* Avoided semaphore locking from userspace/rtdm library: Implemented
|
||||
datagram ring instead of queue.
|
||||
* Assign SII to PDI during PREOP transition; Introduced
|
||||
--enable-sii-assign to switch this on.
|
||||
* Avoided re-allocating memory in userspace library implementations of
|
||||
ecrt_sdo_request_state() and in VoE handlers.
|
||||
* Send sync datagrams only if reference clock is found.
|
||||
* Adjusted some DC clock discipline parameters.
|
||||
* Fixed AL status code lookup.
|
||||
* Fixed some ioctl() return values and permissions.
|
||||
* Fixed FoE data OpCode, thanks to R. Roesch.
|
||||
* Fixed and improved cancelling requests when clearing configuration.
|
||||
* Using common wait queue for requests.
|
||||
* Removed some unnecessary request types.
|
||||
* Output slave FSM datagram statistics.
|
||||
* Removed some state-dependent datagram skip messages.
|
||||
* Immediately restart slave FSM on several failed requests.
|
||||
* Reset master state machine when going to orphaned phase.
|
||||
* Command-line tool:
|
||||
* Show complete access flag in config view.
|
||||
* Added EtherLab skin for 'ethercat pdos' command.
|
||||
* Fixed 'String too large' bug.
|
||||
* Infrastructure:
|
||||
* Added AM_PROG_AR necessary for autoconf 1.12.
|
||||
* Avoided use of AM_CFLAGS, which is not used in some situations.
|
||||
* Added vmalloc() include fix for ARM architecture, thanks to Andrea
|
||||
Scian.
|
||||
* Install ethercat service to multi-user target by default.
|
||||
* Fixed COPYING.LESSER to be LGPL 2.1 (like in file headers).
|
||||
* More detailed output of configure script.
|
||||
* Added rtai_rtdm_dc example, thanks to Graeme Foot.
|
||||
|
||||
Changes in 1.5.1:
|
||||
|
||||
* Fixed reset of allow_scanning flag if ecrt_master_activate() was not called.
|
||||
* Fixed missing distribution for r8169 for 2.6.32 and e1000 driver for 2.6.31.
|
||||
* Added e100 for 2.6.35.
|
||||
* Added r8169 driver for 2.6.35 (F. Pose).
|
||||
* Added e1000e driver for 2.6.35 (F. Pose).
|
||||
* Added fix for ESC port order (DC delay calculation).
|
||||
* Added e1000 driver for 2.6.35.
|
||||
|
||||
Changes in 1.5.0:
|
||||
|
||||
* Added a userspace library for accessing the application interface. This
|
||||
library is licensed under LGPLv2.
|
||||
* Added distributed clocks support.
|
||||
* Added watchdog configuration via application interface (thanks to J. Mohre).
|
||||
* Added VoE mailbox protocol support.
|
||||
* Added SoE mailbox protocol support.
|
||||
* Improved the callback mechanism. ecrt_master_callbacks() now takes two
|
||||
callback functions for sending and receiving datagrams.
|
||||
ecrt_master_send_ext() is used to execute the sending of non-application
|
||||
datagrams.
|
||||
* Separated datagram initialization from filling the payload with zeros.
|
||||
Introduced new method ec_datagram_zero() for that.
|
||||
* Added phy_read and phy_write commands to ethercat tool.
|
||||
* Added e100 driver for Intel PRO/100 NICs.
|
||||
- Added e100 driver for 2.6.27.
|
||||
- Added e100 driver for 2.6.28, thanks to Kim. H. Madsen.
|
||||
- Added e100 driver for 2.6.29, thanks to Andre Puschmann.
|
||||
- Added e100 driver for 2.6.31.
|
||||
- Added e100 driver for 2.6.32.
|
||||
- Added e100 driver for 2.6.33, thanks to J. Kunz.
|
||||
- Added e100 driver for 2.6.37.
|
||||
* Added 8139too driver for kernels 2.6.25 (F. Pose), 2.6.26 (M. Luescher),
|
||||
2.6.27, 2.6.28, 2.6.29 (M. Goetze), 2.6.31 (F. Pose), 2.6.32 (F. Pose),
|
||||
2.6.33 (J. Kunz), 2.6.34 (Malcolm Lewis), 2.6.35 (B. Benner),
|
||||
2.6.36 (F. Pose) and 2.6.37 (F. Pose).
|
||||
* Added e1000 driver for 2.6.26 (M. Luescher), 2.6.27, 2.6.28, 2.6.29, 2.6.32,
|
||||
2.6.33 (J. Kunz), 2.6.35, 2.6.37.
|
||||
* Added r8169 driver for 2.6.24, 2.6.27, 2.6.28, 2.6.29, 2.6.31, 2.6.32
|
||||
(Robbie K), 2.6.33 (J. Kunz), 2.6.35, 2.6.37.
|
||||
* Added e1000e driver for 2.6.32, 2.6.33, 2.6.34 (thanks to Siwei Zhuang).
|
||||
* Debug interfaces are created with the Ethernet addresses of the attached
|
||||
physical device.
|
||||
* Improved error case return codes of many functions.
|
||||
* Implemented the File Access over EtherCAT (FoE) mailbox protocol, thanks to
|
||||
O. Zarges.
|
||||
* Going to the Bootstrap state is now supported by the state machines and the
|
||||
command-line tool.
|
||||
* Added ecrt_open_master() and ecrt_master_reserve() separation for
|
||||
the userspace library (thanks to Martin Troxler).
|
||||
* Added bus information interface (methods ecrt_master(),
|
||||
ecrt_master_get_slave(), ecrt_master_get_sync_manager(),
|
||||
ecrt_master_get_pdo() and ecrt_master_get_pdo_entry()) to get information
|
||||
about the currently connected slaves and the PDO entries provided (thanks to
|
||||
Martin Troxler and Stefan Weiser).
|
||||
* Added ecrt_master_sdo_download() and ecrt_master_sdo_upload()
|
||||
methods to let an application transfer SDOs before activating the master
|
||||
(thanks to Stefan Weiser).
|
||||
* Fixed SDO upload segment response (thanks to Christoph Peter).
|
||||
* Fixed SDO upload segment response for 10 bytes mailbox length (thanks to
|
||||
Joerg Mohre).
|
||||
* SDO entry access rights are shown in 'ethercat sdos'.
|
||||
* Added 64-bit data access macros to application header.
|
||||
* Added debug level for all masters as a module parameter. Thanks to Erwin
|
||||
Burgstaller.
|
||||
* Clear slave list on link down.
|
||||
* Output device link state in 'ethercat master'.
|
||||
* Added 'ethercat graph' command which outputs the bus topology in
|
||||
DOT language.
|
||||
* Changed EC_MAX_SII_SIZE to 4096.
|
||||
* 'ethercat xml' creates valid XML <EtherCATInfoList> for more than one slave
|
||||
(thanks to E. Burgstaller).
|
||||
* Added 'ethercat eoe' command to display Ethernet over EtherCAT statistics.
|
||||
* Added 'ethercat cstruct' command to output PDO information in C language.
|
||||
* Significantly improved EoE bandwidth by running EoE processing in a kthread.
|
||||
* Switched version control from Subversion to Mercurial.
|
||||
* Implemented CompleteAccess for SDO downloads.
|
||||
* ethercat tool is now able to handle multiple masters. The --masters option
|
||||
supports ranges like '0,3,8-10'.
|
||||
* A sync manager is always enabled, if it contains registered process data.
|
||||
* Added a configuration switch --enable-wildcards to use 0xffffffff as a
|
||||
wildcard for vendor ID and product code.
|
||||
* Added support for systemd.
|
||||
|
||||
Changes in 1.4.0:
|
||||
|
||||
* Fixed race condition in jiffy-based frame timeout calculation.
|
||||
* Fixed race condition concerning the ec_slave_config_state->operational flag.
|
||||
* Fixed wrong calculation of the expected working counter if the process data
|
||||
of a domain span several datagrams.
|
||||
* Fixed a kernel oops when a slave configuration is detached while the actual
|
||||
configuration is in progress.
|
||||
* Fixed typo in logging output.
|
||||
* Removed 'bashisms' from init script ('function' keyword).
|
||||
* Fixed bug in e1000 drivers. Memory was allocated when sending the first
|
||||
frame.
|
||||
* Modified licence headers to avoid conflicts with the GPL.
|
||||
* Restricted licence to GPLv2 only.
|
||||
* Fixed spelling of 'PDO', 'SDO' (all uppercase) and 'xx over EtherCAT'
|
||||
(without hyphens).
|
||||
|
||||
Changes in 1.4.0-rc3:
|
||||
|
||||
* Ported the master thread to the kthread interface.
|
||||
* Added missing semaphore up() in an ioctl(). In rare cases, the master
|
||||
semaphore was not released.
|
||||
* Minor fix in 'slaves' command that fixed duplicate display of supported
|
||||
mailbox protocols.
|
||||
* The SDO Information Service is only queried, if the slave has the
|
||||
corresponding SII bit set.
|
||||
* Added some missing header files in the command-line-tool code.
|
||||
* Removed unstable e100, forcedeth, and r8169 drivers.
|
||||
|
||||
Changes in version 1.4.0-rc2:
|
||||
|
||||
* Fixed a deadlock causing race condition concerning thread signaling when the
|
||||
master thread had no opportunity to run, but shall be killed immediately
|
||||
after creation.
|
||||
* Added missing up()s causing a semaphore being not released in some rare
|
||||
cases.
|
||||
* Minor fixes.
|
||||
* Removed some deprecated files.
|
||||
|
||||
Changes in version 1.4.0-rc1:
|
||||
|
||||
* Realtime interface changes:
|
||||
- Replaced ec_slave_t with ec_slave_config_t, separating the bus
|
||||
configuration from the actual slaves. Therefore, renamed
|
||||
ecrt_master_get_slave() to ecrt_master_slave_config().
|
||||
- Replaced slave address string with alias and position values. See
|
||||
ecrt_master_slave_config().
|
||||
- Removed ecrt_master_get_slave_by_pos(), because it is no longer
|
||||
necessary due to alias/position addressing.
|
||||
- Added ec_slave_config_state_t for the new method
|
||||
ecrt_slave_config_state().
|
||||
- Process data memory for a domain can now be allocated externally. This
|
||||
offers the possibility to use a shared-memory region. Therefore,
|
||||
added the domain methods ecrt_domain_size() and
|
||||
ecrt_domain_external_memory().
|
||||
- PDO entry registration functions do not return a process data pointer,
|
||||
but an offset in the domain's process data. In addition, an optional bit
|
||||
position can be requested. This was necessary for the external domain
|
||||
memory. An additional advantage is, that the returned offset is
|
||||
immediately valid. If the domain's process data is allocated internally,
|
||||
the start address can be retrieved with ecrt_domain_data().
|
||||
- Replaced ecrt_slave_pdo_mapping/add/clear() with
|
||||
ecrt_slave_config_pdo_assign_add() to add a PDO to a sync manager's PDO
|
||||
assignment and ecrt_slave_config_pdo_mapping_add() to add a PDO entry to a
|
||||
PDO's mapping. ecrt_slave_config_pdos() is a convenience function
|
||||
for both, that uses the new data types ec_pdo_info_t and
|
||||
ec_pdo_entry_info_t. PDO entries, that are mapped with these functions
|
||||
can now immediately be registered, even if the bus is offline.
|
||||
- Renamed ec_bus_status_t, ec_master_status_t to ec_bus_state_t and
|
||||
ec_master_state_t, respectively. Renamed ecrt_master_get_status() to
|
||||
ecrt_master_state(), for consistency reasons.
|
||||
- Added ec_domain_state_t and ec_wc_state_t for a new output parameter
|
||||
of ecrt_domain_state(). The domain state object does now contain
|
||||
information, if the process data was exchanged completely.
|
||||
- Former "PDO registration" meant PDO entry registration in fact, therefore
|
||||
renamed ec_pdo_reg_t to ec_pdo_entry_reg_t and ecrt_domain_register_pdo()
|
||||
to ecrt_slave_config_reg_pdo_entry().
|
||||
- Removed ecrt_domain_register_pdo_range(), because it's functionality can
|
||||
be reached by specifying an explicit PDO assignment/mapping and
|
||||
registering the mapped PDO entries.
|
||||
- Added an SDO access interface, working with SDO requests. These can be
|
||||
scheduled for reading and writing during realtime operation.
|
||||
- Exported ecrt_slave_config_sdo(), the generic SDO configuration function.
|
||||
- Removed the bus_state and bus_tainted flags from ec_master_state_t.
|
||||
* Device interface changes:
|
||||
- Moved device output parameter of ecdev_offer() to return value.
|
||||
* Replaced the Sysfs interface with a new 'ethercat' command-line tool, that
|
||||
communicates with the master via a character device and ioctls. The device
|
||||
is created via udev. The tool is able to
|
||||
- Write alias addresses.
|
||||
- Show the bus configuration.
|
||||
- Output binary domain process data.
|
||||
- Set the master's debug level.
|
||||
- Show domain information.
|
||||
- Show master information.
|
||||
- List PDO assignment/mapping.
|
||||
- Write an SDO entry.
|
||||
- List SDO dictionaries.
|
||||
- Read an SDO entry.
|
||||
- Output a slave's SII contents.
|
||||
- Write slave's SII contents.
|
||||
- Show slaves.
|
||||
- Request slave states.
|
||||
- Generate slave information xmls.
|
||||
* Removed include/ecdb.h.
|
||||
* Using the timestamp counter is now optional (configure --enable-cycles),
|
||||
because it is only available on Intel architectures.
|
||||
* SDO dictionaries will now also be fetched in operation mode.
|
||||
* SII write requests will now also be processed in operation mode.
|
||||
* Mapping of PDO entries is now supported.
|
||||
* Current PDO assignment/mapping is now read via CoE during bus scan, using
|
||||
direct SDO access, independent of the dictionary.
|
||||
* Network driver news:
|
||||
- Added 8139too driver for kernel 2.6.22, thanks to Erwin Burgstaller.
|
||||
- Added 8139too driver for kernel 2.6.23, thanks to Richard Hacker.
|
||||
- Added 8139too driver for kernel 2.6.24.
|
||||
- Added e1000 driver for kernel 2.6.22.
|
||||
- Added e1000 driver for kernel 2.6.24, thanks to Matthias Luescher.
|
||||
- Added alpha support for the Realtek r8169 chipset, thanks to Scott
|
||||
Hassan.
|
||||
- Fixed unnecessary watchdog executions in e1000 drivers (thanks to
|
||||
Olav Zarges).
|
||||
- Fixed missing protection for a spin_lock_irqrestore() call in e1000
|
||||
drivers from 2.6.20 to 2.6.24 (thanks to Olav Zarges).
|
||||
* Removed the "bus validation" routines. Slave scanning is now done any time
|
||||
the bus topology changes, even during realtime operation. Because of this,
|
||||
the bus_tainted flag was deprecated and removed.
|
||||
* Slave configuration is not done during ecrt_master_activate() any more, but
|
||||
later during realtime operation. The state of the configuration can be
|
||||
queried via the ecrt_domain_state() and ecrt_slave_config_state() functions.
|
||||
* Added support for slaves that do not support the LRW datagram type. Separate
|
||||
domains have to be used for inputs and output.
|
||||
* CoE implementation:
|
||||
- Use expedites transfer type for SDOs <= 4 byte (thanks to J. Mohre).
|
||||
- Allow gaps in PDO mapping (thanks to R. Roesch).
|
||||
- Added some transfer timeouts.
|
||||
- Asynchronous handling of Emergency requests.
|
||||
- Bug fixes.
|
||||
* Sync managers are disabled, if the size is zero.
|
||||
* Renamed ec_master module parameters main and backup to main_devices and
|
||||
backup_devices to avoid warnings of some compilers.
|
||||
* List end evaluate CoE detail flags from general category.
|
||||
* Added MODPROBE_FLAGS variable in start script and sysconfig file.
|
||||
* Implemented missing datagram types.
|
||||
* Changed all occurrences of 'EEPROM' to 'SII'
|
||||
* Allow multiple sync manager categories in SII.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes in version 1.3.2:
|
||||
|
||||
* New feature: Read dynamic PDO mapping from SDO dictionary.
|
||||
* Implemented SII writing workaround for some broken slaves.
|
||||
* Improved handling for spontaneous AL state changes.
|
||||
* Master takes mailbox sync manager configurations from EEPROM words
|
||||
0x0018-0x001b, if no sync manager configurations are provided.
|
||||
* Calculate checksum when writing EEPROM or alias address.
|
||||
* Fixed source MAC address setting bug.
|
||||
* Removed config.kbuild and replaced Kbuild files by Kbuild.in files.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes in version 1.3.1:
|
||||
|
||||
* Improved EoE handling: Avoided skipping of datagrams and release lock
|
||||
while processing.
|
||||
* Added some statistics to the datagram structure.
|
||||
* Master state machine clears all station addresses with a broadcast datagram
|
||||
before setting them.
|
||||
* Added --enable-eoe conditional.
|
||||
* Minor extensions of the master info file.
|
||||
* Improved handling of unexpected working counters.
|
||||
* Create network interfaces for EoE devices with alias as eoeXaY.
|
||||
* Fixed problems on big-endian systems.
|
||||
* Added documentation on how to set up an EoE network.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes in version 1.3.0:
|
||||
|
||||
* Added Intel PRO/1000 Gigabit Ethernet driver (e1000).
|
||||
* Added testing version of Intel PRO/100 Ethernet driver (e100).
|
||||
* Added testing version of NVIDIA nForce Ethernet driver (forcedeth).
|
||||
* Removed "ec_eoeif_count" master module parameter. EoE handlers are created
|
||||
dynamically instead.
|
||||
* Added "main" and "backup" parameters to master module to hand over the
|
||||
MAC addresses of the devices to wait for. This made the ec_device_index
|
||||
parameter of the Ethernet drivers obsolete. The broadcast MAC address means,
|
||||
that the master accepts the first device offered by any Ethernet driver.
|
||||
* Changed format of sysconfig file and accordingly adjusted functionality
|
||||
of the init script to handle the above MAC address lists.
|
||||
* Realtime interface changes:
|
||||
- ecrt_master_run() became obsolete, because the master state machine is now
|
||||
run in process context.
|
||||
- Parameter changes in PDO registration functions ecrt_domain_register_pdo()
|
||||
and ecrt_register_pdo_range(): Replaced slave_address, vendor ID and
|
||||
product code arguments with a slave pointer, which has to be obtained with
|
||||
a prior call to ecrt_master_get_slave().
|
||||
- ecrt_master_get_slave() got additional parameters to check for vendor ID
|
||||
and product code.
|
||||
- Removed addressing scheme "X:Y" for ecrt_master_get_slave().
|
||||
- Added ecrt_master_get_slave_by_pos() to avoid the string handling of
|
||||
ecrt_master_get_slave().
|
||||
- Added ecrt_master_get_status() to get status information about the bus.
|
||||
- Added functions to set up an alternative PDO mapping for a slave, i. e.
|
||||
ec_slave_pdo_mapping_clear(), ec_slave_pdo_mapping_add() and
|
||||
ec_slave_pdo_mapping().
|
||||
* Device interface changes:
|
||||
- Replaced ecdev_register() and ecdev_unregister() with ecdev_offer() and
|
||||
ecdev_withdraw(), respectively. The device modules now offer all their
|
||||
devices to the master. The master then decides, which ones to register.
|
||||
- Replaced ecdev_link_state() with ecdev_set_link(); added ecdev_get_link().
|
||||
* All EEPROM write operations from user space are now blocking until
|
||||
writing has finished. Appropriate error codes are returned.
|
||||
* Implemented setting of the "Secondary slave address" (alias) via sysfs.
|
||||
* Implemented SDO reading in operation mode via sysfs.
|
||||
* Removed annoying eeprom_write_enable file. EEPROM writing always enabled.
|
||||
* Slave configuration is now done exclusively from the master thread. Removed
|
||||
ec_master_sync_io(). Userspace threads are now waiting for events in the
|
||||
state machine.
|
||||
* Master state machine scheduled with timeout if idle, otherwise is executed
|
||||
as fast as possible (with schedule()).
|
||||
* Added dummy module for simulation purposes.
|
||||
* Limited infinite EEPROM reading, if 0xffff limiter word is missing.
|
||||
* Init script works now properly on non-SUSE distros (no rc.status dependency
|
||||
any more).
|
||||
* Removed EtherCAT line comments from 8139too drivers.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes in version 1.2.0:
|
||||
|
||||
* Several fixes of bugs and stability issues. Master should now run fine
|
||||
with kernels 2.6.17 to 2.6.19.
|
||||
* Realtime interface changes:
|
||||
- Re-introduced ecrt_domain_queue() to allow datagram queuing apart
|
||||
from datagram processing. The queuing of a domain's datagrams is not
|
||||
done in ecrt_domain_process() any more!
|
||||
- Removed ecrt_master_deactivate(). Its functionality was moved into
|
||||
ecrt_master_release().
|
||||
- Removed ecrt_master_prepare(). Its functionality was moved into
|
||||
ecrt_master_activate().
|
||||
- Renamed ecdev_start() and ecdev_stop() to ecdev_open() and ecdev_close().
|
||||
These two functions now take a pointer to ec_device_t as their arguments.
|
||||
- The data_ptr parameter of ecrt_domain_register_pdo(),
|
||||
ecrt_domain_register_pdo_list() and ecrt_domain_register_pdo_range() may
|
||||
not be NULL any more.
|
||||
- Removed ecrt_slave_pdo_size(). This function was deprecated long before.
|
||||
- Introduced ECRT_VERSION_MAGIC macro and ecrt_version_magic() function.
|
||||
* Device interface changes:
|
||||
- ec_isr_t was replaced by ec_pollfunc_t, the device driver has to supply
|
||||
a poll function to call its ISR. This was introduced because some network
|
||||
drivers' interrupt functions have different arguments.
|
||||
* State machines now try to re-send datagrams on datagram timeout.
|
||||
* New option -c of the lsec script, displays slave current consumptions and
|
||||
remaining current.
|
||||
* Added frame counter in master info file.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes in version 1.1.1:
|
||||
|
||||
* State change FSM: Clearing of sync managers before PREOP.
|
||||
* Added modules_install make target.
|
||||
* Device modules for kernel 2.6.17.
|
||||
* SDO configurations available in Sysfs.
|
||||
* FMMU configurations cleared when going to INIT.
|
||||
* Slave-specific logs only at debug level 1 (for large buses).
|
||||
* Slave flags (error, online) available in Sysfs.
|
||||
* Acknowledging of spontaneous state changes in master FSMs.
|
||||
* ecrt_master_deactivate() deprecated.
|
||||
* Persistent slave lists. Slave structures are only regenerated on topology
|
||||
change in IDLE mode.
|
||||
* SDO reading via Sysfs.
|
||||
* Added ecrt_domain_register_pdo_range()
|
||||
* Fetching of SDO dictionary.
|
||||
* Better timing behaviour when starting up under high CPU load.
|
||||
* Applied Autotools.
|
||||
* Improved output of lsec.
|
||||
* SDO download state machine.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes in version 1.1:
|
||||
|
||||
* Improved realtime interface.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
505
NEWS.md
505
NEWS.md
|
|
@ -1,505 +0,0 @@
|
|||
# Version 1.6.9
|
||||
|
||||
- Protect datagram injection mechanism against re-ordering.
|
||||
- Fixed for genet and igb drivers for openSUSE Leap 16.0 kernel 6.12.
|
||||
- tty: Implemented new timer interface since kernel 6.15.
|
||||
- Do not require .config to exist in kernel sources.
|
||||
- Fix: Attach slaves before calculating DCs.
|
||||
- Discard EoE traffic in CoE statemachine, if EoE is disabled.
|
||||
- Support for Linux 6.19
|
||||
- Added `--with-kmod-dir` and `--with-ip-cmd` configuration switches
|
||||
to specify the paths of the tools used in the `ethercatctl` script.
|
||||
- Changed the default path of the `ip` command to `/sbin/ip`.
|
||||
|
||||
# Version 1.6.8
|
||||
|
||||
- Fixed usage of `FAKE_EC_HOMEDIR` variable in fake library.
|
||||
|
||||
# Version 1.6.7
|
||||
|
||||
- Completed API methods in fake library
|
||||
- Fix igb for openSUSE 15.6 (kernel 6.4)
|
||||
|
||||
# Version 1.6.6
|
||||
|
||||
- Added Ethernet drivers for kernels 6.4 and 6.12.
|
||||
- Added missing functions to fake user library.
|
||||
- Use sint(32) notation in EtherLab output driver
|
||||
- Added CONTRIBUTING.md
|
||||
|
||||
# Version 1.6.5
|
||||
|
||||
- Implemented interface changes of Linux 6.15.
|
||||
|
||||
# Version 1.6.4
|
||||
|
||||
- igc: Set RX descriptor write-back threshold to 1
|
||||
- Avoid rescan on non-responding slave
|
||||
- Do not touch AL state of EoE slaves
|
||||
- Warn if `FAKE_EC_NAME` is not set
|
||||
- Added configuration switch to disable init.d files
|
||||
- Fixed FakeEtherCAT operation with multiple masters
|
||||
- Add `UPDOWN_INTERFACES` option to `ethercat.conf`
|
||||
- Improvements to the build system
|
||||
- Fix obsolete warnings on bootstrap
|
||||
- Explicitly check for pkg-config macros
|
||||
- Many documentation improvements (thanks to Nicola Fontana)
|
||||
|
||||
# Version 1.6.3
|
||||
|
||||
- Fix ccat for aarch64 >= 6.11.0
|
||||
- Removed domain information from libfakeethercat RtIPC paths
|
||||
- Remove unnecessary inline statement causing build `-O0` problems
|
||||
- Fixed some compiler warnings
|
||||
- Added static keywords to internal functions
|
||||
|
||||
# Version 1.6.2
|
||||
|
||||
- Fixed typo in bash completion.
|
||||
- Directly include `soe_error_codes` into `SoeCommand.cpp`
|
||||
- Fixed check of non-zero bit offset in libfakeethercat
|
||||
|
||||
# Version 1.6.1
|
||||
|
||||
- Added libfakeethercat to simulate Process Data of EtherCAT Slaves.
|
||||
|
||||
# Version 1.6.0
|
||||
|
||||
- Added all native Ethernet drivers for kernels 5.14 and 6.1.
|
||||
- Dropped support for kernels < 3.0.
|
||||
- Allow to query the scanning progress via API.
|
||||
- Added EoE set IP command via command-line-tool.
|
||||
- Changed the default AL state change timeout from 5 to 10 s.
|
||||
|
||||
# Back-ports since version 1.5.2
|
||||
|
||||
- Added feature flag API.
|
||||
- Fixed FoE timeout calculation bug.
|
||||
|
||||
# Version 1.5.2
|
||||
|
||||
- API extensions (find the complete description in `include/ecrt.h`)
|
||||
- Added redundancy features; enable using `--with-devices`.
|
||||
- Re-designed and seamlessly integrated RTDM interface.
|
||||
- Added `ecrt_sdo_request_index()` method to change index and subindex.
|
||||
- Changed the data types of the shift times in `ecrt_slave_config_dc()`
|
||||
to `int32_t` to correctly display negative shift times.
|
||||
- Added API for querying CoE emergency requests.
|
||||
- Added interface to read/write register contents; re-worked register
|
||||
requests.
|
||||
- Added interface to select the reference clock and to sync to it.
|
||||
- Exported `ecrt_domain_size()` to userspace.
|
||||
- Added `ecrt_slave_config_reg_so_entry_pos()` to register non-unique
|
||||
PDO entries.
|
||||
- Ethernet drivers
|
||||
- Added 8139too driver for 3.0, 3.2, 3.4.
|
||||
- Added r8169 driver for 2.6.36 (J. Kunz), 3.2 (J. Kunz), 3.4 (F. Pose).
|
||||
- Added e1000 driver for 3.0, 3.4.
|
||||
- Added e1000e driver for 3.2 (J. Kunz), 3.4 (F. Pose).
|
||||
- Added e100 driver for 3.0, 3.4.
|
||||
- Fixes regarding 8139too driver for 2.6.36.
|
||||
- Some fixes for all e1000 and e1000e drivers.
|
||||
- General behaviour
|
||||
- Avoided semaphore locking from userspace/rtdm library: Implemented
|
||||
datagram ring instead of queue.
|
||||
- Assign SII to PDI during PREOP transition; Introduced
|
||||
`--enable-sii-assign` to switch this on.
|
||||
- Avoided re-allocating memory in userspace library implementations of
|
||||
`ecrt_sdo_request_state()` and in VoE handlers.
|
||||
- Send sync datagrams only if reference clock is found.
|
||||
- Adjusted some DC clock discipline parameters.
|
||||
- Fixed AL status code lookup.
|
||||
- Fixed some `ioctl()` return values and permissions.
|
||||
- Fixed FoE data OpCode, thanks to R. Roesch.
|
||||
- Fixed and improved cancelling requests when clearing configuration.
|
||||
- Using common wait queue for requests.
|
||||
- Removed some unnecessary request types.
|
||||
- Output slave FSM datagram statistics.
|
||||
- Removed some state-dependent datagram skip messages.
|
||||
- Immediately restart slave FSM on several failed requests.
|
||||
- Reset master state machine when going to orphaned phase.
|
||||
- Command-line tool:
|
||||
- Show complete access flag in config view.
|
||||
- Added EtherLab skin for `ethercat pdos` command.
|
||||
- Fixed 'String too large' bug.
|
||||
- Infrastructure:
|
||||
- Added `AM_PROG_AR` necessary for autoconf 1.12.
|
||||
- Avoided use of `AM_CFLAGS`, which is not used in some situations.
|
||||
- Added vmalloc() include fix for ARM architecture, thanks to Andrea
|
||||
Scian.
|
||||
- Install ethercat service to multi-user target by default.
|
||||
- Fixed COPYING.LESSER to be LGPL 2.1 (like in file headers).
|
||||
- More detailed output of configure script.
|
||||
- Added `rtai_rtdm_dc` example, thanks to Graeme Foot.
|
||||
|
||||
# Version 1.5.1
|
||||
|
||||
- Fixed reset of `allow_scanning` flag if `ecrt_master_activate()` was not
|
||||
called.
|
||||
- Fixed missing distribution for r8169 for 2.6.32 and e1000 driver for 2.6.31.
|
||||
- Added e100 for 2.6.35.
|
||||
- Added r8169 driver for 2.6.35 (F. Pose).
|
||||
- Added e1000e driver for 2.6.35 (F. Pose).
|
||||
- Added fix for ESC port order (DC delay calculation).
|
||||
- Added e1000 driver for 2.6.35.
|
||||
|
||||
# Version 1.5.0
|
||||
|
||||
- Added a userspace library for accessing the application interface. This
|
||||
library is licensed under LGPLv2.
|
||||
- Added distributed clocks support.
|
||||
- Added watchdog configuration via application interface (thanks to J. Mohre).
|
||||
- Added VoE mailbox protocol support.
|
||||
- Added SoE mailbox protocol support.
|
||||
- Improved the callback mechanism. `ecrt_master_callbacks()` now takes two
|
||||
callback functions for sending and receiving datagrams.
|
||||
`ecrt_master_send_ext()` is used to execute the sending of non-application
|
||||
datagrams.
|
||||
- Separated datagram initialization from filling the payload with zeros.
|
||||
Introduced new method `ec_datagram_zero()` for that.
|
||||
- Added `phy_read` and `phy_write` commands to `ethercat` tool.
|
||||
- Added e100 driver for Intel PRO/100 NICs.
|
||||
- Added e100 driver for 2.6.27.
|
||||
- Added e100 driver for 2.6.28, thanks to Kim. H. Madsen.
|
||||
- Added e100 driver for 2.6.29, thanks to Andre Puschmann.
|
||||
- Added e100 driver for 2.6.31.
|
||||
- Added e100 driver for 2.6.32.
|
||||
- Added e100 driver for 2.6.33, thanks to J. Kunz.
|
||||
- Added e100 driver for 2.6.37.
|
||||
- Added 8139too driver for kernels 2.6.25 (F. Pose), 2.6.26 (M. Luescher),
|
||||
2.6.27, 2.6.28, 2.6.29 (M. Goetze), 2.6.31 (F. Pose), 2.6.32 (F. Pose),
|
||||
2.6.33 (J. Kunz), 2.6.34 (Malcolm Lewis), 2.6.35 (B. Benner),
|
||||
2.6.36 (F. Pose) and 2.6.37 (F. Pose).
|
||||
- Added e1000 driver for 2.6.26 (M. Luescher), 2.6.27, 2.6.28, 2.6.29, 2.6.32,
|
||||
2.6.33 (J. Kunz), 2.6.35, 2.6.37.
|
||||
- Added r8169 driver for 2.6.24, 2.6.27, 2.6.28, 2.6.29, 2.6.31, 2.6.32
|
||||
(Robbie K), 2.6.33 (J. Kunz), 2.6.35, 2.6.37.
|
||||
- Added e1000e driver for 2.6.32, 2.6.33, 2.6.34 (thanks to Siwei Zhuang).
|
||||
- Debug interfaces are created with the Ethernet addresses of the attached
|
||||
physical device.
|
||||
- Improved error case return codes of many functions.
|
||||
- Implemented the File Access over EtherCAT (FoE) mailbox protocol, thanks to
|
||||
O. Zarges.
|
||||
- Going to the Bootstrap state is now supported by the state machines and the
|
||||
command-line tool.
|
||||
- Added `ecrt_open_master()` and `ecrt_master_reserve()` separation for
|
||||
the userspace library (thanks to Martin Troxler).
|
||||
- Added bus information interface (methods `ecrt_master()`,
|
||||
`ecrt_master_get_slave()`, `ecrt_master_get_sync_manager()`,
|
||||
`ecrt_master_get_pdo()` and `ecrt_master_get_pdo_entry()`) to get
|
||||
information about the currently connected slaves and the PDO entries
|
||||
provided (thanks to Martin Troxler and Stefan Weiser).
|
||||
- Added `ecrt_master_sdo_download()` and `ecrt_master_sdo_upload()`
|
||||
methods to let an application transfer SDOs before activating the master
|
||||
(thanks to Stefan Weiser).
|
||||
- Fixed SDO upload segment response (thanks to Christoph Peter).
|
||||
- Fixed SDO upload segment response for 10 bytes mailbox length (thanks to
|
||||
Joerg Mohre).
|
||||
- SDO entry access rights are shown in `ethercat sdos`.
|
||||
- Added 64-bit data access macros to application header.
|
||||
- Added debug level for all masters as a module parameter. Thanks to Erwin
|
||||
Burgstaller.
|
||||
- Clear slave list on link down.
|
||||
- Output device link state in `ethercat master`.
|
||||
- Added `ethercat graph` command which outputs the bus topology in
|
||||
DOT language.
|
||||
- Changed `EC_MAX_SII_SIZE` to 4096.
|
||||
- `ethercat xml` creates valid XML <EtherCATInfoList> for more than one slave
|
||||
(thanks to E. Burgstaller).
|
||||
- Added `ethercat eoe` command to display Ethernet over EtherCAT statistics.
|
||||
- Added `ethercat cstruct` command to output PDO information in C language.
|
||||
- Significantly improved EoE bandwidth by running EoE processing in a kthread.
|
||||
- Switched version control from Subversion to Mercurial.
|
||||
- Implemented CompleteAccess for SDO downloads.
|
||||
- ethercat tool is now able to handle multiple masters. The `--masters` option
|
||||
supports ranges like `0,3,8-10`.
|
||||
- A sync manager is always enabled, if it contains registered process data.
|
||||
- Added a configuration switch `--enable-wildcards` to use `0xffffffff` as a
|
||||
wildcard for vendor ID and product code.
|
||||
- Added support for systemd.
|
||||
|
||||
# Version 1.4.0
|
||||
|
||||
- Fixed race condition in jiffy-based frame timeout calculation.
|
||||
- Fixed race condition concerning the `ec_slave_config_state->operational`
|
||||
flag.
|
||||
- Fixed wrong calculation of the expected working counter if the process data
|
||||
of a domain span several datagrams.
|
||||
- Fixed a kernel oops when a slave configuration is detached while the actual
|
||||
configuration is in progress.
|
||||
- Fixed typo in logging output.
|
||||
- Removed 'bashisms' from init script ('function' keyword).
|
||||
- Fixed bug in e1000 drivers. Memory was allocated when sending the first
|
||||
frame.
|
||||
- Modified licence headers to avoid conflicts with the GPL.
|
||||
- Restricted licence to GPLv2 only.
|
||||
- Fixed spelling of 'PDO', 'SDO' (all uppercase) and 'xx over EtherCAT'
|
||||
(without hyphens).
|
||||
|
||||
# Version 1.4.0-rc3
|
||||
|
||||
- Ported the master thread to the kthread interface.
|
||||
- Added missing semaphore `up()` in an `ioctl()`. In rare cases, the master
|
||||
semaphore was not released.
|
||||
- Minor fix in `slaves` command that fixed duplicate display of supported
|
||||
mailbox protocols.
|
||||
- The SDO Information Service is only queried, if the slave has the
|
||||
corresponding SII bit set.
|
||||
- Added some missing header files in the command-line-tool code.
|
||||
- Removed unstable e100, forcedeth, and r8169 drivers.
|
||||
|
||||
# Version 1.4.0-rc2
|
||||
|
||||
- Fixed a deadlock causing race condition concerning thread signaling when the
|
||||
master thread had no opportunity to run, but shall be killed immediately
|
||||
after creation.
|
||||
- Added missing `up()`s causing a semaphore being not released in some rare
|
||||
cases.
|
||||
- Minor fixes.
|
||||
- Removed some deprecated files.
|
||||
|
||||
# Version 1.4.0-rc1
|
||||
|
||||
- Realtime interface changes:
|
||||
- Replaced `ec_slave_t` with `ec_slave_config_t`, separating the bus
|
||||
configuration from the actual slaves. Therefore, renamed
|
||||
`ecrt_master_get_slave()` to `ecrt_master_slave_config()`.
|
||||
- Replaced slave address string with alias and position values. See
|
||||
`ecrt_master_slave_config()`.
|
||||
- Removed `ecrt_master_get_slave_by_pos()`, because it is no longer
|
||||
necessary due to alias/position addressing.
|
||||
- Added `ec_slave_config_state_t` for the new method
|
||||
`ecrt_slave_config_state()`.
|
||||
- Process data memory for a domain can now be allocated externally. This
|
||||
offers the possibility to use a shared-memory region. Therefore,
|
||||
added the domain methods `ecrt_domain_size()` and
|
||||
`ecrt_domain_external_memory()`.
|
||||
- PDO entry registration functions do not return a process data pointer,
|
||||
but an offset in the domain's process data. In addition, an optional bit
|
||||
position can be requested. This was necessary for the external domain
|
||||
memory. An additional advantage is, that the returned offset is
|
||||
immediately valid. If the domain's process data is allocated internally,
|
||||
the start address can be retrieved with `ecrt_domain_data()`.
|
||||
- Replaced `ecrt_slave_pdo_mapping/add/clear()` with
|
||||
`ecrt_slave_config_pdo_assign_add()` to add a PDO to a sync manager's
|
||||
PDO assignment and `ecrt_slave_config_pdo_mapping_add()` to add a PDO
|
||||
entry to a PDO's mapping. `ecrt_slave_config_pdos()` is a convenience
|
||||
function for both, that uses the new data types `ec_pdo_info_t` and
|
||||
`ec_pdo_entry_info_t`. PDO entries, that are mapped with these functions
|
||||
can now immediately be registered, even if the bus is offline.
|
||||
- Renamed `ec_bus_status_t`, `ec_master_status_t` to `ec_bus_state_t` and
|
||||
`ec_master_state_t`, respectively. Renamed `ecrt_master_get_status()` to
|
||||
`ecrt_master_state()`, for consistency reasons.
|
||||
- Added `ec_domain_state_t` and `ec_wc_state_t` for a new output parameter
|
||||
of `ecrt_domain_state()`. The domain state object does now contain
|
||||
information, if the process data was exchanged completely.
|
||||
- Former "PDO registration" meant PDO entry registration in fact, therefore
|
||||
renamed `ec_pdo_reg_t` to `ec_pdo_entry_reg_t` and
|
||||
`ecrt_domain_register_pdo()` to `ecrt_slave_config_reg_pdo_entry()`.
|
||||
- Removed `ecrt_domain_register_pdo_range()`, because it's functionality
|
||||
can be reached by specifying an explicit PDO assignment/mapping and
|
||||
registering the mapped PDO entries.
|
||||
- Added an SDO access interface, working with SDO requests. These can be
|
||||
scheduled for reading and writing during realtime operation.
|
||||
- Exported `ecrt_slave_config_sdo()`, the generic SDO configuration
|
||||
function.
|
||||
- Removed the `bus_state` and `bus_tainted` flags from
|
||||
`ec_master_state_t`.
|
||||
- Device interface changes:
|
||||
- Moved device output parameter of `ecdev_offer()` to return value.
|
||||
- Replaced the Sysfs interface with a new `ethercat` command-line tool, that
|
||||
communicates with the master via a character device and ioctls. The device
|
||||
is created via udev. The tool is able to
|
||||
- Write alias addresses.
|
||||
- Show the bus configuration.
|
||||
- Output binary domain process data.
|
||||
- Set the master's debug level.
|
||||
- Show domain information.
|
||||
- Show master information.
|
||||
- List PDO assignment/mapping.
|
||||
- Write an SDO entry.
|
||||
- List SDO dictionaries.
|
||||
- Read an SDO entry.
|
||||
- Output a slave's SII contents.
|
||||
- Write slave's SII contents.
|
||||
- Show slaves.
|
||||
- Request slave states.
|
||||
- Generate slave information xmls.
|
||||
- Removed include/ecdb.h.
|
||||
- Using the timestamp counter is now optional (configure `--enable-cycles`),
|
||||
because it is only available on Intel architectures.
|
||||
- SDO dictionaries will now also be fetched in operation mode.
|
||||
- SII write requests will now also be processed in operation mode.
|
||||
- Mapping of PDO entries is now supported.
|
||||
- Current PDO assignment/mapping is now read via CoE during bus scan, using
|
||||
direct SDO access, independent of the dictionary.
|
||||
- Network driver news:
|
||||
- Added 8139too driver for kernel 2.6.22, thanks to Erwin Burgstaller.
|
||||
- Added 8139too driver for kernel 2.6.23, thanks to Richard Hacker.
|
||||
- Added 8139too driver for kernel 2.6.24.
|
||||
- Added e1000 driver for kernel 2.6.22.
|
||||
- Added e1000 driver for kernel 2.6.24, thanks to Matthias Luescher.
|
||||
- Added alpha support for the Realtek r8169 chipset, thanks to Scott
|
||||
Hassan.
|
||||
- Fixed unnecessary watchdog executions in e1000 drivers (thanks to
|
||||
Olav Zarges).
|
||||
- Fixed missing protection for a `spin_lock_irqrestore()` call in e1000
|
||||
drivers from 2.6.20 to 2.6.24 (thanks to Olav Zarges).
|
||||
- Removed the "bus validation" routines. Slave scanning is now done any time
|
||||
the bus topology changes, even during realtime operation. Because of this,
|
||||
the `bus_tainted` flag was deprecated and removed.
|
||||
- Slave configuration is not done during `ecrt_master_activate()` any more,
|
||||
but later during realtime operation. The state of the configuration can be
|
||||
queried via the `ecrt_domain_state()` and `ecrt_slave_config_state()`
|
||||
functions.
|
||||
- Added support for slaves that do not support the LRW datagram type. Separate
|
||||
domains have to be used for inputs and output.
|
||||
- CoE implementation:
|
||||
- Use expedites transfer type for SDOs <= 4 byte (thanks to J. Mohre).
|
||||
- Allow gaps in PDO mapping (thanks to R. Roesch).
|
||||
- Added some transfer timeouts.
|
||||
- Asynchronous handling of Emergency requests.
|
||||
- Bug fixes.
|
||||
- Sync managers are disabled, if the size is zero.
|
||||
- Renamed `ec_master` module parameters main and backup to `main_devices` and
|
||||
`backup_devices` to avoid warnings of some compilers.
|
||||
- List end evaluate CoE detail flags from general category.
|
||||
- Added `MODPROBE_FLAGS` variable in start script and sysconfig file.
|
||||
- Implemented missing datagram types.
|
||||
- Changed all occurrences of 'EEPROM' to 'SII'
|
||||
- Allow multiple sync manager categories in SII.
|
||||
|
||||
# Version 1.3.2
|
||||
|
||||
- New feature: Read dynamic PDO mapping from SDO dictionary.
|
||||
- Implemented SII writing workaround for some broken slaves.
|
||||
- Improved handling for spontaneous AL state changes.
|
||||
- Master takes mailbox sync manager configurations from EEPROM words
|
||||
0x0018-0x001b, if no sync manager configurations are provided.
|
||||
- Calculate checksum when writing EEPROM or alias address.
|
||||
- Fixed source MAC address setting bug.
|
||||
- Removed config.kbuild and replaced Kbuild files by Kbuild.in files.
|
||||
|
||||
# Version 1.3.1
|
||||
|
||||
- Improved EoE handling: Avoided skipping of datagrams and release lock
|
||||
while processing.
|
||||
- Added some statistics to the datagram structure.
|
||||
- Master state machine clears all station addresses with a broadcast datagram
|
||||
before setting them.
|
||||
- Added `--enable-eoe` conditional.
|
||||
- Minor extensions of the master info file.
|
||||
- Improved handling of unexpected working counters.
|
||||
- Create network interfaces for EoE devices with alias as eoeXaY.
|
||||
- Fixed problems on big-endian systems.
|
||||
- Added documentation on how to set up an EoE network.
|
||||
|
||||
# Version 1.3.0
|
||||
|
||||
- Added Intel PRO/1000 Gigabit Ethernet driver (e1000).
|
||||
- Added testing version of Intel PRO/100 Ethernet driver (e100).
|
||||
- Added testing version of NVIDIA nForce Ethernet driver (forcedeth).
|
||||
- Removed `ec_eoeif_count` master module parameter. EoE handlers are created
|
||||
dynamically instead.
|
||||
- Added "main" and "backup" parameters to master module to hand over the
|
||||
MAC addresses of the devices to wait for. This made the `ec_device_index`
|
||||
parameter of the Ethernet drivers obsolete. The broadcast MAC address means,
|
||||
that the master accepts the first device offered by any Ethernet driver.
|
||||
- Changed format of sysconfig file and accordingly adjusted functionality
|
||||
of the init script to handle the above MAC address lists.
|
||||
- Realtime interface changes:
|
||||
- `ecrt_master_run()` became obsolete, because the master state machine is
|
||||
now run in process context.
|
||||
- Parameter changes in PDO registration functions
|
||||
`ecrt_domain_register_pdo()` and `ecrt_register_pdo_range()`: Replaced
|
||||
`slave_address`, vendor ID and product code arguments with a slave
|
||||
pointer, which has to be obtained with a prior call to
|
||||
`ecrt_master_get_slave()`.
|
||||
- `ecrt_master_get_slave()` got additional parameters to check for vendor ID
|
||||
and product code.
|
||||
- Removed addressing scheme "X:Y" for `ecrt_master_get_slave()`.
|
||||
- Added `ecrt_master_get_slave_by_pos()` to avoid the string handling of
|
||||
`ecrt_master_get_slave()`.
|
||||
- Added `ecrt_master_get_status()` to get status information about the bus.
|
||||
- Added functions to set up an alternative PDO mapping for a slave, i. e.
|
||||
`ec_slave_pdo_mapping_clear()`, `ec_slave_pdo_mapping_add()` and
|
||||
`ec_slave_pdo_mapping()`.
|
||||
- Device interface changes:
|
||||
- Replaced `ecdev_register()` and `ecdev_unregister()` with `ecdev_offer()`
|
||||
and `ecdev_withdraw()`, respectively. The device modules now offer all
|
||||
their devices to the master. The master then decides, which ones to
|
||||
register.
|
||||
- Replaced `ecdev_link_state()` with `ecdev_set_link()`; added
|
||||
`ecdev_get_link()`.
|
||||
- All EEPROM write operations from user space are now blocking until
|
||||
writing has finished. Appropriate error codes are returned.
|
||||
- Implemented setting of the "Secondary slave address" (alias) via sysfs.
|
||||
- Implemented SDO reading in operation mode via sysfs.
|
||||
- Removed annoying `eeprom_write_enable` file. EEPROM writing always enabled.
|
||||
- Slave configuration is now done exclusively from the master thread. Removed
|
||||
`ec_master_sync_io()`. Userspace threads are now waiting for events in the
|
||||
state machine.
|
||||
- Master state machine scheduled with timeout if idle, otherwise is executed
|
||||
as fast as possible (with `schedule()`).
|
||||
- Added dummy module for simulation purposes.
|
||||
- Limited infinite EEPROM reading, if 0xffff limiter word is missing.
|
||||
- Init script works now properly on non-SUSE distros (no rc.status dependency
|
||||
any more).
|
||||
- Removed EtherCAT line comments from 8139too drivers.
|
||||
|
||||
# Version 1.2.0
|
||||
|
||||
- Several fixes of bugs and stability issues. Master should now run fine
|
||||
with kernels 2.6.17 to 2.6.19.
|
||||
- Realtime interface changes:
|
||||
- Re-introduced `ecrt_domain_queue()` to allow datagram queuing apart
|
||||
from datagram processing. The queuing of a domain's datagrams is not
|
||||
done in `ecrt_domain_process()` any more!
|
||||
- Removed `ecrt_master_deactivate()`. Its functionality was moved into
|
||||
`ecrt_master_release()`.
|
||||
- Removed `ecrt_master_prepare()`. Its functionality was moved into
|
||||
`ecrt_master_activate()`.
|
||||
- Renamed `ecdev_start()` and `ecdev_stop()` to `ecdev_open()` and
|
||||
`ecdev_close()`. These two functions now take a pointer to `ec_device_t`
|
||||
as their arguments.
|
||||
- The `data_ptr` parameter of `ecrt_domain_register_pdo()`,
|
||||
`ecrt_domain_register_pdo_list()` and `ecrt_domain_register_pdo_range()`
|
||||
may not be NULL any more.
|
||||
- Removed `ecrt_slave_pdo_size()`. This function was deprecated long before.
|
||||
- Introduced `ECRT_VERSION_MAGIC` macro and `ecrt_version_magic()` function.
|
||||
- Device interface changes:
|
||||
- `ec_isr_t` was replaced by `ec_pollfunc_t`, the device driver has to
|
||||
supply a poll function to call its ISR. This was introduced because some
|
||||
network drivers' interrupt functions have different arguments.
|
||||
- State machines now try to re-send datagrams on datagram timeout.
|
||||
- New option `-c` of the `lsec` script, displays slave current consumptions and
|
||||
remaining current.
|
||||
- Added frame counter in master info file.
|
||||
|
||||
# Version 1.1.1
|
||||
|
||||
- State change FSM: Clearing of sync managers before PREOP.
|
||||
- Added `modules_install` make target.
|
||||
- Device modules for kernel 2.6.17.
|
||||
- SDO configurations available in Sysfs.
|
||||
- FMMU configurations cleared when going to INIT.
|
||||
- Slave-specific logs only at debug level 1 (for large buses).
|
||||
- Slave flags (error, online) available in Sysfs.
|
||||
- Acknowledging of spontaneous state changes in master FSMs.
|
||||
- `ecrt_master_deactivate()` deprecated.
|
||||
- Persistent slave lists. Slave structures are only regenerated on topology
|
||||
change in IDLE mode.
|
||||
- SDO reading via Sysfs.
|
||||
- Added `ecrt_domain_register_pdo_range()`
|
||||
- Fetching of SDO dictionary.
|
||||
- Better timing behaviour when starting up under high CPU load.
|
||||
- Applied Autotools.
|
||||
- Improved output of `lsec`.
|
||||
- SDO download state machine.
|
||||
|
||||
# Version 1.1
|
||||
|
||||
- Improved realtime interface.
|
||||
|
||||
|
||||
vim: spelllang=en spell tw=78
|
||||
13
README.EoE
13
README.EoE
|
|
@ -1,8 +1,10 @@
|
|||
------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
$Id$
|
||||
|
||||
vim: spelllang=en spell tw=78
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This file shall give additional information on how to set up a network
|
||||
environment with Ethernet over EtherCAT devices.
|
||||
|
|
@ -10,9 +12,8 @@ environment with Ethernet over EtherCAT devices.
|
|||
A virtual network interface will appear for every EoE-capable slave. The
|
||||
interface naming scheme is either eoeXsY, where X is the master index and Y is
|
||||
the slave's ring position, or (if the slave has an alias set) eoeXaZ, where Z
|
||||
is the (decimal) alias address. Please provide a network configuration file
|
||||
for any of these interfaces. On SUSE systems, these can look like the
|
||||
following:
|
||||
is the (decimal) alias address. Please provide a network configuration file for
|
||||
any of these interfaces. On SUSE systems, these can look like the following:
|
||||
|
||||
/etc/sysconfig/network/ifcfg-eoe0s14:
|
||||
IPADDRESS=10.0.0.14/8
|
||||
|
|
@ -25,4 +26,4 @@ necessary. Instead, copy the file script/ifup-eoe.sh to your systems if-up.d
|
|||
directory (on SUSE, this is /etc/sysconfig/network/if-up.d), and customize the
|
||||
included variables.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------
|
||||
|
|
|
|||
39
README.md
39
README.md
|
|
@ -1,23 +1,29 @@
|
|||
This is the README file of the IgH EtherCAT Master.
|
||||
|
||||
Contents:
|
||||
vim: spelllang=en spell tw=78
|
||||
|
||||
[[_TOC_]]
|
||||
Contents:
|
||||
- [General Information](#general-information)
|
||||
- [Requirements](#requirements)
|
||||
- [Building and Installing](#building-and-installing)
|
||||
- [Realtime and Tuning](#realtime-and-tuning)
|
||||
- [License](#license)
|
||||
- [Coding Style](#coding-style)
|
||||
|
||||
# General Information
|
||||
|
||||
This is an open-source EtherCAT master implementation for Linux 2.6 or newer.
|
||||
|
||||
See the [features file](FEATURES.md) for a list of features. For more
|
||||
information, see https://etherlab.org/ethercat.
|
||||
information, see http://etherlab.org/en/ethercat.
|
||||
|
||||
or contact
|
||||
|
||||
>>>
|
||||
Dipl.-Ing. (FH) Florian Pose <fp@igh.de>
|
||||
Ingenieurgemeinschaft IgH
|
||||
Nordsternstraße 66
|
||||
D-45329 Essen
|
||||
Dipl.-Ing. (FH) Florian Pose <fp@igh.de>
|
||||
Ingenieurgemeinschaft IgH
|
||||
Nordsternstraße 66
|
||||
D-45329 Essen
|
||||
http://igh.de
|
||||
>>>
|
||||
|
||||
|
|
@ -48,7 +54,7 @@ make doc
|
|||
```
|
||||
|
||||
An up-to-date Doxygen output can be found on
|
||||
[docs.etherlab.org](https://docs.etherlab.org/ethercat/1.6/doxygen/index.html).
|
||||
[docs.etherlab.org](https://docs.etherlab.org/ethercat/1.5/doxygen/index.html).
|
||||
|
||||
# Requirements
|
||||
|
||||
|
|
@ -59,20 +65,13 @@ the EtherCAT master.
|
|||
|
||||
## Hardware requirements
|
||||
|
||||
A table of supported hardware can be found at:
|
||||
https://docs.etherlab.org/ethercat/1.6/doxygen/devicedrivers.html
|
||||
A table of supported hardware can be found at
|
||||
http://etherlab.org/en/ethercat/hardware.php.
|
||||
|
||||
# Building and installing
|
||||
|
||||
See the [install file](INSTALL.md).
|
||||
|
||||
# Dry-run and Field Simulation
|
||||
|
||||
A limited set of the userspace API is available in `libfakeethercat`,
|
||||
a library which can be used to run an userspace application
|
||||
without an EtherCAT master or with emulated EtherCAT slaves.
|
||||
Please find some details [here](fake_lib/README.md).
|
||||
|
||||
# Realtime and Tuning
|
||||
|
||||
Realtime patches for the Linux kernel are supported, but not required. The
|
||||
|
|
@ -102,9 +101,11 @@ You should have received a copy of the GNU General Public License along with
|
|||
the IgH EtherCAT Master; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# I have a question / I want to contribute
|
||||
---
|
||||
|
||||
Please see the [contributiong document](CONTRIBUTING.md).
|
||||
The license mentioned above concerns the source code only. Using the EtherCAT
|
||||
technology and brand is only permitted in compliance with the industrial
|
||||
property and similar rights of Beckhoff Automation GmbH.
|
||||
|
||||
# Coding Style
|
||||
|
||||
|
|
|
|||
7
TODO
7
TODO
|
|
@ -2,15 +2,12 @@
|
|||
|
||||
EtherCAT master TODO
|
||||
|
||||
$Id$
|
||||
|
||||
vim700: spelllang=en spell
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
See issues on
|
||||
https://gitlab.com/etherlab.org/ethercat/-/issues
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Future issues:
|
||||
|
||||
* Improve redundancy_active doc in ecrt.h.
|
||||
|
|
|
|||
14
bootstrap
14
bootstrap
|
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
#-----------------------------------------------------------------------------
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
#
|
||||
|
|
@ -18,7 +20,13 @@
|
|||
# with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# ---
|
||||
#
|
||||
# The license mentioned above concerns the source code only. Using the
|
||||
# EtherCAT technology and brand is only permitted in compliance with the
|
||||
# industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
|
@ -31,4 +39,4 @@ mkdir -p m4
|
|||
|
||||
autoreconf -i
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
|
|||
593
configure.ac
593
configure.ac
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
-----<snip>-----
|
||||
|
||||
Written 1997-2001 by Donald Becker.
|
||||
Written 1997-2001 by Donald Becker.
|
||||
This software may be used and distributed according to the
|
||||
terms of the GNU General Public License (GPL), incorporated
|
||||
herein by reference. Drivers based on or derived from this
|
||||
|
|
@ -100,7 +100,6 @@
|
|||
#include <linux/compiler.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
|
|
@ -112,7 +111,6 @@
|
|||
#include <linux/io.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
#define RTL8139_DRIVER_NAME DRV_NAME " Fast Ethernet driver " DRV_VERSION
|
||||
|
|
@ -149,9 +147,9 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
|
|||
|
||||
/* Whether to use MMIO or PIO. Default to MMIO. */
|
||||
#ifdef CONFIG_8139TOO_PIO
|
||||
static bool use_io = true;
|
||||
static int use_io = 1;
|
||||
#else
|
||||
static bool use_io = false;
|
||||
static int use_io = 0;
|
||||
#endif
|
||||
|
||||
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
|
||||
|
|
@ -183,13 +181,10 @@ static int debug = -1;
|
|||
/* Number of Tx descriptor registers. */
|
||||
#define NUM_TX_DESC 4
|
||||
|
||||
/* max supported ethernet frame size -- must be at least (dev->mtu+18+4).*/
|
||||
#define MAX_ETH_FRAME_SIZE 1792
|
||||
/* max supported ethernet frame size -- must be at least (dev->mtu+14+4).*/
|
||||
#define MAX_ETH_FRAME_SIZE 1536
|
||||
|
||||
/* max supported payload size */
|
||||
#define MAX_ETH_DATA_SIZE (MAX_ETH_FRAME_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN)
|
||||
|
||||
/* Size of the Tx bounce buffers -- must be at least (dev->mtu+18+4). */
|
||||
/* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */
|
||||
#define TX_BUF_SIZE MAX_ETH_FRAME_SIZE
|
||||
#define TX_BUF_TOT_LEN (TX_BUF_SIZE * NUM_TX_DESC)
|
||||
|
||||
|
|
@ -232,13 +227,13 @@ typedef enum {
|
|||
static const struct {
|
||||
const char *name;
|
||||
u32 hw_flags;
|
||||
} board_info[] = {
|
||||
} board_info[] __devinitdata = {
|
||||
{ "RealTek RTL8139", RTL8139_CAPS },
|
||||
{ "RealTek RTL8129", RTL8129_CAPS },
|
||||
};
|
||||
|
||||
|
||||
static const struct pci_device_id rtl8139_pci_tbl[] = {
|
||||
static DEFINE_PCI_DEVICE_TABLE(rtl8139_pci_tbl) = {
|
||||
{0x10ec, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
{0x10ec, 0x8138, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
{0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
|
|
@ -258,7 +253,6 @@ static const struct pci_device_id rtl8139_pci_tbl[] = {
|
|||
{0x126c, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
{0x1743, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
{0x021b, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
{0x16ec, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
|
||||
#ifdef CONFIG_SH_SECUREEDGE5410
|
||||
/* Bogus 8139 silicon reports 8129 without external PROM :-( */
|
||||
|
|
@ -548,8 +542,8 @@ static const struct {
|
|||
|
||||
{ "RTL-8100",
|
||||
HW_REVID(1, 1, 1, 1, 0, 1, 0),
|
||||
HasLWake,
|
||||
},
|
||||
HasLWake,
|
||||
},
|
||||
|
||||
{ "RTL-8100B/8139D",
|
||||
HW_REVID(1, 1, 1, 0, 1, 0, 1),
|
||||
|
|
@ -570,12 +564,6 @@ struct rtl_extra_stats {
|
|||
unsigned long rx_lost_in_ring;
|
||||
};
|
||||
|
||||
struct rtl8139_stats {
|
||||
u64 packets;
|
||||
u64 bytes;
|
||||
struct u64_stats_sync syncp;
|
||||
};
|
||||
|
||||
struct rtl8139_private {
|
||||
void __iomem *mmio_addr;
|
||||
int drv_flags;
|
||||
|
|
@ -586,13 +574,11 @@ struct rtl8139_private {
|
|||
|
||||
unsigned char *rx_ring;
|
||||
unsigned int cur_rx; /* RX buf index of next pkt */
|
||||
struct rtl8139_stats rx_stats;
|
||||
dma_addr_t rx_ring_dma;
|
||||
|
||||
unsigned int tx_flag;
|
||||
unsigned long cur_tx;
|
||||
unsigned long dirty_tx;
|
||||
struct rtl8139_stats tx_stats;
|
||||
unsigned char *tx_buf[NUM_TX_DESC]; /* Tx bounce buffers */
|
||||
unsigned char *tx_bufs; /* Tx bounce buffer region. */
|
||||
dma_addr_t tx_bufs_dma;
|
||||
|
|
@ -625,7 +611,7 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver");
|
|||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(DRV_VERSION);
|
||||
|
||||
module_param(use_io, bool, 0);
|
||||
module_param(use_io, int, 0);
|
||||
MODULE_PARM_DESC(use_io, "Force use of I/O access mode. 0=MMIO 1=PIO");
|
||||
module_param(multicast_filter_limit, int, 0);
|
||||
module_param_array(media, int, NULL, 0);
|
||||
|
|
@ -642,7 +628,7 @@ static int mdio_read (struct net_device *dev, int phy_id, int location);
|
|||
static void mdio_write (struct net_device *dev, int phy_id, int location,
|
||||
int val);
|
||||
static void rtl8139_start_thread(struct rtl8139_private *tp);
|
||||
static void rtl8139_tx_timeout (struct net_device *dev, unsigned int txqueue);
|
||||
static void rtl8139_tx_timeout (struct net_device *dev);
|
||||
static void rtl8139_init_ring (struct net_device *dev);
|
||||
static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,
|
||||
struct net_device *dev);
|
||||
|
|
@ -654,8 +640,7 @@ static int rtl8139_poll(struct napi_struct *napi, int budget);
|
|||
static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance);
|
||||
static int rtl8139_close (struct net_device *dev);
|
||||
static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
|
||||
static void rtl8139_get_stats64(struct net_device *dev,
|
||||
struct rtnl_link_stats64 *stats);
|
||||
static struct net_device_stats *rtl8139_get_stats (struct net_device *dev);
|
||||
static void rtl8139_set_rx_mode (struct net_device *dev);
|
||||
static void __set_rx_mode (struct net_device *dev);
|
||||
static void rtl8139_hw_start (struct net_device *dev);
|
||||
|
|
@ -731,6 +716,7 @@ static void __rtl8139_cleanup_dev (struct net_device *dev)
|
|||
pci_release_regions (pdev);
|
||||
|
||||
free_netdev(dev);
|
||||
pci_set_drvdata (pdev, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -751,32 +737,26 @@ static void rtl8139_chip_reset (void __iomem *ioaddr)
|
|||
}
|
||||
|
||||
|
||||
static struct net_device *rtl8139_init_board(struct pci_dev *pdev)
|
||||
static __devinit struct net_device * rtl8139_init_board (struct pci_dev *pdev)
|
||||
{
|
||||
struct device *d = &pdev->dev;
|
||||
void __iomem *ioaddr;
|
||||
struct net_device *dev;
|
||||
struct rtl8139_private *tp;
|
||||
u8 tmp8;
|
||||
int rc, disable_dev_on_err = 0;
|
||||
unsigned int i, bar;
|
||||
unsigned long io_len;
|
||||
unsigned int i;
|
||||
unsigned long pio_start, pio_end, pio_flags, pio_len;
|
||||
unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
|
||||
u32 version;
|
||||
static const struct {
|
||||
unsigned long mask;
|
||||
char *type;
|
||||
} res[] = {
|
||||
{ IORESOURCE_IO, "PIO" },
|
||||
{ IORESOURCE_MEM, "MMIO" }
|
||||
};
|
||||
|
||||
assert (pdev != NULL);
|
||||
|
||||
/* dev and priv zeroed in alloc_etherdev */
|
||||
dev = alloc_etherdev (sizeof (*tp));
|
||||
if (dev == NULL)
|
||||
if (dev == NULL) {
|
||||
dev_err(&pdev->dev, "Unable to alloc new net device\n");
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
}
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
|
||||
tp = netdev_priv(dev);
|
||||
|
|
@ -787,48 +767,78 @@ static struct net_device *rtl8139_init_board(struct pci_dev *pdev)
|
|||
if (rc)
|
||||
goto err_out;
|
||||
|
||||
disable_dev_on_err = 1;
|
||||
pio_start = pci_resource_start (pdev, 0);
|
||||
pio_end = pci_resource_end (pdev, 0);
|
||||
pio_flags = pci_resource_flags (pdev, 0);
|
||||
pio_len = pci_resource_len (pdev, 0);
|
||||
|
||||
mmio_start = pci_resource_start (pdev, 1);
|
||||
mmio_end = pci_resource_end (pdev, 1);
|
||||
mmio_flags = pci_resource_flags (pdev, 1);
|
||||
mmio_len = pci_resource_len (pdev, 1);
|
||||
|
||||
/* set this immediately, we need to know before
|
||||
* we talk to the chip directly */
|
||||
pr_debug("PIO region size == 0x%02lX\n", pio_len);
|
||||
pr_debug("MMIO region size == 0x%02lX\n", mmio_len);
|
||||
|
||||
retry:
|
||||
if (use_io) {
|
||||
/* make sure PCI base addr 0 is PIO */
|
||||
if (!(pio_flags & IORESOURCE_IO)) {
|
||||
dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
/* check for weird/broken PCI region reporting */
|
||||
if (pio_len < RTL_MIN_IO_SIZE) {
|
||||
dev_err(&pdev->dev, "Invalid PCI I/O region size(s), aborting\n");
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
} else {
|
||||
/* make sure PCI base addr 1 is MMIO */
|
||||
if (!(mmio_flags & IORESOURCE_MEM)) {
|
||||
dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
if (mmio_len < RTL_MIN_IO_SIZE) {
|
||||
dev_err(&pdev->dev, "Invalid PCI mem region size(s), aborting\n");
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
}
|
||||
|
||||
rc = pci_request_regions (pdev, DRV_NAME);
|
||||
if (rc)
|
||||
goto err_out;
|
||||
disable_dev_on_err = 1;
|
||||
|
||||
/* enable PCI bus-mastering */
|
||||
pci_set_master (pdev);
|
||||
|
||||
u64_stats_init(&tp->rx_stats.syncp);
|
||||
u64_stats_init(&tp->tx_stats.syncp);
|
||||
|
||||
retry:
|
||||
/* PIO bar register comes first. */
|
||||
bar = !use_io;
|
||||
|
||||
io_len = pci_resource_len(pdev, bar);
|
||||
|
||||
dev_dbg(d, "%s region size = 0x%02lX\n", res[bar].type, io_len);
|
||||
|
||||
if (!(pci_resource_flags(pdev, bar) & res[bar].mask)) {
|
||||
dev_err(d, "region #%d not a %s resource, aborting\n", bar,
|
||||
res[bar].type);
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
if (io_len < RTL_MIN_IO_SIZE) {
|
||||
dev_err(d, "Invalid PCI %s region size(s), aborting\n",
|
||||
res[bar].type);
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
ioaddr = pci_iomap(pdev, bar, 0);
|
||||
if (!ioaddr) {
|
||||
dev_err(d, "cannot map %s\n", res[bar].type);
|
||||
if (!use_io) {
|
||||
use_io = true;
|
||||
if (use_io) {
|
||||
ioaddr = pci_iomap(pdev, 0, 0);
|
||||
if (!ioaddr) {
|
||||
dev_err(&pdev->dev, "cannot map PIO, aborting\n");
|
||||
rc = -EIO;
|
||||
goto err_out;
|
||||
}
|
||||
dev->base_addr = pio_start;
|
||||
tp->regs_len = pio_len;
|
||||
} else {
|
||||
/* ioremap MMIO region */
|
||||
ioaddr = pci_iomap(pdev, 1, 0);
|
||||
if (ioaddr == NULL) {
|
||||
dev_err(&pdev->dev, "cannot remap MMIO, trying PIO\n");
|
||||
pci_release_regions(pdev);
|
||||
use_io = 1;
|
||||
goto retry;
|
||||
}
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
dev->base_addr = (long) ioaddr;
|
||||
tp->regs_len = mmio_len;
|
||||
}
|
||||
tp->regs_len = io_len;
|
||||
tp->mmio_addr = ioaddr;
|
||||
|
||||
/* Bring old chips out of low-power mode. */
|
||||
|
|
@ -897,55 +907,27 @@ err_out:
|
|||
return ERR_PTR(rc);
|
||||
}
|
||||
|
||||
static int rtl8139_set_features(struct net_device *dev, netdev_features_t features)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
unsigned long flags;
|
||||
netdev_features_t changed = features ^ dev->features;
|
||||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
|
||||
if (!(changed & (NETIF_F_RXALL)))
|
||||
return 0;
|
||||
|
||||
spin_lock_irqsave(&tp->lock, flags);
|
||||
|
||||
if (changed & NETIF_F_RXALL) {
|
||||
int rx_mode = tp->rx_config;
|
||||
if (features & NETIF_F_RXALL)
|
||||
rx_mode |= (AcceptErr | AcceptRunt);
|
||||
else
|
||||
rx_mode &= ~(AcceptErr | AcceptRunt);
|
||||
tp->rx_config = rtl8139_rx_config | rx_mode;
|
||||
RTL_W32_F(RxConfig, tp->rx_config);
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&tp->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct net_device_ops rtl8139_netdev_ops = {
|
||||
.ndo_open = rtl8139_open,
|
||||
.ndo_stop = rtl8139_close,
|
||||
.ndo_get_stats64 = rtl8139_get_stats64,
|
||||
.ndo_get_stats = rtl8139_get_stats,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_set_mac_address = rtl8139_set_mac_address,
|
||||
.ndo_start_xmit = rtl8139_start_xmit,
|
||||
.ndo_set_rx_mode = rtl8139_set_rx_mode,
|
||||
.ndo_eth_ioctl = netdev_ioctl,
|
||||
.ndo_set_multicast_list = rtl8139_set_rx_mode,
|
||||
.ndo_do_ioctl = netdev_ioctl,
|
||||
.ndo_tx_timeout = rtl8139_tx_timeout,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = rtl8139_poll_controller,
|
||||
#endif
|
||||
.ndo_set_features = rtl8139_set_features,
|
||||
};
|
||||
|
||||
static int rtl8139_init_one(struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
static int __devinit rtl8139_init_one (struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
{
|
||||
struct net_device *dev = NULL;
|
||||
struct rtl8139_private *tp;
|
||||
__le16 addr[ETH_ALEN / 2];
|
||||
int i, addr_len, option;
|
||||
void __iomem *ioaddr;
|
||||
static int board_idx = -1;
|
||||
|
|
@ -979,7 +961,7 @@ static int rtl8139_init_one(struct pci_dev *pdev,
|
|||
pdev->subsystem_vendor == PCI_VENDOR_ID_ATHEROS &&
|
||||
pdev->subsystem_device == PCI_DEVICE_ID_REALTEK_8139) {
|
||||
pr_info("OQO Model 2 detected. Forcing PIO\n");
|
||||
use_io = true;
|
||||
use_io = 1;
|
||||
}
|
||||
|
||||
dev = rtl8139_init_board (pdev);
|
||||
|
|
@ -995,28 +977,23 @@ static int rtl8139_init_one(struct pci_dev *pdev,
|
|||
|
||||
addr_len = read_eeprom (ioaddr, 0, 8) == 0x8129 ? 8 : 6;
|
||||
for (i = 0; i < 3; i++)
|
||||
addr[i] = cpu_to_le16(read_eeprom (ioaddr, i + 7, addr_len));
|
||||
eth_hw_addr_set(dev, (u8 *)addr);
|
||||
((__le16 *) (dev->dev_addr))[i] =
|
||||
cpu_to_le16(read_eeprom (ioaddr, i + 7, addr_len));
|
||||
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
|
||||
|
||||
/* The Rtl8139-specific entries in the device structure. */
|
||||
dev->netdev_ops = &rtl8139_netdev_ops;
|
||||
dev->ethtool_ops = &rtl8139_ethtool_ops;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
netif_napi_add(dev, &tp->napi, rtl8139_poll);
|
||||
netif_napi_add(dev, &tp->napi, rtl8139_poll, 64);
|
||||
|
||||
/* note: the hardware is not capable of sg/csum/highdma, however
|
||||
* through the use of skb_copy_and_csum_dev we enable these
|
||||
* features
|
||||
*/
|
||||
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
|
||||
dev->vlan_features = dev->features;
|
||||
|
||||
dev->hw_features |= NETIF_F_RXALL;
|
||||
dev->hw_features |= NETIF_F_RXFCS;
|
||||
|
||||
/* MTU range: 68 - 1770 */
|
||||
dev->min_mtu = ETH_MIN_MTU;
|
||||
dev->max_mtu = MAX_ETH_DATA_SIZE;
|
||||
dev->irq = pdev->irq;
|
||||
|
||||
/* tp zeroed and aligned in alloc_etherdev */
|
||||
tp = netdev_priv(dev);
|
||||
|
|
@ -1043,9 +1020,9 @@ static int rtl8139_init_one(struct pci_dev *pdev,
|
|||
|
||||
pci_set_drvdata (pdev, dev);
|
||||
|
||||
netdev_info(dev, "%s at 0x%p, %pM, IRQ %d\n",
|
||||
netdev_info(dev, "%s at 0x%lx, %pM, IRQ %d\n",
|
||||
board_info[ent->driver_data].name,
|
||||
ioaddr, dev->dev_addr, pdev->irq);
|
||||
dev->base_addr, dev->dev_addr, dev->irq);
|
||||
|
||||
netdev_dbg(dev, "Identified 8139 chip type '%s'\n",
|
||||
rtl_chip_info[tp->chipset].name);
|
||||
|
|
@ -1112,14 +1089,13 @@ err_out:
|
|||
}
|
||||
|
||||
|
||||
static void rtl8139_remove_one(struct pci_dev *pdev)
|
||||
static void __devexit rtl8139_remove_one (struct pci_dev *pdev)
|
||||
{
|
||||
struct net_device *dev = pci_get_drvdata (pdev);
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
|
||||
assert (dev != NULL);
|
||||
|
||||
cancel_delayed_work_sync(&tp->thread);
|
||||
flush_scheduled_work();
|
||||
|
||||
unregister_netdev (dev);
|
||||
|
||||
|
|
@ -1143,14 +1119,14 @@ static void rtl8139_remove_one(struct pci_dev *pdev)
|
|||
No extra delay is needed with 33Mhz PCI, but 66Mhz may change this.
|
||||
*/
|
||||
|
||||
#define eeprom_delay() (void)RTL_R8(Cfg9346)
|
||||
#define eeprom_delay() (void)RTL_R32(Cfg9346)
|
||||
|
||||
/* The EEPROM commands include the alway-set leading bit. */
|
||||
#define EE_WRITE_CMD (5)
|
||||
#define EE_READ_CMD (6)
|
||||
#define EE_ERASE_CMD (7)
|
||||
|
||||
static int read_eeprom(void __iomem *ioaddr, int location, int addr_len)
|
||||
static int __devinit read_eeprom (void __iomem *ioaddr, int location, int addr_len)
|
||||
{
|
||||
int i;
|
||||
unsigned retval = 0;
|
||||
|
|
@ -1182,7 +1158,7 @@ static int read_eeprom(void __iomem *ioaddr, int location, int addr_len)
|
|||
}
|
||||
|
||||
/* Terminate the EEPROM access. */
|
||||
RTL_W8(Cfg9346, 0);
|
||||
RTL_W8 (Cfg9346, ~EE_CS);
|
||||
eeprom_delay ();
|
||||
|
||||
return retval;
|
||||
|
|
@ -1320,11 +1296,10 @@ static void mdio_write (struct net_device *dev, int phy_id, int location,
|
|||
static int rtl8139_open (struct net_device *dev)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
const int irq = tp->pci_dev->irq;
|
||||
int retval;
|
||||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
|
||||
retval = request_irq(irq, rtl8139_interrupt, IRQF_SHARED, dev->name, dev);
|
||||
retval = request_irq (dev->irq, rtl8139_interrupt, IRQF_SHARED, dev->name, dev);
|
||||
if (retval)
|
||||
return retval;
|
||||
|
||||
|
|
@ -1333,7 +1308,7 @@ static int rtl8139_open (struct net_device *dev)
|
|||
tp->rx_ring = dma_alloc_coherent(&tp->pci_dev->dev, RX_BUF_TOT_LEN,
|
||||
&tp->rx_ring_dma, GFP_KERNEL);
|
||||
if (tp->tx_bufs == NULL || tp->rx_ring == NULL) {
|
||||
free_irq(irq, dev);
|
||||
free_irq(dev->irq, dev);
|
||||
|
||||
if (tp->tx_bufs)
|
||||
dma_free_coherent(&tp->pci_dev->dev, TX_BUF_TOT_LEN,
|
||||
|
|
@ -1359,7 +1334,7 @@ static int rtl8139_open (struct net_device *dev)
|
|||
"%s() ioaddr %#llx IRQ %d GP Pins %02x %s-duplex\n",
|
||||
__func__,
|
||||
(unsigned long long)pci_resource_start (tp->pci_dev, 1),
|
||||
irq, RTL_R8 (MediaStatus),
|
||||
dev->irq, RTL_R8 (MediaStatus),
|
||||
tp->mii.full_duplex ? "full" : "half");
|
||||
|
||||
rtl8139_start_thread(tp);
|
||||
|
|
@ -1661,10 +1636,6 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
|
|||
int i;
|
||||
u8 tmp8;
|
||||
|
||||
napi_disable(&tp->napi);
|
||||
netif_stop_queue(dev);
|
||||
synchronize_rcu();
|
||||
|
||||
netdev_dbg(dev, "Transmit timeout, status %02x %04x %04x media %02x\n",
|
||||
RTL_R8(ChipCmd), RTL_R16(IntrStatus),
|
||||
RTL_R16(IntrMask), RTL_R8(MediaStatus));
|
||||
|
|
@ -1694,14 +1665,14 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
|
|||
spin_unlock_irq(&tp->lock);
|
||||
|
||||
/* ...and finally, reset everything */
|
||||
napi_enable(&tp->napi);
|
||||
rtl8139_hw_start(dev);
|
||||
netif_wake_queue(dev);
|
||||
|
||||
if (netif_running(dev)) {
|
||||
rtl8139_hw_start (dev);
|
||||
netif_wake_queue (dev);
|
||||
}
|
||||
spin_unlock_bh(&tp->rx_lock);
|
||||
}
|
||||
|
||||
static void rtl8139_tx_timeout(struct net_device *dev, unsigned int txqueue)
|
||||
static void rtl8139_tx_timeout (struct net_device *dev)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
|
||||
|
|
@ -1729,9 +1700,9 @@ static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,
|
|||
if (len < ETH_ZLEN)
|
||||
memset(tp->tx_buf[entry], 0, ETH_ZLEN);
|
||||
skb_copy_and_csum_dev(skb, tp->tx_buf[entry]);
|
||||
dev_kfree_skb_any(skb);
|
||||
dev_kfree_skb(skb);
|
||||
} else {
|
||||
dev_kfree_skb_any(skb);
|
||||
dev_kfree_skb(skb);
|
||||
dev->stats.tx_dropped++;
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
|
@ -1803,10 +1774,8 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
|
|||
dev->stats.tx_fifo_errors++;
|
||||
}
|
||||
dev->stats.collisions += (txstatus >> 24) & 15;
|
||||
u64_stats_update_begin(&tp->tx_stats.syncp);
|
||||
tp->tx_stats.packets++;
|
||||
tp->tx_stats.bytes += txstatus & 0x7ff;
|
||||
u64_stats_update_end(&tp->tx_stats.syncp);
|
||||
dev->stats.tx_bytes += txstatus & 0x7ff;
|
||||
dev->stats.tx_packets++;
|
||||
}
|
||||
|
||||
dirty_tx++;
|
||||
|
|
@ -1969,10 +1938,7 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
|
|||
/* read size+status of next frame from DMA ring buffer */
|
||||
rx_status = le32_to_cpu (*(__le32 *) (rx_ring + ring_offset));
|
||||
rx_size = rx_status >> 16;
|
||||
if (likely(!(dev->features & NETIF_F_RXFCS)))
|
||||
pkt_size = rx_size - 4;
|
||||
else
|
||||
pkt_size = rx_size;
|
||||
pkt_size = rx_size - 4;
|
||||
|
||||
netif_dbg(tp, rx_status, dev, "%s() status %04x, size %04x, cur %04x\n",
|
||||
__func__, rx_status, rx_size, cur_rx);
|
||||
|
|
@ -2010,34 +1976,15 @@ no_early_rx:
|
|||
if (unlikely((rx_size > (MAX_ETH_FRAME_SIZE+4)) ||
|
||||
(rx_size < 8) ||
|
||||
(!(rx_status & RxStatusOK)))) {
|
||||
if ((dev->features & NETIF_F_RXALL) &&
|
||||
(rx_size <= (MAX_ETH_FRAME_SIZE + 4)) &&
|
||||
(rx_size >= 8) &&
|
||||
(!(rx_status & RxStatusOK))) {
|
||||
/* Length is at least mostly OK, but pkt has
|
||||
* error. I'm hoping we can handle some of these
|
||||
* errors without resetting the chip. --Ben
|
||||
*/
|
||||
dev->stats.rx_errors++;
|
||||
if (rx_status & RxCRCErr) {
|
||||
dev->stats.rx_crc_errors++;
|
||||
goto keep_pkt;
|
||||
}
|
||||
if (rx_status & RxRunt) {
|
||||
dev->stats.rx_length_errors++;
|
||||
goto keep_pkt;
|
||||
}
|
||||
}
|
||||
rtl8139_rx_err (rx_status, dev, tp, ioaddr);
|
||||
received = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
keep_pkt:
|
||||
/* Malloc up new buffer, compatible with net-2e. */
|
||||
/* Omit the four octet CRC from the length. */
|
||||
|
||||
skb = napi_alloc_skb(&tp->napi, pkt_size);
|
||||
skb = netdev_alloc_skb_ip_align(dev, pkt_size);
|
||||
if (likely(skb)) {
|
||||
#if RX_BUF_IDX == 3
|
||||
wrap_copy(skb, rx_ring, ring_offset+4, pkt_size);
|
||||
|
|
@ -2048,13 +1995,13 @@ keep_pkt:
|
|||
|
||||
skb->protocol = eth_type_trans (skb, dev);
|
||||
|
||||
u64_stats_update_begin(&tp->rx_stats.syncp);
|
||||
tp->rx_stats.packets++;
|
||||
tp->rx_stats.bytes += pkt_size;
|
||||
u64_stats_update_end(&tp->rx_stats.syncp);
|
||||
dev->stats.rx_bytes += pkt_size;
|
||||
dev->stats.rx_packets++;
|
||||
|
||||
netif_receive_skb (skb);
|
||||
} else {
|
||||
if (net_ratelimit())
|
||||
netdev_warn(dev, "Memory squeeze, dropping packet\n");
|
||||
dev->stats.rx_dropped++;
|
||||
}
|
||||
received++;
|
||||
|
|
@ -2137,10 +2084,13 @@ static int rtl8139_poll(struct napi_struct *napi, int budget)
|
|||
|
||||
if (work_done < budget) {
|
||||
unsigned long flags;
|
||||
|
||||
/*
|
||||
* Order is important since data can get interrupted
|
||||
* again when we think we are done.
|
||||
*/
|
||||
spin_lock_irqsave(&tp->lock, flags);
|
||||
if (napi_complete_done(napi, work_done))
|
||||
RTL_W16_F(IntrMask, rtl8139_intr_mask);
|
||||
__napi_complete(napi);
|
||||
RTL_W16_F(IntrMask, rtl8139_intr_mask);
|
||||
spin_unlock_irqrestore(&tp->lock, flags);
|
||||
}
|
||||
spin_unlock(&tp->rx_lock);
|
||||
|
|
@ -2221,12 +2171,9 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance)
|
|||
*/
|
||||
static void rtl8139_poll_controller(struct net_device *dev)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
const int irq = tp->pci_dev->irq;
|
||||
|
||||
disable_irq_nosync(irq);
|
||||
rtl8139_interrupt(irq, dev);
|
||||
enable_irq(irq);
|
||||
disable_irq(dev->irq);
|
||||
rtl8139_interrupt(dev->irq, dev);
|
||||
enable_irq(dev->irq);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -2239,7 +2186,7 @@ static int rtl8139_set_mac_address(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
|
||||
spin_lock_irq(&tp->lock);
|
||||
|
||||
|
|
@ -2279,7 +2226,7 @@ static int rtl8139_close (struct net_device *dev)
|
|||
|
||||
spin_unlock_irqrestore (&tp->lock, flags);
|
||||
|
||||
free_irq(tp->pci_dev->irq, dev);
|
||||
free_irq (dev->irq, dev);
|
||||
|
||||
rtl8139_tx_clear (tp);
|
||||
|
||||
|
|
@ -2380,28 +2327,27 @@ static int rtl8139_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
|
|||
static void rtl8139_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
strscpy(info->driver, DRV_NAME, sizeof(info->driver));
|
||||
strscpy(info->version, DRV_VERSION, sizeof(info->version));
|
||||
strscpy(info->bus_info, pci_name(tp->pci_dev), sizeof(info->bus_info));
|
||||
strcpy(info->driver, DRV_NAME);
|
||||
strcpy(info->version, DRV_VERSION);
|
||||
strcpy(info->bus_info, pci_name(tp->pci_dev));
|
||||
info->regdump_len = tp->regs_len;
|
||||
}
|
||||
|
||||
static int rtl8139_get_link_ksettings(struct net_device *dev,
|
||||
struct ethtool_link_ksettings *cmd)
|
||||
static int rtl8139_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
spin_lock_irq(&tp->lock);
|
||||
mii_ethtool_get_link_ksettings(&tp->mii, cmd);
|
||||
mii_ethtool_gset(&tp->mii, cmd);
|
||||
spin_unlock_irq(&tp->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtl8139_set_link_ksettings(struct net_device *dev,
|
||||
const struct ethtool_link_ksettings *cmd)
|
||||
static int rtl8139_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
int rc;
|
||||
spin_lock_irq(&tp->lock);
|
||||
rc = mii_ethtool_set_link_ksettings(&tp->mii, cmd);
|
||||
rc = mii_ethtool_sset(&tp->mii, cmd);
|
||||
spin_unlock_irq(&tp->lock);
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -2483,6 +2429,8 @@ static void rtl8139_get_strings(struct net_device *dev, u32 stringset, u8 *data)
|
|||
|
||||
static const struct ethtool_ops rtl8139_ethtool_ops = {
|
||||
.get_drvinfo = rtl8139_get_drvinfo,
|
||||
.get_settings = rtl8139_get_settings,
|
||||
.set_settings = rtl8139_set_settings,
|
||||
.get_regs_len = rtl8139_get_regs_len,
|
||||
.get_regs = rtl8139_get_regs,
|
||||
.nway_reset = rtl8139_nway_reset,
|
||||
|
|
@ -2494,8 +2442,6 @@ static const struct ethtool_ops rtl8139_ethtool_ops = {
|
|||
.get_strings = rtl8139_get_strings,
|
||||
.get_sset_count = rtl8139_get_sset_count,
|
||||
.get_ethtool_stats = rtl8139_get_ethtool_stats,
|
||||
.get_link_ksettings = rtl8139_get_link_ksettings,
|
||||
.set_link_ksettings = rtl8139_set_link_ksettings,
|
||||
};
|
||||
|
||||
static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
||||
|
|
@ -2514,13 +2460,11 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
unsigned long flags;
|
||||
unsigned int start;
|
||||
|
||||
if (netif_running(dev)) {
|
||||
spin_lock_irqsave (&tp->lock, flags);
|
||||
|
|
@ -2529,19 +2473,7 @@ rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
|||
spin_unlock_irqrestore (&tp->lock, flags);
|
||||
}
|
||||
|
||||
netdev_stats_to_stats64(stats, &dev->stats);
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&tp->rx_stats.syncp);
|
||||
stats->rx_packets = tp->rx_stats.packets;
|
||||
stats->rx_bytes = tp->rx_stats.bytes;
|
||||
} while (u64_stats_fetch_retry(&tp->rx_stats.syncp, start));
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&tp->tx_stats.syncp);
|
||||
stats->tx_packets = tp->tx_stats.packets;
|
||||
stats->tx_bytes = tp->tx_stats.bytes;
|
||||
} while (u64_stats_fetch_retry(&tp->tx_stats.syncp, start));
|
||||
return &dev->stats;
|
||||
}
|
||||
|
||||
/* Set or clear the multicast filter for this adaptor.
|
||||
|
|
@ -2581,9 +2513,6 @@ static void __set_rx_mode (struct net_device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
if (dev->features & NETIF_F_RXALL)
|
||||
rx_mode |= (AcceptErr | AcceptRunt);
|
||||
|
||||
/* We can safely update without stopping the chip. */
|
||||
tmp = rtl8139_rx_config | rx_mode;
|
||||
if (tp->rx_config != tmp) {
|
||||
|
|
@ -2604,13 +2533,17 @@ static void rtl8139_set_rx_mode (struct net_device *dev)
|
|||
spin_unlock_irqrestore (&tp->lock, flags);
|
||||
}
|
||||
|
||||
static int __maybe_unused rtl8139_suspend(struct device *device)
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
static int rtl8139_suspend (struct pci_dev *pdev, pm_message_t state)
|
||||
{
|
||||
struct net_device *dev = dev_get_drvdata(device);
|
||||
struct net_device *dev = pci_get_drvdata (pdev);
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
unsigned long flags;
|
||||
|
||||
pci_save_state (pdev);
|
||||
|
||||
if (!netif_running (dev))
|
||||
return 0;
|
||||
|
||||
|
|
@ -2628,30 +2561,38 @@ static int __maybe_unused rtl8139_suspend(struct device *device)
|
|||
|
||||
spin_unlock_irqrestore (&tp->lock, flags);
|
||||
|
||||
pci_set_power_state (pdev, PCI_D3hot);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused rtl8139_resume(struct device *device)
|
||||
{
|
||||
struct net_device *dev = dev_get_drvdata(device);
|
||||
|
||||
static int rtl8139_resume (struct pci_dev *pdev)
|
||||
{
|
||||
struct net_device *dev = pci_get_drvdata (pdev);
|
||||
|
||||
pci_restore_state (pdev);
|
||||
if (!netif_running (dev))
|
||||
return 0;
|
||||
|
||||
pci_set_power_state (pdev, PCI_D0);
|
||||
rtl8139_init_ring (dev);
|
||||
rtl8139_hw_start (dev);
|
||||
netif_device_attach (dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(rtl8139_pm_ops, rtl8139_suspend, rtl8139_resume);
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
|
||||
static struct pci_driver rtl8139_pci_driver = {
|
||||
.name = DRV_NAME,
|
||||
.id_table = rtl8139_pci_tbl,
|
||||
.probe = rtl8139_init_one,
|
||||
.remove = rtl8139_remove_one,
|
||||
.driver.pm = &rtl8139_pm_ops,
|
||||
.remove = __devexit_p(rtl8139_remove_one),
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = rtl8139_suspend,
|
||||
.resume = rtl8139_resume,
|
||||
#endif /* CONFIG_PM */
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
-----<snip>-----
|
||||
|
||||
Written 1997-2001 by Donald Becker.
|
||||
Written 1997-2001 by Donald Becker.
|
||||
This software may be used and distributed according to the
|
||||
terms of the GNU General Public License (GPL), incorporated
|
||||
herein by reference. Drivers based on or derived from this
|
||||
|
|
@ -100,7 +100,6 @@
|
|||
#include <linux/compiler.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
|
|
@ -112,7 +111,6 @@
|
|||
#include <linux/io.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
#define RTL8139_DRIVER_NAME DRV_NAME " Fast Ethernet driver " DRV_VERSION
|
||||
|
|
@ -149,9 +147,9 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
|
|||
|
||||
/* Whether to use MMIO or PIO. Default to MMIO. */
|
||||
#ifdef CONFIG_8139TOO_PIO
|
||||
static bool use_io = true;
|
||||
static int use_io = 1;
|
||||
#else
|
||||
static bool use_io = false;
|
||||
static int use_io = 0;
|
||||
#endif
|
||||
|
||||
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
|
||||
|
|
@ -183,13 +181,10 @@ static int debug = -1;
|
|||
/* Number of Tx descriptor registers. */
|
||||
#define NUM_TX_DESC 4
|
||||
|
||||
/* max supported ethernet frame size -- must be at least (dev->mtu+18+4).*/
|
||||
#define MAX_ETH_FRAME_SIZE 1792
|
||||
/* max supported ethernet frame size -- must be at least (dev->mtu+14+4).*/
|
||||
#define MAX_ETH_FRAME_SIZE 1536
|
||||
|
||||
/* max supported payload size */
|
||||
#define MAX_ETH_DATA_SIZE (MAX_ETH_FRAME_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN)
|
||||
|
||||
/* Size of the Tx bounce buffers -- must be at least (dev->mtu+18+4). */
|
||||
/* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */
|
||||
#define TX_BUF_SIZE MAX_ETH_FRAME_SIZE
|
||||
#define TX_BUF_TOT_LEN (TX_BUF_SIZE * NUM_TX_DESC)
|
||||
|
||||
|
|
@ -232,13 +227,13 @@ typedef enum {
|
|||
static const struct {
|
||||
const char *name;
|
||||
u32 hw_flags;
|
||||
} board_info[] = {
|
||||
} board_info[] __devinitdata = {
|
||||
{ "RealTek RTL8139", RTL8139_CAPS },
|
||||
{ "RealTek RTL8129", RTL8129_CAPS },
|
||||
};
|
||||
|
||||
|
||||
static const struct pci_device_id rtl8139_pci_tbl[] = {
|
||||
static DEFINE_PCI_DEVICE_TABLE(rtl8139_pci_tbl) = {
|
||||
{0x10ec, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
{0x10ec, 0x8138, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
{0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
|
|
@ -258,7 +253,6 @@ static const struct pci_device_id rtl8139_pci_tbl[] = {
|
|||
{0x126c, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
{0x1743, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
{0x021b, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
{0x16ec, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
|
||||
|
||||
#ifdef CONFIG_SH_SECUREEDGE5410
|
||||
/* Bogus 8139 silicon reports 8129 without external PROM :-( */
|
||||
|
|
@ -548,8 +542,8 @@ static const struct {
|
|||
|
||||
{ "RTL-8100",
|
||||
HW_REVID(1, 1, 1, 1, 0, 1, 0),
|
||||
HasLWake,
|
||||
},
|
||||
HasLWake,
|
||||
},
|
||||
|
||||
{ "RTL-8100B/8139D",
|
||||
HW_REVID(1, 1, 1, 0, 1, 0, 1),
|
||||
|
|
@ -570,12 +564,6 @@ struct rtl_extra_stats {
|
|||
unsigned long rx_lost_in_ring;
|
||||
};
|
||||
|
||||
struct rtl8139_stats {
|
||||
u64 packets;
|
||||
u64 bytes;
|
||||
struct u64_stats_sync syncp;
|
||||
};
|
||||
|
||||
struct rtl8139_private {
|
||||
void __iomem *mmio_addr;
|
||||
int drv_flags;
|
||||
|
|
@ -586,13 +574,11 @@ struct rtl8139_private {
|
|||
|
||||
unsigned char *rx_ring;
|
||||
unsigned int cur_rx; /* RX buf index of next pkt */
|
||||
struct rtl8139_stats rx_stats;
|
||||
dma_addr_t rx_ring_dma;
|
||||
|
||||
unsigned int tx_flag;
|
||||
unsigned long cur_tx;
|
||||
unsigned long dirty_tx;
|
||||
struct rtl8139_stats tx_stats;
|
||||
unsigned char *tx_buf[NUM_TX_DESC]; /* Tx bounce buffers */
|
||||
unsigned char *tx_bufs; /* Tx bounce buffer region. */
|
||||
dma_addr_t tx_bufs_dma;
|
||||
|
|
@ -625,7 +611,7 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver");
|
|||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(DRV_VERSION);
|
||||
|
||||
module_param(use_io, bool, 0);
|
||||
module_param(use_io, int, 0);
|
||||
MODULE_PARM_DESC(use_io, "Force use of I/O access mode. 0=MMIO 1=PIO");
|
||||
module_param(multicast_filter_limit, int, 0);
|
||||
module_param_array(media, int, NULL, 0);
|
||||
|
|
@ -642,7 +628,7 @@ static int mdio_read (struct net_device *dev, int phy_id, int location);
|
|||
static void mdio_write (struct net_device *dev, int phy_id, int location,
|
||||
int val);
|
||||
static void rtl8139_start_thread(struct rtl8139_private *tp);
|
||||
static void rtl8139_tx_timeout (struct net_device *dev, unsigned int txqueue);
|
||||
static void rtl8139_tx_timeout (struct net_device *dev);
|
||||
static void rtl8139_init_ring (struct net_device *dev);
|
||||
static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,
|
||||
struct net_device *dev);
|
||||
|
|
@ -654,8 +640,7 @@ static int rtl8139_poll(struct napi_struct *napi, int budget);
|
|||
static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance);
|
||||
static int rtl8139_close (struct net_device *dev);
|
||||
static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
|
||||
static void rtl8139_get_stats64(struct net_device *dev,
|
||||
struct rtnl_link_stats64 *stats);
|
||||
static struct net_device_stats *rtl8139_get_stats (struct net_device *dev);
|
||||
static void rtl8139_set_rx_mode (struct net_device *dev);
|
||||
static void __set_rx_mode (struct net_device *dev);
|
||||
static void rtl8139_hw_start (struct net_device *dev);
|
||||
|
|
@ -731,6 +716,7 @@ static void __rtl8139_cleanup_dev (struct net_device *dev)
|
|||
pci_release_regions (pdev);
|
||||
|
||||
free_netdev(dev);
|
||||
pci_set_drvdata (pdev, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -751,32 +737,26 @@ static void rtl8139_chip_reset (void __iomem *ioaddr)
|
|||
}
|
||||
|
||||
|
||||
static struct net_device *rtl8139_init_board(struct pci_dev *pdev)
|
||||
static __devinit struct net_device * rtl8139_init_board (struct pci_dev *pdev)
|
||||
{
|
||||
struct device *d = &pdev->dev;
|
||||
void __iomem *ioaddr;
|
||||
struct net_device *dev;
|
||||
struct rtl8139_private *tp;
|
||||
u8 tmp8;
|
||||
int rc, disable_dev_on_err = 0;
|
||||
unsigned int i, bar;
|
||||
unsigned long io_len;
|
||||
unsigned int i;
|
||||
unsigned long pio_start, pio_end, pio_flags, pio_len;
|
||||
unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
|
||||
u32 version;
|
||||
static const struct {
|
||||
unsigned long mask;
|
||||
char *type;
|
||||
} res[] = {
|
||||
{ IORESOURCE_IO, "PIO" },
|
||||
{ IORESOURCE_MEM, "MMIO" }
|
||||
};
|
||||
|
||||
assert (pdev != NULL);
|
||||
|
||||
/* dev and priv zeroed in alloc_etherdev */
|
||||
dev = alloc_etherdev (sizeof (*tp));
|
||||
if (dev == NULL)
|
||||
if (dev == NULL) {
|
||||
dev_err(&pdev->dev, "Unable to alloc new net device\n");
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
}
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
|
||||
tp = netdev_priv(dev);
|
||||
|
|
@ -787,48 +767,78 @@ static struct net_device *rtl8139_init_board(struct pci_dev *pdev)
|
|||
if (rc)
|
||||
goto err_out;
|
||||
|
||||
disable_dev_on_err = 1;
|
||||
pio_start = pci_resource_start (pdev, 0);
|
||||
pio_end = pci_resource_end (pdev, 0);
|
||||
pio_flags = pci_resource_flags (pdev, 0);
|
||||
pio_len = pci_resource_len (pdev, 0);
|
||||
|
||||
mmio_start = pci_resource_start (pdev, 1);
|
||||
mmio_end = pci_resource_end (pdev, 1);
|
||||
mmio_flags = pci_resource_flags (pdev, 1);
|
||||
mmio_len = pci_resource_len (pdev, 1);
|
||||
|
||||
/* set this immediately, we need to know before
|
||||
* we talk to the chip directly */
|
||||
pr_debug("PIO region size == 0x%02lX\n", pio_len);
|
||||
pr_debug("MMIO region size == 0x%02lX\n", mmio_len);
|
||||
|
||||
retry:
|
||||
if (use_io) {
|
||||
/* make sure PCI base addr 0 is PIO */
|
||||
if (!(pio_flags & IORESOURCE_IO)) {
|
||||
dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
/* check for weird/broken PCI region reporting */
|
||||
if (pio_len < RTL_MIN_IO_SIZE) {
|
||||
dev_err(&pdev->dev, "Invalid PCI I/O region size(s), aborting\n");
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
} else {
|
||||
/* make sure PCI base addr 1 is MMIO */
|
||||
if (!(mmio_flags & IORESOURCE_MEM)) {
|
||||
dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
if (mmio_len < RTL_MIN_IO_SIZE) {
|
||||
dev_err(&pdev->dev, "Invalid PCI mem region size(s), aborting\n");
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
}
|
||||
|
||||
rc = pci_request_regions (pdev, DRV_NAME);
|
||||
if (rc)
|
||||
goto err_out;
|
||||
disable_dev_on_err = 1;
|
||||
|
||||
/* enable PCI bus-mastering */
|
||||
pci_set_master (pdev);
|
||||
|
||||
u64_stats_init(&tp->rx_stats.syncp);
|
||||
u64_stats_init(&tp->tx_stats.syncp);
|
||||
|
||||
retry:
|
||||
/* PIO bar register comes first. */
|
||||
bar = !use_io;
|
||||
|
||||
io_len = pci_resource_len(pdev, bar);
|
||||
|
||||
dev_dbg(d, "%s region size = 0x%02lX\n", res[bar].type, io_len);
|
||||
|
||||
if (!(pci_resource_flags(pdev, bar) & res[bar].mask)) {
|
||||
dev_err(d, "region #%d not a %s resource, aborting\n", bar,
|
||||
res[bar].type);
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
if (io_len < RTL_MIN_IO_SIZE) {
|
||||
dev_err(d, "Invalid PCI %s region size(s), aborting\n",
|
||||
res[bar].type);
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
ioaddr = pci_iomap(pdev, bar, 0);
|
||||
if (!ioaddr) {
|
||||
dev_err(d, "cannot map %s\n", res[bar].type);
|
||||
if (!use_io) {
|
||||
use_io = true;
|
||||
if (use_io) {
|
||||
ioaddr = pci_iomap(pdev, 0, 0);
|
||||
if (!ioaddr) {
|
||||
dev_err(&pdev->dev, "cannot map PIO, aborting\n");
|
||||
rc = -EIO;
|
||||
goto err_out;
|
||||
}
|
||||
dev->base_addr = pio_start;
|
||||
tp->regs_len = pio_len;
|
||||
} else {
|
||||
/* ioremap MMIO region */
|
||||
ioaddr = pci_iomap(pdev, 1, 0);
|
||||
if (ioaddr == NULL) {
|
||||
dev_err(&pdev->dev, "cannot remap MMIO, trying PIO\n");
|
||||
pci_release_regions(pdev);
|
||||
use_io = 1;
|
||||
goto retry;
|
||||
}
|
||||
rc = -ENODEV;
|
||||
goto err_out;
|
||||
dev->base_addr = (long) ioaddr;
|
||||
tp->regs_len = mmio_len;
|
||||
}
|
||||
tp->regs_len = io_len;
|
||||
tp->mmio_addr = ioaddr;
|
||||
|
||||
/* Bring old chips out of low-power mode. */
|
||||
|
|
@ -897,55 +907,27 @@ err_out:
|
|||
return ERR_PTR(rc);
|
||||
}
|
||||
|
||||
static int rtl8139_set_features(struct net_device *dev, netdev_features_t features)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
unsigned long flags;
|
||||
netdev_features_t changed = features ^ dev->features;
|
||||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
|
||||
if (!(changed & (NETIF_F_RXALL)))
|
||||
return 0;
|
||||
|
||||
spin_lock_irqsave(&tp->lock, flags);
|
||||
|
||||
if (changed & NETIF_F_RXALL) {
|
||||
int rx_mode = tp->rx_config;
|
||||
if (features & NETIF_F_RXALL)
|
||||
rx_mode |= (AcceptErr | AcceptRunt);
|
||||
else
|
||||
rx_mode &= ~(AcceptErr | AcceptRunt);
|
||||
tp->rx_config = rtl8139_rx_config | rx_mode;
|
||||
RTL_W32_F(RxConfig, tp->rx_config);
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&tp->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct net_device_ops rtl8139_netdev_ops = {
|
||||
.ndo_open = rtl8139_open,
|
||||
.ndo_stop = rtl8139_close,
|
||||
.ndo_get_stats64 = rtl8139_get_stats64,
|
||||
.ndo_get_stats = rtl8139_get_stats,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_set_mac_address = rtl8139_set_mac_address,
|
||||
.ndo_start_xmit = rtl8139_start_xmit,
|
||||
.ndo_set_rx_mode = rtl8139_set_rx_mode,
|
||||
.ndo_eth_ioctl = netdev_ioctl,
|
||||
.ndo_set_multicast_list = rtl8139_set_rx_mode,
|
||||
.ndo_do_ioctl = netdev_ioctl,
|
||||
.ndo_tx_timeout = rtl8139_tx_timeout,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = rtl8139_poll_controller,
|
||||
#endif
|
||||
.ndo_set_features = rtl8139_set_features,
|
||||
};
|
||||
|
||||
static int rtl8139_init_one(struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
static int __devinit rtl8139_init_one (struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
{
|
||||
struct net_device *dev = NULL;
|
||||
struct rtl8139_private *tp;
|
||||
__le16 addr[ETH_ALEN / 2];
|
||||
int i, addr_len, option;
|
||||
void __iomem *ioaddr;
|
||||
static int board_idx = -1;
|
||||
|
|
@ -979,7 +961,7 @@ static int rtl8139_init_one(struct pci_dev *pdev,
|
|||
pdev->subsystem_vendor == PCI_VENDOR_ID_ATHEROS &&
|
||||
pdev->subsystem_device == PCI_DEVICE_ID_REALTEK_8139) {
|
||||
pr_info("OQO Model 2 detected. Forcing PIO\n");
|
||||
use_io = true;
|
||||
use_io = 1;
|
||||
}
|
||||
|
||||
dev = rtl8139_init_board (pdev);
|
||||
|
|
@ -995,28 +977,23 @@ static int rtl8139_init_one(struct pci_dev *pdev,
|
|||
|
||||
addr_len = read_eeprom (ioaddr, 0, 8) == 0x8129 ? 8 : 6;
|
||||
for (i = 0; i < 3; i++)
|
||||
addr[i] = cpu_to_le16(read_eeprom (ioaddr, i + 7, addr_len));
|
||||
eth_hw_addr_set(dev, (u8 *)addr);
|
||||
((__le16 *) (dev->dev_addr))[i] =
|
||||
cpu_to_le16(read_eeprom (ioaddr, i + 7, addr_len));
|
||||
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
|
||||
|
||||
/* The Rtl8139-specific entries in the device structure. */
|
||||
dev->netdev_ops = &rtl8139_netdev_ops;
|
||||
dev->ethtool_ops = &rtl8139_ethtool_ops;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
netif_napi_add(dev, &tp->napi, rtl8139_poll);
|
||||
netif_napi_add(dev, &tp->napi, rtl8139_poll, 64);
|
||||
|
||||
/* note: the hardware is not capable of sg/csum/highdma, however
|
||||
* through the use of skb_copy_and_csum_dev we enable these
|
||||
* features
|
||||
*/
|
||||
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
|
||||
dev->vlan_features = dev->features;
|
||||
|
||||
dev->hw_features |= NETIF_F_RXALL;
|
||||
dev->hw_features |= NETIF_F_RXFCS;
|
||||
|
||||
/* MTU range: 68 - 1770 */
|
||||
dev->min_mtu = ETH_MIN_MTU;
|
||||
dev->max_mtu = MAX_ETH_DATA_SIZE;
|
||||
dev->irq = pdev->irq;
|
||||
|
||||
/* tp zeroed and aligned in alloc_etherdev */
|
||||
tp = netdev_priv(dev);
|
||||
|
|
@ -1043,9 +1020,9 @@ static int rtl8139_init_one(struct pci_dev *pdev,
|
|||
|
||||
pci_set_drvdata (pdev, dev);
|
||||
|
||||
netdev_info(dev, "%s at 0x%p, %pM, IRQ %d\n",
|
||||
netdev_info(dev, "%s at 0x%lx, %pM, IRQ %d\n",
|
||||
board_info[ent->driver_data].name,
|
||||
ioaddr, dev->dev_addr, pdev->irq);
|
||||
dev->base_addr, dev->dev_addr, dev->irq);
|
||||
|
||||
netdev_dbg(dev, "Identified 8139 chip type '%s'\n",
|
||||
rtl_chip_info[tp->chipset].name);
|
||||
|
|
@ -1112,14 +1089,13 @@ err_out:
|
|||
}
|
||||
|
||||
|
||||
static void rtl8139_remove_one(struct pci_dev *pdev)
|
||||
static void __devexit rtl8139_remove_one (struct pci_dev *pdev)
|
||||
{
|
||||
struct net_device *dev = pci_get_drvdata (pdev);
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
|
||||
assert (dev != NULL);
|
||||
|
||||
cancel_delayed_work_sync(&tp->thread);
|
||||
flush_scheduled_work();
|
||||
|
||||
unregister_netdev (dev);
|
||||
|
||||
|
|
@ -1143,14 +1119,14 @@ static void rtl8139_remove_one(struct pci_dev *pdev)
|
|||
No extra delay is needed with 33Mhz PCI, but 66Mhz may change this.
|
||||
*/
|
||||
|
||||
#define eeprom_delay() (void)RTL_R8(Cfg9346)
|
||||
#define eeprom_delay() (void)RTL_R32(Cfg9346)
|
||||
|
||||
/* The EEPROM commands include the alway-set leading bit. */
|
||||
#define EE_WRITE_CMD (5)
|
||||
#define EE_READ_CMD (6)
|
||||
#define EE_ERASE_CMD (7)
|
||||
|
||||
static int read_eeprom(void __iomem *ioaddr, int location, int addr_len)
|
||||
static int __devinit read_eeprom (void __iomem *ioaddr, int location, int addr_len)
|
||||
{
|
||||
int i;
|
||||
unsigned retval = 0;
|
||||
|
|
@ -1182,7 +1158,7 @@ static int read_eeprom(void __iomem *ioaddr, int location, int addr_len)
|
|||
}
|
||||
|
||||
/* Terminate the EEPROM access. */
|
||||
RTL_W8(Cfg9346, 0);
|
||||
RTL_W8 (Cfg9346, ~EE_CS);
|
||||
eeprom_delay ();
|
||||
|
||||
return retval;
|
||||
|
|
@ -1320,11 +1296,10 @@ static void mdio_write (struct net_device *dev, int phy_id, int location,
|
|||
static int rtl8139_open (struct net_device *dev)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
const int irq = tp->pci_dev->irq;
|
||||
int retval;
|
||||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
|
||||
retval = request_irq(irq, rtl8139_interrupt, IRQF_SHARED, dev->name, dev);
|
||||
retval = request_irq (dev->irq, rtl8139_interrupt, IRQF_SHARED, dev->name, dev);
|
||||
if (retval)
|
||||
return retval;
|
||||
|
||||
|
|
@ -1333,7 +1308,7 @@ static int rtl8139_open (struct net_device *dev)
|
|||
tp->rx_ring = dma_alloc_coherent(&tp->pci_dev->dev, RX_BUF_TOT_LEN,
|
||||
&tp->rx_ring_dma, GFP_KERNEL);
|
||||
if (tp->tx_bufs == NULL || tp->rx_ring == NULL) {
|
||||
free_irq(irq, dev);
|
||||
free_irq(dev->irq, dev);
|
||||
|
||||
if (tp->tx_bufs)
|
||||
dma_free_coherent(&tp->pci_dev->dev, TX_BUF_TOT_LEN,
|
||||
|
|
@ -1359,7 +1334,7 @@ static int rtl8139_open (struct net_device *dev)
|
|||
"%s() ioaddr %#llx IRQ %d GP Pins %02x %s-duplex\n",
|
||||
__func__,
|
||||
(unsigned long long)pci_resource_start (tp->pci_dev, 1),
|
||||
irq, RTL_R8 (MediaStatus),
|
||||
dev->irq, RTL_R8 (MediaStatus),
|
||||
tp->mii.full_duplex ? "full" : "half");
|
||||
|
||||
rtl8139_start_thread(tp);
|
||||
|
|
@ -1661,10 +1636,6 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
|
|||
int i;
|
||||
u8 tmp8;
|
||||
|
||||
napi_disable(&tp->napi);
|
||||
netif_stop_queue(dev);
|
||||
synchronize_rcu();
|
||||
|
||||
netdev_dbg(dev, "Transmit timeout, status %02x %04x %04x media %02x\n",
|
||||
RTL_R8(ChipCmd), RTL_R16(IntrStatus),
|
||||
RTL_R16(IntrMask), RTL_R8(MediaStatus));
|
||||
|
|
@ -1694,14 +1665,14 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
|
|||
spin_unlock_irq(&tp->lock);
|
||||
|
||||
/* ...and finally, reset everything */
|
||||
napi_enable(&tp->napi);
|
||||
rtl8139_hw_start(dev);
|
||||
netif_wake_queue(dev);
|
||||
|
||||
if (netif_running(dev)) {
|
||||
rtl8139_hw_start (dev);
|
||||
netif_wake_queue (dev);
|
||||
}
|
||||
spin_unlock_bh(&tp->rx_lock);
|
||||
}
|
||||
|
||||
static void rtl8139_tx_timeout(struct net_device *dev, unsigned int txqueue)
|
||||
static void rtl8139_tx_timeout (struct net_device *dev)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
|
||||
|
|
@ -1729,9 +1700,9 @@ static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,
|
|||
if (len < ETH_ZLEN)
|
||||
memset(tp->tx_buf[entry], 0, ETH_ZLEN);
|
||||
skb_copy_and_csum_dev(skb, tp->tx_buf[entry]);
|
||||
dev_kfree_skb_any(skb);
|
||||
dev_kfree_skb(skb);
|
||||
} else {
|
||||
dev_kfree_skb_any(skb);
|
||||
dev_kfree_skb(skb);
|
||||
dev->stats.tx_dropped++;
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
|
@ -1803,10 +1774,8 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
|
|||
dev->stats.tx_fifo_errors++;
|
||||
}
|
||||
dev->stats.collisions += (txstatus >> 24) & 15;
|
||||
u64_stats_update_begin(&tp->tx_stats.syncp);
|
||||
tp->tx_stats.packets++;
|
||||
tp->tx_stats.bytes += txstatus & 0x7ff;
|
||||
u64_stats_update_end(&tp->tx_stats.syncp);
|
||||
dev->stats.tx_bytes += txstatus & 0x7ff;
|
||||
dev->stats.tx_packets++;
|
||||
}
|
||||
|
||||
dirty_tx++;
|
||||
|
|
@ -1969,10 +1938,7 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
|
|||
/* read size+status of next frame from DMA ring buffer */
|
||||
rx_status = le32_to_cpu (*(__le32 *) (rx_ring + ring_offset));
|
||||
rx_size = rx_status >> 16;
|
||||
if (likely(!(dev->features & NETIF_F_RXFCS)))
|
||||
pkt_size = rx_size - 4;
|
||||
else
|
||||
pkt_size = rx_size;
|
||||
pkt_size = rx_size - 4;
|
||||
|
||||
netif_dbg(tp, rx_status, dev, "%s() status %04x, size %04x, cur %04x\n",
|
||||
__func__, rx_status, rx_size, cur_rx);
|
||||
|
|
@ -2010,34 +1976,15 @@ no_early_rx:
|
|||
if (unlikely((rx_size > (MAX_ETH_FRAME_SIZE+4)) ||
|
||||
(rx_size < 8) ||
|
||||
(!(rx_status & RxStatusOK)))) {
|
||||
if ((dev->features & NETIF_F_RXALL) &&
|
||||
(rx_size <= (MAX_ETH_FRAME_SIZE + 4)) &&
|
||||
(rx_size >= 8) &&
|
||||
(!(rx_status & RxStatusOK))) {
|
||||
/* Length is at least mostly OK, but pkt has
|
||||
* error. I'm hoping we can handle some of these
|
||||
* errors without resetting the chip. --Ben
|
||||
*/
|
||||
dev->stats.rx_errors++;
|
||||
if (rx_status & RxCRCErr) {
|
||||
dev->stats.rx_crc_errors++;
|
||||
goto keep_pkt;
|
||||
}
|
||||
if (rx_status & RxRunt) {
|
||||
dev->stats.rx_length_errors++;
|
||||
goto keep_pkt;
|
||||
}
|
||||
}
|
||||
rtl8139_rx_err (rx_status, dev, tp, ioaddr);
|
||||
received = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
keep_pkt:
|
||||
/* Malloc up new buffer, compatible with net-2e. */
|
||||
/* Omit the four octet CRC from the length. */
|
||||
|
||||
skb = napi_alloc_skb(&tp->napi, pkt_size);
|
||||
skb = netdev_alloc_skb_ip_align(dev, pkt_size);
|
||||
if (likely(skb)) {
|
||||
#if RX_BUF_IDX == 3
|
||||
wrap_copy(skb, rx_ring, ring_offset+4, pkt_size);
|
||||
|
|
@ -2048,13 +1995,13 @@ keep_pkt:
|
|||
|
||||
skb->protocol = eth_type_trans (skb, dev);
|
||||
|
||||
u64_stats_update_begin(&tp->rx_stats.syncp);
|
||||
tp->rx_stats.packets++;
|
||||
tp->rx_stats.bytes += pkt_size;
|
||||
u64_stats_update_end(&tp->rx_stats.syncp);
|
||||
dev->stats.rx_bytes += pkt_size;
|
||||
dev->stats.rx_packets++;
|
||||
|
||||
netif_receive_skb (skb);
|
||||
} else {
|
||||
if (net_ratelimit())
|
||||
netdev_warn(dev, "Memory squeeze, dropping packet\n");
|
||||
dev->stats.rx_dropped++;
|
||||
}
|
||||
received++;
|
||||
|
|
@ -2137,10 +2084,13 @@ static int rtl8139_poll(struct napi_struct *napi, int budget)
|
|||
|
||||
if (work_done < budget) {
|
||||
unsigned long flags;
|
||||
|
||||
/*
|
||||
* Order is important since data can get interrupted
|
||||
* again when we think we are done.
|
||||
*/
|
||||
spin_lock_irqsave(&tp->lock, flags);
|
||||
if (napi_complete_done(napi, work_done))
|
||||
RTL_W16_F(IntrMask, rtl8139_intr_mask);
|
||||
__napi_complete(napi);
|
||||
RTL_W16_F(IntrMask, rtl8139_intr_mask);
|
||||
spin_unlock_irqrestore(&tp->lock, flags);
|
||||
}
|
||||
spin_unlock(&tp->rx_lock);
|
||||
|
|
@ -2221,12 +2171,9 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance)
|
|||
*/
|
||||
static void rtl8139_poll_controller(struct net_device *dev)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
const int irq = tp->pci_dev->irq;
|
||||
|
||||
disable_irq_nosync(irq);
|
||||
rtl8139_interrupt(irq, dev);
|
||||
enable_irq(irq);
|
||||
disable_irq(dev->irq);
|
||||
rtl8139_interrupt(dev->irq, dev);
|
||||
enable_irq(dev->irq);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -2239,7 +2186,7 @@ static int rtl8139_set_mac_address(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
|
||||
spin_lock_irq(&tp->lock);
|
||||
|
||||
|
|
@ -2279,7 +2226,7 @@ static int rtl8139_close (struct net_device *dev)
|
|||
|
||||
spin_unlock_irqrestore (&tp->lock, flags);
|
||||
|
||||
free_irq(tp->pci_dev->irq, dev);
|
||||
free_irq (dev->irq, dev);
|
||||
|
||||
rtl8139_tx_clear (tp);
|
||||
|
||||
|
|
@ -2380,28 +2327,27 @@ static int rtl8139_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
|
|||
static void rtl8139_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
strscpy(info->driver, DRV_NAME, sizeof(info->driver));
|
||||
strscpy(info->version, DRV_VERSION, sizeof(info->version));
|
||||
strscpy(info->bus_info, pci_name(tp->pci_dev), sizeof(info->bus_info));
|
||||
strcpy(info->driver, DRV_NAME);
|
||||
strcpy(info->version, DRV_VERSION);
|
||||
strcpy(info->bus_info, pci_name(tp->pci_dev));
|
||||
info->regdump_len = tp->regs_len;
|
||||
}
|
||||
|
||||
static int rtl8139_get_link_ksettings(struct net_device *dev,
|
||||
struct ethtool_link_ksettings *cmd)
|
||||
static int rtl8139_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
spin_lock_irq(&tp->lock);
|
||||
mii_ethtool_get_link_ksettings(&tp->mii, cmd);
|
||||
mii_ethtool_gset(&tp->mii, cmd);
|
||||
spin_unlock_irq(&tp->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtl8139_set_link_ksettings(struct net_device *dev,
|
||||
const struct ethtool_link_ksettings *cmd)
|
||||
static int rtl8139_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
int rc;
|
||||
spin_lock_irq(&tp->lock);
|
||||
rc = mii_ethtool_set_link_ksettings(&tp->mii, cmd);
|
||||
rc = mii_ethtool_sset(&tp->mii, cmd);
|
||||
spin_unlock_irq(&tp->lock);
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -2483,6 +2429,8 @@ static void rtl8139_get_strings(struct net_device *dev, u32 stringset, u8 *data)
|
|||
|
||||
static const struct ethtool_ops rtl8139_ethtool_ops = {
|
||||
.get_drvinfo = rtl8139_get_drvinfo,
|
||||
.get_settings = rtl8139_get_settings,
|
||||
.set_settings = rtl8139_set_settings,
|
||||
.get_regs_len = rtl8139_get_regs_len,
|
||||
.get_regs = rtl8139_get_regs,
|
||||
.nway_reset = rtl8139_nway_reset,
|
||||
|
|
@ -2494,8 +2442,6 @@ static const struct ethtool_ops rtl8139_ethtool_ops = {
|
|||
.get_strings = rtl8139_get_strings,
|
||||
.get_sset_count = rtl8139_get_sset_count,
|
||||
.get_ethtool_stats = rtl8139_get_ethtool_stats,
|
||||
.get_link_ksettings = rtl8139_get_link_ksettings,
|
||||
.set_link_ksettings = rtl8139_set_link_ksettings,
|
||||
};
|
||||
|
||||
static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
||||
|
|
@ -2514,13 +2460,11 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)
|
||||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
unsigned long flags;
|
||||
unsigned int start;
|
||||
|
||||
if (netif_running(dev)) {
|
||||
spin_lock_irqsave (&tp->lock, flags);
|
||||
|
|
@ -2529,19 +2473,7 @@ rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
|||
spin_unlock_irqrestore (&tp->lock, flags);
|
||||
}
|
||||
|
||||
netdev_stats_to_stats64(stats, &dev->stats);
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&tp->rx_stats.syncp);
|
||||
stats->rx_packets = tp->rx_stats.packets;
|
||||
stats->rx_bytes = tp->rx_stats.bytes;
|
||||
} while (u64_stats_fetch_retry(&tp->rx_stats.syncp, start));
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&tp->tx_stats.syncp);
|
||||
stats->tx_packets = tp->tx_stats.packets;
|
||||
stats->tx_bytes = tp->tx_stats.bytes;
|
||||
} while (u64_stats_fetch_retry(&tp->tx_stats.syncp, start));
|
||||
return &dev->stats;
|
||||
}
|
||||
|
||||
/* Set or clear the multicast filter for this adaptor.
|
||||
|
|
@ -2581,9 +2513,6 @@ static void __set_rx_mode (struct net_device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
if (dev->features & NETIF_F_RXALL)
|
||||
rx_mode |= (AcceptErr | AcceptRunt);
|
||||
|
||||
/* We can safely update without stopping the chip. */
|
||||
tmp = rtl8139_rx_config | rx_mode;
|
||||
if (tp->rx_config != tmp) {
|
||||
|
|
@ -2604,13 +2533,17 @@ static void rtl8139_set_rx_mode (struct net_device *dev)
|
|||
spin_unlock_irqrestore (&tp->lock, flags);
|
||||
}
|
||||
|
||||
static int __maybe_unused rtl8139_suspend(struct device *device)
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
static int rtl8139_suspend (struct pci_dev *pdev, pm_message_t state)
|
||||
{
|
||||
struct net_device *dev = dev_get_drvdata(device);
|
||||
struct net_device *dev = pci_get_drvdata (pdev);
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
unsigned long flags;
|
||||
|
||||
pci_save_state (pdev);
|
||||
|
||||
if (!netif_running (dev))
|
||||
return 0;
|
||||
|
||||
|
|
@ -2628,30 +2561,38 @@ static int __maybe_unused rtl8139_suspend(struct device *device)
|
|||
|
||||
spin_unlock_irqrestore (&tp->lock, flags);
|
||||
|
||||
pci_set_power_state (pdev, PCI_D3hot);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused rtl8139_resume(struct device *device)
|
||||
{
|
||||
struct net_device *dev = dev_get_drvdata(device);
|
||||
|
||||
static int rtl8139_resume (struct pci_dev *pdev)
|
||||
{
|
||||
struct net_device *dev = pci_get_drvdata (pdev);
|
||||
|
||||
pci_restore_state (pdev);
|
||||
if (!netif_running (dev))
|
||||
return 0;
|
||||
|
||||
pci_set_power_state (pdev, PCI_D0);
|
||||
rtl8139_init_ring (dev);
|
||||
rtl8139_hw_start (dev);
|
||||
netif_device_attach (dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(rtl8139_pm_ops, rtl8139_suspend, rtl8139_resume);
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
|
||||
static struct pci_driver rtl8139_pci_driver = {
|
||||
.name = DRV_NAME,
|
||||
.id_table = rtl8139_pci_tbl,
|
||||
.probe = rtl8139_init_one,
|
||||
.remove = rtl8139_remove_one,
|
||||
.driver.pm = &rtl8139_pm_ops,
|
||||
.remove = __devexit_p(rtl8139_remove_one),
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = rtl8139_suspend,
|
||||
.resume = rtl8139_resume,
|
||||
#endif /* CONFIG_PM */
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -17,16 +19,22 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
EtherCAT driver for RTL8139-compatible NICs.
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
Former documentation:
|
||||
|
|
@ -648,7 +656,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -17,16 +19,22 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
EtherCAT driver for RTL8139-compatible NICs.
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
Former documentation:
|
||||
|
|
@ -657,7 +665,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -17,16 +19,22 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
EtherCAT driver for RTL8139-compatible NICs.
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
Former documentation:
|
||||
|
|
@ -657,7 +665,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -17,16 +19,22 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
EtherCAT driver for RTL8139-compatible NICs.
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
Former documentation:
|
||||
|
|
@ -657,7 +665,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -17,16 +19,22 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
EtherCAT driver for RTL8139-compatible NICs.
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
Former documentation:
|
||||
|
|
@ -657,7 +665,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -17,16 +19,22 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
EtherCAT driver for RTL8139-compatible NICs.
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
Former documentation:
|
||||
|
|
@ -649,7 +657,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -17,16 +19,22 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
EtherCAT driver for RTL8139-compatible NICs.
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
Former documentation:
|
||||
|
|
@ -657,7 +665,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -17,16 +19,22 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
EtherCAT driver for RTL8139-compatible NICs.
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
Former documentation:
|
||||
|
|
@ -657,7 +665,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -17,16 +19,22 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
EtherCAT driver for RTL8139-compatible NICs.
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
Former documentation:
|
||||
|
|
@ -657,7 +665,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -17,16 +19,22 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
EtherCAT driver for RTL8139-compatible NICs.
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
Former documentation:
|
||||
|
|
@ -661,7 +669,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,12 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
|
@ -662,7 +668,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -17,16 +17,22 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
EtherCAT driver for RTL8139-compatible NICs.
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
Former documentation:
|
||||
|
|
@ -673,7 +679,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -17,16 +17,22 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
EtherCAT driver for RTL8139-compatible NICs.
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
Former documentation:
|
||||
|
|
@ -662,7 +668,7 @@ struct rtl8139_private {
|
|||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,11 @@
|
|||
* with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
|
|
@ -660,19 +665,10 @@ struct rtl8139_private {
|
|||
unsigned int regs_len;
|
||||
unsigned long fifo_copy_timeout;
|
||||
|
||||
ec_device_t *ecdev_;
|
||||
bool ecdev_initialized;
|
||||
ec_device_t *ecdev;
|
||||
};
|
||||
|
||||
static inline ec_device_t *get_ecdev(struct rtl8139_private *adapter)
|
||||
{
|
||||
#ifdef EC_ENABLE_DRIVER_RESOURCE_VERIFYING
|
||||
WARN_ON(!adapter->ecdev_initialized);
|
||||
#endif
|
||||
return adapter->ecdev_;
|
||||
}
|
||||
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(EC_MASTER_VERSION);
|
||||
|
|
@ -1092,10 +1088,9 @@ static int rtl8139_init_one(struct pci_dev *pdev,
|
|||
/* dev is fully set up and ready to use now */
|
||||
|
||||
// offer device to EtherCAT master module
|
||||
tp->ecdev_ = ecdev_offer(dev, ec_poll, THIS_MODULE);
|
||||
tp->ecdev_initialized = true;
|
||||
tp->ecdev = ecdev_offer(dev, ec_poll, THIS_MODULE);
|
||||
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
pr_debug("about to register device named %s (%p)...\n",
|
||||
dev->name, dev);
|
||||
i = register_netdev (dev);
|
||||
|
|
@ -1168,10 +1163,10 @@ static int rtl8139_init_one(struct pci_dev *pdev,
|
|||
if (rtl_chip_info[tp->chipset].flags & HasHltClk)
|
||||
RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */
|
||||
|
||||
if (get_ecdev(tp)) {
|
||||
i = ecdev_open(get_ecdev(tp));
|
||||
if (tp->ecdev) {
|
||||
i = ecdev_open(tp->ecdev);
|
||||
if (i) {
|
||||
ecdev_withdraw(get_ecdev(tp));
|
||||
ecdev_withdraw(tp->ecdev);
|
||||
goto err_out;
|
||||
}
|
||||
}
|
||||
|
|
@ -1192,9 +1187,9 @@ static void rtl8139_remove_one(struct pci_dev *pdev)
|
|||
|
||||
assert (dev != NULL);
|
||||
|
||||
if (get_ecdev(tp)) {
|
||||
ecdev_close(get_ecdev(tp));
|
||||
ecdev_withdraw(get_ecdev(tp));
|
||||
if (tp->ecdev) {
|
||||
ecdev_close(tp->ecdev);
|
||||
ecdev_withdraw(tp->ecdev);
|
||||
}
|
||||
else {
|
||||
cancel_delayed_work_sync(&tp->thread);
|
||||
|
|
@ -1403,7 +1398,7 @@ static int rtl8139_open (struct net_device *dev)
|
|||
const int irq = tp->pci_dev->irq;
|
||||
int retval;
|
||||
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
retval = request_irq(irq, rtl8139_interrupt, IRQF_SHARED, dev->name, dev);
|
||||
if (retval)
|
||||
return retval;
|
||||
|
|
@ -1414,7 +1409,7 @@ static int rtl8139_open (struct net_device *dev)
|
|||
tp->rx_ring = dma_alloc_coherent(&tp->pci_dev->dev, RX_BUF_TOT_LEN,
|
||||
&tp->rx_ring_dma, GFP_KERNEL);
|
||||
if (tp->tx_bufs == NULL || tp->rx_ring == NULL) {
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
free_irq(irq, dev);
|
||||
}
|
||||
|
||||
|
|
@ -1436,7 +1431,7 @@ static int rtl8139_open (struct net_device *dev)
|
|||
|
||||
rtl8139_init_ring (dev);
|
||||
rtl8139_hw_start (dev);
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
netif_start_queue (dev);
|
||||
}
|
||||
|
||||
|
|
@ -1447,7 +1442,7 @@ static int rtl8139_open (struct net_device *dev)
|
|||
irq, RTL_R8 (MediaStatus),
|
||||
tp->mii.full_duplex ? "full" : "half");
|
||||
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
rtl8139_start_thread(tp);
|
||||
}
|
||||
|
||||
|
|
@ -1459,10 +1454,10 @@ static void rtl_check_media (struct net_device *dev, unsigned int init_media)
|
|||
{
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
|
||||
if (get_ecdev(tp)) {
|
||||
if (tp->ecdev) {
|
||||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
u16 state = RTL_R16(BasicModeStatus) & BMSR_LSTATUS;
|
||||
ecdev_set_link(get_ecdev(tp), state ? 1 : 0);
|
||||
ecdev_set_link(tp->ecdev, state ? 1 : 0);
|
||||
}
|
||||
else {
|
||||
if (tp->phys[0] >= 0) {
|
||||
|
|
@ -1533,7 +1528,7 @@ static void rtl8139_hw_start (struct net_device *dev)
|
|||
if ((!(tmp & CmdRxEnb)) || (!(tmp & CmdTxEnb)))
|
||||
RTL_W8 (ChipCmd, CmdRxEnb | CmdTxEnb);
|
||||
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
/* Enable all known interrupts by setting the interrupt mask. */
|
||||
RTL_W16 (IntrMask, rtl8139_intr_mask);
|
||||
}
|
||||
|
|
@ -1780,7 +1775,7 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
|
|||
if (tmp8 & CmdTxEnb)
|
||||
RTL_W8 (ChipCmd, CmdRxEnb);
|
||||
|
||||
if (get_ecdev(tp)) {
|
||||
if (tp->ecdev) {
|
||||
rtl8139_tx_clear (tp);
|
||||
rtl8139_hw_start (dev);
|
||||
}
|
||||
|
|
@ -1808,7 +1803,7 @@ static void rtl8139_tx_timeout(struct net_device *dev, unsigned int txqueue)
|
|||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
|
||||
tp->watchdog_fired = 1;
|
||||
if (!get_ecdev(tp) && !tp->have_thread) {
|
||||
if (!tp->ecdev && !tp->have_thread) {
|
||||
INIT_DELAYED_WORK(&tp->thread, rtl8139_thread);
|
||||
schedule_delayed_work(&tp->thread, next_tick);
|
||||
}
|
||||
|
|
@ -1831,18 +1826,18 @@ static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,
|
|||
if (len < ETH_ZLEN)
|
||||
memset(tp->tx_buf[entry], 0, ETH_ZLEN);
|
||||
skb_copy_and_csum_dev(skb, tp->tx_buf[entry]);
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
dev_kfree_skb_any(skb);
|
||||
}
|
||||
} else {
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
dev_kfree_skb_any(skb);
|
||||
}
|
||||
dev->stats.tx_dropped++;
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
spin_lock_irqsave(&tp->lock, flags);
|
||||
}
|
||||
/*
|
||||
|
|
@ -1856,7 +1851,7 @@ static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,
|
|||
|
||||
tp->cur_tx++;
|
||||
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx)
|
||||
netif_stop_queue (dev);
|
||||
spin_unlock_irqrestore(&tp->lock, flags);
|
||||
|
|
@ -1935,7 +1930,7 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
|
|||
if (tp->dirty_tx != dirty_tx) {
|
||||
tp->dirty_tx = dirty_tx;
|
||||
mb();
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
netif_wake_queue (dev);
|
||||
}
|
||||
}
|
||||
|
|
@ -2071,7 +2066,7 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
|
|||
RTL_R16 (RxBufAddr),
|
||||
RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd));
|
||||
|
||||
while ((get_ecdev(tp) || netif_running(dev))
|
||||
while ((tp->ecdev || netif_running(dev))
|
||||
&& received < budget
|
||||
&& (RTL_R8 (ChipCmd) & RxBufEmpty) == 0) {
|
||||
u32 ring_offset = cur_rx % RX_BUF_LEN;
|
||||
|
|
@ -2089,7 +2084,7 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
|
|||
else
|
||||
pkt_size = rx_size;
|
||||
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
if (netif_msg_rx_status(tp))
|
||||
pr_debug("%s: rtl8139_rx() status %4.4x, size %4.4x,"
|
||||
" cur %4.4x.\n", dev->name, rx_status,
|
||||
|
|
@ -2161,8 +2156,8 @@ no_early_rx:
|
|||
}
|
||||
|
||||
keep_pkt:
|
||||
if (get_ecdev(tp)) {
|
||||
ecdev_receive(get_ecdev(tp), &rx_ring[ring_offset + 4], pkt_size);
|
||||
if (tp->ecdev) {
|
||||
ecdev_receive(tp->ecdev, &rx_ring[ring_offset + 4], pkt_size);
|
||||
}
|
||||
else {
|
||||
/* Malloc up new buffer, compatible with net-2e. */
|
||||
|
|
@ -2300,7 +2295,7 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance)
|
|||
int link_changed = 0; /* avoid bogus "uninit" warning */
|
||||
int handled = 0;
|
||||
|
||||
if (get_ecdev(tp)) {
|
||||
if (tp->ecdev) {
|
||||
status = RTL_R16 (IntrStatus);
|
||||
}
|
||||
else {
|
||||
|
|
@ -2318,7 +2313,7 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance)
|
|||
if (unlikely(status == 0xFFFF))
|
||||
goto out;
|
||||
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
/* close possible race's with dev_close */
|
||||
if (unlikely(!netif_running(dev))) {
|
||||
RTL_W16 (IntrMask, 0);
|
||||
|
|
@ -2338,7 +2333,7 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance)
|
|||
/* Receive packets are processed by poll routine.
|
||||
If not running start it now. */
|
||||
if (status & RxAckBits){
|
||||
if (get_ecdev(tp)) {
|
||||
if (tp->ecdev) {
|
||||
/* EtherCAT device: Just receive all frames */
|
||||
rtl8139_rx(dev, tp, 100); // FIXME
|
||||
} else {
|
||||
|
|
@ -2361,7 +2356,7 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance)
|
|||
RTL_W16 (IntrStatus, TxErr);
|
||||
}
|
||||
out:
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
spin_unlock (&tp->lock);
|
||||
}
|
||||
|
||||
|
|
@ -2415,7 +2410,7 @@ static int rtl8139_close (struct net_device *dev)
|
|||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
unsigned long flags = 0;
|
||||
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
netif_stop_queue(dev);
|
||||
napi_disable(&tp->napi);
|
||||
|
||||
|
|
@ -2436,7 +2431,7 @@ static int rtl8139_close (struct net_device *dev)
|
|||
dev->stats.rx_missed_errors += RTL_R32 (RxMissed);
|
||||
RTL_W32 (RxMissed, 0);
|
||||
|
||||
if (!get_ecdev(tp)) {
|
||||
if (!tp->ecdev) {
|
||||
spin_unlock_irqrestore (&tp->lock, flags);
|
||||
|
||||
free_irq(tp->pci_dev->irq, dev);
|
||||
|
|
@ -2664,7 +2659,7 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
|||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
int rc;
|
||||
|
||||
if (get_ecdev(tp) || !netif_running(dev))
|
||||
if (tp->ecdev || !netif_running(dev))
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irq(&tp->lock);
|
||||
|
|
@ -2683,7 +2678,7 @@ rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
|||
unsigned long flags;
|
||||
unsigned int start;
|
||||
|
||||
if (get_ecdev(tp) || netif_running(dev)) {
|
||||
if (tp->ecdev || netif_running(dev)) {
|
||||
spin_lock_irqsave (&tp->lock, flags);
|
||||
dev->stats.rx_missed_errors += RTL_R32 (RxMissed);
|
||||
RTL_W32 (RxMissed, 0);
|
||||
|
|
@ -2772,7 +2767,7 @@ static int __maybe_unused rtl8139_suspend(struct device *device)
|
|||
void __iomem *ioaddr = tp->mmio_addr;
|
||||
unsigned long flags;
|
||||
|
||||
if (get_ecdev(tp) || !netif_running (dev))
|
||||
if (tp->ecdev || !netif_running (dev))
|
||||
return 0;
|
||||
|
||||
netif_device_detach (dev);
|
||||
|
|
@ -2797,7 +2792,7 @@ static int __maybe_unused rtl8139_resume(struct device *device)
|
|||
struct net_device *dev = dev_get_drvdata(device);
|
||||
struct rtl8139_private *tp = netdev_priv(dev);
|
||||
|
||||
if (get_ecdev(tp) || !netif_running (dev))
|
||||
if (tp->ecdev || !netif_running (dev))
|
||||
return 0;
|
||||
|
||||
rtl8139_init_ring (dev);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#-----------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
#
|
||||
|
|
@ -19,17 +21,15 @@
|
|||
#
|
||||
# ---
|
||||
#
|
||||
# The license mentioned above concerns the source code only. Using the
|
||||
# EtherCAT technology and brand is only permitted in compliance with the
|
||||
# industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
#
|
||||
# ---
|
||||
#
|
||||
# vim: syntax=make
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
src := @abs_srcdir@
|
||||
ccflags-y := -I@abs_top_builddir@
|
||||
|
||||
ifeq (@ENABLE_DRIVER_RESOURCE_VERIFYING@,1)
|
||||
ccflags-y += -DEC_ENABLE_DRIVER_RESOURCE_VERIFYING
|
||||
endif
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
REV := $(shell if test -s $(src)/../revision; then \
|
||||
cat $(src)/../revision; \
|
||||
|
|
@ -101,4 +101,4 @@ KBUILD_EXTRA_SYMBOLS := \
|
|||
@abs_top_builddir@/$(LINUX_SYMVERS) \
|
||||
@abs_top_builddir@/master/$(LINUX_SYMVERS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Copyright (C) 2006-2025 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
# Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
#
|
||||
# This file is part of the IgH EtherCAT Master.
|
||||
#
|
||||
|
|
@ -17,6 +17,12 @@
|
|||
# with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# ---
|
||||
#
|
||||
# The license mentioned above concerns the source code only. Using the
|
||||
# EtherCAT technology and brand is only permitted in compliance with the
|
||||
# industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
include $(top_srcdir)/Makefile.kbuild
|
||||
|
|
@ -31,7 +37,46 @@ SUBDIRS = \
|
|||
r8169 \
|
||||
stmmac
|
||||
|
||||
EXTRA_DIST = \
|
||||
# using HEADERS to enable tags target
|
||||
noinst_HEADERS = \
|
||||
8139too-2.6.13-ethercat.c \
|
||||
8139too-2.6.13-orig.c \
|
||||
8139too-2.6.17-ethercat.c \
|
||||
8139too-2.6.17-orig.c \
|
||||
8139too-2.6.18-ethercat.c \
|
||||
8139too-2.6.18-orig.c \
|
||||
8139too-2.6.19-ethercat.c \
|
||||
8139too-2.6.19-orig.c \
|
||||
8139too-2.6.22-ethercat.c \
|
||||
8139too-2.6.22-orig.c \
|
||||
8139too-2.6.23-ethercat.c \
|
||||
8139too-2.6.23-orig.c \
|
||||
8139too-2.6.24-ethercat.c \
|
||||
8139too-2.6.24-orig.c \
|
||||
8139too-2.6.25-ethercat.c \
|
||||
8139too-2.6.25-orig.c \
|
||||
8139too-2.6.26-ethercat.c \
|
||||
8139too-2.6.26-orig.c \
|
||||
8139too-2.6.27-ethercat.c \
|
||||
8139too-2.6.27-orig.c \
|
||||
8139too-2.6.28-ethercat.c \
|
||||
8139too-2.6.28-orig.c \
|
||||
8139too-2.6.29-ethercat.c \
|
||||
8139too-2.6.29-orig.c \
|
||||
8139too-2.6.31-ethercat.c \
|
||||
8139too-2.6.31-orig.c \
|
||||
8139too-2.6.32-ethercat.c \
|
||||
8139too-2.6.32-orig.c \
|
||||
8139too-2.6.33-ethercat.c \
|
||||
8139too-2.6.33-orig.c \
|
||||
8139too-2.6.34-ethercat.c \
|
||||
8139too-2.6.34-orig.c \
|
||||
8139too-2.6.35-ethercat.c \
|
||||
8139too-2.6.35-orig.c \
|
||||
8139too-2.6.36-ethercat.c \
|
||||
8139too-2.6.36-orig.c \
|
||||
8139too-2.6.37-ethercat.c \
|
||||
8139too-2.6.37-orig.c \
|
||||
8139too-3.0-ethercat.c \
|
||||
8139too-3.0-orig.c \
|
||||
8139too-3.10-ethercat.c \
|
||||
|
|
@ -60,12 +105,30 @@ EXTRA_DIST = \
|
|||
8139too-5.15-orig.c \
|
||||
8139too-6.1-ethercat.c \
|
||||
8139too-6.1-orig.c \
|
||||
8139too-6.12-ethercat.c \
|
||||
8139too-6.12-orig.c \
|
||||
8139too-6.4-ethercat.c \
|
||||
8139too-6.4-orig.c \
|
||||
create_driver_table.py \
|
||||
device_drivers_template.md \
|
||||
e100-2.6.20-ethercat.c \
|
||||
e100-2.6.20-orig.c \
|
||||
e100-2.6.24-ethercat.c \
|
||||
e100-2.6.24-orig.c \
|
||||
e100-2.6.26-ethercat.c \
|
||||
e100-2.6.26-orig.c \
|
||||
e100-2.6.27-ethercat.c \
|
||||
e100-2.6.27-orig.c \
|
||||
e100-2.6.28-ethercat.c \
|
||||
e100-2.6.28-orig.c \
|
||||
e100-2.6.29-ethercat.c \
|
||||
e100-2.6.29-orig.c \
|
||||
e100-2.6.31-ethercat.c \
|
||||
e100-2.6.31-orig.c \
|
||||
e100-2.6.32-ethercat.c \
|
||||
e100-2.6.32-orig.c \
|
||||
e100-2.6.33-ethercat.c \
|
||||
e100-2.6.33-orig.c \
|
||||
e100-2.6.35-ethercat.c \
|
||||
e100-2.6.35-orig.c \
|
||||
e100-2.6.37-ethercat.c \
|
||||
e100-2.6.37-orig.c \
|
||||
e100-3.0-ethercat.c \
|
||||
e100-3.0-orig.c \
|
||||
e100-3.10-ethercat.c \
|
||||
|
|
@ -84,22 +147,40 @@ EXTRA_DIST = \
|
|||
e100-3.8-orig.c \
|
||||
e100-4.4-ethercat.c \
|
||||
e100-4.4-orig.c \
|
||||
e100-5.4-ethercat.c \
|
||||
e100-5.4-orig.c \
|
||||
e100-5.10-ethercat.c \
|
||||
e100-5.10-orig.c \
|
||||
e100-5.14-ethercat.c \
|
||||
e100-5.14-orig.c \
|
||||
e100-5.15-ethercat.c \
|
||||
e100-5.15-orig.c \
|
||||
e100-5.4-ethercat.c \
|
||||
e100-5.4-orig.c \
|
||||
e100-6.1-ethercat.c \
|
||||
e100-6.1-orig.c \
|
||||
e100-6.12-ethercat.c \
|
||||
e100-6.12-orig.c \
|
||||
e100-6.4-ethercat.c \
|
||||
e100-6.4-orig.c \
|
||||
ecdev.h \
|
||||
generic.c \
|
||||
r8169-2.6.24-ethercat.c \
|
||||
r8169-2.6.24-orig.c \
|
||||
r8169-2.6.27-ethercat.c \
|
||||
r8169-2.6.27-orig.c \
|
||||
r8169-2.6.28-ethercat.c \
|
||||
r8169-2.6.28-orig.c \
|
||||
r8169-2.6.29-ethercat.c \
|
||||
r8169-2.6.29-orig.c \
|
||||
r8169-2.6.31-ethercat.c \
|
||||
r8169-2.6.31-orig.c \
|
||||
r8169-2.6.32-ethercat.c \
|
||||
r8169-2.6.32-orig.c \
|
||||
r8169-2.6.33-ethercat.c \
|
||||
r8169-2.6.33-orig.c \
|
||||
r8169-2.6.35-ethercat.c \
|
||||
r8169-2.6.35-orig.c \
|
||||
r8169-2.6.36-ethercat.c \
|
||||
r8169-2.6.36-orig.c \
|
||||
r8169-2.6.37-ethercat.c \
|
||||
r8169-2.6.37-orig.c \
|
||||
r8169-3.10-ethercat.c \
|
||||
r8169-3.10-orig.c \
|
||||
r8169-3.12-ethercat.c \
|
||||
|
|
@ -117,7 +198,6 @@ EXTRA_DIST = \
|
|||
r8169-3.8-ethercat.c \
|
||||
r8169-3.8-orig.c \
|
||||
r8169-4.4-ethercat.c \
|
||||
r8169-4.4-orig.c \
|
||||
update.sh
|
||||
r8169-4.4-orig.c
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#-----------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
#
|
||||
|
|
@ -19,12 +21,15 @@
|
|||
#
|
||||
# ---
|
||||
#
|
||||
# The license mentioned above concerns the source code only. Using the
|
||||
# EtherCAT technology and brand is only permitted in compliance with the
|
||||
# industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
#
|
||||
# ---
|
||||
#
|
||||
# vim: syntax=make
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
src := @abs_srcdir@
|
||||
ccflags-y := -I@abs_top_builddir@
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
TOPDIR := $(src)/../..
|
||||
|
||||
|
|
@ -48,4 +53,4 @@ KBUILD_EXTRA_SYMBOLS := \
|
|||
@abs_top_builddir@/$(LINUX_SYMVERS) \
|
||||
@abs_top_builddir@/master/$(LINUX_SYMVERS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#-----------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
#
|
||||
|
|
@ -17,18 +19,18 @@
|
|||
# with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# ---
|
||||
#
|
||||
# The license mentioned above concerns the source code only. Using the
|
||||
# EtherCAT technology and brand is only permitted in compliance with the
|
||||
# industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
include $(top_srcdir)/Makefile.kbuild
|
||||
|
||||
EXTRA_DIST = \
|
||||
gpio.c \
|
||||
module.c \
|
||||
module.h \
|
||||
netdev.c \
|
||||
netdev.h \
|
||||
sram.c \
|
||||
update.h \
|
||||
update.c
|
||||
update.h
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -398,11 +398,7 @@ static int ccat_eim_probe(struct platform_device *pdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,11,0)
|
||||
static void ccat_eim_remove(struct platform_device *pdev)
|
||||
#else
|
||||
static int ccat_eim_remove(struct platform_device *pdev)
|
||||
#endif
|
||||
{
|
||||
struct ccat_device *ccatdev = platform_get_drvdata(pdev);
|
||||
|
||||
|
|
@ -411,9 +407,7 @@ static int ccat_eim_remove(struct platform_device *pdev)
|
|||
iounmap(ccatdev->bar_0);
|
||||
release_mem_region(0xf0000000, 0x02000000);
|
||||
}
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static const struct of_device_id bhf_eim_ccat_ids[] = {
|
||||
|
|
|
|||
|
|
@ -862,13 +862,8 @@ static int ccat_eth_open(struct net_device *dev)
|
|||
struct ccat_eth_priv *const priv = netdev_priv(dev);
|
||||
|
||||
if (!priv->ecdev) {
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
|
||||
hrtimer_setup(&priv->poll_timer, poll_timer_callback,
|
||||
CLOCK_MONOTONIC, HRTIMER_MODE_REL);
|
||||
#else
|
||||
hrtimer_init(&priv->poll_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
|
||||
priv->poll_timer.function = poll_timer_callback;
|
||||
#endif
|
||||
hrtimer_start(&priv->poll_timer, POLL_TIME, HRTIMER_MODE_REL);
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,12 @@
|
|||
# with the IgH EtherCAT Master; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# ---
|
||||
#
|
||||
# The license mentioned above concerns the source code only. Using the
|
||||
# EtherCAT technology and brand is only permitted in compliance with the
|
||||
# industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
from os import walk
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007-2012 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -19,9 +21,15 @@
|
|||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
|
|
@ -30,7 +38,7 @@
|
|||
|
||||
/* Former documentation: */
|
||||
|
||||
/*****************************************************************************
|
||||
/*******************************************************************************
|
||||
|
||||
Intel PRO/100 Linux driver
|
||||
Copyright(c) 1999 - 2006 Intel Corporation.
|
||||
|
|
@ -56,7 +64,7 @@
|
|||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*****************************************************************************/
|
||||
*******************************************************************************/
|
||||
|
||||
/*
|
||||
* e100.c: Intel(R) PRO/100 ethernet driver
|
||||
|
|
@ -229,7 +237,7 @@ MODULE_FIRMWARE(FIRMWARE_D101S);
|
|||
MODULE_FIRMWARE(FIRMWARE_D102E);
|
||||
|
||||
MODULE_DESCRIPTION(DRV_DESCRIPTION);
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(DRV_VERSION ", master " EC_MASTER_VERSION);
|
||||
|
||||
|
|
@ -1194,7 +1202,7 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
|||
config->multicast_all = 0x1; /* 1=accept, 0=no */
|
||||
|
||||
/* disable WoL when up */
|
||||
if (nic->ecdev ||
|
||||
if (nic->ecdev ||
|
||||
(netif_running(nic->netdev) || !(nic->flags & wol_magic)))
|
||||
config->magic_packet_disable = 0x1; /* 1=off, 0=on */
|
||||
|
||||
|
|
@ -3001,10 +3009,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
|
|||
// offer device to EtherCAT master module
|
||||
nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE);
|
||||
|
||||
if (nic->ecdev) {
|
||||
nic->ec_watchdog_jiffies = jiffies;
|
||||
}
|
||||
else {
|
||||
if (!nic->ecdev) {
|
||||
strcpy(netdev->name, "eth%d");
|
||||
if ((err = register_netdev(netdev))) {
|
||||
netif_err(nic, probe, nic->netdev,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007-2012 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -19,9 +21,15 @@
|
|||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
|
|
@ -30,7 +38,7 @@
|
|||
|
||||
/* Former documentation: */
|
||||
|
||||
/*****************************************************************************
|
||||
/*******************************************************************************
|
||||
|
||||
Intel PRO/100 Linux driver
|
||||
Copyright(c) 1999 - 2006 Intel Corporation.
|
||||
|
|
@ -56,7 +64,7 @@
|
|||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*****************************************************************************/
|
||||
*******************************************************************************/
|
||||
|
||||
/*
|
||||
* e100.c: Intel(R) PRO/100 ethernet driver
|
||||
|
|
@ -231,7 +239,7 @@ MODULE_FIRMWARE(FIRMWARE_D101S);
|
|||
MODULE_FIRMWARE(FIRMWARE_D102E);
|
||||
|
||||
MODULE_DESCRIPTION(DRV_DESCRIPTION);
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(DRV_VERSION ", master " EC_MASTER_VERSION);
|
||||
|
||||
|
|
@ -1209,7 +1217,7 @@ static int e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
|||
config->multicast_all = 0x1; /* 1=accept, 0=no */
|
||||
|
||||
/* disable WoL when up */
|
||||
if (nic->ecdev ||
|
||||
if (nic->ecdev ||
|
||||
(netif_running(nic->netdev) || !(nic->flags & wol_magic)))
|
||||
config->magic_packet_disable = 0x1; /* 1=off, 0=on */
|
||||
|
||||
|
|
@ -3104,10 +3112,7 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
// offer device to EtherCAT master module
|
||||
nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE);
|
||||
|
||||
if (nic->ecdev) {
|
||||
nic->ec_watchdog_jiffies = jiffies;
|
||||
}
|
||||
else {
|
||||
if (!nic->ecdev) {
|
||||
strcpy(netdev->name, "eth%d");
|
||||
if ((err = register_netdev(netdev))) {
|
||||
netif_err(nic, probe, nic->netdev,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
/*****************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007-2012 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -19,9 +21,15 @@
|
|||
*
|
||||
* ---
|
||||
*
|
||||
* The license mentioned above concerns the source code only. Using the
|
||||
* EtherCAT technology and brand is only permitted in compliance with the
|
||||
* industrial property and similar rights of Beckhoff Automation GmbH.
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* vim: noexpandtab
|
||||
*
|
||||
****************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
\file
|
||||
|
|
@ -30,7 +38,7 @@
|
|||
|
||||
/* Former documentation: */
|
||||
|
||||
/*****************************************************************************
|
||||
/*******************************************************************************
|
||||
|
||||
Intel PRO/100 Linux driver
|
||||
Copyright(c) 1999 - 2006 Intel Corporation.
|
||||
|
|
@ -56,7 +64,7 @@
|
|||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*****************************************************************************/
|
||||
*******************************************************************************/
|
||||
|
||||
/*
|
||||
* e100.c: Intel(R) PRO/100 ethernet driver
|
||||
|
|
@ -231,7 +239,7 @@ MODULE_FIRMWARE(FIRMWARE_D101S);
|
|||
MODULE_FIRMWARE(FIRMWARE_D102E);
|
||||
|
||||
MODULE_DESCRIPTION(DRV_DESCRIPTION);
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
|
||||
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(DRV_VERSION ", master " EC_MASTER_VERSION);
|
||||
|
||||
|
|
@ -1209,7 +1217,7 @@ static int e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
|||
config->multicast_all = 0x1; /* 1=accept, 0=no */
|
||||
|
||||
/* disable WoL when up */
|
||||
if (nic->ecdev ||
|
||||
if (nic->ecdev ||
|
||||
(netif_running(nic->netdev) || !(nic->flags & wol_magic)))
|
||||
config->magic_packet_disable = 0x1; /* 1=off, 0=on */
|
||||
|
||||
|
|
@ -3101,10 +3109,7 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
// offer device to EtherCAT master module
|
||||
nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE);
|
||||
|
||||
if (nic->ecdev) {
|
||||
nic->ec_watchdog_jiffies = jiffies;
|
||||
}
|
||||
else {
|
||||
if (!nic->ecdev) {
|
||||
strcpy(netdev->name, "eth%d");
|
||||
if ((err = register_netdev(netdev))) {
|
||||
netif_err(nic, probe, nic->netdev,
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue