Compare commits

...

408 Commits

Author SHA1 Message Date
Florian Pose b709e58147 Version bump to 1.6.9 2026-03-26 17:47:12 +01:00
Florian Pose 15883228f9 Merge branch 'fix-suse-16' into 'stable-1.6'
Driver fixes for openSUSE Leap 16.0

See merge request etherlab.org/ethercat!192
2026-03-26 17:45:44 +01:00
Florian Pose 9c63faf50d Fixed igb for SUSE kernel 6.12 2026-03-26 17:38:46 +01:00
Florian Pose bf706b737d Fixed genet for SUSE 16.0. 2026-03-26 17:26:45 +01:00
Florian Pose cf19168844 Cherry-picked MR 188 (injection-semaphore) from 1.7. 2026-03-26 16:41:43 +01:00
Florian Pose 98563a2f0d Merge branch 'no-config-necessary' into 'stable-1.6'
Do not require .config to exist in kernel sources

Closes #198

See merge request etherlab.org/ethercat!186
2026-03-24 17:13:53 +01:00
Florian Pose db526666f3 At least check for Makefile. 2026-03-24 17:07:12 +01:00
Florian Pose 1e61b8400c Minor: Improved comments in DC user example. 2026-03-24 17:05:00 +01:00
Florian Pose 6869c2bab8 Merge branch 'stable-1.6-kernel615' into 'stable-1.6'
tty: Implemented new timer interface since kernel 6.15.

See merge request etherlab.org/ethercat!187
2026-03-16 14:47:06 +01:00
Bernd Kuhls e32e99f8b8 tty: Implemented new timer interface since kernel 6.15.
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
2026-03-15 20:06:42 +01:00
Florian Pose 7a7d7f051b Merge branch 'calc-dc-after-attach' into 'stable-1.6'
Attach slaves before calculating DCs

Closes #212

See merge request etherlab.org/ethercat!185
2026-03-13 15:17:53 +01:00
Florian Pose 607d0fd1af Merge branch 'discard-eoe' into 'stable-1.6'
Discard EoE traffic if EoE is disabled

See merge request etherlab.org/ethercat!184
2026-03-13 15:16:29 +01:00
Florian Pose 212cb59d58 Do not require .config to exist in kernel sources. 2026-03-12 12:01:21 +01:00
Florian Pose c76b02ae2e Attach slaves before calculating DCs. 2026-03-12 11:36:37 +01:00
Florian Pose c8c23aa448 Discard EoE traffic in CoE statemachine, if EoE is disabled. 2026-03-10 09:24:13 +01:00
Florian Pose 4e5b661674 Merge branch 'fix-6.19' into 'stable-1.6'
Linux 6.19.0 support

Closes #200

See merge request etherlab.org/ethercat!183
2026-03-09 15:02:17 +01:00
Nicola Fontana c42c9cf8bc Linux 6.19.0 support
Commit 89aec171d9d1ab168e43fcf9754b82e4c0aef9b9 (part of linux kernel
6.19.0-rc1) introduced an arbitrarily sized sockaddr struct to be used
instead of the classical one.

Closes #200
2026-03-08 15:54:00 +01:00
Florian Pose 3ccae1d47d Updated NEWS.md 2026-03-03 08:56:21 +01:00
Florian Pose bde53bc4f3 Use /sbin/ip as default 2026-03-03 08:52:53 +01:00
Florian Pose f16c0ff3c3 Merge branch 'custom-paths' into 'stable-1.6'
Allow to customize kmod path and ip command

Closes #206

See merge request etherlab.org/ethercat!182
2026-03-03 08:51:06 +01:00
Nicola Fontana b86d2163f1 Fix #206: allow to customize utilities from configure
`ethercatctl` calls some utilites actually hardcoded in the script.
Provide a way to customize them from configure.

The default values are choosen to be backward compatible with the old
behavior, but more sensible values would be preferred, e.g.:

OPTION      ACTUAL DEFAULT      PREFERRED DEFAULT
kmod-dir    /sbin               $sbindir
ip-cmd      /bin/ip             $sbindir/ip

In a major future release this can be changed.
2026-03-02 12:09:59 +01:00
Nicola Fontana 90f9feb0ad Improve help string consistency
* Move default values from comments to help strings
* Use the "... [default=...]" convention everywhere
* Change "Enable ... driver" to more correct "Build ... driver"
* Fix --enable-dwmac-intel help string
* Fix --enable-fakeuserlib help string
* Change --disable-initd to --enable-initd to avoid confusion with
  `--disable-initd [default=yes]`.
2026-03-02 11:44:15 +01:00
Florian Pose 2543cc55bd Version 1.6.8: Fixed FAKE_EC_HOMEDIR usage. 2025-10-06 17:15:04 +02:00
Florian Pose 6acfd09764
Merge branch 'patch-1' into 'stable-1.6'
Set direction in syncManager when configuring it.

See merge request etherlab.org/ethercat!179
2025-09-09 11:08:42 +02:00
Jannik Becher c5413f81e2 Set direction in syncManager when configuring it.
This is needed when you configured your pdos without the ecrt_slave_config_pdos function.
2025-08-10 09:54:37 +00:00
Florian Pose c1e6b50d12 Merge branch 'news-markdown' into 'stable-1.6'
Converted NEWS to NEWS.md

See merge request etherlab.org/ethercat!178
2025-07-31 13:20:35 +02:00
Florian Pose c324df4348 Version bump to 1.6.7. 2025-07-31 13:13:59 +02:00
Florian Pose 554e39573a Some backtick escapes. 2025-07-31 13:10:23 +02:00
Florian Pose d34e600a21 Re-formatted in markdown. 2025-07-31 13:05:00 +02:00
Florian Pose 516499a4a7 Converted NEWS to NEWS.md 2025-07-31 13:03:28 +02:00
Florian Pose 6489901521 Merge branch '187-fake_lib-ecrt_master_deactivate-is-missing-for-testing-purposes' into 'stable-1.6'
Resolve "fake_lib: ecrt_master_deactivate() is missing for testing purposes"

Closes #187

See merge request etherlab.org/ethercat!177
2025-07-28 15:16:55 +02:00
Florian Pose 49e82079dc Clang-formatted fake library. 2025-07-24 11:49:14 +02:00
Florian Pose 04c4db80c3 Completed API methods in fake library. 2025-07-24 11:25:44 +02:00
Florian Pose b82a66735c Merge branch 'fix_igb_6.4' into 'stable-1.6'
Fix igb for opensuse 15.6 (kernel 6.4)

See merge request etherlab.org/ethercat!176
2025-07-01 11:33:08 +02:00
Bjarne von Horn d978c45ad7 Fix igb for opensuse 15.6 (kernel 6.4) 2025-07-01 10:15:20 +02:00
Florian Pose 11b5061628 Bumped version to 1.6.6. 2025-06-30 16:04:34 +02:00
Florian Pose 101aa52032 Merge branch '179-add-missing-functions-to-fake-library' into 'stable-1.6'
Add missing functions to fake library

Closes #179

See merge request etherlab.org/ethercat!175
2025-06-30 16:02:05 +02:00
Florian Pose f9b9f7c2cc Add missing functions to fake library 2025-06-30 16:02:05 +02:00
Florian Pose 0561fa0bd9 Merge branch '8139too-6.4-6.12' into 'stable-1.6'
Add 8139too, e100, e1000 and r8169 for kernels 6.4 and 6.12

Closes #160

See merge request etherlab.org/ethercat!172
2025-06-30 13:53:17 +02:00
Florian Pose 5dd3b544bb Avoided some more netif_ calls. 2025-06-30 13:46:26 +02:00
Florian Pose a3fbd3df3a Avoided some netif calls. 2025-06-30 13:17:15 +02:00
Florian Pose b9d5cf13d0 Avoid netif_wake_queue(). 2025-06-27 11:58:37 +02:00
Florian Pose 59654fc8a5 Merge branch 'contributing' into 'stable-1.6'
Add a contributing guide

Closes #181

See merge request etherlab.org/ethercat!174
2025-06-27 10:55:57 +02:00
Florian Pose 9a39273505 Add a contributing guide 2025-06-27 10:55:57 +02:00
Florian Pose 529242d752 Merge branch '175-tool-use-sint-32-notation-in-matlab-output-driver' into 'stable-1.6'
Use sint(32) notation in matlab output driver

Closes #175

See merge request etherlab.org/ethercat!173
2025-06-27 10:22:50 +02:00
Florian Pose 3e9cc87717 Using uint(x) as datatype in EtherLab Pdos output. 2025-06-27 10:16:04 +02:00
Florian Pose 1be2bb6f27 Do not stop queue. 2025-06-26 17:17:34 +02:00
Florian Pose d7e5fb09fc Fixed r8169. 2025-06-26 17:09:42 +02:00
Florian Pose 39ee16381d Avoid napi_consume_skb. 2025-06-26 16:28:43 +02:00
Florian Pose 12df7a1f4a Initialize watchdog jiffies in e100. 2025-06-26 16:08:36 +02:00
Florian Pose bf1e45d934 Fixed checking output. 2025-06-26 14:59:28 +02:00
Florian Pose 7fd10f3a31 Include r8169_leds if existing. 2025-06-26 14:57:52 +02:00
Florian Pose 5bf04e42c3 Merge branch 'stable-1.6' into 8139too-6.4-6.12 2025-06-26 14:48:09 +02:00
Florian Pose 18bf85b911 Distribute update.sh 2025-06-26 14:28:37 +02:00
Florian Pose 6b21038e58 Added r8169 for 6.12. 2025-06-26 14:04:04 +02:00
Florian Pose 8174451e9b Fixed versioned header. 2025-06-26 14:03:42 +02:00
Florian Pose e914edcb34 Fixed included (versioned) headers. 2025-06-26 13:42:26 +02:00
Florian Pose 95fa1fd38c Added e1000 for 6.12. 2025-06-26 13:35:52 +02:00
Florian Pose cdc5d62299 Added e100 und 8139too for 6.12. 2025-06-26 13:14:53 +02:00
Florian Pose 13d2303b30 Add lines to Makefile.am 2025-06-26 13:13:12 +02:00
Florian Pose 5369698022 Merge branch 'more_drivers_6.4_6.12' into 'stable-1.6'
Add e1000e, igb, igc, genet, stmmac for 6.4 and 6.12

See merge request etherlab.org/ethercat!171
2025-06-26 13:07:25 +02:00
Florian Pose ed6bfafd9d Added e1000 for 6.4. 2025-06-26 13:03:52 +02:00
Florian Pose 82c25cb394 Minor change. 2025-06-26 13:01:28 +02:00
Florian Pose 7cc3f11f2c Added r8169 for 6.4. 2025-06-26 12:52:39 +02:00
Florian Pose 66e624d89f Added update script to r8169 2025-06-26 12:52:06 +02:00
Bjarne von Horn 790dcecc34 Add e1000e for 6.12
Taken from 6.12.8
2025-06-26 12:47:04 +02:00
Florian Pose 85871277a4 Added 8139too for 6.4. 2025-06-26 12:08:00 +02:00
Florian Pose de3b7419f9 Removed r8169 from update script (has own subdirectory). 2025-06-26 11:56:27 +02:00
Florian Pose ab6c8b59e5 Updated update script. 2025-06-26 11:54:42 +02:00
Florian Pose 144343a18a Use initialisation checks in e100-6.4. 2025-06-26 11:35:17 +02:00
Bjarne von Horn ab89464e11 Fix uninitialized object usage in igc 6.12. 2025-06-26 11:00:17 +02:00
Bjarne von Horn 7294ebd078 Avoid smp_processor_id() in igb 6.12. 2025-06-26 10:37:23 +02:00
Bjarne von Horn d75234c4e1 fix exported symbol for stmmac 6.12 2025-06-25 11:52:01 +02:00
Bjarne von Horn 5e060a5d7e Add stmmac for 6.12
Taken from 6.12.8
2025-06-23 16:07:23 +02:00
Bjarne von Horn 8b10f32ab3 Add stmmac for 6.4.0 2025-06-23 15:03:04 +02:00
Bjarne von Horn cdc3e6395f Add genet for kernel 6.4.0 2025-06-23 13:23:51 +02:00
Bjarne von Horn ad2a155e97 Add igb for 6.12
Taken from 6.12.8
2025-06-23 13:11:12 +02:00
Bjarne von Horn a61d9d05f0 replace kernel versions in igb update script. 2025-06-23 13:11:12 +02:00
Bjarne von Horn 7c21252c99 Fix igb 6.4 includes
was still 6.1...
2025-06-23 13:11:12 +02:00
Bjarne von Horn 11ec5fff67 Add igc for 6.12
Taken from 6.12.8
2025-06-23 13:11:07 +02:00
Florian Pose ced654cb3e Merge branch 'drivers_6.4.0' into 'stable-1.6'
Add e1000e and igb for 6.4

Closes #180

See merge request etherlab.org/ethercat!169
2025-06-23 10:50:41 +02:00
Bjarne von Horn b9a3264bbb Add igb driver for kernel 6.4 2025-06-23 10:44:24 +02:00
Bjarne von Horn 21433d2cca Fix ccflags for e1000e 6.4 2025-06-23 10:44:24 +02:00
Bjarne von Horn 555729c356 Add e1000e driver for kernel 6.4 2025-06-23 10:44:24 +02:00
Florian Pose 990d48e6c1 Bumped version to 1.6.5. 2025-06-10 12:13:37 +02:00
Florian Pose b8a942afb8 Changed autoconf requirement to 2.59 again. 2025-06-10 12:11:27 +02:00
Florian Pose 354f1493cc Switched from hrtimer_init() to hrtimer_setup() with Linux 6.15. 2025-06-10 12:08:09 +02:00
Florian Pose 240080f110 Implemented new timer interface for mini example since kernel 6.15. 2025-06-10 11:53:59 +02:00
Florian Pose 013c44ad0d Replaced remaining AC_HELP_STRING with AS_HELP_STRING. 2025-06-10 11:46:38 +02:00
Florian Pose 703b611728 Bump version to 1.6.4. 2025-04-17 14:00:06 +02:00
Florian Pose ba42da8f14 Merge branch 'fix_igc_rx' into 'stable-1.6'
Fix RX descriptor writeback threshold to 1

See merge request etherlab.org/ethercat!168
2025-04-04 11:10:50 +02:00
Bjarne von Horn a9e9489f97 Fix RX descriptor writeback threshold to 1
If the igc adapter is not used for EtherCAT, the threshold is left to the original default, 4.

Superseeds !147
2025-04-04 10:10:22 +02:00
Florian Pose 9f1ff71b43 Merge branch 'rescan-statements' into 'stable-1.6'
Avoid rescan on non-responding slave

See merge request etherlab.org/ethercat!167
2025-04-03 16:25:43 +02:00
Florian Pose 527c8b52cf Avoid rescan on non-responding slave. 2025-04-03 16:19:07 +02:00
Florian Pose f40c89c150 Merge branch 'rescan-statements' into 'stable-1.6'
Added some debug statements concering re-scanning

See merge request etherlab.org/ethercat!166
2025-04-02 19:24:00 +02:00
Florian Pose 1a6af314d8 Added some debug statements concering re-scanning. 2025-04-02 19:16:30 +02:00
Florian Pose 7843101ed3 Merge branch '167-warning-no-previous-prototype-for-ec_master_nanosleep-wmissing-prototypes-when-i-try-sudo-make' into 'stable-1.6'
Resolve "warning: no previous prototype for 'ec_master_nanosleep' [-Wmissing-prototypes] when i try 'sudo make modules'"

