/* Copyright Philips Research Labs, Redhill, UK. 2001
 *
 * Prototype Software
 *
 * Contact: Tim Everett (tim.everett@philips.com)
 *
 */

/**
 * @file
 */

/**
 * @addtogroup group_nodes
 * @{
 */


#ifndef __LUDNODEDEFS_H_
#define __LUDNODEDEFS_H_


/**
 * A flag used in lud_node_create() to indicate that this node is used for TriMedia
 * to Host transfers.
 */
#define LUD_NODE_TARGET_HOST            0x40000000

/**
 * A flag used in lud_node_create() to indicate that this node is used for Host
 * to TriMedia transfers.
 */
#define LUD_NODE_HOST_TARGET            0x20000000

/* Old names for above .... should be removed at some later date. */
#define LUD_NODE_HOST_TM	LUD_NODE_HOST_TARGET
#define LUD_NODE_TM_HOST	LUD_NODE_TARGET_HOST

/**
 * A flag used in lud_node_create() to indicate the node should be accessible from
 * linux for ioctl calls.
 */
#define LUD_NODE_HOST_IOCTL         0x10000000

/**
 * A flag used in lud_node_create() to indicate the node should be accessible from
 * linux only via a dedicated linux-side driver, not via the default
 * support in the lud-core module.
 */
#define LUD_NODE_INVISIBLE          0x08000000

/**
 * A flag used in lud_node_create() to indicate that this node can be opened
 * from Linux for reading multiple times.  The default is to only allow
 * one reader at a time.
 */
#define LUD_NODE_MULTIPLE_READERS   0x04000000

/**
 * A flag used in lud_node_create() to indicate that this node can be opened
 * from Linux for writing multiple times.  The default is to only allow
 * one reader at a time.
 */
#define LUD_NODE_MULTIPLE_WRITERS   0x02000000

/**
 * A flag used in lud_node_create() to indicate that this node is a "server"
 * node.  When it is open()ed from Linux, it sends a LUD_SYS_NEW_CONNECTION
 * message to the TriMedia.  The response to this request is a node handle
 * for the node to use for data transfers and ioctls - the so-called
 * "connection node".  Typically, the connection node is invisible
 * (#LUD_NODE_INVISIBLE) and is created dynamically in response to the
 * #LUD_SYS_NEW_CONNECTION message, but this does not have to be the case.
 */
#define LUD_NODE_SERVER   0x01000000

/**
 * A flag used in lud_node_create() to indicate that this node should be
 * automatically flushed by the host after every write().  
 *
 * This only affects nodes with #LUD_NODE_HOST_TARGET set, and it only affects
 * the host to TriMedia Xfer.
 *
 * The default behaviour is optimized for streaming data.  It will buffer
 * data on the host until a packet is full, and then send the full
 * packet to the TriMedia.  The TriMedia only recieves full packets,
 * minimizing the communications overhead and maximizing buffer
 * utilization.
 *
 * This flag disables the buffering, so a data buffer will be sent from the
 * host to the TriMedia after every write(), even if it is only one byte.
 *
 * This flag is essential for complex bi-directional packet-based communications
 * protocols such as Nano-X.  It is not needed for normal streaming protocols
 * such as transport streams.
 */
#define LUD_NODE_AUTO_FLUSH   0x00800000



/**
 * The maximum length of a node name, in characters.
 * This includes the trailing '\\0', so the actual maximum length is one
 * character less.
 */
#define LUD_MAX_NODE_NAME_LENGTH 32

/**
 * The maximum number of nodes in the system.
 */
#define LUD_MAX_NODES	2048


/**
 * @}
 */
#endif


