master/globals.h
author Florian Pose <fp@igh-essen.com>
Fri, 28 Oct 2011 11:31:54 +0200
changeset 2126 0383b71b88e4
parent 2106 505871ced767
child 2589 2b9c78543663
permissions -rw-r--r--
Added coding style document.
39
6965c23a6826 likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents: 19
diff changeset
     1
/******************************************************************************
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
 *
39
6965c23a6826 likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents: 19
diff changeset
     3
 *  $Id$
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
 *
1326
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 1312
diff changeset
     5
 *  Copyright (C) 2006-2008  Florian Pose, Ingenieurgemeinschaft IgH
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
     6
 *
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
     7
 *  This file is part of the IgH EtherCAT Master.
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
     8
 *
1326
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 1312
diff changeset
     9
 *  The IgH EtherCAT Master is free software; you can redistribute it and/or
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 1312
diff changeset
    10
 *  modify it under the terms of the GNU General Public License version 2, as
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 1312
diff changeset
    11
 *  published by the Free Software Foundation.
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 1312
diff changeset
    12
 *
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 1312
diff changeset
    13
 *  The IgH EtherCAT Master is distributed in the hope that it will be useful,
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 1312
diff changeset
    14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 1312
diff changeset
    15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 1312
diff changeset
    16
 *  Public License for more details.
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 1312
diff changeset
    17
 *
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 1312
diff changeset
    18
 *  You should have received a copy of the GNU General Public License along
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 1312
diff changeset
    19
 *  with the IgH EtherCAT Master; if not, write to the Free Software
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    20
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    21
 *
1363
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1337
diff changeset
    22
 *  ---
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1337
diff changeset
    23
 *
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1337
diff changeset
    24
 *  The license mentioned above concerns the source code only. Using the
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1337
diff changeset
    25
 *  EtherCAT technology and brand is only permitted in compliance with the
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1337
diff changeset
    26
 *  industrial property and similar rights of Beckhoff Automation GmbH.
246
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 228
diff changeset
    27
 *
39
6965c23a6826 likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents: 19
diff changeset
    28
 *****************************************************************************/
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    29
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
    30
/** \file
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
    31
 * Global definitions and macros.
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
    32
 */
199
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    33
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    34
/*****************************************************************************/
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    35
883
4963e22a267a Equalized defines against duplicated header inclusion.
Florian Pose <fp@igh-essen.com>
parents: 872
diff changeset
    36
#ifndef __EC_MASTER_GLOBALS_H__
4963e22a267a Equalized defines against duplicated header inclusion.
Florian Pose <fp@igh-essen.com>
parents: 872
diff changeset
    37
#define __EC_MASTER_GLOBALS_H__
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    38
444
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 427
diff changeset
    39
#include "../globals.h"
1209
8be462afb7f4 Added VoE handler.
Florian Pose <fp@igh-essen.com>
parents: 1082
diff changeset
    40
#include "../include/ecrt.h"
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 382
diff changeset
    41
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
    42
#ifdef __KERNEL__
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
    43
2035
72a4e043e67d always use rt_mutex instead of semaphore for mutual exclusion on kernels >= 2.6.24 (removed --enable-mutex build option)
Martin Troxler <ch1010277@ch10pc446>
parents: 2028
diff changeset
    44
#include <linux/version.h>
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
    45
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
    46
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
    47
#include <linux/rtmutex.h>
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
    48
#endif // KERNEL_VERSION(2, 6, 24)
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
    49
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
    50
#endif // __KERNEL__
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
    51
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
    52
#if 0
2037
ea0319750e13 Optionally compile with trace_printk support
Martin Troxler <ch1010277@ch10pc446>
parents: 2035
diff changeset
    53
#ifdef CONFIG_TRACING
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
    54
#define USE_TRACE_PRINTK
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
    55
#endif
2037
ea0319750e13 Optionally compile with trace_printk support
Martin Troxler <ch1010277@ch10pc446>
parents: 2035
diff changeset
    56
#endif
ea0319750e13 Optionally compile with trace_printk support
Martin Troxler <ch1010277@ch10pc446>
parents: 2035
diff changeset
    57
196
f8a1e9f364a3 Introduced version number define.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    58
/******************************************************************************
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
    59
 * EtherCAT master
196
f8a1e9f364a3 Introduced version number define.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    60
 *****************************************************************************/
41
42c66194c0c8 Schoenheitskorrekturen.
Florian Pose <fp@igh-essen.com>
parents: 39
diff changeset
    61
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
    62
/** Datagram timeout in microseconds. */
325
7833cf70c4f2 VERSION 1.1: New realtime interface, only state machines.
Florian Pose <fp@igh-essen.com>
parents: 293
diff changeset
    63
#define EC_IO_TIMEOUT 500
7833cf70c4f2 VERSION 1.1: New realtime interface, only state machines.
Florian Pose <fp@igh-essen.com>
parents: 293
diff changeset
    64
2022
393e7aef6706 renamed ext_injection_timeout -> fsm_injection_timeout
Martin Troxler <ch1010277@ch10pc446>
parents: 1982
diff changeset
    65