Closes #167

See merge request etherlab.org/ethercat!165
2025-03-26 09:06:08 +01:00
Florian Pose 0116094a7c Avoid missing prototype warning. 2025-03-25 09:24:25 +01:00
Florian Pose 7deaae5c4a Merge branch 'disable_eoe_op' into 'stable-1.6'
Backport "Do not touch AL state of EoE slaves." to stable-1.6

See merge request etherlab.org/ethercat!164
2025-03-21 09:32:23 +01:00
Florian Pose 0e2dd2ff56 Do not touch AL state of EoE slaves. 2025-03-21 09:25:47 +01:00
Florian Pose 319d7f8cd4 Merge branch '156-hint-for-user-regarding-fake_ec_name' into 'stable-1.6'
Resolve "Hint for user regarding: FAKE_EC_NAME"

Closes #156

See merge request etherlab.org/ethercat!163
2025-03-18 11:44:01 +01:00
Florian Pose a460324d94 Warning if FAKE_EC_NAME is not set. 2025-03-18 11:33:19 +01:00
Florian Pose 91f140e994 Wrapped long lines. 2025-03-18 11:23:26 +01:00
Florian Pose b9b493336c Merge branch 'disable-initd' into 'stable-1.6'
Support to initd optional

See merge request etherlab.org/ethercat!159
2025-03-13 09:18:54 +01:00
Florian Pose eeee887bcf Merge branch 'fix_fake_ethercat' into 'stable-1.6'
Add EtherCAT Master id to rtipc directory.

See merge request etherlab.org/ethercat!161
2025-03-13 08:44:45 +01:00
Bjarne von Horn 5f75f566ce Create rtipc directories on startup 2025-03-12 14:08:26 +01:00
Bjarne von Horn 7036da66f4 Add EtherCAT Master id to rtipc directory.
Currently, having multiple rtipc instances with the same
cache directory in one application does not work.
So we use one directory per master instance.
2025-03-12 11:54:50 +01:00
Bjarne von Horn 5bbf53a376 Fix FakeEtherCAT Domain activation. 2025-03-11 19:07:01 +01:00
Nicola Fontana d31fe6db68 doc: fix references to init scripts
init.d support has been updated but the TeX files still reference some
old contents.

Fix all the `../script` folder references, avoid pointing to generated
files (that, depending on the configure options, may or may not exist)
and, while at it, refresh a bit the systemd/init.d documentations.
2025-02-17 12:45:41 +01:00
Nicola Fontana 4dc942d789 Update init.d support 2025-02-17 12:45:39 +01:00
Florian Pose 4ce0c74d35 Merge branch 'UPDOWN_INTERFACES' into 'stable-1.6'
Add UPDOWN_INTERFACES option to ethercat.conf

See merge request etherlab.org/ethercat!157
2025-02-17 09:12:05 +00:00
Florian Pose 4831aefbb5 Merge branch 'autotools' into 'stable-1.6'
Improvements to the build system

Closes #16

See merge request etherlab.org/ethercat!158
2025-02-17 09:07:37 +00:00
Florian Pose 45e2a23ea1 Merge branch 'docs' into 'stable-1.6'
Documentation improvements

Closes #31

See merge request etherlab.org/ethercat!156
2025-02-17 09:05:05 +00:00
Nicola Fontana bfd84c8f3e Add UPDOWN_INTERFACES option to ethercat.conf 2025-02-14 17:04:05 +01:00
Nicola Fontana 9d9839a092 Fix obsolete warnings on bootstrap
Use AS_HELP_STRING instead of the obsolete AC_HELP_STRING and call
LT_INIT instead of AC_PROG_LIBTOOL (if available).
2025-02-14 17:02:39 +01:00
Nicola Fontana 0ca438ccb5 Fix #16: explicitely check for pkg-config macros
Without this patch, `./bootstrap` fails with the following error if
pkgconf/pkg-config is not installed:

    lib/Makefile.am:76: error: 'pkgconfig_DATA' is used but 'pkgconfigdir' is undefined

This can be triggered by disinstalling `pkgconf/pkg-config`. The problem
here is that the check for `pkg-config` is done at configure level but
`automake` fails at bootstrap level because of the above error.

This basically "fixes" the issue by changing the way in which
`./bootstrap` fails.
2025-02-14 17:02:27 +01:00
Nicola Fontana a402594fe8 Add automatic TOC to README.md
Manually maintaining the table of contents relies on how HTML fragments
are generated, it is prone to errors (infact it is already out of sync)
and just plain boring.

Unfortunately there is no common agreement on all markdown flavours on
how the table of contents must be implemented. Here the `[[_TOC_]]` tag
has been used because it is supported by both GitLab and GitHub:

    https://gitlab.com/gitlab-org/gitlab/-/issues/21901
2025-02-14 16:59:34 +01:00
Nicola Fontana 7fef7573e6 Fix #31: typos in documentation 2025-02-14 16:59:31 +01:00
Florian Pose 805e407f6f Merge branch 'version-1.6.3' into 'stable-1.6'
Version bump to 1.6.3.

See merge request etherlab.org/ethercat!154
2025-02-06 08:37:29 +00:00
Florian Pose 11504f3a0f Version bump to 1.6.3. 2025-02-06 09:36:40 +01:00
Florian Pose e2129f7794 Merge branch 'genet-6.12' into 'stable-1.6'
[FEAT] add genet device driver for kernel 6.12

See merge request etherlab.org/ethercat!152
2025-02-06 08:28:00 +00:00
Florian Pose 5b3663e15b Merge branch 'fake_without_domain' into 'stable-1.6'
Remove domain information from  RtIPC path.

See merge request etherlab.org/ethercat!149
2025-02-06 08:27:18 +00:00
Florian Pose d15936b8b5 Merge branch 'fix_ccat_aarch64' into 'stable-1.6'
Fix ccat for aarch64 >= 6.11.0

See merge request etherlab.org/ethercat!151
2025-02-06 08:26:12 +00:00
Florian Pose dab517b9ca Merge branch 'tty-module-fixes' into 'stable-1.6'
Fix build issues with tty/module.c

See merge request etherlab.org/ethercat!150
2025-02-06 08:25:41 +00:00
Florian Pose fa7c40b63e Merge branch 'fix_warnings' into 'stable-1.6'
Fix some warnings

See merge request etherlab.org/ethercat!153
2025-02-06 08:24:22 +00:00
Bjarne von Horn d06a18f934 Fix -Wold-style-declaration. 2025-02-05 12:58:56 +01:00
Bjarne von Horn 60dd4f94ec Fix -Wmissing-prototypes 2025-02-05 12:58:56 +01:00
Arnd Begemann c2cbfa5b93 [FEAT] add genet device driver for kernel 6.12 2025-01-10 14:43:36 +01:00
Bjarne von Horn de9efb7770 Fix ccat for aarch64 >= 6.11.0
return type of platform_driver::remove was changed to void
2025-01-06 14:47:09 +01:00
Thomas Petazzoni 2824232792 tty/module.c: fix ec_tty_send_xchar() prototype for Linux >= 6.8
In upstream Linux kernel commit:
  3a00da027946cd08db1c1be2de4620950bbdf074 ("tty: make tty_operations::send_xchar accept u8 char")

The prototype of tty_operations->send_xchar() was changed from:

  void (*send_xchar)(struct tty_struct *tty, char ch);

to:

  void (*send_xchar)(struct tty_struct *tty, u8 ch);

This commit was merged in Linux 6.8, and therefore the
ec_tty_send_xchar() implementation needs to be changed to avoid the
following build failure:

/home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:751:19: error: initialization of "void (*)(struct tty_struct *, u8)" {aka "void (*)(struct tty_struct *, unsigned char)"} from incompatible pointer type "void (*)(struct tty_struct *, char)" [-Werror=incompatible-pointer-types]
  751 |     .send_xchar = ec_tty_send_xchar,
      |                   ^~~~~~~~~~~~~~~~~

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-12-31 10:42:49 +01:00
Thomas Petazzoni 27175946c4 tty/module.c: fix ec_tty_write() prototype for Linux >= 6.6
In upstream Linux kernel commits:
 95713967ba52389f7cea75704d0cf048080ec218 ("tty: make tty_operations::write()'s count size_t")
 69851e4ab8feeb369119a44ddca430c0ee15f0d8 ("tty: propagate u8 data to tty_operations::write()")

The prototype of tty_operations->write() was changed from:

       int  (*write)(struct tty_struct * tty,
                     const unsigned char *buf, int count);

to:

       ssize_t (*write)(struct tty_struct *tty, const u8 *buf, size_t count);

Both of those commits were merged in Linux 6.6, and this needs an
update in tty/module.c to avoid the following build failure:

/home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:740:14: error: initialization of "ssize_t (*)(struct tty_struct *, const u8 *, size_t)" {aka "long int (*)(struct tty_struct *, const unsigned char *, long unsigned int)"} from incompatible pointer type "int (*)(struct tty_struct *, const unsigned char *, int)" [-Werror=incompatible-pointer-types]
  740 |     .write = ec_tty_write,
      |              ^~~~~~~~~~~~

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-12-31 10:42:49 +01:00
Thomas Petazzoni aed3ba0acb tty/module.c: mark internal functions as static
Fixes:

/home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:128:12: warning: no previous prototype for ‘ec_tty_init_module’ [-Wmissing-prototypes]
  128 | int __init ec_tty_init_module(void)
      |            ^~~~~~~~~~~~~~~~~~
/home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:189:13: warning: no previous prototype for ‘ec_tty_cleanup_module’ [-Wmissing-prototypes]
  189 | void __exit ec_tty_cleanup_module(void)
      |             ^~~~~~~~~~~~~~~~~~~~~
