master/master.h
author Florian Pose <fp@igh-essen.com>
Tue, 07 Nov 2006 13:50:03 +0000
branchstable-1.1
changeset 1734 8590d2fcd839
parent 1732 1cc865ba17c2
child 1739 5fcbd29151d2
permissions -rw-r--r--
MERGE trunk -r686:687 -> branches/stable-1.1 (ChangeLog)
39
6965c23a6826 likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents: 33
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: 33
diff changeset
     3
 *  $Id$
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
 *
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     5
 *  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     6
 *
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
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: 195
diff changeset
     8
 *
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     9
 *  The IgH EtherCAT Master is free software; you can redistribute it
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    10
 *  and/or modify it under the terms of the GNU General Public License
246
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 241
diff changeset
    11
 *  as published by the Free Software Foundation; either version 2 of the
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 241
diff changeset
    12
 *  License, or (at your option) any later version.
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    13
 *
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    14
 *  The IgH EtherCAT Master is distributed in the hope that it will be
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    15
 *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    17
 *  GNU General Public License for more details.
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    18
 *
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    19
 *  You should have received a copy of the GNU General Public License
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    20
 *  along with the IgH EtherCAT Master; if not, write to the Free Software
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    21
 *  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: 195
diff changeset
    22
 *
246
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 241
diff changeset
    23
 *  The right to use EtherCAT Technology is granted and comes free of
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 241
diff changeset
    24
 *  charge under condition of compatibility of product made by
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 241
diff changeset
    25
 *  Licensee. People intending to distribute/sell products based on the
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 241
diff changeset
    26
 *  code, have to sign an agreement to guarantee that products using
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 241
diff changeset
    27
 *  software based on IgH EtherCAT master stay compatible with the actual
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 241
diff changeset
    28
 *  EtherCAT specification (which are released themselves as an open
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 241
diff changeset
    29
 *  standard) as the (only) precondition to have the right to use EtherCAT
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 241
diff changeset
    30
 *  Technology, IP and trade marks.
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 241
diff changeset
    31
 *
39
6965c23a6826 likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents: 33
diff changeset
    32
 *****************************************************************************/
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
199
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
   \file
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    36
   EtherCAT master structure.
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    37
*/
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    38
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    39
/*****************************************************************************/
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    40
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    41
#ifndef _EC_MASTER_H_
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    42
#define _EC_MASTER_H_
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    43
95
0066de7a456d Domains als Liste verwaltet.
Florian Pose <fp@igh-essen.com>
parents: 94
diff changeset
    44
#include <linux/list.h>
178
b84f69db8566 MERGE branches/sysfs -> trunk (whole SysFS implementation)
Florian Pose <fp@igh-essen.com>
parents: 151
diff changeset
    45
#include <linux/sysfs.h>
191
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    46
#include <linux/timer.h>
1728
4cf9c3e9f0bd MERGE trunk -r564:568 -> branches/stable-1.1 (doc, master output, atomic flag)
Florian Pose <fp@igh-essen.com>
parents: 1719
diff changeset
    47
#include <asm/atomic.h>
1731
60b2aad9d40b MERGE trunk -r573:587 -> branches/stable-1.1 (race, bootstrap, mailbox bugfix, debug interface switch)
Florian Pose <fp@igh-essen.com>
parents: 1728
diff changeset
    48
#include <asm/semaphore.h>
95
0066de7a456d Domains als Liste verwaltet.
Florian Pose <fp@igh-essen.com>
parents: 94
diff changeset
    49
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents: 52
diff changeset
    50
#include "device.h"
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents: 52
diff changeset
    51
#include "domain.h"
238
b4960499098f Added finite state machine (FSM) processing.
Florian Pose <fp@igh-essen.com>
parents: 236
diff changeset
    52
#include "fsm.h"
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    53
39
6965c23a6826 likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents: 33
diff changeset
    54
