History log of /drivers/net/can/pch_can.c
Revision Date Author Comments
74b5127884d76ccbf4f445f650f9e969ccb4a374 27-Jan-2012 Tomoya MORINAGA <tomoya.rohm@gmail.com> can: pch_can: Change company name OKI SEMICONDUCTOR to LAPIS Semiconductor

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>
44b0052c5cb4e75389ed3eb9e98c29295a7dadfb 12-Dec-2011 Xi Wang <xi.wang@gmail.com> can: pch_can: fix error passive level test

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>
70f23fd66bc821a0e99647f70a809e277cc93c4c 10-May-2011 Justin P. Mattock <justinmattock@gmail.com> treewide: fix a few typos in comments

- 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>
ebc02e9c524e9ff377dd8a3820522d381adf19c8 10-Feb-2011 Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> pch_can: fix tseg1/tseg2 setting issue

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>
c69b90920a36b88ab0d649963d81355d865eeb05 08-Feb-2011 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: fix module reload issue with MSI

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>
ce9736d4fb48beed370e22ac156779746dda7b92 08-Feb-2011 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: fix rmmod issue

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>
eab743ede8c4a5e88533d022e9c5374ed08df4cb 08-Feb-2011 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: fix 800k comms issue

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>
f622691c91cd1bb27d03a5caa8a43822572c62bc 22-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Fix array miss-pointing issue

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
cfb7e5f187e787bb1430decea339fdea6a669f92 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Replace netif_rx to netif_receive_skb

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>
0c78ab76a05cd788af0383354ffe819e0617f6a0 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Add setting TEC/REC statistics processing

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>
fea9294c5f2902c45613681ad995ca27899d2016 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Optimize "if" condition in rx/tx processing

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>
3332bc5446e034566e8a56bf7a7cd479ca35bd6d 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Fix incorrect return processing

Fix incorrect return processing.

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
a6f6d6b51b110e661ae5f862d60c27da4970bec6 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Move MSI processing to probe/remove processing

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>
c755145649fa73bd197ac1a73d141047c61b543a 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Comment optimization

Comment optimization

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
d06848be64e13d5d1d73e581fb185e815893d8b7 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Fix miss-setting status issue

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>
0e0805c4063d0611e282bb7fdebe2e223bfe7220 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Fix bit timing calculation issue

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>
8714fcaca63203fe10331fe530ff48d3dd31de4e 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Delete unnecessary/redundant code

Delete unnecessary/redundant code

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9388b166a323f8f7e35eb7a0d17b297ca695fa91 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Fix coding rule violation

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>
435b4efe93d4cec3aa0b36e8707df8d292d3641b 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Replace netdev_dbg instead of dev_dbg partly

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>
e91530ea959295a31911488c62088d5c372032ea 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Change Copyright and module description

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>
44c9aa890a2587f48920485b7487bc6d516dbbdf 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Reduce register access

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>
ca2b004e89484e89b1815157fae2d7f933c5af9e 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Change functions type

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>
bd58cbc322e97550af5e12584324b7117180435d 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Rename function/macro name

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>
7f2bc50efeaeb1dff62ef7e128ae36499fbcf35d 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Fix warnings

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>
1d5b4b2778e8e40f42ae5d9556777583f3556d81 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Improve rx processing

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>
8ac9702b9d5d81b819fc7d6b4f6abad22af01f3c 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Fix endianness issue

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>
e489ccebf14657774fd877dc841b458703730586 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Divide poll function

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>
76d94b232940ca91e9b26c590cb7312ab88ff722 12-Dec-2010 Tomoya <tomoya-linux@dsn.okisemi.com> pch_can: Add flow control processing

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>
2989042ca86b94bf4ffa9486921bb300ad44225f 29-Nov-2010 Tomoya <tomoya-linux@dsn.okisemi.com> can: EG20T PCH: Delete unnecessary spin_lock

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>
d68f6837c4972b0433e41f8bee4b2b8205610f31 29-Nov-2010 Tomoya <tomoya-linux@dsn.okisemi.com> can: EG20T PCH: Enumerate LEC macros

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>
15ffc8fddf72712cc45d51c64bd500760ec63c80 29-Nov-2010 Tomoya <tomoya-linux@dsn.okisemi.com> can: EG20T PCH: Change Message Object Index

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>
8339a7ed562719e040ca783bf59fa2d614d10ac9 29-Nov-2010 Tomoya <tomoya-linux@dsn.okisemi.com> can: EG20T PCH: Separate Interface Register(IF1/IF2)

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>
0a80410dc53cf68e56456bef1ca66949b87412f9 17-Nov-2010 Tomoya <tomoya-linux@dsn.okisemi.com> can: EG20T PCH: use BIT(X)

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>
086b5650dcdaae7c4aa60a5d0724f775e733610e 17-Nov-2010 Tomoya <tomoya-linux@dsn.okisemi.com> can: EG20T PCH: add prefix to macro

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>
bdfa3d8fe123a940be121daf374581727b3b6547 31-Oct-2010 Marc Kleine-Budde <mkl@pengutronix.de> can: pch_can: fix section mismatch warning by using a whitelisted name

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>
526de53cf78d325351904eefb9624f933924df75 31-Oct-2010 Marc Kleine-Budde <mkl@pengutronix.de> can: pch_can: fix sparse warning

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>
b21d18b51b31a24d17f883b678432fbdee3d5675 15-Oct-2010 Masayuki Ohtake <masa-korg@dsn.okisemi.com> can: Topcliff: Add PCH_CAN driver.

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>