aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/sisusbvga/sisusb.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc/sisusbvga/sisusb.h')
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb.h130
1 files changed, 63 insertions, 67 deletions
diff --git a/drivers/usb/misc/sisusbvga/sisusb.h b/drivers/usb/misc/sisusbvga/sisusb.h
index 8e1120a6480..d2d7872cd02 100644
--- a/drivers/usb/misc/sisusbvga/sisusb.h
+++ b/drivers/usb/misc/sisusbvga/sisusb.h
@@ -8,29 +8,29 @@
8 * 8 *
9 * Otherwise, the following license terms apply: 9 * Otherwise, the following license terms apply:
10 * 10 *
11 * * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * * are met: 13 * are met:
14 * * 1) Redistributions of source code must retain the above copyright 14 * 1) Redistributions of source code must retain the above copyright
15 * * notice, this list of conditions and the following disclaimer. 15 * notice, this list of conditions and the following disclaimer.
16 * * 2) Redistributions in binary form must reproduce the above copyright 16 * 2) Redistributions in binary form must reproduce the above copyright
17 * * notice, this list of conditions and the following disclaimer in the 17 * notice, this list of conditions and the following disclaimer in the
18 * * documentation and/or other materials provided with the distribution. 18 * documentation and/or other materials provided with the distribution.
19 * * 3) The name of the author may not be used to endorse or promote products 19 * 3) The name of the author may not be used to endorse or promote products
20 * * derived from this software without specific prior written permission. 20 * derived from this software without specific prior written permission.
21 * *
22 * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
23 * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 * 21 *
33 * Author: Thomas Winischhofer <thomas@winischhofer.net> 22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Author: Thomas Winischhofer <thomas@winischhofer.net>
34 * 34 *
35 */ 35 */
36 36
@@ -44,16 +44,14 @@
44#include <linux/mutex.h> 44#include <linux/mutex.h>
45 45
46/* For older kernels, support for text consoles is by default 46/* For older kernels, support for text consoles is by default
47 * off. To ensable text console support, change the following: 47 * off. To enable text console support, change the following:
48 */ 48 */
49#if 0 49/* #define CONFIG_USB_SISUSBVGA_CON */
50#define CONFIG_USB_SISUSBVGA_CON
51#endif
52 50
53/* Version Information */ 51/* Version Information */
54 52
55#define SISUSB_VERSION 0 53#define SISUSB_VERSION 0
56#define SISUSB_REVISION 0 54#define SISUSB_REVISION 0
57#define SISUSB_PATCHLEVEL 8 55#define SISUSB_PATCHLEVEL 8
58 56
59/* Include console and mode switching code? */ 57/* Include console and mode switching code? */
@@ -74,7 +72,7 @@
74#define SISUSB_IBUF_SIZE 0x01000 72#define SISUSB_IBUF_SIZE 0x01000
75#define SISUSB_OBUF_SIZE 0x10000 /* fixed */ 73#define SISUSB_OBUF_SIZE 0x10000 /* fixed */
76 74
77#define NUMOBUFS 8 /* max number of output buffers/output URBs */ 75#define NUMOBUFS 8 /* max number of output buffers/output URBs */
78 76
79/* About endianness: 77/* About endianness:
80 * 78 *
@@ -93,7 +91,7 @@
93 */ 91 */
94 92
95#ifdef __BIG_ENDIAN 93#ifdef __BIG_ENDIAN
96#define SISUSB_CORRECT_ENDIANNESS_PACKET(p) \ 94#define SISUSB_CORRECT_ENDIANNESS_PACKET(p) \
97 do { \ 95 do { \
98 p->header = cpu_to_le16(p->header); \ 96 p->header = cpu_to_le16(p->header); \
99 p->address = cpu_to_le32(p->address); \ 97 p->address = cpu_to_le32(p->address); \
@@ -105,7 +103,7 @@
105 103
106struct sisusb_usb_data; 104struct sisusb_usb_data;
107 105
108struct sisusb_urb_context { /* urb->context for outbound bulk URBs */ 106struct sisusb_urb_context { /* urb->context for outbound bulk URBs */
109 struct sisusb_usb_data *sisusb; 107 struct sisusb_usb_data *sisusb;
110 int urbindex; 108 int urbindex;
111 int *actual_length; 109 int *actual_length;
@@ -116,16 +114,16 @@ struct sisusb_usb_data {
116 struct usb_interface *interface; 114 struct usb_interface *interface;
117 struct kref kref; 115 struct kref kref;
118 wait_queue_head_t wait_q; /* for syncind and timeouts */ 116 wait_queue_head_t wait_q; /* for syncind and timeouts */
119 struct mutex lock; /* general race avoidance */ 117 struct mutex lock; /* general race avoidance */
120 unsigned int ifnum; /* interface number of the USB device */ 118 unsigned int ifnum; /* interface number of the USB device */
121 int minor; /* minor (for logging clarity) */ 119 int minor; /* minor (for logging clarity) */
122 int isopen; /* !=0 if open */ 120 int isopen; /* !=0 if open */
123 int present; /* !=0 if device is present on the bus */ 121 int present; /* !=0 if device is present on the bus */
124 int ready; /* !=0 if device is ready for userland */ 122 int ready; /* !=0 if device is ready for userland */
125#ifdef SISUSB_OLD_CONFIG_COMPAT 123#ifdef SISUSB_OLD_CONFIG_COMPAT
126 int ioctl32registered; 124 int ioctl32registered;
127#endif 125#endif
128 int numobufs; /* number of obufs = number of out urbs */ 126 int numobufs; /* number of obufs = number of out urbs */
129 char *obuf[NUMOBUFS], *ibuf; /* transfer buffers */ 127 char *obuf[NUMOBUFS], *ibuf; /* transfer buffers */
130 int obufsize, ibufsize; 128 int obufsize, ibufsize;
131 dma_addr_t transfer_dma_out[NUMOBUFS]; 129 dma_addr_t transfer_dma_out[NUMOBUFS];
@@ -136,13 +134,13 @@ struct sisusb_usb_data {
136 unsigned char completein; 134 unsigned char completein;
137 struct sisusb_urb_context urbout_context[NUMOBUFS]; 135 struct sisusb_urb_context urbout_context[NUMOBUFS];
138 unsigned long flagb0; 136 unsigned long flagb0;
139 unsigned long vrambase; /* framebuffer base */ 137 unsigned long vrambase; /* framebuffer base */
140 unsigned int vramsize; /* framebuffer size (bytes) */ 138 unsigned int vramsize; /* framebuffer size (bytes) */
141 unsigned long mmiobase; 139 unsigned long mmiobase;
142 unsigned int mmiosize; 140 unsigned int mmiosize;
143 unsigned long ioportbase; 141 unsigned long ioportbase;
144 unsigned char devinit; /* device initialized? */ 142 unsigned char devinit; /* device initialized? */
145 unsigned char gfxinit; /* graphics core initialized? */ 143 unsigned char gfxinit; /* graphics core initialized? */
146 unsigned short chipid, chipvendor; 144 unsigned short chipid, chipvendor;
147 unsigned short chiprevision; 145 unsigned short chiprevision;
148#ifdef INCL_SISUSB_CON 146#ifdef INCL_SISUSB_CON
@@ -152,7 +150,7 @@ struct sisusb_usb_data {
152 int haveconsole, con_first, con_last; 150 int haveconsole, con_first, con_last;
153 int havethisconsole[MAX_NR_CONSOLES]; 151 int havethisconsole[MAX_NR_CONSOLES];
154 int textmodedestroyed; 152 int textmodedestroyed;
155 unsigned int sisusb_num_columns; /* real number, not vt's idea */ 153 unsigned int sisusb_num_columns; /* real number, not vt's idea */
156 int cur_start_addr, con_rolled_over; 154 int cur_start_addr, con_rolled_over;
157 int sisusb_cursor_loc, bad_cursor_pos; 155 int sisusb_cursor_loc, bad_cursor_pos;
158 int sisusb_cursor_size_from; 156 int sisusb_cursor_size_from;
@@ -197,7 +195,7 @@ struct sisusb_packet {
197 unsigned short header; 195 unsigned short header;
198 u32 address; 196 u32 address;
199 u32 data; 197 u32 data;
200} __attribute__((__packed__)); 198} __attribute__ ((__packed__));
201 199
202#define CLEARPACKET(packet) memset(packet, 0, 10) 200#define CLEARPACKET(packet) memset(packet, 0, 10)
203 201
@@ -265,36 +263,36 @@ struct sisusb_packet {
265 263
266/* Structure argument for SISUSB_GET_INFO ioctl */ 264/* Structure argument for SISUSB_GET_INFO ioctl */
267struct sisusb_info { 265struct sisusb_info {
268 __u32 sisusb_id; /* for identifying sisusb */ 266 __u32 sisusb_id; /* for identifying sisusb */
269#define SISUSB_ID 0x53495355 /* Identify myself with 'SISU' */ 267#define SISUSB_ID 0x53495355 /* Identify myself with 'SISU' */
270 __u8 sisusb_version; 268 __u8 sisusb_version;
271 __u8 sisusb_revision; 269 __u8 sisusb_revision;
272 __u8 sisusb_patchlevel; 270 __u8 sisusb_patchlevel;
273 __u8 sisusb_gfxinit; /* graphics core initialized? */ 271 __u8 sisusb_gfxinit; /* graphics core initialized? */
274 272
275 __u32 sisusb_vrambase; 273 __u32 sisusb_vrambase;
276 __u32 sisusb_mmiobase; 274 __u32 sisusb_mmiobase;
277 __u32 sisusb_iobase; 275 __u32 sisusb_iobase;
278 __u32 sisusb_pcibase; 276 __u32 sisusb_pcibase;
279 277
280 __u32 sisusb_vramsize; /* framebuffer size in bytes */ 278 __u32 sisusb_vramsize; /* framebuffer size in bytes */
281 279
282 __u32 sisusb_minor; 280 __u32 sisusb_minor;
283 281
284 __u32 sisusb_fbdevactive; /* != 0 if framebuffer device active */ 282 __u32 sisusb_fbdevactive; /* != 0 if framebuffer device active */
285 283
286 __u32 sisusb_conactive; /* != 0 if console driver active */ 284 __u32 sisusb_conactive; /* != 0 if console driver active */
287 285
288 __u8 sisusb_reserved[28]; /* for future use */ 286 __u8 sisusb_reserved[28]; /* for future use */
289}; 287};
290 288
291struct sisusb_command { 289struct sisusb_command {
292 __u8 operation; /* see below */ 290 __u8 operation; /* see below */
293 __u8 data0; /* operation dependent */ 291 __u8 data0; /* operation dependent */
294 __u8 data1; /* operation dependent */ 292 __u8 data1; /* operation dependent */
295 __u8 data2; /* operation dependent */ 293 __u8 data2; /* operation dependent */
296 __u32 data3; /* operation dependent */ 294 __u32 data3; /* operation dependent */
297 __u32 data4; /* for future use */ 295 __u32 data4; /* for future use */
298}; 296};
299 297
300#define SUCMD_GET 0x01 /* for all: data0 = index, data3 = port */ 298#define SUCMD_GET 0x01 /* for all: data0 = index, data3 = port */
@@ -306,7 +304,7 @@ struct sisusb_command {
306 304
307#define SUCMD_CLRSCR 0x07 /* data0:1:2 = length, data3 = address */ 305#define SUCMD_CLRSCR 0x07 /* data0:1:2 = length, data3 = address */
308 306
309#define SUCMD_HANDLETEXTMODE 0x08 /* Reset/destroy text mode */ 307#define SUCMD_HANDLETEXTMODE 0x08 /* Reset/destroy text mode */
310 308
311#define SUCMD_SETMODE 0x09 /* Set a display mode (data3 = SiS mode) */ 309#define SUCMD_SETMODE 0x09 /* Set a display mode (data3 = SiS mode) */
312#define SUCMD_SETVESAMODE 0x0a /* Set a display mode (data3 = VESA mode) */ 310#define SUCMD_SETVESAMODE 0x0a /* Set a display mode (data3 = VESA mode) */
@@ -315,6 +313,4 @@ struct sisusb_command {
315#define SISUSB_GET_CONFIG_SIZE _IOR(0xF3,0x3E,__u32) 313#define SISUSB_GET_CONFIG_SIZE _IOR(0xF3,0x3E,__u32)
316#define SISUSB_GET_CONFIG _IOR(0xF3,0x3F,struct sisusb_info) 314#define SISUSB_GET_CONFIG _IOR(0xF3,0x3F,struct sisusb_info)
317 315
318
319#endif /* SISUSB_H */ 316#endif /* SISUSB_H */
320