IgH EtherCAT Master  1.5.3
soe_request.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 
35 /*****************************************************************************/
36 
37 #ifndef __EC_SOE_REQUEST_H__
38 #define __EC_SOE_REQUEST_H__
39 
40 #include <linux/list.h>
41 
42 #include "globals.h"
43 
44 /*****************************************************************************/
45 
49  struct list_head list;
50  uint8_t drive_no;
51  uint16_t idn;
53  uint8_t *data;
54  size_t mem_size;
55  size_t data_size;
56  uint32_t issue_timeout;
61  unsigned long jiffies_start;
62  unsigned long jiffies_sent;
64  uint16_t error_code;
65 };
66 
67 /*****************************************************************************/
68 
71 
76 int ec_soe_request_copy_data(ec_soe_request_t *, const uint8_t *, size_t);
77 int ec_soe_request_append_data(ec_soe_request_t *, const uint8_t *, size_t);
81 
82 /*****************************************************************************/
83 
84 #endif
uint16_t error_code
SoE error code.
Definition: soe_request.h:64
ec_al_state_t
Application-layer state.
Definition: ecrt.h:557
int ec_soe_request_timed_out(const ec_soe_request_t *)
Checks, if the timeout was exceeded.
Definition: soe_request.c:262
ec_direction_t dir
Direction.
Definition: soe_request.h:58
void ec_soe_request_write(ec_soe_request_t *)
Request a write operation.
Definition: soe_request.c:246
void ec_soe_request_clear(ec_soe_request_t *)
SoE request destructor.
Definition: soe_request.c:77
size_t data_size
Size of SDO data.
Definition: soe_request.h:55
Global definitions and macros.
ec_al_state_t al_state
AL state (only valid for IDN config).
Definition: soe_request.h:52
void ec_soe_request_set_drive_no(ec_soe_request_t *, uint8_t)
Set drive number.
Definition: soe_request.c:105
unsigned long jiffies_start
Jiffies, when the request was issued.
Definition: soe_request.h:61
ec_internal_request_state_t
Generic request state.
Definition: globals.h:278
uint32_t issue_timeout
Maximum time in ms, the processing of the request may take.
Definition: soe_request.h:56
void ec_soe_request_read(ec_soe_request_t *)
Request a read operation.
Definition: soe_request.c:232
int ec_soe_request_append_data(ec_soe_request_t *, const uint8_t *, size_t)
Copies SoE data from an external source.
Definition: soe_request.c:203
void ec_soe_request_init(ec_soe_request_t *)
SoE request constructor.
Definition: soe_request.c:54
struct list_head list
List item.
Definition: soe_request.h:49
ec_direction_t
Direction type for PDO assignment functions.
Definition: ecrt.h:446
int ec_soe_request_alloc(ec_soe_request_t *, size_t)
Pre-allocates the data memory.
Definition: soe_request.c:150
void ec_soe_request_set_idn(ec_soe_request_t *, uint16_t)
Set IDN.
Definition: soe_request.c:117
uint8_t drive_no
Drive number.
Definition: soe_request.h:50
int ec_soe_request_copy_data(ec_soe_request_t *, const uint8_t *, size_t)
Copies SoE data from an external source.
Definition: soe_request.c:179
unsigned long jiffies_sent
Jiffies, when the upload/download request was sent.
Definition: soe_request.h:62
size_t mem_size
Size of SDO data memory.
Definition: soe_request.h:54
uint16_t idn
Sercos ID-Number.
Definition: soe_request.h:51
int ec_soe_request_copy(ec_soe_request_t *, const ec_soe_request_t *)
Copy another SoE request.
Definition: soe_request.c:90
ec_internal_request_state_t state
Request state.
Definition: soe_request.h:60
Sercos-over-EtherCAT request.
Definition: soe_request.h:48
uint8_t * data
Pointer to SDO data.
Definition: soe_request.h:53