/*****************************************************************************/
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    55
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    56
/**
191
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    57
   EtherCAT master mode.
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    58
*/
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    59
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    60
typedef enum
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    61
{
1715
e675450f2174 MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents: 293
diff changeset
    62
    EC_MASTER_MODE_ORPHANED,
191
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    63
    EC_MASTER_MODE_IDLE,
1715
e675450f2174 MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents: 293
diff changeset
    64
    EC_MASTER_MODE_OPERATION
191
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    65
}
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    66
ec_master_mode_t;
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    67
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    68
/*****************************************************************************/
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    69
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
    70
/**
199
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    71
   Cyclic statistics.
98
f564d0929292 MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents: 95
diff changeset
    72
*/
f564d0929292 MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents: 95
diff changeset
    73
f564d0929292 MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents: 95
diff changeset
    74
typedef struct
f564d0929292 MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents: 95
diff changeset
    75
{
293
14aeb79aa992 Renamed command structure to datagram.
Florian Pose <fp@igh-essen.com>
parents: 286
diff changeset
    76
    unsigned int timeouts; /**< datagram timeouts */
195
674071846ee3 Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents: 191
diff changeset
    77
    unsigned int corrupted; /**< corrupted frames */
1716
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
    78
    unsigned int skipped; /**< skipped datagrams (the ones that were
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
    79
                             requeued when not yet received) */
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
    80
    unsigned int unmatched; /**< unmatched datagrams (received, but not
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
    81
                               queued any longer) */
1719
42ed27ae6785 MERGE trunk -r516:527 -> branches/stable-1.1 (jiffies, bugfixes, pdo defines)
Florian Pose <fp@igh-essen.com>
parents: 1716
diff changeset
    82
    unsigned long output_jiffies; /**< time of last output */
98
f564d0929292 MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents: 95
diff changeset
    83
}
f564d0929292 MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents: 95
diff changeset
    84
ec_stats_t;
f564d0929292 MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents: 95
diff changeset
    85
f564d0929292 MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents: 95
diff changeset
    86
/*****************************************************************************/
f564d0929292 MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents: 95
diff changeset
    87
f564d0929292 MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents: 95
diff changeset
    88
/**
199
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    89
   EtherCAT master.
195
674071846ee3 Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents: 191
diff changeset
    90
   Manages slaves, domains and IO.
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    91
*/
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    92
55
059a9e712aa7 Mit neuer Schnittstelle wieder lauff?hig.
Florian Pose <fp@igh-essen.com>
parents: 54
diff changeset
    93
