aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can/usb/peak_usb/pcan_usb_core.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 285Thomas Gleixner1-9/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation version 2 of the license this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 100 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141900.918357685@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-05can: peak_usb: peak_usb_netif_rx(): remove unused parameter "u32 ts_high"Marc Kleine-Budde1-1/+1
The 4th argument of peak_usb_netif_rx() "u32 ts_high" is never used, so remove it. Suggested-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-12-01can: peak_usb: use ktime_t consistentlyArnd Bergmann1-1/+1
This changes the calculation of the timestamps to use ktime_t instead of struct timeval as the base. This gets rid of one of the few remaining users of the deprecated ktime_to_timeval() and timeval_to_ktime() helpers. The code should also get more efficient, as we have now removed all of the divisions. I have left the cut-off for resetting the counters as 4.200 seconds, in order to leave the behavior unchanged otherwise. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-12-01can: peak_usb: remove some 'struct timeval' usersArnd Bergmann1-2/+1
We want to remove 'struct timeval' and related interfaces since this is generally not safe for use beyond 2038. For peak_usb, we can simplify the internal interface by using ktime_t directly. This should not change any behavior, but it avoids a few conversions. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-04-25can: usb: Add support of PCAN-Chip USB stamp moduleStephane Grosjean1-0/+2
This patch adds the support of the PCAN-Chip USB, a stamp module for customer hardware designs, which communicates via USB 2.0 with the hardware. The integrated CAN controller supports the protocols CAN 2.0 A/B as well as CAN FD. The physical CAN connection is determined by external wiring. The Stamp module with its single-sided mounting and plated half-holes is suitable for automatic assembly. Note that the chip is equipped with the same logic than the PCAN-USB FD. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2016-12-01can: peak: Add support for PCAN-USB X6 USB interfaceStephane Grosjean1-0/+2
This adds support for PEAK-System PCAN-USB X6 USB to CAN interface. The CAN FD adapter PCAN-USB X6 allows the connection of up to 6 CAN FD or CAN networks to a computer via USB. The interface is installed in an aluminum profile casing and is shipped in versions with D-Sub connectors or M12 circular connectors. The PCAN-USB X6 registers in the USB sub-system as if 3x PCAN-USB-Pro FD adapters were plugged. So, this patch: - updates the PEAK_USB entry of the corresponding Kconfig file - defines and adds the device id. of the PCAN-USB X6 (0x0014) into the table of supported device ids - defines and adds the new software structure implementing the PCAN-USB X6, which is obviously a clone of the software structure implementing the PCAN-USB Pro FD. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Tested-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-08-25can: pcan_usb: don't provide CAN FD bittimings by non-FD adaptersMarc Kleine-Budde1-2/+2
The CAN FD data bittiming constants are provided via netlink only when there are valid CAN FD constants available in priv->data_bittiming_const. Due to the indirection of pointer assignments in the peak_usb driver the priv->data_bittiming_const never becomes NULL - not even for non-FD adapters. The data_bittiming_const points to zero'ed data which leads to this result when running 'ip -details link show can0': 35: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10 link/can promiscuity 0 can state STOPPED restart-ms 0 pcan_usb: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1 : dtseg1 0..0 dtseg2 0..0 dsjw 1..0 dbrp 0..0 dbrp-inc 0 <== BROKEN! clock 8000000 This patch changes the struct peak_usb_adapter::bittiming_const and struct peak_usb_adapter::data_bittiming_const to pointers to fix the assignemnt problems. Cc: linux-stable <stable@vger.kernel.org> # >= 4.0 Reported-by: Oliver Hartkopp <socketcan@hartkopp.net> Tested-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-01-28can: peak_usb: add support for PEAK new CANFD USB adaptersStephane Grosjean1-0/+4
Add support for the following new PEAK-System technik CANFD USB adapters: PCAN-USB FD single CANFD channel USB adapter PCAN-USB Pro FD dual CANFD channels USB adapter Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Acked-by: Andri Yngvason <andri.yngvason@marel.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-01-28can: peak_usb: add peak_usb_netif_rx() new functionStephane Grosjean1-1/+3
Add a common function that pushes the skb in the network queue with adding timestamps information, converted from time values read from the PEAK USB adapters. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-01-28can: peak_usb: upgrade core to new struct canfd_frameStephane Grosjean1-1/+1
Upgrade PEAK-System USB adapters core to the new data structures (names) and callbacks added for the support of the CANFD extension. This specific patch includes changes that deal with the new struct canfd_frame. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-01-28can: peak_usb: upgrade core to data bittiming specsStephane Grosjean1-0/+3
Upgrade PEAK-System USB adapters core to the new data structures (names) and callbacks added for the support of the CANFD extension. This specific patch does the mandatory changes to support new data bittiming specs. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-01-28can: peak_usb: add adapter BEC callback definitionStephane Grosjean1-0/+2
Add the definition of a new callback that enable any PEAK-System CAN USB adapter to grant read access to its Bus Error Counters value. This ability is not supported by all the PEAK-System adapters, thus, for those, the callback pointer will be initiaized to NULL, which is correct regarding the linux-can device driver specs. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-01-28can: peak_usb: export ctrlmode_supported to adapter specific definitionStephane Grosjean1-0/+1
Export the ctrlmode_supported value from the core file to each adapter specific file. This has been mandatory for supporting the new CANFD extension. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-01-28can: peak_usb: constify struct peak_usb_adapterMarc Kleine-Budde1-5/+5
A "struct peak_usb_adapter" describes a certain USB adapter, as this doesn't change during runtime, this patch marks all USB adapter definitions as const. Acked-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-11-29can: pcan_usb_core: remove obsolete variable open_timeMarc Kleine-Budde1-1/+0
The variable open_time in the struct peak_usb_device was used to protect peak_usb_set_mode() only to be called, if the interface is up. Now the CAN device infrastructure takes care of this. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-09-21can: usb: peak: rename peak_usb dump_mem functionRandy Dunlap1-1/+1
Rename generic-sounding function dump_mem() to pcan_dump_mem() so that it does not conflict with the dump_mem() function in arch/sh/include/asm/kdebug.h. drivers/net/can/usb/peak_usb/pcan_usb_core.c: error: conflicting types for 'dump_mem': => 56:6 drivers/net/can/usb/peak_usb/pcan_usb_core.h: error: conflicting types for 'dump_mem': => 134:6 Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Stephane Grosjean <s.grosjean@peak-system.com> Cc: Wolfgang Grandegger <wg@grandegger.com> Cc: Marc Kleine-Budde <mkl@pengutronix.de> [mkl: convert all users of dump_mem(), too] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-07-20can: mark bittiming_const pointer in struct can_priv as constMarc Kleine-Budde1-1/+1
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 <mkl@pengutronix.de>
2012-03-03can: usb: PEAK-System Technik USB adapters driver coreStephane Grosjean1-0/+146
This patch adds the core of the peak_usb driver which handles PEAK-System Technik PCAN USB adapters. It defines the parts which are common to the PCAN-USB adapters: can network interfaces management, network-to/from-usb data path interface, timestamps management... Tested-by: Oliver Hartkopp <socketcan@hartkopp.net> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>