aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can/pch_can.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
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-04-16net/can: use module_pci_driverAxel Lin1-11/+1
This patch converts the drivers in drivers/net/can/* to use module_pci_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Wolfgang Grandegger <wg@grandegger.com> Cc: Marc Kleine-Budde <mkl@pengutronix.de> Cc: "David S. Miller" <davem@davemloft.net> Cc: linux-can@vger.kernel.org Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-02-04Merge branch 'master' of git://gitorious.org/linux-can/linux-can-nextDavid S. Miller1-1/+1
Conflicts: drivers/net/can/usb/ems_usb.c Minor dev_warn --> netdev_warn conversion conflicts.
2012-02-03can: pch_can: Change company name OKI SEMICONDUCTOR to LAPIS SemiconductorTomoya MORINAGA1-1/+1
On October 1 in 2011, OKI SEMICONDUCTOR Co., Ltd. changed the company name in to LAPIS Semiconductor Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-02-03can: pch_can: fix error passive level testXi Wang1-1/+2
The test (((errc & PCH_REC) >> 8) > 127) would always be false because the receive error counter ((errc & PCH_REC) >> 8) is at most 127, where PCH_REC is defined as 0x7f00. To test whether the receive error counter has reached the error passive level, the RP bit (15) should be used. Signed-off-by: Xi Wang <xi.wang@gmail.com> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2011-05-10treewide: fix a few typos in commentsJustin P. Mattock1-1/+1
- kenrel -> kernel - whetehr -> whether - ttt -> tt - sss -> ss Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-02-09pch_can: fix tseg1/tseg2 setting issueTomoya MORINAGA1-2/+2
Previous patch "[PATCH 1/3] pch_can: fix 800k comms issue" is wrong. I should have modified tseg1_min not tseg2_min. This patch reverts tseg2_min to 1 and set tseg1_min to 2. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-02-08pch_can: fix module reload issue with MSITomoya1-0/+1
Currently, in case reload pch_can, pch_can not to be able to catch interrupt. The cause is bus-master is not set in pch_can. Thus, add enabling bus-master processing. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-02-08pch_can: fix rmmod issueTomoya1-1/+1
Currently, when rmmod pch_can, kernel failure occurs. The cause is pci_iounmap executed before pch_can_reset. Thus pci_iounmap moves after pch_can_reset. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-02-08pch_can: fix 800k comms issueTomoya1-1/+1
Currently, 800k comms fails since prop_seg set zero. (EG20T PCH CAN register of prop_seg must be set more than 1) To prevent prop_seg set to zero, change tseg2_min 1 to 2. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-22pch_can: Fix array miss-pointing issueTomoya1-6/+8
Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-13pch_can: Replace netif_rx to netif_receive_skbTomoya1-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>
2010-12-13pch_can: Add setting TEC/REC statistics processingTomoya1-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>
2010-12-13pch_can: Optimize "if" condition in rx/tx processingTomoya1-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>
2010-12-13pch_can: Fix incorrect return processingTomoya1-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>
2010-12-13pch_can: Move MSI processing to probe/remove processingTomoya1-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>
2010-12-13pch_can: Comment optimizationTomoya1-7/+7
Comment optimization Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-13pch_can: Fix miss-setting status issueTomoya1-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>
2010-12-13pch_can: Fix bit timing calculation issueTomoya1-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>
2010-12-13pch_can: Delete unnecessary/redundant codeTomoya1-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>
2010-12-13pch_can: Fix coding rule violationTomoya1-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>
2010-12-13pch_can: Replace netdev_dbg instead of dev_dbg partlyTomoya1-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>
2010-12-13pch_can: Change Copyright and module descriptionTomoya1-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>
2010-12-13pch_can: Reduce register accessTomoya1-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>
2010-12-13pch_can: Change functions typeTomoya1-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>
2010-12-13pch_can: Rename function/macro nameTomoya1-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>
2010-12-13pch_can: Fix warningsTomoya1-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>
2010-12-13pch_can: Improve rx processingTomoya1-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>
2010-12-13pch_can: Fix endianness issueTomoya1-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>
2010-12-13pch_can: Divide poll functionTomoya1-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>
2010-12-13pch_can: Add flow control processingTomoya1-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>
2010-12-02can: EG20T PCH: Delete unnecessary spin_lockTomoya1-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>
2010-12-02can: EG20T PCH: Enumerate LEC macrosTomoya1-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>
2010-12-02can: EG20T PCH: Change Message Object IndexTomoya1-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>
2010-12-02can: EG20T PCH: Separate Interface Register(IF1/IF2)Tomoya1-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>
2010-11-18can: EG20T PCH: use BIT(X)Tomoya1-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>
2010-11-18can: EG20T PCH: add prefix to macroTomoya1-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>
2010-10-30can: pch_can: fix section mismatch warning by using a whitelisted nameMarc Kleine-Budde1-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>
2010-10-30can: pch_can: fix sparse warningMarc Kleine-Budde1-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>
2010-10-24can: Topcliff: Add PCH_CAN driver.Masayuki Ohtake1-0/+1463
CAN driver of Topcliff PCH Topcliff PCH is the platform controller hub that is going to be used in Intel's upcoming general embedded platform. All IO peripherals in Topcliff PCH are actually devices sitting on AMBA bus. Topcliff PCH has CAN I/F. This driver enables CAN function. Signed-off-by: Masayuki Ohtake <masa-korg@dsn.okisemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>