summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/usb/esd_usb2.c
Commit message (Collapse)AuthorAgeFilesLines
* can: remove unused variableSudip Mukherjee2014-11-181-2/+0Star
| | | | | | | | | these variable were only assigned some values, but then never reused again. so they are safe to be removed. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: esd_usb2: fix memory leak on disconnectAlexey Khoroshilov2014-11-181-0/+1
| | | | | | | | | | | | It seems struct esd_usb2 dev is not deallocated on disconnect. The patch adds the missing deallocation. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Matthias Fuchs <matthias.fuchs@esd.eu> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: populate netdev::dev_id for udev discriminationChristopher R. Baker2014-03-171-0/+1
| | | | | | | | | | | | | | | My objective is to be able to totally discriminate CAN ports on multi-port cards via udev so as to rename them to semantically interesting/unique names for my system (e.g., "ecuCAN" and "auxCAN" instead of "can0" and "can1"). The following patch assigns the dev_id field to match the channel number on all multi-channel devices. I can only test my two-port Peak PCI card, but it works as expected: ATTRS{dev_id} now expresses the port number and my udev rules now unambiguously pick out and rename my individual CAN ports. Signed-off-by: Christopher R. Baker <cbaker@rec.ri.cmu.edu> Tested-by: Oliver Hartkopp <socketcan@hartkopp.net> [PEAK PCAN-USB pro and EMS PCMCIA] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: Unify MTU settings for CAN interfacesOliver Hartkopp2014-03-171-0/+1
| | | | | | | | | | | | | CAN interfaces only support MTU values of 16 (CAN 2.0) and 72 (CAN FD). Setting the MTU to other values is pointless but it does not really hurt. With the introduction of the CAN FD support in drivers/net/can a new function to switch the MTU for CAN FD has been introduced. This patch makes use of this can_change_mtu() function to check for correct MTU settings also in legacy CAN (2.0) devices. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* drivers/net: delete non-required instances of include <linux/init.h>Paul Gortmaker2014-01-161-1/+0Star
| | | | | | | | | | | | | None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. This covers everything under drivers/net except for wireless, which has been submitted separately. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: can: esd_usb2: check index of array before accessingMaximilian Schneider2013-07-191-0/+10
| | | | | | | | | | The esd_usb2_read_bulk_callback() function is parsing the data that comes from the USB CAN adapter. One datum is used as an index to access the dev->nets[] array. This patch adds the missing bounds checking. Acked-by: Matthias Fuchs <matthias.fuchs@esd.eu> Signed-off-by: Maximilian Schneider <max@schneidersoft.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* net: can: esd_usb2: Do not do dma on the stackOlivier Sobrie2013-06-031-51/+76
| | | | | | | | | | | | | | | | smatch reports the following warnings: drivers/net/can/usb/esd_usb2.c:640 esd_usb2_start() error: doing dma on the stack (&msg) drivers/net/can/usb/esd_usb2.c:846 esd_usb2_close() error: doing dma on the stack (&msg) drivers/net/can/usb/esd_usb2.c:855 esd_usb2_close() error: doing dma on the stack (&msg) drivers/net/can/usb/esd_usb2.c:923 esd_usb2_set_bittiming() error: doing dma on the stack (&msg) drivers/net/can/usb/esd_usb2.c:1047 esd_usb2_probe() error: doing dma on the stack (&msg) drivers/net/can/usb/esd_usb2.c:1053 esd_usb2_probe() error: doing dma on the stack (&msg) See "Documentation/DMA-API-HOWTO.txt" section "What memory is DMA'able?" Signed-off-by: Olivier Sobrie <olivier@sobrie.be> Cc: Matthias Fuchs <matthias.fuchs@esd.eu> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: esd_usb2: remove obsolete variable open_timeMarc Kleine-Budde2012-11-291-10/+0Star
| | | | | | | | The variable open_time in the struct esd_usb2_net_priv was used to protect esd_usb2_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>
* can: usb: esd_usb2: Add support for CAN-USB/MicroMatthias Fuchs2012-11-151-6/+25
| | | | | | | | This patch extends the esd_usb2 driver to support the tiny CAN-USB/Micro CAN/USB interface. Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: usb: esd_usb2: Add support for listen-only modeMatthias Fuchs2012-11-151-0/+4
| | | | | | | Add listen-only mode for esd_usb2 driver. Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: mark bittiming_const pointer in struct can_priv as constMarc Kleine-Budde2012-07-201-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>
* can: replace the dev_dbg/info/err/... with the new netdev_xxx macrosWolfgang Grandegger2012-02-031-15/+12Star
| | | | | | | | | | | | Cc: uclinux-dist-devel@blackfin.uclinux.org Cc: Anant Gole <anantgole@ti.com> Cc: Chris Elston <celston@katalix.com> Cc: Sebastian Haas <haas@ems-wuensche.com> Cc: Matthias Fuchs <matthias.fuchs@esd.eu> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Acked-by: Sebastian Haas <dev@sebastianhaas.info> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* USB: convert drivers/net/* to use module_usb_driver()Greg Kroah-Hartman2011-11-181-22/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts the drivers in drivers/net/* to use the module_usb_driver() macro which makes the code smaller and a bit simpler. Added bonus is that it removes some unneeded kernel log messages about drivers loading and/or unloading. Cc: Wolfgang Grandegger <wg@grandegger.com> Cc: Samuel Ortiz <samuel@sortiz.org> Cc: Oliver Neukum <oliver@neukum.name> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Petko Manolov <petkan@users.sourceforge.net> Cc: Steve Glendinning <steve.glendinning@smsc.com> Cc: Christian Lamparter <chunkeey@googlemail.com> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: Dan Williams <dcbw@redhat.com> Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Cc: Ivo van Doorn <IvDoorn@gmail.com> Cc: Gertjan van Wingerde <gwingerde@gmail.com> Cc: Helmut Schaa <helmut.schaa@googlemail.com> Cc: Herton Ronaldo Krzesinski <herton@canonical.com> Cc: Hin-Tak Leung <htl10@users.sourceforge.net> Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Chaoming Li <chaoming_li@realsil.com.cn> Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi> Cc: "David S. Miller" <davem@davemloft.net> Cc: Roel Kluin <roel.kluin@gmail.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Jiri Pirko <jpirko@redhat.com> Cc: Pavel Roskin <proski@gnu.org> Cc: Yoann DI-RUZZA <y.diruzza@lim.eu> Cc: George <george0505@realtek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Fix common misspellingsLucas De Marchi2011-03-311-1/+1
| | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* can: wrong index used in inner looproel kluin2011-03-141-3/+3
| | | | | | | Index i was already used in the outer loop. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: Add driver for esd CAN-USB/2 deviceMatthias Fuchs2010-08-041-0/+1132
This patch adds a driver for esd's USB high speed CAN interface. The driver supports devices with multiple CAN interfaces. Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David S. Miller <davem@davemloft.net>