Commit Graph

2335 Commits

Author SHA1 Message Date
Florian Pose b1945b7bdc Always define EoE handler count. 2023-07-20 13:11:10 +02:00
Florian Pose f5dc109176 Merge branch 'fix-6.4' into 'master'
Fix class_create on kernel 6.4

See merge request etherlab.org/ethercat!73
2023-07-05 08:13:02 +00:00
Nicola Fontana 262afa2f9c Fix class_create on kernel 6.4
Commit 1aaba11da9aa7d7d6b52a74d45b31cac118295a1 in kernel code removed
`module *` argument from `class_create`.
2023-07-05 07:31:52 +02:00
Florian Pose 589838526a Merge branch '8139too-5.10' into 'master'
8139too 5.10

See merge request etherlab.org/ethercat!72
2023-06-29 10:19:25 +00:00
Florian Pose b310b98936 Updated copyright, removed Id. 2023-06-29 11:37:00 +02:00
Florian Pose 6ff4168daa Added 8139too driver for kernel 5.10. 2023-06-29 11:01:31 +02:00
Florian Pose 0ac3c50a0e Improved help on ioctl() version magic mismatch. 2023-06-26 11:45:40 +02:00
Andreas Stewering-Bone 80bfddc640 Merge branch 'cherry-pick-04f202a3' into 'master'
Merge branch 'fix_vm_set_flag' into 'stable-1.5'

See merge request etherlab.org/ethercat!70
2023-06-01 06:27:36 +00:00
Andreas Stewering-Bone e35f35b25c Merge branch 'fix_vm_set_flag' into 'stable-1.5'
Fix setting flag in vm_area_struct for Kernel 6.3

See merge request etherlab.org/ethercat!67

(cherry picked from commit 04f202a39c)

27db882d Fix setting flag in vm_area_struct for Kernel 6.3
2023-06-01 06:11:19 +00:00
Florian Pose f8c9ec6e48 Merge branch 'v6.1-fixups' into 'master'
tty/module.c: fixups for linux >= v6.1

See merge request etherlab.org/ethercat!68
2023-05-25 14:26:10 +00:00
Rasmus Villemoes d39b4a59ec tty/module.c: include proper header for INIT_C_CC definition
In upstream commit c9874d3ffeaf (termios: start unifying non-UAPI
parts of asm/termios.h), the INIT_C_CC definition was moved to a new
header, termios_internal.h. So we must include that header to get that
macro, but conditionally, since the header does not exist in older
kernels.
2023-05-25 14:35:04 +02:00
Rasmus Villemoes bbb16b872b tty/module.c: adapt signature of ->set_termios method to v6.1
Upstream changed ->set_termios to take a const struct ktermios in
commit a8c11c1520347 (tty: Make ->set_termios() old ktermios const).
2023-05-25 14:34:59 +02:00
Florian Pose 960895cb4d Merge branch 'toc' into 'master'
Add automatic TOC to README.md

See merge request etherlab.org/ethercat!66
2023-05-05 08:21:46 +00:00
Nicola Fontana 6d66773bc6 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
2023-05-04 08:27:56 +02:00
Florian Pose 24a361c8f5 Allow zero-sized SDO responses 2023-05-02 10:53:33 +02:00
Florian Pose 251062a245 Merge branch 'fix/bash-completion-typo' into 'master'
bash_completion: fix confic typo

See merge request etherlab.org/ethercat!63
2023-02-09 21:44:42 +00:00
Jeppe Odgaard d3bcb6238e bash_completion: fix confic typo
Change 'confic' to 'config' in ethercat.bash_completion.
2023-02-09 09:27:12 +01:00
Florian Pose ee10317cf6 Put md files in EXTRA_DIST. 2023-01-30 11:31:56 +01:00
Florian Pose 3bc8703f5c Added 'foreign' to AM_INIT_AUTOMAKE(), cause README was renamed to README.md. 2023-01-30 11:29:06 +01:00
Florian Pose fb59955145 Cherry-picked markdown conversions from stable-1.5. 2023-01-30 11:19:08 +01:00
Florian Pose b403327659 Removed $Id$. 2023-01-09 12:42:37 +01:00
Florian Pose d329e30969 ext target for documentation. 2023-01-09 12:40:33 +01:00
Florian Pose c813ad4042 Using CI file from stable-1.5. 2023-01-09 11:39:34 +01:00
Florian Pose 20d0c93270 Changed email and postal address. 2023-01-09 10:01:24 +01:00
Florian Pose 2e2cef6131 Merge branch 'master' of gitlab.com:etherlab.org/ethercat 2022-11-02 09:45:57 +01:00
Florian Pose 72ee17b0e5 Precised kernel versions. 2022-11-02 09:45:38 +01:00
Florian Pose 565f742ea2 Merge branch 'fix-31' into 'master'
Fix #31: typos in documentation