/** FSM injection timeout in microseconds. */
393e7aef6706 renamed ext_injection_timeout -> fsm_injection_timeout
Martin Troxler <ch1010277@ch10pc446>
parents: 1982
diff changeset
    66
#define EC_FSM_INJECTION_TIMEOUT 10000
1585
1f640e321ee4 ecrt_master_set_max_cycle_size: limit SDO traffic
Martin Troxler <martin.troxler@komaxgroup.com>
parents: 1489
diff changeset
    67
1774
a9143f82c7c5 Fixed name of byte transmission time define; changed coding style.
Florian Pose <fp@igh-essen.com>
parents: 1606
diff changeset
    68
/** Time to send a byte in nanoseconds.
a9143f82c7c5 Fixed name of byte transmission time define; changed coding style.
Florian Pose <fp@igh-essen.com>
parents: 1606
diff changeset
    69
 *
a9143f82c7c5 Fixed name of byte transmission time define; changed coding style.
Florian Pose <fp@igh-essen.com>
parents: 1606
diff changeset
    70
 * t_ns = 1 / (100 MBit/s / 8 bit/byte) = 80 ns/byte
a9143f82c7c5 Fixed name of byte transmission time define; changed coding style.
Florian Pose <fp@igh-essen.com>
parents: 1606
diff changeset
    71
 */
a9143f82c7c5 Fixed name of byte transmission time define; changed coding style.
Florian Pose <fp@igh-essen.com>
parents: 1606
diff changeset
    72
#define EC_BYTE_TRANSMISSION_TIME_NS 80
1585
1f640e321ee4 ecrt_master_set_max_cycle_size: limit SDO traffic
Martin Troxler <martin.troxler@komaxgroup.com>
parents: 1489
diff changeset
    73
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
    74
/** Number of state machine retries on datagram timeout. */
505
bc443ca0077f State machines re-send datagrams on timeout.
Florian Pose <fp@igh-essen.com>
parents: 453
diff changeset
    75
#define EC_FSM_RETRIES 3
bc443ca0077f State machines re-send datagrams on timeout.
Florian Pose <fp@igh-essen.com>
parents: 453
diff changeset
    76
1327
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
    77
/** Seconds to wait before fetching SDO dictionary
427
f70c7c6db7f4 Added EC_WAIT_SDO_DICT define.
Florian Pose <fp@igh-essen.com>
parents: 403
diff changeset
    78
    after slave entered PREOP state. */
f70c7c6db7f4 Added EC_WAIT_SDO_DICT define.
Florian Pose <fp@igh-essen.com>
parents: 403
diff changeset
    79
#define EC_WAIT_SDO_DICT 3
f70c7c6db7f4 Added EC_WAIT_SDO_DICT define.
Florian Pose <fp@igh-essen.com>
parents: 403
diff changeset
    80
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
    81
/** Minimum size of a buffer used with ec_state_string(). */
453
2ecaa53c6291 Changed output of ec_state_string() for error flag to "+ ERROR".
Florian Pose <fp@igh-essen.com>
parents: 444
diff changeset
    82
#define EC_STATE_STRING_SIZE 32
403
7bb931deccd9 Added EC_SLAVE_STATE_ACK_ERR to ec_state_string(); added EC_STATE_STRING_SIZE
Florian Pose <fp@igh-essen.com>
parents: 392
diff changeset
    83
872
d4e0380d63b3 Renamed EEPROM to SII.
Florian Pose <fp@igh-essen.com>
parents: 861
diff changeset
    84
/** Maximum SII size in words, to avoid infinite reading. */
1443
731422684dfd Changed EC_MAX_SII_SIZE to 4096.
Florian Pose <fp@igh-essen.com>
parents: 1438
diff changeset
    85
#define EC_MAX_SII_SIZE 4096
696
24fac09b5b26 Limited EEPROM reading; added EC_FIRST_EEPROM_CATEGORY_HEADER define.
Florian Pose <fp@igh-essen.com>
parents: 649
diff changeset
    86
1851
a56bd34e20a1 Frame statistics in 'ethercat master' output.
Florian Pose <fp@igh-essen.com>
parents: 1826
diff changeset
    87
/** Number of statistic rate intervals to maintain. */
a56bd34e20a1 Frame statistics in 'ethercat master' output.
Florian Pose <fp@igh-essen.com>
parents: 1826
diff changeset
    88
#define EC_RATE_COUNT 3
a56bd34e20a1 Frame statistics in 'ethercat master' output.
Florian Pose <fp@igh-essen.com>
parents: 1826
diff changeset
    89
196
f8a1e9f364a3 Introduced version number define.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    90
/******************************************************************************
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
    91
 * EtherCAT protocol
196
f8a1e9f364a3 Introduced version number define.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    92
 *****************************************************************************/
f8a1e9f364a3 Introduced version number define.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    93
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
    94
/** Size of an EtherCAT frame header. */
196
f8a1e9f364a3 Introduced version number define.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    95
#define EC_FRAME_HEADER_SIZE 2
f8a1e9f364a3 Introduced version number define.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    96
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
    97
