Skip to contentSkip to conversation

can/sja1000: driver for PEAK PCAN PCI/PCIe cards

PATCH Superseded Wolfgang Grandegger 5 participants 10 messages Sep 8, 2011 – Sep 29, 2011 6 messages not in the archive

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can/sja1000: driver for PEAK PCAN PCI/PCIe cards

This patch adds the "peak_pci" driver for the PCAN PCI/PCIe cards (1, 2, 3 or 4 channels) from PEAK Systems (http://www.peak-system.com).

---

I have tested this patch on my 2 channel PEAK PCI card. Thomas, or somebody else with a PEAK PCAN PCI/PCIe card at hand, it would be nice if you could test it on your 4 channel card and add your "Tested-by".

Thanks,

Wolfgang.

 drivers/net/can/sja1000/Kconfig    |    7 +
 drivers/net/can/sja1000/Makefile   |    1 +
 drivers/net/can/sja1000/peak_pci.c |  293 ++++++++++++++++++++++++++++++++++++
 3 files changed, 301 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/can/sja1000/peak_pci.c
drivers/net/can/sja1000/Kconfig +7 -0
index 6fdc031..72b637d 100644
@@ -37,6 +37,13 @@ config CAN_EMS_PCI
 	  CPC-PCIe and CPC-104P cards from EMS Dr. Thomas Wuensche
 	  (http://www.ems-wuensche.de).
 
+config CAN_PEAK_PCI
+	tristate "PEAK PCAN PCI/PCIe Cards"
+	depends on PCI
+	---help---
+	  This driver is for the PCAN PCI/PCIe cards (1, 2, 3 or 4 channels)
+	  from PEAK Systems (http://www.peak-system.com).
+
 config CAN_KVASER_PCI
 	tristate "Kvaser PCIcanx and Kvaser PCIcan PCI Cards"
 	depends on PCI
drivers/net/can/sja1000/Makefile +1 -0
index 2c591eb..428f5cf 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_CAN_SJA1000_PLATFORM) += sja1000_platform.o
 obj-$(CONFIG_CAN_SJA1000_OF_PLATFORM) += sja1000_of_platform.o
 obj-$(CONFIG_CAN_EMS_PCI) += ems_pci.o
 obj-$(CONFIG_CAN_KVASER_PCI) += kvaser_pci.o
+obj-$(CONFIG_CAN_PEAK_PCI) += peak_pci.o
 obj-$(CONFIG_CAN_PLX_PCI) += plx_pci.o
 obj-$(CONFIG_CAN_TSCAN1) += tscan1.o
 
drivers/net/can/sja1000/peak_pci.c new file +293 -0

293 lines not on this page · raw message

Signature · 1 line
1.7.4.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hello Wolfgang,

many thanks for providing this patch!

Quoted 2 lines · Wolfgang Grandegger

This patch adds the "peak_pci" driver for the PCAN PCI/PCIe cards (1, 2, 3 or 4 channels) from PEAK Systems (http://www.peak-system.com).

Yes - that fits, but ...

drivers/net/can/sja1000/peak_pci.c line 73

Quoted 11 lines
drivers/net/can/sja1000/peak_pci.c new file +11 -0
+#define PEAK_PCI_VENDOR_ID	0x001C	/* The PCI device and vendor IDs */
+#define PEAK_PCI_DEVICE_ID	0x0001	/* for PCI / PCIe slot cards */
+#define PEAK_PCIE_DEVICE_ID	0x0002	/* for PCIExpress cards */
+
+static const u16 peak_pci_icr_masks[] = {0x02, 0x01, 0x40, 0x80};
+
+static DEFINE_PCI_DEVICE_TABLE(peak_pci_tbl) = {
+	{PEAK_PCI_VENDOR_ID, PEAK_PCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
+	{PEAK_PCI_VENDOR_ID, PEAK_PCIE_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
+	{0,}
+};

The problem is the support of the PCAN ExpressCard (device ID 0x0002) here.

This commit

https://lists.berlios.de/pipermail/socketcan-commit/2010-June/000814.html

should be reverted, as you can use the PCAN-ExpressCard (IPEH-00300[12]) only with a hardware patch, as we need some I2C initialisations to enable the CAN transceiver (and the funky status LEDs). See at:

http://anonscm.debian.org/gitweb/?p=collab-maint/peak-linux-driver.git;a=blob;f=driver/src/pcan_pciec.c;h=87ce0bda41aa0a6dda8284d48237b1ef7c678e11;hb=HEAD#l36

I'll also test your driver on Monday.

Tnx & best regards,
Oliver

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hi Oliver,

Quoted 30 lines · Oliver Hartkopp

Hello Wolfgang,

many thanks for providing this patch!

Quoted 2 lines · Wolfgang Grandegger

This patch adds the "peak_pci" driver for the PCAN PCI/PCIe cards (1, 2, 3 or 4 channels) from PEAK Systems (http://www.peak-system.com).

Yes - that fits, but ...

drivers/net/can/sja1000/peak_pci.c line 73

Quoted 11 lines
drivers/net/can/sja1000/peak_pci.c new file +11 -0
+#define PEAK_PCI_VENDOR_ID	0x001C	/* The PCI device and vendor IDs */
+#define PEAK_PCI_DEVICE_ID	0x0001	/* for PCI / PCIe slot cards */
+#define PEAK_PCIE_DEVICE_ID	0x0002	/* for PCIExpress cards */
+
+static const u16 peak_pci_icr_masks[] = {0x02, 0x01, 0x40, 0x80};
+
+static DEFINE_PCI_DEVICE_TABLE(peak_pci_tbl) = {
+	{PEAK_PCI_VENDOR_ID, PEAK_PCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
+	{PEAK_PCI_VENDOR_ID, PEAK_PCIE_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
+	{0,}
+};

The problem is the support of the PCAN ExpressCard (device ID 0x0002) here.

This commit

Quoted 7 lines
   https://lists.berlios.de/pipermail/socketcan-commit/2010-June/000814.html

should be reverted, as you can use the PCAN-ExpressCard (IPEH-00300[12]) only with a hardware patch, as we need some I2C initialisations to enable the CAN transceiver (and the funky status LEDs). See at:

http://anonscm.debian.org/gitweb/?p=collab-maint/peak-linux-driver.git;a=blob;f=driver/src/pcan_pciec.c;h=87ce0bda41aa0a6dda8284d48237b1ef7c678e11;hb=HEAD#l36

OK, I see, I will revert then. I already realized the I2C stuff for the PCAN-ExpressCard. Obviously Thomas does not use that card but a PCIe slot cards

Quoted 1 line

I'll also test your driver on Monday.

Thanks,

Wolfgang.

Tested-by
#5 lore raw
Quoted 4 lines · Wolfgang Grandegger
Quoted 2 lines

I'll also test your driver on Monday.

Thanks,

Hi Wolfgang,

even if i only had my hardware-patched PEAK PCI ExpressCard hardware here (which is to be removed in the supported PCI device list due to the missing I2C initialization), i successfully tested your driver.

So let's wait for some feedback from Thomas, when he's back to the office ;-)

Tnx & best regards,
Oliver

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

Hi Oliver,

Quoted 9 lines · Oliver Hartkopp
Quoted 4 lines · Wolfgang Grandegger
Quoted 2 lines

I'll also test your driver on Monday.

Thanks,

Quoted 7 lines

Hi Wolfgang,

even if i only had my hardware-patched PEAK PCI ExpressCard hardware here (which is to be removed in the supported PCI device list due to the missing I2C initialization), i successfully tested your driver.

Thanks, I have just sent v2.

Quoted 1 line

So let's wait for some feedback from Thomas, when he's back to the office ;-)

Yep, some testing on a 4 channel card would be nice.

Wolfgang.

#8 lore raw

Hi together,

i'll test the patch as soon as the system is available again, which is not before next week.

Thomas

Wolfgang Grandegger <[email protected]> schrieb am 13.09.2011 09:38:57:

Quoted 15 lines

Hi Oliver,

Quoted 12 lines · Oliver Hartkopp
Quoted 4 lines · Wolfgang Grandegger
Quoted 2 lines

I'll also test your driver on Monday.

Thanks,

Hi Wolfgang,

even if i only had my hardware-patched PEAK PCI ExpressCard hardware

here

Quoted 1 line
Quoted 1 line

(which is to be removed in the supported PCI device list due to the

missing

Quoted 7 lines
Quoted 3 lines

I2C initialization), i successfully tested your driver.

Thanks, I have just sent v2.

Quoted 1 line

So let's wait for some feedback from Thomas, when he's back to the

office ;-)

Quoted 5 lines

Yep, some testing on a 4 channel card would be nice.

Wolfgang.

#9 lore raw
In reply to Wolfgang Grandegger

I got access to another system with a 4 channel card and tested your patch (v1) within the Berlios socket-can SVN tree: it worked :) Thanks!

Thomas

Wolfgang Grandegger <[email protected]> schrieb am 13.09.2011 09:38:57:

Quoted 15 lines

Hi Oliver,

Quoted 12 lines · Oliver Hartkopp
Quoted 4 lines · Wolfgang Grandegger
Quoted 2 lines

I'll also test your driver on Monday.

Thanks,

Hi Wolfgang,

even if i only had my hardware-patched PEAK PCI ExpressCard hardware

here

Quoted 1 line
Quoted 1 line

(which is to be removed in the supported PCI device list due to the

missing

Quoted 7 lines
Quoted 3 lines

I2C initialization), i successfully tested your driver.

Thanks, I have just sent v2.

Quoted 1 line

So let's wait for some feedback from Thomas, when he's back to the

office ;-)

Quoted 5 lines

Yep, some testing on a 4 channel card would be nice.

Wolfgang.

A message that is not in the archive (sent off-list or not yet received): OFA1D2B7AC.618D2DB3-ONC125791A.0032F517-C125791A.00335871-Npw8gZsewqCELgA04lAiVw@public.gmane.org

#11 lore raw

Hi Thomas,

Quoted 2 lines · Thomas Wiedemann

I got access to another system with a 4 channel card and tested your patch (v1) within the Berlios socket-can SVN tree: it worked :)

Hm, did the patch apply to the SVN tree? Any chance to test with David Miller's net-next-2.6 tree. Anyway, I'm quite sure now that the patch works fine on 4-channel cards as well.

Thanks for your effort.

Wolfgang.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#13 lore raw

Antwort: Re: [PATCH net-next-2.6] can/sja1000: driver for PEAK PCAN PCI/PCIe cards

Hi Wolfgang,
i just replaced peak_pci.c.
The net-next-2.6 branch? Is that the one in the latest linux kernels? I'll try to find some time to test a new kernel.

Thomas

Wolfgang Grandegger <[email protected]> schrieb am 29.09.2011 12:39:55:

Quoted 4 lines

Hi Thomas,

Quoted 1 line · Thomas Wiedemann

I got access to another system with a 4 channel card and tested your

patch

Quoted 9 lines
Quoted 1 line

(v1) within the Berlios socket-can SVN tree: it worked :)

Hm, did the patch apply to the SVN tree? Any chance to test with David Miller's net-next-2.6 tree. Anyway, I'm quite sure now that the patch works fine on 4-channel cards as well.

Thanks for your effort.

Wolfgang.

A message that is not in the archive (sent off-list or not yet received): OF72B7C0BE.EE4FAB88-ONC125791A.004029CC-C125791A.004097EF-Npw8gZsewqCELgA04lAiVw@public.gmane.org

#15 lore raw

Re: Antwort: Re: [PATCH net-next-2.6] can/sja1000: driver for PEAK PCAN PCI/PCIe cards

Hi Thomas,

Quoted 4 lines · Thomas Wiedemann

Hi Wolfgang,
i just replaced peak_pci.c.
The net-next-2.6 branch? Is that the one in the latest linux kernels? I'll try to find some time to test a new kernel.

Temporarily (kernel.org is still down) you can get the "net-next-2.6" as shown below:

  $ git clone git://github.com/davem330/net-next.git

The tree is maintained by David Miller and will show up mainline with the next kernel release.

Thanks,

Wolfgang.