# HG changeset patch # User Florian Pose # Date 1230563956 0 # Node ID e206f4485f60fabb1994fcdabe0384811ec5cf3b # Parent 399ef727bf6251a1247c8e3d2a111605e2e265b7 Fixed spelling of EtherCAT terms. diff -r 399ef727bf62 -r e206f4485f60 FEATURES --- a/FEATURES Mon Dec 29 14:10:27 2008 +0000 +++ b/FEATURES Mon Dec 29 15:19:16 2008 +0000 @@ -29,11 +29,11 @@ * Common API for Realtime-Applications in kernel- and userspace. - Requesting and releasing masters. - Dynamic slave configuration, even for slaves that are offline. - - Detailed configuration of the slaves' Pdos and Sdos. - - Creation of process data domains (see below). Registration of Pdo entries + - Detailed configuration of the slaves' PDOs and SDOs. + - Creation of process data domains (see below). Registration of PDO entries for exchange within a domain. - Monitoring the states of masters, slave configurations and domains. - - Sdo handlers for application-triggered CoE transfers (see below). + - SDO handlers for application-triggered CoE transfers (see below). - Avoidance of unnecessary copy operations for process data. * Separating slave groups through domains. @@ -49,12 +49,12 @@ - Automatic configuration of slaves, if a application-layer state change is requested. -* Implementation of the CANopen-over-EtherCAT (CoE) mailbox protocol. +* Implementation of the CANopen over EtherCAT (CoE) mailbox protocol. - Configuration of CoE-capable slaves. - - Sdo information service (dictionary listing). - - Sdo transfers both via the application interface and the command-line tool. + - SDO information service (dictionary listing). + - SDO transfers both via the application interface and the command-line tool. -* Implementation of the Ethernet-over-EtherCAT (EoE) mailbox protocol. +* Implementation of the Ethernet over EtherCAT (EoE) mailbox protocol. - Virtual network interface for any EoE-capable slave. - Both a switched and a routed EoE network architecture is natively supported and configurable with standard tools. @@ -64,7 +64,7 @@ - Reading/Writing alias addresses. - Listing slave configurations. - Viewing process data. - - Sdo download/upload; listing Sdo dictionaries. + - SDO download/upload; listing SDO dictionaries. - Slave SII (EEPROM) access. - Controlling application-layer states. - Generation of slave description XML from existing slaves. diff -r 399ef727bf62 -r e206f4485f60 NEWS --- a/NEWS Mon Dec 29 14:10:27 2008 +0000 +++ b/NEWS Mon Dec 29 15:19:16 2008 +0000 @@ -20,6 +20,8 @@ frame. * Modified licence headers to avoid conflicts with the GPL. * Restricted licence to GPLv2 only. +* Fixed spelling of 'PDO', 'SDO' (all uppercase) and 'xx over EtherCAT' + (without hyphens). Changes in version 1.4.0-rc3: @@ -28,7 +30,7 @@ semaphore was not released. * Minor fix in 'slaves' command that fixed duplicate display of supported mailbox protocols. -* The Sdo Information Service is only queried, if the slave has the +* The SDO Information Service is only queried, if the slave has the corresponding SII bit set. * Added some missing header files in the command-line-tool code. * Removed unstable e100, forcedeth, and r8169 drivers. @@ -59,18 +61,18 @@ offers the possibility to use a shared-memory region. Therefore, added the domain methods ecrt_domain_size() and ecrt_domain_external_memory(). - - Pdo entry registration functions do not return a process data pointer, + - PDO entry registration functions do not return a process data pointer, but an offset in the domain's process data. In addition, an optional bit position can be requested. This was necessary for the external domain memory. An additional advantage is, that the returned offset is immediately valid. If the domain's process data is allocated internally, the start address can be retrieved with ecrt_domain_data(). - Replaced ecrt_slave_pdo_mapping/add/clear() with - ecrt_slave_config_pdo_assign_add() to add a Pdo to a sync manager's Pdo - assignment and ecrt_slave_config_pdo_mapping_add() to add a Pdo entry to a - Pdo's mapping. ecrt_slave_config_pdos() is a convenience function + ecrt_slave_config_pdo_assign_add() to add a PDO to a sync manager's PDO + assignment and ecrt_slave_config_pdo_mapping_add() to add a PDO entry to a + PDO's mapping. ecrt_slave_config_pdos() is a convenience function for both, that uses the new data types ec_pdo_info_t and - ec_pdo_entry_info_t. Pdo entries, that are mapped with these functions + ec_pdo_entry_info_t. PDO entries, that are mapped with these functions can now immediately be registered, even if the bus is offline. - Renamed ec_bus_status_t, ec_master_status_t to ec_bus_state_t and ec_master_state_t, respectively. Renamed ecrt_master_get_status() to @@ -78,15 +80,15 @@ - Added ec_domain_state_t and ec_wc_state_t for a new output parameter of ecrt_domain_state(). The domain state object does now contain information, if the process data was exchanged completely. - - Former "Pdo registration" meant Pdo entry registration in fact, therefore + - Former "PDO registration" meant PDO entry registration in fact, therefore renamed ec_pdo_reg_t to ec_pdo_entry_reg_t and ecrt_domain_register_pdo() to ecrt_slave_config_reg_pdo_entry(). - Removed ecrt_domain_register_pdo_range(), because it's functionality can - be reached by specifying an explicit Pdo assignment/mapping and - registering the mapped Pdo entries. - - Added an Sdo access interface, working with Sdo requests. These can be + be reached by specifying an explicit PDO assignment/mapping and + registering the mapped PDO entries. + - Added an SDO access interface, working with SDO requests. These can be scheduled for reading and writing during realtime operation. - - Exported ecrt_slave_config_sdo(), the generic Sdo configuration function. + - Exported ecrt_slave_config_sdo(), the generic SDO configuration function. - Removed the bus_state and bus_tainted flags from ec_master_state_t. * Device interface changes: - Moved device output parameter of ecdev_offer() to return value. @@ -99,10 +101,10 @@ - Set the master's debug level. - Show domain information. - Show master information. - - List Pdo assignment/mapping. - - Write an Sdo entry. - - List Sdo dictionaries. - - Read an Sdo entry. + - List PDO assignment/mapping. + - Write an SDO entry. + - List SDO dictionaries. + - Read an SDO entry. - Output a slave's SII contents. - Write slave's SII contents. - Show slaves. @@ -111,11 +113,11 @@ * Removed include/ecdb.h. * Using the timestamp counter is now optional (configure --enable-cycles), because it is only available on Intel architectures. -* Sdo dictionaries will now also be fetched in operation mode. +* SDO dictionaries will now also be fetched in operation mode. * SII write requests will now also be processed in operation mode. -* Mapping of Pdo entries is now supported. -* Current Pdo assignment/mapping is now read via CoE during bus scan, using - direct Sdo access, independent of the dictionary. +* Mapping of PDO entries is now supported. +* Current PDO assignment/mapping is now read via CoE during bus scan, using + direct SDO access, independent of the dictionary. * Network driver news: - Added 8139too driver for kernel 2.6.22, thanks to Erwin Burgstaller. - Added 8139too driver for kernel 2.6.23, thanks to Richard Hacker. @@ -137,8 +139,8 @@ * Added support for slaves that do not support the LRW datagram type. Separate domains have to be used for inputs and output. * CoE implementation: - - Use expedites transfer type for Sdos <= 4 byte (thanks to J. Mohre). - - Allow gaps in Pdo mapping (thanks to R. Roesch). + - Use expedites transfer type for SDOs <= 4 byte (thanks to J. Mohre). + - Allow gaps in PDO mapping (thanks to R. Roesch). - Added some transfer timeouts. - Ansynchronous handling of Emergency requests. - Bugfixes. diff -r 399ef727bf62 -r e206f4485f60 README.EoE --- a/README.EoE Mon Dec 29 14:10:27 2008 +0000 +++ b/README.EoE Mon Dec 29 15:19:16 2008 +0000 @@ -3,7 +3,7 @@ $Id$ This file shall give additional information on how to set up a network -environment with Ethernet-over-EtherCAT devices. +environment with Ethernet over EtherCAT devices. A virtual network interface will appear for every EoE-capable slave. The interface naming scheme is either eoeXsY, where X is the master index and Y is diff -r 399ef727bf62 -r e206f4485f60 TODO --- a/TODO Mon Dec 29 14:10:27 2008 +0000 +++ b/TODO Mon Dec 29 15:19:16 2008 +0000 @@ -9,7 +9,6 @@ Release: * config race. -* Pdo -> PDO. Sdo -> SDO "-over-" Future issues: @@ -33,7 +32,7 @@ - Data type abbreviations. - Add a -n (numeric) switch. - Check for unwanted options. -* Segmented Sdo downloads. +* Segmented SDO downloads. Smaller issues: diff -r 399ef727bf62 -r e206f4485f60 configure.ac --- a/configure.ac Mon Dec 29 14:10:27 2008 +0000 +++ b/configure.ac Mon Dec 29 15:19:16 2008 +0000 @@ -264,7 +264,7 @@ fi #------------------------------------------------------------------------------ -# Ethernet-over-EtherCAT support +# Ethernet over EtherCAT support #------------------------------------------------------------------------------ AC_ARG_ENABLE([eoe], diff -r 399ef727bf62 -r e206f4485f60 documentation/ethercat_doc.tex --- a/documentation/ethercat_doc.tex Mon Dec 29 14:10:27 2008 +0000 +++ b/documentation/ethercat_doc.tex Mon Dec 29 15:19:16 2008 +0000 @@ -227,19 +227,19 @@ \end{itemize} -\item CANopen-over-EtherCAT (CoE) +\item CANopen over EtherCAT (CoE) \begin{itemize} - \item Sdo upload, download and information service. - - \item Slave configuration via Sdos. - - \item Sdo access from userspace and from the application. + \item SDO upload, download and information service. + + \item Slave configuration via SDOs. + + \item SDO access from userspace and from the application. \end{itemize} -\item Ethernet-over-EtherCAT (EoE) +\item Ethernet over EtherCAT (EoE) \begin{itemize} @@ -254,12 +254,12 @@ \begin{itemize} - \item Showing the current bus with slaves, Pdos and Sdos. + \item Showing the current bus with slaves, PDOs and SDOs. \item Showing the bus configuration. \item Showing domains and process data. \item Setting the master's debug level. \item Writing alias addresses. - \item Sdo uploading/downloading. + \item SDO uploading/downloading. \item Reading/writing a slave's SII. \item Setting slave states. \item Generate slave description XML. @@ -449,7 +449,7 @@ an Ethernet device, but is not requested by any application yet. The master runs its state machine (see sec.~\ref{sec:fsm-master}), that automatically scans the bus for slaves and executes pending operations from the userspace -interface (for example Sdo access). The command-line tool can be used to +interface (for example SDO access). The command-line tool can be used to access the bus, but there is no process data exchange because of the missing bus configuration. @@ -470,12 +470,12 @@ \index{Process data} Slaves offer their inputs and outputs by presenting the master so-called -``Process Data Objects'' (Pdos\index{Pdo}). The available Pdos can be either +``Process Data Objects'' (PDOs\index{PDO}). The available PDOs can be either determined by reading out the slave's TXPDO and RXPDO SII categories from the -E$^2$PROM (in case of fixed Pdos) or by reading out the appropriate CoE +E$^2$PROM (in case of fixed PDOs) or by reading out the appropriate CoE objects (see sec.~\ref{sec:coe}), if available. The application can register -the Pdos' entries for exchange during cyclic operation. The sum of all -registered Pdo entries defines the ``process data image'', which is exchanged +the PDOs' entries for exchange during cyclic operation. The sum of all +registered PDO entries defines the ``process data image'', which is exchanged via datagrams with ``logical'' memory access (like LWR, LRD or LRW) introduced in~\cite[sec.~5.4]{dlspec}. @@ -483,8 +483,8 @@ \index{Domain} The process data image can be easily managed by creating so-called -``domains'', which allow grouped Pdo exchange. They also take care of managing -the datagram structures needed to exchange the Pdos. Domains are mandatory for +``domains'', which allow grouped PDO exchange. They also take care of managing +the datagram structures needed to exchange the PDOs. Domains are mandatory for process data exchange, so there has to be at least one. They were introduced for the following reasons: @@ -498,10 +498,10 @@ to be partitioned for the use of multiple datagrams. A domain manages this automatically. -\item Not every Pdo has to be exchanged with the same frequency: The values of -Pdos can vary slowly over time (for example temperature values), so exchanging +\item Not every PDO has to be exchanged with the same frequency: The values of +PDOs can vary slowly over time (for example temperature values), so exchanging them with a high frequency would just waste bus bandwidth. For this reason, -multiple domains can be created, to group different Pdos and so allow separate +multiple domains can be created, to group different PDOs and so allow separate exchange. \end{itemize} @@ -513,21 +513,21 @@ \paragraph{FMMU Configuration} \index{FMMU!Configuration} -An application can register Pdo entries for exchange. Every Pdo entry and its -parent Pdo is part of a memory area in the slave's physical memory, that is +An application can register PDO entries for exchange. Every PDO entry and its +parent PDO is part of a memory area in the slave's physical memory, that is protected by a sync manager \cite[sec.~6.7]{dlspec} for synchronized access. In order to make a sync manager react on a datagram accessing its memory, it is necessary to access the last byte covered by the sync manager. Otherwise the sync manager will not react on the datagram and no data will be exchanged. That is why the whole synchronized memory area has to be included into the -process data image: For example, if a certain Pdo entry of a slave is +process data image: For example, if a certain PDO entry of a slave is registered for exchange with a certain domain, one FMMU will be configured to -map the complete sync-manager-protected memory, the Pdo entry resides in. If a -second Pdo entry of the same slave is registered for process data exchange +map the complete sync-manager-protected memory, the PDO entry resides in. If a +second PDO entry of the same slave is registered for process data exchange within the same domain, and it resides in the same sync-manager-protected memory as the first one, the FMMU configuration is not altered, because the desired memory is already part of the domain's process data image. If the -second Pdo entry would belong to another sync-manager-protected area, this +second PDO entry would belong to another sync-manager-protected area, this complete area would also be included into the domains process data image. Figure~\ref{fig:fmmus} gives an overview, how FMMUs are configured to map @@ -551,11 +551,11 @@ % Interface version % Master Requesting and Releasing % Master Locking -% Configuring Pdo assignment and mapping +% Configuring PDO assignment and mapping % Domains (memory) -% Pdo entry registration -% Sdo configuration -% Sdo access +% PDO entry registration +% SDO configuration +% SDO access The application interface provides functions and data structures for applications to access an EtherCAT master. The complete documentation of the @@ -572,7 +572,7 @@ \begin{description} \item[Configuration] The master is requested and the configuration is applied. -For example, domains are created, slaves are configured and Pdo entries are +For example, domains are created, slaves are configured and PDO entries are registered (see sec.~\ref{sec:masterconfig}). \item[Operation] Cyclic code is run and process data are exchanged (see @@ -1432,7 +1432,7 @@ \item[Request handling] Requests (either originating from the application or from external sources) are handled. A request is a job that the master shall -process asynchronously, for example an SII access, Sdo access, or similar. +process asynchronously, for example an SII access, SDO access, or similar. \end{description} @@ -1474,10 +1474,10 @@ \item[PREOP] If the slave supports CoE, it is set to PREOP state using the State change FSM (see sec.~\ref{sec:fsm-change}) to enable mailbox -communication and read the Pdo configuration via CoE. - -\item[Pdos] The Pdos are read via CoE (if supported) using the Pdo Reading FSM -(see sec.~\ref{sec:fsm-pdo}). If this is successful, the Pdo information from +communication and read the PDO configuration via CoE. + +\item[PDOs] The PDOs are read via CoE (if supported) using the PDO Reading FSM +(see sec.~\ref{sec:fsm-pdo}). If this is successful, the PDO information from the SII (if any) is overwritten. \end{description} @@ -1516,18 +1516,18 @@ \item[PREOP] The state change FSM is used to bring the slave to PREOP state. If this is the requested state, the state machine is finished. -\item[Sdo Configuration] If there is a slave configuration attached (see -sec.~\ref{sec:masterconfig}), and there are any Sdo configurations are +\item[SDO Configuration] If there is a slave configuration attached (see +sec.~\ref{sec:masterconfig}), and there are any SDO configurations are provided by the application, these are sent to the slave. -\item[Pdo Configuration] The Pdo configuration state machine is executed to -apply all necessary Pdo configurations. - -\item[Pdo Sync Manager Configuration] If any Pdo sync managers exist, they are +\item[PDO Configuration] The PDO configuration state machine is executed to +apply all necessary PDO configurations. + +\item[PDO Sync Manager Configuration] If any PDO sync managers exist, they are configured. \item[FMMU Configuration] If there are FMMUs configurations supplied by the -application (i.\,e.\ if the application registered Pdo entries), they are +application (i.\,e.\ if the application registered PDO entries), they are applied. \item[SAFEOP] The state change FSM is used to bring the slave to SAFEOP state. @@ -1639,60 +1639,60 @@ %------------------------------------------------------------------------------ -\section{The Pdo State Machines} +\section{The PDO State Machines} \label{sec:fsm-pdo} -\index{FSM!Pdo} - -The Pdo state machines are a set of state machines that read or write the Pdo -assignment and the Pdo mapping via the ``CoE Communication Area'' described in -\cite[sec. 5.6.7.4]{alspec}. For the object access, the CANopen-over-EtherCAT +\index{FSM!PDO} + +The PDO state machines are a set of state machines that read or write the PDO +assignment and the PDO mapping via the ``CoE Communication Area'' described in +\cite[sec. 5.6.7.4]{alspec}. For the object access, the CANopen over EtherCAT access primitives are used (see sec.~\ref{sec:coe}), so the slave must support the CoE mailbox protocol. -\paragraph{Pdo Reading FSM} This state machine (fig.~\ref{fig:fsm-pdo-read}) -has the purpose to read the complete Pdo configuration of a slave. It reads -the Pdo assignment for each Sync Manager and uses the Pdo Entry Reading FSM -(fig.~\ref{fig:fsm-pdo-entry-read}) to read the mapping for each assigned Pdo. +\paragraph{PDO Reading FSM} This state machine (fig.~\ref{fig:fsm-pdo-read}) +has the purpose to read the complete PDO configuration of a slave. It reads +the PDO assignment for each Sync Manager and uses the PDO Entry Reading FSM +(fig.~\ref{fig:fsm-pdo-entry-read}) to read the mapping for each assigned PDO. \begin{figure}[htbp] \centering \includegraphics[width=.4\textwidth]{graphs/fsm_pdo_read} - \caption{Transition Diagram of the Pdo Reading State Machine} + \caption{Transition Diagram of the PDO Reading State Machine} \label{fig:fsm-pdo-read} \end{figure} -Basically it reads the every Sync manager's Pdo assignment Sdo's +Basically it reads the every Sync manager's PDO assignment SDO's (\lstinline+0x1C1x+) number of elements to determine the number of assigned -Pdos for this sync manager and then reads out the subindices of the Sdo to get -the assigned Pdo's indices. When a Pdo index is read, the Pdo Entry Reading -FSM is executed to read the Pdo's mapped Pdo entries. - -\paragraph{Pdo Entry Reading FSM} This state machine -(fig.~\ref{fig:fsm-pdo-entry-read}) reads the Pdo mapping (the Pdo entries) of -a Pdo. It reads the respective mapping Sdo (\lstinline+0x1600+ -- +PDOs for this sync manager and then reads out the subindices of the SDO to get +the assigned PDO's indices. When a PDO index is read, the PDO Entry Reading +FSM is executed to read the PDO's mapped PDO entries. + +\paragraph{PDO Entry Reading FSM} This state machine +(fig.~\ref{fig:fsm-pdo-entry-read}) reads the PDO mapping (the PDO entries) of +a PDO. It reads the respective mapping SDO (\lstinline+0x1600+ -- \lstinline+0x17ff+, or \lstinline+0x1a00+ -- \lstinline+0x1bff+) for the given -Pdo by reading first the subindex zero (number of elements) to determine the -number of mapped Pdo entries. After that, each subindex is read to get the -mapped Pdo entry index, subindex and bit size. +PDO by reading first the subindex zero (number of elements) to determine the +number of mapped PDO entries. After that, each subindex is read to get the +mapped PDO entry index, subindex and bit size. \begin{figure}[htbp] \centering \includegraphics[width=.4\textwidth]{graphs/fsm_pdo_entry_read} - \caption{Transition Diagram of the Pdo Entry Reading State Machine} + \caption{Transition Diagram of the PDO Entry Reading State Machine} \label{fig:fsm-pdo-entry-read} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=.9\textwidth]{graphs/fsm_pdo_conf} - \caption{Transition Diagram of the Pdo Configuration State Machine} + \caption{Transition Diagram of the PDO Configuration State Machine} \label{fig:fsm-pdo-conf} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=.4\textwidth]{graphs/fsm_pdo_entry_conf} - \caption{Transition Diagram of the Pdo Entry Configuration State Machine} + \caption{Transition Diagram of the PDO Entry Configuration State Machine} \label{fig:fsm-pdo-entry-conf} \end{figure} @@ -1706,12 +1706,12 @@ %------------------------------------------------------------------------------ -\section{Ethernet-over-EtherCAT (EoE)} +\section{Ethernet over EtherCAT (EoE)} \label{sec:eoe} \index{EoE} The EtherCAT master implements the -Ethernet-over-EtherCAT\nomenclature{EoE}{Ethernet-over-EtherCAT, Mailbox +Ethernet over EtherCAT\nomenclature{EoE}{Ethernet over EtherCAT, Mailbox Protocol} mailbox protocol~\cite[sec.~5.7]{alspec} to enable the tunneling of Ethernet frames to special slaves, that can either have physical Ethernet ports to forward the frames to, or have an own IP stack to receive the frames. @@ -1865,11 +1865,11 @@ %------------------------------------------------------------------------------ -\section{CANopen-over-EtherCAT (CoE)} +\section{CANopen over EtherCAT (CoE)} \label{sec:coe} \index{CoE} -The CANopen-over-EtherCAT\nomenclature{CoE}{CANopen-over-EtherCAT, Mailbox +The CANopen over EtherCAT\nomenclature{CoE}{CANopen over EtherCAT, Mailbox Protocol} protocol~\cite[sec.~5.6]{alspec} is used to configure slaves and exchange data objects on application level. @@ -1878,23 +1878,23 @@ % Download / Upload % Expedited / Normal % Segmenting -% Sdo Info Services +% SDO Info Services % \ldots -\paragraph{Sdo Download State Machine} - -The best time to apply Sdo configurations is during the slave's PREOP state, +\paragraph{SDO Download State Machine} + +The best time to apply SDO configurations is during the slave's PREOP state, because mailbox communication is already possible and slave's application will start with updating input data in the succeeding SAFEOP state. Therefore the -Sdo configuration has to be part of the slave configuration state machine (see -sec.~\ref{sec:fsm-conf}): It is implemented via an Sdo download state machine, +SDO configuration has to be part of the slave configuration state machine (see +sec.~\ref{sec:fsm-conf}): It is implemented via an SDO download state machine, that is executed just before entering the slave's SAFEOP state. In this way, -it is guaranteed that the Sdo configurations are applied each time, the slave +it is guaranteed that the SDO configurations are applied each time, the slave is reconfigured. -The transition diagram of the Sdo Download state machine can be seen +The transition diagram of the SDO Download state machine can be seen in figure~\ref{fig:fsm-coedown}. \begin{figure}[htbp] @@ -1908,7 +1908,7 @@ \begin{description} \item[START] The beginning state of the CoE download state - machine. The ``Sdo Download Normal Request'' mailbox command is + machine. The ``SDO Download Normal Request'' mailbox command is sent. $\rightarrow$~REQUEST \item[REQUEST] It is checked, if the CoE download request has been @@ -1917,7 +1917,7 @@ \item[CHECK] If no mailbox data is available, the timer is checked. \begin{itemize} - \item If it timed out, the Sdo download is aborted. + \item If it timed out, the SDO download is aborted. $\rightarrow$~ERROR \item Otherwise, the mailbox is queried again. $\rightarrow$~CHECK @@ -1927,16 +1927,16 @@ $\rightarrow$~RESPONSE \item[RESPONSE] If the mailbox response could not be fetched, the data - is invalid, the wrong protocol was received, or a ``Abort Sdo - Transfer Request'' was received, the Sdo download is aborted. + is invalid, the wrong protocol was received, or a ``Abort SDO + Transfer Request'' was received, the SDO download is aborted. $\rightarrow$~ERROR - If a ``Sdo Download Normal Response'' acknowledgement was received, - the Sdo download was successful. $\rightarrow$~END - -\item[END] The Sdo download was successful. - -\item[ERROR] The Sdo download was aborted due to an error. + If a ``SDO Download Normal Response'' acknowledgement was received, + the SDO download was successful. $\rightarrow$~END + +\item[END] The SDO download was successful. + +\item[ERROR] The SDO download was aborted due to an error. \end{description} @@ -2027,19 +2027,19 @@ %------------------------------------------------------------------------------ -\subsection{Sync Managers, Pdos and Pdo Entries} +\subsection{Sync Managers, PDOs and PDO Entries} \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_pdos} %------------------------------------------------------------------------------ -\subsection{Sdo Dictionary} +\subsection{SDO Dictionary} \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_sdos} %------------------------------------------------------------------------------ -\subsection{Sdo Access} +\subsection{SDO Access} \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_download} diff -r 399ef727bf62 -r e206f4485f60 documentation/graphs/fsm_pdo_conf.dot --- a/documentation/graphs/fsm_pdo_conf.dot Mon Dec 29 14:10:27 2008 +0000 +++ b/documentation/graphs/fsm_pdo_conf.dot Mon Dec 29 15:19:16 2008 +0000 @@ -8,8 +8,8 @@ start -> end [fontname="Helvetica",label="No config"] action_next_sync [shape=point,label=""] - action_next_sync -> action_check_assignment [fontname="Helvetica",label="No Pdos"] - action_next_sync -> action_pdo_mapping [fontname="Helvetica",label="First Pdo",weight=10] + action_next_sync -> action_check_assignment [fontname="Helvetica",label="No PDOs"] + action_next_sync -> action_pdo_mapping [fontname="Helvetica",label="First PDO",weight=10] action_next_sync -> end [fontname="Helvetica",label="No more SMs"] action_pdo_mapping [shape=point,label=""] @@ -29,22 +29,22 @@ action_next_pdo_mapping [shape=point,label=""] action_next_pdo_mapping -> action_check_assignment [weight=10] action_next_pdo_mapping -> action_pdo_mapping - [fontname="Helvetica",label="Next Pdo"] + [fontname="Helvetica",label="Next PDO"] action_check_assignment [shape=point,label=""] action_check_assignment -> action_next_sync [fontname="Helvetica",label="Assign ok"] action_check_assignment -> zero_pdo_count [weight=10] zero_pdo_count [fontname="Helvetica"] - zero_pdo_count -> action_next_sync [fontname="Helvetica",label="No Pdos"] - zero_pdo_count -> action_assign_pdo [fontname="Helvetica",label="First Pdo", weight=10] + zero_pdo_count -> action_next_sync [fontname="Helvetica",label="No PDOs"] + zero_pdo_count -> action_assign_pdo [fontname="Helvetica",label="First PDO", weight=10] action_assign_pdo [shape=point,label=""] action_assign_pdo -> assign_pdo [weight=10] assign_pdo [fontname="Helvetica"] - assign_pdo -> set_pdo_count [fontname="Helvetica",label="No more Pdos", weight=10] - assign_pdo -> action_assign_pdo [fontname="Helvetica",label="Next Pdo"] + assign_pdo -> set_pdo_count [fontname="Helvetica",label="No more PDOs", weight=10] + assign_pdo -> action_assign_pdo [fontname="Helvetica",label="Next PDO"] set_pdo_count [fontname="Helvetica"] set_pdo_count -> action_next_sync diff -r 399ef727bf62 -r e206f4485f60 documentation/graphs/fsm_pdo_read.dot --- a/documentation/graphs/fsm_pdo_read.dot Mon Dec 29 14:10:27 2008 +0000 +++ b/documentation/graphs/fsm_pdo_read.dot Mon Dec 29 15:19:16 2008 +0000 @@ -14,8 +14,8 @@ pdo_count -> action_next_pdo [weight=5] action_next_pdo [shape=point,label=""] - action_next_pdo -> pdo [fontname="Helvetica", label="Next Pdo", weight=5] - action_next_pdo -> action_next_sync [fontname="Helvetica", label="No more Pdos"] + action_next_pdo -> pdo [fontname="Helvetica", label="Next PDO", weight=5] + action_next_pdo -> action_next_sync [fontname="Helvetica", label="No more PDOs"] pdo [fontname="Helvetica"] pdo -> pdo_entries [weight=5] diff -r 399ef727bf62 -r e206f4485f60 documentation/graphs/fsm_slave_conf.dot --- a/documentation/graphs/fsm_slave_conf.dot Mon Dec 29 14:10:27 2008 +0000 +++ b/documentation/graphs/fsm_slave_conf.dot Mon Dec 29 15:19:16 2008 +0000 @@ -31,7 +31,7 @@ preop -> enter_sdo_conf [weight=10] enter_sdo_conf [shape=point, label=""] - enter_sdo_conf -> enter_pdo_conf [fontname="Helvetica", label="No Sdos\nconfigured"] + enter_sdo_conf -> enter_pdo_conf [fontname="Helvetica", label="No SDOs\nconfigured"] enter_sdo_conf -> sdo_conf [weight=10] sdo_conf [fontname="Helvetica"] @@ -46,7 +46,7 @@ pdo_conf -> enter_pdo_sync [weight=10] enter_pdo_sync [shape=point, label=""] - enter_pdo_sync -> enter_fmmu [fontname="Helvetica", label="No Pdo SMs"] + enter_pdo_sync -> enter_fmmu [fontname="Helvetica", label="No PDO SMs"] enter_pdo_sync -> pdo_sync [weight=10] pdo_sync [fontname="Helvetica"] diff -r 399ef727bf62 -r e206f4485f60 documentation/images/app-config.fig --- a/documentation/images/app-config.fig Mon Dec 29 14:10:27 2008 +0000 +++ b/documentation/images/app-config.fig Mon Dec 29 15:19:16 2008 +0000 @@ -95,16 +95,16 @@ 4 0 0 50 -1 18 12 0.0000 4 180 1290 3735 2025 Sync Manager\001 4 0 0 50 -1 16 12 0.0000 4 135 450 3735 2385 Index\001 4 0 0 50 -1 16 12 0.0000 4 135 750 3735 2610 Direction\001 -4 0 0 50 -1 18 12 0.0000 4 180 1575 3735 3420 Sdo Configuration\001 +4 0 0 50 -1 18 12 0.0000 4 180 1575 3735 3420 SDO Configuration\001 4 0 0 50 -1 16 12 0.0000 4 135 450 3735 3780 Index\001 4 0 0 50 -1 16 12 0.0000 4 135 780 3735 4005 Subindex\001 4 0 0 50 -1 16 12 0.0000 4 135 390 3735 4230 Data\001 -4 0 0 50 -1 18 12 0.0000 4 180 1140 3735 5040 Sdo Request\001 +4 0 0 50 -1 18 12 0.0000 4 180 1140 3735 5040 SDO Request\001 4 0 0 50 -1 16 12 0.0000 4 135 450 3735 5310 Index\001 4 0 0 50 -1 16 12 0.0000 4 135 780 3735 5535 Subindex\001 -4 0 0 50 -1 18 12 0.0000 4 135 330 6210 2025 Pdo\001 +4 0 0 50 -1 18 12 0.0000 4 135 330 6210 2025 PDO\001 4 0 0 50 -1 16 12 0.0000 4 135 450 6210 2385 Index\001 -4 0 0 50 -1 18 12 0.0000 4 180 885 7785 2025 Pdo Entry\001 +4 0 0 50 -1 18 12 0.0000 4 180 885 7785 2025 PDO Entry\001 4 0 0 50 -1 16 12 0.0000 4 135 450 7785 2340 Index\001 4 0 0 50 -1 16 12 0.0000 4 135 780 7785 2565 Subindex\001 4 0 0 50 -1 16 12 0.0000 4 180 720 7785 2790 Bitlength\001 diff -r 399ef727bf62 -r e206f4485f60 documentation/images/fmmus.fig --- a/documentation/images/fmmus.fig Mon Dec 29 14:10:27 2008 +0000 +++ b/documentation/images/fmmus.fig Mon Dec 29 15:19:16 2008 +0000 @@ -13,7 +13,7 @@ 6 3465 4455 5640 4680 2 2 0 1 0 7 50 -1 42 0.000 0 0 -1 0 0 5 3465 4455 3645 4455 3645 4680 3465 4680 3465 4455 -4 0 0 50 -1 16 12 0.0000 4 180 1905 3735 4635 Registered Pdo Entries\001 +4 0 0 50 -1 16 12 0.0000 4 180 1905 3735 4635 Registered PDO Entries\001 -6 2 1 1 1 0 7 52 -1 46 4.000 0 0 -1 0 0 2 1215 1665 1620 3870 diff -r 399ef727bf62 -r e206f4485f60 examples/mini/mini.c --- a/examples/mini/mini.c Mon Dec 29 14:10:27 2008 +0000 +++ b/examples/mini/mini.c Mon Dec 29 15:19:16 2008 +0000 @@ -73,7 +73,7 @@ #define Beckhoff_EL3152 0x00000002, 0x0c503052 #define Beckhoff_EL4102 0x00000002, 0x10063052 -// offsets for Pdo entries +// offsets for PDO entries static unsigned int off_ana_in; static unsigned int off_ana_out; static unsigned int off_dig_out; @@ -249,12 +249,12 @@ printk(KERN_INFO PFX "Still busy...\n"); break; case EC_SDO_REQUEST_SUCCESS: - printk(KERN_INFO PFX "Sdo value: 0x%04X\n", + printk(KERN_INFO PFX "SDO value: 0x%04X\n", EC_READ_U16(ecrt_sdo_request_data(sdo))); ecrt_sdo_request_read(sdo); // trigger next read break; case EC_SDO_REQUEST_ERROR: - printk(KERN_INFO PFX "Failed to read Sdo!\n"); + printk(KERN_INFO PFX "Failed to read SDO!\n"); ecrt_sdo_request_read(sdo); // retry reading break; } @@ -289,7 +289,7 @@ check_slave_config_states(); #if SDO_ACCESS - // read process data Sdo + // read process data SDO read_sdo(); #endif } @@ -356,9 +356,9 @@ } #if CONFIGURE_PDOS - printk(KERN_INFO PFX "Configuring Pdos...\n"); + printk(KERN_INFO PFX "Configuring PDOs...\n"); if (ecrt_slave_config_pdos(sc_ana_in, EC_END, el3152_syncs)) { - printk(KERN_ERR PFX "Failed to configure Pdos.\n"); + printk(KERN_ERR PFX "Failed to configure PDOs.\n"); goto out_release_master; } @@ -369,7 +369,7 @@ } if (ecrt_slave_config_pdos(sc, EC_END, el4102_syncs)) { - printk(KERN_ERR PFX "Failed to configure Pdos.\n"); + printk(KERN_ERR PFX "Failed to configure PDOs.\n"); goto out_release_master; } @@ -380,23 +380,23 @@ } if (ecrt_slave_config_pdos(sc, EC_END, el2004_syncs)) { - printk(KERN_ERR PFX "Failed to configure Pdos.\n"); + printk(KERN_ERR PFX "Failed to configure PDOs.\n"); goto out_release_master; } #endif #if SDO_ACCESS - printk(KERN_INFO PFX "Creating Sdo requests...\n"); + printk(KERN_INFO PFX "Creating SDO requests...\n"); if (!(sdo = ecrt_slave_config_create_sdo_request(sc_ana_in, 0x3102, 2, 2))) { - printk(KERN_ERR PFX "Failed to create Sdo request.\n"); + printk(KERN_ERR PFX "Failed to create SDO request.\n"); goto out_release_master; } ecrt_sdo_request_timeout(sdo, 500); // ms #endif - printk(KERN_INFO PFX "Registering Pdo entries...\n"); + printk(KERN_INFO PFX "Registering PDO entries...\n"); if (ecrt_domain_reg_pdo_entry_list(domain1, domain1_regs)) { - printk(KERN_ERR PFX "Pdo entry registration failed!\n"); + printk(KERN_ERR PFX "PDO entry registration failed!\n"); goto out_release_master; } diff -r 399ef727bf62 -r e206f4485f60 examples/rtai/rtai_sample.c --- a/examples/rtai/rtai_sample.c Mon Dec 29 14:10:27 2008 +0000 +++ b/examples/rtai/rtai_sample.c Mon Dec 29 15:19:16 2008 +0000 @@ -79,7 +79,7 @@ #define Beckhoff_EL2004 0x00000002, 0x07D43052 #define Beckhoff_EL3162 0x00000002, 0x0C5A3052 -static unsigned int off_ana_in; // offsets for Pdo entries +static unsigned int off_ana_in; // offsets for PDO entries static unsigned int off_dig_out; const static ec_pdo_entry_reg_t domain1_regs[] = { @@ -292,9 +292,9 @@ } #ifdef CONFIGURE_PDOS - printk(KERN_INFO PFX "Configuring Pdos...\n"); + printk(KERN_INFO PFX "Configuring PDOs...\n"); if (ecrt_slave_config_pdos(sc_ana_in, EC_END, el3162_syncs)) { - printk(KERN_ERR PFX "Failed to configure Pdos.\n"); + printk(KERN_ERR PFX "Failed to configure PDOs.\n"); goto out_release_master; } @@ -304,14 +304,14 @@ } if (ecrt_slave_config_pdos(sc, EC_END, el2004_syncs)) { - printk(KERN_ERR PFX "Failed to configure Pdos.\n"); + printk(KERN_ERR PFX "Failed to configure PDOs.\n"); goto out_release_master; } #endif - printk(KERN_INFO PFX "Registering Pdo entries...\n"); + printk(KERN_INFO PFX "Registering PDO entries...\n"); if (ecrt_domain_reg_pdo_entry_list(domain1, domain1_regs)) { - printk(KERN_ERR PFX "Pdo entry registration failed!\n"); + printk(KERN_ERR PFX "PDO entry registration failed!\n"); goto out_release_master; } diff -r 399ef727bf62 -r e206f4485f60 include/ecrt.h --- a/include/ecrt.h Mon Dec 29 14:10:27 2008 +0000 +++ b/include/ecrt.h Mon Dec 29 15:19:16 2008 +0000 @@ -50,18 +50,18 @@ * offers the possibility to use a shared-memory region. Therefore, * added the domain methods ecrt_domain_size() and * ecrt_domain_external_memory(). - * - Pdo entry registration functions do not return a process data pointer, + * - PDO entry registration functions do not return a process data pointer, * but an offset in the domain's process data. In addition, an optional bit * position can be requested. This was necessary for the external domain * memory. An additional advantage is, that the returned offset is * immediately valid. If the domain's process data is allocated internally, * the start address can be retrieved with ecrt_domain_data(). * - Replaced ecrt_slave_pdo_mapping/add/clear() with - * ecrt_slave_config_pdo_assign_add() to add a Pdo to a sync manager's Pdo - * assignment and ecrt_slave_config_pdo_mapping_add() to add a Pdo entry to a - * Pdo's mapping. ecrt_slave_config_pdos() is a convenience function + * ecrt_slave_config_pdo_assign_add() to add a PDO to a sync manager's PDO + * assignment and ecrt_slave_config_pdo_mapping_add() to add a PDO entry to a + * PDO's mapping. ecrt_slave_config_pdos() is a convenience function * for both, that uses the new data types ec_pdo_info_t and - * ec_pdo_entry_info_t. Pdo entries, that are mapped with these functions + * ec_pdo_entry_info_t. PDO entries, that are mapped with these functions * can now immediately be registered, even if the bus is offline. * - Renamed ec_bus_status_t, ec_master_status_t to ec_bus_state_t and * ec_master_state_t, respectively. Renamed ecrt_master_get_status() to @@ -69,15 +69,15 @@ * - Added ec_domain_state_t and #ec_wc_state_t for a new output parameter * of ecrt_domain_state(). The domain state object does now contain * information, if the process data was exchanged completely. - * - Former "Pdo registration" meant Pdo entry registration in fact, therefore + * - Former "PDO registration" meant PDO entry registration in fact, therefore * renamed ec_pdo_reg_t to ec_pdo_entry_reg_t and ecrt_domain_register_pdo() * to ecrt_slave_config_reg_pdo_entry(). * - Removed ecrt_domain_register_pdo_range(), because it's functionality can - * be reached by specifying an explicit Pdo assignment/mapping and - * registering the mapped Pdo entries. - * - Added an Sdo access interface, working with Sdo requests. These can be + * be reached by specifying an explicit PDO assignment/mapping and + * registering the mapped PDO entries. + * - Added an SDO access interface, working with SDO requests. These can be * scheduled for reading and writing during realtime operation. - * - Exported ecrt_slave_config_sdo(), the generic Sdo configuration function. + * - Exported ecrt_slave_config_sdo(), the generic SDO configuration function. * - Removed the bus_state and bus_tainted flags from ec_master_state_t. * * @{ @@ -214,7 +214,7 @@ /*****************************************************************************/ -/** Direction type for Pdo assignment functions. +/** Direction type for PDO assignment functions. */ typedef enum { EC_DIR_INVALID, /**< Invalid direction. Do not use this value. */ @@ -225,33 +225,33 @@ /*****************************************************************************/ -/** Pdo entry configuration information. +/** PDO entry configuration information. * * This is the data type of the \a entries field in ec_pdo_info_t. * * \see ecrt_slave_config_pdos(). */ typedef struct { - uint16_t index; /**< Pdo entry index. */ - uint8_t subindex; /**< Pdo entry subindex. */ - uint8_t bit_length; /**< Size of the Pdo entry in bit. */ + uint16_t index; /**< PDO entry index. */ + uint8_t subindex; /**< PDO entry subindex. */ + uint8_t bit_length; /**< Size of the PDO entry in bit. */ } ec_pdo_entry_info_t; /*****************************************************************************/ -/** Pdo configuration information. +/** PDO configuration information. * * This is the data type of the \a pdos field in ec_sync_info_t. * * \see ecrt_slave_config_pdos(). */ typedef struct { - uint16_t index; /**< Pdo index. */ - unsigned int n_entries; /**< Number of Pdo entries in \a entries to map. + uint16_t index; /**< PDO index. */ + unsigned int n_entries; /**< Number of PDO entries in \a entries to map. Zero means, that the default mapping shall be used (this can only be done if the slave is present at bus configuration time). */ - ec_pdo_entry_info_t *entries; /**< Array of Pdo entries to map. Can either + ec_pdo_entry_info_t *entries; /**< Array of PDO entries to map. Can either be \a NULL, or must contain at least \a n_entries values. */ } ec_pdo_info_t; @@ -260,8 +260,8 @@ /** Sync manager configuration information. * - * This can be use to configure multiple sync managers including the Pdo - * assignment and Pdo mapping. It is used as an input parameter type in + * This can be use to configure multiple sync managers including the PDO + * assignment and PDO mapping. It is used as an input parameter type in * ecrt_slave_config_pdos(). */ typedef struct { @@ -269,14 +269,14 @@ than #EC_MAX_SYNC_MANAGERS for a valid sync manager, but can also be \a 0xff to mark the end of the list. */ ec_direction_t dir; /**< Sync manager direction. */ - unsigned int n_pdos; /**< Number of Pdos in \a pdos. */ - ec_pdo_info_t *pdos; /**< Array with Pdos to assign. This must contain - at least \a n_pdos Pdos. */ + unsigned int n_pdos; /**< Number of PDOs in \a pdos. */ + ec_pdo_info_t *pdos; /**< Array with PDOs to assign. This must contain + at least \a n_pdos PDOs. */ } ec_sync_info_t; /*****************************************************************************/ -/** List record type for Pdo entry mass-registration. +/** List record type for PDO entry mass-registration. * * This type is used for the array parameter of the * ecrt_domain_reg_pdo_entry_list() @@ -286,19 +286,19 @@ uint16_t position; /**< Slave position. */ uint32_t vendor_id; /**< Slave vendor ID. */ uint32_t product_code; /**< Slave product code. */ - uint16_t index; /**< Pdo entry index. */ - uint8_t subindex; /**< Pdo entry subindex. */ - unsigned int *offset; /**< Pointer to a variable to store the Pdo entry's + uint16_t index; /**< PDO entry index. */ + uint8_t subindex; /**< PDO entry subindex. */ + unsigned int *offset; /**< Pointer to a variable to store the PDO entry's (byte-)offset in the process data. */ unsigned int *bit_position; /**< Pointer to a variable to store a bit position (0-7) within the \a offset. Can be NULL, in which case an error is raised if the - Pdo entry does not byte-align. */ + PDO entry does not byte-align. */ } ec_pdo_entry_reg_t; /*****************************************************************************/ -/** Sdo request state. +/** SDO request state. * * This is used as return type of ecrt_sdo_request_state(). */ @@ -371,7 +371,7 @@ * * For process data exchange, at least one process data domain is needed. * This method creates a new process data domain and returns a pointer to the - * new domain object. This object can be used for registering Pdos and + * new domain object. This object can be used for registering PDOs and * exchanging them in cyclic operation. * * \return Pointer to the new domain on success, else NULL. @@ -488,7 +488,7 @@ ec_direction_t dir /**< Input/Output. */ ); -/** Add a Pdo to a sync manager's Pdo assignment. +/** Add a PDO to a sync manager's PDO assignment. * * \see ecrt_slave_config_pdos() * \return zero on success, else non-zero @@ -497,12 +497,12 @@ ec_slave_config_t *sc, /**< Slave configuration. */ uint8_t sync_index, /**< Sync manager index. Must be less than #EC_MAX_SYNC_MANAGERS. */ - uint16_t index /**< Index of the Pdo to assign. */ - ); - -/** Clear a sync manager's Pdo assignment. - * - * This can be called before assigning Pdos via + uint16_t index /**< Index of the PDO to assign. */ + ); + +/** Clear a sync manager's PDO assignment. + * + * This can be called before assigning PDOs via * ecrt_slave_config_pdo_assign_add(), to clear the default assignment of a * sync manager. * @@ -514,34 +514,34 @@ than #EC_MAX_SYNC_MANAGERS. */ ); -/** Add a Pdo entry to the given Pdo's mapping. +/** Add a PDO entry to the given PDO's mapping. * * \see ecrt_slave_config_pdos() * \return zero on success, else non-zero */ int ecrt_slave_config_pdo_mapping_add( ec_slave_config_t *sc, /**< Slave configuration. */ - uint16_t pdo_index, /**< Index of the Pdo. */ - uint16_t entry_index, /**< Index of the Pdo entry to add to the Pdo's + uint16_t pdo_index, /**< Index of the PDO. */ + uint16_t entry_index, /**< Index of the PDO entry to add to the PDO's mapping. */ - uint8_t entry_subindex, /**< Subindex of the Pdo entry to add to the - Pdo's mapping. */ - uint8_t entry_bit_length /**< Size of the Pdo entry in bit. */ - ); - -/** Clear the mapping of a given Pdo. - * - * This can be called before mapping Pdo entries via + uint8_t entry_subindex, /**< Subindex of the PDO entry to add to the + PDO's mapping. */ + uint8_t entry_bit_length /**< Size of the PDO entry in bit. */ + ); + +/** Clear the mapping of a given PDO. + * + * This can be called before mapping PDO entries via * ecrt_slave_config_pdo_mapping_add(), to clear the default mapping. * * \see ecrt_slave_config_pdos() */ void ecrt_slave_config_pdo_mapping_clear( ec_slave_config_t *sc, /**< Slave configuration. */ - uint16_t pdo_index /**< Index of the Pdo. */ - ); - -/** Specify a complete Pdo configuration. + uint16_t pdo_index /**< Index of the PDO. */ + ); + +/** Specify a complete PDO configuration. * * This function is a convenience wrapper for the functions * ecrt_slave_config_sync_manager(), ecrt_slave_config_pdo_assign_clear(), @@ -550,7 +550,7 @@ * automatic code generation. * * The following example shows, how to specify a complete configuration, - * including the Pdo mappings. With this information, the master is able to + * including the PDO mappings. With this information, the master is able to * reserve the complete process data, even if the slave is not present at * configuration time: * @@ -581,9 +581,9 @@ * } * \endcode * - * The next example shows, how to configure the Pdo assignment only. The - * entries for each assigned Pdo are taken from the Pdo's default mapping. - * Please note, that Pdo entry registration will fail, if the Pdo + * The next example shows, how to configure the PDO assignment only. The + * entries for each assigned PDO are taken from the PDO's default mapping. + * Please note, that PDO entry registration will fail, if the PDO * configuration is left empty and the slave is offline. * * \code @@ -617,46 +617,46 @@ configurations. */ ); -/** Registers a Pdo entry for process data exchange in a domain. - * - * Searches the assigned Pdos for the given Pdo entry. An error is raised, if +/** Registers a PDO entry for process data exchange in a domain. + * + * Searches the assigned PDOs for the given PDO entry. An error is raised, if * the given entry is not mapped. Otherwise, the corresponding sync manager * and FMMU configurations are provided for slave configuration and the - * respective sync manager's assigned Pdos are appended to the given domain, - * if not already done. The offset of the requested Pdo entry's data inside - * the domain's process data is returned. Optionally, the Pdo entry bit + * respective sync manager's assigned PDOs are appended to the given domain, + * if not already done. The offset of the requested PDO entry's data inside + * the domain's process data is returned. Optionally, the PDO entry bit * position (0-7) can be retrieved via the \a bit_position output parameter. - * This pointer may be \a NULL, in this case an error is raised if the Pdo + * This pointer may be \a NULL, in this case an error is raised if the PDO * entry does not byte-align. * - * \retval >=0 Success: Offset of the Pdo entry's process data. - * \retval -1 Error: Pdo entry not found. - * \retval -2 Error: Failed to register Pdo entry. - * \retval -3 Error: Pdo entry is not byte-aligned. + * \retval >=0 Success: Offset of the PDO entry's process data. + * \retval -1 Error: PDO entry not found. + * \retval -2 Error: Failed to register PDO entry. + * \retval -3 Error: PDO entry is not byte-aligned. */ int ecrt_slave_config_reg_pdo_entry( ec_slave_config_t *sc, /**< Slave configuration. */ - uint16_t entry_index, /**< Index of the Pdo entry to register. */ - uint8_t entry_subindex, /**< Subindex of the Pdo entry to register. */ + uint16_t entry_index, /**< Index of the PDO entry to register. */ + uint8_t entry_subindex, /**< Subindex of the PDO entry to register. */ ec_domain_t *domain, /**< Domain. */ unsigned int *bit_position /**< Optional address if bit addressing is desired */ ); -/** Add an Sdo configuration. - * - * An Sdo configuration is stored in the slave configuration object and is +/** Add an SDO configuration. + * + * An SDO configuration is stored in the slave configuration object and is * downloaded to the slave whenever the slave is being configured by the * master. This usually happens once on master activation, but can be repeated * subsequently, for example after the slave's power supply failed. * - * \attention The Sdos for Pdo assignment (\p 0x1C10 - \p 0x1C2F) and Pdo + * \attention The SDOs for PDO assignment (\p 0x1C10 - \p 0x1C2F) and PDO * mapping (\p 0x1600 - \p 0x17FF and \p 0x1A00 - \p 0x1BFF) should not be * configured with this function, because they are part of the slave * configuration done by the master. Please use ecrt_slave_config_pdos() and * friends instead. * - * This is the generic function for adding an Sdo configuration. Please note + * This is the generic function for adding an SDO configuration. Please note * that the this function does not do any endianess correction. If * datatype-specific functions are needed (that automatically correct the * endianess), have a look at ecrt_slave_config_sdo8(), @@ -666,8 +666,8 @@ */ int ecrt_slave_config_sdo( ec_slave_config_t *sc, /**< Slave configuration. */ - uint16_t index, /**< Index of the Sdo to configure. */ - uint8_t subindex, /**< Subindex of the Sdo to configure. */ + uint16_t index, /**< Index of the SDO to configure. */ + uint8_t subindex, /**< Subindex of the SDO to configure. */ const uint8_t *data, /**< Pointer to the data. */ size_t size /**< Size of the \a data. */ ); @@ -708,15 +708,15 @@ uint32_t value /**< Value to set. */ ); -/** Create an Sdo request to exchange Sdos during realtime operation. - * - * The created Sdo request object is freed automatically when the master is +/** Create an SDO request to exchange SDOs during realtime operation. + * + * The created SDO request object is freed automatically when the master is * released. */ ec_sdo_request_t *ecrt_slave_config_create_sdo_request( ec_slave_config_t *sc, /**< Slave configuration. */ - uint16_t index, /**< Sdo index. */ - uint8_t subindex, /**< Sdo subindex. */ + uint16_t index, /**< SDO index. */ + uint8_t subindex, /**< SDO subindex. */ size_t size /**< Data size to reserve. */ ); @@ -733,7 +733,7 @@ * Domain methods *****************************************************************************/ -/** Registers a bunch of Pdo entries for a domain. +/** Registers a bunch of PDO entries for a domain. * * \todo doc * \attention The registration array has to be terminated with an empty @@ -742,7 +742,7 @@ */ int ecrt_domain_reg_pdo_entry_list( ec_domain_t *domain, /**< Domain. */ - const ec_pdo_entry_reg_t *pdo_entry_regs /**< Array of Pdo + const ec_pdo_entry_reg_t *pdo_entry_regs /**< Array of PDO registrations. */ ); @@ -756,11 +756,11 @@ /** Provide external memory to store the domain's process data. * - * Call this after all Pdo entries have been registered and before activating + * Call this after all PDO entries have been registered and before activating * the master. * * The size of the allocated memory must be at least ecrt_domain_size(), after - * all Pdo entries have been registered. + * all PDO entries have been registered. */ void ecrt_domain_external_memory( ec_domain_t *domain, /**< Domain. */ @@ -811,10 +811,10 @@ ); /***************************************************************************** - * Sdo request methods. + * SDO request methods. ****************************************************************************/ -/** Set the timeout for an Sdo request. +/** Set the timeout for an SDO request. * * If the request cannot be processed in the specified time, if will be marked * as failed. @@ -823,14 +823,14 @@ * the next call of this method. */ void ecrt_sdo_request_timeout( - ec_sdo_request_t *req, /**< Sdo request. */ + ec_sdo_request_t *req, /**< SDO request. */ uint32_t timeout /**< Timeout in milliseconds. Zero means no timeout. */ ); -/** Access to the Sdo request's data. - * - * This function returns a pointer to the request's internal Sdo data memory. +/** Access to the SDO request's data. + * + * This function returns a pointer to the request's internal SDO data memory. * * - After a read operation was successful, integer data can be evaluated using * the EC_READ_*() macros as usual. Example: @@ -846,45 +846,45 @@ * \endcode * * \attention The return value can be invalid during a read operation, because - * the internal Sdo data memory could be re-allocated if the read Sdo data do + * the internal SDO data memory could be re-allocated if the read SDO data do * not fit inside. * - * \return Pointer to the internal Sdo data memory. + * \return Pointer to the internal SDO data memory. */ uint8_t *ecrt_sdo_request_data( - ec_sdo_request_t *req /**< Sdo request. */ - ); - -/** Returns the current Sdo data size. - * - * When the Sdo request is created, the data size is set to the size of the + ec_sdo_request_t *req /**< SDO request. */ + ); + +/** Returns the current SDO data size. + * + * When the SDO request is created, the data size is set to the size of the * reserved memory. After a read operation the size is set to the size of the * read data. The size is not modified in any other situation. * - * \return Sdo data size in bytes. + * \return SDO data size in bytes. */ size_t ecrt_sdo_request_data_size( - const ec_sdo_request_t *req /**< Sdo request. */ - ); - -/** Get the current state of the Sdo request. + const ec_sdo_request_t *req /**< SDO request. */ + ); + +/** Get the current state of the SDO request. * * \return Request state. */ ec_sdo_request_state_t ecrt_sdo_request_state( - const ec_sdo_request_t *req /**< Sdo request. */ + const ec_sdo_request_t *req /**< SDO request. */ ); -/** Schedule an Sdo write operation. +/** Schedule an SDO write operation. * * \attention This method may not be called while ecrt_sdo_request_state() * returns EC_SDO_REQUEST_BUSY. */ void ecrt_sdo_request_write( - ec_sdo_request_t *req /**< Sdo request. */ - ); - -/** Schedule an Sdo read operation. + ec_sdo_request_t *req /**< SDO request. */ + ); + +/** Schedule an SDO read operation. * * \attention This method may not be called while ecrt_sdo_request_state() * returns EC_SDO_REQUEST_BUSY. @@ -894,7 +894,7 @@ * ecrt_sdo_request_state() returns EC_SDO_REQUEST_BUSY. */ void ecrt_sdo_request_read( - ec_sdo_request_t *req /**< Sdo request. */ + ec_sdo_request_t *req /**< SDO request. */ ); /****************************************************************************** diff -r 399ef727bf62 -r e206f4485f60 master/cdev.c --- a/master/cdev.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/cdev.c Mon Dec 29 15:19:16 2008 +0000 @@ -268,7 +268,7 @@ /*****************************************************************************/ -/** Get slave sync manager Pdo information. +/** Get slave sync manager PDO information. */ int ec_cdev_ioctl_slave_sync_pdo( ec_master_t *master, /**< EtherCAT master. */ @@ -305,7 +305,7 @@ if (!(pdo = ec_pdo_list_find_pdo_by_pos_const( &sync->pdos, data.pdo_pos))) { up(&master->master_sem); - EC_ERR("Sync manager %u does not contain a Pdo with " + EC_ERR("Sync manager %u does not contain a PDO with " "position %u in slave %u!\n", data.sync_index, data.pdo_pos, data.slave_position); return -EINVAL; @@ -325,7 +325,7 @@ /*****************************************************************************/ -/** Get slave sync manager Pdo entry information. +/** Get slave sync manager PDO entry information. */ int ec_cdev_ioctl_slave_sync_pdo_entry( ec_master_t *master, /**< EtherCAT master. */ @@ -363,7 +363,7 @@ if (!(pdo = ec_pdo_list_find_pdo_by_pos_const( &sync->pdos, data.pdo_pos))) { up(&master->master_sem); - EC_ERR("Sync manager %u does not contain a Pdo with " + EC_ERR("Sync manager %u does not contain a PDO with " "position %u in slave %u!\n", data.sync_index, data.pdo_pos, data.slave_position); return -EINVAL; @@ -372,7 +372,7 @@ if (!(entry = ec_pdo_find_entry_by_pos_const( pdo, data.entry_pos))) { up(&master->master_sem); - EC_ERR("Pdo 0x%04X does not contain an entry with " + EC_ERR("PDO 0x%04X does not contain an entry with " "position %u in slave %u!\n", data.pdo_pos, data.entry_pos, data.slave_position); return -EINVAL; @@ -569,7 +569,7 @@ /*****************************************************************************/ -/** Get slave Sdo information. +/** Get slave SDO information. */ int ec_cdev_ioctl_slave_sdo( ec_master_t *master, /**< EtherCAT master. */ @@ -597,7 +597,7 @@ if (!(sdo = ec_slave_get_sdo_by_pos_const( slave, data.sdo_position))) { up(&master->master_sem); - EC_ERR("Sdo %u does not exist in slave %u!\n", + EC_ERR("SDO %u does not exist in slave %u!\n", data.sdo_position, data.slave_position); return -EINVAL; } @@ -616,7 +616,7 @@ /*****************************************************************************/ -/** Get slave Sdo entry information. +/** Get slave SDO entry information. */ int ec_cdev_ioctl_slave_sdo_entry( ec_master_t *master, /**< EtherCAT master. */ @@ -646,7 +646,7 @@ if (!(sdo = ec_slave_get_sdo_by_pos_const( slave, -data.sdo_spec))) { up(&master->master_sem); - EC_ERR("Sdo %u does not exist in slave %u!\n", + EC_ERR("SDO %u does not exist in slave %u!\n", -data.sdo_spec, data.slave_position); return -EINVAL; } @@ -654,7 +654,7 @@ if (!(sdo = ec_slave_get_sdo_const( slave, data.sdo_spec))) { up(&master->master_sem); - EC_ERR("Sdo 0x%04X does not exist in slave %u!\n", + EC_ERR("SDO 0x%04X does not exist in slave %u!\n", data.sdo_spec, data.slave_position); return -EINVAL; } @@ -663,7 +663,7 @@ if (!(entry = ec_sdo_get_entry_const( sdo, data.sdo_entry_subindex))) { up(&master->master_sem); - EC_ERR("Sdo entry 0x%04X:%02X does not exist " + EC_ERR("SDO entry 0x%04X:%02X does not exist " "in slave %u!\n", sdo->index, data.sdo_entry_subindex, data.slave_position); return -EINVAL; @@ -683,7 +683,7 @@ /*****************************************************************************/ -/** Upload Sdo. +/** Upload SDO. */ int ec_cdev_ioctl_slave_sdo_upload( ec_master_t *master, /**< EtherCAT master. */ @@ -768,7 +768,7 @@ /*****************************************************************************/ -/** Download Sdo. +/** Download SDO. */ int ec_cdev_ioctl_slave_sdo_download( ec_master_t *master, /**< EtherCAT master. */ @@ -1028,7 +1028,7 @@ /*****************************************************************************/ -/** Get slave configuration Pdo information. +/** Get slave configuration PDO information. */ int ec_cdev_ioctl_config_pdo( ec_master_t *master, /**< EtherCAT master. */ @@ -1064,7 +1064,7 @@ &sc->sync_configs[data.sync_index].pdos, data.pdo_pos))) { up(&master->master_sem); - EC_ERR("Invalid Pdo position!\n"); + EC_ERR("Invalid PDO position!\n"); return -EINVAL; } @@ -1082,7 +1082,7 @@ /*****************************************************************************/ -/** Get slave configuration Pdo entry information. +/** Get slave configuration PDO entry information. */ int ec_cdev_ioctl_config_pdo_entry( ec_master_t *master, /**< EtherCAT master. */ @@ -1119,7 +1119,7 @@ &sc->sync_configs[data.sync_index].pdos, data.pdo_pos))) { up(&master->master_sem); - EC_ERR("Invalid Pdo position!\n"); + EC_ERR("Invalid PDO position!\n"); return -EINVAL; } @@ -1145,7 +1145,7 @@ /*****************************************************************************/ -/** Get slave configuration Sdo information. +/** Get slave configuration SDO information. */ int ec_cdev_ioctl_config_sdo( ec_master_t *master, /**< EtherCAT master. */ @@ -1174,7 +1174,7 @@ if (!(req = ec_slave_config_get_sdo_by_pos_const( sc, data.sdo_pos))) { up(&master->master_sem); - EC_ERR("Invalid Sdo position!\n"); + EC_ERR("Invalid SDO position!\n"); return -EINVAL; } diff -r 399ef727bf62 -r e206f4485f60 master/ethernet.c --- a/master/ethernet.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/ethernet.c Mon Dec 29 15:19:16 2008 +0000 @@ -26,7 +26,7 @@ /** \file - Ethernet-over-EtherCAT (EoE). + Ethernet over EtherCAT (EoE). */ /*****************************************************************************/ diff -r 399ef727bf62 -r e206f4485f60 master/ethernet.h --- a/master/ethernet.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/ethernet.h Mon Dec 29 15:19:16 2008 +0000 @@ -26,7 +26,7 @@ /** \file - Ethernet-over-EtherCAT (EoE) + Ethernet over EtherCAT (EoE) */ /*****************************************************************************/ @@ -57,7 +57,7 @@ typedef struct ec_eoe ec_eoe_t; /**< \see ec_eoe */ /** - Ethernet-over-EtherCAT (EoE) handler. + Ethernet over EtherCAT (EoE) handler. The master creates one of these objects for each slave that supports the EoE protocol. */ diff -r 399ef727bf62 -r e206f4485f60 master/fmmu_config.c --- a/master/fmmu_config.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fmmu_config.c Mon Dec 29 15:19:16 2008 +0000 @@ -41,7 +41,7 @@ /** FMMU configuration constructor. * * Inits an FMMU configuration, sets the logical start address and adds the - * process data size for the mapped Pdos of the given direction to the domain + * process data size for the mapped PDOs of the given direction to the domain * data size. */ void ec_fmmu_config_init( @@ -49,7 +49,7 @@ ec_slave_config_t *sc, /**< EtherCAT slave configuration. */ ec_domain_t *domain, /**< EtherCAT domain. */ uint8_t sync_index, /**< Sync manager index to use. */ - ec_direction_t dir /**< Pdo direction. */ + ec_direction_t dir /**< PDO direction. */ ) { INIT_LIST_HEAD(&fmmu->list); diff -r 399ef727bf62 -r e206f4485f60 master/fmmu_config.h --- a/master/fmmu_config.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fmmu_config.h Mon Dec 29 15:19:16 2008 +0000 @@ -49,7 +49,7 @@ uint8_t sync_index; /**< Index of sync manager to use. */ ec_direction_t dir; /**< FMMU direction. */ uint32_t logical_start_address; /**< Logical start address. */ - unsigned int data_size; /**< Covered Pdo size. */ + unsigned int data_size; /**< Covered PDO size. */ } ec_fmmu_config_t; /*****************************************************************************/ diff -r 399ef727bf62 -r e206f4485f60 master/fsm_coe.c --- a/master/fsm_coe.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fsm_coe.c Mon Dec 29 15:19:16 2008 +0000 @@ -74,24 +74,24 @@ /*****************************************************************************/ /** - Sdo abort messages. - The "abort Sdo transfer request" supplies an abort code, + SDO abort messages. + The "abort SDO transfer request" supplies an abort code, which can be translated to clear text. This table does the mapping of the codes and messages. */ const ec_code_msg_t sdo_abort_messages[] = { {0x05030000, "Toggle bit not changed"}, - {0x05040000, "Sdo protocol timeout"}, + {0x05040000, "SDO protocol timeout"}, {0x05040001, "Client/Server command specifier not valid or unknown"}, {0x05040005, "Out of memory"}, {0x06010000, "Unsupported access to an object"}, {0x06010001, "Attempt to read a write-only object"}, {0x06010002, "Attempt to write a read-only object"}, {0x06020000, "This object does not exist in the object directory"}, - {0x06040041, "The object cannot be mapped into the Pdo"}, + {0x06040041, "The object cannot be mapped into the PDO"}, {0x06040042, "The number and length of the objects to be mapped would" - " exceed the Pdo length"}, + " exceed the PDO length"}, {0x06040043, "General parameter incompatibility reason"}, {0x06040047, "Gerneral internal incompatibility in device"}, {0x06060000, "Access failure due to a hardware error"}, @@ -120,7 +120,7 @@ /*****************************************************************************/ /** - Outputs an Sdo abort message. + Outputs an SDO abort message. */ void ec_canopen_abort_msg(uint32_t abort_code) @@ -129,13 +129,13 @@ for (abort_msg = sdo_abort_messages; abort_msg->code; abort_msg++) { if (abort_msg->code == abort_code) { - EC_ERR("Sdo abort message 0x%08X: \"%s\".\n", + EC_ERR("SDO abort message 0x%08X: \"%s\".\n", abort_msg->code, abort_msg->message); return; } } - EC_ERR("Unknown Sdo abort code 0x%08X.\n", abort_code); + EC_ERR("Unknown SDO abort code 0x%08X.\n", abort_code); } /*****************************************************************************/ @@ -165,7 +165,7 @@ /*****************************************************************************/ /** - Starts reading a slaves' Sdo dictionary. + Starts reading a slaves' SDO dictionary. */ void ec_fsm_coe_dictionary(ec_fsm_coe_t *fsm, /**< finite state machine */ @@ -179,13 +179,13 @@ /*****************************************************************************/ /** - Starts to transfer an Sdo to/from a slave. + Starts to transfer an SDO to/from a slave. */ void ec_fsm_coe_transfer( ec_fsm_coe_t *fsm, /**< State machine. */ ec_slave_t *slave, /**< EtherCAT slave. */ - ec_sdo_request_t *request /**< Sdo request. */ + ec_sdo_request_t *request /**< SDO request. */ ) { fsm->slave = slave; @@ -275,7 +275,7 @@ } if (slave->sii.has_general && !slave->sii.coe_details.enable_sdo_info) { - EC_ERR("Slave %u does not support Sdo information service!\n", + EC_ERR("Slave %u does not support SDO information service!\n", slave->ring_position); fsm->state = ec_fsm_coe_error; return; @@ -286,11 +286,11 @@ return; } - EC_WRITE_U16(data, 0x8 << 12); // Sdo information + EC_WRITE_U16(data, 0x8 << 12); // SDO information EC_WRITE_U8 (data + 2, 0x01); // Get OD List Request EC_WRITE_U8 (data + 3, 0x00); EC_WRITE_U16(data + 4, 0x0000); - EC_WRITE_U16(data + 6, 0x0001); // deliver all Sdos! + EC_WRITE_U16(data + 6, 0x0001); // deliver all SDOs! fsm->retries = EC_FSM_RETRIES; fsm->state = ec_fsm_coe_dict_request; @@ -369,7 +369,7 @@ (datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ; if (diff_ms >= EC_FSM_COE_DICT_TIMEOUT) { fsm->state = ec_fsm_coe_error; - EC_ERR("Timeout while waiting for Sdo dictionary list response " + EC_ERR("Timeout while waiting for SDO dictionary list response " "on slave %u.\n", slave->ring_position); return; } @@ -442,18 +442,18 @@ } if (rec_size < 3) { - EC_ERR("Received corrupted Sdo dictionary response (size %u).\n", + EC_ERR("Received corrupted SDO dictionary response (size %u).\n", rec_size); fsm->state = ec_fsm_coe_error; return; } - if (EC_READ_U16(data) >> 12 == 0x8 && // Sdo information + if (EC_READ_U16(data) >> 12 == 0x8 && // SDO information (EC_READ_U8(data + 2) & 0x7F) == 0x07) { // error response - EC_ERR("Sdo information error response at slave %u!\n", + EC_ERR("SDO information error response at slave %u!\n", slave->ring_position); if (rec_size < 10) { - EC_ERR("Incomplete Sdo information error response:\n"); + EC_ERR("Incomplete SDO information error response:\n"); ec_print_data(data, rec_size); } else { ec_canopen_abort_msg(EC_READ_U32(data + 6)); @@ -462,10 +462,10 @@ return; } - if (EC_READ_U16(data) >> 12 != 0x8 || // Sdo information + if (EC_READ_U16(data) >> 12 != 0x8 || // SDO information (EC_READ_U8 (data + 2) & 0x7F) != 0x02) { // Get OD List response if (fsm->slave->master->debug_level) { - EC_DBG("Invalid Sdo list response at slave %u! Retrying...\n", + EC_DBG("Invalid SDO list response at slave %u! Retrying...\n", slave->ring_position); ec_print_data(data, rec_size); } @@ -488,13 +488,13 @@ sdo_index = EC_READ_U16(data + 8 + i * 2); if (!sdo_index) { if (slave->master->debug_level) - EC_WARN("Sdo dictionary of slave %u contains index 0x0000.\n", + EC_WARN("SDO dictionary of slave %u contains index 0x0000.\n", slave->ring_position); continue; } if (!(sdo = (ec_sdo_t *) kmalloc(sizeof(ec_sdo_t), GFP_KERNEL))) { - EC_ERR("Failed to allocate memory for Sdo!\n"); + EC_ERR("Failed to allocate memory for SDO!\n"); fsm->state = ec_fsm_coe_error; return; } @@ -505,7 +505,7 @@ fragments_left = EC_READ_U16(data + 4); if (slave->master->debug_level && fragments_left) { - EC_DBG("Sdo list fragments left: %u\n", fragments_left); + EC_DBG("SDO list fragments left: %u\n", fragments_left); } if (EC_READ_U8(data + 2) & 0x80 || fragments_left) { // more messages waiting. check again. @@ -517,12 +517,12 @@ } if (list_empty(&slave->sdo_dictionary)) { - // no Sdos in dictionary. finished. + // no SDOs in dictionary. finished. fsm->state = ec_fsm_coe_end; // success return; } - // fetch Sdo descriptions + // fetch SDO descriptions fsm->sdo = list_entry(slave->sdo_dictionary.next, ec_sdo_t, list); if (!(data = ec_slave_mbox_prepare_send(slave, datagram, 0x03, 8))) { @@ -530,11 +530,11 @@ return; } - EC_WRITE_U16(data, 0x8 << 12); // Sdo information + EC_WRITE_U16(data, 0x8 << 12); // SDO information EC_WRITE_U8 (data + 2, 0x03); // Get object description request EC_WRITE_U8 (data + 3, 0x00); EC_WRITE_U16(data + 4, 0x0000); - EC_WRITE_U16(data + 6, fsm->sdo->index); // Sdo index + EC_WRITE_U16(data + 6, fsm->sdo->index); // SDO index fsm->retries = EC_FSM_RETRIES; fsm->state = ec_fsm_coe_dict_desc_request; @@ -557,7 +557,7 @@ if (datagram->state != EC_DATAGRAM_RECEIVED) { fsm->state = ec_fsm_coe_error; - EC_ERR("Failed to receive CoE Sdo description request datagram for" + EC_ERR("Failed to receive CoE SDO description request datagram for" " slave %u (datagram state %u).\n", slave->ring_position, datagram->state); return; @@ -565,7 +565,7 @@ if (datagram->working_counter != 1) { fsm->state = ec_fsm_coe_error; - EC_ERR("Reception of CoE Sdo description" + EC_ERR("Reception of CoE SDO description" " request failed on slave %u: ", slave->ring_position); ec_datagram_print_wc_error(datagram); return; @@ -613,7 +613,7 @@ (datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ; if (diff_ms >= EC_FSM_COE_DICT_TIMEOUT) { fsm->state = ec_fsm_coe_error; - EC_ERR("Timeout while waiting for Sdo object description " + EC_ERR("Timeout while waiting for SDO object description " "response on slave %u.\n", slave->ring_position); return; } @@ -650,7 +650,7 @@ if (datagram->state != EC_DATAGRAM_RECEIVED) { fsm->state = ec_fsm_coe_error; - EC_ERR("Failed to receive CoE Sdo description response datagram from" + EC_ERR("Failed to receive CoE SDO description response datagram from" " slave %u (datagram state %u).\n", slave->ring_position, datagram->state); return; @@ -658,7 +658,7 @@ if (datagram->working_counter != 1) { fsm->state = ec_fsm_coe_error; - EC_ERR("Reception of CoE Sdo description" + EC_ERR("Reception of CoE SDO description" " response failed on slave %u: ", slave->ring_position); ec_datagram_print_wc_error(datagram); return; @@ -685,16 +685,16 @@ } if (rec_size < 3) { - EC_ERR("Received corrupted Sdo description response (size %u).\n", + EC_ERR("Received corrupted SDO description response (size %u).\n", rec_size); fsm->state = ec_fsm_coe_error; return; } - if (EC_READ_U16(data) >> 12 == 0x8 && // Sdo information + if (EC_READ_U16(data) >> 12 == 0x8 && // SDO information (EC_READ_U8 (data + 2) & 0x7F) == 0x07) { // error response - EC_ERR("Sdo information error response at slave %u while" - " fetching Sdo 0x%04X!\n", slave->ring_position, + EC_ERR("SDO information error response at slave %u while" + " fetching SDO 0x%04X!\n", slave->ring_position, sdo->index); ec_canopen_abort_msg(EC_READ_U32(data + 6)); fsm->state = ec_fsm_coe_error; @@ -702,18 +702,18 @@ } if (rec_size < 8) { - EC_ERR("Received corrupted Sdo description response (size %u).\n", + EC_ERR("Received corrupted SDO description response (size %u).\n", rec_size); fsm->state = ec_fsm_coe_error; return; } - if (EC_READ_U16(data) >> 12 != 0x8 || // Sdo information + if (EC_READ_U16(data) >> 12 != 0x8 || // SDO information (EC_READ_U8 (data + 2) & 0x7F) != 0x04 || // Object desc. response - EC_READ_U16(data + 6) != sdo->index) { // Sdo index + EC_READ_U16(data + 6) != sdo->index) { // SDO index if (fsm->slave->master->debug_level) { EC_DBG("Invalid object description response at slave %u while" - " fetching Sdo 0x%04X!\n", slave->ring_position, + " fetching SDO 0x%04X!\n", slave->ring_position, sdo->index); ec_print_data(data, rec_size); } @@ -737,7 +737,7 @@ name_size = rec_size - 12; if (name_size) { if (!(sdo->name = kmalloc(name_size + 1, GFP_KERNEL))) { - EC_ERR("Failed to allocate Sdo name!\n"); + EC_ERR("Failed to allocate SDO name!\n"); fsm->state = ec_fsm_coe_error; return; } @@ -761,12 +761,12 @@ return; } - EC_WRITE_U16(data, 0x8 << 12); // Sdo information + EC_WRITE_U16(data, 0x8 << 12); // SDO information EC_WRITE_U8 (data + 2, 0x05); // Get entry description request EC_WRITE_U8 (data + 3, 0x00); EC_WRITE_U16(data + 4, 0x0000); - EC_WRITE_U16(data + 6, sdo->index); // Sdo index - EC_WRITE_U8 (data + 8, fsm->subindex); // Sdo subindex + EC_WRITE_U16(data + 6, sdo->index); // SDO index + EC_WRITE_U8 (data + 8, fsm->subindex); // SDO subindex EC_WRITE_U8 (data + 9, 0x00); // value info (no values) fsm->retries = EC_FSM_RETRIES; @@ -791,7 +791,7 @@ if (datagram->state != EC_DATAGRAM_RECEIVED) { fsm->state = ec_fsm_coe_error; - EC_ERR("Failed to receive CoE Sdo entry request datagram for" + EC_ERR("Failed to receive CoE SDO entry request datagram for" " slave %u (datagram state %u).\n", slave->ring_position, datagram->state); return; @@ -799,7 +799,7 @@ if (datagram->working_counter != 1) { fsm->state = ec_fsm_coe_error; - EC_ERR("Reception of CoE Sdo entry request failed on slave %u: ", + EC_ERR("Reception of CoE SDO entry request failed on slave %u: ", slave->ring_position); ec_datagram_print_wc_error(datagram); return; @@ -848,7 +848,7 @@ (datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ; if (diff_ms >= EC_FSM_COE_DICT_TIMEOUT) { fsm->state = ec_fsm_coe_error; - EC_ERR("Timeout while waiting for Sdo entry description response " + EC_ERR("Timeout while waiting for SDO entry description response " "on slave %u.\n", slave->ring_position); return; } @@ -886,7 +886,7 @@ if (datagram->state != EC_DATAGRAM_RECEIVED) { fsm->state = ec_fsm_coe_error; - EC_ERR("Failed to receive CoE Sdo description response datagram from" + EC_ERR("Failed to receive CoE SDO description response datagram from" " slave %u (datagram state %u).\n", slave->ring_position, datagram->state); return; @@ -894,7 +894,7 @@ if (datagram->working_counter != 1) { fsm->state = ec_fsm_coe_error; - EC_ERR("Reception of CoE Sdo description" + EC_ERR("Reception of CoE SDO description" " response failed on slave %u: ", slave->ring_position); ec_datagram_print_wc_error(datagram); return; @@ -921,16 +921,16 @@ } if (rec_size < 3) { - EC_ERR("Received corrupted Sdo entry description response " + EC_ERR("Received corrupted SDO entry description response " "(size %u).\n", rec_size); fsm->state = ec_fsm_coe_error; return; } - if (EC_READ_U16(data) >> 12 == 0x8 && // Sdo information + if (EC_READ_U16(data) >> 12 == 0x8 && // SDO information (EC_READ_U8 (data + 2) & 0x7F) == 0x07) { // error response - EC_ERR("Sdo information error response at slave %u while" - " fetching Sdo entry 0x%04X:%02X!\n", slave->ring_position, + EC_ERR("SDO information error response at slave %u while" + " fetching SDO entry 0x%04X:%02X!\n", slave->ring_position, sdo->index, fsm->subindex); ec_canopen_abort_msg(EC_READ_U32(data + 6)); fsm->state = ec_fsm_coe_error; @@ -938,19 +938,19 @@ } if (rec_size < 9) { - EC_ERR("Received corrupted Sdo entry description response " + EC_ERR("Received corrupted SDO entry description response " "(size %u).\n", rec_size); fsm->state = ec_fsm_coe_error; return; } - if (EC_READ_U16(data) >> 12 != 0x8 || // Sdo information + if (EC_READ_U16(data) >> 12 != 0x8 || // SDO information (EC_READ_U8(data + 2) & 0x7F) != 0x06 || // Entry desc. response - EC_READ_U16(data + 6) != sdo->index || // Sdo index - EC_READ_U8(data + 8) != fsm->subindex) { // Sdo subindex + EC_READ_U16(data + 6) != sdo->index || // SDO index + EC_READ_U8(data + 8) != fsm->subindex) { // SDO subindex if (fsm->slave->master->debug_level) { EC_DBG("Invalid entry description response at slave %u while" - " fetching Sdo entry 0x%04X:%02X!\n", slave->ring_position, + " fetching SDO entry 0x%04X:%02X!\n", slave->ring_position, sdo->index, fsm->subindex); ec_print_data(data, rec_size); } @@ -984,7 +984,7 @@ if (data_size) { uint8_t *desc; if (!(desc = kmalloc(data_size + 1, GFP_KERNEL))) { - EC_ERR("Failed to allocate Sdo entry name!\n"); + EC_ERR("Failed to allocate SDO entry name!\n"); fsm->state = ec_fsm_coe_error; return; } @@ -1003,12 +1003,12 @@ return; } - EC_WRITE_U16(data, 0x8 << 12); // Sdo information + EC_WRITE_U16(data, 0x8 << 12); // SDO information EC_WRITE_U8 (data + 2, 0x05); // Get entry description request EC_WRITE_U8 (data + 3, 0x00); EC_WRITE_U16(data + 4, 0x0000); - EC_WRITE_U16(data + 6, sdo->index); // Sdo index - EC_WRITE_U8 (data + 8, fsm->subindex); // Sdo subindex + EC_WRITE_U16(data + 6, sdo->index); // SDO index + EC_WRITE_U8 (data + 8, fsm->subindex); // SDO subindex EC_WRITE_U8 (data + 9, 0x00); // value info (no values) fsm->retries = EC_FSM_RETRIES; @@ -1016,7 +1016,7 @@ return; } - // another Sdo description to fetch? + // another SDO description to fetch? if (fsm->sdo->list.next != &slave->sdo_dictionary) { fsm->sdo = list_entry(fsm->sdo->list.next, ec_sdo_t, list); @@ -1025,11 +1025,11 @@ return; } - EC_WRITE_U16(data, 0x8 << 12); // Sdo information + EC_WRITE_U16(data, 0x8 << 12); // SDO information EC_WRITE_U8 (data + 2, 0x03); // Get object description request EC_WRITE_U8 (data + 3, 0x00); EC_WRITE_U16(data + 4, 0x0000); - EC_WRITE_U16(data + 6, fsm->sdo->index); // Sdo index + EC_WRITE_U16(data + 6, fsm->sdo->index); // SDO index fsm->retries = EC_FSM_RETRIES; fsm->state = ec_fsm_coe_dict_desc_request; @@ -1056,7 +1056,7 @@ uint8_t size; if (fsm->slave->master->debug_level) { - EC_DBG("Downloading Sdo 0x%04X:%02X to slave %u.\n", + EC_DBG("Downloading SDO 0x%04X:%02X to slave %u.\n", request->index, request->subindex, slave->ring_position); ec_print_data(request->data, request->data_size); } @@ -1075,7 +1075,7 @@ size = 4 - request->data_size; - EC_WRITE_U16(data, 0x2 << 12); // Sdo request + EC_WRITE_U16(data, 0x2 << 12); // SDO request EC_WRITE_U8 (data + 2, (0x3 // size specified, expedited | size << 2 | 0x1 << 5)); // Download request @@ -1090,7 +1090,7 @@ } else { // request->data_size > 4, use normal transfer type if (slave->sii.rx_mailbox_size < 6 + 10 + request->data_size) { - EC_ERR("Sdo fragmenting not supported yet!\n"); + EC_ERR("SDO fragmenting not supported yet!\n"); fsm->state = ec_fsm_coe_error; return; } @@ -1101,7 +1101,7 @@ return; } - EC_WRITE_U16(data, 0x2 << 12); // Sdo request + EC_WRITE_U16(data, 0x2 << 12); // SDO request EC_WRITE_U8 (data + 2, (0x1 // size indicator, normal | 0x1 << 5)); // Download request EC_WRITE_U16(data + 3, request->index); @@ -1149,7 +1149,7 @@ (jiffies - fsm->request->jiffies_sent) * 1000 / HZ; if (diff_ms < fsm->request->response_timeout) { if (fsm->slave->master->debug_level) { - EC_DBG("Slave %u did not respond to Sdo download request. " + EC_DBG("Slave %u did not respond to SDO download request. " "Retrying after %u ms...\n", slave->ring_position, (u32) diff_ms); } @@ -1206,7 +1206,7 @@ (datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ; if (diff_ms >= fsm->request->response_timeout) { fsm->state = ec_fsm_coe_error; - EC_ERR("Timeout while waiting for Sdo download response on " + EC_ERR("Timeout while waiting for SDO download response on " "slave %u.\n", slave->ring_position); return; } @@ -1288,10 +1288,10 @@ return; } - if (EC_READ_U16(data) >> 12 == 0x2 && // Sdo request - EC_READ_U8 (data + 2) >> 5 == 0x4) { // abort Sdo transfer request - fsm->state = ec_fsm_coe_error; - EC_ERR("Sdo download 0x%04X:%02X (%u bytes) aborted on slave %u.\n", + if (EC_READ_U16(data) >> 12 == 0x2 && // SDO request + EC_READ_U8 (data + 2) >> 5 == 0x4) { // abort SDO transfer request + fsm->state = ec_fsm_coe_error; + EC_ERR("SDO download 0x%04X:%02X (%u bytes) aborted on slave %u.\n", request->index, request->subindex, request->data_size, slave->ring_position); if (rec_size < 10) { @@ -1304,12 +1304,12 @@ return; } - if (EC_READ_U16(data) >> 12 != 0x3 || // Sdo response + if (EC_READ_U16(data) >> 12 != 0x3 || // SDO response EC_READ_U8 (data + 2) >> 5 != 0x3 || // Download response EC_READ_U16(data + 3) != request->index || // index EC_READ_U8 (data + 5) != request->subindex) { // subindex if (slave->master->debug_level) { - EC_DBG("Invalid Sdo download response at slave %u! Retrying...\n", + EC_DBG("Invalid SDO download response at slave %u! Retrying...\n", slave->ring_position); ec_print_data(data, rec_size); } @@ -1338,7 +1338,7 @@ uint8_t *data; if (master->debug_level) - EC_DBG("Uploading Sdo 0x%04X:%02X from slave %u.\n", + EC_DBG("Uploading SDO 0x%04X:%02X from slave %u.\n", request->index, request->subindex, slave->ring_position); if (!(slave->sii.mailbox_protocols & EC_MBOX_COE)) { @@ -1352,7 +1352,7 @@ return; } - EC_WRITE_U16(data, 0x2 << 12); // Sdo request + EC_WRITE_U16(data, 0x2 << 12); // SDO request EC_WRITE_U8 (data + 2, 0x2 << 5); // initiate upload request EC_WRITE_U16(data + 3, request->index); EC_WRITE_U8 (data + 5, request->subindex); @@ -1397,7 +1397,7 @@ (jiffies - fsm->request->jiffies_sent) * 1000 / HZ; if (diff_ms < fsm->request->response_timeout) { if (fsm->slave->master->debug_level) { - EC_DBG("Slave %u did not respond to Sdo upload request. " + EC_DBG("Slave %u did not respond to SDO upload request. " "Retrying after %u ms...\n", slave->ring_position, (u32) diff_ms); } @@ -1454,7 +1454,7 @@ (datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ; if (diff_ms >= fsm->request->response_timeout) { fsm->state = ec_fsm_coe_error; - EC_ERR("Timeout while waiting for Sdo upload response on " + EC_ERR("Timeout while waiting for SDO upload response on " "slave %u.\n", slave->ring_position); return; } @@ -1534,14 +1534,14 @@ if (rec_size < 3) { fsm->state = ec_fsm_coe_error; - EC_ERR("Received currupted Sdo upload response (%u bytes)!\n", rec_size); + EC_ERR("Received currupted SDO upload response (%u bytes)!\n", rec_size); ec_print_data(data, rec_size); return; } - if (EC_READ_U16(data) >> 12 == 0x2 && // Sdo request - EC_READ_U8 (data + 2) >> 5 == 0x4) { // abort Sdo transfer request - EC_ERR("Sdo upload 0x%04X:%02X aborted on slave %u.\n", + if (EC_READ_U16(data) >> 12 == 0x2 && // SDO request + EC_READ_U8 (data + 2) >> 5 == 0x4) { // abort SDO transfer request + EC_ERR("SDO upload 0x%04X:%02X aborted on slave %u.\n", request->index, request->subindex, slave->ring_position); if (rec_size >= 10) { request->abort_code = EC_READ_U32(data + 6); @@ -1559,18 +1559,18 @@ if (expedited) { if (rec_size < 7) { fsm->state = ec_fsm_coe_error; - EC_ERR("Received currupted Sdo expedited upload" + EC_ERR("Received currupted SDO expedited upload" " response (only %u bytes)!\n", rec_size); ec_print_data(data, rec_size); return; } - if (EC_READ_U16(data) >> 12 != 0x3 || // Sdo response + if (EC_READ_U16(data) >> 12 != 0x3 || // SDO response EC_READ_U8 (data + 2) >> 5 != 0x2 || // upload response EC_READ_U16(data + 3) != request->index || // index EC_READ_U8 (data + 5) != request->subindex) { // subindex if (fsm->slave->master->debug_level) { - EC_DBG("Invalid Sdo upload expedited response at slave %u!\n", + EC_DBG("Invalid SDO upload expedited response at slave %u!\n", slave->ring_position); ec_print_data(data, rec_size); } @@ -1590,7 +1590,7 @@ if (rec_size < 6 + complete_size) { fsm->state = ec_fsm_coe_error; - EC_ERR("Received currupted Sdo expedited upload" + EC_ERR("Received currupted SDO expedited upload" " response (only %u bytes)!\n", rec_size); ec_print_data(data, rec_size); return; @@ -1603,18 +1603,18 @@ } else { // normal if (rec_size < 10) { fsm->state = ec_fsm_coe_error; - EC_ERR("Received currupted Sdo normal upload" + EC_ERR("Received currupted SDO normal upload" " response (only %u bytes)!\n", rec_size); ec_print_data(data, rec_size); return; } - if (EC_READ_U16(data) >> 12 != 0x3 || // Sdo response + if (EC_READ_U16(data) >> 12 != 0x3 || // SDO response EC_READ_U8 (data + 2) >> 5 != 0x2 || // upload response EC_READ_U16(data + 3) != request->index || // index EC_READ_U8 (data + 5) != request->subindex) { // subindex if (fsm->slave->master->debug_level) { - EC_DBG("Invalid Sdo normal upload response at slave %u!\n", + EC_DBG("Invalid SDO normal upload response at slave %u!\n", slave->ring_position); ec_print_data(data, rec_size); } @@ -1648,7 +1648,7 @@ fsm->toggle = 0; if (data_size < complete_size) { - EC_WARN("Sdo data incomplete (%u / %u).\n", + EC_WARN("SDO data incomplete (%u / %u).\n", data_size, complete_size); if (!(data = ec_slave_mbox_prepare_send(slave, datagram, @@ -1657,7 +1657,7 @@ return; } - EC_WRITE_U16(data, 0x2 << 12); // Sdo request + EC_WRITE_U16(data, 0x2 << 12); // SDO request EC_WRITE_U8 (data + 2, (fsm->toggle << 4 // toggle | 0x3 << 5)); // upload segment request @@ -1753,7 +1753,7 @@ (datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ; if (diff_ms >= fsm->request->response_timeout) { fsm->state = ec_fsm_coe_error; - EC_ERR("Timeout while waiting for Sdo upload segment response " + EC_ERR("Timeout while waiting for SDO upload segment response " "on slave %u.\n", slave->ring_position); return; } @@ -1833,15 +1833,15 @@ } if (rec_size < 10) { - EC_ERR("Received currupted Sdo upload segment response!\n"); + EC_ERR("Received currupted SDO upload segment response!\n"); ec_print_data(data, rec_size); fsm->state = ec_fsm_coe_error; return; } - if (EC_READ_U16(data) >> 12 == 0x2 && // Sdo request - EC_READ_U8 (data + 2) >> 5 == 0x4) { // abort Sdo transfer request - EC_ERR("Sdo upload 0x%04X:%02X aborted on slave %u.\n", + if (EC_READ_U16(data) >> 12 == 0x2 && // SDO request + EC_READ_U8 (data + 2) >> 5 == 0x4) { // abort SDO transfer request + EC_ERR("SDO upload 0x%04X:%02X aborted on slave %u.\n", request->index, request->subindex, slave->ring_position); request->abort_code = EC_READ_U32(data + 6); ec_canopen_abort_msg(request->abort_code); @@ -1849,10 +1849,10 @@ return; } - if (EC_READ_U16(data) >> 12 != 0x3 || // Sdo response + if (EC_READ_U16(data) >> 12 != 0x3 || // SDO response EC_READ_U8 (data + 2) >> 5 != 0x0) { // upload segment response if (fsm->slave->master->debug_level) { - EC_DBG("Invalid Sdo upload segment response at slave %u!\n", + EC_DBG("Invalid SDO upload segment response at slave %u!\n", slave->ring_position); ec_print_data(data, rec_size); } @@ -1868,7 +1868,7 @@ data_size = rec_size - 10; if (data_size != seg_size) { - EC_WARN("Sdo segment data invalid (%u / %u)" + EC_WARN("SDO segment data invalid (%u / %u)" " - Fragmenting not implemented.\n", data_size, seg_size); } @@ -1884,7 +1884,7 @@ return; } - EC_WRITE_U16(data, 0x2 << 12); // Sdo request + EC_WRITE_U16(data, 0x2 << 12); // SDO request EC_WRITE_U8 (data + 2, (fsm->toggle << 4 // toggle | 0x3 << 5)); // upload segment request diff -r 399ef727bf62 -r e206f4485f60 master/fsm_coe.h --- a/master/fsm_coe.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fsm_coe.h Mon Dec 29 15:19:16 2008 +0000 @@ -45,7 +45,7 @@ typedef struct ec_fsm_coe ec_fsm_coe_t; /**< \see ec_fsm_coe */ -/** Finite state machines for the CANopen-over-EtherCAT protocol. +/** Finite state machines for the CANopen over EtherCAT protocol. */ struct ec_fsm_coe { ec_slave_t *slave; /**< slave the FSM runs on */ @@ -54,9 +54,9 @@ void (*state)(ec_fsm_coe_t *); /**< CoE state function */ unsigned long jiffies_start; /**< CoE timestamp. */ - ec_sdo_t *sdo; /**< current Sdo */ + ec_sdo_t *sdo; /**< current SDO */ uint8_t subindex; /**< current subindex */ - ec_sdo_request_t *request; /**< Sdo request */ + ec_sdo_request_t *request; /**< SDO request */ uint8_t toggle; /**< toggle bit for segment commands */ }; diff -r 399ef727bf62 -r e206f4485f60 master/fsm_master.c --- a/master/fsm_master.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fsm_master.c Mon Dec 29 15:19:16 2008 +0000 @@ -317,9 +317,9 @@ /*****************************************************************************/ -/** Check for pending Sdo requests and process one. +/** Check for pending SDO requests and process one. * - * \return non-zero, if an Sdo request is processed. + * \return non-zero, if an SDO request is processed. */ int ec_fsm_master_action_process_sdo( ec_fsm_master_t *fsm /**< Master state machine. */ @@ -342,7 +342,7 @@ if (ec_sdo_request_timed_out(req)) { req->state = EC_REQUEST_FAILURE; if (master->debug_level) - EC_DBG("Sdo request for slave %u timed out...\n", + EC_DBG("SDO request for slave %u timed out...\n", slave->ring_position); continue; } @@ -354,7 +354,7 @@ req->state = EC_REQUEST_BUSY; if (master->debug_level) - EC_DBG("Processing Sdo request for slave %u...\n", + EC_DBG("Processing SDO request for slave %u...\n", slave->ring_position); fsm->idle = 0; @@ -381,19 +381,19 @@ slave = request->slave; if (slave->current_state == EC_SLAVE_STATE_INIT) { - EC_ERR("Discarding Sdo request, slave %u is in INIT.\n", + EC_ERR("Discarding SDO request, slave %u is in INIT.\n", slave->ring_position); request->req.state = EC_REQUEST_FAILURE; wake_up(&master->sdo_queue); continue; } - // Found pending Sdo request. Execute it! + // Found pending SDO request. Execute it! if (master->debug_level) - EC_DBG("Processing Sdo request for slave %u...\n", + EC_DBG("Processing SDO request for slave %u...\n", slave->ring_position); - // Start uploading Sdo + // Start uploading SDO fsm->idle = 0; fsm->sdo_request = &request->req; fsm->slave = slave; @@ -419,11 +419,11 @@ ec_master_t *master = fsm->master; ec_slave_t *slave; - // Check for pending Sdo requests + // Check for pending SDO requests if (ec_fsm_master_action_process_sdo(fsm)) return; - // check, if slaves have an Sdo dictionary to read out. + // check, if slaves have an SDO dictionary to read out. for (slave = master->slaves; slave < master->slaves + master->slave_count; slave++) { @@ -437,13 +437,13 @@ ) continue; if (master->debug_level) { - EC_DBG("Fetching Sdo dictionary from slave %u.\n", + EC_DBG("Fetching SDO dictionary from slave %u.\n", slave->ring_position); } slave->sdo_dictionary_fetched = 1; - // start fetching Sdo dictionary + // start fetching SDO dictionary fsm->idle = 0; fsm->slave = slave; fsm->state = ec_fsm_master_state_sdo_dictionary; @@ -807,12 +807,12 @@ return; } - // Sdo dictionary fetching finished + // SDO dictionary fetching finished if (master->debug_level) { unsigned int sdo_count, entry_count; ec_slave_sdo_dict_info(slave, &sdo_count, &entry_count); - EC_DBG("Fetched %u Sdos and %u entries from slave %u.\n", + EC_DBG("Fetched %u SDOs and %u entries from slave %u.\n", sdo_count, entry_count, slave->ring_position); } @@ -836,7 +836,7 @@ if (ec_fsm_coe_exec(&fsm->fsm_coe)) return; if (!ec_fsm_coe_success(&fsm->fsm_coe)) { - EC_DBG("Failed to process Sdo request for slave %u.\n", + EC_DBG("Failed to process SDO request for slave %u.\n", fsm->slave->ring_position); request->state = EC_REQUEST_FAILURE; wake_up(&master->sdo_queue); @@ -844,15 +844,15 @@ return; } - // Sdo request finished + // SDO request finished request->state = EC_REQUEST_SUCCESS; wake_up(&master->sdo_queue); if (master->debug_level) - EC_DBG("Finished Sdo request for slave %u.\n", + EC_DBG("Finished SDO request for slave %u.\n", fsm->slave->ring_position); - // check for another Sdo request + // check for another SDO request if (ec_fsm_master_action_process_sdo(fsm)) return; // processing another request diff -r 399ef727bf62 -r e206f4485f60 master/fsm_master.h --- a/master/fsm_master.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fsm_master.h Mon Dec 29 15:19:16 2008 +0000 @@ -58,12 +58,12 @@ /*****************************************************************************/ -/** Slave/Sdo request record for master's Sdo request list. +/** Slave/SDO request record for master's SDO request list. */ typedef struct { struct list_head list; /**< List element. */ ec_slave_t *slave; /**< Slave. */ - ec_sdo_request_t req; /**< Sdo request. */ + ec_sdo_request_t req; /**< SDO request. */ } ec_master_sdo_request_t; /*****************************************************************************/ @@ -86,10 +86,10 @@ ec_slave_t *slave; /**< current slave */ ec_sii_write_request_t *sii_request; /**< SII write request */ off_t sii_index; /**< index to SII write request data */ - ec_sdo_request_t *sdo_request; /**< Sdo request to process. */ + ec_sdo_request_t *sdo_request; /**< SDO request to process. */ ec_fsm_coe_t fsm_coe; /**< CoE state machine */ - ec_fsm_pdo_t fsm_pdo; /**< Pdo configuration state machine. */ + ec_fsm_pdo_t fsm_pdo; /**< PDO configuration state machine. */ ec_fsm_change_t fsm_change; /**< State change state machine */ ec_fsm_slave_config_t fsm_slave_config; /**< slave state machine */ ec_fsm_slave_scan_t fsm_slave_scan; /**< slave state machine */ diff -r 399ef727bf62 -r e206f4485f60 master/fsm_pdo.c --- a/master/fsm_pdo.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fsm_pdo.c Mon Dec 29 15:19:16 2008 +0000 @@ -25,7 +25,7 @@ *****************************************************************************/ /** \file - * EtherCAT Pdo configuration state machine. + * EtherCAT PDO configuration state machine. */ /*****************************************************************************/ @@ -69,7 +69,7 @@ /** Constructor. */ void ec_fsm_pdo_init( - ec_fsm_pdo_t *fsm, /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm, /**< PDO configuration state machine. */ ec_fsm_coe_t *fsm_coe /**< CoE state machine to use */ ) { @@ -85,7 +85,7 @@ /** Destructor. */ void ec_fsm_pdo_clear( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { ec_fsm_pdo_entry_clear(&fsm->fsm_pdo_entry); @@ -96,10 +96,10 @@ /*****************************************************************************/ -/** Start reading the Pdo configuration. +/** Start reading the PDO configuration. */ void ec_fsm_pdo_start_reading( - ec_fsm_pdo_t *fsm, /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm, /**< PDO configuration state machine. */ ec_slave_t *slave /**< slave to configure */ ) { @@ -109,10 +109,10 @@ /*****************************************************************************/ -/** Start writing the Pdo configuration. +/** Start writing the PDO configuration. */ void ec_fsm_pdo_start_configuration( - ec_fsm_pdo_t *fsm, /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm, /**< PDO configuration state machine. */ ec_slave_t *slave /**< slave to configure */ ) { @@ -127,7 +127,7 @@ * \return false, if state machine has terminated */ int ec_fsm_pdo_running( - const ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + const ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { return fsm->state != ec_fsm_pdo_state_end @@ -144,7 +144,7 @@ * \return false, if state machine has terminated */ int ec_fsm_pdo_exec( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { fsm->state(fsm); @@ -158,7 +158,7 @@ * \return true, if the state machine terminated gracefully */ int ec_fsm_pdo_success( - const ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + const ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { return fsm->state == ec_fsm_pdo_state_end; @@ -168,20 +168,20 @@ * Reading state funtions. *****************************************************************************/ -/** Start reading Pdo assignment. +/** Start reading PDO assignment. */ void ec_fsm_pdo_read_state_start( ec_fsm_pdo_t *fsm /**< finite state machine */ ) { - // read Pdo assignment for first sync manager not reserved for mailbox + // read PDO assignment for first sync manager not reserved for mailbox fsm->sync_index = 1; // next is 2 ec_fsm_pdo_read_action_next_sync(fsm); } /*****************************************************************************/ -/** Read Pdo assignment of next sync manager. +/** Read PDO assignment of next sync manager. */ void ec_fsm_pdo_read_action_next_sync( ec_fsm_pdo_t *fsm /**< Finite state machine */ @@ -196,7 +196,7 @@ continue; if (slave->master->debug_level) - EC_DBG("Reading Pdo assignment of SM%u.\n", fsm->sync_index); + EC_DBG("Reading PDO assignment of SM%u.\n", fsm->sync_index); ec_pdo_list_clear_pdos(&fsm->pdos); @@ -209,14 +209,14 @@ } if (slave->master->debug_level) - EC_DBG("Reading of Pdo configuration finished.\n"); + EC_DBG("Reading of PDO configuration finished.\n"); fsm->state = ec_fsm_pdo_state_end; } /*****************************************************************************/ -/** Count assigned Pdos. +/** Count assigned PDOs. */ void ec_fsm_pdo_read_state_pdo_count( ec_fsm_pdo_t *fsm /**< finite state machine */ @@ -225,14 +225,14 @@ if (ec_fsm_coe_exec(fsm->fsm_coe)) return; if (!ec_fsm_coe_success(fsm->fsm_coe)) { - EC_ERR("Failed to read number of assigned Pdos for SM%u.\n", + EC_ERR("Failed to read number of assigned PDOs for SM%u.\n", fsm->sync_index); fsm->state = ec_fsm_pdo_state_error; return; } if (fsm->request.data_size != sizeof(uint8_t)) { - EC_ERR("Invalid data size %u returned when uploading Sdo 0x%04X:%02X " + EC_ERR("Invalid data size %u returned when uploading SDO 0x%04X:%02X " "from slave %u.\n", fsm->request.data_size, fsm->request.index, fsm->request.subindex, fsm->slave->ring_position); @@ -242,16 +242,16 @@ fsm->pdo_count = EC_READ_U8(fsm->request.data); if (fsm->slave->master->debug_level) - EC_DBG("%u Pdos assigned.\n", fsm->pdo_count); - - // read first Pdo + EC_DBG("%u PDOs assigned.\n", fsm->pdo_count); + + // read first PDO fsm->pdo_pos = 1; ec_fsm_pdo_read_action_next_pdo(fsm); } /*****************************************************************************/ -/** Read next Pdo. +/** Read next PDO. */ void ec_fsm_pdo_read_action_next_pdo( ec_fsm_pdo_t *fsm /**< finite state machine */ @@ -267,7 +267,7 @@ return; } - // finished reading Pdo configuration + // finished reading PDO configuration if (ec_pdo_list_copy(&fsm->sync->pdos, &fsm->pdos)) { fsm->state = ec_fsm_pdo_state_error; @@ -282,7 +282,7 @@ /*****************************************************************************/ -/** Fetch Pdo information. +/** Fetch PDO information. */ void ec_fsm_pdo_read_state_pdo( ec_fsm_pdo_t *fsm /**< finite state machine */ @@ -291,14 +291,14 @@ if (ec_fsm_coe_exec(fsm->fsm_coe)) return; if (!ec_fsm_coe_success(fsm->fsm_coe)) { - EC_ERR("Failed to read index of assigned Pdo %u from SM%u.\n", + EC_ERR("Failed to read index of assigned PDO %u from SM%u.\n", fsm->pdo_pos, fsm->sync_index); fsm->state = ec_fsm_pdo_state_error; return; } if (fsm->request.data_size != sizeof(uint16_t)) { - EC_ERR("Invalid data size %u returned when uploading Sdo 0x%04X:%02X " + EC_ERR("Invalid data size %u returned when uploading SDO 0x%04X:%02X " "from slave %u.\n", fsm->request.data_size, fsm->request.index, fsm->request.subindex, fsm->slave->ring_position); @@ -308,7 +308,7 @@ if (!(fsm->pdo = (ec_pdo_t *) kmalloc(sizeof(ec_pdo_t), GFP_KERNEL))) { - EC_ERR("Failed to allocate Pdo.\n"); + EC_ERR("Failed to allocate PDO.\n"); fsm->state = ec_fsm_pdo_state_error; return; } @@ -318,7 +318,7 @@ fsm->pdo->sync_index = fsm->sync_index; if (fsm->slave->master->debug_level) - EC_DBG("Pdo 0x%04X.\n", fsm->pdo->index); + EC_DBG("PDO 0x%04X.\n", fsm->pdo->index); list_add_tail(&fsm->pdo->list, &fsm->pdos.list); @@ -329,7 +329,7 @@ /*****************************************************************************/ -/** Fetch Pdo information. +/** Fetch PDO information. */ void ec_fsm_pdo_read_state_pdo_entries( ec_fsm_pdo_t *fsm /**< finite state machine */ @@ -339,13 +339,13 @@ return; if (!ec_fsm_pdo_entry_success(&fsm->fsm_pdo_entry)) { - EC_ERR("Failed to read mapped Pdo entries for Pdo 0x%04X.\n", + EC_ERR("Failed to read mapped PDO entries for PDO 0x%04X.\n", fsm->pdo->index); fsm->state = ec_fsm_pdo_state_error; return; } - // next Pdo + // next PDO fsm->pdo_pos++; ec_fsm_pdo_read_action_next_pdo(fsm); } @@ -354,10 +354,10 @@ * Writing state functions. *****************************************************************************/ -/** Start Pdo configuration. +/** Start PDO configuration. */ void ec_fsm_pdo_conf_state_start( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { if (!fsm->slave->config) { @@ -371,16 +371,16 @@ /*****************************************************************************/ -/** Assign next Pdo. +/** Assign next PDO. */ ec_pdo_t *ec_fsm_pdo_conf_action_next_pdo( - const ec_fsm_pdo_t *fsm, /**< Pdo configuration state machine. */ - const struct list_head *list /**< current Pdo list item */ + const ec_fsm_pdo_t *fsm, /**< PDO configuration state machine. */ + const struct list_head *list /**< current PDO list item */ ) { list = list->next; if (list == &fsm->pdos.list) - return NULL; // no next Pdo + return NULL; // no next PDO return list_entry(list, ec_pdo_t, list); } @@ -389,7 +389,7 @@ /** Get the next sync manager for a pdo configuration. */ void ec_fsm_pdo_conf_action_next_sync( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { fsm->sync_index++; @@ -408,13 +408,13 @@ if (!(fsm->sync = ec_slave_get_sync(fsm->slave, fsm->sync_index))) { if (!list_empty(&fsm->pdos.list)) - EC_WARN("Pdos configured for SM%u, but slave %u does not " + EC_WARN("PDOs configured for SM%u, but slave %u does not " "provide the sync manager information!\n", fsm->sync_index, fsm->slave->ring_position); continue; } - // get first configured Pdo + // get first configured PDO if (!(fsm->pdo = ec_fsm_pdo_conf_action_next_pdo(fsm, &fsm->pdos.list))) { // no pdos configured ec_fsm_pdo_conf_action_check_assignment(fsm); @@ -433,7 +433,7 @@ /** Check if the mapping has to be read, otherwise start to configure it. */ void ec_fsm_pdo_conf_action_pdo_mapping( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { const ec_pdo_t *assigned_pdo; @@ -442,14 +442,14 @@ if ((assigned_pdo = ec_slave_find_pdo(fsm->slave, fsm->pdo->index))) { ec_pdo_copy_entries(&fsm->slave_pdo, assigned_pdo); - } else { // configured Pdo is not assigned and thus unknown + } else { // configured PDO is not assigned and thus unknown ec_pdo_clear_entries(&fsm->slave_pdo); } if (list_empty(&fsm->slave_pdo.entries)) { if (fsm->slave->master->debug_level) - EC_DBG("Reading mapping of Pdo 0x%04X.\n", + EC_DBG("Reading mapping of PDO 0x%04X.\n", fsm->pdo->index); // pdo mapping is unknown; start loading it @@ -466,17 +466,17 @@ /*****************************************************************************/ -/** Execute the Pdo entry state machine to read the current Pdo's mapping. +/** Execute the PDO entry state machine to read the current PDO's mapping. */ void ec_fsm_pdo_conf_state_read_mapping( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { if (ec_fsm_pdo_entry_exec(&fsm->fsm_pdo_entry)) return; if (!ec_fsm_pdo_entry_success(&fsm->fsm_pdo_entry)) - EC_WARN("Failed to read mapped Pdo entries for Pdo 0x%04X.\n", + EC_WARN("Failed to read mapped PDO entries for PDO 0x%04X.\n", fsm->pdo->index); // check if the mapping must be re-configured @@ -490,12 +490,12 @@ * \todo Display mapping differences. */ void ec_fsm_pdo_conf_action_check_mapping( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { if (ec_pdo_equal_entries(fsm->pdo, &fsm->slave_pdo)) { if (fsm->slave->master->debug_level) - EC_DBG("Mapping of Pdo 0x%04X is already configured correctly.\n", + EC_DBG("Mapping of PDO 0x%04X is already configured correctly.\n", fsm->pdo->index); ec_fsm_pdo_conf_action_next_pdo_mapping(fsm); return; @@ -503,7 +503,7 @@ if (fsm->slave->master->debug_level) { // TODO display diff - EC_DBG("Changing mapping of Pdo 0x%04X.\n", fsm->pdo->index); + EC_DBG("Changing mapping of PDO 0x%04X.\n", fsm->pdo->index); } ec_fsm_pdo_entry_start_configuration(&fsm->fsm_pdo_entry, fsm->slave, @@ -514,17 +514,17 @@ /*****************************************************************************/ -/** Let the Pdo entry state machine configure the current Pdo's mapping. +/** Let the PDO entry state machine configure the current PDO's mapping. */ void ec_fsm_pdo_conf_state_mapping( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { if (ec_fsm_pdo_entry_exec(&fsm->fsm_pdo_entry)) return; if (!ec_fsm_pdo_entry_success(&fsm->fsm_pdo_entry)) - EC_WARN("Failed to configure mapping of Pdo 0x%04X.\n", + EC_WARN("Failed to configure mapping of PDO 0x%04X.\n", fsm->pdo->index); ec_fsm_pdo_conf_action_next_pdo_mapping(fsm); @@ -532,13 +532,13 @@ /*****************************************************************************/ -/** Check mapping of next Pdo, otherwise configure assignment. +/** Check mapping of next PDO, otherwise configure assignment. */ void ec_fsm_pdo_conf_action_next_pdo_mapping( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ - ) -{ - // get next configured Pdo + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ + ) +{ + // get next configured PDO if (!(fsm->pdo = ec_fsm_pdo_conf_action_next_pdo(fsm, &fsm->pdo->list))) { // no more configured pdos ec_fsm_pdo_conf_action_check_assignment(fsm); @@ -550,17 +550,17 @@ /*****************************************************************************/ -/** Check if the Pdo assignment of the current SM has to be re-configured. +/** Check if the PDO assignment of the current SM has to be re-configured. */ void ec_fsm_pdo_conf_action_check_assignment( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { // check if assignment has to be re-configured if (ec_pdo_list_equal(&fsm->sync->pdos, &fsm->pdos)) { if (fsm->slave->master->debug_level) - EC_DBG("Pdo assignment for SM%u is already configured " + EC_DBG("PDO assignment for SM%u is already configured " "correctly.\n", fsm->sync_index); ec_fsm_pdo_conf_action_next_sync(fsm); @@ -568,20 +568,20 @@ } if (fsm->slave->master->debug_level) { - EC_DBG("Pdo assignment of SM%u differs:\n", fsm->sync_index); - EC_DBG("Currently assigned Pdos: "); + EC_DBG("PDO assignment of SM%u differs:\n", fsm->sync_index); + EC_DBG("Currently assigned PDOs: "); ec_pdo_list_print(&fsm->sync->pdos); printk("\n"); - EC_DBG("Pdos to assign: "); + EC_DBG("PDOs to assign: "); ec_pdo_list_print(&fsm->pdos); printk("\n"); } - // Pdo assignment has to be changed. Does the slave support this? + // PDO assignment has to be changed. Does the slave support this? if (!(fsm->slave->sii.mailbox_protocols & EC_MBOX_COE) || (fsm->slave->sii.has_general && !fsm->slave->sii.coe_details.enable_pdo_assign)) { - EC_WARN("Slave %u does not support assigning Pdos!\n", + EC_WARN("Slave %u does not support assigning PDOs!\n", fsm->slave->ring_position); ec_fsm_pdo_conf_action_next_sync(fsm); return; @@ -592,14 +592,14 @@ return; } - // set mapped Pdo count to zero - EC_WRITE_U8(fsm->request.data, 0); // zero Pdos mapped + // set mapped PDO count to zero + EC_WRITE_U8(fsm->request.data, 0); // zero PDOs mapped fsm->request.data_size = 1; ec_sdo_request_address(&fsm->request, 0x1C10 + fsm->sync_index, 0); ecrt_sdo_request_write(&fsm->request); if (fsm->slave->master->debug_level) - EC_DBG("Setting number of assigned Pdos to zero.\n"); + EC_DBG("Setting number of assigned PDOs to zero.\n"); fsm->state = ec_fsm_pdo_conf_state_zero_pdo_count; ec_fsm_coe_transfer(fsm->fsm_coe, fsm->slave, &fsm->request); @@ -608,48 +608,48 @@ /*****************************************************************************/ -/** Set the number of assigned Pdos to zero. +/** Set the number of assigned PDOs to zero. */ void ec_fsm_pdo_conf_state_zero_pdo_count( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { if (ec_fsm_coe_exec(fsm->fsm_coe)) return; if (!ec_fsm_coe_success(fsm->fsm_coe)) { - EC_WARN("Failed to clear Pdo assignment of SM%u.\n", fsm->sync_index); - fsm->state = ec_fsm_pdo_state_error; - return; - } - - // the sync manager's assigned Pdos have been cleared + EC_WARN("Failed to clear PDO assignment of SM%u.\n", fsm->sync_index); + fsm->state = ec_fsm_pdo_state_error; + return; + } + + // the sync manager's assigned PDOs have been cleared ec_pdo_list_clear_pdos(&fsm->sync->pdos); - // assign all Pdos belonging to the current sync manager + // assign all PDOs belonging to the current sync manager - // find first Pdo + // find first PDO if (!(fsm->pdo = ec_fsm_pdo_conf_action_next_pdo(fsm, &fsm->pdos.list))) { if (fsm->slave->master->debug_level) - EC_DBG("No Pdos to assign.\n"); + EC_DBG("No PDOs to assign.\n"); // check for mapping to be altered ec_fsm_pdo_conf_action_next_sync(fsm); return; } - // assign first Pdo + // assign first PDO fsm->pdo_pos = 1; ec_fsm_pdo_conf_action_assign_pdo(fsm); } /*****************************************************************************/ -/** Assign a Pdo. +/** Assign a PDO. */ void ec_fsm_pdo_conf_action_assign_pdo( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { EC_WRITE_U16(fsm->request.data, fsm->pdo->index); @@ -659,7 +659,7 @@ ecrt_sdo_request_write(&fsm->request); if (fsm->slave->master->debug_level) - EC_DBG("Assigning Pdo 0x%04X at position %u.\n", + EC_DBG("Assigning PDO 0x%04X at position %u.\n", fsm->pdo->index, fsm->pdo_pos); fsm->state = ec_fsm_pdo_conf_state_assign_pdo; @@ -669,32 +669,32 @@ /*****************************************************************************/ -/** Add a Pdo to the sync managers Pdo assignment. +/** Add a PDO to the sync managers PDO assignment. */ void ec_fsm_pdo_conf_state_assign_pdo( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { if (ec_fsm_coe_exec(fsm->fsm_coe)) return; if (!ec_fsm_coe_success(fsm->fsm_coe)) { - EC_WARN("Failed to assign Pdo 0x%04X at position %u of SM%u.\n", + EC_WARN("Failed to assign PDO 0x%04X at position %u of SM%u.\n", fsm->pdo->index, fsm->pdo_pos, fsm->sync_index); fsm->state = ec_fsm_pdo_state_error; return; } - // find next Pdo + // find next PDO if (!(fsm->pdo = ec_fsm_pdo_conf_action_next_pdo(fsm, &fsm->pdo->list))) { - // no more Pdos to assign, set Pdo count + // no more PDOs to assign, set PDO count EC_WRITE_U8(fsm->request.data, fsm->pdo_pos); fsm->request.data_size = 1; ec_sdo_request_address(&fsm->request, 0x1C10 + fsm->sync_index, 0); ecrt_sdo_request_write(&fsm->request); if (fsm->slave->master->debug_level) - EC_DBG("Setting number of assigned Pdos to %u.\n", fsm->pdo_pos); + EC_DBG("Setting number of assigned PDOs to %u.\n", fsm->pdo_pos); fsm->state = ec_fsm_pdo_conf_state_set_pdo_count; ec_fsm_coe_transfer(fsm->fsm_coe, fsm->slave, &fsm->request); @@ -702,36 +702,36 @@ return; } - // add next Pdo to assignment + // add next PDO to assignment fsm->pdo_pos++; ec_fsm_pdo_conf_action_assign_pdo(fsm); } /*****************************************************************************/ -/** Set the number of assigned Pdos. +/** Set the number of assigned PDOs. */ void ec_fsm_pdo_conf_state_set_pdo_count( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { if (ec_fsm_coe_exec(fsm->fsm_coe)) return; if (!ec_fsm_coe_success(fsm->fsm_coe)) { - EC_WARN("Failed to set number of assigned Pdos of SM%u.\n", + EC_WARN("Failed to set number of assigned PDOs of SM%u.\n", fsm->sync_index); fsm->state = ec_fsm_pdo_state_error; return; } - // Pdos have been configured + // PDOs have been configured ec_pdo_list_copy(&fsm->sync->pdos, &fsm->pdos); if (fsm->slave->master->debug_level) - EC_DBG("Successfully configured Pdo assignment of SM%u.\n", + EC_DBG("Successfully configured PDO assignment of SM%u.\n", fsm->sync_index); - // check if Pdo mapping has to be altered + // check if PDO mapping has to be altered ec_fsm_pdo_conf_action_next_sync(fsm); } @@ -742,7 +742,7 @@ /** State: ERROR. */ void ec_fsm_pdo_state_error( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ ) { } @@ -752,9 +752,9 @@ /** State: END. */ void ec_fsm_pdo_state_end( - ec_fsm_pdo_t *fsm /**< Pdo configuration state machine. */ - ) -{ -} - -/*****************************************************************************/ + ec_fsm_pdo_t *fsm /**< PDO configuration state machine. */ + ) +{ +} + +/*****************************************************************************/ diff -r 399ef727bf62 -r e206f4485f60 master/fsm_pdo.h --- a/master/fsm_pdo.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fsm_pdo.h Mon Dec 29 15:19:16 2008 +0000 @@ -26,7 +26,7 @@ /** \file - EtherCAT Pdo configuration state machine structures. + EtherCAT PDO configuration state machine structures. */ /*****************************************************************************/ @@ -48,23 +48,23 @@ */ typedef struct ec_fsm_pdo ec_fsm_pdo_t; -/** Pdo configuration state machine. +/** PDO configuration state machine. */ struct ec_fsm_pdo { void (*state)(ec_fsm_pdo_t *); /**< State function. */ ec_fsm_coe_t *fsm_coe; /**< CoE state machine to use. */ - ec_fsm_pdo_entry_t fsm_pdo_entry; /**< Pdo entry state machine. */ - ec_pdo_list_t pdos; /**< Pdo configuration. */ - ec_sdo_request_t request; /**< Sdo request. */ - ec_pdo_t slave_pdo; /**< Pdo actually appearing in a slave. */ + ec_fsm_pdo_entry_t fsm_pdo_entry; /**< PDO entry state machine. */ + ec_pdo_list_t pdos; /**< PDO configuration. */ + ec_sdo_request_t request; /**< SDO request. */ + ec_pdo_t slave_pdo; /**< PDO actually appearing in a slave. */ ec_slave_t *slave; /**< Slave the FSM runs on. */ uint8_t sync_index; /**< Current sync manager index. */ ec_sync_t *sync; /**< Current sync manager. */ - ec_pdo_t *pdo; /**< Current Pdo. */ - unsigned int pdo_pos; /**< Assignment position of current Pdos. */ - unsigned int pdo_count; /**< Number of assigned Pdos. */ + ec_pdo_t *pdo; /**< Current PDO. */ + unsigned int pdo_pos; /**< Assignment position of current PDOs. */ + unsigned int pdo_count; /**< Number of assigned PDOs. */ }; /*****************************************************************************/ diff -r 399ef727bf62 -r e206f4485f60 master/fsm_pdo_entry.c --- a/master/fsm_pdo_entry.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fsm_pdo_entry.c Mon Dec 29 15:19:16 2008 +0000 @@ -25,7 +25,7 @@ *****************************************************************************/ /** \file - * EtherCAT Pdo mapping state machine. + * EtherCAT PDO mapping state machine. */ /*****************************************************************************/ @@ -60,7 +60,7 @@ /** Constructor. */ void ec_fsm_pdo_entry_init( - ec_fsm_pdo_entry_t *fsm, /**< Pdo mapping state machine. */ + ec_fsm_pdo_entry_t *fsm, /**< PDO mapping state machine. */ ec_fsm_coe_t *fsm_coe /**< CoE state machine to use. */ ) { @@ -73,7 +73,7 @@ /** Destructor. */ void ec_fsm_pdo_entry_clear( - ec_fsm_pdo_entry_t *fsm /**< Pdo mapping state machine. */ + ec_fsm_pdo_entry_t *fsm /**< PDO mapping state machine. */ ) { ec_sdo_request_clear(&fsm->request); @@ -81,12 +81,12 @@ /*****************************************************************************/ -/** Start reading a Pdo's entries. +/** Start reading a PDO's entries. */ void ec_fsm_pdo_entry_start_reading( - ec_fsm_pdo_entry_t *fsm, /**< Pdo mapping state machine. */ + ec_fsm_pdo_entry_t *fsm, /**< PDO mapping state machine. */ ec_slave_t *slave, /**< slave to configure */ - ec_pdo_t *pdo /**< Pdo to read entries for. */ + ec_pdo_t *pdo /**< PDO to read entries for. */ ) { fsm->slave = slave; @@ -99,12 +99,12 @@ /*****************************************************************************/ -/** Start Pdo mapping state machine. +/** Start PDO mapping state machine. */ void ec_fsm_pdo_entry_start_configuration( - ec_fsm_pdo_entry_t *fsm, /**< Pdo mapping state machine. */ + ec_fsm_pdo_entry_t *fsm, /**< PDO mapping state machine. */ ec_slave_t *slave, /**< slave to configure */ - const ec_pdo_t *pdo /**< Pdo with the desired entries. */ + const ec_pdo_t *pdo /**< PDO with the desired entries. */ ) { fsm->slave = slave; @@ -120,7 +120,7 @@ * \return false, if state machine has terminated */ int ec_fsm_pdo_entry_running( - const ec_fsm_pdo_entry_t *fsm /**< Pdo mapping state machine. */ + const ec_fsm_pdo_entry_t *fsm /**< PDO mapping state machine. */ ) { return fsm->state != ec_fsm_pdo_entry_state_end @@ -134,7 +134,7 @@ * \return false, if state machine has terminated */ int ec_fsm_pdo_entry_exec( - ec_fsm_pdo_entry_t *fsm /**< Pdo mapping state machine. */ + ec_fsm_pdo_entry_t *fsm /**< PDO mapping state machine. */ ) { fsm->state(fsm); @@ -148,7 +148,7 @@ * \return true, if the state machine terminated gracefully */ int ec_fsm_pdo_entry_success( - const ec_fsm_pdo_entry_t *fsm /**< Pdo mapping state machine. */ + const ec_fsm_pdo_entry_t *fsm /**< PDO mapping state machine. */ ) { return fsm->state == ec_fsm_pdo_entry_state_end; @@ -158,10 +158,10 @@ * Reading state functions. *****************************************************************************/ -/** Request reading the number of mapped Pdo entries. +/** Request reading the number of mapped PDO entries. */ void ec_fsm_pdo_entry_read_state_start( - ec_fsm_pdo_entry_t *fsm /**< Pdo mapping state machine. */ + ec_fsm_pdo_entry_t *fsm /**< PDO mapping state machine. */ ) { ec_sdo_request_address(&fsm->request, fsm->target_pdo->index, 0); @@ -174,7 +174,7 @@ /*****************************************************************************/ -/** Read number of mapped Pdo entries. +/** Read number of mapped PDO entries. */ void ec_fsm_pdo_entry_read_state_count( ec_fsm_pdo_entry_t *fsm /**< finite state machine */ @@ -184,13 +184,13 @@ return; if (!ec_fsm_coe_success(fsm->fsm_coe)) { - EC_ERR("Failed to read number of mapped Pdo entries.\n"); + EC_ERR("Failed to read number of mapped PDO entries.\n"); fsm->state = ec_fsm_pdo_entry_state_error; return; } if (fsm->request.data_size != sizeof(uint8_t)) { - EC_ERR("Invalid data size %u at uploading Sdo 0x%04X:%02X.\n", + EC_ERR("Invalid data size %u at uploading SDO 0x%04X:%02X.\n", fsm->request.data_size, fsm->request.index, fsm->request.subindex); fsm->state = ec_fsm_pdo_entry_state_error; @@ -200,16 +200,16 @@ fsm->entry_count = EC_READ_U8(fsm->request.data); if (fsm->slave->master->debug_level) - EC_DBG("%u Pdo entries mapped.\n", fsm->entry_count); - - // read first Pdo entry + EC_DBG("%u PDO entries mapped.\n", fsm->entry_count); + + // read first PDO entry fsm->entry_pos = 1; ec_fsm_pdo_entry_read_action_next(fsm); } /*****************************************************************************/ -/** Read next Pdo entry. +/** Read next PDO entry. */ void ec_fsm_pdo_entry_read_action_next( ec_fsm_pdo_entry_t *fsm /**< finite state machine */ @@ -230,7 +230,7 @@ /*****************************************************************************/ -/** Read Pdo entry information. +/** Read PDO entry information. */ void ec_fsm_pdo_entry_read_state_entry( ec_fsm_pdo_entry_t *fsm /**< finite state machine */ @@ -239,13 +239,13 @@ if (ec_fsm_coe_exec(fsm->fsm_coe)) return; if (!ec_fsm_coe_success(fsm->fsm_coe)) { - EC_ERR("Failed to read mapped Pdo entry.\n"); + EC_ERR("Failed to read mapped PDO entry.\n"); fsm->state = ec_fsm_pdo_entry_state_error; return; } if (fsm->request.data_size != sizeof(uint32_t)) { - EC_ERR("Invalid data size %u at uploading Sdo 0x%04X:%02X.\n", + EC_ERR("Invalid data size %u at uploading SDO 0x%04X:%02X.\n", fsm->request.data_size, fsm->request.index, fsm->request.subindex); fsm->state = ec_fsm_pdo_entry_state_error; @@ -257,7 +257,7 @@ if (!(pdo_entry = (ec_pdo_entry_t *) kmalloc(sizeof(ec_pdo_entry_t), GFP_KERNEL))) { - EC_ERR("Failed to allocate Pdo entry.\n"); + EC_ERR("Failed to allocate PDO entry.\n"); fsm->state = ec_fsm_pdo_entry_state_error; return; } @@ -277,7 +277,7 @@ } if (fsm->slave->master->debug_level) { - EC_DBG("Pdo entry 0x%04X:%02X, %u bit, \"%s\".\n", + EC_DBG("PDO entry 0x%04X:%02X, %u bit, \"%s\".\n", pdo_entry->index, pdo_entry->subindex, pdo_entry->bit_length, pdo_entry->name ? pdo_entry->name : "???"); @@ -285,7 +285,7 @@ list_add_tail(&pdo_entry->list, &fsm->target_pdo->entries); - // next Pdo entry + // next PDO entry fsm->entry_pos++; ec_fsm_pdo_entry_read_action_next(fsm); } @@ -295,17 +295,17 @@ * Configuration state functions. *****************************************************************************/ -/** Start Pdo mapping. +/** Start PDO mapping. */ void ec_fsm_pdo_entry_conf_state_start( - ec_fsm_pdo_entry_t *fsm /**< Pdo mapping state machine. */ - ) -{ - // Pdo mapping has to be changed. Does the slave support this? + ec_fsm_pdo_entry_t *fsm /**< PDO mapping state machine. */ + ) +{ + // PDO mapping has to be changed. Does the slave support this? if (!(fsm->slave->sii.mailbox_protocols & EC_MBOX_COE) || (fsm->slave->sii.has_general && !fsm->slave->sii.coe_details.enable_pdo_configuration)) { - EC_WARN("Slave %u does not support changing the Pdo mapping!\n", + EC_WARN("Slave %u does not support changing the PDO mapping!\n", fsm->slave->ring_position); fsm->state = ec_fsm_pdo_entry_state_error; return; @@ -316,7 +316,7 @@ return; } - // set mapped Pdo entry count to zero + // set mapped PDO entry count to zero EC_WRITE_U8(fsm->request.data, 0); fsm->request.data_size = 1; ec_sdo_request_address(&fsm->request, fsm->source_pdo->index, 0); @@ -332,10 +332,10 @@ /*****************************************************************************/ -/** Process next Pdo entry. +/** Process next PDO entry. */ ec_pdo_entry_t *ec_fsm_pdo_entry_conf_next_entry( - const ec_fsm_pdo_entry_t *fsm, /**< Pdo mapping state machine. */ + const ec_fsm_pdo_entry_t *fsm, /**< PDO mapping state machine. */ const struct list_head *list /**< current entry list item */ ) { @@ -350,14 +350,14 @@ /** Set the number of mapped entries to zero. */ void ec_fsm_pdo_entry_conf_state_zero_entry_count( - ec_fsm_pdo_entry_t *fsm /**< Pdo mapping state machine. */ + ec_fsm_pdo_entry_t *fsm /**< PDO mapping state machine. */ ) { if (ec_fsm_coe_exec(fsm->fsm_coe)) return; if (!ec_fsm_coe_success(fsm->fsm_coe)) { - EC_WARN("Failed to clear Pdo mapping.\n"); + EC_WARN("Failed to clear PDO mapping.\n"); fsm->state = ec_fsm_pdo_entry_state_error; return; } @@ -380,16 +380,16 @@ /*****************************************************************************/ -/** Starts to add a Pdo entry. +/** Starts to add a PDO entry. */ void ec_fsm_pdo_entry_conf_action_map( - ec_fsm_pdo_entry_t *fsm /**< Pdo mapping state machine. */ + ec_fsm_pdo_entry_t *fsm /**< PDO mapping state machine. */ ) { uint32_t value; if (fsm->slave->master->debug_level) - EC_DBG("Mapping Pdo entry 0x%04X:%02X (%u bit) at position %u.\n", + EC_DBG("Mapping PDO entry 0x%04X:%02X (%u bit) at position %u.\n", fsm->entry->index, fsm->entry->subindex, fsm->entry->bit_length, fsm->entry_pos); @@ -407,16 +407,16 @@ /*****************************************************************************/ -/** Add a Pdo entry. +/** Add a PDO entry. */ void ec_fsm_pdo_entry_conf_state_map_entry( - ec_fsm_pdo_entry_t *fsm /**< Pdo mapping state machine. */ + ec_fsm_pdo_entry_t *fsm /**< PDO mapping state machine. */ ) { if (ec_fsm_coe_exec(fsm->fsm_coe)) return; if (!ec_fsm_coe_success(fsm->fsm_coe)) { - EC_WARN("Failed to map Pdo entry 0x%04X:%02X (%u bit) to " + EC_WARN("Failed to map PDO entry 0x%04X:%02X (%u bit) to " "position %u.\n", fsm->entry->index, fsm->entry->subindex, fsm->entry->bit_length, fsm->entry_pos); fsm->state = ec_fsm_pdo_entry_state_error; @@ -434,7 +434,7 @@ ecrt_sdo_request_write(&fsm->request); if (fsm->slave->master->debug_level) - EC_DBG("Setting number of Pdo entries to %u.\n", fsm->entry_pos); + EC_DBG("Setting number of PDO entries to %u.\n", fsm->entry_pos); fsm->state = ec_fsm_pdo_entry_conf_state_set_entry_count; ec_fsm_coe_transfer(fsm->fsm_coe, fsm->slave, &fsm->request); @@ -452,7 +452,7 @@ /** Set the number of entries. */ void ec_fsm_pdo_entry_conf_state_set_entry_count( - ec_fsm_pdo_entry_t *fsm /**< Pdo mapping state machine. */ + ec_fsm_pdo_entry_t *fsm /**< PDO mapping state machine. */ ) { if (ec_fsm_coe_exec(fsm->fsm_coe)) return; @@ -464,7 +464,7 @@ } if (fsm->slave->master->debug_level) - EC_DBG("Successfully configured mapping for Pdo 0x%04X.\n", + EC_DBG("Successfully configured mapping for PDO 0x%04X.\n", fsm->source_pdo->index); fsm->state = ec_fsm_pdo_entry_state_end; // finished @@ -477,7 +477,7 @@ /** State: ERROR. */ void ec_fsm_pdo_entry_state_error( - ec_fsm_pdo_entry_t *fsm /**< Pdo mapping state machine. */ + ec_fsm_pdo_entry_t *fsm /**< PDO mapping state machine. */ ) { } @@ -487,9 +487,9 @@ /** State: END. */ void ec_fsm_pdo_entry_state_end( - ec_fsm_pdo_entry_t *fsm /**< Pdo mapping state machine. */ - ) -{ -} - -/*****************************************************************************/ + ec_fsm_pdo_entry_t *fsm /**< PDO mapping state machine. */ + ) +{ +} + +/*****************************************************************************/ diff -r 399ef727bf62 -r e206f4485f60 master/fsm_pdo_entry.h --- a/master/fsm_pdo_entry.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fsm_pdo_entry.h Mon Dec 29 15:19:16 2008 +0000 @@ -25,7 +25,7 @@ *****************************************************************************/ /** \file - * EtherCAT Pdo entry configuration state machine structures. + * EtherCAT PDO entry configuration state machine structures. */ /*****************************************************************************/ @@ -45,20 +45,20 @@ */ typedef struct ec_fsm_pdo_entry ec_fsm_pdo_entry_t; -/** Pdo configuration state machine. +/** PDO configuration state machine. */ struct ec_fsm_pdo_entry { void (*state)(ec_fsm_pdo_entry_t *); /**< state function */ ec_fsm_coe_t *fsm_coe; /**< CoE state machine to use */ - ec_sdo_request_t request; /**< Sdo request. */ + ec_sdo_request_t request; /**< SDO request. */ ec_slave_t *slave; /**< Slave the FSM runs on. */ - ec_pdo_t *target_pdo; /**< Pdo to read the mapping for. */ - const ec_pdo_t *source_pdo; /**< Pdo with desired mapping. */ + ec_pdo_t *target_pdo; /**< PDO to read the mapping for. */ + const ec_pdo_t *source_pdo; /**< PDO with desired mapping. */ const ec_pdo_entry_t *entry; /**< Current entry. */ unsigned int entry_count; /**< Number of entries. */ - unsigned int entry_pos; /**< Position in Pdo mapping. */ + unsigned int entry_pos; /**< Position in PDO mapping. */ }; /*****************************************************************************/ diff -r 399ef727bf62 -r e206f4485f60 master/fsm_slave_config.c --- a/master/fsm_slave_config.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fsm_slave_config.c Mon Dec 29 15:19:16 2008 +0000 @@ -74,7 +74,7 @@ ec_datagram_t *datagram, /**< datagram structure to use */ ec_fsm_change_t *fsm_change, /**< State change state machine to use. */ ec_fsm_coe_t *fsm_coe, /**< CoE state machine to use. */ - ec_fsm_pdo_t *fsm_pdo /**< Pdo configuration state machine to use. */ + ec_fsm_pdo_t *fsm_pdo /**< PDO configuration state machine to use. */ ) { ec_sdo_request_init(&fsm->request_copy); @@ -437,7 +437,7 @@ /*****************************************************************************/ -/** Check for Sdo configurations to be applied. +/** Check for SDO configurations to be applied. */ void ec_fsm_slave_config_enter_sdo_conf( ec_fsm_slave_config_t *fsm /**< slave state machine */ @@ -446,12 +446,12 @@ ec_slave_t *slave = fsm->slave; // No CoE configuration to be applied? - if (list_empty(&slave->config->sdo_configs)) { // skip Sdo configuration + if (list_empty(&slave->config->sdo_configs)) { // skip SDO configuration ec_fsm_slave_config_enter_pdo_conf(fsm); return; } - // start Sdo configuration + // start SDO configuration fsm->state = ec_fsm_slave_config_state_sdo_conf; fsm->request = list_entry(fsm->slave->config->sdo_configs.next, ec_sdo_request_t, list); @@ -472,7 +472,7 @@ if (ec_fsm_coe_exec(fsm->fsm_coe)) return; if (!ec_fsm_coe_success(fsm->fsm_coe)) { - EC_ERR("Sdo configuration failed for slave %u.\n", + EC_ERR("SDO configuration failed for slave %u.\n", fsm->slave->ring_position); fsm->slave->error_flag = 1; fsm->state = ec_fsm_slave_config_state_error; @@ -484,7 +484,7 @@ return; } - // Another Sdo to configure? + // Another SDO to configure? if (fsm->request->list.next != &fsm->slave->config->sdo_configs) { fsm->request = list_entry(fsm->request->list.next, ec_sdo_request_t, list); @@ -495,7 +495,7 @@ return; } - // All Sdos are now configured. + // All SDOs are now configured. ec_fsm_slave_config_enter_pdo_conf(fsm); } @@ -507,7 +507,7 @@ ec_fsm_slave_config_t *fsm /**< slave state machine */ ) { - // Start configuring Pdos + // Start configuring PDOs ec_fsm_pdo_start_configuration(fsm->fsm_pdo, fsm->slave); fsm->state = ec_fsm_slave_config_state_pdo_conf; fsm->state(fsm); // execute immediately @@ -530,7 +530,7 @@ } if (!ec_fsm_pdo_success(fsm->fsm_pdo)) { - EC_WARN("Pdo configuration failed on slave %u.\n", + EC_WARN("PDO configuration failed on slave %u.\n", fsm->slave->ring_position); } @@ -539,7 +539,7 @@ /*****************************************************************************/ -/** Check for Pdo sync managers to be configured. +/** Check for PDO sync managers to be configured. */ void ec_fsm_slave_config_enter_pdo_sync( ec_fsm_slave_config_t *fsm /**< slave state machine */ @@ -560,7 +560,7 @@ } if (slave->sii.sync_count <= offset) { - // no Pdo sync managers to configure + // no PDO sync managers to configure ec_fsm_slave_config_enter_fmmu(fsm); return; } @@ -588,7 +588,7 @@ /*****************************************************************************/ -/** Configure Pdo sync managers. +/** Configure PDO sync managers. */ void ec_fsm_slave_config_state_pdo_sync( ec_fsm_slave_config_t *fsm /**< slave state machine */ @@ -662,7 +662,7 @@ if (!(sync = ec_slave_get_sync(slave, fmmu->sync_index))) { slave->error_flag = 1; fsm->state = ec_fsm_slave_config_state_error; - EC_ERR("Failed to determine Pdo sync manager for FMMU on slave" + EC_ERR("Failed to determine PDO sync manager for FMMU on slave" " %u!\n", slave->ring_position); return; } diff -r 399ef727bf62 -r e206f4485f60 master/fsm_slave_config.h --- a/master/fsm_slave_config.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fsm_slave_config.h Mon Dec 29 15:19:16 2008 +0000 @@ -55,13 +55,13 @@ ec_datagram_t *datagram; /**< Datagram used in the state machine. */ ec_fsm_change_t *fsm_change; /**< State change state machine. */ ec_fsm_coe_t *fsm_coe; /**< CoE state machine. */ - ec_fsm_pdo_t *fsm_pdo; /**< Pdo configuration state machine. */ + ec_fsm_pdo_t *fsm_pdo; /**< PDO configuration state machine. */ ec_slave_t *slave; /**< Slave the FSM runs on. */ void (*state)(ec_fsm_slave_config_t *); /**< State function. */ unsigned int retries; /**< Retries on datagram timeout. */ - ec_sdo_request_t *request; /**< Sdo request for Sdo configuration. */ - ec_sdo_request_t request_copy; /**< Copied Sdo request. */ + ec_sdo_request_t *request; /**< SDO request for SDO configuration. */ + ec_sdo_request_t request_copy; /**< Copied SDO request. */ }; /*****************************************************************************/ diff -r 399ef727bf62 -r e206f4485f60 master/fsm_slave_scan.c --- a/master/fsm_slave_scan.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fsm_slave_scan.c Mon Dec 29 15:19:16 2008 +0000 @@ -65,7 +65,7 @@ ec_datagram_t *datagram, /**< Datagram to use. */ ec_fsm_slave_config_t *fsm_slave_config, /**< Slave configuration state machine to use. */ - ec_fsm_pdo_t *fsm_pdo /**< Pdo configuration machine to use. */ + ec_fsm_pdo_t *fsm_pdo /**< PDO configuration machine to use. */ ) { fsm->datagram = datagram; @@ -533,12 +533,12 @@ break; case 0x0032: if (ec_slave_fetch_sii_pdos( slave, (uint8_t *) cat_word, - cat_size * 2, EC_DIR_INPUT)) // TxPdo + cat_size * 2, EC_DIR_INPUT)) // TxPDO goto end; break; case 0x0033: if (ec_slave_fetch_sii_pdos( slave, (uint8_t *) cat_word, - cat_size * 2, EC_DIR_OUTPUT)) // RxPdo + cat_size * 2, EC_DIR_OUTPUT)) // RxPDO goto end; break; default: @@ -622,7 +622,7 @@ ec_slave_t *slave = fsm->slave; if (slave->master->debug_level) - EC_DBG("Scanning Pdo assignment and mapping of slave %u.\n", + EC_DBG("Scanning PDO assignment and mapping of slave %u.\n", slave->ring_position); fsm->state = ec_fsm_slave_scan_state_pdos; ec_fsm_pdo_start_reading(fsm->fsm_pdo, slave); @@ -645,7 +645,7 @@ return; } - // reading Pdo configuration finished + // reading PDO configuration finished fsm->state = ec_fsm_slave_scan_state_end; } diff -r 399ef727bf62 -r e206f4485f60 master/fsm_slave_scan.h --- a/master/fsm_slave_scan.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/fsm_slave_scan.h Mon Dec 29 15:19:16 2008 +0000 @@ -57,7 +57,7 @@ ec_datagram_t *datagram; /**< Datagram used in the state machine. */ ec_fsm_slave_config_t *fsm_slave_config; /**< Slave configuration state machine to use. */ - ec_fsm_pdo_t *fsm_pdo; /**< Pdo configuration state machine to use. */ + ec_fsm_pdo_t *fsm_pdo; /**< PDO configuration state machine to use. */ unsigned int retries; /**< Retries on datagram timeout. */ void (*state)(ec_fsm_slave_scan_t *); /**< State function. */ diff -r 399ef727bf62 -r e206f4485f60 master/globals.h --- a/master/globals.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/globals.h Mon Dec 29 15:19:16 2008 +0000 @@ -50,7 +50,7 @@ /** Number of state machine retries on datagram timeout. */ #define EC_FSM_RETRIES 3 -/** Seconds to wait before fetching Sdo dictionary +/** Seconds to wait before fetching SDO dictionary after slave entered PREOP state. */ #define EC_WAIT_SDO_DICT 3 @@ -122,21 +122,21 @@ /** Supported mailbox protocols. */ enum { - EC_MBOX_AOE = 0x01, /**< ADS-over-EtherCAT */ - EC_MBOX_EOE = 0x02, /**< Ethernet-over-EtherCAT */ - EC_MBOX_COE = 0x04, /**< CANopen-over-EtherCAT */ - EC_MBOX_FOE = 0x08, /**< File-Access-over-EtherCAT */ - EC_MBOX_SOE = 0x10, /**< Servo-Profile-over-EtherCAT */ + EC_MBOX_AOE = 0x01, /**< ADS over EtherCAT */ + EC_MBOX_EOE = 0x02, /**< Ethernet over EtherCAT */ + EC_MBOX_COE = 0x04, /**< CANopen over EtherCAT */ + EC_MBOX_FOE = 0x08, /**< File-Access over EtherCAT */ + EC_MBOX_SOE = 0x10, /**< Servo-Profile over EtherCAT */ EC_MBOX_VOE = 0x20 /**< Vendor specific */ }; -/** Slave information interface CANopen-over-EtherCAT details flags. +/** Slave information interface CANopen over EtherCAT details flags. */ typedef struct { - uint8_t enable_sdo : 1; /**< Enable Sdo access. */ + uint8_t enable_sdo : 1; /**< Enable SDO access. */ uint8_t enable_sdo_info : 1; /**< SDO information service available. */ - uint8_t enable_pdo_assign : 1; /**< Pdo mapping configurable. */ - uint8_t enable_pdo_configuration : 1; /**< Pdo configuration possible. */ + uint8_t enable_pdo_assign : 1; /**< PDO mapping configurable. */ + uint8_t enable_pdo_configuration : 1; /**< PDO configuration possible. */ uint8_t enable_upload_at_startup : 1; /**< ?. */ uint8_t enable_sdo_complete_access : 1; /**< Complete access possible. */ } ec_sii_coe_details_t; diff -r 399ef727bf62 -r e206f4485f60 master/master.c --- a/master/master.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/master.c Mon Dec 29 15:19:16 2008 +0000 @@ -942,7 +942,7 @@ /*****************************************************************************/ #ifdef EC_EOE -/** Starts Ethernet-over-EtherCAT processing on demand. +/** Starts Ethernet over EtherCAT processing on demand. */ void ec_master_eoe_start(ec_master_t *master /**< EtherCAT master */) { @@ -969,7 +969,7 @@ /*****************************************************************************/ -/** Stops the Ethernet-over-EtherCAT processing. +/** Stops the Ethernet over EtherCAT processing. */ void ec_master_eoe_stop(ec_master_t *master /**< EtherCAT master */) { @@ -983,7 +983,7 @@ /*****************************************************************************/ -/** Does the Ethernet-over-EtherCAT processing. +/** Does the Ethernet over EtherCAT processing. */ void ec_master_eoe_run(unsigned long data /**< master pointer */) { diff -r 399ef727bf62 -r e206f4485f60 master/master.h --- a/master/master.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/master.h Mon Dec 29 15:19:16 2008 +0000 @@ -133,7 +133,7 @@ #ifdef EC_EOE struct timer_list eoe_timer; /**< EoE timer object. */ unsigned int eoe_running; /**< \a True, if EoE processing is active. */ - struct list_head eoe_handlers; /**< Ethernet-over-EtherCAT handlers. */ + struct list_head eoe_handlers; /**< Ethernet over EtherCAT handlers. */ #endif spinlock_t internal_lock; /**< Spinlock used in \a IDLE phase. */ @@ -148,8 +148,8 @@ wait_queue_head_t sii_queue; /**< Wait queue for SII write requests from user space. */ - struct list_head slave_sdo_requests; /**< Sdo access requests. */ - wait_queue_head_t sdo_queue; /**< Wait queue for Sdo access requests + struct list_head slave_sdo_requests; /**< SDO access requests. */ + wait_queue_head_t sdo_queue; /**< Wait queue for SDO access requests from user space. */ }; diff -r 399ef727bf62 -r e206f4485f60 master/pdo.c --- a/master/pdo.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/pdo.c Mon Dec 29 15:19:16 2008 +0000 @@ -37,10 +37,10 @@ /*****************************************************************************/ -/** Pdo constructor. +/** PDO constructor. */ void ec_pdo_init( - ec_pdo_t *pdo /**< EtherCAT Pdo */ + ec_pdo_t *pdo /**< EtherCAT PDO */ ) { pdo->sync_index = -1; // not assigned @@ -50,7 +50,7 @@ /*****************************************************************************/ -/** Pdo copy constructor. +/** PDO copy constructor. */ int ec_pdo_init_copy(ec_pdo_t *pdo, const ec_pdo_t *other_pdo) { @@ -75,9 +75,9 @@ /*****************************************************************************/ -/** Pdo destructor. - */ -void ec_pdo_clear(ec_pdo_t *pdo /**< EtherCAT Pdo. */) +/** PDO destructor. + */ +void ec_pdo_clear(ec_pdo_t *pdo /**< EtherCAT PDO. */) { if (pdo->name) kfree(pdo->name); @@ -87,13 +87,13 @@ /*****************************************************************************/ -/** Clear Pdo entry list. - */ -void ec_pdo_clear_entries(ec_pdo_t *pdo /**< EtherCAT Pdo. */) +/** Clear PDO entry list. + */ +void ec_pdo_clear_entries(ec_pdo_t *pdo /**< EtherCAT PDO. */) { ec_pdo_entry_t *entry, *next; - // free all Pdo entries + // free all PDO entries list_for_each_entry_safe(entry, next, &pdo->entries, list) { list_del(&entry->list); ec_pdo_entry_clear(entry); @@ -103,10 +103,10 @@ /*****************************************************************************/ -/** Set Pdo name. +/** Set PDO name. */ int ec_pdo_set_name( - ec_pdo_t *pdo, /**< Pdo. */ + ec_pdo_t *pdo, /**< PDO. */ const char *name /**< New name. */ ) { @@ -120,7 +120,7 @@ if (name && (len = strlen(name))) { if (!(pdo->name = (char *) kmalloc(len + 1, GFP_KERNEL))) { - EC_ERR("Failed to allocate Pdo name.\n"); + EC_ERR("Failed to allocate PDO name.\n"); return -1; } memcpy(pdo->name, name, len + 1); @@ -133,7 +133,7 @@ /*****************************************************************************/ -/** Add a new Pdo entry to the configuration. +/** Add a new PDO entry to the configuration. */ ec_pdo_entry_t *ec_pdo_add_entry( ec_pdo_t *pdo, @@ -145,7 +145,7 @@ ec_pdo_entry_t *entry; if (!(entry = kmalloc(sizeof(ec_pdo_entry_t), GFP_KERNEL))) { - EC_ERR("Failed to allocate memory for Pdo entry.\n"); + EC_ERR("Failed to allocate memory for PDO entry.\n"); return NULL; } @@ -159,7 +159,7 @@ /*****************************************************************************/ -/** Copy Pdo entries from another Pdo. +/** Copy PDO entries from another PDO. */ int ec_pdo_copy_entries(ec_pdo_t *pdo, const ec_pdo_t *other) { @@ -170,7 +170,7 @@ list_for_each_entry(other_entry, &other->entries, list) { if (!(entry = (ec_pdo_entry_t *) kmalloc(sizeof(ec_pdo_entry_t), GFP_KERNEL))) { - EC_ERR("Failed to allocate memory for Pdo entry copy.\n"); + EC_ERR("Failed to allocate memory for PDO entry copy.\n"); return -1; } @@ -187,14 +187,14 @@ /*****************************************************************************/ -/** Compares the entries of two Pdos. - * - * \retval 1 The entries of the given Pdos are equal. - * \retval 0 The entries of the given Pdos differ. +/** Compares the entries of two PDOs. + * + * \retval 1 The entries of the given PDOs are equal. + * \retval 0 The entries of the given PDOs differ. */ int ec_pdo_equal_entries( - const ec_pdo_t *pdo1, /**< First Pdo. */ - const ec_pdo_t *pdo2 /**< Second Pdo. */ + const ec_pdo_t *pdo1, /**< First PDO. */ + const ec_pdo_t *pdo2 /**< Second PDO. */ ) { const struct list_head *head1, *head2, *item1, *item2; @@ -223,12 +223,12 @@ /*****************************************************************************/ -/** Get the number of Pdo entries. - * - * \return Number of Pdo entries. +/** Get the number of PDO entries. + * + * \return Number of PDO entries. */ unsigned int ec_pdo_entry_count( - const ec_pdo_t *pdo /**< Pdo. */ + const ec_pdo_t *pdo /**< PDO. */ ) { const ec_pdo_entry_t *entry; @@ -243,12 +243,12 @@ /*****************************************************************************/ -/** Finds a Pdo entry via its position in the list. +/** Finds a PDO entry via its position in the list. * * Const version. */ const ec_pdo_entry_t *ec_pdo_find_entry_by_pos_const( - const ec_pdo_t *pdo, /**< Pdo. */ + const ec_pdo_t *pdo, /**< PDO. */ unsigned int pos /**< Position in the list. */ ) { diff -r 399ef727bf62 -r e206f4485f60 master/pdo.h --- a/master/pdo.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/pdo.h Mon Dec 29 15:19:16 2008 +0000 @@ -43,14 +43,14 @@ /*****************************************************************************/ -/** Pdo description. +/** PDO description. */ typedef struct { struct list_head list; /**< List item. */ - uint16_t index; /**< Pdo index. */ + uint16_t index; /**< PDO index. */ int8_t sync_index; /**< Assigned sync manager. \todo remove? */ - char *name; /**< Pdo name. */ - struct list_head entries; /**< List of Pdo entries. */ + char *name; /**< PDO name. */ + struct list_head entries; /**< List of PDO entries. */ } ec_pdo_t; /*****************************************************************************/ diff -r 399ef727bf62 -r e206f4485f60 master/pdo_entry.c --- a/master/pdo_entry.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/pdo_entry.c Mon Dec 29 15:19:16 2008 +0000 @@ -37,10 +37,10 @@ /*****************************************************************************/ -/** Pdo entry constructor. +/** PDO entry constructor. */ void ec_pdo_entry_init( - ec_pdo_entry_t *entry /**< Pdo entry. */ + ec_pdo_entry_t *entry /**< PDO entry. */ ) { entry->name = NULL; @@ -48,11 +48,11 @@ /*****************************************************************************/ -/** Pdo entry copy constructor. +/** PDO entry copy constructor. */ int ec_pdo_entry_init_copy( - ec_pdo_entry_t *entry, /**< Pdo entry. */ - const ec_pdo_entry_t *other /**< Pdo entry to copy from. */ + ec_pdo_entry_t *entry, /**< PDO entry. */ + const ec_pdo_entry_t *other /**< PDO entry to copy from. */ ) { entry->index = other->index; @@ -68,9 +68,9 @@ /*****************************************************************************/ -/** Pdo entry destructor. +/** PDO entry destructor. */ -void ec_pdo_entry_clear(ec_pdo_entry_t *entry /**< Pdo entry. */) +void ec_pdo_entry_clear(ec_pdo_entry_t *entry /**< PDO entry. */) { if (entry->name) kfree(entry->name); @@ -78,10 +78,10 @@ /*****************************************************************************/ -/** Set Pdo entry name. +/** Set PDO entry name. */ int ec_pdo_entry_set_name( - ec_pdo_entry_t *entry, /**< Pdo entry. */ + ec_pdo_entry_t *entry, /**< PDO entry. */ const char *name /**< New name. */ ) { @@ -95,7 +95,7 @@ if (name && (len = strlen(name))) { if (!(entry->name = (char *) kmalloc(len + 1, GFP_KERNEL))) { - EC_ERR("Failed to allocate Pdo entry name.\n"); + EC_ERR("Failed to allocate PDO entry name.\n"); return -1; } memcpy(entry->name, name, len + 1); @@ -108,14 +108,14 @@ /*****************************************************************************/ -/** Compares two Pdo entries. +/** Compares two PDO entries. * * \retval 1 The entries are equal. * \retval 0 The entries differ. */ int ec_pdo_entry_equal( - const ec_pdo_entry_t *entry1, /**< First Pdo entry. */ - const ec_pdo_entry_t *entry2 /**< Second Pdo entry. */ + const ec_pdo_entry_t *entry1, /**< First PDO entry. */ + const ec_pdo_entry_t *entry2 /**< Second PDO entry. */ ) { return entry1->index == entry2->index diff -r 399ef727bf62 -r e206f4485f60 master/pdo_entry.h --- a/master/pdo_entry.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/pdo_entry.h Mon Dec 29 15:19:16 2008 +0000 @@ -42,12 +42,12 @@ /*****************************************************************************/ -/** Pdo entry description. +/** PDO entry description. */ typedef struct { struct list_head list; /**< list item */ - uint16_t index; /**< Pdo entry index */ - uint8_t subindex; /**< Pdo entry subindex */ + uint16_t index; /**< PDO entry index */ + uint8_t subindex; /**< PDO entry subindex */ char *name; /**< entry name */ uint8_t bit_length; /**< entry length in bit */ } ec_pdo_entry_t; diff -r 399ef727bf62 -r e206f4485f60 master/pdo_list.c --- a/master/pdo_list.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/pdo_list.c Mon Dec 29 15:19:16 2008 +0000 @@ -26,7 +26,7 @@ /** \file - EtherCAT Pdo list methods. + EtherCAT PDO list methods. */ /*****************************************************************************/ @@ -42,10 +42,10 @@ /*****************************************************************************/ -/** Pdo list constructor. +/** PDO list constructor. */ void ec_pdo_list_init( - ec_pdo_list_t *pl /**< Pdo list. */ + ec_pdo_list_t *pl /**< PDO list. */ ) { INIT_LIST_HEAD(&pl->list); @@ -53,18 +53,18 @@ /*****************************************************************************/ -/** Pdo list destructor. - */ -void ec_pdo_list_clear(ec_pdo_list_t *pl /**< Pdo list. */) +/** PDO list destructor. + */ +void ec_pdo_list_clear(ec_pdo_list_t *pl /**< PDO list. */) { ec_pdo_list_clear_pdos(pl); } /*****************************************************************************/ -/** Clears the list of mapped Pdos. - */ -void ec_pdo_list_clear_pdos(ec_pdo_list_t *pl /**< Pdo list. */) +/** Clears the list of mapped PDOs. + */ +void ec_pdo_list_clear_pdos(ec_pdo_list_t *pl /**< PDO list. */) { ec_pdo_t *pdo, *next; @@ -77,12 +77,12 @@ /*****************************************************************************/ -/** Calculates the total size of the mapped Pdo entries. +/** Calculates the total size of the mapped PDO entries. * * \retval Data size in byte. */ uint16_t ec_pdo_list_total_size( - const ec_pdo_list_t *pl /**< Pdo list. */ + const ec_pdo_list_t *pl /**< PDO list. */ ) { unsigned int bit_size; @@ -107,20 +107,20 @@ /*****************************************************************************/ -/** Add a new Pdo to the list. - * - * \retval >0 Pointer to new Pdo. +/** Add a new PDO to the list. + * + * \retval >0 Pointer to new PDO. * \retval NULL No memory. */ ec_pdo_t *ec_pdo_list_add_pdo( - ec_pdo_list_t *pl, /**< Pdo list. */ - uint16_t index /**< Pdo index. */ + ec_pdo_list_t *pl, /**< PDO list. */ + uint16_t index /**< PDO index. */ ) { ec_pdo_t *pdo; if (!(pdo = (ec_pdo_t *) kmalloc(sizeof(ec_pdo_t), GFP_KERNEL))) { - EC_ERR("Failed to allocate memory for Pdo.\n"); + EC_ERR("Failed to allocate memory for PDO.\n"); return NULL; } @@ -132,26 +132,26 @@ /*****************************************************************************/ -/** Add the copy of an existing Pdo to the list. +/** Add the copy of an existing PDO to the list. * * \return 0 on success, else < 0 */ int ec_pdo_list_add_pdo_copy( - ec_pdo_list_t *pl, /**< Pdo list. */ - const ec_pdo_t *pdo /**< Pdo to add. */ + ec_pdo_list_t *pl, /**< PDO list. */ + const ec_pdo_t *pdo /**< PDO to add. */ ) { ec_pdo_t *mapped_pdo; - // Pdo already mapped? + // PDO already mapped? list_for_each_entry(mapped_pdo, &pl->list, list) { if (mapped_pdo->index != pdo->index) continue; - EC_ERR("Pdo 0x%04X is already mapped!\n", pdo->index); + EC_ERR("PDO 0x%04X is already mapped!\n", pdo->index); return -1; } if (!(mapped_pdo = kmalloc(sizeof(ec_pdo_t), GFP_KERNEL))) { - EC_ERR("Failed to allocate Pdo memory.\n"); + EC_ERR("Failed to allocate PDO memory.\n"); return -1; } @@ -166,20 +166,20 @@ /*****************************************************************************/ -/** Makes a deep copy of another Pdo list. +/** Makes a deep copy of another PDO list. * * \return 0 on success, else < 0 */ int ec_pdo_list_copy( - ec_pdo_list_t *pl, /**< Pdo list. */ - const ec_pdo_list_t *other /**< Pdo list to copy from. */ + ec_pdo_list_t *pl, /**< PDO list. */ + const ec_pdo_list_t *other /**< PDO list to copy from. */ ) { ec_pdo_t *other_pdo; ec_pdo_list_clear_pdos(pl); - // Pdo already mapped? + // PDO already mapped? list_for_each_entry(other_pdo, &other->list, list) { if (ec_pdo_list_add_pdo_copy(pl, other_pdo)) return -1; @@ -190,13 +190,13 @@ /*****************************************************************************/ -/** Compares two Pdo lists. - * - * Only the list is compared, not the Pdo entries (i. e. the Pdo +/** Compares two PDO lists. + * + * Only the list is compared, not the PDO entries (i. e. the PDO * mapping). * - * \retval 1 The given Pdo lists are equal. - * \retval 0 The given Pdo lists differ. + * \retval 1 The given PDO lists are equal. + * \retval 0 The given PDO lists differ. */ int ec_pdo_list_equal( const ec_pdo_list_t *pl1, /**< First list. */ @@ -230,11 +230,11 @@ /*****************************************************************************/ -/** Finds a Pdo with the given index. +/** Finds a PDO with the given index. */ ec_pdo_t *ec_pdo_list_find_pdo( - const ec_pdo_list_t *pl, /**< Pdo list. */ - uint16_t index /**< Pdo index. */ + const ec_pdo_list_t *pl, /**< PDO list. */ + uint16_t index /**< PDO index. */ ) { ec_pdo_t *pdo; @@ -250,11 +250,11 @@ /*****************************************************************************/ -/** Finds a Pdo with the given index and returns a const pointer. +/** Finds a PDO with the given index and returns a const pointer. */ const ec_pdo_t *ec_pdo_list_find_pdo_const( - const ec_pdo_list_t *pl, /**< Pdo list. */ - uint16_t index /**< Pdo index. */ + const ec_pdo_list_t *pl, /**< PDO list. */ + uint16_t index /**< PDO index. */ ) { const ec_pdo_t *pdo; @@ -270,12 +270,12 @@ /*****************************************************************************/ -/** Finds a Pdo via its position in the list. +/** Finds a PDO via its position in the list. * * Const version. */ const ec_pdo_t *ec_pdo_list_find_pdo_by_pos_const( - const ec_pdo_list_t *pl, /**< Pdo list. */ + const ec_pdo_list_t *pl, /**< PDO list. */ unsigned int pos /**< Position in the list. */ ) { @@ -292,12 +292,12 @@ /*****************************************************************************/ -/** Get the number of Pdos in the list. - * - * \return Number of Pdos. +/** Get the number of PDOs in the list. + * + * \return Number of PDOs. */ unsigned int ec_pdo_list_count( - const ec_pdo_list_t *pl /**< Pdo list. */ + const ec_pdo_list_t *pl /**< PDO list. */ ) { const ec_pdo_t *pdo; @@ -312,10 +312,10 @@ /*****************************************************************************/ -/** Outputs the Pdos in the list. +/** Outputs the PDOs in the list. */ void ec_pdo_list_print( - const ec_pdo_list_t *pl /**< Pdo list. */ + const ec_pdo_list_t *pl /**< PDO list. */ ) { const ec_pdo_t *pdo; diff -r 399ef727bf62 -r e206f4485f60 master/pdo_list.h --- a/master/pdo_list.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/pdo_list.h Mon Dec 29 15:19:16 2008 +0000 @@ -26,7 +26,7 @@ /** \file - EtherCAT Pdo list structure. + EtherCAT PDO list structure. */ /*****************************************************************************/ @@ -43,10 +43,10 @@ /*****************************************************************************/ -/** EtherCAT Pdo list. +/** EtherCAT PDO list. */ typedef struct { - struct list_head list; /**< List of Pdos. */ + struct list_head list; /**< List of PDOs. */ } ec_pdo_list_t; /*****************************************************************************/ diff -r 399ef727bf62 -r e206f4485f60 master/sdo.c --- a/master/sdo.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/sdo.c Mon Dec 29 15:19:16 2008 +0000 @@ -26,7 +26,7 @@ /** \file - CANopen Sdo functions. + CANopen SDO functions. */ /*****************************************************************************/ @@ -42,9 +42,9 @@ /** Constructor. */ void ec_sdo_init( - ec_sdo_t *sdo, /**< Sdo. */ + ec_sdo_t *sdo, /**< SDO. */ ec_slave_t *slave, /**< Parent slave. */ - uint16_t index /**< Sdo index. */ + uint16_t index /**< SDO index. */ ) { sdo->slave = slave; @@ -57,12 +57,12 @@ /*****************************************************************************/ -/** Sdo destructor. +/** SDO destructor. * - * Clears and frees an Sdo object. + * Clears and frees an SDO object. */ void ec_sdo_clear( - ec_sdo_t *sdo /**< Sdo. */ + ec_sdo_t *sdo /**< SDO. */ ) { ec_sdo_entry_t *entry, *next; @@ -80,13 +80,13 @@ /*****************************************************************************/ -/** Get an Sdo entry from an Sdo via its subindex. +/** Get an SDO entry from an SDO via its subindex. * - * \retval >0 Pointer to the requested Sdo entry. - * \retval NULL Sdo entry not found. + * \retval >0 Pointer to the requested SDO entry. + * \retval NULL SDO entry not found. */ ec_sdo_entry_t *ec_sdo_get_entry( - ec_sdo_t *sdo, /**< Sdo. */ + ec_sdo_t *sdo, /**< SDO. */ uint8_t subindex /**< Entry subindex. */ ) { @@ -103,15 +103,15 @@ /*****************************************************************************/ -/** Get an Sdo entry from an Sdo via its subindex. +/** Get an SDO entry from an SDO via its subindex. * * const version. * - * \retval >0 Pointer to the requested Sdo entry. - * \retval NULL Sdo entry not found. + * \retval >0 Pointer to the requested SDO entry. + * \retval NULL SDO entry not found. */ const ec_sdo_entry_t *ec_sdo_get_entry_const( - const ec_sdo_t *sdo, /**< Sdo. */ + const ec_sdo_t *sdo, /**< SDO. */ uint8_t subindex /**< Entry subindex. */ ) { diff -r 399ef727bf62 -r e206f4485f60 master/sdo.h --- a/master/sdo.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/sdo.h Mon Dec 29 15:19:16 2008 +0000 @@ -26,7 +26,7 @@ /** \file - EtherCAT CANopen Sdo structure. + EtherCAT CANopen SDO structure. */ /*****************************************************************************/ @@ -41,14 +41,14 @@ /*****************************************************************************/ -/** CANopen Sdo. +/** CANopen SDO. */ struct ec_sdo { struct list_head list; /**< List item. */ ec_slave_t *slave; /**< Parent slave. */ - uint16_t index; /**< Sdo index. */ + uint16_t index; /**< SDO index. */ uint8_t object_code; /**< Object code. */ - char *name; /**< Sdo name. */ + char *name; /**< SDO name. */ uint8_t max_subindex; /**< Maximum subindex. */ struct list_head entries; /**< List of entries. */ }; diff -r 399ef727bf62 -r e206f4485f60 master/sdo_entry.c --- a/master/sdo_entry.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/sdo_entry.c Mon Dec 29 15:19:16 2008 +0000 @@ -26,7 +26,7 @@ /** \file - CANopen-over-EtherCAT Sdo entry functions. + CANopen over EtherCAT SDO entry functions. */ /*****************************************************************************/ @@ -40,8 +40,8 @@ /** Constructor. */ void ec_sdo_entry_init( - ec_sdo_entry_t *entry, /**< Sdo entry. */ - ec_sdo_t *sdo, /**< Parent Sdo. */ + ec_sdo_entry_t *entry, /**< SDO entry. */ + ec_sdo_t *sdo, /**< Parent SDO. */ uint8_t subindex /**< Subindex. */ ) { @@ -57,7 +57,7 @@ /** Destructor. */ void ec_sdo_entry_clear( - ec_sdo_entry_t *entry /**< Sdo entry. */ + ec_sdo_entry_t *entry /**< SDO entry. */ ) { diff -r 399ef727bf62 -r e206f4485f60 master/sdo_entry.h --- a/master/sdo_entry.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/sdo_entry.h Mon Dec 29 15:19:16 2008 +0000 @@ -26,7 +26,7 @@ /** \file - EtherCAT CANopen Sdo entry structure. + EtherCAT CANopen SDO entry structure. */ /*****************************************************************************/ @@ -46,11 +46,11 @@ /*****************************************************************************/ -/** CANopen Sdo entry. +/** CANopen SDO entry. */ typedef struct { struct list_head list; /**< List item. */ - ec_sdo_t *sdo; /**< Parent Sdo. */ + ec_sdo_t *sdo; /**< Parent SDO. */ uint8_t subindex; /**< Subindex. */ uint16_t data_type; /**< Data type. */ uint16_t bit_length; /**< Data size in bit. */ diff -r 399ef727bf62 -r e206f4485f60 master/sdo_request.c --- a/master/sdo_request.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/sdo_request.c Mon Dec 29 15:19:16 2008 +0000 @@ -25,7 +25,7 @@ *****************************************************************************/ /** \file - * Canopen-over-EtherCAT Sdo request functions. + * Canopen over EtherCAT SDO request functions. */ /*****************************************************************************/ @@ -37,7 +37,7 @@ /*****************************************************************************/ -/** Default timeout in ms to wait for Sdo transfer responses. +/** Default timeout in ms to wait for SDO transfer responses. */ #define EC_SDO_REQUEST_RESPONSE_TIMEOUT 3000 @@ -59,10 +59,10 @@ /*****************************************************************************/ -/** Sdo request constructor. +/** SDO request constructor. */ void ec_sdo_request_init( - ec_sdo_request_t *req /**< Sdo request. */ + ec_sdo_request_t *req /**< SDO request. */ ) { req->data = NULL; @@ -77,10 +77,10 @@ /*****************************************************************************/ -/** Sdo request destructor. +/** SDO request destructor. */ void ec_sdo_request_clear( - ec_sdo_request_t *req /**< Sdo request. */ + ec_sdo_request_t *req /**< SDO request. */ ) { ec_sdo_request_clear_data(req); @@ -88,7 +88,7 @@ /*****************************************************************************/ -/** Copy another Sdo request. +/** Copy another SDO request. * * \attention Only the index subindex and data are copied. */ @@ -104,10 +104,10 @@ /*****************************************************************************/ -/** Sdo request destructor. +/** SDO request destructor. */ void ec_sdo_request_clear_data( - ec_sdo_request_t *req /**< Sdo request. */ + ec_sdo_request_t *req /**< SDO request. */ ) { if (req->data) { @@ -121,12 +121,12 @@ /*****************************************************************************/ -/** Set the Sdo address. +/** Set the SDO address. */ void ec_sdo_request_address( - ec_sdo_request_t *req, /**< Sdo request. */ - uint16_t index, /**< Sdo index. */ - uint8_t subindex /**< Sdo subindex. */ + ec_sdo_request_t *req, /**< SDO request. */ + uint16_t index, /**< SDO index. */ + uint8_t subindex /**< SDO subindex. */ ) { req->index = index; @@ -140,7 +140,7 @@ * If the \a mem_size is already bigger than \a size, nothing is done. */ int ec_sdo_request_alloc( - ec_sdo_request_t *req, /**< Sdo request. */ + ec_sdo_request_t *req, /**< SDO request. */ size_t size /**< Data size to allocate. */ ) { @@ -150,7 +150,7 @@ ec_sdo_request_clear_data(req); if (!(req->data = (uint8_t *) kmalloc(size, GFP_KERNEL))) { - EC_ERR("Failed to allocate %u bytes of Sdo memory.\n", size); + EC_ERR("Failed to allocate %u bytes of SDO memory.\n", size); return -1; } @@ -161,12 +161,12 @@ /*****************************************************************************/ -/** Copies Sdo data from an external source. +/** Copies SDO data from an external source. * * If the \a mem_size is to small, new memory is allocated. */ int ec_sdo_request_copy_data( - ec_sdo_request_t *req, /**< Sdo request. */ + ec_sdo_request_t *req, /**< SDO request. */ const uint8_t *source, /**< Source data. */ size_t size /**< Number of bytes in \a source. */ ) @@ -185,7 +185,7 @@ * * \return non-zero if the timeout was exceeded, else zero. */ -int ec_sdo_request_timed_out(const ec_sdo_request_t *req /**< Sdo request. */) +int ec_sdo_request_timed_out(const ec_sdo_request_t *req /**< SDO request. */) { return req->issue_timeout && jiffies - req->jiffies_start > HZ * req->issue_timeout / 1000; diff -r 399ef727bf62 -r e206f4485f60 master/sdo_request.h --- a/master/sdo_request.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/sdo_request.h Mon Dec 29 15:19:16 2008 +0000 @@ -26,7 +26,7 @@ /** \file - EtherCAT CANopen Sdo request structure. + EtherCAT CANopen SDO request structure. */ /*****************************************************************************/ @@ -42,15 +42,15 @@ /*****************************************************************************/ -/** CANopen Sdo request. +/** CANopen SDO request. */ struct ec_sdo_request { struct list_head list; /**< List item. */ - uint16_t index; /**< Sdo index. */ - uint8_t subindex; /**< Sdo subindex. */ - uint8_t *data; /**< Pointer to Sdo data. */ - size_t mem_size; /**< Size of Sdo data memory. */ - size_t data_size; /**< Size of Sdo data. */ + uint16_t index; /**< SDO index. */ + uint8_t subindex; /**< SDO subindex. */ + uint8_t *data; /**< Pointer to SDO data. */ + size_t mem_size; /**< Size of SDO data memory. */ + size_t data_size; /**< Size of SDO data. */ uint32_t issue_timeout; /**< Maximum time in ms, the processing of the request may take. */ uint32_t response_timeout; /**< Maximum time in ms, the transfer is @@ -58,11 +58,11 @@ ec_direction_t dir; /**< Direction. EC_DIR_OUTPUT means downloading to the slave, EC_DIR_INPUT means uploading from the slave. */ - ec_request_state_t state; /**< Sdo request state. */ + ec_request_state_t state; /**< SDO request state. */ unsigned long jiffies_start; /**< Jiffies, when the request was issued. */ unsigned long jiffies_sent; /**< Jiffies, when the upload/download request was sent. */ - uint32_t abort_code; /**< Sdo request abort code. Zero on success. */ + uint32_t abort_code; /**< SDO request abort code. Zero on success. */ }; /*****************************************************************************/ diff -r 399ef727bf62 -r e206f4485f60 master/slave.c --- a/master/slave.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/slave.c Mon Dec 29 15:19:16 2008 +0000 @@ -140,7 +140,7 @@ if (slave->config) ec_slave_config_detach(slave->config); - // free all Sdos + // free all SDOs list_for_each_entry_safe(sdo, next_sdo, &slave->sdo_dictionary, list) { list_del(&sdo->list); ec_sdo_clear(sdo); @@ -157,7 +157,7 @@ // free all sync managers ec_slave_clear_sync_managers(slave); - // free all SII Pdos + // free all SII PDOs list_for_each_entry_safe(pdo, next_pdo, &slave->sii.pdos, list) { list_del(&pdo->list); ec_pdo_clear(pdo); @@ -396,7 +396,7 @@ /*****************************************************************************/ /** - Fetches data from a [RT]XPdo category. + Fetches data from a [RT]xPDO category. \return 0 in case of success, else < 0 */ @@ -404,7 +404,7 @@ ec_slave_t *slave, /**< EtherCAT slave */ const uint8_t *data, /**< category data */ size_t data_size, /**< number of bytes */ - ec_direction_t dir /**< Pdo direction. */ + ec_direction_t dir /**< PDO direction. */ ) { ec_pdo_t *pdo; @@ -413,7 +413,7 @@ while (data_size >= 8) { if (!(pdo = kmalloc(sizeof(ec_pdo_t), GFP_KERNEL))) { - EC_ERR("Failed to allocate Pdo memory.\n"); + EC_ERR("Failed to allocate PDO memory.\n"); return -1; } @@ -434,7 +434,7 @@ for (i = 0; i < entry_count; i++) { if (!(entry = kmalloc(sizeof(ec_pdo_entry_t), GFP_KERNEL))) { - EC_ERR("Failed to allocate Pdo entry memory.\n"); + EC_ERR("Failed to allocate PDO entry memory.\n"); return -1; } @@ -454,12 +454,12 @@ data += 8; } - // if sync manager index is positive, the Pdo is mapped by default + // if sync manager index is positive, the PDO is mapped by default if (pdo->sync_index >= 0) { ec_sync_t *sync; if (!(sync = ec_slave_get_sync(slave, pdo->sync_index))) { - EC_ERR("Invalid SM index %i for Pdo 0x%04X in slave %u.", + EC_ERR("Invalid SM index %i for PDO 0x%04X in slave %u.", pdo->sync_index, pdo->index, slave->ring_position); return -1; } @@ -518,11 +518,11 @@ /*****************************************************************************/ /** - Counts the total number of Sdos and entries in the dictionary. + Counts the total number of SDOs and entries in the dictionary. */ void ec_slave_sdo_dict_info(const ec_slave_t *slave, /**< EtherCAT slave */ - unsigned int *sdo_count, /**< number of Sdos */ + unsigned int *sdo_count, /**< number of SDOs */ unsigned int *entry_count /**< total number of entries */ ) @@ -545,13 +545,13 @@ /*****************************************************************************/ /** - * Get an Sdo from the dictionary. - * \returns The desired Sdo, or NULL. + * Get an SDO from the dictionary. + * \returns The desired SDO, or NULL. */ ec_sdo_t *ec_slave_get_sdo( ec_slave_t *slave, /**< EtherCAT slave */ - uint16_t index /**< Sdo index */ + uint16_t index /**< SDO index */ ) { ec_sdo_t *sdo; @@ -568,16 +568,16 @@ /*****************************************************************************/ /** - * Get an Sdo from the dictionary. + * Get an SDO from the dictionary. * * const version. * - * \returns The desired Sdo, or NULL. + * \returns The desired SDO, or NULL. */ const ec_sdo_t *ec_slave_get_sdo_const( const ec_slave_t *slave, /**< EtherCAT slave */ - uint16_t index /**< Sdo index */ + uint16_t index /**< SDO index */ ) { const ec_sdo_t *sdo; @@ -593,13 +593,13 @@ /*****************************************************************************/ -/** Get an Sdo from the dictionary, given its position in the list. - * \returns The desired Sdo, or NULL. +/** Get an SDO from the dictionary, given its position in the list. + * \returns The desired SDO, or NULL. */ const ec_sdo_t *ec_slave_get_sdo_by_pos_const( const ec_slave_t *slave, /**< EtherCAT slave. */ - uint16_t sdo_position /**< Sdo list position. */ + uint16_t sdo_position /**< SDO list position. */ ) { const ec_sdo_t *sdo; @@ -615,8 +615,8 @@ /*****************************************************************************/ -/** Get the number of Sdos in the dictionary. - * \returns Sdo count. +/** Get the number of SDOs in the dictionary. + * \returns SDO count. */ uint16_t ec_slave_sdo_count( @@ -635,12 +635,12 @@ /*****************************************************************************/ -/** Finds a mapped Pdo. - * \returns The desired Pdo object, or NULL. +/** Finds a mapped PDO. + * \returns The desired PDO object, or NULL. */ const ec_pdo_t *ec_slave_find_pdo( const ec_slave_t *slave, /**< Slave. */ - uint16_t index /**< Pdo index to find. */ + uint16_t index /**< PDO index to find. */ ) { unsigned int i; @@ -661,7 +661,7 @@ /*****************************************************************************/ -/** Find name for a Pdo and its entries. +/** Find name for a PDO and its entries. */ void ec_slave_find_names_for_pdo( ec_slave_t *slave, @@ -692,7 +692,7 @@ /*****************************************************************************/ -/** Attach Pdo names. +/** Attach PDO names. */ void ec_slave_attach_pdo_names( ec_slave_t *slave diff -r 399ef727bf62 -r e206f4485f60 master/slave.h --- a/master/slave.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/slave.h Mon Dec 29 15:19:16 2008 +0000 @@ -130,7 +130,7 @@ // Slave information interface ec_sii_t sii; /**< Extracted SII data. */ - struct list_head sdo_dictionary; /**< Sdo dictionary list */ + struct list_head sdo_dictionary; /**< SDO dictionary list */ uint8_t sdo_dictionary_fetched; /**< Dictionary has been fetched. */ unsigned long jiffies_preop; /**< Time, the slave went to PREOP. */ }; diff -r 399ef727bf62 -r e206f4485f60 master/slave_config.c --- a/master/slave_config.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/slave_config.c Mon Dec 29 15:19:16 2008 +0000 @@ -91,14 +91,14 @@ for (i = 0; i < EC_MAX_SYNC_MANAGERS; i++) ec_sync_config_clear(&sc->sync_configs[i]); - // free all Sdo configurations + // free all SDO configurations list_for_each_entry_safe(req, next_req, &sc->sdo_configs, list) { list_del(&req->list); ec_sdo_request_clear(req); kfree(req); } - // free all Sdo requests + // free all SDO requests list_for_each_entry_safe(req, next_req, &sc->sdo_requests, list) { list_del(&req->list); ec_sdo_request_clear(req); @@ -124,7 +124,7 @@ ec_slave_config_t *sc, /**< Slave configuration. */ ec_domain_t *domain, /**< Domain. */ uint8_t sync_index, /**< Sync manager index. */ - ec_direction_t dir /**< Pdo direction. */ + ec_direction_t dir /**< PDO direction. */ ) { unsigned int i; @@ -226,7 +226,7 @@ /*****************************************************************************/ -/** Loads the default Pdo assignment from the slave object. +/** Loads the default PDO assignment from the slave object. */ void ec_slave_config_load_default_sync_config(ec_slave_config_t *sc) { @@ -251,7 +251,7 @@ /*****************************************************************************/ -/** Loads the default mapping for a Pdo from the slave object. +/** Loads the default mapping for a PDO from the slave object. */ void ec_slave_config_load_default_mapping( const ec_slave_config_t *sc, @@ -266,10 +266,10 @@ return; if (sc->master->debug_level) - EC_DBG("Loading default mapping for Pdo 0x%04X in config %u:%u.\n", + EC_DBG("Loading default mapping for PDO 0x%04X in config %u:%u.\n", pdo->index, sc->alias, sc->position); - // find Pdo in any sync manager (it could be reassigned later) + // find PDO in any sync manager (it could be reassigned later) for (i = 0; i < sc->slave->sii.sync_count; i++) { sync = &sc->slave->sii.syncs[i]; @@ -279,13 +279,13 @@ if (default_pdo->name) { if (sc->master->debug_level) - EC_DBG("Found Pdo name \"%s\".\n", default_pdo->name); - - // take Pdo name from assigned one + EC_DBG("Found PDO name \"%s\".\n", default_pdo->name); + + // take PDO name from assigned one ec_pdo_set_name(pdo, default_pdo->name); } - // copy entries (= default Pdo mapping) + // copy entries (= default PDO mapping) if (ec_pdo_copy_entries(pdo, default_pdo)) return; @@ -307,9 +307,9 @@ /*****************************************************************************/ -/** Get the number of Sdo configurations. - * - * \return Number of Sdo configurations. +/** Get the number of SDO configurations. + * + * \return Number of SDO configurations. */ unsigned int ec_slave_config_sdo_count( const ec_slave_config_t *sc /**< Slave configuration. */ @@ -327,7 +327,7 @@ /*****************************************************************************/ -/** Finds an Sdo configuration via its position in the list. +/** Finds an SDO configuration via its position in the list. * * Const version. */ @@ -453,7 +453,7 @@ entry_bit_length) ? 0 : -1; up(&sc->master->master_sem); } else { - EC_ERR("Pdo 0x%04X is not assigned in config %u:%u.\n", + EC_ERR("PDO 0x%04X is not assigned in config %u:%u.\n", pdo_index, sc->alias, sc->position); } @@ -482,7 +482,7 @@ ec_pdo_clear_entries(pdo); up(&sc->master->master_sem); } else { - EC_WARN("Pdo 0x%04X is not assigned in config %u:%u.\n", + EC_WARN("PDO 0x%04X is not assigned in config %u:%u.\n", pdo_index, sc->alias, sc->position); } } @@ -584,7 +584,7 @@ if (bit_position) { *bit_position = bit_pos; } else if (bit_pos) { - EC_ERR("Pdo entry 0x%04X:%02X does not byte-align " + EC_ERR("PDO entry 0x%04X:%02X does not byte-align " "in config %u:%u.\n", index, subindex, sc->alias, sc->position); return -3; @@ -601,7 +601,7 @@ } } - EC_ERR("Pdo entry 0x%04X:%02X is not mapped in slave config %u:%u.\n", + EC_ERR("PDO entry 0x%04X:%02X is not mapped in slave config %u:%u.\n", index, subindex, sc->alias, sc->position); return -1; } @@ -627,7 +627,7 @@ if (!(req = (ec_sdo_request_t *) kmalloc(sizeof(ec_sdo_request_t), GFP_KERNEL))) { - EC_ERR("Failed to allocate memory for Sdo configuration!\n"); + EC_ERR("Failed to allocate memory for SDO configuration!\n"); return -1; } @@ -709,7 +709,7 @@ if (!(req = (ec_sdo_request_t *) kmalloc(sizeof(ec_sdo_request_t), GFP_KERNEL))) { - EC_ERR("Failed to allocate Sdo request memory!\n"); + EC_ERR("Failed to allocate SDO request memory!\n"); return NULL; } diff -r 399ef727bf62 -r e206f4485f60 master/slave_config.h --- a/master/slave_config.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/slave_config.h Mon Dec 29 15:19:16 2008 +0000 @@ -65,8 +65,8 @@ ec_fmmu_config_t fmmu_configs[EC_MAX_FMMUS]; /**< FMMU configurations. */ uint8_t used_fmmus; /**< Number of FMMUs used. */ - struct list_head sdo_configs; /**< List of Sdo configurations. */ - struct list_head sdo_requests; /**< List of Sdo requests. */ + struct list_head sdo_configs; /**< List of SDO configurations. */ + struct list_head sdo_requests; /**< List of SDO requests. */ }; diff -r 399ef727bf62 -r e206f4485f60 master/sync.c --- a/master/sync.c Mon Dec 29 14:10:27 2008 +0000 +++ b/master/sync.c Mon Dec 29 15:19:16 2008 +0000 @@ -121,13 +121,13 @@ /*****************************************************************************/ -/** Adds a Pdo to the list of known mapped Pdos. +/** Adds a PDO to the list of known mapped PDOs. * * \return 0 on success, else < 0 */ int ec_sync_add_pdo( ec_sync_t *sync, /**< EtherCAT sync manager. */ - const ec_pdo_t *pdo /**< Pdo to map. */ + const ec_pdo_t *pdo /**< PDO to map. */ ) { return ec_pdo_list_add_pdo_copy(&sync->pdos, pdo); diff -r 399ef727bf62 -r e206f4485f60 master/sync.h --- a/master/sync.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/sync.h Mon Dec 29 15:19:16 2008 +0000 @@ -48,7 +48,7 @@ uint16_t default_length; /**< Data length in bytes. */ uint8_t control_register; /**< Control register value. */ uint8_t enable; /**< Enable bit. */ - ec_pdo_list_t pdos; /**< Current Pdo assignment. */ + ec_pdo_list_t pdos; /**< Current PDO assignment. */ } ec_sync_t; /*****************************************************************************/ diff -r 399ef727bf62 -r e206f4485f60 master/sync_config.h --- a/master/sync_config.h Mon Dec 29 14:10:27 2008 +0000 +++ b/master/sync_config.h Mon Dec 29 15:19:16 2008 +0000 @@ -44,7 +44,7 @@ */ typedef struct { ec_direction_t dir; /**< Sync manager direction. */ - ec_pdo_list_t pdos; /**< Current Pdo assignment. */ + ec_pdo_list_t pdos; /**< Current PDO assignment. */ } ec_sync_config_t; /*****************************************************************************/ diff -r 399ef727bf62 -r e206f4485f60 tool/CommandConfig.cpp --- a/tool/CommandConfig.cpp Mon Dec 29 14:10:27 2008 +0000 +++ b/tool/CommandConfig.cpp Mon Dec 29 15:19:16 2008 +0000 @@ -47,8 +47,8 @@ << "| hexadecimal)." << endl << "\\- Alias address and relative position (both decimal)." << endl << endl - << "With the --verbose option given, the configured Pdos and" << endl - << "Sdos are output in addition." << endl + << "With the --verbose option given, the configured PDOs and" << endl + << "SDOs are output in addition." << endl << endl << "Configuration selection:" << endl << " Slave configurations can be selected with" << endl @@ -139,13 +139,13 @@ for (k = 0; k < configIter->syncs[j].pdo_count; k++) { m.getConfigPdo(&pdo, configIter->config_index, j, k); - cout << " Pdo 0x" << hex << setw(4) << pdo.index << endl; + cout << " PDO 0x" << hex << setw(4) << pdo.index << endl; for (l = 0; l < pdo.entry_count; l++) { m.getConfigPdoEntry(&entry, configIter->config_index, j, k, l); - cout << " Pdo entry 0x" << hex << setfill('0') + cout << " PDO entry 0x" << hex << setfill('0') << setw(4) << entry.index << ":" << setw(2) << (unsigned int) entry.subindex << ", " << dec << setfill(' ') @@ -156,7 +156,7 @@ } } - cout << "Sdo configuration:" << endl; + cout << "SDO configuration:" << endl; if (configIter->sdo_count) { for (j = 0; j < configIter->sdo_count; j++) { m.getConfigSdo(&sdo, configIter->config_index, j); diff -r 399ef727bf62 -r e206f4485f60 tool/CommandDomains.cpp --- a/tool/CommandDomains.cpp Mon Dec 29 14:10:27 2008 +0000 +++ b/tool/CommandDomains.cpp Mon Dec 29 15:19:16 2008 +0000 @@ -36,7 +36,7 @@ << "(LRD/LWR/LRW) is displayed followed by the domain's" << endl << "process data size in byte. The last values are the current" << endl << "datagram working counter sum and the expected working" << endl - << "counter sum. If the values are equal, all Pdos were" << endl + << "counter sum. If the values are equal, all PDOs were" << endl << "exchanged during the last cycle." << endl << endl << "If the --verbose option is given, the participating slave" << endl diff -r 399ef727bf62 -r e206f4485f60 tool/CommandDownload.cpp --- a/tool/CommandDownload.cpp Mon Dec 29 14:10:27 2008 +0000 +++ b/tool/CommandDownload.cpp Mon Dec 29 15:19:16 2008 +0000 @@ -14,7 +14,7 @@ /*****************************************************************************/ CommandDownload::CommandDownload(): - SdoCommand("download", "Write an Sdo entry to a slave.") + SdoCommand("download", "Write an SDO entry to a slave.") { } @@ -30,28 +30,28 @@ << endl << "This command requires a single slave to be selected." << endl << endl - << "The data type of the Sdo entry is taken from the Sdo" << endl + << "The data type of the SDO entry is taken from the SDO" << endl << "dictionary by default. It can be overridden with the" << endl - << "--type option. If the slave does not support the Sdo" << endl - << "information service or the Sdo is not in the dictionary," << endl + << "--type option. If the slave does not support the SDO" << endl + << "information service or the SDO is not in the dictionary," << endl << "the --type option is mandatory." << endl << endl - << "These are the valid Sdo entry data types:" << endl + << "These are the valid SDO entry data types:" << endl << " int8, int16, int32, uint8, uint16, uint32, string." << endl << endl << "Arguments:" << endl - << " INDEX is the Sdo index and must be an unsigned" << endl + << " INDEX is the SDO index and must be an unsigned" << endl << " 16 bit number." << endl - << " SUBINDEX is the Sdo entry subindex and must be an" << endl + << " SUBINDEX is the SDO entry subindex and must be an" << endl << " unsigned 8 bit number." << endl << " VALUE is the value to download and must correspond" << endl - << " to the Sdo entry datatype (see above)." << endl + << " to the SDO entry datatype (see above)." << endl << endl << "Command-specific options:" << endl << " --alias -a " << endl << " --position -p Slave selection. See the help of" << endl << " the 'slaves' command." << endl - << " --type -t Sdo entry data type (see above)." << endl + << " --type -t SDO entry data type (see above)." << endl << endl << numericInfo(); @@ -78,7 +78,7 @@ >> resetiosflags(ios::basefield) // guess base from prefix >> data.sdo_index; if (strIndex.fail()) { - err << "Invalid Sdo index '" << args[0] << "'!"; + err << "Invalid SDO index '" << args[0] << "'!"; throwInvalidUsageException(err); } @@ -87,7 +87,7 @@ >> resetiosflags(ios::basefield) // guess base from prefix >> number; if (strSubIndex.fail() || number > 0xff) { - err << "Invalid Sdo subindex '" << args[1] << "'!"; + err << "Invalid SDO subindex '" << args[1] << "'!"; throwInvalidUsageException(err); } data.sdo_entry_subindex = number; @@ -111,12 +111,12 @@ m.getSdoEntry(&entry, data.slave_position, data.sdo_index, data.sdo_entry_subindex); } catch (MasterDeviceException &e) { - err << "Failed to determine Sdo entry data type. " + err << "Failed to determine SDO entry data type. " << "Please specify --type."; throwCommandException(err); } if (!(dataType = findDataType(entry.data_type))) { - err << "Pdo entry has unknown data type 0x" + err << "PDO entry has unknown data type 0x" << hex << setfill('0') << setw(4) << entry.data_type << "!" << " Please specify --type."; throwCommandException(err); @@ -208,7 +208,7 @@ m.sdoDownload(&data); } catch (MasterDeviceSdoAbortException &e) { delete [] data.data; - err << "Sdo transfer aborted with code 0x" + err << "SDO transfer aborted with code 0x" << setfill('0') << hex << setw(8) << e.abortCode << ": " << abortText(e.abortCode); throwCommandException(err); diff -r 399ef727bf62 -r e206f4485f60 tool/CommandPdos.cpp --- a/tool/CommandPdos.cpp Mon Dec 29 14:10:27 2008 +0000 +++ b/tool/CommandPdos.cpp Mon Dec 29 15:19:16 2008 +0000 @@ -13,7 +13,7 @@ /*****************************************************************************/ CommandPdos::CommandPdos(): - Command("pdos", "List Sync managers, Pdo assignment and mapping.") + Command("pdos", "List Sync managers, PDO assignment and mapping.") { } @@ -37,19 +37,19 @@ << " SM3: PhysAddr 0x1100, DefaultSize 0, ControlRegister 0x20, " << "Enable 1" << endl << endl - << "2) Assigned Pdos - Pdo direction, hexadecimal index and" << endl - << " the Pdo name, if avaliable. Note that a 'Tx' and 'Rx'" << endl + << "2) Assigned PDOs - PDO direction, hexadecimal index and" << endl + << " the PDO name, if avaliable. Note that a 'Tx' and 'Rx'" << endl << " are seen from the slave's point of view. Example:" << endl << endl - << " TxPdo 0x1a00 \"Channel1\"" << endl + << " TxPDO 0x1a00 \"Channel1\"" << endl << endl - << "3) Mapped Pdo entries - Pdo entry index and subindex (both" << endl + << "3) Mapped PDO entries - PDO entry index and subindex (both" << endl << " hexadecimal), the length in bit and the description, if" << endl << " available. Example:" << endl << endl - << " Pdo entry 0x3101:01, 8 bit, \"Status\"" << endl + << " PDO entry 0x3101:01, 8 bit, \"Status\"" << endl << endl - << "Note, that the displayed Pdo assignment and Pdo mapping" << endl + << "Note, that the displayed PDO assignment and PDO mapping" << endl << "information can either originate from the SII or from the" << endl << "CoE communication area." << endl << endl @@ -115,7 +115,7 @@ m.getPdo(&pdo, slave.position, i, j); cout << " " << (sync.control_register & 0x04 ? "R" : "T") - << "xPdo 0x" + << "xPDO 0x" << hex << setfill('0') << setw(4) << pdo.index << " \"" << pdo.name << "\"" << endl; @@ -126,7 +126,7 @@ for (k = 0; k < pdo.entry_count; k++) { m.getPdoEntry(&entry, slave.position, i, j, k); - cout << " Pdo entry 0x" + cout << " PDO entry 0x" << hex << setfill('0') << setw(4) << entry.index << ":" << setw(2) << (unsigned int) entry.subindex diff -r 399ef727bf62 -r e206f4485f60 tool/CommandSdos.cpp --- a/tool/CommandSdos.cpp Mon Dec 29 14:10:27 2008 +0000 +++ b/tool/CommandSdos.cpp Mon Dec 29 15:19:16 2008 +0000 @@ -13,7 +13,7 @@ /*****************************************************************************/ CommandSdos::CommandSdos(): - SdoCommand("sdos", "List Sdo dictionaries.") + SdoCommand("sdos", "List SDO dictionaries.") { } @@ -27,27 +27,27 @@ << endl << getBriefDescription() << endl << endl - << "Sdo dictionary information is displayed in two layers," << endl + << "SDO dictionary information is displayed in two layers," << endl << "which are indented accordingly:" << endl << endl - << "1) Sdos - Hexadecimal Sdo index and the name. Example:" << endl + << "1) SDOs - Hexadecimal SDO index and the name. Example:" << endl << endl - << " Sdo 0x1018, \"Identity object\"" << endl + << " SDO 0x1018, \"Identity object\"" << endl << endl - << "2) Sdo entries - Sdo index and Sdo entry subindex (both" << endl + << "2) SDO entries - SDO index and SDO entry subindex (both" << endl << " hexadecimal) followed by the data type, the length in" << endl << " bit, and the description. Example:" << endl << endl << " 0x1018:01, uint32, 32 bit, \"Vendor id\"" << endl << endl - << "If the --quiet option is given, only the Sdos are output." + << "If the --quiet option is given, only the SDOs are output." << endl << endl << "Command-specific options:" << endl << " --alias -a " << endl << " --position -p Slave selection. See the help of" << endl << " the 'slaves' command." << endl - << " --quiet -q Only output Sdos (without the" << endl - << " Sdo entries)." << endl + << " --quiet -q Only output SDOs (without the" << endl + << " SDO entries)." << endl << endl << numericInfo(); @@ -90,7 +90,7 @@ for (i = 0; i < slave.sdo_count; i++) { m.getSdo(&sdo, slave.position, i); - cout << "Sdo 0x" + cout << "SDO 0x" << hex << setfill('0') << setw(4) << sdo.sdo_index << ", \"" << sdo.name << "\"" << endl; diff -r 399ef727bf62 -r e206f4485f60 tool/CommandSlaves.cpp --- a/tool/CommandSlaves.cpp Mon Dec 29 14:10:27 2008 +0000 +++ b/tool/CommandSlaves.cpp Mon Dec 29 15:19:16 2008 +0000 @@ -261,20 +261,20 @@ if (si->mailbox_protocols & EC_MBOX_COE) { cout << " CoE details:" << endl - << " Enable Sdo: " + << " Enable SDO: " << (si->coe_details.enable_sdo ? "yes" : "no") << endl - << " Enable Sdo Info: " + << " Enable SDO Info: " << (si->coe_details.enable_sdo_info ? "yes" : "no") << endl - << " Enable Pdo Assign: " + << " Enable PDO Assign: " << (si->coe_details.enable_pdo_assign ? "yes" : "no") << endl - << " Enable Pdo Configuration: " + << " Enable PDO Configuration: " << (si->coe_details.enable_pdo_configuration ? "yes" : "no") << endl << " Enable Upload at startup: " << (si->coe_details.enable_upload_at_startup ? "yes" : "no") << endl - << " Enable Sdo complete access: " + << " Enable SDO complete access: " << (si->coe_details.enable_sdo_complete_access ? "yes" : "no") << endl; } diff -r 399ef727bf62 -r e206f4485f60 tool/CommandUpload.cpp --- a/tool/CommandUpload.cpp Mon Dec 29 14:10:27 2008 +0000 +++ b/tool/CommandUpload.cpp Mon Dec 29 15:19:16 2008 +0000 @@ -14,7 +14,7 @@ /*****************************************************************************/ CommandUpload::CommandUpload(): - SdoCommand("upload", "Read an Sdo entry from a slave.") + SdoCommand("upload", "Read an SDO entry from a slave.") { } @@ -30,26 +30,26 @@ << endl << "This command requires a single slave to be selected." << endl << endl - << "The data type of the Sdo entry is taken from the Sdo" << endl + << "The data type of the SDO entry is taken from the SDO" << endl << "dictionary by default. It can be overridden with the" << endl - << "--type option. If the slave does not support the Sdo" << endl - << "information service or the Sdo is not in the dictionary," << endl + << "--type option. If the slave does not support the SDO" << endl + << "information service or the SDO is not in the dictionary," << endl << "the --type option is mandatory." << endl << endl - << "These are the valid Sdo entry data types:" << endl + << "These are the valid SDO entry data types:" << endl << " int8, int16, int32, uint8, uint16, uint32, string." << endl << endl << "Arguments:" << endl - << " INDEX is the Sdo index and must be an unsigned" << endl + << " INDEX is the SDO index and must be an unsigned" << endl << " 16 bit number." << endl - << " SUBINDEX is the Sdo entry subindex and must be an" << endl + << " SUBINDEX is the SDO entry subindex and must be an" << endl << " unsigned 8 bit number." << endl << endl << "Command-specific options:" << endl << " --alias -a " << endl << " --position -p Slave selection. See the help of" << endl << " the 'slaves' command." << endl - << " --type -t Sdo entry data type (see above)." << endl + << " --type -t SDO entry data type (see above)." << endl << endl << numericInfo(); @@ -77,7 +77,7 @@ >> resetiosflags(ios::basefield) // guess base from prefix >> data.sdo_index; if (strIndex.fail()) { - err << "Invalid Sdo index '" << args[0] << "'!"; + err << "Invalid SDO index '" << args[0] << "'!"; throwInvalidUsageException(err); } @@ -86,7 +86,7 @@ >> resetiosflags(ios::basefield) // guess base from prefix >> uval; if (strSubIndex.fail() || uval > 0xff) { - err << "Invalid Sdo subindex '" << args[1] << "'!"; + err << "Invalid SDO subindex '" << args[1] << "'!"; throwInvalidUsageException(err); } data.sdo_entry_subindex = uval; @@ -110,12 +110,12 @@ m.getSdoEntry(&entry, data.slave_position, data.sdo_index, data.sdo_entry_subindex); } catch (MasterDeviceException &e) { - err << "Failed to determine Sdo entry data type. " + err << "Failed to determine SDO entry data type. " << "Please specify --type."; throwCommandException(err); } if (!(dataType = findDataType(entry.data_type))) { - err << "Pdo entry has unknown data type 0x" + err << "PDO entry has unknown data type 0x" << hex << setfill('0') << setw(4) << entry.data_type << "!" << " Please specify --type."; throwCommandException(err); @@ -134,7 +134,7 @@ m.sdoUpload(&data); } catch (MasterDeviceSdoAbortException &e) { delete [] data.target; - err << "Sdo transfer aborted with code 0x" + err << "SDO transfer aborted with code 0x" << setfill('0') << hex << setw(8) << e.abortCode << ": " << abortText(e.abortCode); throwCommandException(err); diff -r 399ef727bf62 -r e206f4485f60 tool/CommandXml.cpp --- a/tool/CommandXml.cpp Mon Dec 29 14:10:27 2008 +0000 +++ b/tool/CommandXml.cpp Mon Dec 29 15:19:16 2008 +0000 @@ -28,9 +28,9 @@ << endl << getBriefDescription() << endl << endl - << "Note that the Pdo information can either originate" << endl + << "Note that the PDO information can either originate" << endl << "from the SII or from the CoE communication area. For" << endl - << "slaves, that support configuring Pdo assignment and" << endl + << "slaves, that support configuring PDO assignment and" << endl << "mapping, the output depends on the last configuration." << endl << endl << "Command-specific options:" << endl @@ -111,7 +111,7 @@ for (j = 0; j < sync.pdo_count; j++) { m.getPdo(&pdo, slave.position, i, j); pdoType = (sync.control_register & 0x04 ? "R" : "T"); - pdoType += "xPdo"; + pdoType += "xPdo"; // last 2 letters lowercase in XML! cout << " <" << pdoType diff -r 399ef727bf62 -r e206f4485f60 tool/MasterDevice.cpp --- a/tool/MasterDevice.cpp Mon Dec 29 14:10:27 2008 +0000 +++ b/tool/MasterDevice.cpp Mon Dec 29 15:19:16 2008 +0000 @@ -147,7 +147,7 @@ if (ioctl(fd, EC_IOCTL_CONFIG_SDO, data) < 0) { stringstream err; - err << "Failed to get slave config Sdo: " << strerror(errno); + err << "Failed to get slave config SDO: " << strerror(errno); throw MasterDeviceException(err); } } @@ -293,7 +293,7 @@ if (ioctl(fd, EC_IOCTL_SLAVE_SDO, sdo)) { stringstream err; - err << "Failed to get Sdo: " << strerror(errno); + err << "Failed to get SDO: " << strerror(errno); throw MasterDeviceException(err); } } @@ -313,7 +313,7 @@ if (ioctl(fd, EC_IOCTL_SLAVE_SDO_ENTRY, entry)) { stringstream err; - err << "Failed to get Sdo entry: " << strerror(errno); + err << "Failed to get SDO entry: " << strerror(errno); throw MasterDeviceException(err); } } @@ -364,7 +364,7 @@ if (errno == EIO && data->abort_code) { throw MasterDeviceSdoAbortException(data->abort_code); } else { - err << "Failed to download Sdo: " << strerror(errno); + err << "Failed to download SDO: " << strerror(errno); throw MasterDeviceException(err); } } @@ -379,7 +379,7 @@ if (errno == EIO && data->abort_code) { throw MasterDeviceSdoAbortException(data->abort_code); } else { - err << "Failed to upload Sdo: " << strerror(errno); + err << "Failed to upload SDO: " << strerror(errno); throw MasterDeviceException(err); } } diff -r 399ef727bf62 -r e206f4485f60 tool/MasterDevice.h --- a/tool/MasterDevice.h Mon Dec 29 14:10:27 2008 +0000 +++ b/tool/MasterDevice.h Mon Dec 29 15:19:16 2008 +0000 @@ -46,7 +46,7 @@ protected: /** Constructor with stringstream parameter. */ MasterDeviceSdoAbortException(uint32_t code): - MasterDeviceException("Sdo transfer aborted.") { + MasterDeviceException("SDO transfer aborted.") { abortCode = code; }; }; diff -r 399ef727bf62 -r e206f4485f60 tool/SdoCommand.cpp --- a/tool/SdoCommand.cpp Mon Dec 29 14:10:27 2008 +0000 +++ b/tool/SdoCommand.cpp Mon Dec 29 15:19:16 2008 +0000 @@ -70,24 +70,24 @@ /*****************************************************************************/ -/** Sdo abort messages. +/** SDO abort messages. * - * The "Abort Sdo transfer request" supplies an abort code, which can be + * The "Abort SDO transfer request" supplies an abort code, which can be * translated to clear text. This table does the mapping of the codes and * messages. */ const SdoCommand::AbortMessage SdoCommand::abortMessages[] = { {0x05030000, "Toggle bit not changed"}, - {0x05040000, "Sdo protocol timeout"}, + {0x05040000, "SDO protocol timeout"}, {0x05040001, "Client/Server command specifier not valid or unknown"}, {0x05040005, "Out of memory"}, {0x06010000, "Unsupported access to an object"}, {0x06010001, "Attempt to read a write-only object"}, {0x06010002, "Attempt to write a read-only object"}, {0x06020000, "This object does not exist in the object directory"}, - {0x06040041, "The object cannot be mapped into the Pdo"}, + {0x06040041, "The object cannot be mapped into the PDO"}, {0x06040042, "The number and length of the objects to be mapped would" - " exceed the Pdo length"}, + " exceed the PDO length"}, {0x06040043, "General parameter incompatibility reason"}, {0x06040047, "Gerneral internal incompatibility in device"}, {0x06060000, "Access failure due to a hardware error"},