summaryrefslogtreecommitdiffstats
path: root/drivers/net/can
Commit message (Collapse)AuthorAgeFilesLines
* pch_can: Fix array miss-pointing issueTomoya2010-12-221-6/+8
| | | | | Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net/*/: Use static constJoe Perches2010-12-211-1/+1
| | | | | | | Using static const generally increases object text and decreases data size. It also generally decreases overall object size. Signed-off-by: Joe Perches <joe@perches.com>
* pch_can: Replace netif_rx to netif_receive_skbTomoya2010-12-131-1/+1
| | | | | | | | | Since this driver is implemented as NAPI, netif_receive_skb must be used not netif_rx. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Add setting TEC/REC statistics processingTomoya2010-12-131-0/+3
| | | | | | | Add setting TEC/REC statistics processing. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Optimize "if" condition in rx/tx processingTomoya2010-12-131-16/+10
| | | | | | | | | For reduce "if" condition, easy to read/understand the code, optimize "if" condition in rx/tx processing. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Fix incorrect return processingTomoya2010-12-131-9/+10
| | | | | | | Fix incorrect return processing. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Move MSI processing to probe/remove processingTomoya2010-12-131-15/+14
| | | | | | | | | Currently, in case this driver is integrated as module, and when this module is re-installed, no interrupts is to be occurred. For the above issue, move MSI processing to open/release processing. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Comment optimizationTomoya2010-12-131-7/+7
| | | | | | | Comment optimization Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Fix miss-setting status issueTomoya2010-12-131-1/+1
| | | | | | | Modify miss-setting status issue at suspend. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Fix bit timing calculation issueTomoya2010-12-131-4/+2
| | | | | | | | Modify like use calculated value directly passed by CAN core module. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Delete unnecessary/redundant codeTomoya2010-12-131-12/+1
| | | | | | | Delete unnecessary/redundant code Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Fix coding rule violationTomoya2010-12-131-24/+21
| | | | | | | | Fix coding rule violation. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Replace netdev_dbg instead of dev_dbg partlyTomoya2010-12-131-8/+8
| | | | | | | For easy to readable, use netdev_dbg instead of dev_dbg partly Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Change Copyright and module descriptionTomoya2010-12-131-2/+2
| | | | | | | Currently, Copyright and module description are not formal. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Reduce register accessTomoya2010-12-131-34/+21
| | | | | | | For improve tx/rx speed, reduce register access. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Change functions typeTomoya2010-12-131-8/+10
| | | | | | | | Currently, these two functions spec(returned value) is unnatural. Thus, change the return value's spec Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Rename function/macro nameTomoya2010-12-131-99/+77
| | | | | | | For easy to read/understand, Rename function/macro name. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Fix warningsTomoya2010-12-131-73/+73
| | | | | | | | | Currently, in case CONFIG_PM is disabled, compiler outputs warnings. Move six functions which are used only CONFIG_PM is enabled, into "#ifdef CONFIG_PM" area. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Improve rx processingTomoya2010-12-131-76/+82
| | | | | | | | Replace complex "goto" to "do~while". For easy to read/understand, it divides a rx function into some functions. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Fix endianness issueTomoya2010-12-131-27/+20
| | | | | | | | | | | | | | | | | | | | | | there is endianness issue both Tx and Rx. Currently, data is set like below. Register: MSB--LSB x x D0 D1 x x D2 D3 x x D4 D5 x x D6 D7 But Data to be sent must be set like below. Register: MSB--LSB x x D1 D0 x x D3 D2 x x D5 D4 x x D7 D6 (x means reserved area.) Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Divide poll functionTomoya2010-12-131-36/+35
| | | | | | | To easy to read/understand, divide poll function into two sub-functions. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: Add flow control processingTomoya2010-12-131-19/+12
| | | | | | | | | | | Currently, there is no flow control processing. Thus, Add flow control processing as when there is no empty of tx buffer, netif_stop_queue is called. When there is empty buffer, netif_wake_queue is called. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net: remove unnecessary flush_scheduled_work() callsTejun Heo2010-12-121-9/+0
| | | | | | | | | | | | | | | | janz-ican3, sh_eth, skge and vxge don't use workqueue at all and there is no reason to flush the system_wq. Drop flush_scheduled_work() calls and references to workqueue. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Wolfgang Grandegger <wg@grandegger.com> Cc: Stephen Hemminger <shemminger@linux-foundation.org> Cc: Ramkrishna Vepa <ramkrishna.vepa@exar.com> Cc: Sivakumar Subramani <sivakumar.subramani@exar.com> Cc: Sreenivasa Honnur <sreenivasa.honnur@exar.com> Cc: Jon Mason <jon.mason@exar.com> Cc: netdev@vger.kernel.org
* can: slcan: Add missing linux/sched.h include.David S. Miller2010-12-081-0/+1
| | | | | | | | drivers/net/can/slcan.c: In function 'slcan_open': drivers/net/can/slcan.c:568: error: dereferencing pointer to incomplete type Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: add slcan driver for serial/USB-serial CAN adaptersOliver Hartkopp2010-12-083-0/+777
| | | | | | | | | | | | | | This patch adds support for serial/USB-serial CAN adapters implementing the LAWICEL ASCII protocol for CAN frame transport over serial lines. The driver implements the SLCAN line discipline and is heavily based on the slip.c driver. Therefore the code style remains similar to slip.c to be able to apply changes of the SLIP driver to the SLCAN driver easily. For more details see the slcan Kconfig entry. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: EG20T PCH: Delete unnecessary spin_lockTomoya2010-12-021-34/+0
| | | | | | | | | | Delete unnecessary spin_lock for accessing Message Object. Since all message objects are divided into tx/rx area completely, spin_lock processing is unnecessary. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: EG20T PCH: Enumerate LEC macrosTomoya2010-12-021-36/+41
| | | | | | | For easy to readable, LEC #define macros are replaced to enums. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: EG20T PCH: Change Message Object IndexTomoya2010-12-021-147/+116
| | | | | | | | | | | For easy to readable, add Message Object index like below. PCH_RX_OBJ_START PCH_RX_OBJ_END PCH_TX_OBJ_START PCH_TX_OBJ_END Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: EG20T PCH: Separate Interface Register(IF1/IF2)Tomoya2010-12-021-244/+201
| | | | | | | | | | CAN register of Intel PCH EG20T has 2 sets of interface register. To reduce whole of code size, separate interface register. As a result, the number of function also can be reduced. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: EG20T PCH: use BIT(X)Tomoya2010-11-181-36/+37
| | | | | | | | | Replace bit assignment value to BIT(X). For easy to readable/identifiable, replace all bit assigned macros to BIT(X) Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: EG20T PCH: add prefix to macroTomoya2010-11-181-202/+189
| | | | | | | | For easy to readable/identifiable, add prefix "PCH_" to all of #define macros. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net/can/sja1000: Use printf extension %pR for struct resourceJoe Perches2010-11-171-6/+2
| | | | | | | Using %pR standardizes the struct resource output. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net/can: Update WARN usesJoe Perches2010-11-091-1/+1
| | | | | | | Add missing newlines. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: can: Change mail address of Hans J. KochHans J. Koch2010-10-301-1/+1
| | | | | | | | My old mail address doesn't exist anymore. This changes all occurrences to my new address. Signed-off-by: Hans J. Koch <hjk@hansjkoch.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: pch_can: fix section mismatch warning by using a whitelisted nameMarc Kleine-Budde2010-10-301-3/+3
| | | | | | | | | | | | | | | | | | This patch fixes the following section mismatch warning: WARNING: drivers/net/can/pch_can.o(.data+0x18): Section mismatch in reference from the variable pch_can_pcidev to the variable .devinit.rodata:pch_pci_tbl The variable pch_can_pcidev references the variable __devinitconst pch_pci_tbl This is actually a false positive which is fixed by giving the offending variable a whitelisted name, it's renamed to "pch_can_pci_driver". This makes sense because the variable is of the type "struct pci_driver". Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: pch_can: fix sparse warningMarc Kleine-Budde2010-10-301-2/+2
| | | | | | | | | | | | | This patch fixes the following sparse warning: drivers/net/can/pch_can.c:231:26: warning: incorrect type in argument 1 (different address spaces) drivers/net/can/pch_can.c:231:26: expected unsigned int [usertype] *addr drivers/net/can/pch_can.c:231:26: got unsigned int [noderef] <asn:2>*<noident> Let pch_can_bit_{set,clear} first parameter be a void __iomem pointer. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: mcp251x: fix reception of standard RTR framesMarc Kleine-Budde2010-10-261-0/+3
| | | | | | | | | This patch sets the missing CAN_RTR_FLAG if a standard RTR frame is received. (For extended frames the CAN_RTR_FLAG was already set correctly.) Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: flexcan: fix use after free of privMarc Kleine-Budde2010-10-261-1/+2
| | | | | | | | The priv is part of the memory allocated by alloc_candev(). This patch moved the free it after last usage of priv. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* pch_can: depends on PCIRandy Dunlap2010-10-251-1/+1
| | | | | | | | | | | Fix pch_can build when CONFIG_PCI is not enabled. It uses pci interfaces and data structures, so it should depend on PCI. drivers/net/can/pch_can.c:1044: error: implicit declaration of function 'pci_enable_msi' drivers/net/can/pch_can.c:1079: error: implicit declaration of function 'pci_disable_msi' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: tscan1: add driver for TS-CAN1 boardsAndre B. Oliveira2010-10-243-0/+229
| | | | | | | | | Add driver for Technologic Systems TS-CAN1 PC104 peripheral boards. Signed-off-by: Andre B. Oliveira <anbadeol@gmail.com> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: at91_can: add KBUILD_MODNAME to bittiming constantMarc Kleine-Budde2010-10-241-3/+3
| | | | | | | While there replace all usage of self defined DRV_NAME by KBUILD_MODNAME. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: at91_can: convert dev_<level> printing to netdev_<level>Marc Kleine-Budde2010-10-241-19/+16
| | | | | | | While there, remove "printk()" on driver loading. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: at91_can: convert readl, writel their __raw pendantsMarc Kleine-Budde2010-10-241-2/+2
| | | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: at91_can: set bittiming in chip_startMarc Kleine-Budde2010-10-241-1/+1
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: at91_can: implement and use at91_get_berr_counterMarc Kleine-Budde2010-10-241-7/+18
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: at91_can: fix section mismatch warningMarc Kleine-Budde2010-10-241-1/+1
| | | | | | | | | ...by adding the correct annotation "__devinit" to the driver's probe function. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: at91_can: fix compiler warning in at91_irq_err_stateMarc Kleine-Budde2010-10-241-1/+1
| | | | | | | | | | | This patch fixes the following compiler warning: drivers/net/can/at91_can.c: In function 'at91_irq_err_state': drivers/net/can/at91_can.c:779: warning: 'reg_ier' may be used uninitialized in this function drivers/net/can/at91_can.c:779: warning: 'reg_idr' may be used uninitialized in this function Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: at91_can: fix use after free of privMarc Kleine-Budde2010-10-241-3/+3
| | | | | | | | | | | | The priv is part of the memory allocated by alloc_candev(). This patch moved the free it after last usage of priv. While there convert all free_netdev() to free_candev() (which is currently just a wrapper around free_netdev()) to be symetrically with the allocation via alloc_candev(). Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: at91_can: fix reception of extended framesMarc Kleine-Budde2010-10-241-0/+9
| | | | | | | | | | | | | | The AT91_MID_MIDE bit must be set in order to receive extended frames. The reception of an extended frame sets this bit, while reception of standard frames resets it. This results in some lost extended frames in an extended ID only environment. But leads to unpredictable lost extended ID frames in a mixed environment. The problem is fixed by setting the AT91_MID_MIDE after reception of a CAN frame. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* can: at91_can: use correct bit to enable CAN_CTRLMODE_3_SAMPLESMarc Kleine-Budde2010-10-241-3/+3
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
OpenPOWER on IntegriCloud