Merge branch 'devel-1.6' into ethercat-backport_setip

This commit is contained in:
Florian Pose
2024-02-01 15:30:05 +01:00
284 changed files with 2449 additions and 2802 deletions
+3 -5
View File
@@ -1,6 +1,4 @@
#------------------------------------------------------------------------------
#
# $Id$
#-----------------------------------------------------------------------------
#
# Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH
#
@@ -23,7 +21,7 @@
#
# vi: syntax=make
#
#------------------------------------------------------------------------------
#-----------------------------------------------------------------------------
src := @abs_srcdir@
ccflags-y := -I@abs_top_builddir@
@@ -103,4 +101,4 @@ REV := $(shell if test -s $(src)/../revision; then \
CFLAGS_module.o := -DREV=$(REV)
#------------------------------------------------------------------------------
#-----------------------------------------------------------------------------
+4 -5
View File
@@ -1,6 +1,4 @@
#------------------------------------------------------------------------------
#
# $Id$
#-----------------------------------------------------------------------------
#
# Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH
#
@@ -19,7 +17,8 @@
# with the IgH EtherCAT Master; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------------------------
#-----------------------------------------------------------------------------
include $(top_srcdir)/Makefile.kbuild
# using HEADERS to enable tags target
@@ -72,4 +71,4 @@ noinst_HEADERS = \
sync_config.c sync_config.h \
voe_handler.c voe_handler.h
#------------------------------------------------------------------------------
#-----------------------------------------------------------------------------
+15 -15
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2006-2020 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -17,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT master character device.
*/
/*****************************************************************************/
/****************************************************************************/
#include <linux/module.h>
#include <linux/vmalloc.h>
@@ -41,7 +41,7 @@
*/
#define DEBUG 0
/*****************************************************************************/
/****************************************************************************/
static int eccdev_open(struct inode *, struct file *);
static int eccdev_release(struct inode *, struct file *);
@@ -64,7 +64,7 @@ static FAULT_RETURN_TYPE eccdev_vma_fault(
#endif
struct vm_fault *);
/*****************************************************************************/
/****************************************************************************/
/** File operation callbacks for the EtherCAT character device.
*/
@@ -82,7 +82,7 @@ struct vm_operations_struct eccdev_vm_ops = {
.fault = eccdev_vma_fault
};
/*****************************************************************************/
/****************************************************************************/
/** Private data structure for file handles.
*/
@@ -91,7 +91,7 @@ typedef struct {
ec_ioctl_context_t ctx; /**< Context. */
} ec_cdev_priv_t;
/*****************************************************************************/
/****************************************************************************/
/** Constructor.
*
@@ -119,7 +119,7 @@ int ec_cdev_init(
return ret;
}
/*****************************************************************************/
/****************************************************************************/
/** Destructor.
*/
@@ -128,9 +128,9 @@ void ec_cdev_clear(ec_cdev_t *cdev /**< EtherCAT XML device */)
cdev_del(&cdev->cdev);
}
/******************************************************************************
/*****************************************************************************
* File operations
*****************************************************************************/
****************************************************************************/
/** Called when the cdev is opened.
*/
@@ -160,7 +160,7 @@ int eccdev_open(struct inode *inode, struct file *filp)
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Called when the cdev is closed.
*/
@@ -185,7 +185,7 @@ int eccdev_release(struct inode *inode, struct file *filp)
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Called when an ioctl() command is issued.
*/
@@ -202,7 +202,7 @@ long eccdev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
return ec_ioctl(priv->cdev->master, &priv->ctx, cmd, (void __user *) arg);
}
/*****************************************************************************/
/****************************************************************************/
#ifndef VM_DONTDUMP
/** VM_RESERVED disappeared in 3.7.
@@ -237,7 +237,7 @@ int eccdev_mmap(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Page fault callback for a virtual memory area.
*
@@ -278,4 +278,4 @@ static FAULT_RETURN_TYPE eccdev_vma_fault(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT master character device.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_CDEV_H__
#define __EC_CDEV_H__
@@ -36,7 +34,7 @@
#include "globals.h"
/*****************************************************************************/
/****************************************************************************/
/** EtherCAT master character device.
*/
@@ -45,11 +43,11 @@ typedef struct {
struct cdev cdev; /**< Character device. */
} ec_cdev_t;
/*****************************************************************************/
/****************************************************************************/
int ec_cdev_init(ec_cdev_t *, ec_master_t *, dev_t);
void ec_cdev_clear(ec_cdev_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+11 -13
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2012 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -21,19 +19,19 @@
*
* vim: expandtab
*
*****************************************************************************/
****************************************************************************/
/** \file
* EtherCAT CoE emergency ring buffer methods.
*/
/*****************************************************************************/
/****************************************************************************/
#include <linux/slab.h>
#include "coe_emerg_ring.h"
/*****************************************************************************/
/****************************************************************************/
/** Emergency ring buffer constructor.
*/
@@ -50,7 +48,7 @@ void ec_coe_emerg_ring_init(
ring->overruns = 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Emergency ring buffer destructor.
*/
@@ -63,7 +61,7 @@ void ec_coe_emerg_ring_clear(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Set the ring size.
*
@@ -100,7 +98,7 @@ int ec_coe_emerg_ring_size(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Add a new emergency message.
*/
@@ -120,7 +118,7 @@ void ec_coe_emerg_ring_push(
ring->write_index = (ring->write_index + 1) % (ring->size + 1);
}
/*****************************************************************************/
/****************************************************************************/
/** Remove an emergency message from the ring.
*
@@ -140,7 +138,7 @@ int ec_coe_emerg_ring_pop(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Clear the ring.
*
@@ -155,7 +153,7 @@ int ec_coe_emerg_ring_clear_ring(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Read the number of overruns.
*
@@ -168,4 +166,4 @@ int ec_coe_emerg_ring_overruns(
return ring->overruns;
}
/*****************************************************************************/
/****************************************************************************/
+7 -9
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2012 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,21 +17,21 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT CoE emergency ring buffer structure.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_COE_EMERG_RING_H__
#define __EC_COE_EMERG_RING_H__
#include "globals.h"
/*****************************************************************************/
/****************************************************************************/
/** EtherCAT CoE emergency message record.
*/
@@ -41,7 +39,7 @@ typedef struct {
u8 data[EC_COE_EMERGENCY_MSG_SIZE]; /**< Message data. */
} ec_coe_emerg_msg_t;
/*****************************************************************************/
/****************************************************************************/
/** EtherCAT CoE emergency ring buffer.
*/
@@ -56,7 +54,7 @@ typedef struct {
unsigned int overruns; /**< Number of overruns since last reset. */
} ec_coe_emerg_ring_t;
/*****************************************************************************/
/****************************************************************************/
void ec_coe_emerg_ring_init(ec_coe_emerg_ring_t *, ec_slave_config_t *);
void ec_coe_emerg_ring_clear(ec_coe_emerg_ring_t *);
@@ -67,6 +65,6 @@ int ec_coe_emerg_ring_pop(ec_coe_emerg_ring_t *, u8 *);
int ec_coe_emerg_ring_clear_ring(ec_coe_emerg_ring_t *);
int ec_coe_emerg_ring_overruns(ec_coe_emerg_ring_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+32 -34
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,21 +17,21 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
Methods of an EtherCAT datagram.
*/
/*****************************************************************************/
/****************************************************************************/
#include <linux/slab.h>
#include "datagram.h"
#include "master.h"
/*****************************************************************************/
/****************************************************************************/
/** \cond */
@@ -51,7 +49,7 @@
/** \endcond */
/*****************************************************************************/
/****************************************************************************/
/** Array of datagram type strings used in ec_datagram_type_string().
*
@@ -75,7 +73,7 @@ static const char *type_strings[] = {
"FRMW"
};
/*****************************************************************************/
/****************************************************************************/
/** Constructor.
*/
@@ -105,7 +103,7 @@ void ec_datagram_init(ec_datagram_t *datagram /**< EtherCAT datagram. */)
memset(datagram->name, 0x00, EC_DATAGRAM_NAME_SIZE);
}
/*****************************************************************************/
/****************************************************************************/
/** Destructor.
*/
@@ -119,7 +117,7 @@ void ec_datagram_clear(ec_datagram_t *datagram /**< EtherCAT datagram. */)
}
}
/*****************************************************************************/
/****************************************************************************/
/** Unqueue datagram.
*/
@@ -130,7 +128,7 @@ void ec_datagram_unqueue(ec_datagram_t *datagram /**< EtherCAT datagram. */)
}
}
/*****************************************************************************/
/****************************************************************************/
/** Allocates internal payload memory.
*
@@ -165,7 +163,7 @@ int ec_datagram_prealloc(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Fills the datagram payload memory with zeros.
*/
@@ -174,7 +172,7 @@ void ec_datagram_zero(ec_datagram_t *datagram /**< EtherCAT datagram. */)
memset(datagram->data, 0x00, datagram->data_size);
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT APRD datagram.
*
@@ -195,7 +193,7 @@ int ec_datagram_aprd(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT APWR datagram.
*
@@ -216,7 +214,7 @@ int ec_datagram_apwr(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT APRW datagram.
*
@@ -237,7 +235,7 @@ int ec_datagram_aprw(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT ARMW datagram.
*
@@ -258,7 +256,7 @@ int ec_datagram_armw(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT FPRD datagram.
*
@@ -283,7 +281,7 @@ int ec_datagram_fprd(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT FPWR datagram.
*
@@ -308,7 +306,7 @@ int ec_datagram_fpwr(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT FPRW datagram.
*
@@ -333,7 +331,7 @@ int ec_datagram_fprw(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT FRMW datagram.
*
@@ -358,7 +356,7 @@ int ec_datagram_frmw(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT BRD datagram.
*
@@ -378,7 +376,7 @@ int ec_datagram_brd(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT BWR datagram.
*
@@ -398,7 +396,7 @@ int ec_datagram_bwr(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT BRW datagram.
*
@@ -418,7 +416,7 @@ int ec_datagram_brw(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT LRD datagram.
*
@@ -437,7 +435,7 @@ int ec_datagram_lrd(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT LWR datagram.
*
@@ -456,7 +454,7 @@ int ec_datagram_lwr(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT LRW datagram.
*
@@ -475,7 +473,7 @@ int ec_datagram_lrw(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT LRD datagram with external memory.
*
@@ -500,7 +498,7 @@ int ec_datagram_lrd_ext(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT LWR datagram with external memory.
*
@@ -525,7 +523,7 @@ int ec_datagram_lwr_ext(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an EtherCAT LRW datagram with external memory.
*
@@ -550,7 +548,7 @@ int ec_datagram_lrw_ext(
EC_FUNC_FOOTER;
}
/*****************************************************************************/
/****************************************************************************/
/** Prints the state of a datagram.
*
@@ -587,7 +585,7 @@ void ec_datagram_print_state(
printk(KERN_CONT ".\n");
}
/*****************************************************************************/
/****************************************************************************/
/** Evaluates the working counter of a single-cast datagram.
*
@@ -609,7 +607,7 @@ void ec_datagram_print_wc_error(
printk(KERN_CONT "\n");
}
/*****************************************************************************/
/****************************************************************************/
/** Outputs datagram statistics at most every second.
*/
@@ -630,7 +628,7 @@ void ec_datagram_output_stats(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Returns a string describing the datagram type.
*
@@ -643,4 +641,4 @@ const char *ec_datagram_type_string(
return type_strings[datagram->type];
}
/*****************************************************************************/
/****************************************************************************/
+8 -10
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT datagram structure.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_DATAGRAM_H__
#define __EC_DATAGRAM_H__
@@ -37,7 +35,7 @@
#include "globals.h"
/*****************************************************************************/
/****************************************************************************/
/** EtherCAT datagram type.
*/
@@ -61,7 +59,7 @@ typedef enum {
Write. */
} ec_datagram_type_t;
/*****************************************************************************/
/****************************************************************************/
/** EtherCAT datagram state.
*/
@@ -74,7 +72,7 @@ typedef enum {
EC_DATAGRAM_ERROR /**< Error while sending/receiving (dequeued). */
} ec_datagram_state_t;
/*****************************************************************************/
/****************************************************************************/
/** EtherCAT datagram.
*/
@@ -106,7 +104,7 @@ typedef struct {
char name[EC_DATAGRAM_NAME_SIZE]; /**< Description of the datagram. */
} ec_datagram_t;
/*****************************************************************************/
/****************************************************************************/
void ec_datagram_init(ec_datagram_t *);
void ec_datagram_clear(ec_datagram_t *);
@@ -137,6 +135,6 @@ void ec_datagram_print_wc_error(const ec_datagram_t *);
void ec_datagram_output_stats(ec_datagram_t *);
const char *ec_datagram_type_string(const ec_datagram_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+7 -9
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,21 +17,21 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT datagram pair methods.
*/
/*****************************************************************************/
/****************************************************************************/
#include <linux/slab.h>
#include "master.h"
#include "datagram_pair.h"
/*****************************************************************************/
/****************************************************************************/
/** Datagram pair constructor.
*
@@ -138,7 +136,7 @@ out_datagrams:
return ret;
}
/*****************************************************************************/
/****************************************************************************/
/** Datagram pair destructor.
*/
@@ -161,7 +159,7 @@ void ec_datagram_pair_clear(
#endif
}
/*****************************************************************************/
/****************************************************************************/
/** Process received data.
*
@@ -192,4 +190,4 @@ uint16_t ec_datagram_pair_process(
return pair_wc;
}
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT datagram pair structure.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_DATAGRAM_PAIR_H__
#define __EC_DATAGRAM_PAIR_H__
@@ -36,7 +34,7 @@
#include "globals.h"
#include "datagram.h"
/*****************************************************************************/
/****************************************************************************/
/** Domain datagram pair.
*/
@@ -50,7 +48,7 @@ typedef struct {
unsigned int expected_working_counter; /**< Expectord working conter. */
} ec_datagram_pair_t;
/*****************************************************************************/
/****************************************************************************/
int ec_datagram_pair_init(ec_datagram_pair_t *, ec_domain_t *, uint32_t,
uint8_t *, size_t, const unsigned int []);
@@ -58,6 +56,6 @@ void ec_datagram_pair_clear(ec_datagram_pair_t *);
uint16_t ec_datagram_pair_process(ec_datagram_pair_t *, uint16_t[]);
/*****************************************************************************/
/****************************************************************************/
#endif
+15 -17
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
Ethernet interface for debugging purposes.
*/
/*****************************************************************************/
/****************************************************************************/
#include <linux/version.h>
#include <linux/netdevice.h>
@@ -36,7 +34,7 @@
#include "master.h"
#include "debug.h"
/*****************************************************************************/
/****************************************************************************/
// net_device functions
int ec_dbgdev_open(struct net_device *);
@@ -54,7 +52,7 @@ static const struct net_device_ops ec_dbg_netdev_ops =
.ndo_get_stats = ec_dbgdev_stats,
};
/*****************************************************************************/
/****************************************************************************/
/** Debug interface constructor.
*
@@ -96,7 +94,7 @@ int ec_debug_init(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Debug interface destructor.
*
@@ -110,7 +108,7 @@ void ec_debug_clear(
free_netdev(dbg->dev);
}
/*****************************************************************************/
/****************************************************************************/
/** Register debug interface.
*/
@@ -139,7 +137,7 @@ void ec_debug_register(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Unregister debug interface.
*/
@@ -154,7 +152,7 @@ void ec_debug_unregister(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Sends frame data to the interface.
*/
@@ -189,9 +187,9 @@ void ec_debug_send(
netif_rx(skb);
}
/******************************************************************************
/*****************************************************************************
* NET_DEVICE functions
*****************************************************************************/
****************************************************************************/
/** Opens the virtual network device.
*
@@ -208,7 +206,7 @@ int ec_dbgdev_open(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Stops the virtual network device.
*
@@ -225,7 +223,7 @@ int ec_dbgdev_stop(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Transmits data via the virtual network device.
*
@@ -243,7 +241,7 @@ int ec_dbgdev_tx(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Gets statistics about the virtual network device.
*
@@ -257,4 +255,4 @@ struct net_device_stats *ec_dbgdev_stats(
return &dbg->stats;
}
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,21 +17,21 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
Network interface for debugging purposes.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_DEBUG_H__
#define __EC_DEBUG_H__
#include "../devices/ecdev.h"
/*****************************************************************************/
/****************************************************************************/
/** Debugging network interface.
*/
@@ -47,7 +45,7 @@ typedef struct
}
ec_debug_t;
/*****************************************************************************/
/****************************************************************************/
int ec_debug_init(ec_debug_t *, ec_device_t *, const char *);
void ec_debug_clear(ec_debug_t *);
@@ -57,4 +55,4 @@ void ec_debug_send(ec_debug_t *, const uint8_t *, size_t);
#endif
/*****************************************************************************/
/****************************************************************************/
+25 -27
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT device methods.
*/
/*****************************************************************************/
/****************************************************************************/
#include <linux/module.h>
#include <linux/skbuff.h>
@@ -48,7 +46,7 @@
} while (0)
#endif
/*****************************************************************************/
/****************************************************************************/
enum {
/* genet driver needs extra headroom in skb for status block */
@@ -154,7 +152,7 @@ out_return:
return ret;
}
/*****************************************************************************/
/****************************************************************************/
/** Destructor.
*/
@@ -174,7 +172,7 @@ void ec_device_clear(
#endif
}
/*****************************************************************************/
/****************************************************************************/
/** Associate with net_device.
*/
@@ -205,7 +203,7 @@ void ec_device_attach(
#endif
}
/*****************************************************************************/
/****************************************************************************/
/** Disconnect from net_device.
*/
@@ -232,7 +230,7 @@ void ec_device_detach(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Opens the EtherCAT device.
*
@@ -265,7 +263,7 @@ int ec_device_open(
return ret;
}
/*****************************************************************************/
/****************************************************************************/
/** Stops the EtherCAT device.
*
@@ -294,7 +292,7 @@ int ec_device_close(
return ret;
}
/*****************************************************************************/
/****************************************************************************/
/** Returns a pointer to the device's transmit memory.
*
@@ -312,7 +310,7 @@ uint8_t *ec_device_tx_data(
return device->tx_skb[device->tx_ring_index]->data + ETH_HLEN;
}
/*****************************************************************************/
/****************************************************************************/
/** Sends the content of the transmit socket buffer.
*
@@ -354,7 +352,7 @@ void ec_device_send(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Clears the frame statistics.
*/
@@ -383,7 +381,7 @@ void ec_device_clear_stats(
}
}
/*****************************************************************************/
/****************************************************************************/
#ifdef EC_DEBUG_RING
/** Appends frame data to the debug ring.
@@ -413,7 +411,7 @@ void ec_device_debug_ring_append(
device->debug_frame_count++;
}
/*****************************************************************************/
/****************************************************************************/
/** Outputs the debug ring.
*/
@@ -454,7 +452,7 @@ void ec_device_debug_ring_print(
}
#endif
/*****************************************************************************/
/****************************************************************************/
/** Calls the poll function of the assigned net_device.
*
@@ -476,7 +474,7 @@ void ec_device_poll(
device->poll(device->dev);
}
/*****************************************************************************/
/****************************************************************************/
/** Update device statistics.
*/
@@ -513,9 +511,9 @@ void ec_device_update_stats(
device->last_rx_bytes = device->rx_bytes;
}
/******************************************************************************
/*****************************************************************************
* Device interface
*****************************************************************************/
****************************************************************************/
/** Withdraws an EtherCAT device from the master.
*
@@ -551,7 +549,7 @@ void ecdev_withdraw(ec_device_t *device /**< EtherCAT device */)
up(&master->device_sem);
}
/*****************************************************************************/
/****************************************************************************/
/** Opens the network device and makes the master enter IDLE phase.
*
@@ -589,7 +587,7 @@ int ecdev_open(ec_device_t *device /**< EtherCAT device */)
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Makes the master leave IDLE phase and closes the network device.
*
@@ -609,7 +607,7 @@ void ecdev_close(ec_device_t *device /**< EtherCAT device */)
}
}
/*****************************************************************************/
/****************************************************************************/
/** Accepts a received frame.
*
@@ -655,7 +653,7 @@ void ecdev_receive(
ec_master_receive_datagrams(device->master, device, ec_data, ec_size);
}
/*****************************************************************************/
/****************************************************************************/
/** Sets a new link state.
*
@@ -682,7 +680,7 @@ void ecdev_set_link(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Reads the link state.
*
@@ -702,7 +700,7 @@ uint8_t ecdev_get_link(
return device->link_state;
}
/*****************************************************************************/
/****************************************************************************/
/** \cond */
@@ -715,4 +713,4 @@ EXPORT_SYMBOL(ecdev_set_link);
/** \endcond */
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT device structure.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_DEVICE_H__
#define __EC_DEVICE_H__
@@ -64,7 +62,7 @@ typedef struct {
#endif
/*****************************************************************************/
/****************************************************************************/
/**
EtherCAT device.
@@ -123,7 +121,7 @@ struct ec_device
#endif
};
/*****************************************************************************/
/****************************************************************************/
int ec_device_init(ec_device_t *, ec_master_t *);
void ec_device_clear(ec_device_t *);
@@ -147,6 +145,6 @@ void ec_device_debug_ring_append(ec_device_t *, ec_debug_frame_dir_t,
void ec_device_debug_ring_print(const ec_device_t *);
#endif
/*****************************************************************************/
/****************************************************************************/
#endif
+24 -26
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT domain methods.
*/
/*****************************************************************************/
/****************************************************************************/
#include <linux/module.h>
@@ -41,11 +39,11 @@
*/
#define DEBUG_REDUNDANCY 0
/*****************************************************************************/
/****************************************************************************/
void ec_domain_clear_data(ec_domain_t *);
/*****************************************************************************/
/****************************************************************************/
/** Domain constructor.
*/
@@ -75,7 +73,7 @@ void ec_domain_init(
domain->notify_jiffies = 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Domain destructor.
*/
@@ -93,7 +91,7 @@ void ec_domain_clear(ec_domain_t *domain /**< EtherCAT domain */)
ec_domain_clear_data(domain);
}
/*****************************************************************************/
/****************************************************************************/
/** Frees internally allocated memory.
*/
@@ -109,7 +107,7 @@ void ec_domain_clear_data(
domain->data_origin = EC_ORIG_INTERNAL;
}
/*****************************************************************************/
/****************************************************************************/
/** Adds an FMMU configuration to the domain.
*/
@@ -128,7 +126,7 @@ void ec_domain_add_fmmu_config(
domain->index, fmmu->data_size, domain->data_size);
}
/*****************************************************************************/
/****************************************************************************/
/** Allocates a domain datagram pair and appends it to the list.
*
@@ -174,7 +172,7 @@ int ec_domain_add_datagram_pair(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Domain finish helper function.
*
@@ -205,7 +203,7 @@ int shall_count(
return 1;
}
/*****************************************************************************/
/****************************************************************************/
/** Finishes a domain.
*
@@ -319,7 +317,7 @@ int ec_domain_finish(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Get the number of FMMU configurations of the domain.
*/
@@ -335,7 +333,7 @@ unsigned int ec_domain_fmmu_count(const ec_domain_t *domain)
return num;
}
/*****************************************************************************/
/****************************************************************************/
/** Get a certain FMMU configuration via its position in the list.
*
@@ -357,7 +355,7 @@ const ec_fmmu_config_t *ec_domain_find_fmmu(
return NULL;
}
/*****************************************************************************/
/****************************************************************************/
#if EC_MAX_NUM_DEVICES > 1
@@ -385,9 +383,9 @@ int data_changed(
#endif
/******************************************************************************
/*****************************************************************************
* Application interface
*****************************************************************************/
****************************************************************************/
int ecrt_domain_reg_pdo_entry_list(ec_domain_t *domain,
const ec_pdo_entry_reg_t *regs)
@@ -416,14 +414,14 @@ int ecrt_domain_reg_pdo_entry_list(ec_domain_t *domain,
return 0;
}
/*****************************************************************************/
/****************************************************************************/
size_t ecrt_domain_size(const ec_domain_t *domain)
{
return domain->data_size;
}
/*****************************************************************************/
/****************************************************************************/
void ecrt_domain_external_memory(ec_domain_t *domain, uint8_t *mem)
{
@@ -440,14 +438,14 @@ void ecrt_domain_external_memory(ec_domain_t *domain, uint8_t *mem)
up(&domain->master->master_sem);
}
/*****************************************************************************/
/****************************************************************************/
uint8_t *ecrt_domain_data(ec_domain_t *domain)
{
return domain->data;
}
/*****************************************************************************/
/****************************************************************************/
void ecrt_domain_process(ec_domain_t *domain)
{
@@ -637,7 +635,7 @@ void ecrt_domain_process(ec_domain_t *domain)
#endif
}
/*****************************************************************************/
/****************************************************************************/
void ecrt_domain_queue(ec_domain_t *domain)
{
@@ -667,7 +665,7 @@ void ecrt_domain_queue(ec_domain_t *domain)
}
}
/*****************************************************************************/
/****************************************************************************/
void ecrt_domain_state(const ec_domain_t *domain, ec_domain_state_t *state)
{
@@ -694,7 +692,7 @@ void ecrt_domain_state(const ec_domain_t *domain, ec_domain_state_t *state)
state->redundancy_active = domain->redundancy_active;
}
/*****************************************************************************/
/****************************************************************************/
/** \cond */
@@ -708,4 +706,4 @@ EXPORT_SYMBOL(ecrt_domain_state);
/** \endcond */
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT domain structure.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_DOMAIN_H__
#define __EC_DOMAIN_H__
@@ -38,7 +36,7 @@
#include "master.h"
#include "fmmu_config.h"
/*****************************************************************************/
/****************************************************************************/
/** EtherCAT domain.
*
@@ -68,7 +66,7 @@ struct ec_domain
unsigned long notify_jiffies; /**< Time of last notification. */
};
/*****************************************************************************/
/****************************************************************************/
void ec_domain_init(ec_domain_t *, ec_master_t *, unsigned int);
void ec_domain_clear(ec_domain_t *);
@@ -79,6 +77,6 @@ int ec_domain_finish(ec_domain_t *, uint32_t);
unsigned int ec_domain_fmmu_count(const ec_domain_t *);
const ec_fmmu_config_t *ec_domain_find_fmmu(const ec_domain_t *, unsigned int);
/*****************************************************************************/
/****************************************************************************/
#endif
+4 -4
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -17,7 +17,7 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
// This file only contains the doxygen mainpage.
@@ -25,7 +25,7 @@
* Doxygen mainpage only.
*/
/*****************************************************************************/
/****************************************************************************/
/**
\mainpage
@@ -76,4 +76,4 @@
\endverbatim
*/
/*****************************************************************************/
/****************************************************************************/
+42 -39
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,18 +17,20 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
Ethernet over EtherCAT (EoE).
*/
/*****************************************************************************/
/****************************************************************************/
#include <linux/version.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/lockdep.h>
#include <linux/skbuff.h>
#include "globals.h"
#include "master.h"
@@ -38,7 +38,7 @@
#include "mailbox.h"
#include "ethernet.h"
/*****************************************************************************/
/****************************************************************************/
/** Defines the debug level of EoE processing.
*
@@ -57,7 +57,7 @@
*/
#define EC_EOE_TRIES 100
/*****************************************************************************/
/****************************************************************************/
void ec_eoe_flush(ec_eoe_t *);
@@ -74,7 +74,7 @@ int ec_eoedev_stop(struct net_device *);
int ec_eoedev_tx(struct sk_buff *, struct net_device *);
struct net_device_stats *ec_eoedev_stats(struct net_device *);
/*****************************************************************************/
/****************************************************************************/
/** Device operations for EoE interfaces.
*/
@@ -85,7 +85,7 @@ static const struct net_device_ops ec_eoedev_ops = {
.ndo_get_stats = ec_eoedev_stats,
};
/*****************************************************************************/
/****************************************************************************/
/** EoE constructor.
*
@@ -117,7 +117,6 @@ int ec_eoe_init(
eoe->tx_queue_size = EC_EOE_TX_QUEUE_SIZE;
eoe->tx_queued_frames = 0;
sema_init(&eoe->tx_queue_sem, 1);
eoe->tx_frame_number = 0xFF;
memset(&eoe->stats, 0, sizeof(struct net_device_stats));
@@ -200,7 +199,7 @@ int ec_eoe_init(
return ret;
}
/*****************************************************************************/
/****************************************************************************/
/** EoE destructor.
*
@@ -226,27 +225,30 @@ void ec_eoe_clear(ec_eoe_t *eoe /**< EoE handler */)
ec_datagram_clear(&eoe->datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Empties the transmit queue.
*/
void ec_eoe_flush(ec_eoe_t *eoe /**< EoE handler */)
{
ec_eoe_frame_t *frame, *next;
struct list_head tx_queue;
down(&eoe->tx_queue_sem);
netif_tx_lock_bh(eoe->dev);
list_for_each_entry_safe(frame, next, &eoe->tx_queue, queue) {
list_replace_init(&eoe->tx_queue, &tx_queue);
eoe->tx_queued_frames = 0;
netif_tx_unlock_bh(eoe->dev);
list_for_each_entry_safe(frame, next, &tx_queue, queue) {
list_del(&frame->queue);
dev_kfree_skb(frame->skb);
kfree(frame);
}
eoe->tx_queued_frames = 0;
up(&eoe->tx_queue_sem);
}
/*****************************************************************************/
/****************************************************************************/
/** Sends a frame or the next fragment.
*
@@ -319,7 +321,7 @@ int ec_eoe_send(ec_eoe_t *eoe /**< EoE handler */)
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Runs the EoE state machine.
*/
@@ -347,7 +349,7 @@ void ec_eoe_run(ec_eoe_t *eoe /**< EoE handler */)
ec_datagram_output_stats(&eoe->datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Queues the datagram, if necessary.
*/
@@ -359,7 +361,7 @@ void ec_eoe_queue(ec_eoe_t *eoe /**< EoE handler */)
}
}
/*****************************************************************************/
/****************************************************************************/
/** Returns the state of the device.
*
@@ -370,7 +372,7 @@ int ec_eoe_is_open(const ec_eoe_t *eoe /**< EoE handler */)
return eoe->opened;
}
/*****************************************************************************/
/****************************************************************************/
/** Returns the idle state.
*
@@ -382,9 +384,9 @@ int ec_eoe_is_idle(const ec_eoe_t *eoe /**< EoE handler */)
return eoe->rx_idle && eoe->tx_idle;
}
/******************************************************************************
/*****************************************************************************
* STATE PROCESSING FUNCTIONS
*****************************************************************************/
****************************************************************************/
/** State: RX_START.
*
@@ -407,7 +409,7 @@ void ec_eoe_state_rx_start(ec_eoe_t *eoe /**< EoE handler */)
eoe->state = ec_eoe_state_rx_check;
}
/*****************************************************************************/
/****************************************************************************/
/** State: RX_CHECK.
*
@@ -438,7 +440,7 @@ void ec_eoe_state_rx_check(ec_eoe_t *eoe /**< EoE handler */)
eoe->state = ec_eoe_state_rx_fetch;
}
/*****************************************************************************/
/****************************************************************************/
/** State: RX_FETCH.
*
@@ -613,7 +615,7 @@ void ec_eoe_state_rx_fetch(ec_eoe_t *eoe /**< EoE handler */)
}
}
/*****************************************************************************/
/****************************************************************************/
/** State: TX START.
*
@@ -635,10 +637,10 @@ void ec_eoe_state_tx_start(ec_eoe_t *eoe /**< EoE handler */)
return;
}
down(&eoe->tx_queue_sem);
netif_tx_lock_bh(eoe->dev);
if (!eoe->tx_queued_frames || list_empty(&eoe->tx_queue)) {
up(&eoe->tx_queue_sem);
netif_tx_unlock_bh(eoe->dev);
eoe->tx_idle = 1;
// no data available.
// start a new receive immediately.
@@ -659,7 +661,7 @@ void ec_eoe_state_tx_start(ec_eoe_t *eoe /**< EoE handler */)
}
eoe->tx_queued_frames--;
up(&eoe->tx_queue_sem);
netif_tx_unlock_bh(eoe->dev);
eoe->tx_idle = 0;
@@ -690,7 +692,7 @@ void ec_eoe_state_tx_start(ec_eoe_t *eoe /**< EoE handler */)
eoe->state = ec_eoe_state_tx_sent;
}
/*****************************************************************************/
/****************************************************************************/
/** State: TX SENT.
*
@@ -755,9 +757,9 @@ void ec_eoe_state_tx_sent(ec_eoe_t *eoe /**< EoE handler */)
}
}
/******************************************************************************
/*****************************************************************************
* NET_DEVICE functions
*****************************************************************************/
****************************************************************************/
/** Opens the virtual network device.
*
@@ -779,7 +781,7 @@ int ec_eoedev_open(struct net_device *dev /**< EoE net_device */)
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Stops the virtual network device.
*
@@ -801,7 +803,7 @@ int ec_eoedev_stop(struct net_device *dev /**< EoE net_device */)
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Transmits data via the virtual network device.
*
@@ -824,6 +826,9 @@ int ec_eoedev_tx(struct sk_buff *skb, /**< transmit socket buffer */
}
#endif
WARN_ON_ONCE(skb_get_queue_mapping(skb) != 0);
lockdep_assert_held(&netdev_get_tx_queue(dev, 0)->_xmit_lock);
if (!(frame =
(ec_eoe_frame_t *) kmalloc(sizeof(ec_eoe_frame_t), GFP_ATOMIC))) {
if (printk_ratelimit())
@@ -833,14 +838,12 @@ int ec_eoedev_tx(struct sk_buff *skb, /**< transmit socket buffer */
frame->skb = skb;
down(&eoe->tx_queue_sem);
list_add_tail(&frame->queue, &eoe->tx_queue);
eoe->tx_queued_frames++;
if (eoe->tx_queued_frames == eoe->tx_queue_size) {
netif_stop_queue(dev);
eoe->tx_queue_active = 0;
}
up(&eoe->tx_queue_sem);
#if EOE_DEBUG_LEVEL >= 2
EC_SLAVE_DBG(eoe->slave, 0, "EoE %s TX queued frame"
@@ -853,7 +856,7 @@ int ec_eoedev_tx(struct sk_buff *skb, /**< transmit socket buffer */
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Gets statistics about the virtual network device.
*
@@ -867,4 +870,4 @@ struct net_device_stats *ec_eoedev_stats(
return &eoe->stats;
}
/*****************************************************************************/
/****************************************************************************/
+8 -13
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
Ethernet over EtherCAT (EoE)
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_ETHERNET_H__
#define __EC_ETHERNET_H__
@@ -34,13 +32,11 @@
#include <linux/list.h>
#include <linux/netdevice.h>
#include <linux/semaphore.h>
#include "globals.h"
#include "slave.h"
#include "datagram.h"
/*****************************************************************************/
/****************************************************************************/
/** EoE frame types.
*/
@@ -65,7 +61,7 @@ typedef struct
}
ec_eoe_frame_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct ec_eoe ec_eoe_t; /**< \see ec_eoe */
@@ -99,7 +95,6 @@ struct ec_eoe
unsigned int tx_queue_size; /**< Transmit queue size. */
unsigned int tx_queue_active; /**< kernel netif queue started */
unsigned int tx_queued_frames; /**< number of frames in the queue */
struct semaphore tx_queue_sem; /**< Semaphore for the send queue. */
ec_eoe_frame_t *tx_frame; /**< current TX frame */
uint8_t tx_frame_number; /**< number of the transmitted frame */
uint8_t tx_fragment_number; /**< number of the fragment */
@@ -111,7 +106,7 @@ struct ec_eoe
unsigned int tries; /**< Tries. */
};
/*****************************************************************************/
/****************************************************************************/
int ec_eoe_init(ec_eoe_t *, ec_slave_t *);
void ec_eoe_clear(ec_eoe_t *);
@@ -120,8 +115,8 @@ void ec_eoe_queue(ec_eoe_t *);
int ec_eoe_is_open(const ec_eoe_t *);
int ec_eoe_is_idle(const ec_eoe_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
/*****************************************************************************/
/****************************************************************************/
+3 -3
View File
@@ -29,7 +29,7 @@
#include "flag.h"
/*****************************************************************************/
/****************************************************************************/
/** SDO request constructor.
*/
@@ -52,7 +52,7 @@ int ec_flag_init(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** SDO request destructor.
*/
@@ -66,4 +66,4 @@ void ec_flag_clear(
}
}
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,13 +17,13 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/** \file
* EtherCAT FMMU configuration methods.
*/
/*****************************************************************************/
/****************************************************************************/
#include "globals.h"
#include "slave_config.h"
@@ -33,7 +31,7 @@
#include "fmmu_config.h"
/*****************************************************************************/
/****************************************************************************/
/** FMMU configuration constructor.
*
@@ -61,7 +59,7 @@ void ec_fmmu_config_init(
ec_domain_add_fmmu_config(domain, fmmu);
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes an FMMU configuration page.
*
@@ -90,4 +88,4 @@ void ec_fmmu_config_page(
EC_WRITE_U16(data + 14, 0x0000); // reserved
}
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,13 +17,13 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/** \file
* EtherCAT FMMU configuration structure.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FMMU_CONFIG_H__
#define __EC_FMMU_CONFIG_H__
@@ -33,7 +31,7 @@
#include "globals.h"
#include "sync.h"
/*****************************************************************************/
/****************************************************************************/
/** FMMU configuration.
*/
@@ -47,7 +45,7 @@ typedef struct {
unsigned int data_size; /**< Covered PDO size. */
} ec_fmmu_config_t;
/*****************************************************************************/
/****************************************************************************/
void ec_fmmu_config_init(ec_fmmu_config_t *, ec_slave_config_t *,
ec_domain_t *, uint8_t, ec_direction_t);
@@ -55,6 +53,6 @@ void ec_fmmu_config_init(ec_fmmu_config_t *, ec_slave_config_t *,
void ec_fmmu_config_page(const ec_fmmu_config_t *, const ec_sync_t *,
uint8_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+4 -6
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,7 +17,7 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/** \file
* FoE defines.
@@ -28,7 +26,7 @@
#ifndef __FOE_H__
#define __FOE_H__
/*****************************************************************************/
/****************************************************************************/
/** FoE error enumeration type.
*/
@@ -51,6 +49,6 @@ typedef enum {
FOE_MBOX_PROT_ERROR = 15, /**< Mailbox protocol error. */
} ec_foe_error_t;
/*****************************************************************************/
/****************************************************************************/
#endif
+17 -17
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH
* Copyright (C) 2020 Florian Pose, IgH
@@ -18,13 +18,13 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/** \file
* File-over-EtherCAT request functions.
*/
/*****************************************************************************/
/****************************************************************************/
#include <linux/module.h>
#include <linux/jiffies.h>
@@ -34,17 +34,17 @@
#include "foe_request.h"
#include "foe.h"
/*****************************************************************************/
/****************************************************************************/
/** Default timeout in ms to wait for FoE transfer responses.
*/
#define EC_FOE_REQUEST_RESPONSE_TIMEOUT 3000
/*****************************************************************************/
/****************************************************************************/
void ec_foe_request_clear_data(ec_foe_request_t *);
/*****************************************************************************/
/****************************************************************************/
/** FoE request constructor.
*/
@@ -65,7 +65,7 @@ void ec_foe_request_init(
req->error_code = 0x00000000;
}
/*****************************************************************************/
/****************************************************************************/
/** FoE request destructor.
*/
@@ -76,7 +76,7 @@ void ec_foe_request_clear(
ec_foe_request_clear_data(req);
}
/*****************************************************************************/
/****************************************************************************/
/** FoE request destructor.
*/
@@ -93,7 +93,7 @@ void ec_foe_request_clear_data(
req->data_size = 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Pre-allocates the data memory.
*
@@ -123,7 +123,7 @@ int ec_foe_request_alloc(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Copies FoE data from an external source.
*
@@ -149,7 +149,7 @@ int ec_foe_request_copy_data(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Checks, if the timeout was exceeded.
*
@@ -163,7 +163,7 @@ int ec_foe_request_timed_out(
&& jiffies - req->jiffies_start > HZ * req->issue_timeout / 1000;
}
/*****************************************************************************/
/****************************************************************************/
/** Set the request timeout.
*/
@@ -175,7 +175,7 @@ void ec_foe_request_timeout(
req->issue_timeout = timeout;
}
/*****************************************************************************/
/****************************************************************************/
/** Returns a pointer to the request's data.
*
@@ -188,7 +188,7 @@ uint8_t *ec_foe_request_data(
return req->buffer;
}
/*****************************************************************************/
/****************************************************************************/
/** Returns the data size.
*
@@ -201,7 +201,7 @@ size_t ec_foe_request_data_size(
return req->data_size;
}
/*****************************************************************************/
/****************************************************************************/
/** Prepares a read request (slave to master).
*/
@@ -215,7 +215,7 @@ void ec_foe_request_read(
req->jiffies_start = jiffies;
}
/*****************************************************************************/
/****************************************************************************/
/** Prepares a write request (master to slave).
*/
@@ -229,4 +229,4 @@ void ec_foe_request_write(
req->jiffies_start = jiffies;
}
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT FoE request structure.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FOE_REQUEST_H__
#define __EC_FOE_REQUEST_H__
@@ -37,7 +35,7 @@
#include "globals.h"
/*****************************************************************************/
/****************************************************************************/
/** FoE request.
*/
@@ -63,7 +61,7 @@ typedef struct {
uint32_t error_code; /**< Error code from an FoE Error Request. */
} ec_foe_request_t;
/*****************************************************************************/
/****************************************************************************/
void ec_foe_request_init(ec_foe_request_t *, uint8_t *file_name);
void ec_foe_request_clear(ec_foe_request_t *);
@@ -75,6 +73,6 @@ int ec_foe_request_timed_out(const ec_foe_request_t *);
void ec_foe_request_write(ec_foe_request_t *);
void ec_foe_request_read(ec_foe_request_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+23 -25
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,26 +17,26 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT state change FSM.
*/
/*****************************************************************************/
/****************************************************************************/
#include "globals.h"
#include "master.h"
#include "fsm_change.h"
/*****************************************************************************/
/****************************************************************************/
/** Timeout while waiting for AL state change [s].
*/
#define EC_AL_STATE_CHANGE_TIMEOUT 5
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_change_state_start(ec_fsm_change_t *);
void ec_fsm_change_state_check(ec_fsm_change_t *);
@@ -50,7 +48,7 @@ void ec_fsm_change_state_check_ack(ec_fsm_change_t *);
void ec_fsm_change_state_end(ec_fsm_change_t *);
void ec_fsm_change_state_error(ec_fsm_change_t *);
/*****************************************************************************/
/****************************************************************************/
/**
Constructor.
@@ -65,7 +63,7 @@ void ec_fsm_change_init(ec_fsm_change_t *fsm, /**< finite state machine */
fsm->spontaneous_change = 0;
}
/*****************************************************************************/
/****************************************************************************/
/**
Destructor.
@@ -75,7 +73,7 @@ void ec_fsm_change_clear(ec_fsm_change_t *fsm /**< finite state machine */)
{
}
/*****************************************************************************/
/****************************************************************************/
/**
Starts the change state machine.
@@ -92,7 +90,7 @@ void ec_fsm_change_start(ec_fsm_change_t *fsm, /**< finite state machine */
fsm->state = ec_fsm_change_state_start;
}
/*****************************************************************************/
/****************************************************************************/
/**
Starts the change state machine to only acknowlegde a slave's state.
@@ -108,7 +106,7 @@ void ec_fsm_change_ack(ec_fsm_change_t *fsm, /**< finite state machine */
fsm->state = ec_fsm_change_state_start_code;
}
/*****************************************************************************/
/****************************************************************************/
/**
Executes the current state of the state machine.
@@ -123,7 +121,7 @@ int ec_fsm_change_exec(ec_fsm_change_t *fsm /**< finite state machine */)
&& fsm->state != ec_fsm_change_state_error;
}
/*****************************************************************************/
/****************************************************************************/
/**
Returns, if the state machine terminated with success.
@@ -135,9 +133,9 @@ int ec_fsm_change_success(ec_fsm_change_t *fsm /**< Finite state machine */)
return fsm->state == ec_fsm_change_state_end;
}
/******************************************************************************
/*****************************************************************************
* state change state machine
*****************************************************************************/
****************************************************************************/
/**
Change state: START.
@@ -159,7 +157,7 @@ void ec_fsm_change_state_start(ec_fsm_change_t *fsm
fsm->state = ec_fsm_change_state_check;
}
/*****************************************************************************/
/****************************************************************************/
/**
Change state: CHECK.
@@ -222,7 +220,7 @@ void ec_fsm_change_state_check(ec_fsm_change_t *fsm
fsm->state = ec_fsm_change_state_status;
}
/*****************************************************************************/
/****************************************************************************/
/**
Change state: STATUS.
@@ -313,7 +311,7 @@ void ec_fsm_change_state_status(ec_fsm_change_t *fsm
fsm->retries = EC_FSM_RETRIES;
}
/*****************************************************************************/
/****************************************************************************/
/** Enter reading AL status code.
*/
@@ -331,7 +329,7 @@ void ec_fsm_change_state_start_code(
fsm->state = ec_fsm_change_state_code;
}
/*****************************************************************************/
/****************************************************************************/
/**
Application layer status messages.
@@ -391,7 +389,7 @@ const ec_code_msg_t al_status_messages[] = {
};
/*****************************************************************************/
/****************************************************************************/
/**
Change state: CODE.
@@ -443,7 +441,7 @@ void ec_fsm_change_state_code(ec_fsm_change_t *fsm
fsm->state = ec_fsm_change_state_ack;
}
/*****************************************************************************/
/****************************************************************************/
/**
Change state: ACK.
@@ -480,7 +478,7 @@ void ec_fsm_change_state_ack(ec_fsm_change_t *fsm /**< finite state machine */)
fsm->state = ec_fsm_change_state_check_ack;
}
/*****************************************************************************/
/****************************************************************************/
/**
Change state: CHECK ACK.
@@ -546,7 +544,7 @@ void ec_fsm_change_state_check_ack(ec_fsm_change_t *fsm
fsm->retries = EC_FSM_RETRIES;
}
/*****************************************************************************/
/****************************************************************************/
/**
State: ERROR.
@@ -557,7 +555,7 @@ void ec_fsm_change_state_error(ec_fsm_change_t *fsm
{
}
/*****************************************************************************/
/****************************************************************************/
/**
State: END.
@@ -568,4 +566,4 @@ void ec_fsm_change_state_end(ec_fsm_change_t *fsm
{
}
/*****************************************************************************/
/****************************************************************************/
+7 -9
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT state change FSM.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FSM_CHANGE_H__
#define __EC_FSM_CHANGE_H__
@@ -35,7 +33,7 @@
#include "datagram.h"
#include "slave.h"
/*****************************************************************************/
/****************************************************************************/
/**
Mode of the change state machine.
@@ -47,7 +45,7 @@ typedef enum {
}
ec_fsm_change_mode_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct ec_fsm_change ec_fsm_change_t; /**< \see ec_fsm_change */
@@ -70,7 +68,7 @@ struct ec_fsm_change
uint8_t spontaneous_change; /**< spontaneous state change detected */
};
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_change_init(ec_fsm_change_t *, ec_datagram_t *);
void ec_fsm_change_clear(ec_fsm_change_t *);
@@ -81,6 +79,6 @@ void ec_fsm_change_ack(ec_fsm_change_t *, ec_slave_t *);
int ec_fsm_change_exec(ec_fsm_change_t *);
int ec_fsm_change_success(ec_fsm_change_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+48 -50
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,13 +17,13 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/** \file
* EtherCAT CoE state machines.
*/
/*****************************************************************************/
/****************************************************************************/
#include "globals.h"
#include "master.h"
@@ -33,7 +31,7 @@
#include "fsm_coe.h"
#include "slave_config.h"
/*****************************************************************************/
/****************************************************************************/
/** Maximum time in ms to wait for responses when reading out the dictionary.
*/
@@ -59,7 +57,7 @@
*/
#define DEBUG_LONG 0
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_coe_dict_start(ec_fsm_coe_t *, ec_datagram_t *);
void ec_fsm_coe_dict_request(ec_fsm_coe_t *, ec_datagram_t *);
@@ -90,7 +88,7 @@ void ec_fsm_coe_up_seg_response(ec_fsm_coe_t *, ec_datagram_t *);
void ec_fsm_coe_end(ec_fsm_coe_t *, ec_datagram_t *);
void ec_fsm_coe_error(ec_fsm_coe_t *, ec_datagram_t *);
/*****************************************************************************/
/****************************************************************************/
/** SDO abort messages.
*
@@ -135,7 +133,7 @@ const ec_code_msg_t sdo_abort_messages[] = {
{}
};
/*****************************************************************************/
/****************************************************************************/
/** Outputs an SDO abort message.
*/
@@ -157,7 +155,7 @@ void ec_canopen_abort_msg(
EC_SLAVE_ERR(slave, "Unknown SDO abort code 0x%08X.\n", abort_code);
}
/*****************************************************************************/
/****************************************************************************/
/** Constructor.
*/
@@ -169,7 +167,7 @@ void ec_fsm_coe_init(
fsm->datagram = NULL;
}
/*****************************************************************************/
/****************************************************************************/
/** Destructor.
*/
@@ -179,7 +177,7 @@ void ec_fsm_coe_clear(
{
}
/*****************************************************************************/
/****************************************************************************/
/** Starts reading a slaves' SDO dictionary.
*/
@@ -192,7 +190,7 @@ void ec_fsm_coe_dictionary(
fsm->state = ec_fsm_coe_dict_start;
}
/*****************************************************************************/
/****************************************************************************/
/** Starts to transfer an SDO to/from a slave.
*/
@@ -213,7 +211,7 @@ void ec_fsm_coe_transfer(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Executes the current state of the state machine.
*
@@ -248,7 +246,7 @@ int ec_fsm_coe_exec(
return datagram_used;
}
/*****************************************************************************/
/****************************************************************************/
/** Returns, if the state machine terminated with success.
* \return non-zero if successful.
@@ -260,7 +258,7 @@ int ec_fsm_coe_success(
return fsm->state == ec_fsm_coe_end;
}
/*****************************************************************************/
/****************************************************************************/
/** Check if the received data are a CoE emergency request.
*
@@ -298,9 +296,9 @@ int ec_fsm_coe_check_emergency(
return 1;
}
/******************************************************************************
/*****************************************************************************
* CoE dictionary state machine
*****************************************************************************/
****************************************************************************/
/** Prepare a dictionary request.
*
@@ -328,7 +326,7 @@ int ec_fsm_coe_prepare_dict(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** CoE state: DICT START.
*/
@@ -359,7 +357,7 @@ void ec_fsm_coe_dict_start(
}
}
/*****************************************************************************/
/****************************************************************************/
/** CoE state: DICT REQUEST.
* \todo Timeout behavior
@@ -400,7 +398,7 @@ void ec_fsm_coe_dict_request(
fsm->state = ec_fsm_coe_dict_check;
}
/*****************************************************************************/
/****************************************************************************/
/** CoE state: DICT CHECK.
*/
@@ -453,7 +451,7 @@ void ec_fsm_coe_dict_check(
fsm->state = ec_fsm_coe_dict_response;
}
/*****************************************************************************/
/****************************************************************************/
/** Prepare an object description request.
*
@@ -481,7 +479,7 @@ int ec_fsm_coe_dict_prepare_desc(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: DICT RESPONSE.
@@ -636,7 +634,7 @@ void ec_fsm_coe_dict_response(
}
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: DICT DESC REQUEST.
@@ -680,7 +678,7 @@ void ec_fsm_coe_dict_desc_request(
fsm->state = ec_fsm_coe_dict_desc_check;
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: DICT DESC CHECK.
@@ -736,7 +734,7 @@ void ec_fsm_coe_dict_desc_check(
fsm->state = ec_fsm_coe_dict_desc_response;
}
/*****************************************************************************/
/****************************************************************************/
/** Prepare an entry description request.
*
@@ -766,7 +764,7 @@ int ec_fsm_coe_dict_prepare_entry(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: DICT DESC RESPONSE.
@@ -901,7 +899,7 @@ void ec_fsm_coe_dict_desc_response(
}
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: DICT ENTRY REQUEST.
@@ -944,7 +942,7 @@ void ec_fsm_coe_dict_entry_request(
fsm->state = ec_fsm_coe_dict_entry_check;
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: DICT ENTRY CHECK.
@@ -1000,7 +998,7 @@ void ec_fsm_coe_dict_entry_check(
fsm->state = ec_fsm_coe_dict_entry_response;
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: DICT ENTRY RESPONSE.
@@ -1178,9 +1176,9 @@ void ec_fsm_coe_dict_entry_response(
fsm->state = ec_fsm_coe_end;
}
/******************************************************************************
/*****************************************************************************
* CoE state machine
*****************************************************************************/
****************************************************************************/
/** Prepare a donwnload request.
*
@@ -1325,7 +1323,7 @@ void ec_fsm_coe_down_start(
}
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: DOWN REQUEST.
@@ -1396,7 +1394,7 @@ void ec_fsm_coe_down_request(
fsm->state = ec_fsm_coe_down_check;
}
/*****************************************************************************/
/****************************************************************************/
/** CoE state: DOWN CHECK.
*/
@@ -1454,7 +1452,7 @@ void ec_fsm_coe_down_check(
fsm->state = ec_fsm_coe_down_response;
}
/*****************************************************************************/
/****************************************************************************/
/** Prepare a download segment request.
*/
@@ -1517,7 +1515,7 @@ void ec_fsm_coe_down_prepare_segment_request(
fsm->state = ec_fsm_coe_down_seg_check;
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: DOWN RESPONSE.
@@ -1639,7 +1637,7 @@ void ec_fsm_coe_down_response(
}
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: DOWN SEG CHECK.
@@ -1695,7 +1693,7 @@ void ec_fsm_coe_down_seg_check(
fsm->state = ec_fsm_coe_down_seg_response;
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: DOWN SEG RESPONSE.
@@ -1827,7 +1825,7 @@ void ec_fsm_coe_down_seg_response(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Prepare an upload request.
*
@@ -1864,7 +1862,7 @@ int ec_fsm_coe_prepare_up(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: UP START.
@@ -1896,7 +1894,7 @@ void ec_fsm_coe_up_start(
}
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: UP REQUEST.
\todo Timeout behavior
@@ -1965,7 +1963,7 @@ void ec_fsm_coe_up_request(
fsm->state = ec_fsm_coe_up_check;
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: UP CHECK.
@@ -2024,7 +2022,7 @@ void ec_fsm_coe_up_check(
fsm->state = ec_fsm_coe_up_response;
}
/*****************************************************************************/
/****************************************************************************/
/** Prepare an SDO upload segment request.
*/
@@ -2053,7 +2051,7 @@ void ec_fsm_coe_up_prepare_segment_request(
}
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: UP RESPONSE.
@@ -2248,7 +2246,7 @@ void ec_fsm_coe_up_response(
fsm->state = ec_fsm_coe_end; // success
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: UP REQUEST.
@@ -2292,7 +2290,7 @@ void ec_fsm_coe_up_seg_request(
fsm->state = ec_fsm_coe_up_seg_check;
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: UP CHECK.
@@ -2351,7 +2349,7 @@ void ec_fsm_coe_up_seg_check(
fsm->state = ec_fsm_coe_up_seg_response;
}
/*****************************************************************************/
/****************************************************************************/
/**
CoE state: UP RESPONSE.
@@ -2497,7 +2495,7 @@ void ec_fsm_coe_up_seg_response(
fsm->state = ec_fsm_coe_end; // success
}
/*****************************************************************************/
/****************************************************************************/
/**
State: ERROR.
@@ -2510,7 +2508,7 @@ void ec_fsm_coe_error(
{
}
/*****************************************************************************/
/****************************************************************************/
/**
State: END.
@@ -2523,4 +2521,4 @@ void ec_fsm_coe_end(
{
}
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT CoE state machines.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FSM_COE_H__
#define __EC_FSM_COE_H__
@@ -37,7 +35,7 @@
#include "sdo.h"
#include "sdo_request.h"
/*****************************************************************************/
/****************************************************************************/
typedef struct ec_fsm_coe ec_fsm_coe_t; /**< \see ec_fsm_coe */
@@ -60,7 +58,7 @@ struct ec_fsm_coe {
size_t segment_size; /**< Current segment size. */
};
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_coe_init(ec_fsm_coe_t *);
void ec_fsm_coe_clear(ec_fsm_coe_t *);
@@ -71,6 +69,6 @@ void ec_fsm_coe_transfer(ec_fsm_coe_t *, ec_slave_t *, ec_sdo_request_t *);
int ec_fsm_coe_exec(ec_fsm_coe_t *, ec_datagram_t *);
int ec_fsm_coe_success(const ec_fsm_coe_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+31 -33
View File
@@ -1,9 +1,7 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH
* 2013 Florian Pose <fp@igh-essen.com>
* 2013 Florian Pose <fp@igh.de>
*
* This file is part of the IgH EtherCAT Master.
*
@@ -20,13 +18,13 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/** \file
* EtherCAT FoE state machines.
*/
/*****************************************************************************/
/****************************************************************************/
#include "globals.h"
#include "master.h"
@@ -34,7 +32,7 @@
#include "fsm_foe.h"
#include "foe.h"
/*****************************************************************************/
/****************************************************************************/
/** Maximum time in ms to wait for responses when reading out the dictionary.
*/
@@ -49,7 +47,7 @@
//#define DEBUG_FOE
/*****************************************************************************/
/****************************************************************************/
/** FoE OpCodes.
*/
@@ -62,7 +60,7 @@ enum {
EC_FOE_OPCODE_BUSY = 6 /**< Busy. */
};
/*****************************************************************************/
/****************************************************************************/
int ec_foe_prepare_data_send(ec_fsm_foe_t *, ec_datagram_t *);
int ec_foe_prepare_wrq_send(ec_fsm_foe_t *, ec_datagram_t *);
@@ -90,7 +88,7 @@ void ec_fsm_foe_state_sent_ack(ec_fsm_foe_t *, ec_datagram_t *);
void ec_fsm_foe_write_start(ec_fsm_foe_t *, ec_datagram_t *);
void ec_fsm_foe_read_start(ec_fsm_foe_t *, ec_datagram_t *);
/*****************************************************************************/
/****************************************************************************/
/** Constructor.
*/
@@ -102,7 +100,7 @@ void ec_fsm_foe_init(
fsm->datagram = NULL;
}
/*****************************************************************************/
/****************************************************************************/
/** Destructor.
*/
@@ -110,7 +108,7 @@ void ec_fsm_foe_clear(ec_fsm_foe_t *fsm /**< finite state machine */)
{
}
/*****************************************************************************/
/****************************************************************************/
/** Executes the current state of the state machine.
*
@@ -145,7 +143,7 @@ int ec_fsm_foe_exec(
return datagram_used;
}
/*****************************************************************************/
/****************************************************************************/
/** Returns, if the state machine terminated with success.
* \return non-zero if successful.
@@ -155,7 +153,7 @@ int ec_fsm_foe_success(const ec_fsm_foe_t *fsm /**< Finite state machine */)
return fsm->state == ec_fsm_foe_end;
}
/*****************************************************************************/
/****************************************************************************/
/** Prepares an FoE transfer.
*/
@@ -189,7 +187,7 @@ void ec_fsm_foe_transfer(
}
}
/*****************************************************************************/
/****************************************************************************/
/** State: ERROR.
*/
@@ -203,7 +201,7 @@ void ec_fsm_foe_error(
#endif
}
/*****************************************************************************/
/****************************************************************************/
/** State: END.
*/
@@ -217,7 +215,7 @@ void ec_fsm_foe_end(
#endif
}
/*****************************************************************************/
/****************************************************************************/
/** Sends a file or the next fragment.
*
@@ -258,7 +256,7 @@ int ec_foe_prepare_data_send(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Prepare a write request (WRQ) with filename
*
@@ -293,7 +291,7 @@ int ec_foe_prepare_wrq_send(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Initializes the FoE write state machine.
*/
@@ -327,7 +325,7 @@ void ec_fsm_foe_write_start(
fsm->state = ec_fsm_foe_state_wrq_sent;
}
/*****************************************************************************/
/****************************************************************************/
/** Check for acknowledge.
*/
@@ -379,7 +377,7 @@ void ec_fsm_foe_state_ack_check(
fsm->state = ec_fsm_foe_state_ack_read;
}
/*****************************************************************************/
/****************************************************************************/
/** Acknowledge a read operation.
*/
@@ -456,7 +454,7 @@ void ec_fsm_foe_state_ack_read(
ec_foe_set_tx_error(fsm, FOE_ACK_ERROR);
}
/*****************************************************************************/
/****************************************************************************/
/** State: WRQ SENT.
*
@@ -497,7 +495,7 @@ void ec_fsm_foe_state_wrq_sent(
fsm->state = ec_fsm_foe_state_ack_check;
}
/*****************************************************************************/
/****************************************************************************/
/** State: WRQ SENT.
*
@@ -535,7 +533,7 @@ void ec_fsm_foe_state_data_sent(
fsm->state = ec_fsm_foe_state_ack_check;
}
/*****************************************************************************/
/****************************************************************************/
/** Prepare a read request (RRQ) with filename
*
@@ -569,7 +567,7 @@ int ec_foe_prepare_rrq_send(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Prepare to send an acknowledge.
*
@@ -594,7 +592,7 @@ int ec_foe_prepare_send_ack(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** State: RRQ SENT.
*
@@ -635,7 +633,7 @@ void ec_fsm_foe_state_rrq_sent(
fsm->state = ec_fsm_foe_state_data_check;
}
/*****************************************************************************/
/****************************************************************************/
/** Starting state for read operations.
*/
@@ -668,7 +666,7 @@ void ec_fsm_foe_read_start(
fsm->state = ec_fsm_foe_state_rrq_sent;
}
/*****************************************************************************/
/****************************************************************************/
/** Check for data.
*/
@@ -718,7 +716,7 @@ void ec_fsm_foe_state_data_check(
fsm->state = ec_fsm_foe_state_data_read;
}
/*****************************************************************************/
/****************************************************************************/
/** Start reading data.
*/
@@ -842,7 +840,7 @@ void ec_fsm_foe_state_data_read(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Sent an acknowledge.
*/
@@ -888,7 +886,7 @@ void ec_fsm_foe_state_sent_ack(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Set an error code and go to the send error state.
*/
@@ -901,7 +899,7 @@ void ec_foe_set_tx_error(
fsm->state = ec_fsm_foe_error;
}
/*****************************************************************************/
/****************************************************************************/
/** Set an error code and go to the receive error state.
*/
@@ -914,4 +912,4 @@ void ec_foe_set_rx_error(
fsm->state = ec_fsm_foe_error;
}
/*****************************************************************************/
/****************************************************************************/
+9 -10
View File
@@ -1,9 +1,7 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH
* 2009-2012 Florian Pose <fp@igh-essen.com>
* 2009-2012 Florian Pose <fp@igh.de>
*
* This file is part of the IgH EtherCAT Master.
*
@@ -20,14 +18,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT FoE state machines.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FSM_FOE_H__
#define __EC_FSM_FOE_H__
@@ -38,7 +36,7 @@
#include "slave.h"
#include "foe_request.h"
/*****************************************************************************/
/****************************************************************************/
typedef struct ec_fsm_foe ec_fsm_foe_t; /**< \see ec_fsm_foe */
@@ -48,7 +46,8 @@ struct ec_fsm_foe {
ec_slave_t *slave; /**< Slave the FSM runs on. */
unsigned int retries; /**< Retries upon datagram timeout */
void (*state)(ec_fsm_foe_t *, ec_datagram_t *); /**< FoE state function. */
void (*state)(ec_fsm_foe_t *, ec_datagram_t *); /**< FoE state function.
*/
ec_datagram_t *datagram; /**< Datagram used in previous step. */
unsigned long jiffies_start; /**< FoE timestamp. */
uint8_t subindex; /**< Current subindex. */
@@ -73,7 +72,7 @@ struct ec_fsm_foe {
uint32_t rx_filename_len; /**< Length of the receive file name. */
};
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_foe_init(ec_fsm_foe_t *);
void ec_fsm_foe_clear(ec_fsm_foe_t *);
@@ -83,6 +82,6 @@ int ec_fsm_foe_success(const ec_fsm_foe_t *);
void ec_fsm_foe_transfer(ec_fsm_foe_t *, ec_slave_t *, ec_foe_request_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+37 -37
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -17,13 +17,13 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/** \file
* EtherCAT master state machine.
*/
/*****************************************************************************/
/****************************************************************************/
#include "globals.h"
#include "master.h"
@@ -36,13 +36,13 @@
#include "fsm_master.h"
#include "fsm_foe.h"
/*****************************************************************************/
/****************************************************************************/
/** Time difference [ns] to tolerate without setting a new system time offset.
*/
#define EC_SYSTEM_TIME_TOLERANCE_NS 1000000
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_master_state_start(ec_fsm_master_t *);
void ec_fsm_master_state_broadcast(ec_fsm_master_t *);
@@ -63,7 +63,7 @@ void ec_fsm_master_state_soe_request(ec_fsm_master_t *);
void ec_fsm_master_enter_clear_addresses(ec_fsm_master_t *);
void ec_fsm_master_enter_write_system_times(ec_fsm_master_t *);
/*****************************************************************************/
/****************************************************************************/
/** Constructor.
*/
@@ -100,7 +100,7 @@ void ec_fsm_master_init(
ec_fsm_sii_init(&fsm->fsm_sii, fsm->datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Destructor.
*/
@@ -118,7 +118,7 @@ void ec_fsm_master_clear(
ec_fsm_sii_clear(&fsm->fsm_sii);
}
/*****************************************************************************/
/****************************************************************************/
/** Reset state machine.
*/
@@ -142,7 +142,7 @@ void ec_fsm_master_reset(
fsm->rescan_required = 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Executes the current state of the state machine.
*
@@ -165,7 +165,7 @@ int ec_fsm_master_exec(
return 1;
}
/*****************************************************************************/
/****************************************************************************/
/**
* \return true, if the state machine is in an idle phase
@@ -177,7 +177,7 @@ int ec_fsm_master_idle(
return fsm->idle;
}
/*****************************************************************************/
/****************************************************************************/
/** Restarts the master state machine.
*/
@@ -190,9 +190,9 @@ void ec_fsm_master_restart(
fsm->state(fsm); // execute immediately
}
/******************************************************************************
/*****************************************************************************
* Master state machine
*****************************************************************************/
****************************************************************************/
/** Master state: START.
*
@@ -250,7 +250,7 @@ void ec_fsm_master_state_start(
fsm->state = ec_fsm_master_state_broadcast;
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: BROADCAST.
*
@@ -432,7 +432,7 @@ void ec_fsm_master_state_broadcast(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Check for pending SII write requests and process one.
*
@@ -494,7 +494,7 @@ int ec_fsm_master_action_process_sii(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Check for pending internal SDO/SoE requests and process one.
*
@@ -577,7 +577,7 @@ int ec_fsm_master_action_process_int_request(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Master action: IDLE.
*
@@ -637,7 +637,7 @@ void ec_fsm_master_action_idle(
ec_fsm_master_restart(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Master action: Get state of next slave.
*/
@@ -665,7 +665,7 @@ void ec_fsm_master_action_next_slave_state(
ec_fsm_master_action_idle(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Master action: Configure.
*/
@@ -721,7 +721,7 @@ void ec_fsm_master_action_configure(
ec_fsm_master_action_next_slave_state(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: READ STATE.
*
@@ -778,7 +778,7 @@ void ec_fsm_master_state_read_state(
ec_fsm_master_action_next_slave_state(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: ACKNOWLEDGE.
*/
@@ -800,7 +800,7 @@ void ec_fsm_master_state_acknowledge(
ec_fsm_master_action_configure(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Start clearing slave addresses.
*/
@@ -816,7 +816,7 @@ void ec_fsm_master_enter_clear_addresses(
fsm->state = ec_fsm_master_state_clear_addresses;
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: CLEAR ADDRESSES.
*/
@@ -861,7 +861,7 @@ void ec_fsm_master_state_clear_addresses(
fsm->state = ec_fsm_master_state_dc_measure_delays;
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: DC MEASURE DELAYS.
*/
@@ -914,7 +914,7 @@ void ec_fsm_master_state_dc_measure_delays(
fsm->datagram->device_index = fsm->slave->device_index;
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: SCAN SLAVE.
*
@@ -988,7 +988,7 @@ void ec_fsm_master_state_scan_slave(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: CONFIGURE SLAVE.
*
@@ -1018,7 +1018,7 @@ void ec_fsm_master_state_configure_slave(
ec_fsm_master_action_next_slave_state(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Start writing DC system times.
*/
@@ -1064,7 +1064,7 @@ void ec_fsm_master_enter_write_system_times(
ec_fsm_master_restart(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Configure 32 bit time offset.
*
@@ -1106,7 +1106,7 @@ u64 ec_fsm_master_dc_offset32(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Configure 64 bit time offset.
*
@@ -1146,7 +1146,7 @@ u64 ec_fsm_master_dc_offset64(
return new_offset;
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: DC READ OFFSET.
*/
@@ -1199,7 +1199,7 @@ void ec_fsm_master_state_dc_read_offset(
fsm->state = ec_fsm_master_state_dc_write_offset;
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: DC WRITE OFFSET.
*/
@@ -1234,7 +1234,7 @@ void ec_fsm_master_state_dc_write_offset(
ec_fsm_master_enter_write_system_times(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: ASSIGN SII.
*/
@@ -1271,7 +1271,7 @@ cont:
fsm->state(fsm); // execute immediately
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: WRITE SII.
*/
@@ -1325,7 +1325,7 @@ void ec_fsm_master_state_write_sii(
ec_fsm_master_restart(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: SDO DICTIONARY.
*/
@@ -1360,7 +1360,7 @@ void ec_fsm_master_state_sdo_dictionary(
ec_fsm_master_restart(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: SDO REQUEST.
*/
@@ -1403,7 +1403,7 @@ void ec_fsm_master_state_sdo_request(
ec_fsm_master_restart(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Master state: SoE REQUEST.
*/
@@ -1446,4 +1446,4 @@ void ec_fsm_master_state_soe_request(
ec_fsm_master_restart(fsm);
}
/*****************************************************************************/
/****************************************************************************/
+7 -7
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -17,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT master state machine.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FSM_MASTER_H__
#define __EC_FSM_MASTER_H__
@@ -38,7 +38,7 @@
#include "fsm_slave_scan.h"
#include "fsm_pdo.h"
/*****************************************************************************/
/****************************************************************************/
/** SII write request.
*/
@@ -51,7 +51,7 @@ typedef struct {
ec_internal_request_state_t state; /**< State of the request. */
} ec_sii_write_request_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct ec_fsm_master ec_fsm_master_t; /**< \see ec_fsm_master */
@@ -91,7 +91,7 @@ struct ec_fsm_master {
ec_fsm_sii_t fsm_sii; /**< SII state machine */
};
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_master_init(ec_fsm_master_t *, ec_master_t *, ec_datagram_t *);
void ec_fsm_master_clear(ec_fsm_master_t *);
@@ -101,6 +101,6 @@ void ec_fsm_master_reset(ec_fsm_master_t *);
int ec_fsm_master_exec(ec_fsm_master_t *);
int ec_fsm_master_idle(const ec_fsm_master_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+37 -39
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,13 +17,13 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/** \file
* EtherCAT PDO configuration state machine.
*/
/*****************************************************************************/
/****************************************************************************/
#include "globals.h"
#include "master.h"
@@ -34,7 +32,7 @@
#include "fsm_pdo.h"
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_pdo_read_state_start(ec_fsm_pdo_t *, ec_datagram_t *);
void ec_fsm_pdo_read_state_pdo_count(ec_fsm_pdo_t *, ec_datagram_t *);
@@ -61,7 +59,7 @@ void ec_fsm_pdo_conf_action_assign_pdo(ec_fsm_pdo_t *, ec_datagram_t *);
void ec_fsm_pdo_state_end(ec_fsm_pdo_t *, ec_datagram_t *);
void ec_fsm_pdo_state_error(ec_fsm_pdo_t *, ec_datagram_t *);
/*****************************************************************************/
/****************************************************************************/
/** Constructor.
*/
@@ -77,7 +75,7 @@ void ec_fsm_pdo_init(
ec_pdo_init(&fsm->slave_pdo);
}
/*****************************************************************************/
/****************************************************************************/
/** Destructor.
*/
@@ -91,7 +89,7 @@ void ec_fsm_pdo_clear(
ec_pdo_clear(&fsm->slave_pdo);
}
/*****************************************************************************/
/****************************************************************************/
/** Print the current and desired PDO assignment.
*/
@@ -106,7 +104,7 @@ void ec_fsm_pdo_print(
printk(KERN_CONT "\n");
}
/*****************************************************************************/
/****************************************************************************/
/** Start reading the PDO configuration.
*/
@@ -119,7 +117,7 @@ void ec_fsm_pdo_start_reading(
fsm->state = ec_fsm_pdo_read_state_start;
}
/*****************************************************************************/
/****************************************************************************/
/** Start writing the PDO configuration.
*/
@@ -132,7 +130,7 @@ void ec_fsm_pdo_start_configuration(
fsm->state = ec_fsm_pdo_conf_state_start;
}
/*****************************************************************************/
/****************************************************************************/
/** Get running state.
*
@@ -146,7 +144,7 @@ int ec_fsm_pdo_running(
&& fsm->state != ec_fsm_pdo_state_error;
}
/*****************************************************************************/
/****************************************************************************/
/** Executes the current state of the state machine.
*
@@ -165,7 +163,7 @@ int ec_fsm_pdo_exec(
return ec_fsm_pdo_running(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Get execution result.
*
@@ -178,9 +176,9 @@ int ec_fsm_pdo_success(
return fsm->state == ec_fsm_pdo_state_end;
}
/******************************************************************************
/*****************************************************************************
* Reading state funtions.
*****************************************************************************/
****************************************************************************/
/** Start reading PDO assignment.
*/
@@ -194,7 +192,7 @@ void ec_fsm_pdo_read_state_start(
ec_fsm_pdo_read_action_next_sync(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Read PDO assignment of next sync manager.
*/
@@ -230,7 +228,7 @@ void ec_fsm_pdo_read_action_next_sync(
fsm->state = ec_fsm_pdo_state_end;
}
/*****************************************************************************/
/****************************************************************************/
/** Count assigned PDOs.
*/
@@ -266,7 +264,7 @@ void ec_fsm_pdo_read_state_pdo_count(
ec_fsm_pdo_read_action_next_pdo(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Read next PDO.
*/
@@ -294,7 +292,7 @@ void ec_fsm_pdo_read_action_next_pdo(
ec_fsm_pdo_read_action_next_sync(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Fetch PDO information.
*/
@@ -343,7 +341,7 @@ void ec_fsm_pdo_read_state_pdo(
fsm->state(fsm, datagram); // execute immediately
}
/*****************************************************************************/
/****************************************************************************/
/** Fetch PDO information.
*/
@@ -368,9 +366,9 @@ void ec_fsm_pdo_read_state_pdo_entries(
ec_fsm_pdo_read_action_next_pdo(fsm, datagram);
}
/******************************************************************************
/*****************************************************************************
* Writing state functions.
*****************************************************************************/
****************************************************************************/
/** Start PDO configuration.
*/
@@ -388,7 +386,7 @@ void ec_fsm_pdo_conf_state_start(
ec_fsm_pdo_conf_action_next_sync(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Assign next PDO.
*
@@ -405,7 +403,7 @@ ec_pdo_t *ec_fsm_pdo_conf_action_next_pdo(
return list_entry(list, ec_pdo_t, list);
}
/*****************************************************************************/
/****************************************************************************/
/** Get the next sync manager for a pdo configuration.
*/
@@ -454,7 +452,7 @@ void ec_fsm_pdo_conf_action_next_sync(
fsm->state = ec_fsm_pdo_state_end;
}
/*****************************************************************************/
/****************************************************************************/
/** Check if the mapping has to be read, otherwise start to configure it.
*/
@@ -489,7 +487,7 @@ void ec_fsm_pdo_conf_action_pdo_mapping(
ec_fsm_pdo_conf_action_check_mapping(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Execute the PDO entry state machine to read the current PDO's mapping.
*/
@@ -511,7 +509,7 @@ void ec_fsm_pdo_conf_state_read_mapping(
ec_fsm_pdo_conf_action_check_mapping(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Check if the mapping has to be re-configured.
*
@@ -548,7 +546,7 @@ void ec_fsm_pdo_conf_action_check_mapping(
ec_fsm_pdo_conf_action_next_pdo_mapping(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Let the PDO entry state machine configure the current PDO's mapping.
*/
@@ -569,7 +567,7 @@ void ec_fsm_pdo_conf_state_mapping(
ec_fsm_pdo_conf_action_next_pdo_mapping(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Check mapping of next PDO, otherwise configure assignment.
*/
@@ -588,7 +586,7 @@ void ec_fsm_pdo_conf_action_next_pdo_mapping(
ec_fsm_pdo_conf_action_pdo_mapping(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Check if the PDO assignment of the current SM has to be re-configured.
*/
@@ -635,7 +633,7 @@ void ec_fsm_pdo_conf_action_check_assignment(
ec_fsm_pdo_conf_action_next_sync(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Set the number of assigned PDOs to zero.
*/
@@ -674,7 +672,7 @@ void ec_fsm_pdo_conf_state_zero_pdo_count(
ec_fsm_pdo_conf_action_assign_pdo(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Assign a PDO.
*/
@@ -697,7 +695,7 @@ void ec_fsm_pdo_conf_action_assign_pdo(
ec_fsm_coe_exec(fsm->fsm_coe, datagram); // execute immediately
}
/*****************************************************************************/
/****************************************************************************/
/** Add a PDO to the sync managers PDO assignment.
*/
@@ -742,7 +740,7 @@ void ec_fsm_pdo_conf_state_assign_pdo(
ec_fsm_pdo_conf_action_assign_pdo(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Set the number of assigned PDOs.
*/
@@ -773,9 +771,9 @@ void ec_fsm_pdo_conf_state_set_pdo_count(
ec_fsm_pdo_conf_action_next_sync(fsm, datagram);
}
/******************************************************************************
/*****************************************************************************
* Common state functions
*****************************************************************************/
****************************************************************************/
/** State: ERROR.
*/
@@ -786,7 +784,7 @@ void ec_fsm_pdo_state_error(
{
}
/*****************************************************************************/
/****************************************************************************/
/** State: END.
*/
@@ -797,4 +795,4 @@ void ec_fsm_pdo_state_end(
{
}
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT PDO configuration state machine structures.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FSM_PDO_H__
#define __EC_FSM_PDO_H__
@@ -36,7 +34,7 @@
#include "fsm_coe.h"
#include "fsm_pdo_entry.h"
/*****************************************************************************/
/****************************************************************************/
/**
* \see ec_fsm_pdo
@@ -62,7 +60,7 @@ struct ec_fsm_pdo
unsigned int pdo_count; /**< Number of assigned PDOs. */
};
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_pdo_init(ec_fsm_pdo_t *, ec_fsm_coe_t *);
void ec_fsm_pdo_clear(ec_fsm_pdo_t *);
@@ -73,6 +71,6 @@ void ec_fsm_pdo_start_configuration(ec_fsm_pdo_t *, ec_slave_t *);
int ec_fsm_pdo_exec(ec_fsm_pdo_t *, ec_datagram_t *);
int ec_fsm_pdo_success(const ec_fsm_pdo_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+28 -30
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,13 +17,13 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/** \file
* EtherCAT PDO mapping state machine.
*/
/*****************************************************************************/
/****************************************************************************/
#include "globals.h"
#include "master.h"
@@ -34,7 +32,7 @@
#include "fsm_pdo_entry.h"
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_pdo_entry_read_state_start(ec_fsm_pdo_entry_t *, ec_datagram_t *);
void ec_fsm_pdo_entry_read_state_count(ec_fsm_pdo_entry_t *, ec_datagram_t *);
@@ -55,7 +53,7 @@ void ec_fsm_pdo_entry_conf_action_map(ec_fsm_pdo_entry_t *, ec_datagram_t *);
void ec_fsm_pdo_entry_state_end(ec_fsm_pdo_entry_t *, ec_datagram_t *);
void ec_fsm_pdo_entry_state_error(ec_fsm_pdo_entry_t *, ec_datagram_t *);
/*****************************************************************************/
/****************************************************************************/
/** Constructor.
*/
@@ -68,7 +66,7 @@ void ec_fsm_pdo_entry_init(
ec_sdo_request_init(&fsm->request);
}
/*****************************************************************************/
/****************************************************************************/
/** Destructor.
*/
@@ -79,7 +77,7 @@ void ec_fsm_pdo_entry_clear(
ec_sdo_request_clear(&fsm->request);
}
/*****************************************************************************/
/****************************************************************************/
/** Print the current and desired PDO mapping.
*/
@@ -94,7 +92,7 @@ void ec_fsm_pdo_entry_print(
printk(KERN_CONT "\n");
}
/*****************************************************************************/
/****************************************************************************/
/** Start reading a PDO's entries.
*/
@@ -112,7 +110,7 @@ void ec_fsm_pdo_entry_start_reading(
fsm->state = ec_fsm_pdo_entry_read_state_start;
}
/*****************************************************************************/
/****************************************************************************/
/** Start PDO mapping state machine.
*/
@@ -136,7 +134,7 @@ void ec_fsm_pdo_entry_start_configuration(
fsm->state = ec_fsm_pdo_entry_conf_state_start;
}
/*****************************************************************************/
/****************************************************************************/
/** Get running state.
*
@@ -150,7 +148,7 @@ int ec_fsm_pdo_entry_running(
&& fsm->state != ec_fsm_pdo_entry_state_error;
}
/*****************************************************************************/
/****************************************************************************/
/** Executes the current state.
*
@@ -166,7 +164,7 @@ int ec_fsm_pdo_entry_exec(
return ec_fsm_pdo_entry_running(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Get execution result.
*
@@ -179,9 +177,9 @@ int ec_fsm_pdo_entry_success(
return fsm->state == ec_fsm_pdo_entry_state_end;
}
/******************************************************************************
/*****************************************************************************
* Reading state functions.
*****************************************************************************/
****************************************************************************/
/** Request reading the number of mapped PDO entries.
*/
@@ -198,7 +196,7 @@ void ec_fsm_pdo_entry_read_state_start(
ec_fsm_coe_exec(fsm->fsm_coe, datagram); // execute immediately
}
/*****************************************************************************/
/****************************************************************************/
/** Read number of mapped PDO entries.
*/
@@ -236,7 +234,7 @@ void ec_fsm_pdo_entry_read_state_count(
ec_fsm_pdo_entry_read_action_next(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Read next PDO entry.
*/
@@ -259,7 +257,7 @@ void ec_fsm_pdo_entry_read_action_next(
fsm->state = ec_fsm_pdo_entry_state_end;
}
/*****************************************************************************/
/****************************************************************************/
/** Read PDO entry information.
*/
@@ -325,9 +323,9 @@ void ec_fsm_pdo_entry_read_state_entry(
}
}
/******************************************************************************
/*****************************************************************************
* Configuration state functions.
*****************************************************************************/
****************************************************************************/
/** Start PDO mapping.
*/
@@ -354,7 +352,7 @@ void ec_fsm_pdo_entry_conf_state_start(
ec_fsm_coe_exec(fsm->fsm_coe, datagram); // execute immediately
}
/*****************************************************************************/
/****************************************************************************/
/** Process next PDO entry.
*
@@ -371,7 +369,7 @@ ec_pdo_entry_t *ec_fsm_pdo_entry_conf_next_entry(
return list_entry(list, ec_pdo_entry_t, list);
}
/*****************************************************************************/
/****************************************************************************/
/** Set the number of mapped entries to zero.
*/
@@ -406,7 +404,7 @@ void ec_fsm_pdo_entry_conf_state_zero_entry_count(
ec_fsm_pdo_entry_conf_action_map(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Starts to add a PDO entry.
*/
@@ -435,7 +433,7 @@ void ec_fsm_pdo_entry_conf_action_map(
ec_fsm_coe_exec(fsm->fsm_coe, datagram); // execute immediately
}
/*****************************************************************************/
/****************************************************************************/
/** Add a PDO entry.
*/
@@ -482,7 +480,7 @@ void ec_fsm_pdo_entry_conf_state_map_entry(
ec_fsm_pdo_entry_conf_action_map(fsm, datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Set the number of entries.
*/
@@ -508,9 +506,9 @@ void ec_fsm_pdo_entry_conf_state_set_entry_count(
fsm->state = ec_fsm_pdo_entry_state_end; // finished
}
/******************************************************************************
/*****************************************************************************
* Common state functions
*****************************************************************************/
****************************************************************************/
/** State: ERROR.
*/
@@ -521,7 +519,7 @@ void ec_fsm_pdo_entry_state_error(
{
}
/*****************************************************************************/
/****************************************************************************/
/** State: END.
*/
@@ -532,4 +530,4 @@ void ec_fsm_pdo_entry_state_end(
{
}
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,13 +17,13 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/** \file
* EtherCAT PDO entry configuration state machine structures.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FSM_PDO_ENTRY_H__
#define __EC_FSM_PDO_ENTRY_H__
@@ -34,7 +32,7 @@
#include "datagram.h"
#include "fsm_coe.h"
/*****************************************************************************/
/****************************************************************************/
/**
* \see ec_fsm_pdo_entry
@@ -59,7 +57,7 @@ struct ec_fsm_pdo_entry
unsigned int entry_pos; /**< Position in PDO mapping. */
};
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_pdo_entry_init(ec_fsm_pdo_entry_t *, ec_fsm_coe_t *);
void ec_fsm_pdo_entry_clear(ec_fsm_pdo_entry_t *);
@@ -72,6 +70,6 @@ void ec_fsm_pdo_entry_start_configuration(ec_fsm_pdo_entry_t *, ec_slave_t *,
int ec_fsm_pdo_entry_exec(ec_fsm_pdo_entry_t *, ec_datagram_t *);
int ec_fsm_pdo_entry_success(const ec_fsm_pdo_entry_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+20 -22
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT slave information interface FSM.
*/
/*****************************************************************************/
/****************************************************************************/
#include "globals.h"
#include "mailbox.h"
@@ -48,7 +46,7 @@
//#define SII_DEBUG
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_sii_state_start_reading(ec_fsm_sii_t *);
void ec_fsm_sii_state_read_check(ec_fsm_sii_t *);
@@ -59,7 +57,7 @@ void ec_fsm_sii_state_write_check2(ec_fsm_sii_t *);
void ec_fsm_sii_state_end(ec_fsm_sii_t *);
void ec_fsm_sii_state_error(ec_fsm_sii_t *);
/*****************************************************************************/
/****************************************************************************/
/**
Constructor.
@@ -73,7 +71,7 @@ void ec_fsm_sii_init(ec_fsm_sii_t *fsm, /**< finite state machine */
fsm->datagram = datagram;
}
/*****************************************************************************/
/****************************************************************************/
/**
Destructor.
@@ -83,7 +81,7 @@ void ec_fsm_sii_clear(ec_fsm_sii_t *fsm /**< finite state machine */)
{
}
/*****************************************************************************/
/****************************************************************************/
/**
Initializes the SII read state machine.
@@ -101,7 +99,7 @@ void ec_fsm_sii_read(ec_fsm_sii_t *fsm, /**< finite state machine */
fsm->mode = mode;
}
/*****************************************************************************/
/****************************************************************************/
/**
Initializes the SII write state machine.
@@ -121,7 +119,7 @@ void ec_fsm_sii_write(ec_fsm_sii_t *fsm, /**< finite state machine */
memcpy(fsm->value, value, 2);
}
/*****************************************************************************/
/****************************************************************************/
/**
Executes the SII state machine.
@@ -136,7 +134,7 @@ int ec_fsm_sii_exec(ec_fsm_sii_t *fsm /**< finite state machine */)
&& fsm->state != ec_fsm_sii_state_error;
}
/*****************************************************************************/
/****************************************************************************/
/**
Returns, if the master startup state machine terminated with success.
@@ -148,9 +146,9 @@ int ec_fsm_sii_success(ec_fsm_sii_t *fsm /**< Finite state machine */)
return fsm->state == ec_fsm_sii_state_end;
}
/******************************************************************************
/*****************************************************************************
* state functions
*****************************************************************************/
****************************************************************************/
/**
SII state: START READING.
@@ -187,7 +185,7 @@ void ec_fsm_sii_state_start_reading(
fsm->state = ec_fsm_sii_state_read_check;
}
/*****************************************************************************/
/****************************************************************************/
/**
SII state: READ CHECK.
@@ -235,7 +233,7 @@ void ec_fsm_sii_state_read_check(
fsm->state = ec_fsm_sii_state_read_fetch;
}
/*****************************************************************************/
/****************************************************************************/
/**
SII state: READ FETCH.
@@ -304,7 +302,7 @@ void ec_fsm_sii_state_read_fetch(
fsm->state = ec_fsm_sii_state_end;
}
/*****************************************************************************/
/****************************************************************************/
/**
SII state: START WRITING.
@@ -335,7 +333,7 @@ void ec_fsm_sii_state_start_writing(
fsm->state = ec_fsm_sii_state_write_check;
}
/*****************************************************************************/
/****************************************************************************/
/**
SII state: WRITE CHECK.
@@ -374,7 +372,7 @@ void ec_fsm_sii_state_write_check(
fsm->state = ec_fsm_sii_state_write_check2;
}
/*****************************************************************************/
/****************************************************************************/
/**
SII state: WRITE CHECK 2.
@@ -457,7 +455,7 @@ void ec_fsm_sii_state_write_check2(
fsm->state = ec_fsm_sii_state_end;
}
/*****************************************************************************/
/****************************************************************************/
/**
State: ERROR.
@@ -469,7 +467,7 @@ void ec_fsm_sii_state_error(
{
}
/*****************************************************************************/
/****************************************************************************/
/**
State: END.
@@ -481,4 +479,4 @@ void ec_fsm_sii_state_end(
{
}
/*****************************************************************************/
/****************************************************************************/
+7 -9
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT slave information interface FSM structure.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FSM_SII_H__
#define __EC_FSM_SII_H__
@@ -35,7 +33,7 @@
#include "datagram.h"
#include "slave.h"
/*****************************************************************************/
/****************************************************************************/
/** SII access addressing mode.
*/
@@ -44,7 +42,7 @@ typedef enum {
EC_FSM_SII_USE_CONFIGURED_ADDRESS /**< Use configured addresses. */
} ec_fsm_sii_addressing_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct ec_fsm_sii ec_fsm_sii_t; /**< \see ec_fsm_sii */
@@ -66,7 +64,7 @@ struct ec_fsm_sii
uint8_t check_once_more; /**< one more try after timeout */
};
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_sii_init(ec_fsm_sii_t *, ec_datagram_t *);
void ec_fsm_sii_clear(ec_fsm_sii_t *);
@@ -79,6 +77,6 @@ void ec_fsm_sii_write(ec_fsm_sii_t *, ec_slave_t *, uint16_t,
int ec_fsm_sii_exec(ec_fsm_sii_t *);
int ec_fsm_sii_success(ec_fsm_sii_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+23 -23
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -17,13 +17,13 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/** \file
* EtherCAT slave (SDO) state machine.
*/
/*****************************************************************************/
/****************************************************************************/
#include "globals.h"
#include "master.h"
@@ -32,7 +32,7 @@
#include "fsm_slave.h"
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_slave_state_idle(ec_fsm_slave_t *, ec_datagram_t *);
void ec_fsm_slave_state_ready(ec_fsm_slave_t *, ec_datagram_t *);
@@ -49,7 +49,7 @@ int ec_fsm_slave_action_process_eoe(ec_fsm_slave_t *, ec_datagram_t *);
void ec_fsm_slave_state_eoe_request(ec_fsm_slave_t *, ec_datagram_t *);
#endif
/*****************************************************************************/
/****************************************************************************/
/** Constructor.
*/
@@ -80,7 +80,7 @@ void ec_fsm_slave_init(
#endif
}
/*****************************************************************************/
/****************************************************************************/
/** Destructor.
*/
@@ -126,7 +126,7 @@ void ec_fsm_slave_clear(
#endif
}
/*****************************************************************************/
/****************************************************************************/
/** Executes the current state of the state machine.
*
@@ -153,7 +153,7 @@ int ec_fsm_slave_exec(
return datagram_used;
}
/*****************************************************************************/
/****************************************************************************/
/** Sets the current state of the state machine to READY
*/
@@ -167,7 +167,7 @@ void ec_fsm_slave_set_ready(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Returns, if the FSM is currently not busy and ready to execute.
*
@@ -180,9 +180,9 @@ int ec_fsm_slave_is_ready(
return fsm->state == ec_fsm_slave_state_ready;
}
/******************************************************************************
/*****************************************************************************
* Slave state machine
*****************************************************************************/
****************************************************************************/
/** Slave state: IDLE.
*/
@@ -194,7 +194,7 @@ void ec_fsm_slave_state_idle(
// do nothing
}
/*****************************************************************************/
/****************************************************************************/
/** Slave state: READY.
*/
@@ -231,7 +231,7 @@ void ec_fsm_slave_state_ready(
#endif
}
/*****************************************************************************/
/****************************************************************************/
/** Check for pending SDO requests and process one.
*
@@ -283,7 +283,7 @@ int ec_fsm_slave_action_process_sdo(
return 1;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave state: SDO_REQUEST.
*/
@@ -317,7 +317,7 @@ void ec_fsm_slave_state_sdo_request(
fsm->state = ec_fsm_slave_state_ready;
}
/*****************************************************************************/
/****************************************************************************/
/** Check for pending register requests and process one.
*
@@ -385,7 +385,7 @@ int ec_fsm_slave_action_process_reg(
return 1;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave state: Register request.
*/
@@ -435,7 +435,7 @@ void ec_fsm_slave_state_reg_request(
fsm->state = ec_fsm_slave_state_ready;
}
/*****************************************************************************/
/****************************************************************************/
/** Check for pending FoE requests and process one.
*
@@ -477,7 +477,7 @@ int ec_fsm_slave_action_process_foe(
return 1;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave state: FOE REQUEST.
*/
@@ -512,7 +512,7 @@ void ec_fsm_slave_state_foe_request(
fsm->state = ec_fsm_slave_state_ready;
}
/*****************************************************************************/
/****************************************************************************/
/** Check for pending SoE requests and process one.
*
@@ -564,7 +564,7 @@ int ec_fsm_slave_action_process_soe(
return 1;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave state: SOE_REQUEST.
*/
@@ -598,7 +598,7 @@ void ec_fsm_slave_state_soe_request(
fsm->state = ec_fsm_slave_state_ready;
}
/*****************************************************************************/
/****************************************************************************/
#ifdef EC_EOE
/** Check for pending EoE IP parameter requests and process one.
@@ -651,7 +651,7 @@ int ec_fsm_slave_action_process_eoe(
return 1;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave state: EOE_REQUEST.
*/
@@ -681,5 +681,5 @@ void ec_fsm_slave_state_eoe_request(
fsm->state = ec_fsm_slave_state_ready;
}
/*****************************************************************************/
/****************************************************************************/
#endif
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT slave request state machine.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FSM_SLAVE_H__
#define __EC_FSM_SLAVE_H__
@@ -45,7 +43,7 @@
#include "fsm_eoe.h"
#endif
/*****************************************************************************/
/****************************************************************************/
typedef struct ec_fsm_slave ec_fsm_slave_t; /**< \see ec_fsm_slave */
@@ -74,7 +72,7 @@ struct ec_fsm_slave {
#endif
};
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_slave_init(ec_fsm_slave_t *, ec_slave_t *);
void ec_fsm_slave_clear(ec_fsm_slave_t *);
@@ -83,7 +81,7 @@ int ec_fsm_slave_exec(ec_fsm_slave_t *, ec_datagram_t *);
void ec_fsm_slave_set_ready(ec_fsm_slave_t *);
int ec_fsm_slave_is_ready(const ec_fsm_slave_t *);
/*****************************************************************************/
/****************************************************************************/
#endif // __EC_FSM_SLAVE_H__
+60 -61
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -16,15 +16,14 @@
* You should have received a copy of the GNU General Public License along
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* ---
*
*/
/** \file
*
* EtherCAT slave configuration state machine.
*/
/*****************************************************************************/
/****************************************************************************/
#include <asm/div64.h>
@@ -34,7 +33,7 @@
#include "slave_config.h"
#include "fsm_slave_config.h"
/*****************************************************************************/
/****************************************************************************/
/** Maximum clock difference (in ns) before going to SAFEOP.
*
@@ -51,7 +50,7 @@
*/
#define EC_DC_START_OFFSET 100000000ULL
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_slave_config_state_start(ec_fsm_slave_config_t *);
void ec_fsm_slave_config_state_init(ec_fsm_slave_config_t *);
@@ -108,7 +107,7 @@ void ec_fsm_slave_config_state_error(ec_fsm_slave_config_t *);
void ec_fsm_slave_config_reconfigure(ec_fsm_slave_config_t *);
/*****************************************************************************/
/****************************************************************************/
/** Constructor.
*/
@@ -133,7 +132,7 @@ void ec_fsm_slave_config_init(
fsm->wait_ms = 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Destructor.
*/
@@ -145,7 +144,7 @@ void ec_fsm_slave_config_clear(
ec_soe_request_clear(&fsm->soe_request_copy);
}
/*****************************************************************************/
/****************************************************************************/
/** Start slave configuration state machine.
*/
@@ -158,7 +157,7 @@ void ec_fsm_slave_config_start(
fsm->state = ec_fsm_slave_config_state_start;
}
/*****************************************************************************/
/****************************************************************************/
/**
* \return false, if state machine has terminated
@@ -171,7 +170,7 @@ int ec_fsm_slave_config_running(
&& fsm->state != ec_fsm_slave_config_state_error;
}
/*****************************************************************************/
/****************************************************************************/
/** Executes the current state of the state machine.
*
@@ -194,7 +193,7 @@ int ec_fsm_slave_config_exec(
return ec_fsm_slave_config_running(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/**
* \return true, if the state machine terminated gracefully
@@ -206,9 +205,9 @@ int ec_fsm_slave_config_success(
return fsm->state == ec_fsm_slave_config_state_end;
}
/******************************************************************************
/*****************************************************************************
* Slave configuration state machine
*****************************************************************************/
****************************************************************************/
/** Slave configuration state: START.
*/
@@ -220,7 +219,7 @@ void ec_fsm_slave_config_state_start(
ec_fsm_slave_config_enter_init(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Start state change to INIT.
*/
@@ -233,7 +232,7 @@ void ec_fsm_slave_config_enter_init(
fsm->state = ec_fsm_slave_config_state_init;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: INIT.
*/
@@ -270,7 +269,7 @@ void ec_fsm_slave_config_state_init(
fsm->state = ec_fsm_slave_config_state_clear_fmmus;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: CLEAR FMMU.
*/
@@ -300,7 +299,7 @@ void ec_fsm_slave_config_state_clear_fmmus(
ec_fsm_slave_config_enter_clear_sync(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Clear the sync manager configurations.
*/
@@ -329,7 +328,7 @@ void ec_fsm_slave_config_enter_clear_sync(
fsm->state = ec_fsm_slave_config_state_clear_sync;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: CLEAR SYNC.
*/
@@ -361,7 +360,7 @@ void ec_fsm_slave_config_state_clear_sync(
ec_fsm_slave_config_enter_dc_clear_assign(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Clear the DC assignment.
*/
@@ -385,7 +384,7 @@ void ec_fsm_slave_config_enter_dc_clear_assign(
fsm->state = ec_fsm_slave_config_state_dc_clear_assign;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: CLEAR DC ASSIGN.
*/
@@ -414,7 +413,7 @@ void ec_fsm_slave_config_state_dc_clear_assign(
ec_fsm_slave_config_enter_mbox_sync(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Check for mailbox sync managers to be configured.
*/
@@ -544,7 +543,7 @@ void ec_fsm_slave_config_enter_mbox_sync(
fsm->state = ec_fsm_slave_config_state_mbox_sync;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: SYNC.
*
@@ -611,7 +610,7 @@ void ec_fsm_slave_config_state_mbox_sync(
#endif
}
/*****************************************************************************/
/****************************************************************************/
#ifdef EC_SII_ASSIGN
@@ -637,7 +636,7 @@ void ec_fsm_slave_config_enter_assign_pdi(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: ASSIGN_PDI.
*/
@@ -669,7 +668,7 @@ cont_preop:
#endif
/*****************************************************************************/
/****************************************************************************/
/** Request PREOP state.
*/
@@ -690,7 +689,7 @@ void ec_fsm_slave_config_enter_boot_preop(
ec_fsm_change_exec(fsm->fsm_change); // execute immediately
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: BOOT/PREOP.
*/
@@ -761,7 +760,7 @@ void ec_fsm_slave_config_state_boot_preop(
#endif
}
/*****************************************************************************/
/****************************************************************************/
#ifdef EC_SII_ASSIGN
@@ -801,7 +800,7 @@ cont_sdo_conf:
#endif
/*****************************************************************************/
/****************************************************************************/
/** Check for SDO configurations to be applied.
*/
@@ -832,7 +831,7 @@ void ec_fsm_slave_config_enter_sdo_conf(
ec_fsm_coe_exec(fsm->fsm_coe, fsm->datagram); // execute immediately
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: SDO_CONF.
*/
@@ -871,7 +870,7 @@ void ec_fsm_slave_config_state_sdo_conf(
ec_fsm_slave_config_enter_soe_conf_preop(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Check for SoE configurations to be applied.
*/
@@ -905,7 +904,7 @@ void ec_fsm_slave_config_enter_soe_conf_preop(
ec_fsm_slave_config_enter_pdo_conf(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: SOE_CONF.
*/
@@ -949,7 +948,7 @@ void ec_fsm_slave_config_state_soe_conf_preop(
ec_fsm_slave_config_enter_pdo_conf(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** PDO_CONF entry function.
*/
@@ -963,7 +962,7 @@ void ec_fsm_slave_config_enter_pdo_conf(
fsm->state(fsm); // execute immediately
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: PDO_CONF.
*/
@@ -989,7 +988,7 @@ void ec_fsm_slave_config_state_pdo_conf(
ec_fsm_slave_config_enter_watchdog_divider(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** WATCHDOG_DIVIDER entry function.
*/
@@ -1014,7 +1013,7 @@ void ec_fsm_slave_config_enter_watchdog_divider(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: WATCHDOG_DIVIDER.
*/
@@ -1046,7 +1045,7 @@ void ec_fsm_slave_config_state_watchdog_divider(
ec_fsm_slave_config_enter_watchdog(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** WATCHDOG entry function
*/
@@ -1072,7 +1071,7 @@ void ec_fsm_slave_config_enter_watchdog(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: WATCHDOG.
*/
@@ -1104,7 +1103,7 @@ void ec_fsm_slave_config_state_watchdog(
ec_fsm_slave_config_enter_pdo_sync(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Check for PDO sync managers to be configured.
*/
@@ -1172,7 +1171,7 @@ void ec_fsm_slave_config_enter_pdo_sync(
fsm->state = ec_fsm_slave_config_state_pdo_sync;
}
/*****************************************************************************/
/****************************************************************************/
/** Configure PDO sync managers.
*/
@@ -1205,7 +1204,7 @@ void ec_fsm_slave_config_state_pdo_sync(
ec_fsm_slave_config_enter_fmmu(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Check for FMMUs to be configured.
*/
@@ -1259,7 +1258,7 @@ void ec_fsm_slave_config_enter_fmmu(
fsm->state = ec_fsm_slave_config_state_fmmu;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: FMMU.
*/
@@ -1291,7 +1290,7 @@ void ec_fsm_slave_config_state_fmmu(
ec_fsm_slave_config_enter_dc_cycle(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Check for DC to be configured.
*/
@@ -1329,7 +1328,7 @@ void ec_fsm_slave_config_enter_dc_cycle(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: DC CYCLE.
*/
@@ -1372,7 +1371,7 @@ void ec_fsm_slave_config_state_dc_cycle(
fsm->state = ec_fsm_slave_config_state_dc_sync_check;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: DC SYNC CHECK.
*/
@@ -1473,7 +1472,7 @@ void ec_fsm_slave_config_state_dc_sync_check(
fsm->state = ec_fsm_slave_config_state_dc_start;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: DC START.
*/
@@ -1518,7 +1517,7 @@ void ec_fsm_slave_config_state_dc_start(
fsm->state = ec_fsm_slave_config_state_dc_assign;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: DC ASSIGN.
*/
@@ -1550,7 +1549,7 @@ void ec_fsm_slave_config_state_dc_assign(
ec_fsm_slave_config_enter_wait_safeop(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Wait before SAFEOP transition.
*
@@ -1586,7 +1585,7 @@ void ec_fsm_slave_config_enter_wait_safeop(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: WAIT SAFEOP.
*/
@@ -1603,7 +1602,7 @@ void ec_fsm_slave_config_state_wait_safeop(
ec_fsm_slave_config_enter_safeop(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Request SAFEOP state.
*/
@@ -1616,7 +1615,7 @@ void ec_fsm_slave_config_enter_safeop(
ec_fsm_change_exec(fsm->fsm_change); // execute immediately
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: SAFEOP.
*/
@@ -1648,7 +1647,7 @@ void ec_fsm_slave_config_state_safeop(
ec_fsm_slave_config_enter_soe_conf_safeop(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Check for SoE configurations to be applied in SAFEOP.
*/
@@ -1682,7 +1681,7 @@ void ec_fsm_slave_config_enter_soe_conf_safeop(
ec_fsm_slave_config_enter_op(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: SOE_CONF.
*/
@@ -1726,7 +1725,7 @@ void ec_fsm_slave_config_state_soe_conf_safeop(
ec_fsm_slave_config_enter_op(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Bring slave to OP.
*/
@@ -1740,7 +1739,7 @@ void ec_fsm_slave_config_enter_op(
ec_fsm_change_exec(fsm->fsm_change); // execute immediately
}
/*****************************************************************************/
/****************************************************************************/
/** Slave configuration state: OP
*/
@@ -1766,7 +1765,7 @@ void ec_fsm_slave_config_state_op(
fsm->state = ec_fsm_slave_config_state_end; // successful
}
/*****************************************************************************/
/****************************************************************************/
/** Reconfigure the slave starting at INIT.
*/
@@ -1780,9 +1779,9 @@ void ec_fsm_slave_config_reconfigure(
ec_fsm_slave_config_enter_init(fsm); // reconfigure
}
/******************************************************************************
/*****************************************************************************
* Common state functions
*****************************************************************************/
****************************************************************************/
/** State: ERROR.
*/
@@ -1792,7 +1791,7 @@ void ec_fsm_slave_config_state_error(
{
}
/*****************************************************************************/
/****************************************************************************/
/** State: END.
*/
@@ -1802,4 +1801,4 @@ void ec_fsm_slave_config_state_end(
{
}
/*****************************************************************************/
/****************************************************************************/
+7 -8
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -16,15 +16,14 @@
* You should have received a copy of the GNU General Public License along
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* ---
*
*/
/**
\file
EtherCAT slave configuration state machine.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FSM_SLAVE_CONFIG_H__
#define __EC_FSM_SLAVE_CONFIG_H__
@@ -36,7 +35,7 @@
#include "fsm_coe.h"
#include "fsm_pdo.h"
/*****************************************************************************/
/****************************************************************************/
/** \see ec_fsm_slave_config */
typedef struct ec_fsm_slave_config ec_fsm_slave_config_t;
@@ -63,7 +62,7 @@ struct ec_fsm_slave_config
unsigned long wait_ms; /**< Wait time (used to wait before SAFEOP). */
};
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_slave_config_init(ec_fsm_slave_config_t *, ec_datagram_t *,
ec_fsm_change_t *, ec_fsm_coe_t *, ec_fsm_soe_t *, ec_fsm_pdo_t *);
@@ -74,6 +73,6 @@ void ec_fsm_slave_config_start(ec_fsm_slave_config_t *, ec_slave_t *);
int ec_fsm_slave_config_exec(ec_fsm_slave_config_t *);
int ec_fsm_slave_config_success(const ec_fsm_slave_config_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+35 -37
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT slave state machines.
*/
/*****************************************************************************/
/****************************************************************************/
#include "globals.h"
#include "master.h"
@@ -35,7 +33,7 @@
#include "fsm_slave_scan.h"
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_slave_scan_state_start(ec_fsm_slave_scan_t *);
void ec_fsm_slave_scan_state_address(ec_fsm_slave_scan_t *);
@@ -66,7 +64,7 @@ void ec_fsm_slave_scan_enter_regalias(ec_fsm_slave_scan_t *);
void ec_fsm_slave_scan_enter_preop(ec_fsm_slave_scan_t *);
void ec_fsm_slave_scan_enter_pdos(ec_fsm_slave_scan_t *);
/*****************************************************************************/
/****************************************************************************/
/** Constructor.
*/
@@ -86,7 +84,7 @@ void ec_fsm_slave_scan_init(
ec_fsm_sii_init(&fsm->fsm_sii, fsm->datagram);
}
/*****************************************************************************/
/****************************************************************************/
/** Destructor.
*/
@@ -96,7 +94,7 @@ void ec_fsm_slave_scan_clear(ec_fsm_slave_scan_t *fsm /**< slave state machine *
ec_fsm_sii_clear(&fsm->fsm_sii);
}
/*****************************************************************************/
/****************************************************************************/
/**
* Start slave scan state machine.
@@ -111,7 +109,7 @@ void ec_fsm_slave_scan_start(
fsm->state = ec_fsm_slave_scan_state_start;
}
/*****************************************************************************/
/****************************************************************************/
/**
\return false, if state machine has terminated
@@ -123,7 +121,7 @@ int ec_fsm_slave_scan_running(const ec_fsm_slave_scan_t *fsm /**< slave state ma
&& fsm->state != ec_fsm_slave_scan_state_error;
}
/*****************************************************************************/
/****************************************************************************/
/**
Executes the current state of the state machine.
@@ -144,7 +142,7 @@ int ec_fsm_slave_scan_exec(ec_fsm_slave_scan_t *fsm /**< slave state machine */)
return ec_fsm_slave_scan_running(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/**
\return true, if the state machine terminated gracefully
@@ -155,9 +153,9 @@ int ec_fsm_slave_scan_success(const ec_fsm_slave_scan_t *fsm /**< slave state ma
return fsm->state == ec_fsm_slave_scan_state_end;
}
/******************************************************************************
/*****************************************************************************
* slave scan state machine
*****************************************************************************/
****************************************************************************/
/**
Slave scan state: START.
@@ -174,7 +172,7 @@ void ec_fsm_slave_scan_state_start(ec_fsm_slave_scan_t *fsm /**< slave state mac
fsm->state = ec_fsm_slave_scan_state_address;
}
/*****************************************************************************/
/****************************************************************************/
/**
Slave scan state: ADDRESS.
@@ -212,7 +210,7 @@ void ec_fsm_slave_scan_state_address(
fsm->state = ec_fsm_slave_scan_state_state;
}
/*****************************************************************************/
/****************************************************************************/
/**
Slave scan state: STATE.
@@ -258,7 +256,7 @@ void ec_fsm_slave_scan_state_state(
fsm->state = ec_fsm_slave_scan_state_base;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave scan state: BASE.
*/
@@ -330,7 +328,7 @@ void ec_fsm_slave_scan_state_base(
}
}
/*****************************************************************************/
/****************************************************************************/
/**
Slave scan state: DC CAPABILITIES.
@@ -375,7 +373,7 @@ void ec_fsm_slave_scan_state_dc_cap(
fsm->state = ec_fsm_slave_scan_state_dc_times;
}
/*****************************************************************************/
/****************************************************************************/
/**
Slave scan state: DC TIMES.
@@ -414,7 +412,7 @@ void ec_fsm_slave_scan_state_dc_times(
ec_fsm_slave_scan_enter_datalink(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/**
Slave scan entry function: DATALINK.
@@ -434,7 +432,7 @@ void ec_fsm_slave_scan_enter_datalink(
fsm->state = ec_fsm_slave_scan_state_datalink;
}
/*****************************************************************************/
/****************************************************************************/
/** Enter slave scan state SII_SIZE.
*/
@@ -453,7 +451,7 @@ void ec_fsm_slave_scan_enter_sii_size(
fsm->state(fsm); // execute state immediately
}
/*****************************************************************************/
/****************************************************************************/
#ifdef EC_SII_ASSIGN
@@ -477,7 +475,7 @@ void ec_fsm_slave_scan_enter_assign_sii(
#endif
/*****************************************************************************/
/****************************************************************************/
/**
Slave scan state: DATALINK.
@@ -527,7 +525,7 @@ void ec_fsm_slave_scan_state_datalink(
#endif
}
/*****************************************************************************/
/****************************************************************************/
#ifdef EC_SII_ASSIGN
@@ -565,7 +563,7 @@ continue_with_sii_size:
#endif
/*****************************************************************************/
/****************************************************************************/
/**
Slave scan state: SII SIZE.
@@ -642,7 +640,7 @@ alloc_sii:
ec_fsm_sii_exec(&fsm->fsm_sii); // execute state immediately
}
/*****************************************************************************/
/****************************************************************************/
/**
Slave scan state: SII DATA.
@@ -869,7 +867,7 @@ end:
fsm->state = ec_fsm_slave_scan_state_error;
}
/*****************************************************************************/
/****************************************************************************/
#ifdef EC_REGALIAS
@@ -890,7 +888,7 @@ void ec_fsm_slave_scan_enter_regalias(
fsm->state = ec_fsm_slave_scan_state_regalias;
}
/*****************************************************************************/
/****************************************************************************/
/** Slave scan state: REGALIAS.
*/
@@ -928,7 +926,7 @@ void ec_fsm_slave_scan_state_regalias(
#endif // defined EC_REGALIAS
/*****************************************************************************/
/****************************************************************************/
/** Enter slave scan state PREOP.
*/
@@ -966,7 +964,7 @@ void ec_fsm_slave_scan_enter_preop(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Slave scan state: PREOP.
*/
@@ -985,7 +983,7 @@ void ec_fsm_slave_scan_state_preop(
ec_fsm_slave_scan_enter_pdos(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Slave scan state: SYNC.
*/
@@ -1053,7 +1051,7 @@ void ec_fsm_slave_scan_state_sync(
ec_fsm_slave_scan_enter_pdos(fsm);
}
/*****************************************************************************/
/****************************************************************************/
/** Enter slave scan state PDOS.
*/
@@ -1069,7 +1067,7 @@ void ec_fsm_slave_scan_enter_pdos(
ec_fsm_pdo_exec(fsm->fsm_pdo, fsm->datagram); // execute immediately
}
/*****************************************************************************/
/****************************************************************************/
/** Slave scan state: PDOS.
*/
@@ -1090,9 +1088,9 @@ void ec_fsm_slave_scan_state_pdos(
fsm->state = ec_fsm_slave_scan_state_end;
}
/******************************************************************************
/*****************************************************************************
* Common state functions
*****************************************************************************/
****************************************************************************/
/** State: ERROR.
*/
@@ -1102,7 +1100,7 @@ void ec_fsm_slave_scan_state_error(
{
}
/*****************************************************************************/
/****************************************************************************/
/** State: END.
*/
@@ -1112,4 +1110,4 @@ void ec_fsm_slave_scan_state_end(
{
}
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT slave scanning state machine.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FSM_SLAVE_SCAN_H__
#define __EC_FSM_SLAVE_SCAN_H__
@@ -39,7 +37,7 @@
#include "fsm_coe.h"
#include "fsm_pdo.h"
/*****************************************************************************/
/****************************************************************************/
/** \see ec_fsm_slave_scan */
typedef struct ec_fsm_slave_scan ec_fsm_slave_scan_t;
@@ -61,7 +59,7 @@ struct ec_fsm_slave_scan
ec_fsm_sii_t fsm_sii; /**< SII state machine. */
};
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_slave_scan_init(ec_fsm_slave_scan_t *, ec_datagram_t *,
ec_fsm_slave_config_t *, ec_fsm_pdo_t *);
@@ -72,6 +70,6 @@ void ec_fsm_slave_scan_start(ec_fsm_slave_scan_t *, ec_slave_t *);
int ec_fsm_slave_scan_exec(ec_fsm_slave_scan_t *);
int ec_fsm_slave_scan_success(const ec_fsm_slave_scan_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+28 -28
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2006-2020 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -17,21 +17,21 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT SoE state machines.
*/
/*****************************************************************************/
/****************************************************************************/
#include "globals.h"
#include "master.h"
#include "mailbox.h"
#include "fsm_soe.h"
/*****************************************************************************/
/****************************************************************************/
/** SoE operations
*/
@@ -54,7 +54,7 @@ enum {
*/
#define EC_SOE_RESPONSE_TIMEOUT 1000
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_soe_read_start(ec_fsm_soe_t *, ec_datagram_t *);
void ec_fsm_soe_read_request(ec_fsm_soe_t *, ec_datagram_t *);
@@ -69,11 +69,11 @@ void ec_fsm_soe_write_response(ec_fsm_soe_t *, ec_datagram_t *);
void ec_fsm_soe_end(ec_fsm_soe_t *, ec_datagram_t *);
void ec_fsm_soe_error(ec_fsm_soe_t *, ec_datagram_t *);
/*****************************************************************************/
/****************************************************************************/
extern const ec_code_msg_t soe_error_codes[];
/*****************************************************************************/
/****************************************************************************/
/** Outputs an SoE error code.
*/
@@ -92,7 +92,7 @@ void ec_print_soe_error(const ec_slave_t *slave, uint16_t error_code)
EC_SLAVE_ERR(slave, "Unknown SoE error 0x%04X.\n", error_code);
}
/*****************************************************************************/
/****************************************************************************/
/** Constructor.
*/
@@ -105,7 +105,7 @@ void ec_fsm_soe_init(
fsm->fragment_size = 0;
}
/*****************************************************************************/
/****************************************************************************/
/** Destructor.
*/
@@ -115,7 +115,7 @@ void ec_fsm_soe_clear(
{
}
/*****************************************************************************/
/****************************************************************************/
/** Starts to transfer an IDN to/from a slave.
*/
@@ -135,7 +135,7 @@ void ec_fsm_soe_transfer(
}
}
/*****************************************************************************/
/****************************************************************************/
/** Executes the current state of the state machine.
*
@@ -170,7 +170,7 @@ int ec_fsm_soe_exec(
return datagram_used;
}
/*****************************************************************************/
/****************************************************************************/
/** Returns, if the state machine terminated with success.
*
@@ -181,7 +181,7 @@ int ec_fsm_soe_success(const ec_fsm_soe_t *fsm /**< Finite state machine */)
return fsm->state == ec_fsm_soe_end;
}
/*****************************************************************************/
/****************************************************************************/
/** Output information about a failed SoE transfer.
*/
@@ -200,9 +200,9 @@ void ec_fsm_soe_print_error(ec_fsm_soe_t *fsm /**< Finite state machine */)
printk(KERN_CONT " IDN 0x%04X failed.\n", request->idn);
}
/******************************************************************************
/*****************************************************************************
* SoE read state machine
*****************************************************************************/
****************************************************************************/
/** Prepare a read operation.
*
@@ -239,7 +239,7 @@ int ec_fsm_soe_prepare_read(
return 0;
}
/*****************************************************************************/
/****************************************************************************/
/** SoE state: READ START.
*/
@@ -270,7 +270,7 @@ void ec_fsm_soe_read_start(
}
}
/*****************************************************************************/
/****************************************************************************/
/** SoE state: READ REQUEST.
*/
@@ -325,7 +325,7 @@ void ec_fsm_soe_read_request(
fsm->state = ec_fsm_soe_read_check;
}
/*****************************************************************************/
/****************************************************************************/
/** CoE state: READ CHECK.
*/
@@ -381,7 +381,7 @@ void ec_fsm_soe_read_check(
fsm->state = ec_fsm_soe_read_response;
}
/*****************************************************************************/
/****************************************************************************/
/** SoE state: READ RESPONSE.
*/
@@ -505,9 +505,9 @@ void ec_fsm_soe_read_response(
}
}
/******************************************************************************
/*****************************************************************************
* SoE write state machine
*****************************************************************************/
****************************************************************************/
/** Write next fragment.
*/
@@ -554,7 +554,7 @@ void ec_fsm_soe_write_next_fragment(
fsm->state = ec_fsm_soe_write_request;
}
/*****************************************************************************/
/****************************************************************************/
/** SoE state: WRITE START.
*/
@@ -590,7 +590,7 @@ void ec_fsm_soe_write_start(
req->jiffies_sent = jiffies;
}
/*****************************************************************************/
/****************************************************************************/
/** SoE state: WRITE REQUEST.
*/
@@ -650,7 +650,7 @@ void ec_fsm_soe_write_request(
}
}
/*****************************************************************************/
/****************************************************************************/
/** CoE state: WRITE CHECK.
*/
@@ -704,7 +704,7 @@ void ec_fsm_soe_write_check(
fsm->state = ec_fsm_soe_write_response;
}
/*****************************************************************************/
/****************************************************************************/
/** SoE state: WRITE RESPONSE.
*/
@@ -811,7 +811,7 @@ void ec_fsm_soe_write_response(
}
}
/*****************************************************************************/
/****************************************************************************/
/** State: ERROR.
*/
@@ -822,7 +822,7 @@ void ec_fsm_soe_error(
{
}
/*****************************************************************************/
/****************************************************************************/
/** State: END.
*/
@@ -833,4 +833,4 @@ void ec_fsm_soe_end(
{
}
/*****************************************************************************/
/****************************************************************************/
+6 -8
View File
@@ -1,6 +1,4 @@
/******************************************************************************
*
* $Id$
/*****************************************************************************
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -19,14 +17,14 @@
* with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT CoE state machines.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_FSM_SOE_H__
#define __EC_FSM_SOE_H__
@@ -36,7 +34,7 @@
#include "slave.h"
#include "soe_request.h"
/*****************************************************************************/
/****************************************************************************/
typedef struct ec_fsm_soe ec_fsm_soe_t; /**< \see ec_fsm_soe */
@@ -54,7 +52,7 @@ struct ec_fsm_soe {
size_t fragment_size; /**< Size of the current fragment. */
};
/*****************************************************************************/
/****************************************************************************/
void ec_fsm_soe_init(ec_fsm_soe_t *);
void ec_fsm_soe_clear(ec_fsm_soe_t *);
@@ -64,6 +62,6 @@ void ec_fsm_soe_transfer(ec_fsm_soe_t *, ec_slave_t *, ec_soe_request_t *);
int ec_fsm_soe_exec(ec_fsm_soe_t *, ec_datagram_t *);
int ec_fsm_soe_success(const ec_fsm_soe_t *);
/*****************************************************************************/
/****************************************************************************/
#endif
+17 -17
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2006-2021 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -16,13 +16,13 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this file. If not, see <http://www.gnu.org/licenses/>.
*
*****************************************************************************/
****************************************************************************/
/** \file
* Global definitions and macros.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_MASTER_GLOBALS_H__
#define __EC_MASTER_GLOBALS_H__
@@ -30,9 +30,9 @@
#include "../globals.h"
#include "../include/ecrt.h"
/******************************************************************************
/*****************************************************************************
* EtherCAT master
*****************************************************************************/
****************************************************************************/
/** Datagram timeout in microseconds. */
#define EC_IO_TIMEOUT 500
@@ -59,9 +59,9 @@
/** Number of statistic rate intervals to maintain. */
#define EC_RATE_COUNT 3
/******************************************************************************
/*****************************************************************************
* EtherCAT protocol
*****************************************************************************/
****************************************************************************/
/** Size of an EtherCAT frame header. */
#define EC_FRAME_HEADER_SIZE 2
@@ -202,7 +202,7 @@ typedef enum {
extern const char *ec_device_names[2]; // only main and backup!
/*****************************************************************************/
/****************************************************************************/
/** Convenience macro for printing EtherCAT-specific information to syslog.
*
@@ -244,17 +244,17 @@ extern const char *ec_device_names[2]; // only main and backup!
#define EC_DBG(fmt, args...) \
printk(KERN_DEBUG "EtherCAT DEBUG: " fmt, ##args)
/*****************************************************************************/
/****************************************************************************/
/** Absolute value.
*/
#define EC_ABS(X) ((X) >= 0 ? (X) : -(X))
/*****************************************************************************/
/****************************************************************************/
extern char *ec_master_version_str;
/*****************************************************************************/
/****************************************************************************/
unsigned int ec_master_count(void);
void ec_print_data(const uint8_t *, size_t);
@@ -265,7 +265,7 @@ int ec_mac_is_zero(const uint8_t *);
ec_master_t *ecrt_request_master_err(unsigned int);
/*****************************************************************************/
/****************************************************************************/
/** Code/Message pair.
*
@@ -277,7 +277,7 @@ typedef struct {
const char *message; /**< Message belonging to \a code. */
} ec_code_msg_t;
/*****************************************************************************/
/****************************************************************************/
/** Generic request state.
*
@@ -292,11 +292,11 @@ typedef enum {
EC_INT_REQUEST_FAILURE
} ec_internal_request_state_t;
/*****************************************************************************/
/****************************************************************************/
extern const ec_request_state_t ec_request_state_translation_table[];
/*****************************************************************************/
/****************************************************************************/
/** Origin type.
*/
@@ -305,10 +305,10 @@ typedef enum {
EC_ORIG_EXTERNAL /**< External. */
} ec_origin_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct ec_slave ec_slave_t; /**< \see ec_slave. */
/*****************************************************************************/
/****************************************************************************/
#endif
+144 -123
View File
File diff suppressed because it is too large Load Diff
+48 -48
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/*****************************************************************************
*
* Copyright (C) 2006-2021 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -16,14 +16,14 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this file. If not, see <http://www.gnu.org/licenses/>.
*
*****************************************************************************/
****************************************************************************/
/**
\file
EtherCAT master character device IOCTL commands.
*/
/*****************************************************************************/
/****************************************************************************/
#ifndef __EC_IOCTL_H__
#define __EC_IOCTL_H__
@@ -32,7 +32,7 @@
#include "globals.h"
/*****************************************************************************/
/****************************************************************************/
/** \cond */
@@ -157,18 +157,18 @@
#define EC_IOCTL_VOE_DATA EC_IOWR(0x62, ec_ioctl_voe_t)
#define EC_IOCTL_SET_SEND_INTERVAL EC_IOW(0x63, size_t)
/*****************************************************************************/
/****************************************************************************/
#define EC_IOCTL_STRING_SIZE 64
/*****************************************************************************/
/****************************************************************************/
typedef struct {
uint32_t ioctl_version_magic;
uint32_t master_count;
} ec_ioctl_module_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
uint32_t slave_count;
@@ -208,7 +208,7 @@ typedef struct {
uint16_t ref_clock;
} ec_ioctl_master_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// input
@@ -257,7 +257,7 @@ typedef struct {
char name[EC_IOCTL_STRING_SIZE];
} ec_ioctl_slave_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -272,7 +272,7 @@ typedef struct {
uint8_t pdo_count;
} ec_ioctl_slave_sync_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -286,7 +286,7 @@ typedef struct {
int8_t name[EC_IOCTL_STRING_SIZE];
} ec_ioctl_slave_sync_pdo_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -302,7 +302,7 @@ typedef struct {
int8_t name[EC_IOCTL_STRING_SIZE];
} ec_ioctl_slave_sync_pdo_entry_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -316,7 +316,7 @@ typedef struct {
uint32_t fmmu_count;
} ec_ioctl_domain_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -332,7 +332,7 @@ typedef struct {
uint32_t data_size;
} ec_ioctl_domain_fmmu_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -341,7 +341,7 @@ typedef struct {
uint8_t *target;
} ec_ioctl_domain_data_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -349,7 +349,7 @@ typedef struct {
uint8_t al_state;
} ec_ioctl_slave_state_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -362,7 +362,7 @@ typedef struct {
int8_t name[EC_IOCTL_STRING_SIZE];
} ec_ioctl_slave_sdo_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -378,7 +378,7 @@ typedef struct {
int8_t description[EC_IOCTL_STRING_SIZE];
} ec_ioctl_slave_sdo_entry_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -393,7 +393,7 @@ typedef struct {
uint32_t abort_code;
} ec_ioctl_slave_sdo_upload_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -408,7 +408,7 @@ typedef struct {
uint32_t abort_code;
} ec_ioctl_slave_sdo_download_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -418,7 +418,7 @@ typedef struct {
uint16_t *words;
} ec_ioctl_slave_sii_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -429,7 +429,7 @@ typedef struct {
uint8_t *data;
} ec_ioctl_slave_reg_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -445,7 +445,7 @@ typedef struct {
char file_name[32];
} ec_ioctl_slave_foe_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -460,7 +460,7 @@ typedef struct {
uint16_t error_code;
} ec_ioctl_slave_soe_read_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -474,7 +474,7 @@ typedef struct {
uint16_t error_code;
} ec_ioctl_slave_soe_write_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -501,7 +501,7 @@ typedef struct {
ec_sync_signal_t dc_sync[EC_SYNC_SIGNAL_COUNT];
} ec_ioctl_config_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -515,7 +515,7 @@ typedef struct {
int8_t name[EC_IOCTL_STRING_SIZE];
} ec_ioctl_config_pdo_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -531,7 +531,7 @@ typedef struct {
int8_t name[EC_IOCTL_STRING_SIZE];
} ec_ioctl_config_pdo_entry_t;
/*****************************************************************************/
/****************************************************************************/
/** Maximum size for displayed SDO data.
* \todo Make this dynamic.
@@ -551,7 +551,7 @@ typedef struct {
uint8_t complete_access;
} ec_ioctl_config_sdo_t;
/*****************************************************************************/
/****************************************************************************/
/** Maximum size for displayed IDN data.
* \todo Make this dynamic.
@@ -571,7 +571,7 @@ typedef struct {
uint8_t data[EC_MAX_IDN_DATA_SIZE];
} ec_ioctl_config_idn_t;
/*****************************************************************************/
/****************************************************************************/
/** Maximum size for key.
*/
@@ -587,7 +587,7 @@ typedef struct {
int32_t value;
} ec_ioctl_config_flag_t;
/*****************************************************************************/
/****************************************************************************/
#ifdef EC_EOE
@@ -609,7 +609,7 @@ typedef struct {
#endif
/*****************************************************************************/
/****************************************************************************/
#define EC_ETH_ALEN 6
#ifdef ETH_ALEN
@@ -648,7 +648,7 @@ typedef struct {
size_t process_data_size;
} ec_ioctl_master_activate_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -659,7 +659,7 @@ typedef struct {
uint8_t entry_bit_length;
} ec_ioctl_add_pdo_entry_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -672,7 +672,7 @@ typedef struct {
unsigned int bit_position;
} ec_ioctl_reg_pdo_entry_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -686,7 +686,7 @@ typedef struct {
unsigned int bit_position;
} ec_ioctl_reg_pdo_pos_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -698,7 +698,7 @@ typedef struct {
uint8_t complete_access;
} ec_ioctl_sc_sdo_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -710,7 +710,7 @@ typedef struct {
int32_t overruns;
} ec_ioctl_sc_emerg_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -720,7 +720,7 @@ typedef struct {
ec_slave_config_state_t *state;
} ec_ioctl_sc_state_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -732,7 +732,7 @@ typedef struct {
size_t size;
} ec_ioctl_sc_idn_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -742,7 +742,7 @@ typedef struct {
int32_t value;
} ec_ioctl_sc_flag_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -752,7 +752,7 @@ typedef struct {
ec_domain_state_t *state;
} ec_ioctl_domain_state_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -768,7 +768,7 @@ typedef struct {
ec_request_state_t state;
} ec_ioctl_sdo_request_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -784,7 +784,7 @@ typedef struct {
ec_request_state_t state;
} ec_ioctl_soe_request_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -800,7 +800,7 @@ typedef struct {
size_t transfer_size;
} ec_ioctl_reg_request_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -815,7 +815,7 @@ typedef struct {
ec_request_state_t state;
} ec_ioctl_voe_t;
/*****************************************************************************/
/****************************************************************************/
typedef struct {
// inputs
@@ -825,7 +825,7 @@ typedef struct {
ec_master_link_state_t *state;
} ec_ioctl_link_state_t;
/*****************************************************************************/
/****************************************************************************/
#ifdef __KERNEL__
@@ -851,7 +851,7 @@ int ec_rtdm_mmap(ec_ioctl_context_t *, void **);
#endif
/*****************************************************************************/
/****************************************************************************/
/** \endcond */

Some files were not shown because too many files have changed in this diff Show More