#ident "$Id: dvd_command.h,v 1.6 2007/02/21 23:06:36 craig Exp $"
/*
 *               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 DVD_COMMAND_H
#define DVD_COMMAND_H

#include <types.h>
#include <es_int.h>

/*
 * This structure must be of length 32 or a multiple thereof
 */
typedef struct diCommand {
    /* Command code or psuedo-command code from dvd_hw.h */
    u8     theCommand;
    u8     pad1[3];
    u32    arg[6];
    u32    pad2[1];
} diCommand_t;
#define DI_COMMAND_ALIGNMENT    (sizeof(u32))

extern diCommand_t      interfaceDiCommand;

/*
 * This structure must be of length 32 or a multiple thereof
 */
typedef struct diRegVals {
    u32    ImmRegVal;
    u32    unused[3];
} diRegVals_t;

typedef struct openPartitionParams {
    /* Offset to partition start - the first word of the partition header */
    u32                 partitionWordOffset;
    ESTicket            *eTicket;
    ESTicketView        *eTicketView;
    u32                 numTmdBytes;
    ESTitleMeta         *tmd;
    u32                 numCertBytes;
    u8                  *certificates;
    u32                 dataWordOffset;
    u8                  *h3HashPtr;
} openPartitionParams_t;

/*
 * These are the values taken by the argument to the
 * callback function
 */

#define DVD_INTTYPE_TC                  0x00000001
#define DVD_INTTYPE_DE                  0x00000002
#define DVD_INTTYPE_CVR                 0x00000004
#define DVD_INTTYPE_BRK                 0x00000008
#define DVD_INTTYPE_TIMEOUT             0x00000010
#define DVD_INTTYPE_SECURITY_ERROR      0x00000020
#define DVD_INTTYPE_ETICKET_ERROR       0x00000040
/*
 * The caller did something wrong, like misaligned buffer
 * This return value isn't part of the official API, but
 * is useful for debugging
 */
#define DVD_INTTYPE_CALLER              0x00000080

#endif /* DVD_COMMAND_H */
