diff -r 9f83a343ae75 -r 5cff10efb927 master/module.c --- a/master/module.c Thu Apr 20 14:38:41 2006 +0000 +++ b/master/module.c Mon Apr 24 10:47:03 2006 +0000 @@ -1,23 +1,33 @@ /****************************************************************************** * - * m o d u l e . c - * - * EtherCAT master driver module. - * - * Author: Florian Pose - * * $Id$ * - * (C) Copyright IgH 2005 - * Ingenieurgemeinschaft IgH - * Heinz-Bäcker Str. 34 - * D-45356 Essen - * Tel.: +49 201/61 99 31 - * Fax.: +49 201/61 98 36 - * E-mail: sp@igh-essen.com + * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH + * + * This file is part of the IgH EtherCAT Master. + * + * The IgH EtherCAT Master is free software; you can redistribute it + * and/or modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; version 2 of the License. + * + * The IgH EtherCAT Master is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the IgH EtherCAT Master; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ +/** + \file + EtherCAT master driver module. +*/ + +/*****************************************************************************/ + #include #include #include @@ -33,6 +43,10 @@ /*****************************************************************************/ +/** + Compile version info. +*/ + #define COMPILE_INFO EC_STR(EC_MASTER_VERSION_MAIN) \ "." EC_STR(EC_MASTER_VERSION_SUB) \ " (" EC_MASTER_VERSION_EXTRA ")" \ @@ -47,6 +61,8 @@ /*****************************************************************************/ +/** \cond */ + MODULE_AUTHOR ("Florian Pose "); MODULE_DESCRIPTION ("EtherCAT master driver module"); MODULE_LICENSE("GPL"); @@ -55,6 +71,8 @@ module_param(ec_master_count, int, 1); MODULE_PARM_DESC(ec_master_count, "number of EtherCAT masters to initialize"); +/** \endcond */ + /*****************************************************************************/ /** @@ -205,8 +223,12 @@ *****************************************************************************/ /** - Registeres an EtherCAT device for a certain master. + Connects an EtherCAT device to a certain master. + The master will use the device for sending and receiving frames. It is + required that no other instance (for example the kernel IP stack) uses + the device. \return 0 on success, else < 0 + \ingroup DeviceInterface */ ec_device_t *ecdev_register(unsigned int master_index, /**< master index */ @@ -257,7 +279,12 @@ /*****************************************************************************/ /** - Unregisteres an EtherCAT device. + Disconnect an EtherCAT device from the master. + The device is disconnected from the master and all device ressources + are freed. + \attention Before calling this function, the ecdev_stop() function has + to be called, to be sure that the master does not use the device any more. + \ingroup DeviceInterface */ void ecdev_unregister(unsigned int master_index, /**< master index */ @@ -282,6 +309,10 @@ /** Starts the master associated with the device. + This function has to be called by the network device driver to tell the + master that the device is ready to send and receive data. The master + will enter the free-run mode then. + \ingroup DeviceInterface */ int ecdev_start(unsigned int master_index /**< master index */) @@ -302,6 +333,9 @@ /** Stops the master associated with the device. + Tells the master to stop using the device for frame IO. Has to be called + before unregistering the device. + \ingroup DeviceInterface */ void ecdev_stop(unsigned int master_index /**< master index */) @@ -322,6 +356,7 @@ /** Reserves an EtherCAT master for realtime operation. \return pointer to reserved master, or NULL on error + \ingroup RealtimeInterface */ ec_master_t *ecrt_request_master(unsigned int master_index @@ -380,6 +415,7 @@ /** Releases a reserved EtherCAT master. + \ingroup RealtimeInterface */ void ecrt_release_master(ec_master_t *master /**< EtherCAT master */) @@ -405,6 +441,8 @@ /*****************************************************************************/ +/** \cond */ + module_init(ec_init_module); module_exit(ec_cleanup_module); @@ -415,4 +453,6 @@ EXPORT_SYMBOL(ecrt_request_master); EXPORT_SYMBOL(ecrt_release_master); -/*****************************************************************************/ +/** \endcond */ + +/*****************************************************************************/