rtcan: add rtcan_plx_pci driver
PATCH 1/1 rtcan: add rtcan_plx_pci driver
This is a general driver for cards based on PLX90xx PCI-bridges. It supports following cards:
- Adlink PCI-7841/cPCI-7841 card (http://www.adlinktech.com/)
- Adlink PCI-7841/cPCI-7841 SE card
- esd CAN-PCI/CPCI/PCI104/200 (http://www.esd.eu/)
- esd CAN-PCI/PMC/266
- esd CAN-PCIe/2000
- Marathon CAN-bus-PCI card (http://www.marathon.ru/)
- TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/)
This driver has been ported from socketcan of mainline Linux kernel 2.6.34. Support of esd cards has been added by Matthias Fuchs in linux-next
--- ksrc/drivers/can/sja1000/Kconfig | 15 + ksrc/drivers/can/sja1000/Makefile | 7 + ksrc/drivers/can/sja1000/rtcan_plx_pci.c | 608 ++++++++++++++++++++++++++++++ 3 files changed, 630 insertions(+), 0 deletions(-) create mode 100644 ksrc/drivers/can/sja1000/rtcan_plx_pci.c
ksrc/drivers/can/sja1000/Kconfig +15 -0
@@ -41,6 +41,21 @@ config XENO_DRIVERS_CAN_SJA1000_IXXAT_PCI the second channel working, Xenomai's shared interrupt support must be enabled. +config XENO_DRIVERS_CAN_SJA1000_PLX_PCI + depends on XENO_DRIVERS_CAN_SJA1000 && PCI + tristate "PLX-based PCI Cards" + help + + This driver is for CAN interface cards based on + the PLX90xx PCI bridge. + Driver supports now: + - Adlink PCI-7841/cPCI-7841 card (http://www.adlinktech.com/) + - Adlink PCI-7841/cPCI-7841 SE card + - esd CAN-PCI/CPCI/PCI104/200 (http://www.esd.eu/) + - esd CAN-PCI/PMC/266 + - esd CAN-PCIe/2000 + - Marathon CAN-bus-PCI card (http://www.marathon.ru/) + - TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/) config XENO_DRIVERS_CAN_SJA1000_EMS_PCI depends on XENO_DRIVERS_CAN_SJA1000 && PCI
ksrc/drivers/can/sja1000/Makefile +7 -0
@@ -7,6 +7,7 @@ EXTRA_CFLAGS += -D__IN_XENOMAI__ -Iinclude/xenomai -Idrivers/xenomai/can -Idrive obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000) += xeno_can_sja1000.o obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_PEAK_PCI) += xeno_can_peak_pci.o obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_PEAK_DNG) += xeno_can_peak_dng.o +obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_PLX_PCI) += xeno_can_plx_pci.o obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_IXXAT_PCI) += xeno_can_ixxat_pci.o obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_EMS_PCI) += xeno_can_ems_pci.o obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_ESD_PCI) += xeno_can_esd_pci.o
@@ -16,6 +17,7 @@ obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_MEM) += xeno_can_mem.o xeno_can_sja1000-y := rtcan_sja1000.o rtcan_sja1000_proc.o xeno_can_peak_pci-y := rtcan_peak_pci.o xeno_can_peak_dng-y := rtcan_peak_dng.o +xeno_can_plx_pci-y := rtcan_plx_pci.o xeno_can_ixxat_pci-y := rtcan_ixxat_pci.o xeno_can_ems_pci-y := rtcan_ems_pci.o xeno_can_esd_pci-y := rtcan_esd_pci.o
@@ -31,6 +33,7 @@ O_TARGET := built-in.o obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000) += xeno_can_sja1000.o obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_PEAK_PCI) += xeno_can_peak_pci.o obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_PEAK_DNG) += xeno_can_peak_dng.o +obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_PLX_PCI) += xeno_can_plx_pci.o obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_IXXAT_PCI) += xeno_can_ixxat_pci.o obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_EMS_PCI) += xeno_can_ems_pci.o obj-$(CONFIG_XENO_DRIVERS_CAN_SJA1000_ESD_PCI) += xeno_can_esd_pci.o
@@ -42,6 +45,7 @@ list-multi := xeno_can_sja1000.o xeno_can_sja1000-objs := rtcan_sja1000.o rtcan_sja1000_proc.o xeno_can_peak_pci-objs := rtcan_peak_pci.o xeno_can_peak_dng-objs := rtcan_peak_dng.o +xeno_can_plx_pci-objs := rtcan_plx_pci.o xeno_can_ixxat_pci-objs := rtcan_ixxat_pci.o xeno_can_ems_pci-objs := rtcan_ems_pci.o xeno_can_esd_pci-objs := rtcan_esd_pci.o
@@ -63,6 +67,9 @@ xeno_can_peak_pci.o: $(xeno_can_peak_pci-objs) xeno_can_peak_dng.o: $(xeno_can_peak_dng-objs) $(LD) -r -o $@ $(xeno_can_peak_dng-objs) +xeno_can_plx_pci.o: $(xeno_can_plx_pci-objs) + $(LD) -r -o $@ $(xeno_can_plx_pci-objs) + xeno_can_ixxat_pci.o: $(xeno_can_ixxat_pci-objs) $(LD) -r -o $@ $(xeno_can_ixxat_pci-objs)
ksrc/drivers/can/sja1000/rtcan_plx_pci.c new file +608 -0
608 lines not on this page · raw message
Signature · 1 line
1.6.0.6
Quoted 9 lines · Pavel Cheblakov
This is a general driver for cards based on PLX90xx PCI-bridges. It supports following cards:
- Adlink PCI-7841/cPCI-7841 card (http://www.adlinktech.com/)
- Adlink PCI-7841/cPCI-7841 SE card
- esd CAN-PCI/CPCI/PCI104/200 (http://www.esd.eu/)
- esd CAN-PCI/PMC/266
- esd CAN-PCIe/2000
- Marathon CAN-bus-PCI card (http://www.marathon.ru/)
- TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/)
The esd cards mentioned above are supported by the RTCAN driver xeno_can_esd_pci. Why do you propose a new driver instead of extending the existing one?
Signature · 1 line
Sebastian
Hi Sebastian,
Quoted 11 lines · Sebastian Smolorz
Quoted 9 lines · Pavel Cheblakov
This is a general driver for cards based on PLX90xx PCI-bridges. It supports following cards:
- Adlink PCI-7841/cPCI-7841 card (http://www.adlinktech.com/)
- Adlink PCI-7841/cPCI-7841 SE card
- esd CAN-PCI/CPCI/PCI104/200 (http://www.esd.eu/)
- esd CAN-PCI/PMC/266
- esd CAN-PCIe/2000
- Marathon CAN-bus-PCI card (http://www.marathon.ru/)
- TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/)
Quoted 3 lines
The esd cards mentioned above are supported by the RTCAN driver
xeno_can_esd_pci. Why do you propose a new driver instead of extending the existing one?
For Socket-CAN, this driver is supposed to support all PLX PCI based boards including the esd CAN PCI cards and also the IXXAT PCI board (not yet done, though). The RTCAN driver xeno_can_esd_pci is a *dedicated* driver for that card without generic support for the PLX PCI chips. Extending it makes little sense. The question is if we want to drop xeno_can_esd_pci and xeno_can_ixxat_pci.
Wolfgang.
Quoted 19 lines · Wolfgang Grandegger
Hi Sebastian,
Quoted 12 lines · Sebastian Smolorz
Quoted 10 lines · Pavel Cheblakov
This is a general driver for cards based on PLX90xx PCI-bridges. It supports following cards:
- Adlink PCI-7841/cPCI-7841 card (http://www.adlinktech.com/)
- Adlink PCI-7841/cPCI-7841 SE card
- esd CAN-PCI/CPCI/PCI104/200 (http://www.esd.eu/)
- esd CAN-PCI/PMC/266
- esd CAN-PCIe/2000
- Marathon CAN-bus-PCI card (http://www.marathon.ru/)
- TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/)Quoted 2 lines
The esd cards mentioned above are supported by the RTCAN driver
xeno_can_esd_pci. Why do you propose a new driver instead of extending the existing one?
Quoted 9 lines
For Socket-CAN, this driver is supposed to support all PLX PCI based boards including the esd CAN PCI cards and also the IXXAT PCI board (not yet done, though). The RTCAN driver
xeno_can_esd_pciis a *dedicated* driver for that card without generic support for the PLX PCI chips. Extending it makes little sense. The question is if we want to dropxeno_can_esd_pciandxeno_can_ixxat_pci.Wolfgang.
I subscribe to Wolfgang.
Moreover, during an adaptation of Socket-CAN plx_pci driver to Xenomai, I remarked that these drivers are too similar. In general, the differences consist only of slightly changed API (early version of Socket-CAN internal API) and different prefixes for some names.
Hi Wolfgang,
Quoted 16 lines · Wolfgang Grandegger
Quoted 11 lines · Sebastian Smolorz
Quoted 9 lines · Pavel Cheblakov
This is a general driver for cards based on PLX90xx PCI-bridges. It supports following cards:
- Adlink PCI-7841/cPCI-7841 card (http://www.adlinktech.com/)
- Adlink PCI-7841/cPCI-7841 SE card
- esd CAN-PCI/CPCI/PCI104/200 (http://www.esd.eu/)
- esd CAN-PCI/PMC/266
- esd CAN-PCIe/2000
- Marathon CAN-bus-PCI card (http://www.marathon.ru/)
- TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/)Quoted 3 lines
The esd cards mentioned above are supported by the RTCAN driver
xeno_can_esd_pci. Why do you propose a new driver instead of extending the existing one?
Quoted 6 lines
For Socket-CAN, this driver is supposed to support all PLX PCI based boards including the esd CAN PCI cards and also the IXXAT PCI board (not yet done, though). The RTCAN driver
xeno_can_esd_pciis a *dedicated* driver for that card without generic support for the PLX PCI chips. Extending it makes little sense. The question is if we want to dropxeno_can_esd_pciandxeno_can_ixxat_pci.
With extending the esd_pci driver I meant to take this driver as a basis to add support for more cards. Of course this would mean to rename the driver in order to reflect that. I'm not against a unification of esd_pci and ixxat_pci but it's unneccessary work to write a new RTCAN driver if there exists another one which is tried and tested in the field. So my question was why Pavel did not take the esd_pci driver as the starting position.
So talking about potential issues in Pavel's code (e.g. the function plx_pci_check_sja1000()) could be unnecessary if he derived the new driver from esd_pci .
Signature · 1 line
Sebastian
Quoted 26 lines · Sebastian Smolorz
Hi Wolfgang,
Quoted 16 lines · Wolfgang Grandegger
Quoted 11 lines · Sebastian Smolorz
Quoted 9 lines · Pavel Cheblakov
This is a general driver for cards based on PLX90xx PCI-bridges. It supports following cards:
- Adlink PCI-7841/cPCI-7841 card (http://www.adlinktech.com/)
- Adlink PCI-7841/cPCI-7841 SE card
- esd CAN-PCI/CPCI/PCI104/200 (http://www.esd.eu/)
- esd CAN-PCI/PMC/266
- esd CAN-PCIe/2000
- Marathon CAN-bus-PCI card (http://www.marathon.ru/)
- TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/)Quoted 3 lines
The esd cards mentioned above are supported by the RTCAN driver
xeno_can_esd_pci. Why do you propose a new driver instead of extending the existing one?Quoted 6 lines
For Socket-CAN, this driver is supposed to support all PLX PCI based boards including the esd CAN PCI cards and also the IXXAT PCI board (not yet done, though). The RTCAN driver
xeno_can_esd_pciis a *dedicated* driver for that card without generic support for the PLX PCI chips. Extending it makes little sense. The question is if we want to dropxeno_can_esd_pciandxeno_can_ixxat_pci.
Quoted 6 lines
With extending the
esd_pcidriver I meant to take this driver as a basis to add support for more cards. Of course this would mean to rename the driver in order to reflect that. I'm not against a unification ofesd_pciandixxat_pcibut it's unneccessary work to write a new RTCAN driver if there exists another one which is tried and tested in the field. So my question was why Pavel did not take theesd_pcidriver as the starting position.
He did *not* write a new RTCAN driver. He ported plx_pci.c from the mainline kernel to rtcan, which is much less work and even less error prune.
Quoted 3 lines
So talking about potential issues in Pavel's code (e.g. the function
plx_pci_check_sja1000()) could be unnecessary if he derived the new driver fromesd_pci.
Does it harm? It is necessary to find out the number of channels on some cards.
Wolfgang.
Quoted 35 lines · Wolfgang Grandegger
Quoted 26 lines · Sebastian Smolorz
Hi Wolfgang,
Quoted 16 lines · Wolfgang Grandegger
Quoted 11 lines · Sebastian Smolorz
Quoted 9 lines · Pavel Cheblakov
This is a general driver for cards based on PLX90xx PCI-bridges. It supports following cards:
- Adlink PCI-7841/cPCI-7841 card (http://www.adlinktech.com/)
- Adlink PCI-7841/cPCI-7841 SE card
- esd CAN-PCI/CPCI/PCI104/200 (http://www.esd.eu/)
- esd CAN-PCI/PMC/266
- esd CAN-PCIe/2000
- Marathon CAN-bus-PCI card (http://www.marathon.ru/)
- TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/)Quoted 3 lines
The esd cards mentioned above are supported by the RTCAN driver
xeno_can_esd_pci. Why do you propose a new driver instead of extending the existing one?Quoted 6 lines
For Socket-CAN, this driver is supposed to support all PLX PCI based boards including the esd CAN PCI cards and also the IXXAT PCI board (not yet done, though). The RTCAN driver
xeno_can_esd_pciis a *dedicated* driver for that card without generic support for the PLX PCI chips. Extending it makes little sense. The question is if we want to dropxeno_can_esd_pciandxeno_can_ixxat_pci.Quoted 7 lines
With extending the
esd_pcidriver I meant to take this driver as a basis to add support for more cards. Of course this would mean to rename the driver in order to reflect that. I'm not against a unification ofesd_pciandixxat_pcibut it's unneccessary work to write a new RTCAN driver if there exists another one which is tried and tested in the field. So my question was why Pavel did not take theesd_pcidriver as the starting position.
Quoted 2 lines
He did *not* write a new RTCAN driver. He ported
plx_pci.cfrom the mainline kernel to rtcan,
So it is a new RTCAN driver - never mind, just nitpicking. ;-)
As I said, I'm in favour of a unified driver which supports more cards than esd_pci and ixxat_pci. The question is how we proceed best when we include rt_sja1000_plx_pci. I suggest not to remove esd_pci immediately but rather mark it deprecated with a reference to the new driver, e.g. in the Kconfig help text. That way we would have a fallback driver in case of unforeseen issues with the new driver.
Quoted 9 lines
which is much less work and even less error
prune.Quoted 3 lines
So talking about potential issues in Pavel's code (e.g. the function
plx_pci_check_sja1000()) could be unnecessary if he derived the new driver fromesd_pci.Does it harm? It is necessary to find out the number of channels on some cards.
Yes, you are right.
Signature · 1 line
Sebastian
Quoted 39 lines · Sebastian Smolorz
Quoted 35 lines · Wolfgang Grandegger
Quoted 26 lines · Sebastian Smolorz
Hi Wolfgang,
Quoted 16 lines · Wolfgang Grandegger
Quoted 11 lines · Sebastian Smolorz
Quoted 9 lines · Pavel Cheblakov
This is a general driver for cards based on PLX90xx PCI-bridges. It supports following cards:
- Adlink PCI-7841/cPCI-7841 card (http://www.adlinktech.com/)
- Adlink PCI-7841/cPCI-7841 SE card
- esd CAN-PCI/CPCI/PCI104/200 (http://www.esd.eu/)
- esd CAN-PCI/PMC/266
- esd CAN-PCIe/2000
- Marathon CAN-bus-PCI card (http://www.marathon.ru/)
- TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/)Quoted 3 lines
The esd cards mentioned above are supported by the RTCAN driver
xeno_can_esd_pci. Why do you propose a new driver instead of extending the existing one?Quoted 6 lines
For Socket-CAN, this driver is supposed to support all PLX PCI based boards including the esd CAN PCI cards and also the IXXAT PCI board (not yet done, though). The RTCAN driver
xeno_can_esd_pciis a *dedicated* driver for that card without generic support for the PLX PCI chips. Extending it makes little sense. The question is if we want to dropxeno_can_esd_pciandxeno_can_ixxat_pci.Quoted 7 lines
With extending the
esd_pcidriver I meant to take this driver as a basis to add support for more cards. Of course this would mean to rename the driver in order to reflect that. I'm not against a unification ofesd_pciandixxat_pcibut it's unneccessary work to write a new RTCAN driver if there exists another one which is tried and tested in the field. So my question was why Pavel did not take theesd_pcidriver as the starting position.Quoted 2 lines
He did *not* write a new RTCAN driver. He ported
plx_pci.cfrom the mainline kernel to rtcan,
Quoted 8 lines
So it is a new RTCAN driver - never mind, just nitpicking. ;-)
As I said, I'm in favour of a unified driver which supports more cards than
esd_pciandixxat_pci. The question is how we proceed best when we includert_sja1000_plx_pci. I suggest not to removeesd_pciimmediately but rather mark it deprecated with a reference to the new driver, e.g. in theKconfighelp text. That way we would have a fallback driver in case of unforeseen issues with the new driver.
Fine with me. Marking it as deprecated is a good thing, though. Note that the esd part of the plx_pci driver was contributed by Matthias Fuchs, including support for the *new* esd pci cards.
Wolfgang.
Hi Pavel,
Quoted 10 lines · Pavel Cheblakov
This is a general driver for cards based on PLX90xx PCI-bridges. It supports following cards:
- Adlink PCI-7841/cPCI-7841 card (http://www.adlinktech.com/)
- Adlink PCI-7841/cPCI-7841 SE card
- esd CAN-PCI/CPCI/PCI104/200 (http://www.esd.eu/)
- esd CAN-PCI/PMC/266
- esd CAN-PCIe/2000
- Marathon CAN-bus-PCI card (http://www.marathon.ru/)
- TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/)
Quoted 4 lines
This driver has been ported from socketcan of mainline Linux kernel 2.6.34. Support of esd cards has been added by Matthias Fuchs in linux-next
Signed-off-by Pavel Cheblakov <[email protected]>
As discussed, could you please label the Kconfig entry for the old esd PCI driver as deprecated. Apart from that the patch looks good and you can add my "Acked-by: Wolfgang Grandegger <[email protected]>".
Thanks,
Wolfgang.