/******************************************************************************/
/*                       Copyright 2001 Broadcom Corporation                  */
/*                                                                            */
/* This material is the confidential trade secret and proprietary information */
/* of Broadcom Corp.  It may not be reproduced, used, sold or transferred to  */
/* any third party without the prior written consent of Broadcom Corp.        */
/* All rights reserved.                                                       */
/******************************************************************************/
/*   FileName        : bcm_stp.h                                              */
/*   Purpose         : Definition of STP related types                        */
/*   Limitations     : None                                                   */
/*   Author          : Emmanuel Hanssens                                      */
/*   Creation Date   : 12-Oct-2001                                            */
/*   History         : Compiled by RCS                                        */
/******************************************************************************/
/*   $Id: bcm_stp.h,v 1.6 2004/06/22 13:51:00 hanssens Exp $  */
/******************************************************************************/

#ifndef STP_H
# define STP_H

# include "bcm_userdef.h"
# include "bcm_layout.h"

# define STP_GET_REPLY    17
# define STP_SEND_REQUEST 18
# define STP_READ_WRITE   25
# define STP_ANSWER       50
# define STP_GET_MSG_SIZE 52
# define STP_RESET_DEVICE 53
# define BROKEN_PIPE      0xFF

/* stp error codes */
# define ESTPSIZE 1
# define ESTPSHRT 2
# define ESTPDATA 3
# define ESTPRUBB 4
# define ESTPFAIL 5

extern const char *stpErr[];

typedef struct STPheader STPheader;
struct STPheader
{
  uint32 dataSize;
  uint8  bcm6410Id;
  uint8  msgType;
  uint16 notif;  
};
extern typeLayout STPheaderLayout[];

typedef struct STPrequest STPrequest;
struct STPrequest
{
  uint16 offset;
  uint16 num_items;
  uint8 device;
  uint8 rw_flag;
  uint8 addr_increment;
  uint8 reserved;
};
extern typeLayout STPrequestLayout[];

typedef struct STPanswer STPanswer;
struct STPanswer
{
  uint16 num_items;
  uint8 status;
  uint8 reserved;
};
extern typeLayout STPanswerLayout[];

typedef struct STPmsgSize STPmsgSize;
struct STPmsgSize
{
  uint32 reqMsgSize;
  uint32 repMsgSize;
};
extern typeLayout STPmsgSizeLayout[];

#endif
