/**
 * @file       driver_ipc.h
 * @brief      Process authenticator structures of commands using
 * for communication between driver and SWD part
 * @author     Ivan Vorobiov (i.vorobiov@samsung.com)
 * @version    1.0
 * @date       Created Jun 6, 2016
 * @copyright  In Samsung Ukraine R&D Center (SURC) under a contract between
 * @copyright  LLC "Samsung Electronics Ukraine Company" (Kiev, Ukraine) and
 * @copyright  "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
 * @copyright  Copyright: (c) Samsung Electronics Co, Ltd 2016. All rights reserved.
**/
#ifndef PA_TZ_DRV_INCLUDE_DRIVER_IPC_H_
#define PA_TZ_DRV_INCLUDE_DRIVER_IPC_H_

#include <stdint.h>

/** Each function must have its own ID.
 * Extend this list if you add a new function.
 */
typedef enum {
	kFidDrvAuthenticate = 42
} PaTzDrvFuncId;

/** Union of marshaling parameters. */
/* If adding any function, add the marshaling structure here */
typedef struct {
    struct {
        PaTzDrvFuncId functionId;
        uint32_t result;
    } header;
    void *handler;
} PaTzDrvParam;

/* Driver ID. These is managed by Trustonic */
#define DRV_PA_TZ_ID (DRIVER_ID)

#if defined(CONFIG_TEEGRIS40)
static char kProcaTeegrisDriverName[] = "pa_driver";
#else
static char kProcaTeegrisDriverName[] = "dev://pa_driver";
#endif

/** Universal data type to transmit addresses from lib to driver */
typedef uint64_t DrvClientAddress;

typedef struct {
  DrvClientAddress in_addr;
  DrvClientAddress out_addr;
} __attribute__((packed)) DrvClientBuffers;

#endif  // PA_TZ_DRV_INCLUDE_DRIVER_IPC_H_