/home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:216:5: warning: no previous prototype for ‘ec_tty_init’ [-Wmissing-prototypes]
  216 | int ec_tty_init(ec_tty_t *t, int minor,
      |     ^~~~~~~~~~~
/home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:293:6: warning: no previous prototype for ‘ec_tty_clear’ [-Wmissing-prototypes]
  293 | void ec_tty_clear(ec_tty_t *tty)
      |      ^~~~~~~~~~~~
/home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:301:14: warning: no previous prototype for ‘ec_tty_tx_size’ [-Wmissing-prototypes]
  301 | unsigned int ec_tty_tx_size(ec_tty_t *tty)
      |              ^~~~~~~~~~~~~~
/home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:316:14: warning: no previous prototype for ‘ec_tty_tx_space’ [-Wmissing-prototypes]
  316 | unsigned int ec_tty_tx_space(ec_tty_t *tty)
      |              ^~~~~~~~~~~~~~~
/home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:323:14: warning: no previous prototype for ‘ec_tty_rx_size’ [-Wmissing-prototypes]
  323 | unsigned int ec_tty_rx_size(ec_tty_t *tty)
      |              ^~~~~~~~~~~~~~
/home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:338:14: warning: no previous prototype for ‘ec_tty_rx_space’ [-Wmissing-prototypes]
  338 | unsigned int ec_tty_rx_space(ec_tty_t *tty)
      |              ^~~~~~~~~~~~~~~
/home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:345:5: warning: no previous prototype for ‘ec_tty_get_serial_info’ [-Wmissing-prototypes]
  345 | int ec_tty_get_serial_info(ec_tty_t *tty, struct serial_struct *data)
      |     ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-12-31 10:42:49 +01:00
Florian Pose c117849d02 Removed FAKE_EC_DOMAIN_PERMUTATION. 2024-12-16 15:49:33 +01:00
Florian Pose 5ae7662893 Removed domain permutation from documentation; fixed some typos. 2024-12-16 15:45:55 +01:00
Florian Pose 2e9101da99 Remove domain information from RtIPC path. 2024-11-29 14:06:02 +01:00
Florian Pose ca66cd6ae9 Merge branch 'remove-inline-statement' into 'stable-1.6'
Remove unnecessary inline statement causing build -O0 problems

Closes #147

See merge request etherlab.org/ethercat!148
2024-11-18 12:27:14 +00:00
Richard Hacker 5802c72818 Remove unnecessary inline statement causing build -O0 problems
Fixes #147
2024-11-18 10:54:00 +01:00
Florian Pose 285cdf0bc3 Merge branch 'version-1.6.2' into 'stable-1.6'
Changed version to 1.6.2.

See merge request etherlab.org/ethercat!146
2024-10-31 08:38:07 +00:00
Florian Pose 29fc602642 Changed version to 1.6.2. 2024-10-31 09:29:55 +01:00
Florian Pose 318a92ce81 Merge branch 'remove_doxygen_timestamp' into 'stable-1.6'
Remove datetime from footer for reproducible builds.

See merge request etherlab.org/ethercat!145
2024-10-21 09:35:20 +00:00
Bjarne von Horn 50a9b0a23d Remove datetime from footer for reproducible builds. 2024-10-14 09:30:26 +02:00
Florian Pose 3ad731466b Merge branch 'fake-typo' into 'stable-1.6'
Fixed typo.

See merge request etherlab.org/ethercat!144
2024-10-11 15:24:18 +00:00
Florian Pose c85676cadf Fixed typo. 2024-10-11 17:15:42 +02:00
Florian Pose b0816ee67d Merge branch 'fix-fake-bit-offset' into 'stable-1.6'
Fixed check of non-zero bit offset.

Closes #139

See merge request etherlab.org/ethercat!143
2024-10-11 14:29:14 +00:00
Florian Pose 2dd0ff8d44 Fixed check of non-zero bit offset. 2024-10-11 16:21:44 +02:00
Florian Pose 4a757cedc2 Merge branch 'cherry-pick-45f2d1a9' into 'stable-1.6'
Merge branch 'Fix-19'

Closes #19

See merge request etherlab.org/ethercat!142
2024-10-02 12:27:17 +00:00
Florian Pose bc295a57aa Merge branch 'Fix-19' into 'master'
Fix #19: directly include soe_error_codes into SoeCommand.cpp

Closes #19

See merge request etherlab.org/ethercat!39

(cherry picked from commit 45f2d1a988)

e30a39f3 Fix #19: directly include soe_error_codes into SoeCommand.cpp

Co-authored-by: Florian Pose <fp@igh.de>
2024-10-02 09:33:42 +00:00
Florian Pose b457365165 Merge branch 'fix_typo' into 'stable-1.6'
Fix typo in bash completition.

Closes #137

See merge request etherlab.org/ethercat!141
2024-09-17 14:44:50 +00:00
Bjarne von Horn be4ff5b22f Fix typo in bash completition.
Fixes #137.
2024-09-17 09:19:20 +02:00
Florian Pose 419f62161b Merge branch 'add_fake_library' into 'stable-1.6'
Add fake library

See merge request etherlab.org/ethercat!136
2024-07-26 11:18:49 +00:00
Florian Pose 905b768c58 Fixed typo and updated URLs. 2024-07-26 12:49:24 +02:00
Florian Pose a0f7a0c8c9 Mention libfakeethercat in PDF documentation. 2024-07-26 12:35:54 +02:00
Florian Pose 04064099e9 Updated doxyfile to 1.11.0. 2024-07-26 11:57:02 +02:00
Bjarne von Horn 0f9ad4c834 Add more methods to fake_lib for EtherLab master block 2024-07-26 10:54:24 +02:00
Bjarne von Horn 185674e2b4 Add ecrt_master_scan_progress to fake lib. 2024-07-26 10:45:54 +02:00
Bjarne von Horn 3e3b938c2f Version bump to 1.6.1 2024-07-26 09:49:18 +02:00
Bjarne von Horn f1349ead07 Add reference to EtherLab for swap_io. 2024-07-23 13:33:28 +02:00
Florian Pose 2632042e4e Merge branch 'stable-1.6-fix-rtdm-device-minor' into 'stable-1.6'
Fix "No such file or directory" error when using multiple masters and RTDM

See merge request etherlab.org/ethercat!139
2024-07-23 07:19:24 +00:00
Xianzi Lu 9ee9497dd4 Fix "No such file or directory" error when using multiple masters and RTDM
This error occurs when we are using multiple masters along with RTDM.
Device minor is not set and device numbers are always one when registering
an RTDM device.
Seems there is no need to change the legacy Xenomai 2.6 RTDM driver, because
the device will be identified by a name instead of a device minor.
2024-07-23 13:34:39 +08:00
Bjarne von Horn 1d858d8b3e Fix doxygen wording. 2024-07-22 11:43:51 +02:00
Florian Pose b30b7b6561 Merge branch 'fix_disable_eoe' into 'stable-1.6'
Fix building without EoE

Closes #123

See merge request etherlab.org/ethercat!137
2024-07-22 07:47:01 +00:00
Bjarne von Horn 45e8b098d7 add multi-master support to fakelib. 2024-07-19 11:51:17 +02:00
Bjarne von Horn eaeddb0c49 Add CI job without EoE. 2024-07-18 14:15:30 +02:00
Bjarne von Horn 4f71ac5099 Fix building without EoE
Fixes #123
2024-07-18 14:14:32 +02:00
Bjarne von Horn b5c7527990 fix pdf job dependencies. 2024-07-18 13:34:28 +02:00
Bjarne von Horn 86656eb61a switch to 15.4 2024-07-18 12:36:02 +02:00
Bjarne von Horn fe08cb0741 build fakelib in CI. 2024-07-18 12:07:17 +02:00
Bjarne von Horn c2c3d56a2c Add README to fakelib 2024-07-18 12:02:53 +02:00
Bjarne von Horn c15195178f Add SDO Json Dump to FakeLib. 2024-07-08 15:23:54 +02:00
Bjarne von Horn 0261b21adb more fake functions 2024-07-05 11:06:21 +02:00
Bjarne von Horn 013aafc329 Simulate domain state 2024-07-05 11:06:05 +02:00
Bjarne von Horn 4795be145a Save SDO config 2024-07-05 11:05:36 +02:00
Bjarne von Horn 42b980c0d4 add fake ethercat library to build system. 2024-07-04 19:00:42 +02:00
Bjarne von Horn 19779300e9 Add debug statements. 2024-07-04 18:31:20 +02:00
Bjarne von Horn 0740c3bbb6 permutate domain ids with FAKE_DOMAIN_PERMUTATION env 2024-07-04 18:30:35 +02:00
Bjarne von Horn daa555a4f6 Make rtipc name configurable 2024-07-04 18:13:17 +02:00
Bjarne von Horn 4c953d5000 WIP add rtipc 2024-07-04 15:41:34 +02:00
Bjarne von Horn 19afa78793 Very initial libfakeethercat 2024-07-04 12:31:46 +02:00
Florian Pose bc945f69ab Merge branch 'devel-1.6' into 'stable-1.6'
mention all current drivers in ethercat.conf

See merge request etherlab.org/ethercat!135
2024-06-07 13:16:14 +00:00
Bjarne von Horn 7e8c6cf12a mention all current drivers in ethercat.conf 2024-06-07 15:03:47 +02:00
Florian Pose cafd367785 Merge branch 'docs-on-tag' into 'stable-1.6'
Trigger docs pipeline on new tag.

See merge request etherlab.org/ethercat!134
2024-06-07 12:53:01 +00:00
Florian Pose 2b9b61fd1e Trigger docs pipeline on new tag. 2024-06-07 14:45:40 +02:00
Florian Pose 8330bca82c Merge branch 'devel-1.6' into 'stable-1.6'
Preparations for version 1.6

See merge request etherlab.org/ethercat!114
2024-06-07 11:50:33 +00:00
Bjarne von Horn 057defec1c update doxygen layout. 2024-06-07 13:19:20 +02:00
Bjarne von Horn a62bfcef9a Fix out-of-tree build of various drivers 2024-06-07 11:45:29 +02:00
Bjarne von Horn b02f0492e0 remove unneeded suse conditional. 2024-06-07 11:41:06 +02:00
Bjarne von Horn 807c8ba709 Add missing backslash in Makefile.am 2024-06-07 11:29:58 +02:00
Bjarne von Horn bac16d07a9 Fix systemd service file
network.service is suse-specific,
on Debian its name is networking.service.

According to https://systemd.io/NETWORK_ONLINE/,
there are three targets available in systemd for networking purposes.
2024-06-07 10:55:26 +02:00
Florian Pose c3db4383b6 Determine master version via git tag. 2024-06-07 10:42:23 +02:00
Florian Pose f538987d66 Chapter with userspace application example. 2024-06-07 10:31:01 +02:00
Florian Pose c2996a8bd9 Included application interface header in PDF doc. 2024-06-07 10:15:27 +02:00
Bjarne von Horn 93b60bb812 Fix rt_mutex_lock_interruptible() again for RT >= 3.2 2024-06-06 17:10:13 +02:00
Bjarne von Horn d71e362a5e update doxygen logo and add favicon 2024-06-06 16:38:33 +02:00
Bjarne von Horn 6f928c6fe8 Fix rt_mutex_lock_interruptible for Kernel < 3.17.0 2024-06-06 16:27:04 +02:00
Bjarne von Horn 0cb7cfd973 Fix very old kernels with CONFIG_SUSE_KERNEL 2024-06-06 16:27:04 +02:00
Florian Pose f814e7d328 Merge branch 'rework_doc_again' into 'devel-1.6'
Annotate API restrictions with tags.

See merge request etherlab.org/ethercat!130
2024-06-06 13:29:23 +00:00
Florian Pose 5177b6fb14 Fixed ref. 2024-06-06 15:23:29 +02:00
Florian Pose c4e2670164 Fixed tables. 2024-06-06 15:21:59 +02:00
Florian Pose 4a39a106e1 Reviewed API usage. 2024-06-06 15:07:25 +02:00
Florian Pose 220bb4661a Enable -Wmaybe-uninitialised; Fixed uninitialized kfree(). 2024-06-06 14:24:56 +02:00
Florian Pose d22a450aae Merge branch 'dev-base-lock' into 'devel-1.6'
Linux >= 6.9.0 support

See merge request etherlab.org/ethercat!129
2024-06-06 12:10:51 +00:00
Bjarne von Horn 2c3a92ff23 Annotate API restrictions with tags.
Refers to an overview page with tables and explainations.
2024-06-06 13:56:09 +02:00
Bjarne von Horn 495dbc1aa6 Fix return value for ecrt_master_send_ext(). 2024-06-06 13:55:40 +02:00
Bjarne von Horn 3a064cac2a avoid sleeping in ecrt_master_send_ext()
mini.c example now plays well with EoE.
2024-06-05 16:24:12 +02:00
Nicola Fontana 95c25b5071 Remove dev_base_lock for linux >= 6.9.0
Kernel commit 1b3ef46cb7f2618cc0b507393220a69810f6da12 removed
`dev_base_lock` from v6.9 onward.

Use the alternate iterator `for_each_netdev_rcu` introduced by commit
c6d14c84566d6b70ad9dc1618db0dec87cca9300 in 2.6.33+.
2024-06-03 12:45:48 +02:00
Bjarne von Horn f4e9367dde Add igc for 5.15.40 2024-06-03 11:05:20 +02:00
Florian Pose eb6e7bf41b Merge branch 'al-timeout-api' into 'devel-1.6'
Add interface to set AL state change timeouts

See merge request etherlab.org/ethercat!127
2024-05-22 11:07:10 +00:00
Florian Pose 7b40d5fc40 Added missing prototypes. 2024-05-22 12:36:16 +02:00
Florian Pose 95a25495af Added ecrt_slave_config_state_timeout() in user-space library. 2024-05-22 12:06:48 +02:00
Florian Pose b182bef611 AL state timeout lookup logic. 2024-05-22 11:54:36 +02:00
Florian Pose 36d036b081 Added missing prototypes. 2024-05-22 11:05:18 +02:00
Florian Pose 737c3cf3d7 Removed unused methods. 2024-05-22 11:03:10 +02:00
Florian Pose 6503e0a32a Added missing prototypes. 2024-05-22 11:01:37 +02:00
Florian Pose 4fe6b87f89 Added missing prototypes. 2024-05-22 11:00:25 +02:00
Florian Pose 299a039c49 Defined interface. 2024-05-22 10:10:05 +02:00
Florian Pose 609f61af54 Group docs / ecrt_master_scan_progress() is RT. 2024-05-21 17:53:53 +02:00
Florian Pose 45a6acba02 Fixed typo. 2024-05-21 16:16:57 +02:00
Florian Pose d717cfc1e6 Merge branch '84-api-call-for-eoe-set-ip-command' into 'devel-1.6'
API call for EoE Set-IP command

See merge request etherlab.org/ethercat!111
2024-05-21 13:58:03 +00:00
Florian Pose dea5173310 Avoided warning. 2024-05-21 15:49:21 +02:00
Florian Pose ade722eb52 Limit hostname to 32 bit (including terminator) in kernel. 2024-05-21 15:42:49 +02:00
Florian Pose d999311ae8 EoE API docs. 2024-05-21 15:40:04 +02:00
Bjarne von Horn 997c81b6fa use separate queue for external datagrams to avoid corrupting master::queue 2024-05-16 09:48:23 +02:00
Bjarne von Horn 783bc19600 Fix SDO Upload in ethercat tool 2024-05-16 09:44:21 +02:00
Florian Pose 018863d9c7 Avoid for loop initial declaration. 2024-05-15 16:32:52 +02:00
Florian Pose dd1187d942 Fixed byte order. 2024-05-15 14:42:45 +02:00
Florian Pose f6f4cf74be Fixed format string placeholder. 2024-05-15 14:39:12 +02:00
Florian Pose e4588964a5 Use inet_ntop() to display configured EoE parameters. 2024-05-15 13:44:32 +02:00
Florian Pose a1552bdf61 Use signed char as hostname type. 2024-05-15 13:41:26 +02:00
Florian Pose ac57cfce24 Fixed uninitialized variable. 2024-05-15 13:40:05 +02:00
Florian Pose 5cc1aaf6cf Fixed method names in change list. 2024-05-15 13:09:05 +02:00
Florian Pose c2f9baf96a Ported API and internal structures to struct in_addr. 2024-05-15 13:04:34 +02:00
Florian Pose 66c5793e7b Comment. 2024-05-15 11:23:32 +02:00
Florian Pose 405b8b71e1 Documentation on how to convert string-coded IP adresses. 2024-05-14 19:00:53 +02:00
Florian Pose 972337444b Retry receiving an EoE set IP parameter response. 2024-05-14 18:37:17 +02:00
Florian Pose 5830c42e12 Added missing line breaks in output. 2024-05-14 18:21:48 +02:00
Florian Pose cbadc30d15 Updated slave configuration state machine graph. 2024-05-14 17:53:15 +02:00
Florian Pose bfa618ebbb Set EoE IP params during slave configuation. 2024-05-14 17:52:50 +02:00
Florian Pose 0fb163ea5b Introduced ec_eoe_request_valid(). 2024-05-14 17:36:49 +02:00
Florian Pose 4a1ac80fda Merge remote-tracking branch 'origin/devel-1.6' into 84-api-call-for-eoe-set-ip-command 2024-05-14 16:30:29 +02:00
Florian Pose 26b22db16d Open master device in read/write mode due to changed permissions. 2024-05-14 16:26:15 +02:00
Florian Pose 5908be27b4 Fixed typo. 2024-05-14 15:59:00 +02:00
Florian Pose 156cea6a9c Fixed typo. 2024-05-14 15:40:26 +02:00
Florian 40212a30a6 Merge remote-tracking branch 'origin/devel-1.6' into 84-api-call-for-eoe-set-ip-command 2024-05-14 15:38:39 +02:00
Bjarne von Horn 9012a40ed9 Fix crc command.
Due to changed permissions in 2f4c06af.
2024-05-14 10:40:19 +02:00
Bjarne von Horn a9804cb302 Fix igc for suse 15.6 2024-05-07 14:59:19 +02:00
Bjarne von Horn 496cebb8ec add another missing EC_PUBLIC_API 2024-04-18 13:48:38 +02:00
Bjarne von Horn 0cd18cd234 Add missing EC_PUBLIC_API
Fixes #111
2024-04-18 09:06:05 +02:00
Bjarne von Horn 763be6deaa missing igb get_ecdev conversions in 5.14, 5.15 and 6.1 2024-04-11 14:11:45 +02:00
Bjarne von Horn 721b4db1d2 Merge branch 'verify_igb' into devel-1.6 2024-04-08 14:16:51 +02:00
Bjarne von Horn 3549dc69cc avoid deadlock in stmmac 2024-04-08 13:06:03 +02:00
Bjarne von Horn 44439c3ea0 Fix stmmac nullptr dereference
```
Apr 08 11:15:37 conga-smarc-2 kernel:  hrtimer_try_to_cancel+0x15/0x130
Apr 08 11:15:37 conga-smarc-2 kernel:  hrtimer_cancel+0x11/0x30
Apr 08 11:15:37 conga-smarc-2 kernel:  stmmac_release+0xea/0x3a0 [ec_dwmac_intel]
Apr 08 11:15:37 conga-smarc-2 kernel:  ec_device_close+0x2d/0x40 [ec_master]
```
2024-04-08 11:36:44 +02:00
Bjarne von Horn 42d376ed53 WARN_ONCE on querying ecdev before ecdev_offer for stmmac 2024-04-03 17:13:12 +02:00
Bjarne von Horn 498ab702d2 WARN_ONCE on querying ecdev before ecdev_offer for 8139too 2024-04-03 12:10:34 +02:00
Bjarne von Horn cf54188d74 WARN_ONCE on querying ecdev before ecdev_offer for e100 2024-04-03 12:10:34 +02:00
Bjarne von Horn 10f15cb282 WARN_ONCE on querying ecdev before ecdev_offer for e1000e 2024-04-03 12:10:34 +02:00
Bjarne von Horn 45b526e99f WARN_ONCE on querying ecdev before ecdev_offer for e1000 2024-04-03 12:10:34 +02:00
Bjarne von Horn c2c4a1b27f WARN_ONCE on querying ecdev before ecdev_offer for genet 2024-04-03 11:11:44 +02:00
Bjarne von Horn f388bde39a WARN_ONCE on querying ecdev before ecdev_offer for igc 2024-04-03 11:11:44 +02:00
Bjarne von Horn 995e41ee6a WARN_ONCE on querying ecdev before ecdev_offer for r8169 2024-04-03 11:11:44 +02:00
Bjarne von Horn 592cc1f309 Fix resource leak in igb 2024-04-03 11:11:40 +02:00
Bjarne von Horn 188519459f WARN_ONCE on querying ecdev before ecdev_offer for igb 2024-04-03 10:48:54 +02:00
Florian Pose 6e8119b955 Merge branch 'int_return_type' into 'devel-1.6'
use int as return type for all application interface methods

See merge request etherlab.org/ethercat!119
2024-04-03 08:40:51 +00:00
Bjarne von Horn dd7fc5b8eb Add --enable-driver-resource-verifying option
verify that ecdev pointer in native drivers is dereferenced after it has been initialized by ecdev_offer().
2024-04-03 10:40:14 +02:00
Bjarne von Horn e4f7122548 typo in configure.ac 2024-04-03 10:39:37 +02:00
Bjarne von Horn fe160f5c86 Use -ENOBUFS to indicate insufficient preallocated buffer 2024-04-03 10:34:17 +02:00
Bjarne von Horn 614a309bcc use `int` as return type for ecrt_reg_request_*
See #101
2024-04-03 10:34:17 +02:00
Bjarne von Horn e78237ed31 use `int` as return type for ecrt_voe_handler_*
See #101
2024-04-03 10:34:17 +02:00
Bjarne von Horn 8c30331e6e use `int` as return type for ecrt_soe_request_*
See #101
2024-04-03 10:34:17 +02:00
Bjarne von Horn 885b8717e1 use `int` as return type for ecrt_sdo_request_*
See #101
2024-04-03 10:34:17 +02:00
Bjarne von Horn 5248b967d2 use `int` as return type for ecrt_slave_*
See #101
2024-04-03 10:34:17 +02:00
Bjarne von Horn 13e99008c3 use int as return type for ecrt_master_*
See #101
2024-04-03 10:34:17 +02:00
Bjarne von Horn 06b408ef1b use int as return type for ecrt_domain_*
See #101
2024-04-03 10:34:17 +02:00
Bjarne von Horn 19a347267c fix stmmac driver names in table 2024-04-03 10:33:12 +02:00
Bjarne von Horn 5d39d3b0cf Add dwmac_intel and stmmac_pci v6.1.81 2024-04-03 10:33:12 +02:00
Bjarne von Horn 3870a66c8f Fix rtdm rtai redefinition error 2024-02-16 14:06:23 +01:00
Bjarne von Horn e8213ea7e8 allow non-standard RTAI include dir 2024-02-16 14:05:58 +01:00
Florian Pose 251bb4a147 Changed AL state change timeout. Maybe a fix for #32. 2024-02-08 12:43:17 +01:00
Florian Pose 5f8d97edcf Assigned ioctl calls to RT, nRT or both; documented that in header. 2024-02-08 12:05:29 +01:00
Florian Pose 677b8442e3 Minor: Use slave pointer. 2024-02-08 12:04:47 +01:00
Florian Pose caea048cc9 Merge branch 'prefetch-domain-pointer' into 'devel-1.6'
Prefetch domain pointer / made domain argument const

See merge request etherlab.org/ethercat!118
2024-02-08 08:54:17 +00:00
Bjarne von Horn d0f4aed39b Make ecrt_master_reset available in RT context
It takes the master_sem, so calling it from RT context is not an option.
The reset is done by a workqueue now, which is triggered in a NMI-safe way.

Fixes #103
2024-02-08 08:59:29 +01:00
Bjarne von Horn 1226b9d745 build with kernel 3.4 in CI 2024-02-07 18:22:25 +01:00
Florian Pose 2f4c06afc1 Moved application time ioctl for RT-only; changed some permissions. 2024-02-07 17:08:52 +01:00
Florian Pose 67b3756976 Removed header addition. 2024-02-07 16:18:05 +01:00
Florian Pose ec407273f4 Changed email address. 2024-02-07 16:17:22 +01:00
Florian Pose 0c9813862f Minor: Broke long lines. 2024-02-07 16:11:02 +01:00
Florian Pose a5df1c38d1 Moved fetching domain offset to ecrt_master_activate(). 2024-02-07 15:27:47 +01:00
Florian Pose 4bab54a336 Removed some unused variables. 2024-02-07 15:26:37 +01:00
Bjarne von Horn 6092d13098 further ccat fixes for leap 15.5 2024-02-07 15:24:21 +01:00
Bjarne von Horn c064eb7446 fix -Wcomment in igc 2024-02-07 15:21:04 +01:00
Bjarne von Horn 9f8570f3cd further igc fixes for leap 15.5 2024-02-07 15:19:55 +01:00
Bjarne von Horn a5fc2b0f26 remove unused variables. 2024-02-07 15:03:39 +01:00
Bjarne von Horn fb3c725953 add missing include for igc on suse 15.5 2024-02-07 15:00:19 +01:00
Bjarne von Horn e553a9999e Merge branch 'igc_6.1' into devel-1.6 2024-02-07 14:49:37 +01:00
Bjarne von Horn 26ffb1d265 Merge branch 'genet_5.10' into devel-1.6 2024-02-07 14:48:05 +01:00
Florian Pose a0c05e20c7 Fixed methods in mapfile. 2024-02-07 13:16:48 +01:00
Florian Pose c8ed5fa38d Unified EoE IP parameter names. 2024-02-07 12:44:55 +01:00
Bjarne von Horn bd94f4bb88 [e1000] cancel watchdog task in ecdev mode on removal 2024-02-07 12:16:49 +01:00
Bjarne von Horn 81bbf7dbc4 [e1000] fix scheduling watchdog task. 2024-02-07 12:13:15 +01:00
Bjarne von Horn 0d1cd09043 [e1000] add missing forward declaration 2024-02-07 12:03:57 +01:00
Bjarne von Horn 19b8f672c7 Disable memory allocation in {soe,sdo}_request_write
Because it's not compatible with Xenomai and other atomic contexts.
The memory is preallocated when creating the request in before.
2024-02-05 16:05:57 +01:00
Florian Pose 25cfa1ead1 Fix building with --disable-eoe. 2024-02-05 15:41:02 +01:00
Florian Pose 25bf7ef885 Set IP parameter methods on user and kernel side. 2024-02-05 15:24:24 +01:00
Bjarne von Horn 501903aec7 [igc] fix copy pasta typo 2024-02-05 15:17:41 +01:00
Bjarne von Horn c76399b8db more eth_hw_addr_set ifdefs for suse's kernel 2024-02-05 14:25:48 +01:00
Florian Pose 81e89154ae Added const for array/string parameters. 2024-02-05 13:58:45 +01:00
Bjarne von Horn 1485d78d6a Add bcmgenet 5.14.21 2024-02-05 12:09:35 +01:00
Florian Pose 82d1dfff3c Merge branch 'devel-1.6' into 84-api-call-for-eoe-set-ip-command 2024-02-05 12:08:45 +01:00
Florian Pose d89191cd9e strcpy explanations. 2024-02-05 12:07:34 +01:00
Florian Pose 073c81386c Changed names of EoE set IP methods to match subcommand names. 2024-02-05 11:59:22 +01:00
Bjarne von Horn 69a8ff515a add genet update script 2024-02-05 11:52:43 +01:00
Bjarne von Horn 5ea3c93d06 Add genet 5.10.110 2024-02-05 11:52:43 +01:00
Florian Pose 740117c76f Merge branch 'devel-1.6' into 84-api-call-for-eoe-set-ip-command 2024-02-05 11:16:27 +01:00
Florian Pose ec54baeef6 Removed nunecessary srcdir again; added libethercat.map to EXTRA_DIST. 2024-02-05 11:06:01 +01:00
Florian Pose 7683717998 Added srcdir for mapfile dependencies. 2024-02-05 10:59:25 +01:00
Bjarne von Horn a1a0edb9c4 Fix e1000 link detection with xenomai 2024-02-05 10:08:55 +01:00
Bjarne von Horn 34c56eae7d Fix igc link detection with xenomai 2024-02-05 10:08:55 +01:00
Bjarne von Horn 35ff319856 Fix igb link detection with xenomai 2024-02-05 10:08:55 +01:00
Bjarne von Horn bdd7d1f8f7 Fix r8169 link detection with Xenomai
```
[  741.073012] IRQ pipeline: some code running in oob context 'Xenomai'
[  741.073013]               called an in-band only routine
[  741.073013] CPU: 1 PID: 22419 Comm: my_task Tainted: G           O      5.10.179-lp154.3-0510xenomai3 #1
[  741.073014] Hardware name: ICP / iEi IMBA-9454ISA/IMBA-9454ISA(E168), BIOS 080014  02/20/2009
[  741.073015] IRQ stage: Xenomai
[  741.073015] Call Trace:
[  741.073015]  dump_stack+0x86/0xa6
[  741.073016]  check_inband_stage+0x8c/0xa0
[  741.073017]  inband_irq_save+0xe/0x30
[  741.073017]  try_to_grab_pending+0x1e/0x180
[  741.073018]  mod_delayed_work_on+0x42/0xa0
[  741.073018]  phy_trigger_machine+0x23/0x30
[  741.073019]  phy_mac_interrupt+0xe/0x20
[  741.073019]  ec_poll+0x105/0x110 [ec_r8169]
[  741.073020]  ec_device_poll+0x24/0x30 [ec_master]
[  741.073020]  ecrt_master_receive+0x21/0x160 [ec_master]
[  741.073021]  ec_ioctl_rtdm_rt+0x430/0x4c0 [ec_master]
[  741.073021]  ? rtdm_fd_get+0x11d/0x210
[  741.073022]  ec_rtdm_ioctl_rt_handler+0x26/0x40 [ec_master]
[  741.073022]  rtdm_fd_ioctl+0xdc/0x240
[  741.073023]  ? xnlock_dbg_release+0x21/0xf0
[  741.073023]  CoBaLt_ioctl+0xe/0x20
[  741.073024]  handle_head_syscall+0x10f/0x4d0
[  741.073025]  ? CoBaLt_fcntl+0x20/0x20
[  741.073025]  ? handle_pipelined_syscall+0x39/0x40
[  741.073026]  handle_oob_syscall+0x13/0x20
[  741.073026]  pipeline_syscall+0x8c/0x130
[  741.073027]  syscall_enter_from_user_mode+0x26/0x90
[  741.073027]  do_syscall_64+0x13/0x60
[  741.073028]  entry_SYSCALL_64_after_hwframe+0x61/0xc6
[  741.073029] RIP: 0033:0x7fac8da13c8f
[  741.073029] Code: Unable to access opcode bytes at RIP 0x7fac8da13c65.
[  741.073030] RSP: 002b:00007fac8e864c90 EFLAGS: 00000206 ORIG_RAX: 0000000010000050
[  741.073031] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fac8da13c8f
[  741.073032] RDX: 0000000000000000 RSI: 000000000000a426 RDI: 0000000000000003
[  741.073032] RBP: 000000000000a426 R08: 00007fac8e865700 R09: 0000000000000000
[  741.073033] R10: 0000000000000113 R11: 0000000000000206 R12: 0000000000000000
[  741.073033] R13: 0000000000000000 R14: 0000000000000000 R15: 00007fac8e864e80
```
2024-02-05 10:08:55 +01:00
Bjarne von Horn 0c1e2bc397 fix r8169 modname 2024-02-05 10:08:55 +01:00
Bjarne von Horn aa89735e55 do ioctl multiplexing in ioctl.c 2024-02-05 10:08:55 +01:00
Bjarne von Horn bf790debb6 Split ioctl switch statements into rt, nrt and common 2024-02-05 10:08:55 +01:00
Bjarne von Horn 1e7b4816c1 Add rtai modules to KBUILD_EXTRA_SYMBOLS 2024-02-05 10:04:35 +01:00
Bjarne von Horn df7145a1c3 Add Xenomai{2,3} and RTAI to CI 2024-02-05 10:04:14 +01:00
Bjarne von Horn 385f2ba64e Use rtdm_safe_copy_{from,to}_user 2024-02-05 10:04:14 +01:00
Bjarne von Horn ca60769996 introduce ec_copy_{from,to}_user macros with ctx argument in ioctl 2024-02-05 10:02:28 +01:00
Bjarne von Horn 95209d2858 Move ec_rtdm_context into common header 2024-02-05 09:58:05 +01:00
Bjarne von Horn 0a41222ee6 prepare uniting ec_rtdm_context 2024-02-05 09:58:04 +01:00
Bjarne von Horn 656526f03c remove EC_RTDM_OPS_HAS_MMAP again 2024-02-05 09:58:04 +01:00
Bjarne von Horn 1c9f9bfe7d use RTDM CFLAGS for non-standard include dir 2024-02-05 09:58:04 +01:00
Bjarne von Horn bc1f0e8f41 Add --with-xenomai-config option 2024-02-05 09:58:04 +01:00
Bjarne von Horn db0d120e2e Fix Xenomai Posix setschedparam 2024-02-05 09:58:04 +01:00
Bjarne von Horn 64adc0ce16 Port examples to Xenomai3 2024-02-05 09:58:04 +01:00
Bjarne von Horn 3ba71d5702 use sig_atomic_t for run flag in examples
Otherwise the loop may run forever.
2024-02-05 09:58:04 +01:00
Bjarne von Horn 1dae91d8c3 Use mmap handler in Xenomai3 2024-02-05 09:58:04 +01:00
Bjarne von Horn e76109c854 Use xeno_config for xenomai version detection 2024-02-05 09:58:04 +01:00
Joonyoung Shim 023d989ee3 Support Xenomai version 3
From 9567f460411d9a832c24b3ef65252f6f4f902fef Mon Sep 17 00:00:00 2001
Xenomai version 3 has different RTDM interface with version 2 and has
Alchemy interface instead of native API. This supports RTDM of Xenomai
version 3 and to use Alchemy interface.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
2024-02-05 09:58:04 +01:00
Bjarne von Horn a297dd7fae add symbol version check target 2024-02-02 11:53:31 +01:00
Bjarne von Horn 71f8041248 Add symbol map file.
Fixes #88
2024-02-02 11:53:31 +01:00
Bjarne von Horn 5fd05393bb Add missing EC_PUBLIC_API declarations 2024-02-02 11:53:31 +01:00
Florian Pose 4ce4d08b7b Made some more pointer arguments const in API. 2024-02-02 10:56:09 +01:00
Florian Pose 0829b3f802 Minor: Broke long lines. 2024-02-02 10:18:34 +01:00
Florian Pose df354272a8 Minor: Fixed indentation. 2024-02-02 10:15:47 +01:00
Bjarne von Horn 984cb49633 Add missing EC_PUBLIC_API declarations 2024-02-02 10:04:44 +01:00
Bjarne von Horn 8bf902b02a update conditions in CI 2024-02-02 09:53:47 +01:00
Bjarne von Horn 6b95e42844 add release pipeline with dist tarballs
Fixes #9
2024-02-02 09:53:42 +01:00
Bjarne von Horn 13cef2b981 Add const to pointers to pdo and pdo_entry infos
Fixes #85
2024-02-02 08:48:39 +01:00
Florian Pose eb05547c77 Version bump to 1.6.0. 2024-02-01 18:20:45 +01:00
Florian Pose 6200ecca77 Limited line length to 78. 2024-02-01 17:44:20 +01:00
Florian Pose f7695cd250 Broken-down SET IP methods. 2024-02-01 17:26:30 +01:00
Florian Pose be4754deca API proposal for EoE set IP. 2024-02-01 16:52:24 +01:00
Florian Pose df3954d8ec Fixed line lengths; and ID keywords of merged sources. 2024-02-01 16:38:06 +01:00
Bjarne von Horn ac50849bcc Add e1000e for 5.4, 5.10, 5.14 and 6.1 2024-02-01 16:17:21 +01:00
Bjarne von Horn 0836726b77 Add 8139too for 5.15.115 2024-02-01 16:06:14 +01:00
Bjarne von Horn 9a0a683f3c Add 8139too for 5.14.21 2024-02-01 16:05:06 +01:00
Florian Pose 585070576c Merge branch 'ethercat-backport_setip' into 'devel-1.6'
Backport Set IP command from master

See merge request etherlab.org/ethercat!112
2024-02-01 14:35:32 +00:00
Florian Pose 5e0d49755d Merge branch 'devel-1.6' into ethercat-backport_setip 2024-02-01 15:30:05 +01:00
Florian Pose 4f32561ce9 Merge branch 'devel-1.6' into ethercat-backport_setip 2024-02-01 15:27:17 +01:00
Florian Pose cbc1c22eaa Merge branch 'prepare-1.6' into 'devel-1.6'
Prepare release 1.6

See merge request etherlab.org/ethercat!113
2024-02-01 14:22:15 +00:00
Florian Pose ee55c20e28 Fixed mail address; limited lines to 78 characters; removed $Id$. 2024-02-01 15:15:41 +01:00
Bjarne von Horn 7727ac725d Use spinlocks in ec_mini.ko examples
down() must not be used in softirq context:
```
[  613.686994] BUG: sleeping function called from invalid context at ../kernel/locking/semaphore.c:58
[  613.687003] in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 29, name: ktimers/1
[  613.687007] preempt_count: 0, expected: 0
[  613.687009] RCU nest depth: 3, expected: 0
[  613.687013] CPU: 1 PID: 29 Comm: ktimers/1 Tainted: G        W  OE      6.1.38-lp154.12-0601rt #1 1ef8e7f7e45a6388beff51e7b17265074b1375d6
[  613.687020] Hardware name: ICP / iEi IMBA-9454ISA/IMBA-9454ISA(E168), BIOS 080014  02/20/2009
[  613.687023] Call Trace:
[  613.687029]  <TASK>
[  613.687034]  dump_stack_lvl+0x44/0x5c
[  613.687046]  __might_resched+0x171/0x1c0
[  613.687055]  ? check_slave_config_states+0x100/0x100 [ec_mini 7f93b9d1541d0037eab9400e73ee29f252250780]
[  613.687070]  down+0x1e/0x70
[  613.687076]  cyclic_task+0x11/0xdc [ec_mini 7f93b9d1541d0037eab9400e73ee29f252250780]
[  613.687088]  call_timer_fn+0x29/0x190
[  613.687096]  run_timer_softirq+0x4d5/0x570
[  613.687104]  ? __schedule+0x32b/0x1330
[  613.687110]  __do_softirq+0xd5/0x2ec
[  613.687117]  ? smpboot_thread_fn+0x23/0x300
[  613.687127]  run_timersd+0x60/0xb0
[  613.687130]  smpboot_thread_fn+0x24c/0x300
[  613.687133]  ? smpboot_unregister_percpu_thread+0x70/0x70
[  613.687135]  kthread+0x129/0x140
[  613.687138]  ? kthread_complete_and_exit+0x20/0x20
[  613.687141]  ret_from_fork+0x22/0x30
[  613.687146]  </TASK>
```
2024-02-01 14:09:00 +01:00
Florian Pose 512bac72e2 Merge branch 'devel-1.6' into prepare-1.6 2024-02-01 13:26:12 +01:00
Florian Pose be41b79f3f Merge branch 'devel-1.6' into prepare-1.6 2024-02-01 13:09:45 +01:00
Florian Pose 038f732543 Increase ioctl() version magic to 35. 2024-02-01 13:05:55 +01:00
Florian Pose 762bb01ff9 Merge branch 'devel-1.6' into ethercat-backport_setip 2024-02-01 12:41:38 +01:00
Florian Pose 2fdea4dd53 Merge branch '79-query-scan-progress-via-api-2' into 'devel-1.6'
Resolve "Query scan progress via API"

See merge request etherlab.org/ethercat!110
2024-02-01 10:27:07 +00:00
Bjarne von Horn 75686518c7 Remove whitespace. 2024-02-01 09:20:25 +01:00
Bjarne von Horn 2e071ad680 Remove EtherCAT copyright notice. 2024-02-01 09:18:26 +01:00
Bjarne von Horn 879a0b0278 Remove 2.6 conditionals in tty 2024-02-01 09:12:55 +01:00
Bjarne von Horn 52247cfc14 Remove 2.6 conditionals in example 2024-02-01 09:12:55 +01:00
Bjarne von Horn e8dd5984c7 Remove 2.6 conditionals in generic driver 2024-02-01 09:12:55 +01:00
Bjarne von Horn 9a2abde36c Remove 2.6 conditionals in master 2024-02-01 09:12:55 +01:00
Bjarne von Horn a2482e4a67 Remove e1000e 2.6 2024-02-01 09:12:55 +01:00
Bjarne von Horn 9fe05cf4eb Remove 2.6 e1000 2024-02-01 09:12:55 +01:00
Bjarne von Horn cb4888eee9 Remove 2.6 8139too e100 r8169 2024-02-01 09:12:55 +01:00
Florian Pose 91fe3eb735 Added ecrt_master_scan_progress() method. 2024-01-31 16:52:18 +01:00
Florian Pose 21b0b13703 Merge branch 'kbuild_out_of_tree' into 'devel-1.6'
support out-of-tree build

See merge request etherlab.org/ethercat!79
2024-01-31 14:52:23 +00:00
Nicola Fontana aad0686cc3 Disable 8139too driver by default
From now on, if you want 8139too support you must explicitly pass
`--enable-8139too` to `./configure`.
2024-01-31 15:18:02 +01:00
Bjarne von Horn 7c5f11bb8a WIP: Split doxygen API group into RT and nRT. 2024-01-15 11:43:59 +01:00
Bjarne von Horn dc13d7c511 Add lockdep assertion for EoE xmit callback 2024-01-15 11:43:59 +01:00
Bjarne von Horn eb44f82a91 Reuse netif_tx_lock for EoE TX synchronization
ndo_start_xmit callback is protected by __netif_tx_lock by the network stack,
so we no not need our own locks.
2024-01-15 11:20:25 +01:00
Bjarne von Horn a54fac3090 Make locking of ext_datagram_queue more selective 2024-01-15 11:20:25 +01:00
Bjarne von Horn 13e1e469e1 Use RT Mutex instead of semaphore for RT ioctl locking. 2024-01-15 11:20:25 +01:00
Bjarne von Horn 7a7f9a041e Fix -Wcomment. 2024-01-15 11:20:25 +01:00
Bjarne von Horn b78e5e8c7d Implement symbol visibility for libethercat 2024-01-15 11:20:25 +01:00
Bjarne von Horn c3826c7758 Remove EtherCAT copyright notice. 2024-01-15 11:20:25 +01:00
Bjarne von Horn 539d8e4ab2 Remove 2.6 conditionals in tty 2024-01-15 11:20:25 +01:00
Bjarne von Horn a0226a8e80 Remove 2.6 conditionals in example 2024-01-15 11:20:25 +01:00
Bjarne von Horn 10f892529b Remove 2.6 conditionals in generic driver 2024-01-15 11:20:25 +01:00
Bjarne von Horn 543dc87d88 Remove 2.6 conditionals in master 2024-01-15 11:20:25 +01:00
Bjarne von Horn f77a746b26 Remove e1000e 2.6 2024-01-15 11:20:25 +01:00
Bjarne von Horn 9def07b48f Remove 2.6 e1000 2024-01-15 11:20:22 +01:00
Bjarne von Horn 8b11bd8a97 Remove 2.6 8139too e100 r8169 2024-01-15 11:18:37 +01:00
Bjarne von Horn 3eda5173c6 Use fixed-size setip request 2023-09-20 12:46:52 +02:00
Bjarne von Horn 01c72a8865 EoE for Set IP in master 2023-09-20 12:30:24 +02:00
Bjarne von Horn c04fe65fef enable ip command in tool only if EC_EOE defined 2023-09-20 10:40:35 +02:00
Florian Pose 17fe43df94 EoE interface configuration hints. 2023-09-15 13:41:01 +02:00
Florian Pose e6243c0907 Included "ethercat ip" command in documentation. 2023-09-15 13:41:01 +02:00
Florian Pose 7b2084e270 Fixed endianess of EoE parameters. 2023-09-15 13:41:01 +02:00
Florian Pose 4d47f0b328 Implemented EoE Set IP parameter request via command-line tool. 2023-09-15 13:40:57 +02:00
Florian Pose 0e25f6d80f Removed obsolete mailbox type name and clarified documentation. 2023-09-13 10:02:31 +02:00
Florian Pose 5a255fce3d Removed obsolete FoE type name. 2023-09-13 10:02:31 +02:00
Florian Pose 41bc600cef Removed obsolete SoE type name. 2023-09-13 10:02:31 +02:00
Florian Pose d1df6520ba Cleaned up EoE frame type definitions. 2023-09-13 10:02:31 +02:00
Florian Pose 60ebe661a6 EoE frame types. 2023-09-13 10:02:31 +02:00
Bjarne von Horn 88080a2da1 build dist in ci and test out-of-tree build 2023-09-11 11:43:39 +02:00
Bjarne von Horn d967426204 add missing EXTRA_DIST 2023-09-11 11:43:39 +02:00
Bjarne von Horn 73e6ea9ce6 support out-of-tree build
by replacing `src` variable in Kbuild files.
2023-09-11 11:43:39 +02:00
1355 changed files with 539526 additions and 934344 deletions

93
.clang-format Normal file
View File

@ -0,0 +1,93 @@
---
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
...

2
.gitignore vendored
View File

@ -33,11 +33,13 @@ 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

View File

@ -1,20 +1,79 @@
image:
registry.gitlab.com/etherlab.org/build-container-factory/leap-15.3:linux-syms
registry.gitlab.com/etherlab.org/build-container-factory/leap-15.4:linux-syms
stages:
- build
- test
- doc
- deploy
- release
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 --disable-8139too --enable-tty --with-devices=2 --enable-ccat
- ./configure --with-linux-dir=/usr/src/linux-obj/$(uname -i)/default --enable-tty --with-devices=2 --enable-ccat --enable-fakeuserlib
- 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
- ethercat-*.tar.bz2
# Build ethercat tool subcommand help output for documentation
commands:
@ -54,7 +113,7 @@ doxygen:
GIT_SUBMODULE_STRATEGY: recursive
script:
- ./bootstrap
- ./configure --with-linux-dir=/usr/src/linux-obj/$(uname -i)/default --disable-8139too --enable-tty --with-devices=2 --enable-ccat
- ./configure --with-linux-dir=/usr/src/linux-obj/$(uname -i)/default --enable-tty --with-devices=2 --enable-ccat
- make doc
- mv doxygen-output/html/ html/
artifacts:
@ -65,11 +124,14 @@ 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.3:texlive
image: registry.gitlab.com/etherlab.org/build-container-factory/leap-15.4:texlive
script:
- cd documentation
- 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
- 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
- make
- make index
- make
@ -83,12 +145,45 @@ pdf:
update docs server:
stage: deploy
rules:
- if: $CI_COMMIT_BRANCH == "stable-1.5" && $CI_PROJECT_NAMESPACE == "etherlab.org"
- if: ($CI_COMMIT_BRANCH == "stable-1.6" || $CI_COMMIT_TAG) && $CI_PROJECT_NAMESPACE == "etherlab.org"
trigger: etherlab.org/docs
upload:
stage: deploy
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"
dependencies:
- "build"
script:
- echo "$CI_COMMIT_TAG" | grep -qE '^[0-9]+(\.[0-9]+){2}$'
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
--header "Content-Type: application/gzip" \
--fail-with-body \
--upload-file "ethercat-${CI_COMMIT_TAG}.tar.gz" \
"${PACKAGE_REGISTRY_URL}/ethercat-${CI_COMMIT_TAG}.tar.gz"
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
--header "Content-Type: application/x-bzip2" \
--fail-with-body \
--upload-file "ethercat-${CI_COMMIT_TAG}.tar.bz2" \
"${PACKAGE_REGISTRY_URL}/ethercat-${CI_COMMIT_TAG}.tar.bz2"
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"
script:
- |
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"ethercat.tar.bz2\",\"url\":\"${PACKAGE_REGISTRY_URL}/ethercat-${CI_COMMIT_TAG}.tar.bz2\",\"link_type\":\"package\",\"filepath\":\"/dist-tarballs/ethercat.tar.bz2\"}" \
--assets-link "{\"name\":\"ethercat.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/ethercat-${CI_COMMIT_TAG}.tar.gz\",\"link_type\":\"package\",\"filepath\":\"/dist-tarballs/ethercat.tar.gz\"}"
# from 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml', but on all branches
workflow:
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH == "stable-1.5"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH == "stable-1.6"

181
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,181 @@
<!-- 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)!