Closes #31

See merge request etherlab.org/ethercat!59
2022-10-26 07:18:33 +00:00
Nicola Fontana b7211615af Fix #31: typos in documentation 2022-10-26 08:01:57 +02:00
Florian Pose 575ae786ed Minor line length change. 2022-09-21 09:09:33 +02:00
Florian Pose fa96b8fcb0 Merge branch 'lock-fixes' into 'master'
Various locking fixes and improvements

See merge request etherlab.org/ethercat!58
2022-09-05 09:41:16 +00:00
Florian Pose 7cce5ec6ae Fixed downloading SDOs via stdin (-). 2022-09-05 11:22:08 +02:00
Florian Pose afbead48a7 Removed tabs; output code as int. 2022-09-05 11:19:59 +02:00
Florian Pose e893051563 Merge branch 'deif/O_CLOEXEC' into 'master'
lib: use O_CLOEXEC flag when opening EtherCAT master device

See merge request etherlab.org/ethercat!56
2022-09-05 09:18:03 +00:00
Florian Pose 1437f8d409 Merge branch 'lock-abstraction-fixups' into 'master'
fix direct uses of up()/down()

See merge request etherlab.org/ethercat!55
2022-09-05 09:17:32 +00:00
Florian Pose 6af1d9a441 Merge branch 'ip-path' into 'master'
ethercatctl: fix hard-coded path to ip utility

See merge request etherlab.org/ethercat!54
2022-09-05 09:16:46 +00:00
Florian Pose 2aacdb810a Merge branch 'deif/tty-fixups' into 'master'
tty: fixups for kernels 5.14 and 5.15

See merge request etherlab.org/ethercat!53
2022-09-05 09:16:02 +00:00
Florian Pose 19be4c8da4 Merge branch 'fix-5.18' into 'master'
Fix for linux 5.18.0

See merge request etherlab.org/ethercat!52
2022-09-05 09:15:06 +00:00
Florian Pose 869a88a6c8 Merge branch 'build-update' into 'master'
Fix obsolete warnings on bootstrap

See merge request etherlab.org/ethercat!49
2022-09-05 09:14:33 +00:00
Florian Pose 82ce570c7e Merge branch 'fix-init-doc' into 'master'
doc: fix references to init scripts

See merge request etherlab.org/ethercat!48
2022-09-05 09:13:40 +00:00
Esben Haabendal 81758004fd Improve synchronization of master->domains list
Introduce a new lock for synchronization of the master->domains list, and use
that instead of the big master_sem lock, improving real-time performance of
fx. ecrt_domain_process() when EoE thread is being shut down (or other
use-cases where master_sem is held for extended periods).

The following locking order is used:

* master->master_sem
* master->domains_lock
* master->io_sem
* domain->datagram_pairs_lock

Meaning that it is allowed to take domains_lock while holding master_sem, and
it is allowed to hold domains_lock while locking io_sem and
datagram_pairs_lock.

[RV: For now, the lockdep_assert_held() annotations are commented out,
since they don't compile with CONFIG_PROVE_LOCKING and (the default)
--disable-rtmutex.]
2022-09-01 15:38:01 +02:00
Esben Haabendal 19b8ddea18 Add lock protection of domain->datagram_pairs
While domain->datagram_pairs was previously partly protected by the
master->master_sem lock (it was not done consistently though), the fix
to protection of master->datagram_queue made it even worse.

