/******************************************************************************/
/*                       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_hmiBootServices.h                                  */
/*   Purpose         : Provide boot services through QA protocol              */
/*   Limitations     : None                                                   */
/*   Author          : Emmanuel Hanssens                                      */
/*   Creation Date   : 24-Sep-2001                                            */
/*   History         : Compiled by CVS                                        */
/******************************************************************************/
/*   $Id: bcm_hmiBootServices.h,v 1.5 2004/01/09 08:24:32 hanssens Exp $  */
/******************************************************************************/
#ifndef HMI_BOOT_SERVICES_H
# define HMI_BOOT_SERVICES_H

# include "bcm_hmiBootMsg.h"
# include "bcm_hmiQA.h"

# define GenerateBootRequest(dev, applicationId, msgReq, msgRep) \
  hmiQA(dev, applicationId, \
  (uint8 *) msgReq, SIZE_OF_REQ_MSG(GenerateBootRequest), \
  (uint8 *) msgRep, SIZE_OF_REP_MSG(GenerateBootRequest), \
  &GenerateBootRequestLayout)

/* This service does not expect any answer => call hmiQuestion instead of hmiQA 
 * It also uses messages with variable size, while the message layout only
 * show the fixed size part => different computation */
# define SendBootPacket(dev, applicationId, msgReq, reqRef) \
   hmiQuestion(dev, applicationId, \
   (uint8 *) msgReq, \
   SIZE_OF_REQ_MSG(SendBootPacket) + msgReq->packetSize, \
   0, reqRef, \
   &SendBootPacketLayout)

# define GoOperational(dev, applicationId, msgReq, msgRep) \
  hmiQA(dev, applicationId, \
  (uint8 *) msgReq, SIZE_OF_REQ_MSG(GoOperational), \
  (uint8 *) msgRep, SIZE_OF_REP_MSG(GoOperational), \
  &GoOperationalLayout)

# define BootReadSmem(dev, applicationId, msgReq, msgRep, msgRepSize) \
  hmiQvarA(dev, applicationId, \
  (uint8 *) msgReq, SIZE_OF_REQ_MSG(BootReadSmem), \
  (uint8 *) msgRep, SIZE_OF_REP_MSG(BootReadSmem), msgRepSize, \
  &BootReadSmemLayout)

#endif