File diff suppressed because it is too large Load Diff

View File

@ -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
./configure --sysconfdir=/etc
make all modules
```
@ -26,13 +26,11 @@ make modules_install install
depmod
```
... and linking the init script and copying the sysconfig file from $PREFIX/etc
to the appropriate locations and customizing the sysconfig file.
... and then customizing the appropriate configuration file:
```bash
ln -s ${PREFIX}/etc/init.d/ethercat /etc/init.d/ethercat
cp ${PREFIX}/etc/sysconfig/ethercat /etc/sysconfig/ethercat
vi /etc/sysconfig/ethercat
# vi /etc/ethercat.conf # For systemd based distro
# vi /etc/sysconfig/ethercat # For init.d based distro
```
Make sure, that the 'udev' package is installed, to automatically create the
@ -47,7 +45,8 @@ echo KERNEL==\"EtherCAT[0-9]*\", MODE=\"0664\" > /etc/udev/rules.d/99-EtherCAT.r
Now you can start the EtherCAT master:
```bash
/etc/init.d/ethercat start
# systemctl start ethercat # For systemd based distro
# /etc/init.d/ethercat start # For init.d based distro
```
Have a look at the [examples subdirectory](examples/) for some application

View File

@ -1,6 +1,4 @@
#------------------------------------------------------------------------------
#
# $Id$
#-----------------------------------------------------------------------------
#
# Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
#
@ -19,15 +17,9 @@
# 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/
@ -35,4 +27,9 @@ ifeq (@ENABLE_TTY@,1)
obj-m += tty/
endif
#------------------------------------------------------------------------------
ifeq (@ENABLE_RTAI@, 1)
KBUILD_EXTRA_SYMBOLS := \
@RTAI_MODULE_DIR@/Module.symvers
endif
#-----------------------------------------------------------------------------

