devices/ecdev.h
author Florian Pose <fp@igh-essen.com>
Wed, 02 Aug 2006 12:25:25 +0000
branchstable-1.0
changeset 1624 9dc190591c0f
parent 1623 05622513f627
permissions -rw-r--r--
MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
104
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
/******************************************************************************
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
 *
195
674071846ee3 Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents: 191
diff changeset
     3
 *  $Id$
104
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
 *
1618
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     5
 *  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     6
 *
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     7
 *  This file is part of the IgH EtherCAT Master.
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     8
 *
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     9
 *  The IgH EtherCAT Master is free software; you can redistribute it
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    10
 *  and/or modify it under the terms of the GNU General Public License
1619
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents: 1618
diff changeset
    11
 *  as published by the Free Software Foundation; either version 2 of the
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents: 1618
diff changeset
    12
 *  License, or (at your option) any later version.
1618
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    13
 *
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    14
 *  The IgH EtherCAT Master is distributed in the hope that it will be
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    15
 *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    17
 *  GNU General Public License for more details.
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    18
 *
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    19
 *  You should have received a copy of the GNU General Public License
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    20
 *  along with the IgH EtherCAT Master; if not, write to the Free Software
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    21
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    22
 *
1619
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents: 1618
diff changeset
    23
 *  The right to use EtherCAT Technology is granted and comes free of
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents: 1618
diff changeset
    24
 *  charge under condition of compatibility of product made by
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents: 1618
diff changeset
    25
 *  Licensee. People intending to distribute/sell products based on the
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents: 1618
diff changeset
    26
 *  code, have to sign an agreement to guarantee that products using
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents: 1618
diff changeset
    27
 *  software based on IgH EtherCAT master stay compatible with the actual
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents: 1618
diff changeset
    28
 *  EtherCAT specification (which are released themselves as an open
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents: 1618
diff changeset
    29
 *  standard) as the (only) precondition to have the right to use EtherCAT
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents: 1618
diff changeset
    30
 *  Technology, IP and trade marks.
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents: 1618
diff changeset
    31
 *
104
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    32
 *****************************************************************************/
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
1618
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    34
/**
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    35
   \file
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    36
   EtherCAT interface for EtherCAT device drivers.
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    37
*/
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    38
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    39
/**
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    40
   \defgroup DeviceInterface EtherCAT device interface
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    41
   Master interface for EtherCAT-capable network device drivers.
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    42
   Through the EtherCAT device interface, EtherCAT-capable network device
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    43
   drivers are able to connect their device(s) to the master, pass received
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    44
   frames and notify the master about status changes. The master on his part,
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    45
   can send his frames through connected devices.
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    46
*/
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    47
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    48
/*****************************************************************************/
5cff10efb927 MERGE trunk -r355:360 -> branches/stable-1.0 (Doxygen, INSTALL, and GPLv2)
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    49
104
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    50
#ifndef _ETHERCAT_DEVICE_H_
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    51
#define _ETHERCAT_DEVICE_H_
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    52
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    53
#include <linux/netdevice.h>
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    54
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    55
/*****************************************************************************/
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    56
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    57
struct ec_device;
1623
05622513f627 MERGE trunk -r450:451 -> branches/stable-1.0 (docs)
Florian Pose <fp@igh-essen.com>
parents: 1619
diff changeset
    58
typedef struct ec_device ec_device_t; /**< \see ec_device */
05622513f627 MERGE trunk -r450:451 -> branches/stable-1.0 (docs)
Florian Pose <fp@igh-essen.com>
parents: 1619
diff changeset
    59
05622513f627 MERGE trunk -r450:451 -> branches/stable-1.0 (docs)
Florian Pose <fp@igh-essen.com>
parents: 1619
diff changeset
    60
/**
05622513f627 MERGE trunk -r450:451 -> branches/stable-1.0 (docs)
Florian Pose <fp@igh-essen.com>
parents: 1619
diff changeset
    61
   Interrupt-Service-Routine Type
05622513f627 MERGE trunk -r450:451 -> branches/stable-1.0 (docs)
Florian Pose <fp@igh-essen.com>
parents: 1619
diff changeset
    62
*/
104
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    63
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    64
typedef irqreturn_t (*ec_isr_t)(int, void *, struct pt_regs *);
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    65
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    66
/*****************************************************************************/
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    67
// Registration functions
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    68
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    69
ec_device_t *ecdev_register(unsigned int master_index,
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    70
                            struct net_device *net_dev, ec_isr_t isr,
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    71
                            struct module *module);
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    72
void ecdev_unregister(unsigned int master_index, ec_device_t *device);
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    73
191
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 104
diff changeset
    74
int ecdev_start(unsigned int master_index);
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 104
diff changeset
    75
void ecdev_stop(unsigned int master_index);
ca805255a935 Prepared Free-Run mode
Florian Pose <fp@igh-essen.com>
parents: 104
diff changeset
    76
104
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    77
/*****************************************************************************/
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    78
// Device methods
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    79
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    80
void ecdev_receive(ec_device_t *device, const void *data, size_t size);
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    81
void ecdev_link_state(ec_device_t *device, uint8_t newstate);
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    82
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    83
/*****************************************************************************/
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    84
052bc82d5442 MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    85
#endif