Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * cs.h |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | * |
| 8 | * The initial developer of the original code is David A. Hinds |
| 9 | * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds |
| 10 | * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. |
| 11 | * |
| 12 | * (C) 1999 David A. Hinds |
| 13 | */ |
| 14 | |
| 15 | #ifndef _LINUX_CS_H |
| 16 | #define _LINUX_CS_H |
| 17 | |
Dominik Brodowski | 5fa9167 | 2009-11-08 17:24:46 +0100 | [diff] [blame] | 18 | #ifdef __KERNEL__ |
| 19 | #include <linux/interrupt.h> |
| 20 | #endif |
| 21 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | /* ModifyConfiguration */ |
| 23 | typedef struct modconf_t { |
| 24 | u_int Attributes; |
| 25 | u_int Vcc, Vpp1, Vpp2; |
| 26 | } modconf_t; |
| 27 | |
| 28 | /* Attributes for ModifyConfiguration */ |
Dominik Brodowski | 4bbed52 | 2006-01-15 11:18:12 +0100 | [diff] [blame] | 29 | #define CONF_IRQ_CHANGE_VALID 0x0100 |
| 30 | #define CONF_VCC_CHANGE_VALID 0x0200 |
| 31 | #define CONF_VPP1_CHANGE_VALID 0x0400 |
| 32 | #define CONF_VPP2_CHANGE_VALID 0x0800 |
| 33 | #define CONF_IO_CHANGE_WIDTH 0x1000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | |
| 35 | /* For RequestConfiguration */ |
| 36 | typedef struct config_req_t { |
| 37 | u_int Attributes; |
Dominik Brodowski | 70294b4 | 2006-01-15 12:43:16 +0100 | [diff] [blame] | 38 | u_int Vpp; /* both Vpp1 and Vpp2 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | u_int IntType; |
| 40 | u_int ConfigBase; |
| 41 | u_char Status, Pin, Copy, ExtStatus; |
| 42 | u_char ConfigIndex; |
| 43 | u_int Present; |
| 44 | } config_req_t; |
| 45 | |
| 46 | /* Attributes for RequestConfiguration */ |
| 47 | #define CONF_ENABLE_IRQ 0x01 |
| 48 | #define CONF_ENABLE_DMA 0x02 |
| 49 | #define CONF_ENABLE_SPKR 0x04 |
Dominik Brodowski | a7debe7 | 2010-03-07 10:58:29 +0100 | [diff] [blame] | 50 | #define CONF_ENABLE_PULSE_IRQ 0x08 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | #define CONF_VALID_CLIENT 0x100 |
| 52 | |
| 53 | /* IntType field */ |
| 54 | #define INT_MEMORY 0x01 |
| 55 | #define INT_MEMORY_AND_IO 0x02 |
| 56 | #define INT_CARDBUS 0x04 |
| 57 | #define INT_ZOOMED_VIDEO 0x08 |
| 58 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | /* Configuration registers present */ |
| 60 | #define PRESENT_OPTION 0x001 |
| 61 | #define PRESENT_STATUS 0x002 |
| 62 | #define PRESENT_PIN_REPLACE 0x004 |
| 63 | #define PRESENT_COPY 0x008 |
| 64 | #define PRESENT_EXT_STATUS 0x010 |
| 65 | #define PRESENT_IOBASE_0 0x020 |
| 66 | #define PRESENT_IOBASE_1 0x040 |
| 67 | #define PRESENT_IOBASE_2 0x080 |
| 68 | #define PRESENT_IOBASE_3 0x100 |
| 69 | #define PRESENT_IOSIZE 0x200 |
| 70 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | /* For RequestWindow */ |
| 72 | typedef struct win_req_t { |
| 73 | u_int Attributes; |
| 74 | u_long Base; |
| 75 | u_int Size; |
| 76 | u_int AccessSpeed; |
| 77 | } win_req_t; |
| 78 | |
| 79 | /* Attributes for RequestWindow */ |
Dominik Brodowski | 0ca724d | 2010-07-24 19:03:02 +0200 | [diff] [blame] | 80 | #define WIN_MEMORY_TYPE_CM 0x00 /* default */ |
| 81 | #define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */ |
| 82 | #define WIN_DATA_WIDTH_8 0x00 /* default */ |
| 83 | #define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */ |
| 84 | #define WIN_ENABLE 0x01 /* MAP_ACTIVE */ |
| 85 | #define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */ |
| 86 | |
| 87 | #define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE | |
| 88 | MAP_USE_WAIT */ |
| 89 | #define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]: |
| 90 | 0x04 -> 0 |
| 91 | 0x08 -> 1 |
| 92 | 0x0c -> 2 |
| 93 | 0x10 -> 3 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | #endif /* _LINUX_CS_H */ |