05 Oct, 2017
1 commit
-
It's used for transceiver_switch.
NOTE: it's newly added since it's deleted by upstream before.
However, the driver is still using it, so have to add it.Signed-off-by: Dong Aisheng
(cherry picked from commit 53109634188e672b807a7256afbf10db0d9a6574)
18 Feb, 2017
1 commit
-
[ Upstream commit f1712c73714088a7252d276a57126d56c7d37e64 ]
Zhang Yanmin reported crashes [1] and provided a patch adding a
synchronize_rcu() call in can_rx_unregister()The main problem seems that the sockets themselves are not RCU
protected.If CAN uses RCU for delivery, then sockets should be freed only after
one RCU grace period.Recent kernels could use sock_set_flag(sk, SOCK_RCU_FREE), but let's
ease stable backports with the following fix instead.[1]
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [] selinux_socket_sock_rcv_skb+0x65/0x2a0Call Trace:
[] security_sock_rcv_skb+0x4c/0x60
[] sk_filter+0x41/0x210
[] sock_queue_rcv_skb+0x53/0x3a0
[] raw_rcv+0x2a3/0x3c0
[] can_rcv_filter+0x12b/0x370
[] can_receive+0xd9/0x120
[] can_rcv+0xab/0x100
[] __netif_receive_skb_core+0xd8c/0x11f0
[] __netif_receive_skb+0x24/0xb0
[] process_backlog+0x127/0x280
[] net_rx_action+0x33b/0x4f0
[] __do_softirq+0x184/0x440
[] do_softirq_own_stack+0x1c/0x30
[] do_softirq.part.18+0x3b/0x40
[] do_softirq+0x1d/0x20
[] netif_rx_ni+0xe5/0x110
[] slcan_receive_buf+0x507/0x520
[] flush_to_ldisc+0x21c/0x230
[] process_one_work+0x24f/0x670
[] worker_thread+0x9d/0x6f0
[] ? rescuer_thread+0x480/0x480
[] kthread+0x12c/0x150
[] ret_from_fork+0x3f/0x70Reported-by: Zhang Yanmin
Signed-off-by: Eric Dumazet
Acked-by: Oliver Hartkopp
Signed-off-by: David S. Miller
Signed-off-by: Greg Kroah-Hartman
22 Sep, 2016
1 commit
-
A timer was used to restart after the bus-off state, leading to a
relatively large can_restart() executed in an interrupt context,
which in turn sets up pinctrl. When this happens during system boot,
there is a high probability of grabbing the pinctrl_list_mutex,
which is locked already by the probe() of other device, making the
kernel suspect a deadlock condition [1].To resolve this issue, the restart_timer is replaced by a delayed
work.[1] https://github.com/victronenergy/venus/issues/24
Signed-off-by: Sergei Miroshnichenko
Cc: linux-stable
Signed-off-by: Marc Kleine-Budde
09 May, 2016
1 commit
-
As described in 'can: m_can: tag current CAN FD controllers as non-ISO'
(6cfda7fbebe) it is possible to define fixed configuration options by
setting the according bit in 'ctrlmode' and clear it in 'ctrlmode_supported'.
This leads to the incovenience that the fixed configuration bits can not be
passed by netlink even when they have the correct values (e.g. non-ISO, FD).This patch fixes that issue and not only allows fixed set bit values to be set
again but now requires(!) to provide these fixed values at configuration time.
A valid CAN FD configuration consists of a nominal/arbitration bittiming, a
data bittiming and a control mode with CAN_CTRLMODE_FD set - which is now
enforced by a new can_validate() function. This fix additionally removed the
inconsistency that was prohibiting the support of 'CANFD-only' controller
drivers, like the RCar CAN FD.For this reason a new helper can_set_static_ctrlmode() has been introduced to
provide a proper interface to handle static enabled CAN controller options.Reported-by: Ramesh Shanmugasundaram
Signed-off-by: Oliver Hartkopp
Reviewed-by: Ramesh Shanmugasundaram
Cc: # >= 3.18
Signed-off-by: Marc Kleine-Budde
09 Oct, 2015
1 commit
-
This patch makes can_dropped_invalid_skb return bool due to this
particular function only using either one or zero as its return
value.No functional change.
Signed-off-by: Yaowei Bai
Acked-by: Marc Kleine-Budde
Signed-off-by: David S. Miller
21 Sep, 2015
1 commit
-
This patch adds the missing #include-s to the dev.h and led.h, so that they can
be used without including further header files.Signed-off-by: Marc Kleine-Budde
13 Jul, 2015
1 commit
-
Commit 514ac99c64b "can: fix multiple delivery of a single CAN frame for
overlapping CAN filters" requires the skb->tstamp to be set to check for
identical CAN skbs.Without timestamping to be required by user space applications this timestamp
was not generated which lead to commit 36c01245eb8 "can: fix loss of CAN frames
in raw_rcv" - which forces the timestamp to be set in all CAN related skbuffs
by introducing several __net_timestamp() calls.This forces e.g. out of tree drivers which are not using alloc_can{,fd}_skb()
to add __net_timestamp() after skbuff creation to prevent the frame loss fixed
in mainline Linux.This patch removes the timestamp dependency and uses an atomic counter to
create an unique identifier together with the skbuff pointer.Btw: the new skbcnt element introduced in struct can_skb_priv has to be
initialized with zero in out-of-tree drivers which are not using
alloc_can{,fd}_skb() too.Signed-off-by: Oliver Hartkopp
Cc: linux-stable
Signed-off-by: Marc Kleine-Budde
23 Mar, 2015
2 commits
-
Add -rxtx trigger, that will be activated both for tx
as rx events. This trigger mimics "activity" LED for Ethernet
devices.Signed-off-by: Yegor Yefremov
Signed-off-by: Marc Kleine-Budde -
It is identical to the can destructor.
Signed-off-by: Florian Westphal
Acked-by: Oliver Hartkopp
Signed-off-by: Marc Kleine-Budde
08 Dec, 2014
1 commit
-
The handling of can error states is different between platforms.
This is an attempt to correct that problem.I've moved this handling into a generic function for changing the
error state. This ensures that error state changes are handled
the same way everywhere (where this function is used).This new mechanism also adds reverse state transitioning in error
frames, i.e. the user will be notified through the socket interface
when the state goes down.Signed-off-by: Andri Yngvason
Acked-by: Wolfgang Grandegger
Signed-off-by: Marc Kleine-Budde
18 Nov, 2014
1 commit
-
The CAN device drivers can use can_is_canfd_skb() to check if the frame to send
is on CAN FD mode or normal CAN mode.Acked-by: Oliver Hartkopp
Signed-off-by: Dong Aisheng
Signed-off-by: Marc Kleine-Budde
19 May, 2014
2 commits
-
Armin pointed me to the fact that the identifier which is used to ensure the
unique include processing in lunux/include/uapi/linux/can.h is CAN_H.
This clashed with his own source as includes from libraries and APIs should
use an underscore '_' at the identifier start.This patch fixes the protection identifiers in all CAN relavant includes.
Reported-by: Armin Burchardt
Signed-off-by: Oliver Hartkopp
Signed-off-by: Marc Kleine-Budde -
Add support for the CAN controller found in Renesas R-Car SoCs.
Signed-off-by: Sergei Shtylyov
Signed-off-by: Marc Kleine-Budde
07 Mar, 2014
2 commits
-
The configuration for CAN FD depends on CAN_CTRLMODE_FD enabled in the driver
specific ctrlmode_supported capabilities.The configuration can be done either with the 'fd { on | off }' option in the
'ip' tool from iproute2 or by setting the CAN netdevice MTU to CAN_MTU (16) or
to CANFD_MTU (72).Signed-off-by: Oliver Hartkopp
Acked-by: Stephane Grosjean
Signed-off-by: Marc Kleine-Budde -
As CAN FD offers a second bitrate for the data section of the CAN frame the
infrastructure for storing and configuring this second bitrate is introduced.
Improved the readability of the if-statement by inserting some newlines.Signed-off-by: Oliver Hartkopp
Acked-by: Stephane Grosjean
Signed-off-by: Marc Kleine-Budde
14 Feb, 2014
1 commit
-
linux-can-next-for-3.15-20140212
Marc Kleine-Budde says:
====================
this is a pull request of eight patches for net-next/master.Florian Vaussard contributed a series that merged the sja1000 of_platform
into the platform driver. The of_platform driver is finally removed.
Stephane Grosjean supplied a patch to allocate CANFD skbs. In a patch
by Uwe Kleine-König another missing copyright information was added to
a userspace header. And a patch by Yoann DI RUZZA that adds listen only
mode to the at91_can driver.
====================Signed-off-by: David S. Miller
04 Feb, 2014
1 commit
-
This patch adds the ability of allocating a CANFD frame data structure in the
skb data area.Signed-off-by: Stephane Grosjean
Acked-by: Oliver Hartkopp
Signed-off-by: Marc Kleine-Budde
31 Jan, 2014
1 commit
-
Self generated skbuffs in net/can/bcm.c are setting a skb->sk reference but
no explicit destructor which is enforced since Linux 3.11 with commit
376c7311bdb6 (net: add a temporary sanity check in skb_orphan()).This patch adds some helper functions to make sure that a destructor is
properly defined when a sock reference is assigned to a CAN related skb.
To create an unshared skb owned by the original sock a common helper function
has been introduced to replace open coded functions to create CAN echo skbs.Signed-off-by: Oliver Hartkopp
Tested-by: Andre Naujoks
Reviewed-by: Eric Dumazet
Signed-off-by: David S. Miller
21 Aug, 2013
2 commits
-
Flags is not used by boards, so remove this field from the driver
platform_data.Signed-off-by: Alexander Shiyan
Signed-off-by: Marc Kleine-Budde -
This patch replaces power callbacks to the regulator API. To improve
the readability of the code, helper for the regulator enable/disable
was added.Acked-by: Haojian Zhuang
Signed-off-by: Alexander Shiyan
Signed-off-by: Marc Kleine-Budde
27 Jun, 2013
1 commit
-
As there are no more users of the flexcan platform file, let's remove it.
Cc: Sascha Hauer
Acked-by: Shawn Guo
Signed-off-by: Fabio Estevam
Signed-off-by: Marc Kleine-Budde
29 Jan, 2013
1 commit
-
Added accessor and skb_reserve helpers for struct can_skb_priv.
Removed pointless skb_headroom() check.Signed-off-by: Oliver Hartkopp
CC: Marc Kleine-Budde
Signed-off-by: David S. Miller
26 Jan, 2013
4 commits
-
The struct can_skb_priv is used to transport additional information along
with the stored struct can(fd)_frame that can not be contained in existing
struct sk_buff elements.can_skb_priv is located in the skb headroom, which does not touch the existing
CAN sk_buff usage with skb->data and skb->len, so that even out-of-tree
CAN drivers can be used without changes.Btw. out-of-tree CAN drivers without can_skb_priv in the sk_buff headroom
would not support features based on can_skb_priv.The can_skb_priv->ifindex contains the first interface where the CAN frame
appeared on the local host. Unfortunately skb->skb_iif can not be used as this
value is overwritten in every netif_receive_skb() call.Signed-off-by: Oliver Hartkopp
Signed-off-by: Marc Kleine-Budde -
The LED trigger name for CAN devices is based on the initial
CAN device name, but does never change. The LED trigger name
is not guaranteed to be unique in case of hotplugging CAN devices.This patch tries to address this problem by modifying the
LED trigger name according to the CAN device name when
the latter changes.v1 - Kurt Van Dijck
v2 - Fabio Baltieri
- remove rename blocking if trigger is bound
- use led-subsystem function for the actual rename (still WiP)
- call init/exit functions from dev.c
v3 - Kurt Van Dijck
- safe operation for non-candev based devices (vcan, slcan)
based on earlier patch
v4 - Kurt Van Dijck
- trivial patch mistakes fixedSigned-off-by: Kurt Van Dijck
Signed-off-by: Fabio Baltieri
Signed-off-by: Marc Kleine-Budde -
In net_device notifier calls, it was impossible to determine
if a CAN device is based on candev in a safe way.
This patch adds such test in order to access candev storage
from within those notifiers.Signed-off-by: Kurt Van Dijck
Acked-by: Oliver Hartkopp
Signed-off-by: Fabio Baltieri
Signed-off-by: Marc Kleine-Budde -
This patch implements the functions to add two LED triggers, named
-tx and -rx, to a canbus device driver.Triggers are called from specific handlers by each CAN device driver and
can be disabled altogether with a Kconfig option.The implementation keeps the LED on when the interface is UP and blinks
the LED on network activity at a configurable rate.This only supports can-dev based drivers, as it uses some support field
in the can_priv structure.Supported drivers should call devm_can_led_init() and can_led_event() as
needed.Cleanup is handled automatically by devres, so no *_exit function is
needed.Supported events are:
- CAN_LED_EVENT_OPEN: turn on tx/rx LEDs
- CAN_LED_EVENT_STOP: turn off tx/rx LEDs
- CAN_LED_EVENT_TX: trigger tx LED blink
- CAN_LED_EVENT_RX: trigger tx LED blinkCc: Wolfgang Grandegger
Cc: Marc Kleine-Budde
Signed-off-by: Fabio Baltieri
Acked-by: Oliver Hartkopp
Signed-off-by: Marc Kleine-Budde
17 Oct, 2012
1 commit
-
Remove non-UAPI Kbuild files that have become empty as a result of UAPI
disintegration. They used to have only header-y lines in them and those have
now moved to the Kbuild files in the corresponding uapi/ directories.Possibly these should not be removed but rather have a comment inserted to say
they are intentionally left blank. This would make it easier to add generated
header lines in future without having to restore the infrastructure.Note that at this point not all the UAPI disintegration parts have been merged,
so it is likely that more empty Kbuild files will turn up.It is probably necessary to make the files non-empty to prevent the patch
program from automatically deleting them when it reduces them to nothing.Signed-off-by: David Howells
11 Oct, 2012
1 commit
-
Signed-off-by: David Howells
Acked-by: Arnd Bergmann
Acked-by: Thomas Gleixner
Acked-by: Michael Kerrisk
Acked-by: Paul E. McKenney
Acked-by: Dave Jones
Signed-off-by: Marc Kleine-Budde
20 Jul, 2012
1 commit
-
This patch marks the bittiming_const pointer as in the struct can_pric as
"const". This allows us to mark the struct can_bittiming_const in the CAN
drivers as "const", too.Signed-off-by: Marc Kleine-Budde
20 Jun, 2012
3 commits
-
- update sanity checks
- add DLC to length conversion helpers
- can_dlc2len() - get data length from can_dlc with sanitized can_dlc
- can_len2dlc() - map the sanitized data length to an appropriate DLCSigned-off-by: Oliver Hartkopp
Signed-off-by: Marc Kleine-Budde -
- introduce a new sockopt CAN_RAW_FD_FRAMES to allow CAN FD frames
- handle CAN frames and CAN FD frames simultaneously when enabledSigned-off-by: Oliver Hartkopp
Signed-off-by: Marc Kleine-Budde -
- handle ETH_P_CAN and ETH_P_CANFD skbuffs
- update sanity checks for CAN and CAN FD
- make sure the CAN frame can pass the selected CAN netdevice on send
- bump core version and abi version to indicate the new CAN FD supportSigned-off-by: Oliver Hartkopp
Signed-off-by: Marc Kleine-Budde
24 May, 2012
1 commit
-
As Heinz-Juergen Oertel pointed out 'CAN error frames' are a already defined
term for the CAN protocol violation indication on the wire.To avoid confusion with the error messages created by CAN drivers available
via CAN RAW sockets update the documentation and change the naming from
'error frames' to 'error messages' or 'error message frames'.Signed-off-by: Oliver Hartkopp
Signed-off-by: Marc Kleine-Budde
03 Feb, 2012
1 commit
-
can_get_echo_skb() is usually called in the TX complete handler.
The stats->tx_packets and stats->tx_bytes should be updated there, too.
This patch simplifies to figure out the size of the sent CAN frame.Signed-off-by: Marc Kleine-Budde
02 Dec, 2011
1 commit
-
Signed-off-by: Wolfgang Grandegger
Acked-by: Marc Kleine-Budde
Signed-off-by: David S. Miller
18 Oct, 2011
1 commit
-
The BerliOS project, which currently hosts our mailinglist, will
close with the end of the year. Now take the chance and remove all
occurrences of the mailinglist address from the source files.Signed-off-by: Marc Kleine-Budde
Signed-off-by: David S. Miller
17 Sep, 2011
1 commit
-
This patch adds a CAN Gateway/Router to route (and modify) CAN frames.
It is based on the PF_CAN core infrastructure for msg filtering and msg
sending and can optionally modify routed CAN frames on the fly.
CAN frames can *only* be routed between CAN network interfaces (one hop).
They can be modified with AND/OR/XOR/SET operations as configured by the
netlink configuration interface known e.g. from iptables. From the netlink
view this can-gw implements RTM_{NEW|DEL|GET}ROUTE for PF_CAN.The CAN specific userspace tool to manage CAN routing entries can be found in
the CAN utils http://svn.berlios.de/wsvn/socketcan/trunk/can-utils/cangw.c
at the SocketCAN SVN on BerliOS.Signed-off-by: Oliver Hartkopp
Signed-off-by: David S. Miller
27 Aug, 2011
1 commit
-
uses type canid_t, defined in .
Signed-off-by: Ben Hutchings
Acked-by: Oliver Hartkopp
Signed-off-by: David S. Miller
05 May, 2011
1 commit
-
commit 53914b67993c724cec585863755c9ebc8446e83b had the
same message. That commit did put everything in place but
did not make can_proto const itself.Signed-off-by: Kurt Van Dijck
Acked-by: Oliver Hartkopp
Signed-off-by: David S. Miller
11 Apr, 2011
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (34 commits)
net: Add support for SMSC LAN9530, LAN9730 and LAN89530
mlx4_en: Restoring RX buffer pointer in case of failure
mlx4: Sensing link type at device initialization
ipv4: Fix "Set rt->rt_iif more sanely on output routes."
MAINTAINERS: add entry for Xen network backend
be2net: Fix suspend/resume operation
be2net: Rename some struct members for clarity
pppoe: drop PPPOX_ZOMBIEs in pppoe_flush_dev
dsa/mv88e6131: add support for mv88e6085 switch
ipv6: Enable RFS sk_rxhash tracking for ipv6 sockets (v2)
be2net: Fix a potential crash during shutdown.
bna: Fix for handling firmware heartbeat failure
can: mcp251x: Allow pass IRQ flags through platform data.
smsc911x: fix mac_lock acquision before calling smsc911x_mac_read
iwlwifi: accept EEPROM version 0x423 for iwl6000
rt2x00: fix cancelling uninitialized work
rtlwifi: Fix some warnings/bugs
p54usb: IDs for two new devices
wl12xx: fix potential buffer overflow in testmode nvs push
zd1211rw: reset rx idle timer from tasklet
...