aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/can/usb
AgeCommit message (Collapse)AuthorFilesLines
2017-04-25can: mcba_usb: Add support for Microchip CAN BUS AnalyzerRemigiusz Kołłątaj3-0/+911
SocketCAN driver for Microchip CAN BUS Analyzer (http://www.microchip.com/development-tools/) Changes in v4: - possible memory leak fixed in mcba_usb_write_bulk_callback - LED support added - failure handling in mcba_usb_probe improved - C99 initializers for structs on stack Changes in v3: - improved/simplified CAN ID conversion - functions for transmission of skb and cmd separated - fixed/improved netif_stop_queue handling - style/cosmetic corrections Changes in v2: - Termination handling reimplemented to fit new netlink API (IFLA_CAN_TERMINATION) - Bitrate handling reimplemented to fit new netlink API (IFLA_CAN_BITRATE) - CAN ID conversion refactored (changed from macro to inline functions) - CAN DLC handling using get_can_dlc() - Endianness handling for can_speed introduced - Debugging removed - Redundant error prints removed - Style/cosmetic corrections (i.e. macro names, redefs, inits etc.) Signed-off-by: Remigiusz Kołłątaj <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2017-04-25can: peak: move header file to new can common subdirStephane Grosjean2-244/+1
The CAN-FD IP from PEAK-System runs into several kinds of PC CAN-FD interfaces. Up to now, only the USB CAN-FD adapters were supported by the Kernel. In order to prepare the adding of some new non-USB CAN-FD interfaces, this patch moves - and rename - the IP definitions file from its private (usb) sub-directory into a - newly created - CAN specific one. Signed-off-by: Stephane Grosjean <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2017-04-25can: peak: fix usage of const qualifier in pointers argsStephane Grosjean1-8/+8
Fixes the usage of the const qualifier in the memory pointer arguments of the declared inline functions. By changing the line containing "const", this patch also changes the name of the arg into a more usual one. Signed-off-by: Stephane Grosjean <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2017-04-25can: peak: fix usage of usb specific data typeStephane Grosjean2-14/+14
This patch fixes the wrong usage of a specific USB data type into a common header file. This common header file is intended to define the common data types and values that define access to the PEAK-System CAN-FD IP, whatever the PC interface is. Signed-off-by: Stephane Grosjean <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2017-03-03can: usb_8dev: Fix memory leak of priv->cmd_msg_bufferMarc Kleine-Budde1-6/+3
The priv->cmd_msg_buffer is allocated in the probe function, but never kfree()ed. This patch converts the kzalloc() to resource-managed kzalloc. Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2017-03-03can: gs_usb: fix coding styleEthan Zonca1-6/+5
This patch fixes five minor style issues, spaces are between bitwise OR operators. Signed-off-by: Ethan Zonca <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2017-03-03can: gs_usb: Don't use stack memory for USB transfersEthan Zonca1-11/+29
Fixes: 05ca5270005c can: gs_usb: add ethtool set_phys_id callback to locate physical device The gs_usb driver is performing USB transfers using buffers allocated on the stack. This causes the driver to not function with vmapped stacks. Instead, allocate memory for the transfer buffers. Signed-off-by: Ethan Zonca <[email protected]> Cc: linux-stable <[email protected]> # >= v4.8 Signed-off-by: Marc Kleine-Budde <[email protected]>
2016-12-10Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-2/+4
2016-12-08can: peak: fix bad memory access and free sequence추지호1-2/+4
Fix for bad memory access while disconnecting. netdev is freed before private data free, and dev is accessed after freeing netdev. This makes a slub problem, and it raise kernel oops with slub debugger config. Signed-off-by: Jiho Chu <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2016-12-03Merge tag 'linux-can-next-for-4.10-20161201' of ↵David S. Miller1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2016-12-01 this is a pull request of 4 patches for net-next/master. There are two patches by Chris Paterson for the rcar_can and rcar_canfd device tree binding documentation. And a patch by Geert Uytterhoeven that corrects the order of interrupt specifiers. The fourth patch by Colin Ian King fixes a spelling error in the kvaser_usb driver. ==================== Signed-off-by: David S. Miller <[email protected]>
2016-12-01net: can: usb: kvaser_usb: fix spelling mistake of "outstanding"Colin Ian King1-2/+2
Trivial fix to spelling mistake "oustanding" to "outstanding" in comment and dev_dbg message. Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2016-12-01can: peak: Add support for PCAN-USB X6 USB interfaceStephane Grosjean3-0/+76
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 <[email protected]> Tested-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2016-12-01can: peak: Fix bittiming fields size in bitsStephane Grosjean2-24/+45
This fixes the bitimings fields ranges supported by all the CAN-FD USB interfaces of the PEAK-System CAN-FD adapters. Very first development versions of the IP core API defined smaller TSGEx and SJW fields for both nominal and data bittimings records than the production versions. This patch fixes them by enlarging their sizes to the actual values: field: old size: fixed size: nominal TSGEG1 6 8 nominal TSGEG2 4 7 nominal SJW 4 7 data TSGEG1 4 5 data TSGEG2 3 4 data SJW 2 4 Note that this has no other consequences than offering larger choice to bitrate encoding. Signed-off-by: Stephane Grosjean <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2016-08-13net: can: usb: usb_8dev: don't print error when allocating urb failsWolfram Sang1-4/+1
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-08-13net: can: usb: peak_usb: pcan_usb_core: don't print error when allocating ↵Wolfram Sang1-5/+1
urb fails kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-08-13net: can: usb: kvaser_usb: don't print error when allocating urb failsWolfram Sang1-6/+1
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-08-13net: can: usb: gs_usb: don't print error when allocating urb failsWolfram Sang1-7/+2
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-08-13net: can: usb: esd_usb2: don't print error when allocating urb failsWolfram Sang1-3/+0
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-08-13net: can: usb: ems_usb: don't print error when allocating urb failsWolfram Sang1-7/+2
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-06-30Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller3-5/+22
Several cases of overlapping changes, except the packet scheduler conflicts which deal with the addition of the free list parameter to qdisc_enqueue(). Signed-off-by: David S. Miller <[email protected]>
2016-06-23can: kvaser_usb: Add support for more Kvaser Leaf v2 devicesJimmy Assarsson2-1/+9
This patch adds support for Kvaser Leaf Light HS v2 OEM, Mini PCI Express 2xHS and USBcan Light 2xHS. Signed-off-by: Jimmy Assarsson <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2016-06-20can: gs_usb: Add Basic support for the bytewerk.org candleLight interfaceMaximilian Schneider2-4/+13
This patchs adds basic support for the bytewerk.org candleLight interface, a open hardware (CERN OHL) USB CAN adapter. Signed-off-by: Hubert Denkmair <[email protected]> Signed-off-by: Maximilian Schneider <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2016-06-17can: gs_usb: add ethtool set_phys_id callback to locate physical deviceMaximilian Schneider1-31/+85
This patch Implements the ethtool set_phys_id callback to ease the locating of specific physical devices. Currently only supported on candleLight interfaces. Signed-off-by: Hubert Denkmair <[email protected]> Signed-off-by: Maximilian Schneider <[email protected]> [mkl: split codingstyle change sinto separate patch] Signed-off-by: Marc Kleine-Budde <[email protected]>
2016-06-17can: gs_usb: codingstyle: introduce use of BIT() + fix indentionMaximilian Schneider1-11/+14
This patch converts "1 << n" by BIT(n) and fixes the indention. No functional change. Signed-off-by: Hubert Denkmair <[email protected]> Signed-off-by: Maximilian Schneider <[email protected]> [mkl: split codingstyle changes into separate patch] Signed-off-by: Marc Kleine-Budde <[email protected]>
2016-05-09can: gs_usb: modify the usb device table to use only the first usb interfaceMaximilian Schneider1-1/+2
Modified the USB device table to use only the first USB interface, as is the case with GS USB devices. This allows other GS USB compatible devices to be more flexible with their remaining interfaces. Signed-off-by: Maximilian Schneider <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2016-05-04treewide: replace dev->trans_start update with helperFlorian Westphal3-6/+6
Replace all trans_start updates with netif_trans_update helper. change was done via spatch: struct net_device *d; @@ - d->trans_start = jiffies + netif_trans_update(d) Compile tested only. Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Florian Westphal <[email protected]> Acked-by: Felipe Balbi <[email protected]> Acked-by: Mugunthan V N <[email protected]> Acked-by: Antonio Quartulli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-03-08Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-13/+11
Several cases of overlapping changes, as well as one instance (vxlan) of a bug fix in 'net' overlapping with code movement in 'net-next'. Signed-off-by: David S. Miller <[email protected]>
2016-02-26can: ems_usb: fix coding styleMarc Kleine-Budde1-5/+3
This patch fixes the coding style issues introduced in commit: 90cfde46586d can: ems_usb: Fix possible tx overflow Reported-by: Sergei Shtylyov <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2016-02-26can: gs_usb: fixed disconnect bug by removing erroneous use of kfree()Maximilain Schneider1-13/+11
gs_destroy_candev() erroneously calls kfree() on a struct gs_can *, which is allocated through alloc_candev() and should instead be freed using free_candev() alone. The inappropriate use of kfree() causes the kernel to hang when gs_destroy_candev() is called. Only the struct gs_usb * which is allocated through kzalloc() should be freed using kfree() when the device is disconnected. Signed-off-by: Maximilian Schneider <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2016-02-21can: ems_usb: Fix possible tx overflowGerhard Uttenthaler1-4/+10
This patch fixes the problem that more CAN messages could be sent to the interface as could be send on the CAN bus. This was more likely for slow baud rates. The sleeping _start_xmit was woken up in the _write_bulk_callback. Under heavy TX load this produced another bulk transfer without checking the free_slots variable and hence caused the overflow in the interface. Signed-off-by: Gerhard Uttenthaler <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-11-23can: remove obsolete assignment for CAN protocol error typeOliver Hartkopp3-3/+0
The assignment 'cf->data[2] |= CAN_ERR_PROT_UNSPEC' used at CAN error message creation time is obsolete as CAN_ERR_PROT_UNSPEC is zero and cf->data[2] is initialized with zero in alloc_can_err_skb() anyway. So we could either assign 'cf->data[2] = CAN_ERR_PROT_UNSPEC' correctly or we can remove the obsolete OR operation entirely. Signed-off-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-11-23can: fix assignment of error location in CAN error messagesOliver Hartkopp2-5/+3
As Dan Carpenter reported in http://marc.info/?l=linux-can&m=144793696016187 the assignment of the error location in CAN error messages had some bit wise overlaps. Indeed the value to be assigned in data[3] is no bitfield but defines a single value which points to a location inside the CAN frame on the wire. This patch fixes the assignments for the error locations in error messages. Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-08-27Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller5-70/+82
2015-08-25can: pcan_usb: don't provide CAN FD bittimings by non-FD adaptersMarc Kleine-Budde5-70/+82
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 <[email protected]> # >= 4.0 Reported-by: Oliver Hartkopp <[email protected]> Tested-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-08-20can: gs_usb: Fix typo in function nameNik Nyby1-4/+4
This fixes typos in gs_usb.c where 'receive' is misspelled as 'recieve'. Signed-off-by: Nik Nyby <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-07-15can: pcan_usb: don't touch skb after netif_rx()Marc Kleine-Budde2-6/+5
There is no guarantee that the skb is in the same state after calling net_receive_skb() or netif_rx(). It might be freed or reused. Not really harmful as its a read access, except you turn on the proper debugging options which catch a use after free. Cc: Stephane Grosjean <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-07-15can: usb_8dev: don't touch skb after netif_rx()Marc Kleine-Budde1-4/+2
There is no guarantee that the skb is in the same state after calling net_receive_skb() or netif_rx(). It might be freed or reused. Not really harmful as its a read access, except you turn on the proper debugging options which catch a use after free. Cc: Bernd Krumboeck <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-07-15can: ems_usb: don't touch skb after netif_rx()Marc Kleine-Budde1-4/+2
There is no guarantee that the skb is in the same state after calling net_receive_skb() or netif_rx(). It might be freed or reused. Not really harmful as its a read access, except you turn on the proper debugging options which catch a use after free. Cc: Gerhard Uttenthaler <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-07-15can: esd_usb2: don't touch skb after netif_rx()Marc Kleine-Budde1-4/+2
There is no guarantee that the skb is in the same state after calling net_receive_skb() or netif_rx(). It might be freed or reused. Not really harmful as its a read access, except you turn on the proper debugging options which catch a use after free. Cc: Thomas Körper <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-04-27net:treewide: Fix typo in drivers/netMasanari Iida1-1/+1
This patch fix spelling typo in printk. Signed-off-by: Masanari Iida <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-04-02Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller4-57/+102
Conflicts: drivers/net/usb/asix_common.c drivers/net/usb/sr9800.c drivers/net/usb/usbnet.c include/linux/usb/usbnet.h net/ipv4/tcp_ipv4.c net/ipv6/tcp_ipv6.c The TCP conflicts were overlapping changes. In 'net' we added a READ_ONCE() to the socket cached RX route read, whilst in 'net-next' Eric Dumazet touched the surrounding code dealing with how mini sockets are handled. With USB, it's a case of the same bug fix first going into net-next and then I cherry picked it back into net. Signed-off-by: David S. Miller <[email protected]>
2015-04-01can: pcan_usb: pcan_usb_fd_send_cmd(): silence compiler warning about ↵Marc Kleine-Budde1-1/+1
uninitialized var This patch silences the compiler warning: drivers/net/can/usb/peak_usb/pcan_usb_fd.c: In function 'pcan_usb_fd_send_cmd': drivers/net/can/usb/peak_usb/pcan_usb_fd.c:185:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized] by initialising the variable as 0. Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-04-01can: ems_usb: mark timestamp as little endianMarc Kleine-Budde1-2/+2
The struct ems_cpc_msg describes the a message received from the USB device, which uses little endian byte order. This patch marks the timestamp in struct ems_cpc_msg accordingly. Acked-by: Gerhard Uttenthaler <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-04-01can: ems_usb: fix endianess of CAN IDGerhard Uttenthaler1-5/+2
The device expects the CAN ID in little endian format. Signed-off-by: Gerhard Uttenthaler <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-03-22can: esd_usb2: Fix sparse warningsThomas Körper1-2/+2
The hnd field of the structs does not need to be __le32: the device just returns the value without using it itself. Signed-off-by: Thomas Körper <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-03-22can: kvaser_usb: Use can-dev unregistration mechanismAhmed S. Darwish1-1/+1
Use can-dev's unregister_candev() instead of directly calling networking unregister_netdev(). While both are functionally equivalent, unregister_candev() might do extra stuff in the future than just calling networking layer unregistration code. Signed-off-by: Ahmed S. Darwish <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-03-22can: peak_usb_fd: add support for ISO / non-ISO mode switchingStephane Grosjean2-2/+30
The PCAN USB (pro) FD adapters with firmware versions > 2.x support the switching between ISO (default) and non-ISO conform bitstreams on the CAN bus. The setting for the 2.x firmware adapters can be modified with the 'ip' tool from the iproute2 package (option: fd-non-iso [on|off]). Signed-off-by: Stephane Grosjean <[email protected]> Signed-off-by: Oliver Hartkopp <[email protected]> Tested-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-03-22can: peak_usb: rename usb option cmds definition and structsStephane Grosjean2-28/+28
The PUCAN_CMD_RX_FRAME_(ENABLE|DISABLE) command has extended its purpose and was therefore renamed to PUCAN_CMD_SET_(EN|DIS)_OPTION. Signed-off-by: Stephane Grosjean <[email protected]> Signed-off-by: Oliver Hartkopp <[email protected]> Tested-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-03-22can: gs_usb: check for kzalloc allocation failureColin Ian King1-0/+2
smatch detected the following issue: drivers/net/can/usb/gs_usb.c:904 gs_usb_probe() error: potential null dereference 'dev'. (kzalloc returns null) Add a check for null return from kzalloc and return -ENOMEM Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2015-03-22can: kvaser_usb: Fix sparse warning __le16 degrades to integerAhmed S. Darwish1-3/+4
USB endpoint's wMaxPacketSize field is an le16 entity. Use appropriate le16_to_cpu macros to maintain endian independence. Reported-by: Marc Kleine-Budde <[email protected]> Signed-off-by: Ahmed S. Darwish <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>