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 #ifndef _AGP_BACKEND_H
31 #define _AGP_BACKEND_H 1
32
33 #include <linux/list.h>
34
35 enum chipset_type {
36 NOT_SUPPORTED,
37 SUPPORTED,
38 };
39
40 struct agp_version {
41 u16 major;
42 u16 minor;
43 };
44
45 struct agp_kern_info {
46 struct agp_version version;
47 struct pci_dev *device;
48 enum chipset_type chipset;
49 unsigned long mode;
50 unsigned long aper_base;
51 size_t aper_size;
52 int max_memory;
53 int current_memory;
54 bool cant_use_aperture;
55 unsigned long page_mask;
56 const struct vm_operations_struct *vm_ops;
57 };
58
59
60
61
62
63
64
65
66
67 struct agp_bridge_data;
68
69 struct agp_memory {
70 struct agp_memory *next;
71 struct agp_memory *prev;
72 struct agp_bridge_data *bridge;
73 struct page **pages;
74 size_t page_count;
75 int key;
76 int num_scratch_pages;
77 off_t pg_start;
78 u32 type;
79 u32 physical;
80 bool is_bound;
81 bool is_flushed;
82
83 struct list_head mapped_list;
84
85 struct scatterlist *sg_list;
86 int num_sg;
87 };
88
89 #define AGP_NORMAL_MEMORY 0
90
91 #define AGP_USER_TYPES (1 << 16)
92 #define AGP_USER_MEMORY (AGP_USER_TYPES)
93 #define AGP_USER_CACHED_MEMORY (AGP_USER_TYPES + 1)
94
95 extern struct agp_bridge_data *agp_bridge;
96 extern struct list_head agp_bridges;
97
98 extern struct agp_bridge_data *(*agp_find_bridge)(struct pci_dev *);
99
100 extern void agp_free_memory(struct agp_memory *);
101 extern struct agp_memory *agp_allocate_memory(struct agp_bridge_data *, size_t, u32);
102 extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *);
103 extern int agp_bind_memory(struct agp_memory *, off_t);
104 extern int agp_unbind_memory(struct agp_memory *);
105 extern void agp_enable(struct agp_bridge_data *, u32);
106 extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *);
107 extern void agp_backend_release(struct agp_bridge_data *);
108
109 #endif