2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* cs.h
|
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*
|
|
|
|
* The initial developer of the original code is David A. Hinds
|
|
|
|
* <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
|
|
|
|
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* (C) 1999 David A. Hinds
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LINUX_CS_H
|
|
|
|
#define _LINUX_CS_H
|
|
|
|
|
2009-11-08 16:24:46 +00:00
|
|
|
#ifdef __KERNEL__
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#endif
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/* ModifyConfiguration */
|
|
|
|
typedef struct modconf_t {
|
|
|
|
u_int Attributes;
|
|
|
|
u_int Vcc, Vpp1, Vpp2;
|
|
|
|
} modconf_t;
|
|
|
|
|
|
|
|
/* Attributes for ModifyConfiguration */
|
2006-01-15 10:18:12 +00:00
|
|
|
#define CONF_IRQ_CHANGE_VALID 0x0100
|
|
|
|
#define CONF_VCC_CHANGE_VALID 0x0200
|
|
|
|
#define CONF_VPP1_CHANGE_VALID 0x0400
|
|
|
|
#define CONF_VPP2_CHANGE_VALID 0x0800
|
|
|
|
#define CONF_IO_CHANGE_WIDTH 0x1000
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* For RequestConfiguration */
|
|
|
|
typedef struct config_req_t {
|
|
|
|
u_int Attributes;
|
2006-01-15 11:43:16 +00:00
|
|
|
u_int Vpp; /* both Vpp1 and Vpp2 */
|
2005-04-16 22:20:36 +00:00
|
|
|
u_int IntType;
|
|
|
|
u_int ConfigBase;
|
|
|
|
u_char Status, Pin, Copy, ExtStatus;
|
|
|
|
u_char ConfigIndex;
|
|
|
|
u_int Present;
|
|
|
|
} config_req_t;
|
|
|
|
|
|
|
|
/* Attributes for RequestConfiguration */
|
|
|
|
#define CONF_ENABLE_IRQ 0x01
|
|
|
|
#define CONF_ENABLE_DMA 0x02
|
|
|
|
#define CONF_ENABLE_SPKR 0x04
|
2010-03-07 09:58:29 +00:00
|
|
|
#define CONF_ENABLE_PULSE_IRQ 0x08
|
2005-04-16 22:20:36 +00:00
|
|
|
#define CONF_VALID_CLIENT 0x100
|
|
|
|
|
|
|
|
/* IntType field */
|
|
|
|
#define INT_MEMORY 0x01
|
|
|
|
#define INT_MEMORY_AND_IO 0x02
|
|
|
|
#define INT_CARDBUS 0x04
|
|
|
|
#define INT_ZOOMED_VIDEO 0x08
|
|
|
|
|
|
|
|
/* Configuration registers present */
|
|
|
|
#define PRESENT_OPTION 0x001
|
|
|
|
#define PRESENT_STATUS 0x002
|
|
|
|
#define PRESENT_PIN_REPLACE 0x004
|
|
|
|
#define PRESENT_COPY 0x008
|
|
|
|
#define PRESENT_EXT_STATUS 0x010
|
|
|
|
#define PRESENT_IOBASE_0 0x020
|
|
|
|
#define PRESENT_IOBASE_1 0x040
|
|
|
|
#define PRESENT_IOBASE_2 0x080
|
|
|
|
#define PRESENT_IOBASE_3 0x100
|
|
|
|
#define PRESENT_IOSIZE 0x200
|
|
|
|
|
|
|
|
/* For RequestWindow */
|
|
|
|
typedef struct win_req_t {
|
|
|
|
u_int Attributes;
|
|
|
|
u_long Base;
|
|
|
|
u_int Size;
|
|
|
|
u_int AccessSpeed;
|
|
|
|
} win_req_t;
|
|
|
|
|
|
|
|
/* Attributes for RequestWindow */
|
2010-07-24 17:03:02 +00:00
|
|
|
#define WIN_MEMORY_TYPE_CM 0x00 /* default */
|
|
|
|
#define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */
|
|
|
|
#define WIN_DATA_WIDTH_8 0x00 /* default */
|
|
|
|
#define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */
|
|
|
|
#define WIN_ENABLE 0x01 /* MAP_ACTIVE */
|
|
|
|
#define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */
|
|
|
|
|
|
|
|
#define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE |
|
|
|
|
MAP_USE_WAIT */
|
|
|
|
#define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]:
|
|
|
|
0x04 -> 0
|
|
|
|
0x08 -> 1
|
|
|
|
0x0c -> 2
|
|
|
|
0x10 -> 3 */
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#endif /* _LINUX_CS_H */
|