/*****************************************************************************
 * Copyright (c) 1988-95 Digi International Inc., All Rights Reserved
 * 
 * This  software  contains  proprietary  and  confidential   information   of
 * Digi International  Inc.   By  accepting  transfer  of this copy, Recipient
 * agrees to retain this software in  confidence,  to  prevent  disclosure  to
 * others,  and  to make no  use of this software other than that for which it
 * was delivered.  This is an unpublished copyright work  Digi   International
 * Inc.    Except   as   permitted   by  federal  law,  17 USC 117, copying is
 * strictly prohibited.
 * 
 * Digi  International  Inc.  CONFIDENTIAL  -   (Digi    International    Inc.
 * Confidential  when   combined   with   the   aggregated  modules  for  this
 * product) OBJECT CODE ONLY SOURCE MATERIALS
 * 
 * (C) COPYRIGHT Digi International Inc. 1995
 * 
 * All Rights Reserved
 * 
 * US   Government   Users   Restricted   Rights   -   Use,   duplication   or
 * disclosure  restricted by GSA ADP Schedule Contract with Digi International
 * Inc.
 * 
 *****************************************************************************/

/******************************************************************
 *
 *  SpiderX25 - Network board driver
 *
 *  Copyright 1990  Spider Systems Limited
 *
 *  ALLOC.H
 *
 *    Allocation table header
 *
 ******************************************************************/

/*
 * $Id: alloc.h,v 1.8 1997/10/22 21:52:30 gary Exp $
 */

#include "types.h"

#define NQPAIR    40
#define NMBLOCK  500
#define NSTREAM   260
#undef NCLASS		/* We don't want to clash with the system's NCLASS */
#define NCLASS    10
#define NBCALLS   20
#define MAXSIZE 8192

#ifndef NPRI
#define NPRI    3
#endif


struct clinit
{
    int32 ci_count;
    int32 ci_size;
};

struct alloc
{
    int32 n_qpairs;
    int32 n_streams;
    int32 n_mblocks;
    int32 n_classes;
    int32 n_bcalls;

    int32 n_putwait;
    int32 n_nrdy;
    int32 n_timeout;

    int32 n_loscale;
    int32 n_medscale;
    struct clinit n_classinfo[NCLASS];
};

typedef struct bcall bcall_t;

struct class {
    int16        cl_free;
    int16	cl_pad;
    union {
        dblk_t  *cl_db_freelist;
        mblk_t  *cl_mb_freelist;
        queue_t *cl_qu_freelist;
	strm_t	*cl_st_freelist;
        bcall_t *cl_bc_freelist;
    } cl_un_freelist;
    int32         cl_stop[NPRI];
    int32         cl_alloc;
    int32         cl_used;
    int32         cl_fail;
    int32         cl_hwm;
    bcall_t     *cl_bclist;
    int16	cl_low_water ;
    int32 	cl_low_water_mask ;
    int8        *cl_base;
    int8        *cl_limit;
};

#define cl_freelist cl_un_freelist.cl_db_freelist

