IgH EtherCAT Master  1.5.3
ecdev.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * $Id$
4  *
5  * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
6  *
7  * This file is part of the IgH EtherCAT Master.
8  *
9  * The IgH EtherCAT Master is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License version 2, as
11  * published by the Free Software Foundation.
12  *
13  * The IgH EtherCAT Master is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16  * Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with the IgH EtherCAT Master; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  * ---
23  *
24  * The license mentioned above concerns the source code only. Using the
25  * EtherCAT technology and brand is only permitted in compliance with the
26  * industrial property and similar rights of Beckhoff Automation GmbH.
27  *
28  *****************************************************************************/
29 
43 /*****************************************************************************/
44 
45 #ifndef __ECDEV_H__
46 #define __ECDEV_H__
47 
48 #include <linux/netdevice.h>
49 
50 /*****************************************************************************/
51 
52 struct ec_device;
53 typedef struct ec_device ec_device_t;
57 typedef void (*ec_pollfunc_t)(struct net_device *);
58 
59 /******************************************************************************
60  * Offering/withdrawal functions
61  *****************************************************************************/
62 
63 ec_device_t *ecdev_offer(struct net_device *net_dev, ec_pollfunc_t poll,
64  struct module *module);
65 void ecdev_withdraw(ec_device_t *device);
66 
67 /******************************************************************************
68  * Device methods
69  *****************************************************************************/
70 
71 int ecdev_open(ec_device_t *device);
72 void ecdev_close(ec_device_t *device);
73 void ecdev_receive(ec_device_t *device, const void *data, size_t size);
74 void ecdev_set_link(ec_device_t *device, uint8_t state);
75 uint8_t ecdev_get_link(const ec_device_t *device);
76 
77 /*****************************************************************************/
78 
79 #endif
void ecdev_close(ec_device_t *device)
Makes the master leave IDLE phase and closes the network device.
Definition: device.c:617
int ecdev_open(ec_device_t *device)
Opens the network device and makes the master enter IDLE phase.
Definition: device.c:579
void(* ec_pollfunc_t)(struct net_device *)
Device poll function type.
Definition: ecdev.h:57
EtherCAT device.
Definition: device.h:81
uint8_t ecdev_get_link(const ec_device_t *device)
Reads the link state.
Definition: device.c:711
void ecdev_receive(ec_device_t *device, const void *data, size_t size)
Accepts a received frame.
Definition: device.c:641
ec_device_t * ecdev_offer(struct net_device *net_dev, ec_pollfunc_t poll, struct module *module)
Offers an EtherCAT device to a certain master.
Definition: module.c:484
void ecdev_set_link(ec_device_t *device, uint8_t state)
Sets a new link state.
Definition: device.c:685
void ecdev_withdraw(ec_device_t *device)
Withdraws an EtherCAT device from the master.
Definition: device.c:548