Maintained code docs.

This commit is contained in:
Florian Pose 2008-10-15 10:01:54 +00:00
parent 882a01c91f
commit 7c3d71913c
5 changed files with 43 additions and 19 deletions

View File

@ -1056,7 +1056,7 @@ INCLUDE_FILE_PATTERNS =
# 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.

View File

@ -62,6 +62,7 @@ EXTRA_DIST = \
README.EoE
BUILT_SOURCES = \
Doxyfile \
Kbuild
modules:

View File

@ -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 @@ static struct file_operations eccdev_fops = {
.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 @@ long eccdev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
/*****************************************************************************/
/** 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 @@ int eccdev_mmap(
/*****************************************************************************/
/** 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;

View File

@ -71,7 +71,7 @@ typedef struct {
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;

View File

@ -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 @@ ec_request_state_t ecrt_voe_handler_execute(ec_voe_handler_t *voe)
* 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 @@ void ec_voe_handler_state_write_start(ec_voe_handler_t *voe)
/*****************************************************************************/
/** 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 @@ void ec_voe_handler_state_write_response(ec_voe_handler_t *voe)
/*****************************************************************************/
/** 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 @@ void ec_voe_handler_state_read_start(ec_voe_handler_t *voe)
/*****************************************************************************/
/** 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 @@ void ec_voe_handler_state_read_check(ec_voe_handler_t *voe)
/*****************************************************************************/
/** 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 @@ void ec_voe_handler_state_read_response(ec_voe_handler_t *voe)
/*****************************************************************************/
/** 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)
{
}