struct ec_master
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    94
{
241
cd90a22cab28 Minor changes in master.h
Florian Pose <fp@igh-essen.com>
parents: 239
diff changeset
    95
    struct list_head list; /**< list item for module's master list */
1728
4cf9c3e9f0bd MERGE trunk -r564:568 -> branches/stable-1.1 (doc, master output, atomic flag)
Florian Pose <fp@igh-essen.com>
parents: 1719
diff changeset
    96
    atomic_t available; /**< zero, if the master is reserved for RT */
241
cd90a22cab28 Minor changes in master.h
Florian Pose <fp@igh-essen.com>
parents: 239
diff changeset
    97
    unsigned int index; /**< master index */
cd90a22cab28 Minor changes in master.h
Florian Pose <fp@igh-essen.com>
parents: 239
diff changeset
    98
195
674071846ee3 Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents: 191
diff changeset
    99
    struct kobject kobj; /**< kobject */
241
cd90a22cab28 Minor changes in master.h
Florian Pose <fp@igh-essen.com>
parents: 239
diff changeset
   100
1716
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   101
    ec_device_t *device; /**< EtherCAT device */
1731
60b2aad9d40b MERGE trunk -r573:587 -> branches/stable-1.1 (race, bootstrap, mailbox bugfix, debug interface switch)
Florian Pose <fp@igh-essen.com>
parents: 1728
diff changeset
   102
    struct semaphore device_sem; /**< device semaphore */
1716
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   103
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   104
    ec_fsm_t fsm; /**< master state machine */
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   105
    ec_master_mode_t mode; /**< master mode */
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   106
195
674071846ee3 Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents: 191
diff changeset
   107
    struct list_head slaves; /**< list of slaves on the bus */
674071846ee3 Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents: 191
diff changeset
   108
    unsigned int slave_count; /**< number of slaves on the bus */
241
cd90a22cab28 Minor changes in master.h
Florian Pose <fp@igh-essen.com>
parents: 239
diff changeset
   109
293
14aeb79aa992 Renamed command structure to datagram.
Florian Pose <fp@igh-essen.com>
parents: 286
diff changeset
   110
    struct list_head datagram_queue; /**< datagram queue */
14aeb79aa992 Renamed command structure to datagram.
Florian Pose <fp@igh-essen.com>
parents: 286
diff changeset
   111
    uint8_t datagram_index; /**< current datagram index */
241
cd90a22cab28 Minor changes in master.h
Florian Pose <fp@igh-essen.com>
parents: 239
diff changeset
   112
195
674071846ee3 Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents: 191
diff changeset
   113
    struct list_head domains; /**< list of domains */
241
cd90a22cab28 Minor changes in master.h
Florian Pose <fp@igh-essen.com>
parents: 239
diff changeset
   114
195
674071846ee3 Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents: 191
diff changeset
   115
    int debug_level; /**< master debug level */
674071846ee3 Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents: 191
diff changeset
   116
    ec_stats_t stats; /**< cyclic statistics */
241
cd90a22cab28 Minor changes in master.h
Florian Pose <fp@igh-essen.com>
parents: 239
diff changeset
   117
236
34d7ce41e9db Started freerun state machine development.
Florian Pose <fp@igh-essen.com>
parents: 229
diff changeset
   118
    struct workqueue_struct *workqueue; /**< master workqueue */
1715
e675450f2174 MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents: 293
diff changeset
   119
    struct work_struct idle_work; /**< free run work object */
1716
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   120
    uint32_t idle_cycle_times[HZ]; /**< Idle cycle times ring */
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   121
    unsigned int idle_cycle_time_pos; /**< time ring buffer position */
241
cd90a22cab28 Minor changes in master.h
Florian Pose <fp@igh-essen.com>
parents: 239
diff changeset
   122
286
f3352378b4d4 Added missing documentation.
Florian Pose <fp@igh-essen.com>
parents: 275
diff changeset
   123
    struct timer_list eoe_timer; /**< EoE timer object */
1716
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   124
    uint32_t eoe_cycle_times[HZ]; /**< EoE cycle times ring */
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   125
    unsigned int eoe_cycle_time_pos; /**< time ring buffer position */
251
c1d0b63a9302 EoE in Free-Run mode; Finished slave configuration state machine.
Florian Pose <fp@igh-essen.com>
parents: 246
diff changeset
   126
    unsigned int eoe_running; /**< non-zero, if EoE processing is active. */
1716
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   127
    unsigned int eoe_checked; /**< non-zero, if EoE processing is not
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   128
                                 necessary. */
251
c1d0b63a9302 EoE in Free-Run mode; Finished slave configuration state machine.
Florian Pose <fp@igh-essen.com>
parents: 246
diff changeset
   129
    struct list_head eoe_handlers; /**< Ethernet-over-EtherCAT handlers */
1716
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   130
1715
e675450f2174 MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents: 293
diff changeset
   131
    spinlock_t internal_lock; /**< spinlock used in idle mode */
204
5ab50514d9b2 Locking callback interface.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   132
    int (*request_cb)(void *); /**< lock request callback */
5ab50514d9b2 Locking callback interface.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   133
    void (*release_cb)(void *); /**< lock release callback */
5ab50514d9b2 Locking callback interface.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   134
    void *cb_data; /**< data parameter of locking callbacks */
268
4f9c149fb71f EEPROM write enable SysFS entry.
Florian Pose <fp@igh-essen.com>
parents: 251
diff changeset
   135
4f9c149fb71f EEPROM write enable SysFS entry.
Florian Pose <fp@igh-essen.com>
parents: 251
diff changeset
   136
    uint8_t eeprom_write_enable; /**< allow write operations to EEPROMs */
1732
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   137
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   138
    ec_sdo_request_t *sdo_request; /**< pointer to the current SDO request */
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   139
    unsigned int sdo_seq_user; /**< sequence number for user space */
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   140
    unsigned int sdo_seq_master; /**< sequence number for master */
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   141
    struct semaphore sdo_sem; /**< SDO semaphore */
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   142
    struct timer_list sdo_timer; /**< timer for polling sdo processing */
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   143
    struct completion sdo_complete; /**< SDO request completion object */
55
059a9e712aa7 Mit neuer Schnittstelle wieder lauff?hig.
Florian Pose <fp@igh-essen.com>
parents: 54
diff changeset
   144
};
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   145
39
6965c23a6826 likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents: 33
diff changeset
   146
