Commit 9c1d36ca authored by Romain Naour's avatar Romain Naour Committed by Peter Korsgaard
Browse files

openpowerlink: new package



[Peter: fixup patch 2 corruption]
Signed-off-by: default avatarRomain Naour <romain.naour@openwide.fr>
Signed-off-by: default avatarPeter Korsgaard <peter@korsgaard.com>
parent 0b430863
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -311,6 +311,7 @@ source "package/ola/Config.in"
source "package/on2-8170-modules/Config.in"
source "package/open2300/Config.in"
source "package/openocd/Config.in"
source "package/openpowerlink/Config.in"
source "package/owl-linux/Config.in"
source "package/parted/Config.in"
source "package/pciutils/Config.in"
+112 −0
Original line number Diff line number Diff line
comment "openpowerlink requires a toolchain with C++ and threads support enabled"
	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS

config BR2_PACKAGE_OPENPOWERLINK
	bool "openpowerlink"
	depends on BR2_INSTALL_LIBSTDCPP
	depends on BR2_TOOLCHAIN_HAS_THREADS
	depends on BR2_i386 || BR2_x86_64
	help
	  openPOWERLINK is an Open Source Industrial Ethernet
	  stack implementing the POWERLINK protocol for Managing Node
	  (MN, POWERLINK Master) and Controlled Node (CN, POWERLINK Slave).

	  It is provided by
	  SYSTEC electronic (http://www.systec-electronic.com),
	  B&R (http://www.br-automation.com) and
	  Kalycito (http://www.kalycito.com).

	  https://sourceforge.net/projects/openpowerlink/

if BR2_PACKAGE_OPENPOWERLINK

choice
	prompt "stack implementation"

config BR2_PACKAGE_OPENPOWERLINK_LIBPCAP
	bool "userspace stack"
	select BR2_PACKAGE_LIBPCAP
	help
	  The Linux userspace implementation of the openPOWERLINK stack provides
	  all functions for a software based POWERLINK solution running as Linux
	  userspace application. The stack uses the libpcap library for accessing
	  the network interface and is therefore totally independant of the used
	  network card and driver.

config BR2_PACKAGE_OPENPOWERLINK_KERNEL_MODULE
	bool "kernel stack"
	depends on BR2_LINUX_KERNEL
	help
	  The openPOWERLINK stack may be implemented as Linux kernel module.
	  This solution provides the best performance, but is limited to the
	  available openPOWERLINK network drivers.
	  You may select BR2_PACKAGE_PCIUTILS for lscpi,
	  and BR2_PACKAGE_PROCPS for ps command.
	  These commands are used in EplLoad and EplUndload scripts.

endchoice

if BR2_PACKAGE_OPENPOWERLINK_KERNEL_MODULE

choice
	prompt "select Ethernet Powerlink Driver"

config BR2_PACKAGE_OPENPOWERLINK_82573
	bool "Intel 82573"

config BR2_PACKAGE_OPENPOWERLINK_8255x
	bool "Intel 8255x"

config BR2_PACKAGE_OPENPOWERLINK_RTL8139
	bool "Realtek RTL-8139"

endchoice

endif

choice
	prompt "Select MN/CN mode"

	config BR2_PACKAGE_OPENPOWERLINK_MN
	bool "MN"
	help
	  Enable Managing Node mode

	config BR2_PACKAGE_OPENPOWERLINK_CN
	bool "CN"
	help
	  Enable Controlled Node mode

endchoice

menu "openpowerlink demos"

config BR2_PACKAGE_OPENPOWERLINK_DEMO_MN_CONSOLE
	bool "console MN demo"
	depends on BR2_PACKAGE_OPENPOWERLINK_MN

config BR2_PACKAGE_OPENPOWERLINK_DEMO_MN_QT
	bool "qt MN demo"
	depends on BR2_PACKAGE_OPENPOWERLINK_MN
	depends on BR2_INSTALL_LIBSTDCPP
	select BR2_PACKAGE_QT
	select BR2_PACKAGE_QT_STL

config BR2_PACKAGE_OPENPOWERLINK_DEMO_CN_CONSOLE
	bool "console CN demo"
	depends on !BR2_PACKAGE_OPENPOWERLINK_MN

config BR2_PACKAGE_OPENPOWERLINK_DEMO_LINUX_KERNEL
	bool "kernel demo"
	depends on BR2_PACKAGE_OPENPOWERLINK_KERNEL_MODULE
	depends on BR2_PACKAGE_OPENPOWERLINK_MN

endmenu

config BR2_PACKAGE_OPENPOWERLINK_DEBUG_LEVEL
	string "debug level for openpowerlink stack"
	default "0xEC000000L"
	help
	  Debug level to be used for openPOWERLINK debugging functions.

endif
+22 −0
Original line number Diff line number Diff line
commit 8658075bd7c49a7481e8f6d0d7a13b0651e1dfd7
Author: Romain Naour <romain.naour@openwide.fr>
Date:   Wed Sep 18 23:33:04 2013 +0200

    [FIX] demo_mn_qt: add EplDebug.c in demo_sources list

    demo_mn_qt use EplGetEmergErrCodeStr()

    Signed-off-by: Romain Naour <romain.naour@openwide.fr>

diff --git a/Examples/X86/Generic/demo_mn_qt/CMakeLists.txt b/Examples/X86/Generic/demo_mn_qt/CMakeLists.txt
index 9db2f7f..48ae9eb 100644
--- a/Examples/X86/Generic/demo_mn_qt/CMakeLists.txt
+++ b/Examples/X86/Generic/demo_mn_qt/CMakeLists.txt
@@ -78,6 +78,7 @@ SET(DEMO_SOURCES src/EplApi.cpp
                  src/MainWindow.cpp
                  src/NodeState.cpp
                  ${POWERLINK_SOURCE_DIR}/ObjDicts/${OBJDICT}/EplApiProcessImageSetup.c
+                 ${POWERLINK_SOURCE_DIR}/EplStack/EplDebug.c
     )

 # The TRACE macros need trace.c on the Windows platform
+78 −0
Original line number Diff line number Diff line
From 9990e19bc554d11c4123986692c5e0572682467a Mon Sep 17 00:00:00 2001
From: Josef Baumgartner <josef.baumgartner@br-automation.com>
Date: Wed, 14 Aug 2013 10:22:21 +0200
Subject: [PATCH 1/1] [FIX] Fix compilation issue for kernels > 3.5

With kernel version 3.5 the interface of kmap_atomic() and
kunmap_atomic is changed. The fix adapts to the new interface.

Change-Id: I0885b87dc594bf48d1ff4eaeaf188268ceb3b112
Reviewed-on: http://brateggevoat1/gerrit/1261
Tested-by: Jenkins <jenkins@brateggevoat1.br-automation.co.at>
Reviewed-by: Josef Baumgartner <josef.baumgartner@br-automation.com>
---
 EplStack/EplApiProcessImage.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/EplStack/EplApiProcessImage.c b/EplStack/EplApiProcessImage.c
index a1a049f..02907bc 100644
--- a/EplStack/EplApiProcessImage.c
+++ b/EplStack/EplApiProcessImage.c
@@ -573,7 +573,7 @@ tEplApiProcessImageCopyJobInt   IntCopyJob;
 #elif (TARGET_SYSTEM == _WIN32_)
     if (EplApiProcessImageInstance_g.m_dwCurrentThreadId == GetCurrentThreadId())
 #elif (TARGET_SYSTEM == _VXWORKS_)
-    if (EplApiProcessImageInstance_g.m_currentThreadId == taskIdSelf())    	
+    if (EplApiProcessImageInstance_g.m_currentThreadId == taskIdSelf())
 #else
 #error "OS currently not supported by EplApiProcessImage!"
 #endif
@@ -1018,13 +1018,20 @@ void*           pVirtUserPart;
             }

             ulSize = min ((PAGE_SIZE - ulOffset), pPart->m_uiSize - ulLength);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
             pVirtUserPart = kmap_atomic(ppPage[nIndex], KM_USER0);
+#else
+            pVirtUserPart = kmap_atomic(ppPage[nIndex]);
+#endif

             EPL_MEMCPY(pPIVar,
                 pVirtUserPart + ulOffset,
                 ulSize);
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
             kunmap_atomic(pVirtUserPart, KM_USER0);
+#else
+            kunmap_atomic(pVirtUserPart);
+#endif

             pPIVar += ulSize;
             ulLength += ulSize;
@@ -1063,14 +1070,21 @@ void*           pVirtUserPart;
             }

             ulSize = min ((PAGE_SIZE - ulOffset), pPart->m_uiSize - ulLength);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
             pVirtUserPart = kmap_atomic(ppPage[nIndex], KM_USER0);
+#else
+            pVirtUserPart = kmap_atomic(ppPage[nIndex]);
+#endif

             EPL_MEMCPY(pVirtUserPart + ulOffset,
                 pPIVar,
                 ulSize);

+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
             kunmap_atomic(pVirtUserPart, KM_USER0);
-
+#else
+            kunmap_atomic(pVirtUserPart);
+#endif
             pPIVar += ulSize;
             ulLength += ulSize;
             ulOffset = 0;

--
1.8.4
+28 −0
Original line number Diff line number Diff line
From cb6c4ff053e72f7fe5954894aebe2c0d94120b2d Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@openwide.fr>
Date: Thu, 3 Oct 2013 23:22:17 +0200
Subject: [PATCH 5/5] [FIX] Linux Powerlink user lib: add INSTALL

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
 Examples/X86/Generic/powerlink_user_lib/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Examples/X86/Generic/powerlink_user_lib/CMakeLists.txt b/Examples/X86/Generic/powerlink_user_lib/CMakeLists.txt
index e67d573..40b7756 100644
--- a/Examples/X86/Generic/powerlink_user_lib/CMakeLists.txt
+++ b/Examples/X86/Generic/powerlink_user_lib/CMakeLists.txt
@@ -329,7 +329,9 @@ ENDIF ()
 #
 # Installation
 #
-IF (WIN32)
+IF (UNIX)
+    INSTALL(TARGETS powerlink ARCHIVE DESTINATION lib)
+ELSEIF (WIN32)
     IF (CFG_X86_WINDOWS_DLL)
         INSTALL(TARGETS openPOWERLINK RUNTIME DESTINATION bin)
     ENDIF (CFG_X86_WINDOWS_DLL)
--
1.8.4
Loading