/** Size of an EtherCAT datagram header. */
293
14aeb79aa992 Renamed command structure to datagram.
Florian Pose <fp@igh-essen.com>
parents: 259
diff changeset
    98
#define EC_DATAGRAM_HEADER_SIZE 10
196
f8a1e9f364a3 Introduced version number define.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    99
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   100
/** Size of an EtherCAT datagram footer. */
293
14aeb79aa992 Renamed command structure to datagram.
Florian Pose <fp@igh-essen.com>
parents: 259
diff changeset
   101
#define EC_DATAGRAM_FOOTER_SIZE 2
196
f8a1e9f364a3 Introduced version number define.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
   102
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   103
/** Size of the EtherCAT address field. */
708
90bdb315f560 Fixed EtherCAT addressing problem on big-endian systems. The slaves
Florian Pose <fp@igh-essen.com>
parents: 696
diff changeset
   104
#define EC_ADDR_LEN 4
90bdb315f560 Fixed EtherCAT addressing problem on big-endian systems. The slaves
Florian Pose <fp@igh-essen.com>
parents: 696
diff changeset
   105
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   106
/** Resulting maximum data size of a single datagram in a frame. */
211
c684b6b7adaf Using kernel Ethernet constants.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   107
#define EC_MAX_DATA_SIZE (ETH_DATA_LEN - EC_FRAME_HEADER_SIZE \
293
14aeb79aa992 Renamed command structure to datagram.
Florian Pose <fp@igh-essen.com>
parents: 259
diff changeset
   108
                          - EC_DATAGRAM_HEADER_SIZE - EC_DATAGRAM_FOOTER_SIZE)
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   109
1217
e8a9785e63c3 Introduced EC_MBOX_HEADER_SIZE.
Florian Pose <fp@igh-essen.com>
parents: 1209
diff changeset
   110
/** Mailbox header size.  */
e8a9785e63c3 Introduced EC_MBOX_HEADER_SIZE.
Florian Pose <fp@igh-essen.com>
parents: 1209
diff changeset
   111
#define EC_MBOX_HEADER_SIZE 6
e8a9785e63c3 Introduced EC_MBOX_HEADER_SIZE.
Florian Pose <fp@igh-essen.com>
parents: 1209
diff changeset
   112
872
d4e0380d63b3 Renamed EEPROM to SII.
Florian Pose <fp@igh-essen.com>
parents: 861
diff changeset
   113
/** Word offset of first SII category. */
d4e0380d63b3 Renamed EEPROM to SII.
Florian Pose <fp@igh-essen.com>
parents: 861
diff changeset
   114
#define EC_FIRST_SII_CATEGORY_OFFSET 0x40
696
24fac09b5b26 Limited EEPROM reading; added EC_FIRST_EEPROM_CATEGORY_HEADER define.
Florian Pose <fp@igh-essen.com>
parents: 649
diff changeset
   115
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   116
/** Size of a sync manager configuration page. */
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   117
#define EC_SYNC_PAGE_SIZE 8
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   118
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   119
/** Maximum number of FMMUs per slave. */
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   120
#define EC_MAX_FMMUS 16
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   121
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   122
/** Size of an FMMU configuration page. */
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   123
#define EC_FMMU_PAGE_SIZE 16
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   124
1438
1d30b96bb04f Replaced ecrt_slave_config_dc_cycle_times() and ecrt_slave_config_dc_shift_times() by ecrt_slave_config_dc_sync_signals().
Florian Pose <fp@igh-essen.com>
parents: 1425
diff changeset
   125
/** Number of DC sync signals. */
1d30b96bb04f Replaced ecrt_slave_config_dc_cycle_times() and ecrt_slave_config_dc_shift_times() by ecrt_slave_config_dc_sync_signals().
Florian Pose <fp@igh-essen.com>
parents: 1425
diff changeset
   126
#define EC_SYNC_SIGNAL_COUNT 2
1d30b96bb04f Replaced ecrt_slave_config_dc_cycle_times() and ecrt_slave_config_dc_shift_times() by ecrt_slave_config_dc_sync_signals().
Florian Pose <fp@igh-essen.com>
parents: 1425
diff changeset
   127
1485
5ddc3a455059 ethercat eoe command.
Florian Pose <fp@igh-essen.com>
parents: 1443
diff changeset
   128
/** Size of the datagram description string.
5ddc3a455059 ethercat eoe command.
Florian Pose <fp@igh-essen.com>
parents: 1443
diff changeset
   129
 *
5ddc3a455059 ethercat eoe command.
Florian Pose <fp@igh-essen.com>
parents: 1443
diff changeset
   130
 * This is also used as the maximum lenth of EoE device names.
5ddc3a455059 ethercat eoe command.
Florian Pose <fp@igh-essen.com>
parents: 1443
diff changeset
   131
 **/
5ddc3a455059 ethercat eoe command.
Florian Pose <fp@igh-essen.com>
parents: 1443
diff changeset
   132
