/**	@(#)device.h	13.1 (RC International) 91/02/02	 */

#if	!defined(_DEVICE_)

#define	_DEVICE_

/*
 * rawdev -- for raw disk and tape 
 */

struct rawdev
{
    u_char		     ic_drive:3;	/* drive number [0-7] */
    u_char		     ic_controller:3;	/* controller number [0-7] */
    u_char		     ic_channel:2;	/* channel number [0-3] */
    u_char		     ic_pu_id;		/* pu id [0-255] */
};

/* rawdev comparison function */
#if defined(vax) || defined(mips)
#define rawdev_equal(a,b) ( (a.ic_drive == b.ic_drive) && \
			    (a.ic_controller == b.ic_controller) && \
			    (a.ic_channel == b.ic_channel) && \
			    (a.ic_pu_id == b.ic_pu_id) )
#else
#define rawdev_equal(a,b)	( a == b )
#endif

/*
 * rcomm -- for communication device.
 */

struct rcomm
{
    UID_T		     rc_subpuuid;	/* uid of the subpu */
    u_short		     rc_class;		/* the class */
    u_short		     rc_slotno;		/* slot number */
};

/* rcomm comparison function */
#if defined(vax) || defined(mips)
#define rcomm_equal(a,b) ( (uid_equal(a.rc_subpuuid, b.rc_subpuuid)) && \
			   (a.rc_class == b.rc_class) && \
			   (a.rc_slotno == b.rc_slotno) )
#else
#define rcomm_equal(a,b)   ( a == b )
#endif

/*
 * rsubpu -- for sub-PU's 
 */

struct rsubpu
{
    UID_T		     rs_uid;		/* uid of the subpu */
    u_char		     rs_curr_pu_id;	/* current pu attached to */
    u_char		     rs_prev_pu_id;	/* previous pu attached to */
};

#endif	!defined(_DEVICE_)