View File

@ -17,12 +17,6 @@
# 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
@ -30,7 +24,6 @@ include $(top_srcdir)/Makefile.kbuild
ACLOCAL_AMFLAGS = -I m4
AM_DISTCHECK_CONFIGURE_FLAGS = \
--disable-8139too \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
SUBDIRS = \
@ -54,6 +47,11 @@ SUBDIRS += \
examples
endif
if ENABLE_FAKEUSERLIB
SUBDIRS += \
fake_lib
endif
if ENABLE_TTY
SUBDIRS += tty
endif

View File

@ -3,7 +3,7 @@
# ```
# include $(top_srcdir)/Makefile.kbuild
# ```
KBUILD = $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(abs_srcdir)" INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)"
KBUILD = $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(abs_builddir)" INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)"
modules:

441
NEWS
View File

@ -1,441 +0,0 @@
-------------------------------------------------------------------------------
$Id$
vim: spelllang=en spell tw=78
-------------------------------------------------------------------------------
Changes since 1.5.2:
* 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 Normal file
View File

@ -0,0 +1,505 @@
# 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

View File

@ -1,10 +1,8 @@
-------------------------------------------------------------------------------
$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.
@ -12,8 +10,9 @@ 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
@ -26,4 +25,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.
-------------------------------------------------------------------------------
------------------------------------------------------------------------------