#define EC_DATAGRAM_NAME_SIZE 20
5ddc3a455059 ethercat eoe command.
Florian Pose <fp@igh-essen.com>
parents: 1443
diff changeset
   133
989
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   134
/** Slave state mask.
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   135
 *
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   136
 * Apply this mask to a slave state byte to get the slave state without
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   137
 * the error flag.
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   138
 */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   139
#define EC_SLAVE_STATE_MASK 0x0F
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   140
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   141
/** State of an EtherCAT slave.
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   142
 */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   143
typedef enum {
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   144
    EC_SLAVE_STATE_UNKNOWN = 0x00,
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   145
    /**< unknown state */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   146
    EC_SLAVE_STATE_INIT = 0x01,
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   147
    /**< INIT state (no mailbox communication, no IO) */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   148
    EC_SLAVE_STATE_PREOP = 0x02,
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   149
    /**< PREOP state (mailbox communication, no IO) */
1337
0253c74d0940 merge -c1619 branches/1.4-foe: Implemented going to bootstrap state BOOT.
Florian Pose <fp@igh-essen.com>
parents: 1327
diff changeset
   150
    EC_SLAVE_STATE_BOOT = 0x03,
0253c74d0940 merge -c1619 branches/1.4-foe: Implemented going to bootstrap state BOOT.
Florian Pose <fp@igh-essen.com>
parents: 1327
diff changeset
   151
    /**< Bootstrap state (mailbox communication, firmware update) */
989
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   152
    EC_SLAVE_STATE_SAFEOP = 0x04,
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   153
    /**< SAFEOP (mailbox communication and input update) */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   154
    EC_SLAVE_STATE_OP = 0x08,
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   155
    /**< OP (mailbox communication and input/output update) */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   156
    EC_SLAVE_STATE_ACK_ERR = 0x10
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   157
    /**< Acknowledge/Error bit (no actual state) */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   158
} ec_slave_state_t;
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   159
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   160
/** Supported mailbox protocols.
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   161
 */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   162
enum {
1327
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
   163
    EC_MBOX_AOE = 0x01, /**< ADS over EtherCAT */
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
   164
    EC_MBOX_EOE = 0x02, /**< Ethernet over EtherCAT */
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
   165
    EC_MBOX_COE = 0x04, /**< CANopen over EtherCAT */
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
   166
    EC_MBOX_FOE = 0x08, /**< File-Access over EtherCAT */
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
   167
    EC_MBOX_SOE = 0x10, /**< Servo-Profile over EtherCAT */
989
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   168
    EC_MBOX_VOE = 0x20  /**< Vendor specific */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   169
};
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   170
1327
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
   171
/** Slave information interface CANopen over EtherCAT details flags.
989
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   172
 */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   173
typedef struct {
1327
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
   174
    uint8_t enable_sdo : 1; /**< Enable SDO access. */
989
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   175
    uint8_t enable_sdo_info : 1; /**< SDO information service available. */
1327
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
   176
    uint8_t enable_pdo_assign : 1; /**< PDO mapping configurable. */
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
   177
    uint8_t enable_pdo_configuration : 1; /**< PDO configuration possible. */
989
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   178
    uint8_t enable_upload_at_startup : 1; /**< ?. */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   179
    uint8_t enable_sdo_complete_access : 1; /**< Complete access possible. */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   180
} ec_sii_coe_details_t;
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   181
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   182
/** Slave information interface general flags.
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   183
 */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   184
typedef struct {
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   185
    uint8_t enable_safeop : 1; /**< ?. */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   186
    uint8_t enable_not_lrw : 1; /**< Slave does not support LRW. */
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   187
} ec_sii_general_flags_t;
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 883
diff changeset
   188
1379
cbceb0e2f2a0 Reading more base information (incl. whether DC supported).
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   189
/** EtherCAT slave distributed clocks range.
cbceb0e2f2a0 Reading more base information (incl. whether DC supported).
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   190
 */
cbceb0e2f2a0 Reading more base information (incl. whether DC supported).
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   191
typedef enum {
cbceb0e2f2a0 Reading more base information (incl. whether DC supported).
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   192
    EC_DC_32, /**< 32 bit. */
cbceb0e2f2a0 Reading more base information (incl. whether DC supported).
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   193
    EC_DC_64 /*< 64 bit for system time, system time offset and
cbceb0e2f2a0 Reading more base information (incl. whether DC supported).
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   194
               port 0 receive time. */
cbceb0e2f2a0 Reading more base information (incl. whether DC supported).
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   195
} ec_slave_dc_range_t;
cbceb0e2f2a0 Reading more base information (incl. whether DC supported).
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   196
1438
1d30b96bb04f Replaced ecrt_slave_config_dc_cycle_times() and ecrt_slave_config_dc_shift_times() by ecrt_slave_config_dc_sync_signals().
Florian Pose <fp@igh-essen.com>
parents: 1425
diff changeset
   197