/*****************************************************************************/
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   147
1732
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   148
// master creation/deletion
251
c1d0b63a9302 EoE in Free-Run mode; Finished slave configuration state machine.
Florian Pose <fp@igh-essen.com>
parents: 246
diff changeset
   149
int ec_master_init(ec_master_t *, unsigned int, unsigned int);
1732
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   150
void ec_master_destroy(ec_master_t *);
98
f564d0929292 MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents: 95
diff changeset
   151
1732
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   152
// mode transitions
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   153
int ec_master_enter_idle_mode(ec_master_t *);
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   154
void ec_master_leave_idle_mode(ec_master_t *);
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   155
int ec_master_enter_operation_mode(ec_master_t *);
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   156
void ec_master_leave_operation_mode(ec_master_t *);
191
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 182
diff changeset
   157
251
c1d0b63a9302 EoE in Free-Run mode; Finished slave configuration state machine.
Florian Pose <fp@igh-essen.com>
parents: 246
diff changeset
   158
// EoE
c1d0b63a9302 EoE in Free-Run mode; Finished slave configuration state machine.
Florian Pose <fp@igh-essen.com>
parents: 246
diff changeset
   159
void ec_master_eoe_start(ec_master_t *);
c1d0b63a9302 EoE in Free-Run mode; Finished slave configuration state machine.
Florian Pose <fp@igh-essen.com>
parents: 246
diff changeset
   160
void ec_master_eoe_stop(ec_master_t *);
c1d0b63a9302 EoE in Free-Run mode; Finished slave configuration state machine.
Florian Pose <fp@igh-essen.com>
parents: 246
diff changeset
   161
1732
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   162
// datagram IO
1716
9440f4ff25c7 MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents: 1715
diff changeset
   163
void ec_master_receive_datagrams(ec_master_t *, const uint8_t *, size_t);
293
14aeb79aa992 Renamed command structure to datagram.
Florian Pose <fp@igh-essen.com>
parents: 286
diff changeset
   164
void ec_master_queue_datagram(ec_master_t *, ec_datagram_t *);
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   165
195
674071846ee3 Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents: 191
diff changeset
   166
// misc.
1715
e675450f2174 MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents: 293
diff changeset
   167
void ec_master_output_stats(ec_master_t *);
1732
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   168
void ec_master_destroy_slaves(ec_master_t *);
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   169
void ec_master_calc_addressing(ec_master_t *);
1715
e675450f2174 MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents: 293
diff changeset
   170
1732
1cc865ba17c2 MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents: 1731
diff changeset
   171
// helper functions
1715
e675450f2174 MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents: 293
diff changeset
   172
void ec_sync_config(const ec_sii_sync_t *, const ec_slave_t *, uint8_t *);
275
ba51285d4ef6 Variable-sized data fields, BK1120.
Florian Pose <fp@igh-essen.com>
parents: 268
diff changeset
   173
void ec_fmmu_config(const ec_fmmu_t *, const ec_slave_t *, uint8_t *);
145
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents: 144
diff changeset
   174
39
6965c23a6826 likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents: 33
diff changeset
   175
/*****************************************************************************/
0
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   176
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   177
#endif