IgH EtherCAT Master  1.5.2
mbox_gateway_request.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * $Id$
4  *
5  * Copyright (C) 2019 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_MBG_REQUEST_H__
38 #define __EC_MBG_REQUEST_H__
39 
40 #include <linux/list.h>
41 
42 #include "globals.h"
43 
44 /*****************************************************************************/
45 
48 typedef struct {
49  struct list_head list;
50  uint8_t *data;
51  size_t mem_size;
52  size_t data_size;
53  uint32_t response_timeout;
56  unsigned long jiffies_sent;
58  uint16_t error_code;
59  uint8_t mbox_type;
61 
62 /*****************************************************************************/
63 
66 
68 int ec_mbg_request_copy_data(ec_mbg_request_t *, const uint8_t *, size_t);
70 
71 /*****************************************************************************/
72 
73 #endif
ec_internal_request_state_t state
Request state.
uint8_t mbox_type
Cached MBox type.
EtherCAT Mailbox Gateway request.
size_t data_size
Size of MBox request data.
uint32_t response_timeout
Maximum time in ms, the transfer is retried, if the slave does not respond.
size_t mem_size
Size of MBox request data memory.
Global definitions and macros.
uint8_t * data
Pointer to MBox request data.
ec_internal_request_state_t
Generic request state.
Definition: globals.h:325
uint16_t error_code
MBox Gateway error code.
int ec_mbg_request_copy_data(ec_mbg_request_t *, const uint8_t *, size_t)
Copies Mbox Gateway data from an external source.
void ec_mbg_request_init(ec_mbg_request_t *)
Mbox Gateway request constructor.
unsigned long jiffies_sent
Jiffies, when the upload/download request was sent.
void ec_mbg_request_clear(ec_mbg_request_t *)
Mbox Gateway request destructor.
void ec_mbg_request_run(ec_mbg_request_t *)
Request to run.
int ec_mbg_request_alloc(ec_mbg_request_t *, size_t)
Pre-allocates the data memory.