

/*
 * hifi_protocol.h:
 *
 * Copyright (c) 2000 James McKenzie <james@fishsoup.dhs.org>.
 *
 * $Id: hifi_protocol.h,v 1.5 2000/09/29 13:18:24 root Exp $
 *
 * $Log: hifi_protocol.h,v $
 * Revision 1.5  2000/09/29 13:18:24  root
 * #
 *
 * Revision 1.4  2000/09/24 01:46:07  root
 * #
 *
 * Revision 1.3  2000/02/20 03:10:18  root
 * #
 *
 * Revision 1.2  2000/02/20 03:09:30  root
 * #
 *
 *
 */
#ifndef __HIFI_PROTOCOL_H_      /* include guard */
#define __HIFI_PROTOCOL_H_

#define HIFI_SEQUENCE_NONE	0x0000
#define HIFI_SEQUENCE_REL	0x8000
#define HIFI_SEQUENCE_ACK	0x4000
#define HIFI_SEQUENCE_MASK	0x3fff

typedef struct
{
  Byte class;                   /* Device Class */
  Byte unit;                    /* Unit (Address) */
}
HIFI_PACKED Hifi_Address;

typedef struct
{
  Word magic;                   /*Magic Number */
  Hifi_Address dest;            /*Packet dstn */
  Hifi_Address src;             /*Packet source */
  Word sequence;                /*sequence numbers with */
  /*seq>0x7fff should cause */
  /*RESP packets to be generated */
}
HIFI_PACKED Hifi_Packet_Header;

typedef struct
{
  Word command;                 /*Command >0xff (Class depnt) */
  Word len;                     /*Length of command including */
  /*This header */
}
HIFI_PACKED Hifi_CMD_Header;

typedef struct
{
  Word strq;                    /*Command >0xff (Class depnt) */
  Word len;                     /*Length of command including */
  /*This header */
}
HIFI_PACKED Hifi_ST_Header;

#endif /* __HIFI_PROTOCOL_H_ */
