/*
 *               Copyright (C) 2005, BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished  proprietary information of BroadOn Communications Corp.,
 *  and  are protected by Federal copyright law. They may not be disclosed
 *  to  third  parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 */

#ifndef __AES_HAL_H__
#define __AES_HAL_H__

#include "iostypes.h"

#define AES_OP_TIME             1000
#define AES_DMA_TIME            1000

/* Error codes */
#define AES_ERROR_OK            0
#define AES_ERROR_UNKNOWN       1
#define AES_ERROR_INTR          2
#define AES_ERROR_ACCESS        3
#define AES_ERROR_SIZE          4
#define AES_ERROR_TIMEOUT       5


int AES_ProgramKey(u32 *key);

int AES_ProgramIV(u32 *iv);

int _AES_Setup(u32 srcAddr, u32 dstAddr);

int _AES_StartEncryption(u32 numBlocks, u32 chain, u32 intrEnable);

int _AES_StartDecryption(u32 numBlocks, u32 chain, u32 intrEnable);

int _AES_StartDma(u32 numBlocks, u32 intrEnable);

int _AES_Wait4Done(u32 timeout, u32 pollOnly);

int AES_Encrypt(u32 srcAddr, u32 dstAddr, u32 numBlocks, u32 chain, 
         u32 intrEnable);

int AES_Decrypt(u32 srcAddr, u32 dstAddr, u32 numBlocks, u32 chain, 
         u32 intrEnable);

int AES_Dma(u32 srcAddr, u32 dstAddr, u32 numBlocks, u32 intrEnable);

/* Variable used to distinguish whether memory is BFM or live hw */
extern u32 MEM_LIVE; /* Global variable defined in aes_hal.c */


#endif /* __AES_HAL_H__ */
