IgH EtherCAT Master  1.6.0-rc1
foe_request.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * $Id$
4  *
5  * Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH
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_FOE_REQUEST_H__
38 #define __EC_FOE_REQUEST_H__
39 
40 #include <linux/list.h>
41 
42 #include "../include/ecrt.h"
43 
44 #include "globals.h"
45 
46 /*****************************************************************************/
47 
50 typedef struct {
51  struct list_head list;
52  uint8_t *buffer;
53  size_t buffer_size;
54  size_t data_size;
56  uint32_t issue_timeout;
58  uint32_t response_timeout;
64  unsigned long jiffies_start;
65  unsigned long jiffies_sent;
67  uint8_t *file_name;
68  uint32_t password;
69  uint32_t result;
70  uint32_t error_code;
72 
73 /*****************************************************************************/
74 
75 void ec_foe_request_init(ec_foe_request_t *, uint8_t *file_name);
77 
79 int ec_foe_request_copy_data(ec_foe_request_t *, const uint8_t *, size_t);
81 
84 
85 /*****************************************************************************/
86 
87 #endif
ec_direction_t dir
Direction.
Definition: foe_request.h:60
void ec_foe_request_read(ec_foe_request_t *)
Prepares a read request (slave to master).
Definition: foe_request.c:215
void ec_foe_request_clear(ec_foe_request_t *)
FoE request destructor.
Definition: foe_request.c:79
unsigned long jiffies_sent
Jiffies, when the upload/download request was sent.
Definition: foe_request.h:65
uint32_t result
FoE request abort code.
Definition: foe_request.h:69
uint32_t response_timeout
Maximum time in ms, the transfer is retried, if the slave does not respond.
Definition: foe_request.h:58
Global definitions and macros.
ec_internal_request_state_t
Generic request state.
Definition: globals.h:293
void ec_foe_request_init(ec_foe_request_t *, uint8_t *file_name)
FoE request constructor.
Definition: foe_request.c:57
size_t buffer_size
Size of FoE data memory.
Definition: foe_request.h:53
int ec_foe_request_alloc(ec_foe_request_t *, size_t)
Pre-allocates the data memory.
Definition: foe_request.c:112
uint8_t * buffer
Pointer to FoE data.
Definition: foe_request.h:52
ec_direction_t
Direction type for PDO assignment functions.
Definition: ecrt.h:435
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:141
size_t data_size
Size of FoE data.
Definition: foe_request.h:54
uint8_t * file_name
Pointer to the filename.
Definition: foe_request.h:67
FoE request.
Definition: foe_request.h:50
unsigned long jiffies_start
Jiffies, when the request was issued.
Definition: foe_request.h:64
int ec_foe_request_timed_out(const ec_foe_request_t *)
Checks, if the timeout was exceeded.
Definition: foe_request.c:165
uint32_t error_code
Error code from an FoE Error Request.
Definition: foe_request.h:70
ec_internal_request_state_t state
FoE request state.
Definition: foe_request.h:63
void ec_foe_request_write(ec_foe_request_t *)
Prepares a write request (master to slave).
Definition: foe_request.c:229
uint32_t password
Password needed for FoE.
Definition: foe_request.h:68
uint32_t issue_timeout
Maximum time in ms, the processing of the request may take.
Definition: foe_request.h:56