summaryrefslogtreecommitdiffstats
path: root/kernel-headers/linux/bvbuffdesc.h
blob: 8dab36f473c057884d3ade223e9383eea382fc48 (plain)
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
/*
 * bvbuffdesc.h
 *
 * Copyright (C) 2011 Texas Instruments, Inc.
 *
 * This package is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#ifndef BVBUFFDESC_H
#define BVBUFFDESC_H

/*
 * bvbuffmap - This is a private structure used by BLTsville
 * implementations to manage resources associated with a buffer.  A pointer
 * to this is returned from bv_map() and used in subsequent bv_blt() and
 * bv_unmap() calls.
 */
struct bvbuffmap;

#define BVATDEF_VENDOR_SHIFT	24
#define BVATDEF_VENDOR_MASK	(0xFF << BVATDEF_VENDOR_SHIFT)

/* Common aux type */
#define BVATDEF_VENDOR_ALL	(0x00 << BVATDEF_VENDOR_SHIFT)

/* Texas Instruments, Inc. */
#define BVATDEF_VENDOR_TI	(0x01 << BVATDEF_VENDOR_SHIFT)

enum bvauxtype {
	BVAT_NONE = 0,	/* auxptr not used */
	BVAT_PHYSDESC =	/* handle points to bvphysdesc struct */
		BVATDEF_VENDOR_ALL + 1,

#ifdef BVAT_EXTERNAL_INCLUDE
#include BVAT_EXTERNAL_INCLUDE
#endif
};


struct bvphysdesc {
	unsigned int structsize;	/* used to identify struct version */
	unsigned long pagesize;		/* page size in bytes */
	unsigned long *pagearray;	/* array of physical pages */
	unsigned int pagecount;		/* number of pages in the pagearray */
	unsigned long pageoffset;	/* page offset in bytes */
};

/*
 * bvbuffdesc - This structure is used to specify the buffer parameters
 * in a call to bv_map().
 */
struct bvbuffdesc {
	unsigned int structsize;	/* used to identify struct version */
	void *virtaddr;			/* virtual ptr to start of buffer */
	unsigned long length;		/* length of the buffer in bytes */
	struct bvbuffmap *map;		/* resource(s) associated w/buffer */
	enum bvauxtype auxtype;		/* type of auxptr */
	void *auxptr;			/* additional buffer description data;
					type depends on auxtype */
};

#endif /* BVBUFFDESC_H */