This change adds protection of domain->datagram_pairs using a new lock
dedicated to this.  The domain->datagram_pairs_lock is acquired in the actual
functions accessing the domain->datagram_pairs, and this currently means that
it is acquired both in situations where master->master_sem is held and in
situations where master->io_sem is held.
2022-09-01 15:37:58 +02:00
Esben Haabendal 2372382259 Acquire master->io_sem lock where needed
With this, we should have in place so that master->io_sem is always held when
accessing master->datagram_queue.

Note, the use of master->master_sem in ec_ioctl_send() and
ec_ioctl_receive() were wrong (introduced in commit cef602586c). The
only thing needing to be synchronized there is the access to
master->datagram_queue, which is protected by master->io_sem.

This corresponds roughly to the fixes for stable-1.5 that are seen in
https://gitlab.com/etherlab.org/ethercat/-/merge_requests/36 .
2022-09-01 15:37:54 +02:00
Esben Haabendal e243c6b7db Clarify purpose of master->io_sem
In order to ensure proper use of locking, the purpose of each mutex/semaphore
must be clear and documented.

This is my best guess.  The master->io_sem has a simple purpose, synchronizing
access to the master->datagram_queue list structure.
2022-09-01 15:37:50 +02:00
Rasmus Villemoes 624872fcdb fix direct uses of up()/down()
When converting to the ec_lock_t abstraction, these were missed,
making building with --enable-rtmutex broken.

Fixes: 9955855f7e (Applied 0016-If-enable-rtmutex-use-rtmutexes-instead-of-semaphore.patch)
2022-08-31 15:21:23 +02:00
Rasmus Villemoes a8fe799522 ethercatctl: fix hard-coded path to ip utility
- The unmodified upstream iproute2 package installs the ip utility in
  /sbin. That is also where it thus ends up with for example Yocto
  builds.

- Debian/Ubuntu installs it in /bin (and I assume that's how this came
  to be), but their packaging logic provides a symlink /sbin/ip ->
  /bin/ip .

- ArchLinux seems to install it in both places (as hardlinks).

- CentOS only has /sbin/ip.

- Fedora only has /sbin/ip.

So /sbin/ip should work everywhere, whereas /bin/ip does not.
2022-08-31 15:18:42 +02:00
Per Noergaard Christensen 38038f6a48 lib: use O_CLOEXEC flag when opening EtherCAT master device
This flag specifies that the file descriptor should be closed when an
exec function is invoked. When a file descriptor is allocated (as with
open or dup), O_CLOEXEC bit is initially cleared on the new file
descriptor, meaning that descriptor will survive into the new program
after exec. Setting O_CLOEXEC avoid this survival of the desciptor in
the new program. And setting it at open() time is the only race-free
way to avoid accidentally leaking the fd via other threads that
concurrently do fork()+exec() (or similar, e.g. posix_spawn).
2022-08-30 14:39:32 +02:00
Per Noergaard Christensen 96a045e36e tty: fixups for kernels 5.14 and 5.15
alloc_tty_driver was deprecated by tty_alloc_driver in commit 7f0bc6a68ed9
(TTY: pass flags to alloc_tty_driver) in 2012 but first in kernel
v5.15 it has been dropped (56ec5880a28e). Switch to tty_alloc_driver
when using kernels >= v5.15

As of v5.15, the put_tty_driver alias has been dropped in favor of
directly calling tty_driver_kref_put (9f90a4ddef4e).  Switch to
tty_driver_kref_put when using kernels >= v5.15

As from v5.14 the write_room (03b3b1a2405c) and
chars_in_buffer (fff4ef17a940) methods' return type changed from int
to unsigned int in struct tty_operations. This has impact on
ec_tty_write_room() and ec_tty_chars_in_buffer().
2022-08-30 13:57:23 +02:00
Nicola Fontana 4050913147 Fix for linux 5.18.0
In recent kernels, netif_rx_ni() is just a wrapper around netif_rx():

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9f9919f73c94ae00af4e6ad45179282122f24988
2022-07-18 11:21:29 +02:00
Florian Pose fa890a8b61 Applied 0021-Await-SDO-dictionary-to-be-fetched.patch 2022-06-23 12:43:34 +02:00
Florian Pose 8896d3b879 Applied 0020-eoe-ip.patch 2022-06-23 12:39:52 +02:00