The NetBSD Project

CVS log for src/sys/netcan/can.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / netcan

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.13.6.1 / (download) - annotate - [select for diffs], Wed Nov 15 02:08:34 2023 UTC (3 months ago) by thorpej
Branch: thorpej-ifq
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

Rename ifq_enqueue() -> if_enqueue(), ifq_enqueue2() -> if_enqueue2().

Revision 1.13 / (download) - annotate - [select for diffs], Fri Nov 4 09:00:58 2022 UTC (15 months, 2 weeks ago) by ozaki-r
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, HEAD
Branch point for: thorpej-ifq
Changes since 1.12: +4 -4 lines
Diff to previous 1.12 (colored)

inpcb: rename functions to inpcb_*

Inspired by rmind-smpnet patches.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Sep 3 02:07:32 2022 UTC (17 months, 2 weeks ago) by thorpej
Branch: MAIN
CVS Tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.11: +15 -28 lines
Diff to previous 1.11 (colored)

Convert CAN from a legacy netisr to pktqueue.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Dec 31 14:24:51 2021 UTC (2 years, 1 month ago) by riastradh
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

sys: Use if_ioctl wrapper function.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Sep 21 15:04:27 2021 UTC (2 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.9: +6 -6 lines
Diff to previous 1.9 (colored)

don't opencode kauth_cred_get()

Revision 1.4.2.3 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:16 2020 UTC (3 years, 10 months ago) by martin
Branch: phil-wifi
Changes since 1.4.2.2: +6 -2 lines
Diff to previous 1.4.2.2 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.4.2.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:08:58 2020 UTC (3 years, 10 months ago) by martin
Branch: phil-wifi
Changes since 1.4.2.1: +4 -5 lines
Diff to previous 1.4.2.1 (colored) to branchpoint 1.4 (colored)

Merge changes from current as of 20200406

Revision 1.8.2.1 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:07 2020 UTC (3 years, 11 months ago) by ad
Branch: ad-namecache
Changes since 1.8: +4 -5 lines
Diff to previous 1.8 (colored) next main 1.9 (colored)

Sync with head.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jan 29 05:20:26 2020 UTC (4 years ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3
Changes since 1.8: +4 -5 lines
Diff to previous 1.8 (colored)

Adopt <net/if_stats.h>.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Aug 19 03:24:38 2019 UTC (4 years, 6 months ago) by ozaki-r
Branch: MAIN
CVS Tags: phil-wifi-20191119, ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.7: +8 -2 lines
Diff to previous 1.7 (colored)

can: add missing mowner variables for MBUFTRACE

Revision 1.7 / (download) - annotate - [select for diffs], Sat Jul 20 15:34:41 2019 UTC (4 years, 7 months ago) by bouyer
Branch: MAIN
CVS Tags: netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9
Changes since 1.6: +2 -4 lines
Diff to previous 1.6 (colored)

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.

Revision 1.4.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:09:47 2019 UTC (4 years, 8 months ago) by christos
Branch: phil-wifi
Changes since 1.4: +5 -5 lines
Diff to previous 1.4 (colored)

Sync with HEAD

Revision 1.2.12.3 / (download) - annotate - [select for diffs], Mon Nov 26 01:52:51 2018 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.2.12.2: +5 -5 lines
Diff to previous 1.2.12.2 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

Sync with HEAD, resolve a couple of conflicts

Revision 1.6 / (download) - annotate - [select for diffs], Thu Nov 15 10:23:56 2018 UTC (5 years, 3 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, isaki-audio2-base, isaki-audio2
Changes since 1.5: +4 -4 lines
Diff to previous 1.5 (colored)

Remove the 't' argument from m_tag_find().

Revision 1.5 / (download) - annotate - [select for diffs], Thu Nov 15 10:06:07 2018 UTC (5 years, 3 months ago) by maxv
Branch: MAIN
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

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().

Revision 1.2.12.2 / (download) - annotate - [select for diffs], Sat Jul 28 04:38:10 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.2.12.1: +4 -3 lines
Diff to previous 1.2.12.1 (colored) to branchpoint 1.2 (colored)

Sync with HEAD

Revision 1.4 / (download) - annotate - [select for diffs], Tue Jun 26 06:48:03 2018 UTC (5 years, 7 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728
Branch point for: phil-wifi
Changes since 1.3: +4 -3 lines
Diff to previous 1.3 (colored)

 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.

Revision 1.2.2.1 / (download) - annotate - [select for diffs], Mon Apr 9 13:34:11 2018 UTC (5 years, 10 months ago) by bouyer
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Changes since 1.2: +3 -2 lines
Diff to previous 1.2 (colored) next main 1.3 (colored)

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.

Revision 1.2.12.1 / (download) - annotate - [select for diffs], Thu Mar 22 01:44:51 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.2: +3 -2 lines
Diff to previous 1.2 (colored)

Synch with HEAD, resolve conflicts

Revision 1.3 / (download) - annotate - [select for diffs], Wed Mar 21 14:23:54 2018 UTC (5 years, 11 months ago) by roy
Branch: MAIN
CVS Tags: pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322
Changes since 1.2: +3 -2 lines
Diff to previous 1.2 (colored)

Sprinkle more soroverflow().

Revision 1.2.10.2 / (download) - annotate - [select for diffs], Sun Dec 3 11:39:03 2017 UTC (6 years, 2 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.2.10.1: +1013 -0 lines
Diff to previous 1.2.10.1 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

update from HEAD

Revision 1.2.6.2 / (download) - annotate - [select for diffs], Mon Aug 28 17:53:12 2017 UTC (6 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.2.6.1: +1013 -0 lines
Diff to previous 1.2.6.1 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

Sync with HEAD

Revision 1.2.10.1, Sat May 27 21:02:56 2017 UTC (6 years, 8 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.2: +0 -1013 lines
FILE REMOVED

file can.c was added on branch tls-maxphys on 2017-12-03 11:39:03 +0000

Revision 1.2.6.1, Sat May 27 21:02:56 2017 UTC (6 years, 8 months ago) by skrll
Branch: nick-nhusb
Changes since 1.2: +0 -1013 lines
FILE REMOVED

file can.c was added on branch nick-nhusb on 2017-08-28 17:53:12 +0000

Revision 1.2 / (download) - annotate - [select for diffs], Sat May 27 21:02:56 2017 UTC (6 years, 8 months ago) by bouyer
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, pgoyette-compat-base, pgoyette-compat-0315, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek
Branch point for: tls-maxphys, pgoyette-compat, nick-nhusb, netbsd-8
Changes since 1.1: +1013 -0 lines
Diff to previous 1.1 (colored)

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.

Revision 1.1.2.15 / (download) - annotate - [select for diffs], Thu May 25 18:21:00 2017 UTC (6 years, 8 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.14: +7 -4 lines
Diff to previous 1.1.2.14 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored)

Allow can_bpf_mtap() to call bpf_mtap_softint() when needed.

Revision 1.1.2.14 / (download) - annotate - [select for diffs], Mon May 22 16:11:23 2017 UTC (6 years, 9 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.13: +28 -3 lines
Diff to previous 1.1.2.13 (colored) to branchpoint 1.1 (colored)

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.

Revision 1.1.2.13 / (download) - annotate - [select for diffs], Sun Apr 23 21:05:09 2017 UTC (6 years, 10 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.12: +30 -11 lines
Diff to previous 1.1.2.12 (colored) to branchpoint 1.1 (colored)

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.

Revision 1.1.2.12 / (download) - annotate - [select for diffs], Thu Apr 20 17:29:10 2017 UTC (6 years, 10 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.11: +4 -3 lines
Diff to previous 1.1.2.11 (colored) to branchpoint 1.1 (colored)

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.

Revision 1.1.2.11 / (download) - annotate - [select for diffs], Thu Apr 20 12:59:11 2017 UTC (6 years, 10 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.10: +11 -5 lines
Diff to previous 1.1.2.10 (colored) to branchpoint 1.1 (colored)

Fix LINKMODE
Refuse to send packets if LISTENONLY is set
Don't forget to unbind in error case.

Revision 1.1.2.10 / (download) - annotate - [select for diffs], Wed Apr 19 22:19:12 2017 UTC (6 years, 10 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.9: +29 -21 lines
Diff to previous 1.1.2.9 (colored) to branchpoint 1.1 (colored)

can_mbuf_tag_clean(): make sure we won't free the tag we will reuse.
Avoid mbuf leak in error paths.

Revision 1.1.2.9 / (download) - annotate - [select for diffs], Wed Apr 19 17:52:37 2017 UTC (6 years, 10 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.8: +3 -2 lines
Diff to previous 1.1.2.8 (colored) to branchpoint 1.1 (colored)

Call if_alloc_sadl() for the interface, so that getifaddrs() will find
them.

Revision 1.1.2.8 / (download) - annotate - [select for diffs], Tue Apr 18 20:37:38 2017 UTC (6 years, 10 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.7: +9 -2 lines
Diff to previous 1.1.2.7 (colored) to branchpoint 1.1 (colored)

Add can_ifinit_timings() helper function, which initialise timing parameters
to known invalid values.

Revision 1.1.2.7 / (download) - annotate - [select for diffs], Mon Apr 17 20:32:27 2017 UTC (6 years, 10 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.6: +80 -5 lines
Diff to previous 1.1.2.6 (colored) to branchpoint 1.1 (colored)

Add infranstructure to configure timings from userland on a can interface.
This uses the SIOCGDRVSPEC/SIOCSDRVSPEC ioctls.
Compile-tested only.

Revision 1.1.2.6 / (download) - annotate - [select for diffs], Sun Feb 5 19:44:53 2017 UTC (7 years ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.5: +9 -2 lines
Diff to previous 1.1.2.5 (colored) to branchpoint 1.1 (colored)

more sanity checks on the mbuf we get.

Revision 1.1.2.5 / (download) - annotate - [select for diffs], Sun Feb 5 17:37:10 2017 UTC (7 years ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.4: +15 -4 lines
Diff to previous 1.1.2.4 (colored) to branchpoint 1.1 (colored)

Introduce can_ifattach(), for common setups of can interfaces.
Convert output to a ifq and change canloop_output to canloop_ifstart

Revision 1.1.2.4 / (download) - annotate - [select for diffs], Sun Feb 5 11:45:11 2017 UTC (7 years ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.3: +16 -2 lines
Diff to previous 1.1.2.3 (colored) to branchpoint 1.1 (colored)

Centralize mbuf tag cleanup, it will be used by real interface drivers too.

Revision 1.1.2.3 / (download) - annotate - [select for diffs], Sun Feb 5 10:56:12 2017 UTC (7 years ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.2: +21 -7 lines
Diff to previous 1.1.2.2 (colored) to branchpoint 1.1 (colored)

Implement CAN_RAW_FILTER socket option, and add tests for it.

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Mon Jan 16 18:03:38 2017 UTC (7 years, 1 month ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1.2.1: +135 -10 lines
Diff to previous 1.1.2.1 (colored) to branchpoint 1.1 (colored)

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.

Revision 1.1.2.1 / (download) - annotate - [select for diffs], Sun Jan 15 20:27:33 2017 UTC (7 years, 1 month ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.1: +697 -0 lines
Diff to previous 1.1 (colored)

Initial commit of a CAN socket layer, compatible with linux SoccketCAN
(but incomplete). Based on work from Robert Swindells.

Revision 1.1, Sun Jan 15 20:27:33 2017 UTC (7 years, 1 month ago) by bouyer
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, bouyer-socketcan-base1
Branch point for: bouyer-socketcan
FILE REMOVED

file can.c was initially added on branch bouyer-socketcan.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>