IgH EtherCAT Master  1.5.2
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
50typedef 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;
64 unsigned long jiffies_start;
65 unsigned long jiffies_sent;
67 uint8_t *file_name;
68 uint32_t result;
69 uint32_t error_code;
71
72/*****************************************************************************/
73
74void ec_foe_request_init(ec_foe_request_t *, uint8_t *file_name);
76
78int ec_foe_request_copy_data(ec_foe_request_t *, const uint8_t *, size_t);
80
83
84/*****************************************************************************/
85
86#endif
int ec_foe_request_alloc(ec_foe_request_t *, size_t)
Pre-allocates the data memory.
Definition: foe_request.c:111
void ec_foe_request_clear(ec_foe_request_t *)
FoE request destructor.
Definition: foe_request.c:78
void ec_foe_request_read(ec_foe_request_t *)
Prepares a read request (slave to master).
Definition: foe_request.c:214
void ec_foe_request_init(ec_foe_request_t *, uint8_t *file_name)
FoE request constructor.
Definition: foe_request.c:57
int ec_foe_request_timed_out(const ec_foe_request_t *)
Checks, if the timeout was exceeded.
Definition: foe_request.c:164
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:140
void ec_foe_request_write(ec_foe_request_t *)
Prepares a write request (master to slave).
Definition: foe_request.c:228
Global definitions and macros.
ec_internal_request_state_t
Generic request state.
Definition: globals.h:278
ec_direction_t
Direction type for PDO assignment functions.
Definition: ecrt.h:430
FoE request.
Definition: foe_request.h:50
ec_direction_t dir
Direction.
Definition: foe_request.h:60
uint32_t issue_timeout
Maximum time in ms, the processing of the request may take.
Definition: foe_request.h:56
uint32_t response_timeout
Maximum time in ms, the transfer is retried, if the slave does not respond.
Definition: foe_request.h:58
uint32_t result
FoE request abort code.
Definition: foe_request.h:68
unsigned long jiffies_start
Jiffies, when the request was issued.
Definition: foe_request.h:64
size_t buffer_size
Size of FoE data memory.
Definition: foe_request.h:53
uint32_t error_code
Error code from an FoE Error Request.
Definition: foe_request.h:69
uint8_t * buffer
Pointer to FoE data.
Definition: foe_request.h:52
uint8_t * file_name
Pointer to the filename.
Definition: foe_request.h:67
size_t data_size
Size of FoE data.
Definition: foe_request.h:54
unsigned long jiffies_sent
Jiffies, when the upload/download request was sent.
Definition: foe_request.h:65
ec_internal_request_state_t state
FoE request state.
Definition: foe_request.h:63