[FIX] Fix timer overflow in generic timer module

Check the timeout value to be sure that we don't get an overflow. We
can handle values up to UINT_MAX / 2.

Resolves: #335

Change-Id: Ie07a7a82112dfba958b1627ecf67cc89bc3ee4b2
Reviewed-on: http://brateggevoat1/gerrit/2370
Tested-by: Jenkins <jenkins@brateggevoat1.br-automation.co.at>
Reviewed-by: Joerg Zelenka <joerg.zelenka@br-automation.com>
Reviewed-by: Josef Baumgartner <josef.baumgartner@br-automation.com>
[TASK] Optimize eventk_process()

Use switch/case instead of function pointer table.

Change-Id: Ifae16899bf32ab9d7f6aebef4abf7a54aaca0fde
Reviewed-on: http://brateggevoat1/gerrit/2375
Tested-by: Jenkins <jenkins@brateggevoat1.br-automation.co.at>
Reviewed-by: Wolfgang Seiss <wolfgang.seiss@br-automation.com>
Reviewed-by: Joerg Zelenka <joerg.zelenka@br-automation.com>
Reviewed-by: Josef Baumgartner <josef.baumgartner@br-automation.com>
[TASK] Optimize searching for OD index entries

- Calculate number of entries at initialization
- Using binary search instead of linear search

Change-Id: If41a0331a4798bcf5d49a4681e7471ee20f4e082
Reviewed-on: http://brateggevoat1/gerrit/2376
Tested-by: Jenkins <jenkins@brateggevoat1.br-automation.co.at>
Reviewed-by: Wolfgang Seiss <wolfgang.seiss@br-automation.com>
Reviewed-by: Joerg Zelenka <joerg.zelenka@br-automation.com>
Reviewed-by: Josef Baumgartner <josef.baumgartner@br-automation.com>
[TASK] Add names for Linux pthreads to ease debugging

Add names for Linux pthreads. This eases debugging as threads can
be identified by there names within top or ftrace.

Change-Id: I8a49ee1f89a86071a19d9cab47f3eb8fd1becb1e
Reviewed-on: http://brateggevoat1/gerrit/2382
Tested-by: Jenkins <jenkins@brateggevoat1.br-automation.co.at>
Reviewed-by: Wolfgang Seiss <wolfgang.seiss@br-automation.com>
Reviewed-by: Josef Baumgartner <josef.baumgartner@br-automation.com>
[FIX] Fix NMT command handling with PRes Chaining nodes

This fix solves potential deadlocks with PRes Chaining nodes which hang in
PreOperational2 state.
Before the MN sends the NMT reset command to a PRes Chaining node it must
deactivate the PRes Chainging mode by sending a syncRequest frame (as
recommended by EPSG DS 302-C V1.0.0).
The function nmtmnu_sendNmtCommandEx is modified in order to follow this
recommendation with plain and extended NMT reset commands. In case of
extended NMT reset commands the active PRes Chaining nodes are removed
from the bit array in the NMT command data field. When the syncResponse
frame is received a plain NMT reset command is sent to the node.
Note that plain NMT resets to all noads (broadcast, nodeId=0xFF) are
dispatched immediately without considering the node's PRes Chaining mode.

Resolves: #799 and #781

Change-Id: I724b1eefe97da335a1514b2a1fd7f62e0e072542
Reviewed-on: http://brateggevoat1/gerrit/2374
Tested-by: Jenkins <jenkins@brateggevoat1.br-automation.co.at>
Reviewed-by: Wolfgang Seiss <wolfgang.seiss@br-automation.com>
Reviewed-by: Josef Baumgartner <josef.baumgartner@br-automation.com>