aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/mediatek/vdec/verify/usb_io.h
blob: 29fa68513def3fea1fd431138dba913fb6f406e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/** @file usb_io.h
 */


#ifndef __USB_IO_H__
#define __USB_IO_H__

//#include "x_common.h"
//-----------------------------------------------------------------------------
// Include files
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
// Configurations
//-----------------------------------------------------------------------------



//-----------------------------------------------------------------------------
// Constant definitions
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
// Type definitions
//-----------------------------------------------------------------------------
enum FILE_CMD
{
    FILE_OPEN = 0,
    FILE_CLOSE,
    FILE_SEEK,
    FILE_READ,
    FILE_WRITE,
    FILE_CMD_LAST
};

enum ACK_STATUS
{
    ACK_ERROR_ABORT = 0,
    ACK_GET_PARAM_NUM,
    ACK_GET_PARAM,
    ACK_CMD_CONTINUE,
    ACK_CMD_COMPLETE,
    ACK_LAST
};


//-----------------------------------------------------------------------------
// Macro definitions
//-----------------------------------------------------------------------------
#ifndef SEEK_SET
#define SEEK_SET    0   /* set file offset to offset */
#endif
#ifndef SEEK_CUR
#define SEEK_CUR    1   /* set file offset to current plus offset */
#endif
#ifndef SEEK_END
#define SEEK_END    2   /* set file offset to EOF plus offset */
#endif

//-----------------------------------------------------------------------------
// Prototype  of inter-file functions
//-----------------------------------------------------------------------------
BOOL fgHDDFsMount(UINT32 u4InstID);
BOOL fgHDDFsUnMount(UINT32 u4InstID);

BOOL fgHDDFsOpenFile(UINT32 u4InstID,
                     CHAR *strFileName,
                     ULONG *pi4FileId);

BOOL fgHDDFsCloseFile(ULONG i4FileId);
BOOL fgHDDFsReadFile(UINT32 u4InstID,
                     CHAR *strFileName,
                     void *pvAddr,
                     UINT32 u4Offset,
                     UINT32 u4Length,
                     UINT32 *pu4RealReadSize,
                     UINT32 *pu4TotalFileLength,
                     ULONG *pi4FileId);
BOOL fgHDDFsWriteFile(CHAR *strFileName,
                      void *pvAddr,
                      UINT32 u4Length);

UINT32 u4HDDFsGetFileSize(ULONG *pi4FileId);

int vdecopenFile(char *path, int flag, int mode);
int vdecwriteFile(int fp, char *buf, int writelen);
int vdeccloseFile(int fp);


#endif // __USB_IO_H__