/** EtherCAT slave sync signal configuration.
1d30b96bb04f Replaced ecrt_slave_config_dc_cycle_times() and ecrt_slave_config_dc_shift_times() by ecrt_slave_config_dc_sync_signals().
Florian Pose <fp@igh-essen.com>
parents: 1425
diff changeset
   198
 */
1d30b96bb04f Replaced ecrt_slave_config_dc_cycle_times() and ecrt_slave_config_dc_shift_times() by ecrt_slave_config_dc_sync_signals().
Florian Pose <fp@igh-essen.com>
parents: 1425
diff changeset
   199
typedef struct {
1d30b96bb04f Replaced ecrt_slave_config_dc_cycle_times() and ecrt_slave_config_dc_shift_times() by ecrt_slave_config_dc_sync_signals().
Florian Pose <fp@igh-essen.com>
parents: 1425
diff changeset
   200
    uint32_t cycle_time; /**< Cycle time [ns]. */
1d30b96bb04f Replaced ecrt_slave_config_dc_cycle_times() and ecrt_slave_config_dc_shift_times() by ecrt_slave_config_dc_sync_signals().
Florian Pose <fp@igh-essen.com>
parents: 1425
diff changeset
   201
    uint32_t shift_time; /**< Shift time [ns]. */
1d30b96bb04f Replaced ecrt_slave_config_dc_cycle_times() and ecrt_slave_config_dc_shift_times() by ecrt_slave_config_dc_sync_signals().
Florian Pose <fp@igh-essen.com>
parents: 1425
diff changeset
   202
} ec_sync_signal_t;
1d30b96bb04f Replaced ecrt_slave_config_dc_cycle_times() and ecrt_slave_config_dc_shift_times() by ecrt_slave_config_dc_sync_signals().
Florian Pose <fp@igh-essen.com>
parents: 1425
diff changeset
   203
1382
cb2188d111f3 Read SDO entry access rights.
Florian Pose <fp@igh-essen.com>
parents: 1379
diff changeset
   204
/** Access states for SDO entries.
cb2188d111f3 Read SDO entry access rights.
Florian Pose <fp@igh-essen.com>
parents: 1379
diff changeset
   205
 *
cb2188d111f3 Read SDO entry access rights.
Florian Pose <fp@igh-essen.com>
parents: 1379
diff changeset
   206
 * The access rights are managed per AL state.
cb2188d111f3 Read SDO entry access rights.
Florian Pose <fp@igh-essen.com>
parents: 1379
diff changeset
   207
 */
cb2188d111f3 Read SDO entry access rights.
Florian Pose <fp@igh-essen.com>
parents: 1379
diff changeset
   208
enum {
cb2188d111f3 Read SDO entry access rights.
Florian Pose <fp@igh-essen.com>
parents: 1379
diff changeset
   209
    EC_SDO_ENTRY_ACCESS_PREOP, /**< Access rights in PREOP. */
cb2188d111f3 Read SDO entry access rights.
Florian Pose <fp@igh-essen.com>
parents: 1379
diff changeset
   210
    EC_SDO_ENTRY_ACCESS_SAFEOP, /**< Access rights in SAFEOP. */
cb2188d111f3 Read SDO entry access rights.
Florian Pose <fp@igh-essen.com>
parents: 1379
diff changeset
   211
    EC_SDO_ENTRY_ACCESS_OP, /**< Access rights in OP. */
cb2188d111f3 Read SDO entry access rights.
Florian Pose <fp@igh-essen.com>
parents: 1379
diff changeset
   212
    EC_SDO_ENTRY_ACCESS_COUNT /**< Number of states. */
cb2188d111f3 Read SDO entry access rights.
Florian Pose <fp@igh-essen.com>
parents: 1379
diff changeset
   213
};
cb2188d111f3 Read SDO entry access rights.
Florian Pose <fp@igh-essen.com>
parents: 1379
diff changeset
   214
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   215
/*****************************************************************************/
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   216
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   217
/** Convenience macro for printing EtherCAT-specific information to syslog.
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   218
 *
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   219
 * This will print the message in \a fmt with a prefixed "EtherCAT: ".
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   220
 *
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   221
 * \param fmt format string (like in printf())
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   222
 * \param args arguments (optional)
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   223
 */
84
b4ae98855cea printk durch Makros ersetzt.
Florian Pose <fp@igh-essen.com>
parents: 73
diff changeset
   224
