diff -ur libcifx.org/src/netx_tap/netx_tap.c libcifx/src/netx_tap/netx_tap.c --- libcifx.org/src/netx_tap/netx_tap.c 2015-07-13 09:59:26.000000000 +0200 +++ libcifx/src/netx_tap/netx_tap.c 2015-11-02 12:44:28.028051467 +0100 @@ -162,7 +162,7 @@ { if(g_ulTraceLevel & TRACE_LEVEL_ERROR) { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Error allocating tap device for '%s'. Error=%d", config->cifx_name, internal_dev->eth_fd); + USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Error allocating tap device for '%s'. Error=%d", config->cifx_name, internal_dev->eth_fd); } } else { @@ -171,7 +171,7 @@ if(g_ulTraceLevel & TRACE_LEVEL_INFO) { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_INFO, "Successfully created '%s' on device '%s'", internal_dev->cifxeth_name, config->cifx_name); + USER_Trace( internal_dev->devinst, TRACE_LEVEL_INFO, "Ethernet-IF Info: Successfully created '%s' at channel %d on device '%s'", internal_dev->cifxeth_name, channel_no, config->cifx_name); } /* Register for ethernet service on device */ if (CIFX_NO_ERROR == (cifxeth_register_app( internal_dev, 1))) @@ -181,7 +181,7 @@ { if(g_ulTraceLevel & TRACE_LEVEL_ERROR) { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Error creating cifX Ethernet device threads."); + USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Error creating cifX Ethernet device threads."); } } else { @@ -206,7 +206,7 @@ { if(g_ulTraceLevel & TRACE_LEVEL_ERROR) { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Not enough memory to create cifx virtual ethernet interface!"); + USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Not enough memory to create cifx virtual ethernet interface!"); } } } @@ -370,7 +370,7 @@ { USER_Trace(ptDevInst, TRACE_LEVEL_ERROR, - "Error reading channel info block to detect channels usable for ethernet interface (lRet=0x%08X).", + "Ethernet-IF Error: Error reading channel info block to detect channels usable for ethernet interface (lRet=0x%08X).", lRet); } @@ -400,6 +400,15 @@ } } lRet = CIFX_INVALID_BOARD; + if (0 == fComChannelFound) + { + if(g_ulTraceLevel & TRACE_LEVEL_DEBUG) + { + USER_Trace(ptDevInst, + TRACE_LEVEL_DEBUG, + "Ethernet-IF Info: No communication channel found, skip further search for ethernt-if!\n"); + } + } /* Check system info block entries */ for( ; (fComChannelFound && ((ulSearchIdx + ulStartIndex) < CIFX_MAX_NUMBER_OF_CHANNELS)); ++ulSearchIdx) { @@ -416,6 +425,15 @@ break; } } + if ((1 == fComChannelFound) && (lRet != CIFX_NO_ERROR)) + { + if(g_ulTraceLevel & TRACE_LEVEL_DEBUG) + { + USER_Trace(ptDevInst, + TRACE_LEVEL_DEBUG, + "Ethernet-IF Info:: No ethernet channel found at channels %d-%d on %s!\n",ulStartIndex, ulSearchIdx + ulStartIndex, szDeviceName); + } + } } /* Close system device */ xSysdeviceClose(hSysdevice); @@ -451,7 +469,7 @@ { if(g_ulTraceLevel & TRACE_LEVEL_ERROR) { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Error creating tap device (TUNSETIFF) '%s'. Error=%d", prefix, errno); + USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Error creating tap device (TUNSETIFF) '%s'. Error=%d", prefix, errno); } close(ret); ret = err; @@ -464,7 +482,7 @@ { if(g_ulTraceLevel & TRACE_LEVEL_ERROR) { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Error opening tun interface '%s'. Error=%d", TUNTAP_DEVICEPATH, errno); + USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Error opening tun interface '%s'. Error=%d", TUNTAP_DEVICEPATH, errno); } ret = -errno; } @@ -542,7 +560,7 @@ { if(g_ulTraceLevel & TRACE_LEVEL_ERROR) { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Exception on Ethernet Device file descriptor, exiting thread"); + USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Exception on Ethernet Device file descriptor, exiting thread"); } break; } @@ -578,7 +596,7 @@ { if(g_ulTraceLevel & TRACE_LEVEL_ERROR) { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Error sending frame to cifX Device. (Error=0x%08X)", cifx_error); + USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Error sending frame to cifX Device. (Error=0x%08X)", cifx_error); } } internal_dev->active_sends++; @@ -593,7 +611,7 @@ { if(g_ulTraceLevel & TRACE_LEVEL_ERROR) { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Error on select for Ethernet Device file descriptor, exiting thread"); + USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Error on select for Ethernet Device file descriptor, exiting thread"); } break; } @@ -657,7 +675,7 @@ { if(g_ulTraceLevel & TRACE_LEVEL_ERROR) { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Error sending incoming data to ethernet device (%d)\n", ret); + USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Error sending incoming data to ethernet device (%d)\n", ret); } } } @@ -769,7 +787,7 @@ { if(g_ulTraceLevel & TRACE_LEVEL_ERROR) { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Failed to set MAC address of %s (%d)", internal_dev->cifxeth_name, errno); + USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Failed to set MAC address of %s (%d)", internal_dev->cifxeth_name, errno); } } } @@ -812,7 +830,7 @@ /* This is a transport error */ USER_Trace(internal_dev->devinst, TRACE_LEVEL_ERROR, - "Error in cifXEthTransferPacket()(lRet=0x%08X).", + "Ethernet-IF Error: Error in cifXEthTransferPacket()(lRet=0x%08X).", lRet); } else { @@ -821,7 +839,7 @@ { USER_Trace(internal_dev->devinst, TRACE_LEVEL_ERROR, - "Error sending Register-Application-Request (lRet=0x%08X).", + "Ethernet-IF Error: Error sending Register-Application-Request (lRet=0x%08X).", lRet); } } @@ -963,7 +981,7 @@ { if(g_ulTraceLevel & TRACE_LEVEL_ERROR) { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Failed to retrieve extended info of %s (0x%X)", lRet); + USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Failed to retrieve extended info of %s (0x%X)", lRet); } } return lRet;