View File

@ -1,29 +1,23 @@
This is the README file of the IgH EtherCAT Master.
vim: spelllang=en spell tw=78
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)
[[_TOC_]]
# 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 http://etherlab.org/en/ethercat.
information, see https://etherlab.org/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
>>>
@ -54,7 +48,7 @@ make doc
```
An up-to-date Doxygen output can be found on
[docs.etherlab.org](https://docs.etherlab.org/ethercat/1.5/doxygen/index.html).
[docs.etherlab.org](https://docs.etherlab.org/ethercat/1.6/doxygen/index.html).
# Requirements
@ -65,13 +59,20 @@ the EtherCAT master.
## Hardware requirements
A table of supported hardware can be found at
http://etherlab.org/en/ethercat/hardware.php.
A table of supported hardware can be found at:
https://docs.etherlab.org/ethercat/1.6/doxygen/devicedrivers.html
# 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
@ -101,11 +102,9 @@ 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
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.
Please see the [contributiong document](CONTRIBUTING.md).
# Coding Style

7
TODO
View File

@ -2,12 +2,15 @@
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.

View File

@ -1,7 +1,5 @@
#!/bin/bash
#----------------------------------------------------------------------------
#
# $Id$
#-----------------------------------------------------------------------------
#
# Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH
#
@ -20,13 +18,7 @@
# 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
@ -39,4 +31,4 @@ mkdir -p m4
autoreconf -i
#----------------------------------------------------------------------------
#-----------------------------------------------------------------------------

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

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -19,22 +17,16 @@
* 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:
@ -656,7 +648,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -19,22 +17,16 @@
* 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:
@ -665,7 +657,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -19,22 +17,16 @@
* 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:
@ -665,7 +657,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -19,22 +17,16 @@
* 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:
@ -665,7 +657,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -19,22 +17,16 @@
* 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:
@ -665,7 +657,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -19,22 +17,16 @@
* 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 +649,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -19,22 +17,16 @@
* 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:
@ -665,7 +657,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -19,22 +17,16 @@
* 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:
@ -665,7 +657,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -19,22 +17,16 @@
* 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:
@ -665,7 +657,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -19,22 +17,16 @@
* 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:
@ -669,7 +661,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);

View File

@ -17,12 +17,6 @@
* 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
*
*****************************************************************************/
@ -668,7 +662,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);

View File

@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -17,22 +17,16 @@
* 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:
@ -155,6 +149,17 @@
#include "../globals.h"
#include "ecdev.h"
#ifdef CONFIG_SUSE_KERNEL
#include <linux/suse_version.h>
#else
# ifndef SUSE_VERSION
# define SUSE_VERSION 0
# endif
# ifndef SUSE_PATCHLEVEL
# define SUSE_PATCHLEVEL 0
# endif
#endif
#define RTL8139_DRIVER_NAME DRV_NAME \
" EtherCAT-capable Fast Ethernet driver " \
DRV_VERSION ", master " EC_MASTER_VERSION
@ -668,7 +673,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);
@ -2389,8 +2394,11 @@ static int rtl8139_set_mac_address(struct net_device *dev, void *p)
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
#if SUSE_VERSION == 15 && SUSE_PATCHLEVEL >= 5
eth_hw_addr_set(dev, addr->sa_data);
#else
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
#endif
spin_lock_irq(&tp->lock);
RTL_W8_F(Cfg9346, Cfg9346_Unlock);

View File

@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -17,22 +17,16 @@
* 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:
@ -668,7 +662,7 @@ struct rtl8139_private {
ec_device_t *ecdev;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);

View File

@ -17,11 +17,6 @@
* 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
*
@ -665,10 +660,19 @@ struct rtl8139_private {
unsigned int regs_len;
unsigned long fifo_copy_timeout;
ec_device_t *ecdev;
ec_device_t *ecdev_;
bool ecdev_initialized;
};
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
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_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(EC_MASTER_VERSION);
@ -1088,9 +1092,10 @@ 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_ = ecdev_offer(dev, ec_poll, THIS_MODULE);
tp->ecdev_initialized = true;
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
pr_debug("about to register device named %s (%p)...\n",
dev->name, dev);
i = register_netdev (dev);
@ -1163,10 +1168,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 (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (get_ecdev(tp)) {
i = ecdev_open(get_ecdev(tp));
if (i) {
ecdev_withdraw(tp->ecdev);
ecdev_withdraw(get_ecdev(tp));
goto err_out;
}
}
@ -1187,9 +1192,9 @@ static void rtl8139_remove_one(struct pci_dev *pdev)
assert (dev != NULL);
if (tp->ecdev) {
ecdev_close(tp->ecdev);
ecdev_withdraw(tp->ecdev);
if (get_ecdev(tp)) {
ecdev_close(get_ecdev(tp));
ecdev_withdraw(get_ecdev(tp));
}
else {
cancel_delayed_work_sync(&tp->thread);
@ -1398,7 +1403,7 @@ static int rtl8139_open (struct net_device *dev)
const int irq = tp->pci_dev->irq;
int retval;
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
retval = request_irq(irq, rtl8139_interrupt, IRQF_SHARED, dev->name, dev);
if (retval)
return retval;
@ -1409,7 +1414,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 (!tp->ecdev) {
if (!get_ecdev(tp)) {
free_irq(irq, dev);
}
@ -1431,7 +1436,7 @@ static int rtl8139_open (struct net_device *dev)
rtl8139_init_ring (dev);
rtl8139_hw_start (dev);
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
netif_start_queue (dev);
}
@ -1442,7 +1447,7 @@ static int rtl8139_open (struct net_device *dev)
irq, RTL_R8 (MediaStatus),
tp->mii.full_duplex ? "full" : "half");
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
rtl8139_start_thread(tp);
}
@ -1454,10 +1459,10 @@ static void rtl_check_media (struct net_device *dev, unsigned int init_media)
{
struct rtl8139_private *tp = netdev_priv(dev);
if (tp->ecdev) {
if (get_ecdev(tp)) {
void __iomem *ioaddr = tp->mmio_addr;
u16 state = RTL_R16(BasicModeStatus) & BMSR_LSTATUS;
ecdev_set_link(tp->ecdev, state ? 1 : 0);
ecdev_set_link(get_ecdev(tp), state ? 1 : 0);
}
else {
if (tp->phys[0] >= 0) {
@ -1528,7 +1533,7 @@ static void rtl8139_hw_start (struct net_device *dev)
if ((!(tmp & CmdRxEnb)) || (!(tmp & CmdTxEnb)))
RTL_W8 (ChipCmd, CmdRxEnb | CmdTxEnb);
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
/* Enable all known interrupts by setting the interrupt mask. */
RTL_W16 (IntrMask, rtl8139_intr_mask);
}
@ -1775,7 +1780,7 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
if (tmp8 & CmdTxEnb)
RTL_W8 (ChipCmd, CmdRxEnb);
if (tp->ecdev) {
if (get_ecdev(tp)) {
rtl8139_tx_clear (tp);
rtl8139_hw_start (dev);
}
@ -1803,7 +1808,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 (!tp->ecdev && !tp->have_thread) {
if (!get_ecdev(tp) && !tp->have_thread) {
INIT_DELAYED_WORK(&tp->thread, rtl8139_thread);
schedule_delayed_work(&tp->thread, next_tick);
}
@ -1826,18 +1831,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 (!tp->ecdev) {
if (!get_ecdev(tp)) {
dev_kfree_skb_any(skb);
}
} else {
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
dev_kfree_skb_any(skb);
}
dev->stats.tx_dropped++;
return NETDEV_TX_OK;
}
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
spin_lock_irqsave(&tp->lock, flags);
}
/*
@ -1851,7 +1856,7 @@ static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,
tp->cur_tx++;
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx)
netif_stop_queue (dev);
spin_unlock_irqrestore(&tp->lock, flags);
@ -1930,7 +1935,7 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
if (tp->dirty_tx != dirty_tx) {
tp->dirty_tx = dirty_tx;
mb();
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
netif_wake_queue (dev);
}
}
@ -2066,7 +2071,7 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
RTL_R16 (RxBufAddr),
RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd));
while ((tp->ecdev || netif_running(dev))
while ((get_ecdev(tp) || netif_running(dev))
&& received < budget
&& (RTL_R8 (ChipCmd) & RxBufEmpty) == 0) {
u32 ring_offset = cur_rx % RX_BUF_LEN;
@ -2084,7 +2089,7 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
else
pkt_size = rx_size;
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
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,
@ -2156,8 +2161,8 @@ no_early_rx:
}
keep_pkt:
if (tp->ecdev) {
ecdev_receive(tp->ecdev, &rx_ring[ring_offset + 4], pkt_size);
if (get_ecdev(tp)) {
ecdev_receive(get_ecdev(tp), &rx_ring[ring_offset + 4], pkt_size);
}
else {
/* Malloc up new buffer, compatible with net-2e. */
@ -2295,7 +2300,7 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance)
int link_changed = 0; /* avoid bogus "uninit" warning */
int handled = 0;
if (tp->ecdev) {
if (get_ecdev(tp)) {
status = RTL_R16 (IntrStatus);
}
else {
@ -2313,7 +2318,7 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance)
if (unlikely(status == 0xFFFF))
goto out;
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
/* close possible race's with dev_close */
if (unlikely(!netif_running(dev))) {
RTL_W16 (IntrMask, 0);
@ -2333,7 +2338,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 (tp->ecdev) {
if (get_ecdev(tp)) {
/* EtherCAT device: Just receive all frames */
rtl8139_rx(dev, tp, 100); // FIXME
} else {
@ -2356,7 +2361,7 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance)
RTL_W16 (IntrStatus, TxErr);
}
out:
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
spin_unlock (&tp->lock);
}
@ -2410,7 +2415,7 @@ static int rtl8139_close (struct net_device *dev)
void __iomem *ioaddr = tp->mmio_addr;
unsigned long flags = 0;
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
netif_stop_queue(dev);
napi_disable(&tp->napi);
@ -2431,7 +2436,7 @@ static int rtl8139_close (struct net_device *dev)
dev->stats.rx_missed_errors += RTL_R32 (RxMissed);
RTL_W32 (RxMissed, 0);
if (!tp->ecdev) {
if (!get_ecdev(tp)) {
spin_unlock_irqrestore (&tp->lock, flags);
free_irq(tp->pci_dev->irq, dev);
@ -2659,7 +2664,7 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
struct rtl8139_private *tp = netdev_priv(dev);
int rc;
if (tp->ecdev || !netif_running(dev))
if (get_ecdev(tp) || !netif_running(dev))
return -EINVAL;
spin_lock_irq(&tp->lock);
@ -2678,7 +2683,7 @@ rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
unsigned long flags;
unsigned int start;
if (tp->ecdev || netif_running(dev)) {
if (get_ecdev(tp) || netif_running(dev)) {
spin_lock_irqsave (&tp->lock, flags);
dev->stats.rx_missed_errors += RTL_R32 (RxMissed);
RTL_W32 (RxMissed, 0);
@ -2767,7 +2772,7 @@ static int __maybe_unused rtl8139_suspend(struct device *device)
void __iomem *ioaddr = tp->mmio_addr;
unsigned long flags;
if (tp->ecdev || !netif_running (dev))
if (get_ecdev(tp) || !netif_running (dev))
return 0;
netif_device_detach (dev);
@ -2792,7 +2797,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 (tp->ecdev || !netif_running (dev))
if (get_ecdev(tp) || !netif_running (dev))
return 0;
rtl8139_init_ring (dev);

View File

@ -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,6 +100,7 @@
#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>
@ -111,6 +112,7 @@
#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
@ -147,9 +149,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 int use_io = 1;
static bool use_io = true;
#else
static int use_io = 0;
static bool use_io = false;
#endif
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
@ -181,10 +183,13 @@ 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+14+4).*/
#define MAX_ETH_FRAME_SIZE 1536
/* max supported ethernet frame size -- must be at least (dev->mtu+18+4).*/
#define MAX_ETH_FRAME_SIZE 1792
/* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */
/* 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). */
#define TX_BUF_SIZE MAX_ETH_FRAME_SIZE
#define TX_BUF_TOT_LEN (TX_BUF_SIZE * NUM_TX_DESC)
@ -227,13 +232,13 @@ typedef enum {
static const struct {
const char *name;
u32 hw_flags;
} board_info[] __devinitdata = {
} board_info[] = {
{ "RealTek RTL8139", RTL8139_CAPS },
{ "RealTek RTL8129", RTL8129_CAPS },
};
static DEFINE_PCI_DEVICE_TABLE(rtl8139_pci_tbl) = {
static const struct pci_device_id 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 },
@ -253,6 +258,7 @@ static DEFINE_PCI_DEVICE_TABLE(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 :-( */
@ -542,8 +548,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),
@ -564,6 +570,12 @@ 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;
@ -574,11 +586,13 @@ 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;
@ -611,7 +625,7 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION);
module_param(use_io, int, 0);
module_param(use_io, bool, 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);
@ -628,7 +642,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);
static void rtl8139_tx_timeout (struct net_device *dev, unsigned int txqueue);
static void rtl8139_init_ring (struct net_device *dev);
static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,
struct net_device *dev);
@ -640,7 +654,8 @@ 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 struct net_device_stats *rtl8139_get_stats (struct net_device *dev);
static void rtl8139_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *stats);
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);
@ -716,7 +731,6 @@ static void __rtl8139_cleanup_dev (struct net_device *dev)
pci_release_regions (pdev);
free_netdev(dev);
pci_set_drvdata (pdev, NULL);
}
@ -737,26 +751,32 @@ static void rtl8139_chip_reset (void __iomem *ioaddr)
}
static __devinit struct net_device * rtl8139_init_board (struct pci_dev *pdev)
static 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;
unsigned long pio_start, pio_end, pio_flags, pio_len;
unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
unsigned int i, bar;
unsigned long io_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) {
dev_err(&pdev->dev, "Unable to alloc new net device\n");
if (dev == NULL)
return ERR_PTR(-ENOMEM);
}
SET_NETDEV_DEV(dev, &pdev->dev);
tp = netdev_priv(dev);
@ -767,78 +787,48 @@ static __devinit struct net_device * rtl8139_init_board (struct pci_dev *pdev)
if (rc)
goto err_out;
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;
}
}
disable_dev_on_err = 1;
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);
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;
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;
goto retry;
}
dev->base_addr = (long) ioaddr;
tp->regs_len = mmio_len;
rc = -ENODEV;
goto err_out;
}
tp->regs_len = io_len;
tp->mmio_addr = ioaddr;
/* Bring old chips out of low-power mode. */
@ -907,27 +897,55 @@ 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_stats = rtl8139_get_stats,
.ndo_change_mtu = eth_change_mtu,
.ndo_get_stats64 = rtl8139_get_stats64,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = rtl8139_set_mac_address,
.ndo_start_xmit = rtl8139_start_xmit,
.ndo_set_multicast_list = rtl8139_set_rx_mode,
.ndo_do_ioctl = netdev_ioctl,
.ndo_set_rx_mode = rtl8139_set_rx_mode,
.ndo_eth_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 __devinit rtl8139_init_one (struct pci_dev *pdev,
const struct pci_device_id *ent)
static int 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;
@ -961,7 +979,7 @@ static int __devinit 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 = 1;
use_io = true;
}
dev = rtl8139_init_board (pdev);
@ -977,23 +995,28 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
addr_len = read_eeprom (ioaddr, 0, 8) == 0x8129 ? 8 : 6;
for (i = 0; i < 3; i++)
((__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);
addr[i] = cpu_to_le16(read_eeprom (ioaddr, i + 7, addr_len));
eth_hw_addr_set(dev, (u8 *)addr);
/* 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, 64);
netif_napi_add(dev, &tp->napi, rtl8139_poll);
/* 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->irq = pdev->irq;
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;
/* tp zeroed and aligned in alloc_etherdev */
tp = netdev_priv(dev);
@ -1020,9 +1043,9 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
pci_set_drvdata (pdev, dev);
netdev_info(dev, "%s at 0x%lx, %pM, IRQ %d\n",
netdev_info(dev, "%s at 0x%p, %pM, IRQ %d\n",
board_info[ent->driver_data].name,
dev->base_addr, dev->dev_addr, dev->irq);
ioaddr, dev->dev_addr, pdev->irq);
netdev_dbg(dev, "Identified 8139 chip type '%s'\n",
rtl_chip_info[tp->chipset].name);
@ -1089,13 +1112,14 @@ err_out:
}
static void __devexit rtl8139_remove_one (struct pci_dev *pdev)
static void 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);
flush_scheduled_work();
cancel_delayed_work_sync(&tp->thread);
unregister_netdev (dev);
@ -1119,14 +1143,14 @@ static void __devexit 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_R32(Cfg9346)
#define eeprom_delay() (void)RTL_R8(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 __devinit read_eeprom (void __iomem *ioaddr, int location, int addr_len)
static int read_eeprom(void __iomem *ioaddr, int location, int addr_len)
{
int i;
unsigned retval = 0;
@ -1158,7 +1182,7 @@ static int __devinit read_eeprom (void __iomem *ioaddr, int location, int addr_l
}
/* Terminate the EEPROM access. */
RTL_W8 (Cfg9346, ~EE_CS);
RTL_W8(Cfg9346, 0);
eeprom_delay ();
return retval;
@ -1296,10 +1320,11 @@ 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);
int retval;
void __iomem *ioaddr = tp->mmio_addr;
const int irq = tp->pci_dev->irq;
int retval;
retval = request_irq (dev->irq, rtl8139_interrupt, IRQF_SHARED, dev->name, dev);
retval = request_irq(irq, rtl8139_interrupt, IRQF_SHARED, dev->name, dev);
if (retval)
return retval;
@ -1308,7 +1333,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(dev->irq, dev);
free_irq(irq, dev);
if (tp->tx_bufs)
dma_free_coherent(&tp->pci_dev->dev, TX_BUF_TOT_LEN,
@ -1334,7 +1359,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),
dev->irq, RTL_R8 (MediaStatus),
irq, RTL_R8 (MediaStatus),
tp->mii.full_duplex ? "full" : "half");
rtl8139_start_thread(tp);
@ -1636,6 +1661,10 @@ 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));
@ -1665,14 +1694,14 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
spin_unlock_irq(&tp->lock);
/* ...and finally, reset everything */
if (netif_running(dev)) {
rtl8139_hw_start (dev);
netif_wake_queue (dev);
}
napi_enable(&tp->napi);
rtl8139_hw_start(dev);
netif_wake_queue(dev);
spin_unlock_bh(&tp->rx_lock);
}
static void rtl8139_tx_timeout (struct net_device *dev)
static void rtl8139_tx_timeout(struct net_device *dev, unsigned int txqueue)
{
struct rtl8139_private *tp = netdev_priv(dev);
@ -1700,9 +1729,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(skb);
dev_kfree_skb_any(skb);
} else {
dev_kfree_skb(skb);
dev_kfree_skb_any(skb);
dev->stats.tx_dropped++;
return NETDEV_TX_OK;
}
@ -1774,8 +1803,10 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
dev->stats.tx_fifo_errors++;
}
dev->stats.collisions += (txstatus >> 24) & 15;
dev->stats.tx_bytes += txstatus & 0x7ff;
dev->stats.tx_packets++;
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);
}
dirty_tx++;
@ -1938,7 +1969,10 @@ 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;
pkt_size = rx_size - 4;
if (likely(!(dev->features & NETIF_F_RXFCS)))
pkt_size = rx_size - 4;
else
pkt_size = rx_size;
netif_dbg(tp, rx_status, dev, "%s() status %04x, size %04x, cur %04x\n",
__func__, rx_status, rx_size, cur_rx);
@ -1976,15 +2010,34 @@ 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 = netdev_alloc_skb_ip_align(dev, pkt_size);
skb = napi_alloc_skb(&tp->napi, pkt_size);
if (likely(skb)) {
#if RX_BUF_IDX == 3
wrap_copy(skb, rx_ring, ring_offset+4, pkt_size);
@ -1995,13 +2048,13 @@ no_early_rx:
skb->protocol = eth_type_trans (skb, dev);
dev->stats.rx_bytes += pkt_size;
dev->stats.rx_packets++;
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);
netif_receive_skb (skb);
} else {
if (net_ratelimit())
netdev_warn(dev, "Memory squeeze, dropping packet\n");
dev->stats.rx_dropped++;
}
received++;
@ -2084,13 +2137,10 @@ 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);
__napi_complete(napi);
RTL_W16_F(IntrMask, rtl8139_intr_mask);
if (napi_complete_done(napi, work_done))
RTL_W16_F(IntrMask, rtl8139_intr_mask);
spin_unlock_irqrestore(&tp->lock, flags);
}
spin_unlock(&tp->rx_lock);
@ -2171,9 +2221,12 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance)
*/
static void rtl8139_poll_controller(struct net_device *dev)
{
disable_irq(dev->irq);
rtl8139_interrupt(dev->irq, dev);
enable_irq(dev->irq);
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);
}
#endif
@ -2186,7 +2239,7 @@ static int rtl8139_set_mac_address(struct net_device *dev, void *p)
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
eth_hw_addr_set(dev, addr->sa_data);
spin_lock_irq(&tp->lock);
@ -2226,7 +2279,7 @@ static int rtl8139_close (struct net_device *dev)
spin_unlock_irqrestore (&tp->lock, flags);
free_irq (dev->irq, dev);
free_irq(tp->pci_dev->irq, dev);
rtl8139_tx_clear (tp);
@ -2327,27 +2380,28 @@ 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);
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;
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));
}
static int rtl8139_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
static int rtl8139_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct rtl8139_private *tp = netdev_priv(dev);
spin_lock_irq(&tp->lock);
mii_ethtool_gset(&tp->mii, cmd);
mii_ethtool_get_link_ksettings(&tp->mii, cmd);
spin_unlock_irq(&tp->lock);
return 0;
}
static int rtl8139_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
static int rtl8139_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{
struct rtl8139_private *tp = netdev_priv(dev);
int rc;
spin_lock_irq(&tp->lock);
rc = mii_ethtool_sset(&tp->mii, cmd);
rc = mii_ethtool_set_link_ksettings(&tp->mii, cmd);
spin_unlock_irq(&tp->lock);
return rc;
}
@ -2429,8 +2483,6 @@ 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,
@ -2442,6 +2494,8 @@ 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)
@ -2460,11 +2514,13 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
}
static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)
static void
rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
{
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);
@ -2473,7 +2529,19 @@ static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)
spin_unlock_irqrestore (&tp->lock, flags);
}
return &dev->stats;
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));
}
/* Set or clear the multicast filter for this adaptor.
@ -2513,6 +2581,9 @@ 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) {
@ -2533,17 +2604,13 @@ static void rtl8139_set_rx_mode (struct net_device *dev)
spin_unlock_irqrestore (&tp->lock, flags);
}
#ifdef CONFIG_PM
static int rtl8139_suspend (struct pci_dev *pdev, pm_message_t state)
static int __maybe_unused rtl8139_suspend(struct device *device)
{
struct net_device *dev = pci_get_drvdata (pdev);
struct net_device *dev = dev_get_drvdata(device);
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;
@ -2561,38 +2628,30 @@ static int rtl8139_suspend (struct pci_dev *pdev, pm_message_t state)
spin_unlock_irqrestore (&tp->lock, flags);
pci_set_power_state (pdev, PCI_D3hot);
return 0;
}
static int rtl8139_resume (struct pci_dev *pdev)
static int __maybe_unused rtl8139_resume(struct device *device)
{
struct net_device *dev = pci_get_drvdata (pdev);
struct net_device *dev = dev_get_drvdata(device);
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;
}
#endif /* CONFIG_PM */
static SIMPLE_DEV_PM_OPS(rtl8139_pm_ops, rtl8139_suspend, rtl8139_resume);
static struct pci_driver rtl8139_pci_driver = {
.name = DRV_NAME,
.id_table = rtl8139_pci_tbl,
.probe = rtl8139_init_one,
.remove = __devexit_p(rtl8139_remove_one),
#ifdef CONFIG_PM
.suspend = rtl8139_suspend,
.resume = rtl8139_resume,
#endif /* CONFIG_PM */
.remove = rtl8139_remove_one,
.driver.pm = &rtl8139_pm_ops,
};

View File

@ -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,6 +100,7 @@
#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>
@ -111,6 +112,7 @@
#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
@ -147,9 +149,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 int use_io = 1;
static bool use_io = true;
#else
static int use_io = 0;
static bool use_io = false;
#endif
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
@ -181,10 +183,13 @@ 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+14+4).*/
#define MAX_ETH_FRAME_SIZE 1536
/* max supported ethernet frame size -- must be at least (dev->mtu+18+4).*/
#define MAX_ETH_FRAME_SIZE 1792
/* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */
/* 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). */
#define TX_BUF_SIZE MAX_ETH_FRAME_SIZE
#define TX_BUF_TOT_LEN (TX_BUF_SIZE * NUM_TX_DESC)
@ -227,13 +232,13 @@ typedef enum {
static const struct {
const char *name;
u32 hw_flags;
} board_info[] __devinitdata = {
} board_info[] = {
{ "RealTek RTL8139", RTL8139_CAPS },
{ "RealTek RTL8129", RTL8129_CAPS },
};
static DEFINE_PCI_DEVICE_TABLE(rtl8139_pci_tbl) = {
static const struct pci_device_id 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 },
@ -253,6 +258,7 @@ static DEFINE_PCI_DEVICE_TABLE(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 :-( */
@ -542,8 +548,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),
@ -564,6 +570,12 @@ 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;
@ -574,11 +586,13 @@ 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;
@ -611,7 +625,7 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION);
module_param(use_io, int, 0);
module_param(use_io, bool, 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);
@ -628,7 +642,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);
static void rtl8139_tx_timeout (struct net_device *dev, unsigned int txqueue);
static void rtl8139_init_ring (struct net_device *dev);
static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,
struct net_device *dev);
@ -640,7 +654,8 @@ 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 struct net_device_stats *rtl8139_get_stats (struct net_device *dev);
static void rtl8139_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *stats);
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);
@ -716,7 +731,6 @@ static void __rtl8139_cleanup_dev (struct net_device *dev)
pci_release_regions (pdev);
free_netdev(dev);
pci_set_drvdata (pdev, NULL);
}
@ -737,26 +751,32 @@ static void rtl8139_chip_reset (void __iomem *ioaddr)
}
static __devinit struct net_device * rtl8139_init_board (struct pci_dev *pdev)
static 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;
unsigned long pio_start, pio_end, pio_flags, pio_len;
unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
unsigned int i, bar;
unsigned long io_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) {
dev_err(&pdev->dev, "Unable to alloc new net device\n");
if (dev == NULL)
return ERR_PTR(-ENOMEM);
}
SET_NETDEV_DEV(dev, &pdev->dev);
tp = netdev_priv(dev);
@ -767,78 +787,48 @@ static __devinit struct net_device * rtl8139_init_board (struct pci_dev *pdev)
if (rc)
goto err_out;
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;
}
}
disable_dev_on_err = 1;
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);
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;
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;
goto retry;
}
dev->base_addr = (long) ioaddr;
tp->regs_len = mmio_len;
rc = -ENODEV;
goto err_out;
}
tp->regs_len = io_len;
tp->mmio_addr = ioaddr;
/* Bring old chips out of low-power mode. */
@ -907,27 +897,55 @@ 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_stats = rtl8139_get_stats,
.ndo_change_mtu = eth_change_mtu,
.ndo_get_stats64 = rtl8139_get_stats64,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = rtl8139_set_mac_address,
.ndo_start_xmit = rtl8139_start_xmit,
.ndo_set_multicast_list = rtl8139_set_rx_mode,
.ndo_do_ioctl = netdev_ioctl,
.ndo_set_rx_mode = rtl8139_set_rx_mode,
.ndo_eth_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 __devinit rtl8139_init_one (struct pci_dev *pdev,
const struct pci_device_id *ent)
static int 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;
@ -961,7 +979,7 @@ static int __devinit 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 = 1;
use_io = true;
}
dev = rtl8139_init_board (pdev);
@ -977,23 +995,28 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
addr_len = read_eeprom (ioaddr, 0, 8) == 0x8129 ? 8 : 6;
for (i = 0; i < 3; i++)
((__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);
addr[i] = cpu_to_le16(read_eeprom (ioaddr, i + 7, addr_len));
eth_hw_addr_set(dev, (u8 *)addr);
/* 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, 64);
netif_napi_add(dev, &tp->napi, rtl8139_poll);
/* 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->irq = pdev->irq;
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;
/* tp zeroed and aligned in alloc_etherdev */
tp = netdev_priv(dev);
@ -1020,9 +1043,9 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
pci_set_drvdata (pdev, dev);
netdev_info(dev, "%s at 0x%lx, %pM, IRQ %d\n",
netdev_info(dev, "%s at 0x%p, %pM, IRQ %d\n",
board_info[ent->driver_data].name,
dev->base_addr, dev->dev_addr, dev->irq);
ioaddr, dev->dev_addr, pdev->irq);
netdev_dbg(dev, "Identified 8139 chip type '%s'\n",
rtl_chip_info[tp->chipset].name);
@ -1089,13 +1112,14 @@ err_out:
}
static void __devexit rtl8139_remove_one (struct pci_dev *pdev)
static void 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);
flush_scheduled_work();
cancel_delayed_work_sync(&tp->thread);
unregister_netdev (dev);
@ -1119,14 +1143,14 @@ static void __devexit 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_R32(Cfg9346)
#define eeprom_delay() (void)RTL_R8(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 __devinit read_eeprom (void __iomem *ioaddr, int location, int addr_len)
static int read_eeprom(void __iomem *ioaddr, int location, int addr_len)
{
int i;
unsigned retval = 0;
@ -1158,7 +1182,7 @@ static int __devinit read_eeprom (void __iomem *ioaddr, int location, int addr_l
}
/* Terminate the EEPROM access. */
RTL_W8 (Cfg9346, ~EE_CS);
RTL_W8(Cfg9346, 0);
eeprom_delay ();
return retval;
@ -1296,10 +1320,11 @@ 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);
int retval;
void __iomem *ioaddr = tp->mmio_addr;
const int irq = tp->pci_dev->irq;
int retval;
retval = request_irq (dev->irq, rtl8139_interrupt, IRQF_SHARED, dev->name, dev);
retval = request_irq(irq, rtl8139_interrupt, IRQF_SHARED, dev->name, dev);
if (retval)
return retval;
@ -1308,7 +1333,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(dev->irq, dev);
free_irq(irq, dev);
if (tp->tx_bufs)
dma_free_coherent(&tp->pci_dev->dev, TX_BUF_TOT_LEN,
@ -1334,7 +1359,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),
dev->irq, RTL_R8 (MediaStatus),
irq, RTL_R8 (MediaStatus),
tp->mii.full_duplex ? "full" : "half");
rtl8139_start_thread(tp);
@ -1636,6 +1661,10 @@ 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));
@ -1665,14 +1694,14 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
spin_unlock_irq(&tp->lock);
/* ...and finally, reset everything */
if (netif_running(dev)) {
rtl8139_hw_start (dev);
netif_wake_queue (dev);
}
napi_enable(&tp->napi);
rtl8139_hw_start(dev);
netif_wake_queue(dev);
spin_unlock_bh(&tp->rx_lock);
}
static void rtl8139_tx_timeout (struct net_device *dev)
static void rtl8139_tx_timeout(struct net_device *dev, unsigned int txqueue)
{
struct rtl8139_private *tp = netdev_priv(dev);
@ -1700,9 +1729,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(skb);
dev_kfree_skb_any(skb);
} else {
dev_kfree_skb(skb);
dev_kfree_skb_any(skb);
dev->stats.tx_dropped++;
return NETDEV_TX_OK;
}
@ -1774,8 +1803,10 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
dev->stats.tx_fifo_errors++;
}
dev->stats.collisions += (txstatus >> 24) & 15;
dev->stats.tx_bytes += txstatus & 0x7ff;
dev->stats.tx_packets++;
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);
}
dirty_tx++;
@ -1938,7 +1969,10 @@ 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;
pkt_size = rx_size - 4;
if (likely(!(dev->features & NETIF_F_RXFCS)))
pkt_size = rx_size - 4;
else
pkt_size = rx_size;
netif_dbg(tp, rx_status, dev, "%s() status %04x, size %04x, cur %04x\n",
__func__, rx_status, rx_size, cur_rx);
@ -1976,15 +2010,34 @@ 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 = netdev_alloc_skb_ip_align(dev, pkt_size);
skb = napi_alloc_skb(&tp->napi, pkt_size);
if (likely(skb)) {
#if RX_BUF_IDX == 3
wrap_copy(skb, rx_ring, ring_offset+4, pkt_size);
@ -1995,13 +2048,13 @@ no_early_rx:
skb->protocol = eth_type_trans (skb, dev);
dev->stats.rx_bytes += pkt_size;
dev->stats.rx_packets++;
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);
netif_receive_skb (skb);
} else {
if (net_ratelimit())
netdev_warn(dev, "Memory squeeze, dropping packet\n");
dev->stats.rx_dropped++;
}
received++;
@ -2084,13 +2137,10 @@ 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);
__napi_complete(napi);
RTL_W16_F(IntrMask, rtl8139_intr_mask);
if (napi_complete_done(napi, work_done))
RTL_W16_F(IntrMask, rtl8139_intr_mask);
spin_unlock_irqrestore(&tp->lock, flags);
}
spin_unlock(&tp->rx_lock);
@ -2171,9 +2221,12 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance)
*/
static void rtl8139_poll_controller(struct net_device *dev)
{
disable_irq(dev->irq);
rtl8139_interrupt(dev->irq, dev);
enable_irq(dev->irq);
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);
}
#endif
@ -2186,7 +2239,7 @@ static int rtl8139_set_mac_address(struct net_device *dev, void *p)
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
eth_hw_addr_set(dev, addr->sa_data);
spin_lock_irq(&tp->lock);
@ -2226,7 +2279,7 @@ static int rtl8139_close (struct net_device *dev)
spin_unlock_irqrestore (&tp->lock, flags);
free_irq (dev->irq, dev);
free_irq(tp->pci_dev->irq, dev);
rtl8139_tx_clear (tp);
@ -2327,27 +2380,28 @@ 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);
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;
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));
}
static int rtl8139_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
static int rtl8139_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct rtl8139_private *tp = netdev_priv(dev);
spin_lock_irq(&tp->lock);
mii_ethtool_gset(&tp->mii, cmd);
mii_ethtool_get_link_ksettings(&tp->mii, cmd);
spin_unlock_irq(&tp->lock);
return 0;
}
static int rtl8139_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
static int rtl8139_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{
struct rtl8139_private *tp = netdev_priv(dev);
int rc;
spin_lock_irq(&tp->lock);
rc = mii_ethtool_sset(&tp->mii, cmd);
rc = mii_ethtool_set_link_ksettings(&tp->mii, cmd);
spin_unlock_irq(&tp->lock);
return rc;
}
@ -2429,8 +2483,6 @@ 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,
@ -2442,6 +2494,8 @@ 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)
@ -2460,11 +2514,13 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
}
static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)
static void
rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
{
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);
@ -2473,7 +2529,19 @@ static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)
spin_unlock_irqrestore (&tp->lock, flags);
}
return &dev->stats;
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));
}
/* Set or clear the multicast filter for this adaptor.
@ -2513,6 +2581,9 @@ 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) {
@ -2533,17 +2604,13 @@ static void rtl8139_set_rx_mode (struct net_device *dev)
spin_unlock_irqrestore (&tp->lock, flags);
}
#ifdef CONFIG_PM
static int rtl8139_suspend (struct pci_dev *pdev, pm_message_t state)
static int __maybe_unused rtl8139_suspend(struct device *device)
{
struct net_device *dev = pci_get_drvdata (pdev);
struct net_device *dev = dev_get_drvdata(device);
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;
@ -2561,38 +2628,30 @@ static int rtl8139_suspend (struct pci_dev *pdev, pm_message_t state)
spin_unlock_irqrestore (&tp->lock, flags);
pci_set_power_state (pdev, PCI_D3hot);
return 0;
}
static int rtl8139_resume (struct pci_dev *pdev)
static int __maybe_unused rtl8139_resume(struct device *device)
{
struct net_device *dev = pci_get_drvdata (pdev);
struct net_device *dev = dev_get_drvdata(device);
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;
}
#endif /* CONFIG_PM */
static SIMPLE_DEV_PM_OPS(rtl8139_pm_ops, rtl8139_suspend, rtl8139_resume);
static struct pci_driver rtl8139_pci_driver = {
.name = DRV_NAME,
.id_table = rtl8139_pci_tbl,
.probe = rtl8139_init_one,
.remove = __devexit_p(rtl8139_remove_one),
#ifdef CONFIG_PM
.suspend = rtl8139_suspend,
.resume = rtl8139_resume,
#endif /* CONFIG_PM */
.remove = rtl8139_remove_one,
.driver.pm = &rtl8139_pm_ops,
};

View File

@ -1,6 +1,4 @@
#------------------------------------------------------------------------------
#
# $Id$
#-----------------------------------------------------------------------------
#
# Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
#
@ -21,15 +19,17 @@
#
# ---
#
# 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; \
@ -93,8 +93,12 @@ else
endif
endif
ifeq (@ENABLE_STMMAC@,1)
obj-m += stmmac/
endif
KBUILD_EXTRA_SYMBOLS := \
@abs_top_builddir@/$(LINUX_SYMVERS) \
@abs_top_builddir@/master/$(LINUX_SYMVERS)
#------------------------------------------------------------------------------
#-----------------------------------------------------------------------------

View File

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#
# Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
# Copyright (C) 2006-2025 Florian Pose, Ingenieurgemeinschaft IgH
#
# This file is part of the IgH EtherCAT Master.
#
@ -17,12 +17,6 @@
# 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
@ -34,48 +28,10 @@ SUBDIRS = \
genet \
igb \
igc \
r8169
r8169 \
stmmac
# 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 \
EXTRA_DIST = \
8139too-3.0-ethercat.c \
8139too-3.0-orig.c \
8139too-3.10-ethercat.c \
@ -104,30 +60,12 @@ noinst_HEADERS = \
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 \
@ -146,40 +84,22 @@ noinst_HEADERS = \
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 \
@ -197,6 +117,7 @@ noinst_HEADERS = \
r8169-3.8-ethercat.c \
r8169-3.8-orig.c \
r8169-4.4-ethercat.c \
r8169-4.4-orig.c
r8169-4.4-orig.c \
update.sh
#------------------------------------------------------------------------------

View File

@ -1,6 +1,4 @@
#------------------------------------------------------------------------------
#
# $Id$
#-----------------------------------------------------------------------------
#
# Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
#
@ -21,15 +19,12 @@
#
# ---
#
# 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)/../..
@ -53,4 +48,4 @@ KBUILD_EXTRA_SYMBOLS := \
@abs_top_builddir@/$(LINUX_SYMVERS) \
@abs_top_builddir@/master/$(LINUX_SYMVERS)
#------------------------------------------------------------------------------
#-----------------------------------------------------------------------------

View File

@ -1,6 +1,4 @@
#------------------------------------------------------------------------------
#
# $Id$
#-----------------------------------------------------------------------------
#
# Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
#
@ -19,18 +17,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 \
update.h
sram.c \
update.h \
update.c
#------------------------------------------------------------------------------
#-----------------------------------------------------------------------------

View File

@ -398,7 +398,11 @@ 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);
@ -407,7 +411,9 @@ 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[] = {

View File

@ -31,6 +31,17 @@
#define request_dma(X, Y) ((int)(-EINVAL))
#endif
#ifdef CONFIG_SUSE_KERNEL
#include <linux/suse_version.h>
#else
# ifndef SUSE_VERSION
# define SUSE_VERSION 0
# endif
# ifndef SUSE_PATCHLEVEL
# define SUSE_PATCHLEVEL 0
# endif
#endif
#include "module.h"
/**
@ -851,8 +862,13 @@ 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;
@ -897,7 +913,7 @@ static int ccat_eth_init_netdev(struct ccat_eth_priv *priv)
/* init netdev with MAC and stack callbacks */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) || (SUSE_VERSION == 15 && SUSE_PATCHLEVEL == 5)
u8 mac_addr[ETH_ALEN];
if (priv->netdev->addr_len != ETH_ALEN)

View File

@ -19,12 +19,6 @@
# 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
@ -34,6 +28,7 @@ from re import compile
DRIVER_MAP=(
# (subdir, driver name, file prefix)
(".", "8139too", "8139too"),
("stmmac", "dwmac-intel", "dwmac-intel"),
(".", "e100", "e100"),
("e1000", "e1000", "e1000_main"),
("e1000e", "e1000e", "netdev"),
@ -42,6 +37,7 @@ DRIVER_MAP=(
("igc", "igc", "igc_main"),
(".", "r8169", "r8169"),
("r8169", "r8169", "r8169_main"),
("stmmac", "stmmac-pci", "stmmac_pci"),
)

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

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2007-2012 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -21,15 +19,9 @@
*
* ---
*
* 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
@ -38,7 +30,7 @@
/* Former documentation: */
/*******************************************************************************
/*****************************************************************************
Intel PRO/100 Linux driver
Copyright(c) 1999 - 2006 Intel Corporation.
@ -64,7 +56,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
@ -237,7 +229,7 @@ MODULE_FIRMWARE(FIRMWARE_D101S);
MODULE_FIRMWARE(FIRMWARE_D102E);
MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION ", master " EC_MASTER_VERSION);
@ -1202,7 +1194,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 */
@ -3009,7 +3001,10 @@ 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) {
if (nic->ecdev) {
nic->ec_watchdog_jiffies = jiffies;
}
else {
strcpy(netdev->name, "eth%d");
if ((err = register_netdev(netdev))) {
netif_err(nic, probe, nic->netdev,

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2007-2012 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -21,15 +19,9 @@
*
* ---
*
* 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
@ -38,7 +30,7 @@
/* Former documentation: */
/*******************************************************************************
/*****************************************************************************
Intel PRO/100 Linux driver
Copyright(c) 1999 - 2006 Intel Corporation.
@ -64,7 +56,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
@ -239,7 +231,7 @@ MODULE_FIRMWARE(FIRMWARE_D101S);
MODULE_FIRMWARE(FIRMWARE_D102E);
MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION ", master " EC_MASTER_VERSION);
@ -1217,7 +1209,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 */
@ -3112,7 +3104,10 @@ 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) {
if (nic->ecdev) {
nic->ec_watchdog_jiffies = jiffies;
}
else {
strcpy(netdev->name, "eth%d");
if ((err = register_netdev(netdev))) {
netif_err(nic, probe, nic->netdev,

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2007-2012 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -21,15 +19,9 @@
*
* ---
*
* 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
@ -38,7 +30,7 @@
/* Former documentation: */
/*******************************************************************************
/*****************************************************************************
Intel PRO/100 Linux driver
Copyright(c) 1999 - 2006 Intel Corporation.
@ -64,7 +56,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
@ -239,7 +231,7 @@ MODULE_FIRMWARE(FIRMWARE_D101S);
MODULE_FIRMWARE(FIRMWARE_D102E);
MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION ", master " EC_MASTER_VERSION);
@ -1217,7 +1209,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 */
@ -3109,7 +3101,10 @@ 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) {
if (nic->ecdev) {
nic->ec_watchdog_jiffies = jiffies;
}
else {
strcpy(netdev->name, "eth%d");
if ((err = register_netdev(netdev))) {
netif_err(nic, probe, nic->netdev,

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2007-2012 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -21,15 +19,9 @@
*
* ---
*
* 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
@ -38,7 +30,7 @@
/* Former documentation: */
/*******************************************************************************
/*****************************************************************************
Intel PRO/100 Linux driver
Copyright(c) 1999 - 2006 Intel Corporation.
@ -64,7 +56,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
@ -239,7 +231,7 @@ MODULE_FIRMWARE(FIRMWARE_D101S);
MODULE_FIRMWARE(FIRMWARE_D102E);
MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION ", master " EC_MASTER_VERSION);
@ -1217,7 +1209,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 */
@ -3109,7 +3101,10 @@ 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) {
if (nic->ecdev) {
nic->ec_watchdog_jiffies = jiffies;
}
else {
strcpy(netdev->name, "eth%d");
if ((err = register_netdev(netdev))) {
netif_err(nic, probe, nic->netdev,

View File

@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2007-2012 Florian Pose, Ingenieurgemeinschaft IgH
*
@ -21,15 +19,9 @@
*
* ---
*
* 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
@ -38,7 +30,7 @@
/* Former documentation: */
/*******************************************************************************
/*****************************************************************************
Intel PRO/100 Linux driver
Copyright(c) 1999 - 2006 Intel Corporation.
@ -64,7 +56,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
@ -239,7 +231,7 @@ MODULE_FIRMWARE(FIRMWARE_D101S);
MODULE_FIRMWARE(FIRMWARE_D102E);
MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
MODULE_AUTHOR("Florian Pose <fp@igh.de>");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION ", master " EC_MASTER_VERSION);
@ -1217,7 +1209,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 */
@ -3109,7 +3101,10 @@ 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) {
if (nic->ecdev) {
nic->ec_watchdog_jiffies = jiffies;
}
else {
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