#define EC_INFO(fmt, args...) \
b4ae98855cea printk durch Makros ersetzt.
Florian Pose <fp@igh-essen.com>
parents: 73
diff changeset
   225
    printk(KERN_INFO "EtherCAT: " fmt, ##args)
259
87b20532872b Added some documentation.
Florian Pose <fp@igh-essen.com>
parents: 256
diff changeset
   226
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   227
/** Convenience macro for printing EtherCAT-specific errors to syslog.
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   228
 *
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   229
 * This will print the message in \a fmt with a prefixed "EtherCAT ERROR: ".
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   230
 *
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   231
 * \param fmt format string (like in printf())
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   232
 * \param args arguments (optional)
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   233
 */
84
b4ae98855cea printk durch Makros ersetzt.
Florian Pose <fp@igh-essen.com>
parents: 73
diff changeset
   234
#define EC_ERR(fmt, args...) \
b4ae98855cea printk durch Makros ersetzt.
Florian Pose <fp@igh-essen.com>
parents: 73
diff changeset
   235
    printk(KERN_ERR "EtherCAT ERROR: " fmt, ##args)
259
87b20532872b Added some documentation.
Florian Pose <fp@igh-essen.com>
parents: 256
diff changeset
   236
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   237
/** Convenience macro for printing EtherCAT-specific warnings to syslog.
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   238
 *
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   239
 * This will print the message in \a fmt with a prefixed "EtherCAT WARNING: ".
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   240
 *
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   241
 * \param fmt format string (like in printf())
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   242
 * \param args arguments (optional)
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   243
 */
84
b4ae98855cea printk durch Makros ersetzt.
Florian Pose <fp@igh-essen.com>
parents: 73
diff changeset
   244
#define EC_WARN(fmt, args...) \
b4ae98855cea printk durch Makros ersetzt.
Florian Pose <fp@igh-essen.com>
parents: 73
diff changeset
   245
    printk(KERN_WARNING "EtherCAT WARNING: " fmt, ##args)
259
87b20532872b Added some documentation.
Florian Pose <fp@igh-essen.com>
parents: 256
diff changeset
   246
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   247
/** Convenience macro for printing EtherCAT debug messages to syslog.
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   248
 *
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   249
 * This will print the message in \a fmt with a prefixed "EtherCAT DEBUG: ".
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   250
 *
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   251
 * \param fmt format string (like in printf())
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   252
 * \param args arguments (optional)
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   253
 */
84
b4ae98855cea printk durch Makros ersetzt.
Florian Pose <fp@igh-essen.com>
parents: 73
diff changeset
   254
#define EC_DBG(fmt, args...) \
b4ae98855cea printk durch Makros ersetzt.
Florian Pose <fp@igh-essen.com>
parents: 73
diff changeset
   255
    printk(KERN_DEBUG "EtherCAT DEBUG: " fmt, ##args)
b4ae98855cea printk durch Makros ersetzt.
Florian Pose <fp@igh-essen.com>
parents: 73
diff changeset
   256
41
42c66194c0c8 Schoenheitskorrekturen.
Florian Pose <fp@igh-essen.com>
parents: 39
diff changeset
   257
/*****************************************************************************/
42c66194c0c8 Schoenheitskorrekturen.
Florian Pose <fp@igh-essen.com>
parents: 39
diff changeset
   258
1904
2fadf016d9be Moved ABS() macro to globals.
Florian Pose <fp@igh-essen.com>
parents: 1884
diff changeset
   259
/** Absolute value.
2fadf016d9be Moved ABS() macro to globals.
Florian Pose <fp@igh-essen.com>
parents: 1884
diff changeset
   260
 */
2fadf016d9be Moved ABS() macro to globals.
Florian Pose <fp@igh-essen.com>
parents: 1884
diff changeset
   261
#define EC_ABS(X) ((X) >= 0 ? (X) : -(X))
2fadf016d9be Moved ABS() macro to globals.
Florian Pose <fp@igh-essen.com>
parents: 1884
diff changeset
   262
2fadf016d9be Moved ABS() macro to globals.
Florian Pose <fp@igh-essen.com>
parents: 1884
diff changeset
   263
/*****************************************************************************/
2fadf016d9be Moved ABS() macro to globals.
Florian Pose <fp@igh-essen.com>
parents: 1884
diff changeset
   264
444
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 427
diff changeset
   265
extern char *ec_master_version_str;
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 427
diff changeset
   266
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 427
diff changeset
   267
/*****************************************************************************/
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 427
diff changeset
   268
1826
ec6223c3b7ec Multi-master support for command-line tool. The --master option supports
Florian Pose <fp@igh-essen.com>
parents: 1774
diff changeset
   269
unsigned int ec_master_count(void);
325
7833cf70c4f2 VERSION 1.1: New realtime interface, only state machines.
Florian Pose <fp@igh-essen.com>
parents: 293
diff changeset
   270
void ec_print_data(const uint8_t *, size_t);
7833cf70c4f2 VERSION 1.1: New realtime interface, only state machines.
Florian Pose <fp@igh-essen.com>
parents: 293
diff changeset
   271
void ec_print_data_diff(const uint8_t *, const uint8_t *, size_t);
1337
0253c74d0940 merge -c1619 branches/1.4-foe: Implemented going to bootstrap state BOOT.
Florian Pose <fp@igh-essen.com>
parents: 1327
diff changeset
   272
size_t ec_state_string(uint8_t, char *, uint8_t);
639
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 630
diff changeset
   273
ssize_t ec_mac_print(const uint8_t *, char *);
aa23c48dca2d Allow only MAC addresses as device identifiers; replaced master list by
Florian Pose <fp@igh-essen.com>
parents: 630
diff changeset
   274
int ec_mac_is_zero(const uint8_t *);
152
9654f3cf588d Plugfest: Globale Debug-Funktionen f?r Frame-Daten.
Florian Pose <fp@igh-essen.com>
parents: 141
diff changeset
   275
1312
74853e018898 Created backend versions of all API functions returing a pointer; using
Florian Pose <fp@igh-essen.com>
parents: 1217
diff changeset
   276
ec_master_t *ecrt_request_master_err(unsigned int);
74853e018898 Created backend versions of all API functions returing a pointer; using
Florian Pose <fp@igh-essen.com>
parents: 1217
diff changeset
   277
152
9654f3cf588d Plugfest: Globale Debug-Funktionen f?r Frame-Daten.
Florian Pose <fp@igh-essen.com>
parents: 141
diff changeset
   278
/*****************************************************************************/
9654f3cf588d Plugfest: Globale Debug-Funktionen f?r Frame-Daten.
Florian Pose <fp@igh-essen.com>
parents: 141
diff changeset
   279
809
ec4ef8911824 External domain memory.
Florian Pose <fp@igh-essen.com>
parents: 792
diff changeset
   280
/** Code/Message pair.
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   281
 *
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   282
 * Some EtherCAT datagrams support reading a status code to display a certain
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   283
 * message. This type allows to map a code to a message string.
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   284
 */
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   285
typedef struct {
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   286
    uint32_t code; /**< Code. */
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   287
    const char *message; /**< Message belonging to \a code. */
809
ec4ef8911824 External domain memory.
Florian Pose <fp@igh-essen.com>
parents: 792
diff changeset
   288
} ec_code_msg_t;
164
ed85368b2b2e AL status code reading after failed state transition.
Florian Pose <fp@igh-essen.com>
parents: 152
diff changeset
   289
ed85368b2b2e AL status code reading after failed state transition.
Florian Pose <fp@igh-essen.com>
parents: 152
diff changeset
   290
/*****************************************************************************/
ed85368b2b2e AL status code reading after failed state transition.
Florian Pose <fp@igh-essen.com>
parents: 152
diff changeset
   291
861
6e3de145421a Introduced ec_sdo_request_state_t, making ec_request_t private again;
Florian Pose <fp@igh-essen.com>
parents: 858
diff changeset
   292
/** Generic request state.
6e3de145421a Introduced ec_sdo_request_state_t, making ec_request_t private again;
Florian Pose <fp@igh-essen.com>
parents: 858
diff changeset
   293
 *
6e3de145421a Introduced ec_sdo_request_state_t, making ec_request_t private again;
Florian Pose <fp@igh-essen.com>
parents: 858
diff changeset
   294
 * \attention If ever changing this, please be sure to adjust the \a
6e3de145421a Introduced ec_sdo_request_state_t, making ec_request_t private again;
Florian Pose <fp@igh-essen.com>
parents: 858
diff changeset
   295
 * state_table in master/sdo_request.c.
6e3de145421a Introduced ec_sdo_request_state_t, making ec_request_t private again;
Florian Pose <fp@igh-essen.com>
parents: 858
diff changeset
   296
 */
6e3de145421a Introduced ec_sdo_request_state_t, making ec_request_t private again;
Florian Pose <fp@igh-essen.com>
parents: 858
diff changeset
   297
typedef enum {
1209
8be462afb7f4 Added VoE handler.
Florian Pose <fp@igh-essen.com>
parents: 1082
diff changeset
   298
    EC_INT_REQUEST_INIT,
8be462afb7f4 Added VoE handler.
Florian Pose <fp@igh-essen.com>
parents: 1082
diff changeset
   299
    EC_INT_REQUEST_QUEUED,
8be462afb7f4 Added VoE handler.
Florian Pose <fp@igh-essen.com>
parents: 1082
diff changeset
   300
    EC_INT_REQUEST_BUSY,
8be462afb7f4 Added VoE handler.
Florian Pose <fp@igh-essen.com>
parents: 1082
diff changeset
   301
    EC_INT_REQUEST_SUCCESS,
8be462afb7f4 Added VoE handler.
Florian Pose <fp@igh-essen.com>
parents: 1082
diff changeset
   302
    EC_INT_REQUEST_FAILURE
8be462afb7f4 Added VoE handler.
Florian Pose <fp@igh-essen.com>
parents: 1082
diff changeset
   303
} ec_internal_request_state_t;
8be462afb7f4 Added VoE handler.
Florian Pose <fp@igh-essen.com>
parents: 1082
diff changeset
   304
8be462afb7f4 Added VoE handler.
Florian Pose <fp@igh-essen.com>
parents: 1082
diff changeset
   305
/*****************************************************************************/
8be462afb7f4 Added VoE handler.
Florian Pose <fp@igh-essen.com>
parents: 1082
diff changeset
   306
8be462afb7f4 Added VoE handler.
Florian Pose <fp@igh-essen.com>
parents: 1082
diff changeset
   307
extern const ec_request_state_t ec_request_state_translation_table[];
861
6e3de145421a Introduced ec_sdo_request_state_t, making ec_request_t private again;
Florian Pose <fp@igh-essen.com>
parents: 858
diff changeset
   308
6e3de145421a Introduced ec_sdo_request_state_t, making ec_request_t private again;
Florian Pose <fp@igh-essen.com>
parents: 858
diff changeset
   309
/*****************************************************************************/
6e3de145421a Introduced ec_sdo_request_state_t, making ec_request_t private again;
Florian Pose <fp@igh-essen.com>
parents: 858
diff changeset
   310
809
ec4ef8911824 External domain memory.
Florian Pose <fp@igh-essen.com>
parents: 792
diff changeset
   311
/** Origin type.
ec4ef8911824 External domain memory.
Florian Pose <fp@igh-essen.com>
parents: 792
diff changeset
   312
 */
ec4ef8911824 External domain memory.
Florian Pose <fp@igh-essen.com>
parents: 792
diff changeset
   313
typedef enum {
ec4ef8911824 External domain memory.
Florian Pose <fp@igh-essen.com>
parents: 792
diff changeset
   314
    EC_ORIG_INTERNAL, /**< Internal. */
ec4ef8911824 External domain memory.
Florian Pose <fp@igh-essen.com>
parents: 792
diff changeset
   315
    EC_ORIG_EXTERNAL /**< External. */
ec4ef8911824 External domain memory.
Florian Pose <fp@igh-essen.com>
parents: 792
diff changeset
   316
} ec_origin_t;
ec4ef8911824 External domain memory.
Florian Pose <fp@igh-essen.com>
parents: 792
diff changeset
   317
ec4ef8911824 External domain memory.
Florian Pose <fp@igh-essen.com>
parents: 792
diff changeset
   318
/*****************************************************************************/
ec4ef8911824 External domain memory.
Florian Pose <fp@igh-essen.com>
parents: 792
diff changeset
   319
792
3778920f61e4 Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents: 773
diff changeset
   320
typedef struct ec_slave ec_slave_t; /**< \see ec_slave. */
740
68d83b45dfa2 Added ec_slave_get_sdo() and ec_sdo_get_entry().
Florian Pose <fp@igh-essen.com>
parents: 708
diff changeset
   321
68d83b45dfa2 Added ec_slave_get_sdo() and ec_sdo_get_entry().
Florian Pose <fp@igh-essen.com>
parents: 708
diff changeset
   322
/*****************************************************************************/
68d83b45dfa2 Added ec_slave_get_sdo() and ec_sdo_get_entry().
Florian Pose <fp@igh-essen.com>
parents: 708
diff changeset
   323
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   324
#ifdef __KERNEL__
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   325
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   326
/** Mutual exclusion helpers.
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   327
 */
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   328
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   329
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   330
#define ec_mutex_t rt_mutex
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   331
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   332
static inline void ec_mutex_init(struct ec_mutex_t *mutex)
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   333
{
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   334
    rt_mutex_init(mutex);
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   335
}
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   336
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   337
static inline void ec_mutex_lock(struct ec_mutex_t *mutex)
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   338
{
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   339
    rt_mutex_lock(mutex);
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   340
}
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   341
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   342
static inline int ec_mutex_trylock(struct ec_mutex_t *mutex)
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   343
{
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   344
    return rt_mutex_trylock(mutex);
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   345
}
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   346
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   347
static inline int ec_mutex_lock_interruptible(struct ec_mutex_t *mutex)
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   348
{
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   349
    return rt_mutex_lock_interruptible(mutex, 0);
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   350
}
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   351
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   352
static inline void ec_mutex_unlock(struct ec_mutex_t *mutex)
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   353
{
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   354
    rt_mutex_unlock(mutex);
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   355
}
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   356
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   357
#else // < KERNEL_VERSION(2, 6, 24)
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   358
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   359
#define ec_mutex_t semaphore
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   360
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   361
static inline void ec_mutex_init(struct ec_mutex_t *sem)
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   362
{
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   363
    sema_init(sem, 1);
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   364
}
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   365
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   366
static inline void ec_mutex_lock(struct ec_mutex_t *sem)
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   367
{
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   368
    down(sem);
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   369
}
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   370
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   371
static inline int ec_mutex_trylock(struct ec_mutex_t *sem)
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   372
{
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   373
    down(sem);
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   374
    return 1;
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   375
}
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   376
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   377
static inline int ec_mutex_lock_interruptible(struct ec_mutex_t *sem)
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   378
{
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   379
    return down_interruptible(sem);
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   380
}
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   381
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   382
static inline void ec_mutex_unlock(struct ec_mutex_t *sem)
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   383
{
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   384
    up(sem);
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   385
}
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   386
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   387
#endif // KERNEL_VERSION(2, 6, 24)
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   388
2028
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   389
#endif // __KERNEL__
55854f070c4a use rt_mutex instead of semaphore for mutual exclusion (use --enable-mutex)
Martin Troxler <ch1010277@ch10pc446>
parents: 2022
diff changeset
   390
2106
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   391
/*****************************************************************************/
505871ced767 Minor: Fixed line breaks and spacing.
Florian Pose <fp@igh-essen.com>
parents: 2037
diff changeset
   392
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   393
#endif