Maintained code docs.
--- a/Doxyfile.in Wed Oct 15 10:00:22 2008 +0000
+++ b/Doxyfile.in Wed Oct 15 10:01:54 2008 +0000
@@ -1056,7 +1056,7 @@
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
-PREDEFINED =
+PREDEFINED = __KERNEL__
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
--- a/Makefile.am Wed Oct 15 10:00:22 2008 +0000
+++ b/Makefile.am Wed Oct 15 10:01:54 2008 +0000
@@ -62,6 +62,7 @@
README.EoE
BUILT_SOURCES = \
+ Doxyfile \
Kbuild
modules:
--- a/master/cdev.c Wed Oct 15 10:00:22 2008 +0000
+++ b/master/cdev.c Wed Oct 15 10:01:54 2008 +0000
@@ -50,18 +50,18 @@
/*****************************************************************************/
-/** \cond */
-
-int eccdev_open(struct inode *, struct file *);
-int eccdev_release(struct inode *, struct file *);
-long eccdev_ioctl(struct file *, unsigned int, unsigned long);
-int eccdev_mmap(struct file *, struct vm_area_struct *);
+static int eccdev_open(struct inode *, struct file *);
+static int eccdev_release(struct inode *, struct file *);
+static long eccdev_ioctl(struct file *, unsigned int, unsigned long);
+static int eccdev_mmap(struct file *, struct vm_area_struct *);
static struct page *eccdev_vma_nopage(
struct vm_area_struct *, unsigned long, int *);
/*****************************************************************************/
+/** File operation callbacks for the EtherCAT character device.
+ */
static struct file_operations eccdev_fops = {
.owner = THIS_MODULE,
.open = eccdev_open,
@@ -70,21 +70,21 @@
.mmap = eccdev_mmap
};
+/** Callbacks for a virtual memory area retrieved with ecdevc_mmap().
+ */
struct vm_operations_struct eccdev_vm_ops = {
.nopage = eccdev_vma_nopage
};
-/** \endcond */
-
/*****************************************************************************/
/** Private data structure for file handles.
*/
typedef struct {
- ec_cdev_t *cdev;
- unsigned int requested;
- uint8_t *process_data;
- size_t process_data_size;
+ ec_cdev_t *cdev; /**< Character device. */
+ unsigned int requested; /**< Master wac requested via this file handle. */
+ uint8_t *process_data; /**< Total process data area. */
+ size_t process_data_size; /**< Size of the \a process_data. */
} ec_cdev_priv_t;
/*****************************************************************************/
@@ -2563,6 +2563,11 @@
/*****************************************************************************/
+/** Memory-map callback for the EtherCAT character device.
+ *
+ * The actual mapping will be done in the eccdev_vma_nopage() callback of the
+ * virtual memory area.
+ */
int eccdev_mmap(
struct file *filp,
struct vm_area_struct *vma
@@ -2582,10 +2587,16 @@
/*****************************************************************************/
+/** Page fault callback for a virtual memory area.
+ *
+ * Called at the first access on a virtual-memory area retrieved with
+ * ecdev_mmap().
+ */
struct page *eccdev_vma_nopage(
- struct vm_area_struct *vma,
- unsigned long address,
- int *type
+ struct vm_area_struct *vma, /**< Virtual memory area initialized by
+ the kernel. */
+ unsigned long address, /**< Requested virtual address. */
+ int *type /**< Type output parameter. */
)
{
unsigned long offset;
--- a/master/fsm_master.h Wed Oct 15 10:00:22 2008 +0000
+++ b/master/fsm_master.h Wed Oct 15 10:01:54 2008 +0000
@@ -71,7 +71,7 @@
ec_direction_t dir; /**< Direction. */
uint16_t offset; /**< Physical memory offset. */
size_t length; /**< Number of bytes. */
- uint8_t *data;
+ uint8_t *data; /**< Data to write / memory for read data. */
ec_internal_request_state_t state; /**< State of the request. */
} ec_phy_request_t;
--- a/master/voe_handler.c Wed Oct 15 10:00:22 2008 +0000
+++ b/master/voe_handler.c Wed Oct 15 10:01:54 2008 +0000
@@ -58,8 +58,6 @@
/*****************************************************************************/
-void ec_voe_handler_clear_data(ec_voe_handler_t *);
-
void ec_voe_handler_state_write_start(ec_voe_handler_t *);
void ec_voe_handler_state_write_response(ec_voe_handler_t *);
@@ -199,6 +197,8 @@
* State functions.
*****************************************************************************/
+/** Start writing VoE data.
+ */
void ec_voe_handler_state_write_start(ec_voe_handler_t *voe)
{
ec_slave_t *slave = voe->config->slave;
@@ -234,6 +234,8 @@
/*****************************************************************************/
+/** Wait for the mailbox response.
+ */
void ec_voe_handler_state_write_response(ec_voe_handler_t *voe)
{
ec_datagram_t *datagram = &voe->datagram;
@@ -282,6 +284,8 @@
/*****************************************************************************/
+/** Start reading VoE data.
+ */
void ec_voe_handler_state_read_start(ec_voe_handler_t *voe)
{
ec_datagram_t *datagram = &voe->datagram;
@@ -306,6 +310,8 @@
/*****************************************************************************/
+/** Check for new data in the mailbox.
+ */
void ec_voe_handler_state_read_check(ec_voe_handler_t *voe)
{
ec_datagram_t *datagram = &voe->datagram;
@@ -356,6 +362,8 @@
/*****************************************************************************/
+/** Read the pending mailbox data.
+ */
void ec_voe_handler_state_read_response(ec_voe_handler_t *voe)
{
ec_datagram_t *datagram = &voe->datagram;
@@ -419,12 +427,16 @@
/*****************************************************************************/
+/** Successful termination state function.
+ */
void ec_voe_handler_state_end(ec_voe_handler_t *voe)
{
}
/*****************************************************************************/
+/** Failure termination state function.
+ */
void ec_voe_handler_state_error(ec_voe_handler_t *voe)
{
}