IgH EtherCAT Master  1.6.1
foe_request.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH
4  *
5  * This file is part of the IgH EtherCAT Master.
6  *
7  * The IgH EtherCAT Master is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License version 2, as
9  * published by the Free Software Foundation.
10  *
11  * The IgH EtherCAT Master is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
14  * Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with the IgH EtherCAT Master; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  ****************************************************************************/
21 
27 /****************************************************************************/
28 
29 #ifndef __EC_FOE_REQUEST_H__
30 #define __EC_FOE_REQUEST_H__
31 
32 #include <linux/list.h>
33 
34 #include "../include/ecrt.h"
35 
36 #include "globals.h"
37 
38 /****************************************************************************/
39 
42 typedef struct {
43  struct list_head list;
44  uint8_t *buffer;
45  size_t buffer_size;
46  size_t data_size;
48  uint32_t issue_timeout;
50  uint32_t response_timeout;
56  unsigned long jiffies_start;
57  unsigned long jiffies_sent;
59  uint8_t *file_name;
60  uint32_t result;
61  uint32_t error_code;
63 
64 /****************************************************************************/
65 
66 void ec_foe_request_init(ec_foe_request_t *, uint8_t *file_name);
68 
70 int ec_foe_request_copy_data(ec_foe_request_t *, const uint8_t *, size_t);
72 
75 
76 /****************************************************************************/
77 
78 #endif
ec_direction_t dir
Direction.
Definition: foe_request.h:52
void ec_foe_request_read(ec_foe_request_t *)
Prepares a read request (slave to master).
Definition: foe_request.c:171
void ec_foe_request_clear(ec_foe_request_t *)
FoE request destructor.
Definition: foe_request.c:73
unsigned long jiffies_sent
Jiffies, when the upload/download request was sent.
Definition: foe_request.h:57
uint32_t result
FoE request abort code.
Definition: foe_request.h:60
uint32_t response_timeout
Maximum time in ms, the transfer is retried, if the slave does not respond.
Definition: foe_request.h:50
Global definitions and macros.
ec_internal_request_state_t
Generic request state.
Definition: globals.h:287
void ec_foe_request_init(ec_foe_request_t *, uint8_t *file_name)
FoE request constructor.
Definition: foe_request.c:52
size_t buffer_size
Size of FoE data memory.
Definition: foe_request.h:45
int ec_foe_request_alloc(ec_foe_request_t *, size_t)
Pre-allocates the data memory.
Definition: foe_request.c:106
uint8_t * buffer
Pointer to FoE data.
Definition: foe_request.h:44
ec_direction_t
Direction type for PDO assignment functions.
Definition: ecrt.h:504
int ec_foe_request_copy_data(ec_foe_request_t *, const uint8_t *, size_t)
Copies FoE data from an external source.
Definition: foe_request.c:135
size_t data_size
Size of FoE data.
Definition: foe_request.h:46
uint8_t * file_name
Pointer to the filename.
Definition: foe_request.h:59
FoE request.
Definition: foe_request.h:42
unsigned long jiffies_start
Jiffies, when the request was issued.
Definition: foe_request.h:56
int ec_foe_request_timed_out(const ec_foe_request_t *)
Checks, if the timeout was exceeded.
Definition: foe_request.c:159
uint32_t error_code
Error code from an FoE Error Request.
Definition: foe_request.h:61
ec_internal_request_state_t state
FoE request state.
Definition: foe_request.h:55
void ec_foe_request_write(ec_foe_request_t *)
Prepares a write request (master to slave).
Definition: foe_request.c:185
uint32_t issue_timeout
Maximum time in ms, the processing of the request may take.
Definition: foe_request.h:48