/*
 * @COPYRIGHT@
 * 
 * x-kernel v3.3
 * 
 * Copyright (c) 1993,1991,1990,1996  Arizona Board of Regents
 * 
 * @COPYRIGHT@
 *
 * $RCSfile: xk_config.h,v $
 *
 * HISTORY
 * $Log: xk_config.h,v $
 * Revision 1.1  1997/01/28 22:42:00  rrp
 * Initial revision
 *
 * Revision 1.3  1996/02/02  23:36:25  slm
 * Updated copyright and version.
 *
 * Revision 1.2.1.1  1994/10/26  00:03:14  hkaram
 * New branch
 *
 * Revision 1.2  1994/06/11  00:02:22  menze
 * Added copyright notice
 *
 * Revision 1.1  1994/05/15  00:26:22  davidm
 * Initial revision
 */
/* 
 * Configuration-tunable parameters
 */
#ifndef xk_config_h
#define xk_config_h

/*
 * Number of queues in the timing wheel of the event manager.
 * It should be a function of the estimated number of scheduled
 * (outstanding) events, such that queues don't get too long, but with
 * as little overhead as possible. It better be a power of two as
 * otherwise there will be a lot of mutiplications and divisions.  A
 * value of 128 is probably good for up to some 500-1000 events.
 */
#define XK_EVENT_WHEEL_SIZE		128

/*
 * Maximum number of threads that should be kept cached in the
 * event manager.
 * Events that return from the event handler have their thread cached
 * unless the cache is full.  The following parameter  determines the max.
 * number of threads ever cached.  Each thread has a relatively large
 * stack, so it shouldn't be too large.
 */
#define XK_EVENT_THREAD_CACHE_SIZE	8

/*
 * Maximum number of events to be cached.
 * Events are expected to be created and cancelled frequently.  By
 * caching events, it should be possible to absorb most of these
 * frequent changes and save much work for the malloc package.
 * EVENT_CACHE_SIZE should be chosen according to the maximum of the
 * rate d(# evSchedule - # evCancel)/dt.
 */
#define XK_EVENT_EVENT_CACHE_SIZE	32

/*
 * Should shepherd prolog functions be supported?  This is used by the
 * LANCE driver to delay copying frames out of the network buffer.
 */
#define XK_SHEPHERD_PROLOG

/* 
 * Default number of shepherd threads started up.
 * These threads are shared by all instances of network drivers.  This
 * number can be overridden by a ROM file option of the form:
 *
 *	shepherd threads N
 */
#define XK_SHEPHERD_THREADS	16

/* 
 * Default number of input buffers.  There should be at least as many
 * buffers as input threads.  If there are more buffers than input
 * threads, incoming packets can be queued by the driver if all
 * shepherd threads are busy.  This number can be overridden by a ROM
 * file option of the form:
 *
 *	shepherd buffers N
 */
#define XK_SHEPHERD_BUFFERS	64

/*
 * Maximum size of an incoming frame.
 * Incoming frames are stored in contiguous memory by the driver,
 * encapsulated into a messaged and then a shepherd thread ships it
 * through the protocol stack.  Notice that the input buffer pool
 * uses memory of the size:
 *
 *	XK_SHEPHERD_BUFFERS * XK_MAX_FRAME_SIZE
 *
 * If this becomes too large, you might want to change the input
 * handling to use one buffer pool per frame size.
 */
#define XK_MAX_FRAME_SIZE 2048

/*
 * Maximum size of a network adaptor's header.
 * For Ethernet, this would be 14 bytes.  Input handling occurs in
 * two stages: first a network adaptor drivers does hardware-dependent
 * processing and then passes the frame on to a hardware independent
 * protocol (in the case of Ethernet, this is "eth").  Both typically
 * need access to the header, so it is stored separately from the actual
 * frame data.  The hardware-dependent driver passes this header to
 * the hardware independent protocol via a message attribute.
 */
#define XK_MAX_HARDWARE_HEADER_SIZE	16

/*
 * Should LANCE driver interleave frame buffers?  If set, twice as
 * many send/receive buffers will fit in the network buffer but
 * caching may be worse (or better!).
 */
#define XK_LANCE_INTERLEAVED

#endif /* xk_config_h */
