fp@1335: /****************************************************************************** fp@1335: * fp@1336: * $Id$ fp@1335: * fp@1363: * Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH fp@1335: * fp@1335: * This file is part of the IgH EtherCAT Master. fp@1335: * fp@1363: * The IgH EtherCAT Master is free software; you can redistribute it and/or fp@1363: * modify it under the terms of the GNU General Public License version 2, as fp@1363: * published by the Free Software Foundation. fp@1335: * fp@1363: * The IgH EtherCAT Master is distributed in the hope that it will be useful, fp@1363: * but WITHOUT ANY WARRANTY; without even the implied warranty of fp@1363: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General fp@1363: * Public License for more details. fp@1335: * fp@1363: * You should have received a copy of the GNU General Public License along fp@1363: * with the IgH EtherCAT Master; if not, write to the Free Software fp@1335: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@1335: * fp@1363: * --- fp@1363: * fp@1363: * The license mentioned above concerns the source code only. Using the fp@1363: * EtherCAT technology and brand is only permitted in compliance with the fp@1363: * industrial property and similar rights of Beckhoff Automation GmbH. fp@1335: * fp@1335: *****************************************************************************/ fp@1335: fp@1335: /** fp@1335: \file fp@1335: EtherCAT FoE request structure. fp@1335: */ fp@1335: fp@1335: /*****************************************************************************/ fp@1335: fp@1335: #ifndef __EC_FOE_REQUEST_H__ fp@1335: #define __EC_FOE_REQUEST_H__ fp@1335: fp@2464: #include fp@2464: fp@1335: #include "../include/ecrt.h" fp@1335: fp@1335: #include "globals.h" fp@1335: fp@1335: /*****************************************************************************/ fp@1335: fp@1335: /** FoE request. fp@1335: */ fp@1335: typedef struct { fp@2464: struct list_head list; /**< List item. */ fp@1335: uint8_t *buffer; /**< Pointer to FoE data. */ fp@1335: size_t buffer_size; /**< Size of FoE data memory. */ fp@1335: size_t data_size; /**< Size of FoE data. */ fp@1335: fp@1335: uint32_t issue_timeout; /**< Maximum time in ms, the processing of the fp@1335: request may take. */ fp@1335: uint32_t response_timeout; /**< Maximum time in ms, the transfer is fp@1335: retried, if the slave does not respond. */ fp@1335: ec_direction_t dir; /**< Direction. EC_DIR_OUTPUT means downloading to fp@1335: the slave, EC_DIR_INPUT means uploading from the fp@1335: slave. */ fp@1349: ec_internal_request_state_t state; /**< FoE request state. */ fp@1335: unsigned long jiffies_start; /**< Jiffies, when the request was issued. */ fp@1335: unsigned long jiffies_sent; /**< Jiffies, when the upload/download fp@1335: request was sent. */ fp@1335: uint8_t *file_name; /**< Pointer to the filename. */ fp@1336: uint32_t result; /**< FoE request abort code. Zero on success. */ fp@1336: uint32_t error_code; /**< Error code from an FoE Error Request. */ fp@1335: } ec_foe_request_t; fp@1335: fp@1335: /*****************************************************************************/ fp@1335: fp@2464: void ec_foe_request_init(ec_foe_request_t *, uint8_t *file_name); fp@1335: void ec_foe_request_clear(ec_foe_request_t *); fp@1335: fp@1335: int ec_foe_request_alloc(ec_foe_request_t *, size_t); fp@1335: int ec_foe_request_copy_data(ec_foe_request_t *, const uint8_t *, size_t); fp@1335: int ec_foe_request_timed_out(const ec_foe_request_t *); fp@1335: fp@1335: void ec_foe_request_write(ec_foe_request_t *); fp@1335: void ec_foe_request_read(ec_foe_request_t *); fp@1335: fp@1335: /*****************************************************************************/ fp@1335: fp@1335: #endif