| History log of /src/sys/netcan |
| Revision | Date | Author | Comments |
| 1.2 | 27-May-2017 |
bouyer | branches: 1.2.6; 1.2.10; merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used in automation and automotive fields. For example, the NMEA2000 standard developped for marine devices uses a CAN network as the link layer.
This is an implementation of the linux socketcan API: https://www.kernel.org/doc/Documentation/networking/can.txt you can also see can(4).
This adds a new socket family (AF_CAN) and protocol (PF_CAN), as well as the canconfig(8) utility, used to set timing parameter of CAN hardware. Also inclued is a driver for the CAN controller found in the allwinner A20 SoC (I tested it with an Olimex lime2 board, connected with PIC18-based CAN devices).
There is also the canloop(4) pseudo-device, which allows to use the socketcan API without CAN hardware.
At this time the CANFD part of the linux socketcan API is not implemented. Error frames are not implemented either. But I could get the cansend and canreceive utilities from the canutils package to build and run with minimal changes. tcpudmp(8) can also be used to record frames, which can be decoded with etherreal.
|
| 1.1 | 15-Jan-2017 |
bouyer | branches: 1.1.2; file Makefile was initially added on branch bouyer-socketcan.
|
| 1.1.2.2 | 17-Apr-2017 |
bouyer | Add infranstructure to configure timings from userland on a can interface. This uses the SIOCGDRVSPEC/SIOCSDRVSPEC ioctls. Compile-tested only.
|
| 1.1.2.1 | 15-Jan-2017 |
bouyer | Initial commit of a CAN socket layer, compatible with linux SoccketCAN (but incomplete). Based on work from Robert Swindells.
|
| 1.2.10.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.2.10.1 | 27-May-2017 |
jdolecek | file Makefile was added on branch tls-maxphys on 2017-12-03 11:39:03 +0000
|
| 1.2.6.2 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.2.6.1 | 27-May-2017 |
skrll | file Makefile was added on branch nick-nhusb on 2017-08-28 17:53:12 +0000
|
| 1.14 | 05-Jul-2024 |
rin | sys: Drop redundant NULL check before m_freem(9)
m_freem(9) safely has accepted NULL argument at least since 4.2BSD: https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/sys/uipc_mbuf.c
Compile-tested on amd64/ALL.
Suggested by knakahara@
|
| 1.13 | 04-Nov-2022 |
ozaki-r | branches: 1.13.6; 1.13.8; inpcb: rename functions to inpcb_*
Inspired by rmind-smpnet patches.
|
| 1.12 | 03-Sep-2022 |
thorpej | Convert CAN from a legacy netisr to pktqueue.
|
| 1.11 | 31-Dec-2021 |
riastradh | sys: Use if_ioctl wrapper function.
|
| 1.10 | 21-Sep-2021 |
christos | don't opencode kauth_cred_get()
|
| 1.9 | 29-Jan-2020 |
thorpej | Adopt <net/if_stats.h>.
|
| 1.8 | 19-Aug-2019 |
ozaki-r | branches: 1.8.2; can: add missing mowner variables for MBUFTRACE
|
| 1.7 | 20-Jul-2019 |
bouyer | Don't kmem_alloc()/kmem_free() with spin lock held: call can_pcbsetfilter() without canp_mtx; take it here and check canp_state before updating the canp_filters.
|
| 1.6 | 15-Nov-2018 |
maxv | Remove the 't' argument from m_tag_find().
|
| 1.5 | 15-Nov-2018 |
maxv | Simplify the mtag API:
- Remove m_tag_init(), m_tag_first(), m_tag_next() and m_tag_delete_nonpersistent().
- Remove the 't' argument from m_tag_delete_chain().
|
| 1.4 | 26-Jun-2018 |
msaitoh | branches: 1.4.2; Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same as FreeBSD.
This change also fixes a bug that the direction is misunderstand on some environment by passing the direction to bpf_mtap*() instead of checking m->m_pkthdr.rcvif.
|
| 1.3 | 21-Mar-2018 |
roy | Sprinkle more soroverflow().
|
| 1.2 | 27-May-2017 |
bouyer | branches: 1.2.2; 1.2.6; 1.2.10; 1.2.12; merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used in automation and automotive fields. For example, the NMEA2000 standard developped for marine devices uses a CAN network as the link layer.
This is an implementation of the linux socketcan API: https://www.kernel.org/doc/Documentation/networking/can.txt you can also see can(4).
This adds a new socket family (AF_CAN) and protocol (PF_CAN), as well as the canconfig(8) utility, used to set timing parameter of CAN hardware. Also inclued is a driver for the CAN controller found in the allwinner A20 SoC (I tested it with an Olimex lime2 board, connected with PIC18-based CAN devices).
There is also the canloop(4) pseudo-device, which allows to use the socketcan API without CAN hardware.
At this time the CANFD part of the linux socketcan API is not implemented. Error frames are not implemented either. But I could get the cansend and canreceive utilities from the canutils package to build and run with minimal changes. tcpudmp(8) can also be used to record frames, which can be decoded with etherreal.
|
| 1.1 | 15-Jan-2017 |
bouyer | branches: 1.1.2; file can.c was initially added on branch bouyer-socketcan.
|
| 1.1.2.15 | 25-May-2017 |
bouyer | Allow can_bpf_mtap() to call bpf_mtap_softint() when needed.
|
| 1.1.2.14 | 22-May-2017 |
bouyer | factor out if_attach() and bpf_attach() calls in can_ifattach(). Introduce can_ifdetach(). Introduce can_bpf_mtap(), which converts the can_id to network byte order (as required by tcpdump/wireshark). Thanks to Guy Harris for poiting this requirement.
|
| 1.1.2.13 | 23-Apr-2017 |
bouyer | Add locking and refcounting to canpcb. Store the canpcb in the in the mbuf tag on send instead of the socket's address. This should protect against a race where the socket cloud be closed before we get back the mbuf from the adapter's driver.
|
| 1.1.2.12 | 20-Apr-2017 |
bouyer | If a packet was sent using sendto, the socket pointed to by the tag may be unbound. Check for this in canintr(). XXX possibly the socket can completely dissapear before we get here. This needs to be revisited.
|
| 1.1.2.11 | 20-Apr-2017 |
bouyer | Fix LINKMODE Refuse to send packets if LISTENONLY is set Don't forget to unbind in error case.
|
| 1.1.2.10 | 19-Apr-2017 |
bouyer | can_mbuf_tag_clean(): make sure we won't free the tag we will reuse. Avoid mbuf leak in error paths.
|
| 1.1.2.9 | 19-Apr-2017 |
bouyer | Call if_alloc_sadl() for the interface, so that getifaddrs() will find them.
|
| 1.1.2.8 | 18-Apr-2017 |
bouyer | Add can_ifinit_timings() helper function, which initialise timing parameters to known invalid values.
|
| 1.1.2.7 | 17-Apr-2017 |
bouyer | Add infranstructure to configure timings from userland on a can interface. This uses the SIOCGDRVSPEC/SIOCSDRVSPEC ioctls. Compile-tested only.
|
| 1.1.2.6 | 05-Feb-2017 |
bouyer | more sanity checks on the mbuf we get.
|
| 1.1.2.5 | 05-Feb-2017 |
bouyer | Introduce can_ifattach(), for common setups of can interfaces. Convert output to a ifq and change canloop_output to canloop_ifstart
|
| 1.1.2.4 | 05-Feb-2017 |
bouyer | Centralize mbuf tag cleanup, it will be used by real interface drivers too.
|
| 1.1.2.3 | 05-Feb-2017 |
bouyer | Implement CAN_RAW_FILTER socket option, and add tests for it.
|
| 1.1.2.2 | 16-Jan-2017 |
bouyer | Use PACKET_TAG_SO to store the sender's struct socket pointer, and use it to implement socket options CAN_RAW_LOOPBACK and CAN_RAW_RECV_OWN_MSGS.
|
| 1.1.2.1 | 15-Jan-2017 |
bouyer | Initial commit of a CAN socket layer, compatible with linux SoccketCAN (but incomplete). Based on work from Robert Swindells.
|
| 1.2.12.3 | 26-Nov-2018 |
pgoyette | Sync with HEAD, resolve a couple of conflicts
|
| 1.2.12.2 | 28-Jul-2018 |
pgoyette | Sync with HEAD
|
| 1.2.12.1 | 22-Mar-2018 |
pgoyette | Synch with HEAD, resolve conflicts
|
| 1.2.10.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.2.10.1 | 27-May-2017 |
jdolecek | file can.c was added on branch tls-maxphys on 2017-12-03 11:39:03 +0000
|
| 1.2.6.2 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.2.6.1 | 27-May-2017 |
skrll | file can.c was added on branch nick-nhusb on 2017-08-28 17:53:12 +0000
|
| 1.2.2.1 | 09-Apr-2018 |
bouyer | Pull up following revision(s) (requested by roy in ticket #724): tests/net/icmp/t_ping.c: revision 1.19 sys/netinet6/raw_ip6.c: revision 1.166 sys/netinet6/ip6_input.c: revision 1.195 sys/net/raw_usrreq.c: revision 1.59 sys/sys/socketvar.h: revision 1.151 sys/kern/uipc_socket2.c: revision 1.128 tests/lib/libc/sys/t_recvmmsg.c: revision 1.2 lib/libc/sys/recv.2: revision 1.38 sys/net/rtsock.c: revision 1.239 sys/netinet/udp_usrreq.c: revision 1.246 sys/netinet6/icmp6.c: revision 1.224 tests/net/icmp/t_ping.c: revision 1.20 sys/netipsec/keysock.c: revision 1.63 sys/netinet/raw_ip.c: revision 1.172 sys/kern/uipc_socket.c: revision 1.260 tests/net/icmp/t_ping.c: revision 1.22 sys/kern/uipc_socket.c: revision 1.261 tests/net/icmp/t_ping.c: revision 1.23 sys/netinet/ip_mroute.c: revision 1.155 sbin/route/route.c: revision 1.159 sys/netinet6/ip6_mroute.c: revision 1.123 sys/netatalk/ddp_input.c: revision 1.31 sys/netcan/can.c: revision 1.3 sys/kern/uipc_usrreq.c: revision 1.184 sys/netinet6/udp6_usrreq.c: revision 1.138 tests/net/icmp/t_ping.c: revision 1.18 socket: report receive buffer overflows Add soroverflow() which increments the overflow counter, sets so_error to ENOBUFS and wakes the receive socket up. Replace all code that manually increments this counter with soroverflow(). Add soroverflow() to raw_input(). This allows userland to detect route(4) overflows so it can re-sync with the current state. socket: clear error even when peeking The error has already been reported and it's pointless requiring another recv(2) call just to clear it. socket: remove now incorrect comment that so_error is only udp As it can be affected by route(4) sockets which are raw. rtsock: log dropped messages that we cannot report to userland Handle ENOBUFS when receiving messages. Don't send messages if the receiver has died. Sprinkle more soroverflow(). Handle ENOBUFS in recv Handle ENOBUFS in sendto Note value received. Harden another sendto for ENOBUFS. Handle the routing socket overflowing gracefully. Allow a valid sendto .... duh Handle errors better. Fix test for checking we sent all the data we asked to.
|
| 1.4.2.3 | 13-Apr-2020 |
martin | Mostly merge changes from HEAD upto 20200411
|
| 1.4.2.2 | 08-Apr-2020 |
martin | Merge changes from current as of 20200406
|
| 1.4.2.1 | 10-Jun-2019 |
christos | Sync with HEAD
|
| 1.8.2.1 | 29-Feb-2020 |
ad | Sync with head.
|
| 1.13.8.1 | 02-Aug-2025 |
perseant | Sync with HEAD
|
| 1.13.6.1 | 15-Nov-2023 |
thorpej | Rename ifq_enqueue() -> if_enqueue(), ifq_enqueue2() -> if_enqueue2().
|
| 1.3 | 30-May-2017 |
bouyer | branches: 1.3.6; 1.3.10; Needs <sys/types.h> not <machine/int_types.h>
|
| 1.2 | 27-May-2017 |
bouyer | merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used in automation and automotive fields. For example, the NMEA2000 standard developped for marine devices uses a CAN network as the link layer.
This is an implementation of the linux socketcan API: https://www.kernel.org/doc/Documentation/networking/can.txt you can also see can(4).
This adds a new socket family (AF_CAN) and protocol (PF_CAN), as well as the canconfig(8) utility, used to set timing parameter of CAN hardware. Also inclued is a driver for the CAN controller found in the allwinner A20 SoC (I tested it with an Olimex lime2 board, connected with PIC18-based CAN devices).
There is also the canloop(4) pseudo-device, which allows to use the socketcan API without CAN hardware.
At this time the CANFD part of the linux socketcan API is not implemented. Error frames are not implemented either. But I could get the cansend and canreceive utilities from the canutils package to build and run with minimal changes. tcpudmp(8) can also be used to record frames, which can be decoded with etherreal.
|
| 1.1 | 15-Jan-2017 |
bouyer | branches: 1.1.2; file can.h was initially added on branch bouyer-socketcan.
|
| 1.1.2.4 | 17-Apr-2017 |
bouyer | Add infranstructure to configure timings from userland on a can interface. This uses the SIOCGDRVSPEC/SIOCSDRVSPEC ioctls. Compile-tested only.
|
| 1.1.2.3 | 16-Jan-2017 |
bouyer | Use PACKET_TAG_SO to store the sender's struct socket pointer, and use it to implement socket options CAN_RAW_LOOPBACK and CAN_RAW_RECV_OWN_MSGS.
|
| 1.1.2.2 | 15-Jan-2017 |
bouyer | Align can_frame.data to 8 bytes, per SocketCAN spec.
|
| 1.1.2.1 | 15-Jan-2017 |
bouyer | Initial commit of a CAN socket layer, compatible with linux SoccketCAN (but incomplete). Based on work from Robert Swindells.
|
| 1.3.10.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.3.10.1 | 30-May-2017 |
jdolecek | file can.h was added on branch tls-maxphys on 2017-12-03 11:39:03 +0000
|
| 1.3.6.2 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.3.6.1 | 30-May-2017 |
skrll | file can.h was added on branch nick-nhusb on 2017-08-28 17:53:12 +0000
|
| 1.2 | 27-May-2017 |
bouyer | branches: 1.2.6; 1.2.10; merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used in automation and automotive fields. For example, the NMEA2000 standard developped for marine devices uses a CAN network as the link layer.
This is an implementation of the linux socketcan API: https://www.kernel.org/doc/Documentation/networking/can.txt you can also see can(4).
This adds a new socket family (AF_CAN) and protocol (PF_CAN), as well as the canconfig(8) utility, used to set timing parameter of CAN hardware. Also inclued is a driver for the CAN controller found in the allwinner A20 SoC (I tested it with an Olimex lime2 board, connected with PIC18-based CAN devices).
There is also the canloop(4) pseudo-device, which allows to use the socketcan API without CAN hardware.
At this time the CANFD part of the linux socketcan API is not implemented. Error frames are not implemented either. But I could get the cansend and canreceive utilities from the canutils package to build and run with minimal changes. tcpudmp(8) can also be used to record frames, which can be decoded with etherreal.
|
| 1.1 | 17-Apr-2017 |
bouyer | branches: 1.1.2; file can_link.h was initially added on branch bouyer-socketcan.
|
| 1.1.2.2 | 18-Apr-2017 |
bouyer | Remove clt_clock_freq from user-supplied timing informations, it is defined by the brp.
|
| 1.1.2.1 | 17-Apr-2017 |
bouyer | Add infranstructure to configure timings from userland on a can interface. This uses the SIOCGDRVSPEC/SIOCSDRVSPEC ioctls. Compile-tested only.
|
| 1.2.10.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.2.10.1 | 27-May-2017 |
jdolecek | file can_link.h was added on branch tls-maxphys on 2017-12-03 11:39:03 +0000
|
| 1.2.6.2 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.2.6.1 | 27-May-2017 |
skrll | file can_link.h was added on branch nick-nhusb on 2017-08-28 17:53:12 +0000
|
| 1.8 | 20-Jul-2019 |
bouyer | Don't kmem_alloc()/kmem_free() with spin lock held: call can_pcbsetfilter() without canp_mtx; take it here and check canp_state before updating the canp_filters.
|
| 1.7 | 25-Feb-2019 |
maxv | RIP6, CAN, SCTP and SCTP6 lack a length check in their _send() functions. Fix RIP6 and CAN, add a big XXX in the SCTP ones.
Found by KASAN, triggered by SyzKaller.
Reported-by: syzbot+0b9692ae0f49f93b7dc7@syzkaller.appspotmail.com
|
| 1.6 | 09-Jun-2017 |
bouyer | branches: 1.6.4; 1.6.6; 1.6.10; Refuse to bind to a non-CAN interface. Also release the lock in the error branch.
|
| 1.5 | 01-Jun-2017 |
chs | branches: 1.5.2; remove checks for failure after memory allocation calls that cannot fail:
kmem_alloc() with KM_SLEEP kmem_zalloc() with KM_SLEEP percpu_alloc() pserialize_create() psref_class_create()
all of these paths include an assertion that the allocation has not failed, so callers should not assert that again.
|
| 1.4 | 30-May-2017 |
bouyer | Forced commit for previous (1.2) rev commit message: don't dereference a NULL pointer in can_setsockaddr() if we didn't bind to an interface.
|
| 1.3 | 30-May-2017 |
bouyer | Needs <sys/types.h> not <machine/int_types.h>
|
| 1.2 | 27-May-2017 |
bouyer | merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used in automation and automotive fields. For example, the NMEA2000 standard developped for marine devices uses a CAN network as the link layer.
This is an implementation of the linux socketcan API: https://www.kernel.org/doc/Documentation/networking/can.txt you can also see can(4).
This adds a new socket family (AF_CAN) and protocol (PF_CAN), as well as the canconfig(8) utility, used to set timing parameter of CAN hardware. Also inclued is a driver for the CAN controller found in the allwinner A20 SoC (I tested it with an Olimex lime2 board, connected with PIC18-based CAN devices).
There is also the canloop(4) pseudo-device, which allows to use the socketcan API without CAN hardware.
At this time the CANFD part of the linux socketcan API is not implemented. Error frames are not implemented either. But I could get the cansend and canreceive utilities from the canutils package to build and run with minimal changes. tcpudmp(8) can also be used to record frames, which can be decoded with etherreal.
|
| 1.1 | 15-Jan-2017 |
bouyer | branches: 1.1.2; file can_pcb.c was initially added on branch bouyer-socketcan.
|
| 1.1.2.4 | 23-Apr-2017 |
bouyer | Add locking and refcounting to canpcb. Store the canpcb in the in the mbuf tag on send instead of the socket's address. This should protect against a race where the socket cloud be closed before we get back the mbuf from the adapter's driver.
|
| 1.1.2.3 | 05-Feb-2017 |
bouyer | more sanity checks on the mbuf we get.
|
| 1.1.2.2 | 05-Feb-2017 |
bouyer | Implement CAN_RAW_FILTER socket option, and add tests for it.
|
| 1.1.2.1 | 15-Jan-2017 |
bouyer | Initial commit of a CAN socket layer, compatible with linux SoccketCAN (but incomplete). Based on work from Robert Swindells.
|
| 1.5.2.1 | 15-Jun-2017 |
snj | Pull up following revision(s) (requested by bouyer in ticket #34): sys/netcan/can_pcb.c: revision 1.6 tests/net/can/t_can.c: revision 1.6 Refuse to bind to a non-CAN interface. Also release the lock in the error branch. -- Test bind()ing to a non-existent interface.
|
| 1.6.10.2 | 13-Apr-2020 |
martin | Mostly merge changes from HEAD upto 20200411
|
| 1.6.10.1 | 10-Jun-2019 |
christos | Sync with HEAD
|
| 1.6.6.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.6.6.1 | 09-Jun-2017 |
jdolecek | file can_pcb.c was added on branch tls-maxphys on 2017-12-03 11:39:03 +0000
|
| 1.6.4.2 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.6.4.1 | 09-Jun-2017 |
skrll | file can_pcb.c was added on branch nick-nhusb on 2017-08-28 17:53:12 +0000
|
| 1.2 | 27-May-2017 |
bouyer | branches: 1.2.6; 1.2.10; merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used in automation and automotive fields. For example, the NMEA2000 standard developped for marine devices uses a CAN network as the link layer.
This is an implementation of the linux socketcan API: https://www.kernel.org/doc/Documentation/networking/can.txt you can also see can(4).
This adds a new socket family (AF_CAN) and protocol (PF_CAN), as well as the canconfig(8) utility, used to set timing parameter of CAN hardware. Also inclued is a driver for the CAN controller found in the allwinner A20 SoC (I tested it with an Olimex lime2 board, connected with PIC18-based CAN devices).
There is also the canloop(4) pseudo-device, which allows to use the socketcan API without CAN hardware.
At this time the CANFD part of the linux socketcan API is not implemented. Error frames are not implemented either. But I could get the cansend and canreceive utilities from the canutils package to build and run with minimal changes. tcpudmp(8) can also be used to record frames, which can be decoded with etherreal.
|
| 1.1 | 15-Jan-2017 |
bouyer | branches: 1.1.2; file can_pcb.h was initially added on branch bouyer-socketcan.
|
| 1.1.2.4 | 23-Apr-2017 |
bouyer | Add locking and refcounting to canpcb. Store the canpcb in the in the mbuf tag on send instead of the socket's address. This should protect against a race where the socket cloud be closed before we get back the mbuf from the adapter's driver.
|
| 1.1.2.3 | 05-Feb-2017 |
bouyer | Implement CAN_RAW_FILTER socket option, and add tests for it.
|
| 1.1.2.2 | 16-Jan-2017 |
bouyer | Use PACKET_TAG_SO to store the sender's struct socket pointer, and use it to implement socket options CAN_RAW_LOOPBACK and CAN_RAW_RECV_OWN_MSGS.
|
| 1.1.2.1 | 15-Jan-2017 |
bouyer | Initial commit of a CAN socket layer, compatible with linux SoccketCAN (but incomplete). Based on work from Robert Swindells.
|
| 1.2.10.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.2.10.1 | 27-May-2017 |
jdolecek | file can_pcb.h was added on branch tls-maxphys on 2017-12-03 11:39:03 +0000
|
| 1.2.6.2 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.2.6.1 | 27-May-2017 |
skrll | file can_pcb.h was added on branch nick-nhusb on 2017-08-28 17:53:12 +0000
|
| 1.3 | 03-Sep-2022 |
thorpej | Convert CAN from a legacy netisr to pktqueue.
|
| 1.2 | 27-May-2017 |
bouyer | branches: 1.2.6; 1.2.10; merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used in automation and automotive fields. For example, the NMEA2000 standard developped for marine devices uses a CAN network as the link layer.
This is an implementation of the linux socketcan API: https://www.kernel.org/doc/Documentation/networking/can.txt you can also see can(4).
This adds a new socket family (AF_CAN) and protocol (PF_CAN), as well as the canconfig(8) utility, used to set timing parameter of CAN hardware. Also inclued is a driver for the CAN controller found in the allwinner A20 SoC (I tested it with an Olimex lime2 board, connected with PIC18-based CAN devices).
There is also the canloop(4) pseudo-device, which allows to use the socketcan API without CAN hardware.
At this time the CANFD part of the linux socketcan API is not implemented. Error frames are not implemented either. But I could get the cansend and canreceive utilities from the canutils package to build and run with minimal changes. tcpudmp(8) can also be used to record frames, which can be decoded with etherreal.
|
| 1.1 | 15-Jan-2017 |
bouyer | branches: 1.1.2; file can_proto.c was initially added on branch bouyer-socketcan.
|
| 1.1.2.2 | 16-Jan-2017 |
bouyer | Use PACKET_TAG_SO to store the sender's struct socket pointer, and use it to implement socket options CAN_RAW_LOOPBACK and CAN_RAW_RECV_OWN_MSGS.
|
| 1.1.2.1 | 15-Jan-2017 |
bouyer | Initial commit of a CAN socket layer, compatible with linux SoccketCAN (but incomplete). Based on work from Robert Swindells.
|
| 1.2.10.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.2.10.1 | 27-May-2017 |
jdolecek | file can_proto.c was added on branch tls-maxphys on 2017-12-03 11:39:03 +0000
|
| 1.2.6.2 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.2.6.1 | 27-May-2017 |
skrll | file can_proto.c was added on branch nick-nhusb on 2017-08-28 17:53:12 +0000
|
| 1.3 | 03-Sep-2022 |
thorpej | Convert CAN from a legacy netisr to pktqueue.
|
| 1.2 | 27-May-2017 |
bouyer | branches: 1.2.6; 1.2.10; merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used in automation and automotive fields. For example, the NMEA2000 standard developped for marine devices uses a CAN network as the link layer.
This is an implementation of the linux socketcan API: https://www.kernel.org/doc/Documentation/networking/can.txt you can also see can(4).
This adds a new socket family (AF_CAN) and protocol (PF_CAN), as well as the canconfig(8) utility, used to set timing parameter of CAN hardware. Also inclued is a driver for the CAN controller found in the allwinner A20 SoC (I tested it with an Olimex lime2 board, connected with PIC18-based CAN devices).
There is also the canloop(4) pseudo-device, which allows to use the socketcan API without CAN hardware.
At this time the CANFD part of the linux socketcan API is not implemented. Error frames are not implemented either. But I could get the cansend and canreceive utilities from the canutils package to build and run with minimal changes. tcpudmp(8) can also be used to record frames, which can be decoded with etherreal.
|
| 1.1 | 15-Jan-2017 |
bouyer | branches: 1.1.2; file can_var.h was initially added on branch bouyer-socketcan.
|
| 1.1.2.9 | 25-May-2017 |
bouyer | Allow can_bpf_mtap() to call bpf_mtap_softint() when needed.
|
| 1.1.2.8 | 22-May-2017 |
bouyer | factor out if_attach() and bpf_attach() calls in can_ifattach(). Introduce can_ifdetach(). Introduce can_bpf_mtap(), which converts the can_id to network byte order (as required by tcpdump/wireshark). Thanks to Guy Harris for poiting this requirement.
|
| 1.1.2.7 | 18-Apr-2017 |
bouyer | include socketvar.h, so avoid a warning on struct sockopt *
|
| 1.1.2.6 | 18-Apr-2017 |
bouyer | Add can_ifinit_timings() helper function, which initialise timing parameters to known invalid values.
|
| 1.1.2.5 | 17-Apr-2017 |
bouyer | Add infranstructure to configure timings from userland on a can interface. This uses the SIOCGDRVSPEC/SIOCSDRVSPEC ioctls. Compile-tested only.
|
| 1.1.2.4 | 05-Feb-2017 |
bouyer | Introduce can_ifattach(), for common setups of can interfaces. Convert output to a ifq and change canloop_output to canloop_ifstart
|
| 1.1.2.3 | 05-Feb-2017 |
bouyer | Centralize mbuf tag cleanup, it will be used by real interface drivers too.
|
| 1.1.2.2 | 16-Jan-2017 |
bouyer | Use PACKET_TAG_SO to store the sender's struct socket pointer, and use it to implement socket options CAN_RAW_LOOPBACK and CAN_RAW_RECV_OWN_MSGS.
|
| 1.1.2.1 | 15-Jan-2017 |
bouyer | Initial commit of a CAN socket layer, compatible with linux SoccketCAN (but incomplete). Based on work from Robert Swindells.
|
| 1.2.10.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.2.10.1 | 27-May-2017 |
jdolecek | file can_var.h was added on branch tls-maxphys on 2017-12-03 11:39:03 +0000
|
| 1.2.6.2 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.2.6.1 | 27-May-2017 |
skrll | file can_var.h was added on branch nick-nhusb on 2017-08-28 17:53:12 +0000
|
| 1.2 | 27-May-2017 |
bouyer | branches: 1.2.6; 1.2.10; merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used in automation and automotive fields. For example, the NMEA2000 standard developped for marine devices uses a CAN network as the link layer.
This is an implementation of the linux socketcan API: https://www.kernel.org/doc/Documentation/networking/can.txt you can also see can(4).
This adds a new socket family (AF_CAN) and protocol (PF_CAN), as well as the canconfig(8) utility, used to set timing parameter of CAN hardware. Also inclued is a driver for the CAN controller found in the allwinner A20 SoC (I tested it with an Olimex lime2 board, connected with PIC18-based CAN devices).
There is also the canloop(4) pseudo-device, which allows to use the socketcan API without CAN hardware.
At this time the CANFD part of the linux socketcan API is not implemented. Error frames are not implemented either. But I could get the cansend and canreceive utilities from the canutils package to build and run with minimal changes. tcpudmp(8) can also be used to record frames, which can be decoded with etherreal.
|
| 1.1 | 15-Jan-2017 |
bouyer | branches: 1.1.2; file files.netcan was initially added on branch bouyer-socketcan.
|
| 1.1.2.2 | 18-Apr-2017 |
bouyer | if_canloop.c is in netcan/
|
| 1.1.2.1 | 15-Jan-2017 |
bouyer | Initial commit of a CAN socket layer, compatible with linux SoccketCAN (but incomplete). Based on work from Robert Swindells.
|
| 1.2.10.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.2.10.1 | 27-May-2017 |
jdolecek | file files.netcan was added on branch tls-maxphys on 2017-12-03 11:39:03 +0000
|
| 1.2.6.2 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.2.6.1 | 27-May-2017 |
skrll | file files.netcan was added on branch nick-nhusb on 2017-08-28 17:53:12 +0000
|
| 1.10 | 03-Sep-2022 |
thorpej | Garbage-collect the remaining vestiges of netisr.
|
| 1.9 | 29-Jan-2020 |
thorpej | Adopt <net/if_stats.h>.
|
| 1.8 | 27-Apr-2019 |
pgoyette | branches: 1.8.4; Semicolon not needed
|
| 1.7 | 27-Apr-2019 |
pgoyette | Oooppss - deleted too many chars. Put them back.
Should fix the build break.
|
| 1.6 | 27-Apr-2019 |
pgoyette | A few more empty-string --> NULL in required-modules lists
|
| 1.5 | 19-Dec-2017 |
ozaki-r | branches: 1.5.4; Don't set IFEF_MPSAFE unless NET_MPSAFE at this point
Because recent investigations show that interfaces with IFEF_MPSAFE need to follow additional restrictions to work with the flag safely. We should enable it on an interface by default only if the interface surely satisfies the restrictions, which are described in if.h.
Note that enabling IFEF_MPSAFE solely gains a few benefit on performance because the network stack is still serialized by the big kernel locks by default.
|
| 1.4 | 06-Dec-2017 |
ozaki-r | Ensure to not turn on IFF_RUNNING of an interface until its initialization completes
And ensure to turn off it before destruction as per IFF_RUNNING's description "resource allocated". (The description is a bit doubtful though, I believe the change is still proper.)
|
| 1.3 | 16-Nov-2017 |
ozaki-r | branches: 1.3.2; Unify IFEF_*_MPSAFE into IFEF_MPSAFE
There are already two flags for if_output and if_start, however, it seems such MPSAFE flags are eventually needed for all if_XXX operations. Having discrete flags for each operation is wasteful of if_extflags bits. So let's unify the flags into one: IFEF_MPSAFE.
Fortunately IFEF_*_MPSAFE flags have never been included in any releases, so we can change them without breaking backward compatibility of the releases (though the kernel version of -current should be bumped).
Note that if an interface have both MP-safe and non-MP-safe operations at a time, we have to set the IFEF_MPSAFE flag and let callees of non-MP-safe opeartions take the kernel lock.
Proposed on tech-kern@ and tech-net@
|
| 1.2 | 27-May-2017 |
bouyer | branches: 1.2.2; 1.2.6; merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used in automation and automotive fields. For example, the NMEA2000 standard developped for marine devices uses a CAN network as the link layer.
This is an implementation of the linux socketcan API: https://www.kernel.org/doc/Documentation/networking/can.txt you can also see can(4).
This adds a new socket family (AF_CAN) and protocol (PF_CAN), as well as the canconfig(8) utility, used to set timing parameter of CAN hardware. Also inclued is a driver for the CAN controller found in the allwinner A20 SoC (I tested it with an Olimex lime2 board, connected with PIC18-based CAN devices).
There is also the canloop(4) pseudo-device, which allows to use the socketcan API without CAN hardware.
At this time the CANFD part of the linux socketcan API is not implemented. Error frames are not implemented either. But I could get the cansend and canreceive utilities from the canutils package to build and run with minimal changes. tcpudmp(8) can also be used to record frames, which can be decoded with etherreal.
|
| 1.1 | 15-Jan-2017 |
bouyer | branches: 1.1.2; file if_canloop.c was initially added on branch bouyer-socketcan.
|
| 1.1.2.8 | 25-May-2017 |
bouyer | Allow can_bpf_mtap() to call bpf_mtap_softint() when needed.
|
| 1.1.2.7 | 22-May-2017 |
bouyer | factor out if_attach() and bpf_attach() calls in can_ifattach(). Introduce can_ifdetach(). Introduce can_bpf_mtap(), which converts the can_id to network byte order (as required by tcpdump/wireshark). Thanks to Guy Harris for poiting this requirement.
|
| 1.1.2.6 | 24-Apr-2017 |
bouyer | Use bpf_mtap() not bpf_mtap_af(). Now files produced by tcpdump can be decoded by wireshark.
|
| 1.1.2.5 | 19-Apr-2017 |
bouyer | Set rcvif before bpf_mtap
|
| 1.1.2.4 | 05-Feb-2017 |
bouyer | Introduce can_ifattach(), for common setups of can interfaces. Convert output to a ifq and change canloop_output to canloop_ifstart
|
| 1.1.2.3 | 05-Feb-2017 |
bouyer | Centralize mbuf tag cleanup, it will be used by real interface drivers too.
|
| 1.1.2.2 | 16-Jan-2017 |
bouyer | Use PACKET_TAG_SO to store the sender's struct socket pointer, and use it to implement socket options CAN_RAW_LOOPBACK and CAN_RAW_RECV_OWN_MSGS.
|
| 1.1.2.1 | 15-Jan-2017 |
bouyer | Initial commit of a CAN socket layer, compatible with linux SoccketCAN (but incomplete). Based on work from Robert Swindells.
|
| 1.2.6.2 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.2.6.1 | 27-May-2017 |
skrll | file if_canloop.c was added on branch nick-nhusb on 2017-08-28 17:53:12 +0000
|
| 1.2.2.1 | 02-Jan-2018 |
snj | Pull up following revision(s) (requested by ozaki-r in ticket #456): sys/arch/arm/sunxi/sunxi_emac.c: 1.9 sys/dev/ic/dwc_gmac.c: 1.43-1.44 sys/dev/pci/if_iwm.c: 1.75 sys/dev/pci/if_wm.c: 1.543 sys/dev/pci/ixgbe/ixgbe.c: 1.112 sys/dev/pci/ixgbe/ixv.c: 1.74 sys/kern/sys_socket.c: 1.75 sys/net/agr/if_agr.c: 1.43 sys/net/bpf.c: 1.219 sys/net/if.c: 1.397, 1.399, 1.401-1.403, 1.406-1.410, 1.412-1.416 sys/net/if.h: 1.242-1.247, 1.250, 1.252-1.257 sys/net/if_bridge.c: 1.140 via patch, 1.142-1.146 sys/net/if_etherip.c: 1.40 sys/net/if_ethersubr.c: 1.243, 1.246 sys/net/if_faith.c: 1.57 sys/net/if_gif.c: 1.132 sys/net/if_l2tp.c: 1.15, 1.17 sys/net/if_loop.c: 1.98-1.101 sys/net/if_media.c: 1.35 sys/net/if_pppoe.c: 1.131-1.132 sys/net/if_spppsubr.c: 1.176-1.177 sys/net/if_tun.c: 1.142 sys/net/if_vlan.c: 1.107, 1.109, 1.114-1.121 sys/net/npf/npf_ifaddr.c: 1.3 sys/net/npf/npf_os.c: 1.8-1.9 sys/net/rtsock.c: 1.230 sys/netcan/if_canloop.c: 1.3-1.5 sys/netinet/if_arp.c: 1.255 sys/netinet/igmp.c: 1.65 sys/netinet/in.c: 1.210-1.211 sys/netinet/in_pcb.c: 1.180 sys/netinet/ip_carp.c: 1.92, 1.94 sys/netinet/ip_flow.c: 1.81 sys/netinet/ip_input.c: 1.362 sys/netinet/ip_mroute.c: 1.147 sys/netinet/ip_output.c: 1.283, 1.285, 1.287 sys/netinet6/frag6.c: 1.61 sys/netinet6/in6.c: 1.251, 1.255 sys/netinet6/in6_pcb.c: 1.162 sys/netinet6/ip6_flow.c: 1.35 sys/netinet6/ip6_input.c: 1.183 sys/netinet6/ip6_output.c: 1.196 sys/netinet6/mld6.c: 1.90 sys/netinet6/nd6.c: 1.239-1.240 sys/netinet6/nd6_nbr.c: 1.139 sys/netinet6/nd6_rtr.c: 1.136 sys/netipsec/ipsec_output.c: 1.65 sys/rump/net/lib/libnetinet/netinet_component.c: 1.9-1.10 kmem_intr_free kmem_intr_[z]alloced memory the underlying pools are the same but api-wise those should match Unify IFEF_*_MPSAFE into IFEF_MPSAFE There are already two flags for if_output and if_start, however, it seems such MPSAFE flags are eventually needed for all if_XXX operations. Having discrete flags for each operation is wasteful of if_extflags bits. So let's unify the flags into one: IFEF_MPSAFE. Fortunately IFEF_*_MPSAFE flags have never been included in any releases, so we can change them without breaking backward compatibility of the releases (though the kernel version of -current should be bumped). Note that if an interface have both MP-safe and non-MP-safe operations at a time, we have to set the IFEF_MPSAFE flag and let callees of non-MP-safe opeartions take the kernel lock. Proposed on tech-kern@ and tech-net@ Provide macros for softnet_lock and KERNEL_LOCK hiding NET_MPSAFE switch It reduces C&P codes such as "#ifndef NET_MPSAFE KERNEL_LOCK(1, NULL); ..." scattered all over the source code and makes it easy to identify remaining KERNEL_LOCK and/or softnet_lock that are held even if NET_MPSAFE. No functional change Hold KERNEL_LOCK on if_ioctl selectively based on IFEF_MPSAFE If IFEF_MPSAFE is set, hold the lock and otherwise don't hold. This change requires additions of KERNEL_LOCK to subsequence functions from if_ioctl such as ifmedia_ioctl and ifioctl_common to protect non-MP-safe components. Proposed on tech-kern@ and tech-net@ Ensure to hold if_ioctl_lock when calling if_flags_set Fix locking against myself on ifpromisc vlan_unconfig_locked could be called with holding if_ioctl_lock. Ensure to not turn on IFF_RUNNING of an interface until its initialization completes And ensure to turn off it before destruction as per IFF_RUNNING's description "resource allocated". (The description is a bit doubtful though, I believe the change is still proper.) Ensure to hold if_ioctl_lock on if_up and if_down One exception for if_down is if_detach; in the case the lock isn't needed because it's guaranteed that no other one can access ifp at that point. Make if_link_queue MP-safe if IFEF_MPSAFE if_link_queue is a queue to store events of link state changes, which is used to pass events from (typically) an interrupt handler to if_link_state_change softint. The queue was protected by KERNEL_LOCK so far, but if IFEF_MPSAFE is enabled, it becomes unsafe because (perhaps) an interrupt handler of an interface with IFEF_MPSAFE doesn't take KERNEL_LOCK. Protect it by a spin mutex. Additionally with this change KERNEL_LOCK of if_link_state_change softint is omitted if NET_MPSAFE is enabled. Note that the spin mutex is now ifp->if_snd.ifq_lock as well as the case of if_timer (see the comment). Use IFADDR_WRITER_FOREACH instead of IFADDR_READER_FOREACH At that point no other one modifies the list so IFADDR_READER_FOREACH is unnecessary. Use of IFADDR_READER_FOREACH is harmless in general though, if we try to detect contract violations of pserialize, using it violates the contract. So avoid using it makes life easy. Ensure to call if_addr_init with holding if_ioctl_lock Get rid of outdated comments Fix build of kernels without ether By throwing out if_enable_vlan_mtu and if_disable_vlan_mtu that created a unnecessary dependency from if.c to if_ethersubr.c. PR kern/52790 Rename IFNET_LOCK to IFNET_GLOBAL_LOCK IFNET_LOCK will be used in another lock, if_ioctl_lock (might be renamed then). Wrap if_ioctl_lock with IFNET_* macros (NFC) Also if_ioctl_lock perhaps needs to be renamed to something because it's now not just for ioctl... Reorder some destruction routines in if_detach - Destroy if_ioctl_lock at the end of the if_detach because it's used in various destruction routines - Move psref_target_destroy after pr_purgeif because we want to use psref in pr_purgeif (otherwise destruction procedures can be tricky) Ensure to call if_mcast_op with holding IFNET_LOCK Note that CARP doesn't deal with IFNET_LOCK yet. Remove IFNET_GLOBAL_LOCK where it's unnecessary because IFNET_LOCK is held Describe which lock is used to protect each member variable of struct ifnet Requested by skrll@ Write a guideline for converting an interface to IFEF_MPSAFE Requested by skrll@ Note that IFNET_LOCK must not be held in softint Don't set IFEF_MPSAFE unless NET_MPSAFE at this point Because recent investigations show that interfaces with IFEF_MPSAFE need to follow additional restrictions to work with the flag safely. We should enable it on an interface by default only if the interface surely satisfies the restrictions, which are described in if.h. Note that enabling IFEF_MPSAFE solely gains a few benefit on performance because the network stack is still serialized by the big kernel locks by default.
|
| 1.3.2.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.3.2.1 | 16-Nov-2017 |
jdolecek | file if_canloop.c was added on branch tls-maxphys on 2017-12-03 11:39:03 +0000
|
| 1.5.4.2 | 08-Apr-2020 |
martin | Merge changes from current as of 20200406
|
| 1.5.4.1 | 10-Jun-2019 |
christos | Sync with HEAD
|
| 1.8.4.1 | 29-Feb-2020 |
ad | Sync with head.
|