/******************************************************************************/
/*                       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_hmiQA.h                                            */
/*   Purpose         : Header for the HMI question-answer protocol            */
/*   Limitations     : None                                                   */
/*   Author          : Emmanuel Hanssens                                      */
/*   Creation Date   : 17-Sep-2001                                            */
/*   History         : Compiled by CVS                                        */
/******************************************************************************/
/*   $Id: bcm_hmiQA.h,v 1.13 2004/09/29 08:10:14 hanssens Exp $  */
/******************************************************************************/
#ifndef BCM_HMI_QA_H
# define BCM_HMI_QA_H

# include "bcm_userdef.h"
# include "bcm_hmiMsgHdr.h"
# include "bcm_message.h"

/* error codes */
# define EHMIWGID  1
# define EHMIWRIT  2
# define EHMIREAD  3
# define EHMIPUTO  4
# define EHMIGETO  5
# define EHMISEFA  6
# define EHMIGOFW  7
# define EHMIOPEN  8
# define EHMISIZE  9
# define EHMIIDOR 10

/* error strings array */
extern const char * hmiErr[ ];

struct HmiDev;
typedef struct HmiDev HmiDev;

void hmiDriverInit(void);
HmiDev *hmiOpen(uint16 bcm6410Id);
# ifdef UDP_PHY_USE_DYNAMIC_IP_ALLOCATION
void hmiInit(HmiDev *hmi, MsgDev *msg);
# else
void hmiInit(HmiDev *hmi);
# endif
void hmiClose(HmiDev *hmi);
int hmiGetReqMsgMaxSize(HmiDev *hmi);
int hmiQuestion(HmiDev    *hmi,
                uint16     applicationId,
                uint8     *payload,
                uint16     payloadSize,
                uint32     sourceRef,
                uint32    *requestRef,
                MsgLayout *layout);
int hmiAnswerPayload(HmiDev     *hmi,
                     uint8      *payload,
                     uint16      payloadSize,
                     MsgLayout  *layout);
int hmiAnswerHdr(HmiDev     *hmi,
                 uint32      requestRef,
                 uint16     *payloadSize,
                 uint32     *sourceRef);
int hmiQA      (HmiDev    *hmi,
                uint16     applicationId,
                uint8     *reqMsg,
                uint16     reqMsgSize,
                uint8     *repMsgBuffer,
                uint16     repMsgBufferSize,
                MsgLayout *layout);
int hmiQvarA   (HmiDev    *hmi,
                uint16     applicationId,
                uint8     *reqMsg,
                uint16     reqMsgSize,
                uint8     *repMsgBuffer,
                uint16     repMsgBufferSize,
                uint16    *repMsgSize,
                MsgLayout *layout);
# ifdef UDP_PHY
uint8 hmiHasAnswer(HmiDev *hmi);
# endif

#endif
