aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/can/usb/gs_usb.c
AgeCommit message (Collapse)AuthorFilesLines
2020-09-21can: drivers: fix spelling mistakesMarc Kleine-Budde1-2/+2
This patch fixes spelling erros found by "codespell" in the drivers/net/can subtree. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-01-02can: gs_usb: gs_usb_probe(): use descriptors of current altsettingJohan Hovold1-2/+2
Make sure to always use the descriptors of the current alternate setting to avoid future issues when accessing fields that may differ between settings. Signed-off-by: Johan Hovold <[email protected]> Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: gs_usb: gs_can_open(): prevent memory leakNavid Emamdoost1-0/+1
In gs_can_open() if usb_submit_urb() fails the allocated urb should be released. Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Cc: linux-stable <[email protected]> Signed-off-by: Navid Emamdoost <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Reviewed-by: Alexios Zavras <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-15Merge tag 'linux-can-next-for-4.16-20180105' of ↵David S. Miller1-2/+2
ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2017-12-01,Re: pull-request: can-next this is a pull request of 7 patches for net-next/master. All patches are by me. Patch 6 is for the "can_raw" protocol and add error checking to the bind() function. All other patches clean up the coding style and remove unused parameters in various CAN drivers and infrastructure. ==================== Signed-off-by: David S. Miller <[email protected]>
2018-01-05can: gs_usb: gs_cmd_reset(): remove unused parameter "struct gs_usb *gsusb"Marc Kleine-Budde1-2/+2
The 2nd parameter of gs_cmd_reset() "struct gs_usb *gsusb" is unused, so remove it. Suggested-by: Oleksij Rempel <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2018-01-04can: gs_usb: fix return value of the "set_bittiming" callbackWolfgang Grandegger1-1/+1
The "set_bittiming" callback treats a positive return value as error! For that reason "can_changelink()" will quit silently after setting the bittiming values without processing ctrlmode, restart-ms, etc. Signed-off-by: Wolfgang Grandegger <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2017-10-19can: gs_usb: fix busy loop if no more TX context is availableWolfgang Grandegger1-8/+2
If sending messages with no cable connected, it quickly happens that there is no more TX context available. Then "gs_can_start_xmit()" returns with "NETDEV_TX_BUSY" and the upper layer does retry immediately keeping the CPU busy. To fix that issue, I moved "atomic_dec(&dev->active_tx_urbs)" from "gs_usb_xmit_callback()" to the TX done handling in "gs_usb_receive_bulk_callback()". Renaming "active_tx_urbs" to "active_tx_contexts" and moving it into "gs_[alloc|free]_tx_context()" would also make sense. Signed-off-by: Wolfgang Grandegger <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2017-06-09can: gs_usb: fix memory leak in gs_cmd_reset()Marc Kleine-Budde1-0/+2
This patch adds the missing kfree() in gs_cmd_reset() to free the memory that is not used anymore after usb_control_msg(). Cc: linux-stable <[email protected]> Cc: Maximilian Schneider <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2017-04-25net: can: usb: gs_usb: Fix buffer on stackMaksim Salau1-5/+12
Allocate buffers on HEAP instead of STACK for local structures that are to be sent using usb_control_msg(). Signed-off-by: Maksim Salau <[email protected]> Cc: linux-stable <[email protected]> # >= v4.8 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-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-06-30Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-3/+11
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-20can: gs_usb: Add Basic support for the bytewerk.org candleLight interfaceMaximilian Schneider1-3/+11
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-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]>
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-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]>
2014-11-18can: gs_usb: add .ndo_change_mtu functionMarc Kleine-Budde1-0/+1
Use common can_change_mtu function. Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-05-21can: gs_usb: gs_destroy_candev(): fix use after freeMarc Kleine-Budde1-1/+1
This patch fixes a use after free of "dev" in gs_destroy_candev(). Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-05-19can: gs_usb: Added support for the GS_USB CAN devicesMaximilian Schneider1-0/+971
The Geschwister Schneider Family of devices are galvanically isolated USB2.0 to CAN2.0A/B adapters. Currently two form factors are available, a tethered dongle in a rugged enclosure, and mini-pci-e card. Signed-off-by: Maximilian Schneider <[email protected]> Acked-by: Wolfgang Grandegger <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>