xref: /dragonfly/sys/dev/misc/cmx/cmxreg.h (revision 8af44722)
1 /*-
2  * Copyright (c) 2006-2007 Daniel Roethlisberger <daniel@roe.ch>
3  * Copyright (c) 2000-2004 OMNIKEY GmbH (www.omnikey.com)
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  *
27  * $FreeBSD: src/sys/dev/cmx/cmxreg.h,v 1.1 2008/03/06 08:09:45 rink Exp $
28  * $DragonFly: src/sys/dev/misc/cmx/cmxreg.h,v 1.1 2008/04/23 08:57:10 hasso Exp $
29  */
30 
31 /* I/O port registers */
32 #define REG_OFFSET_DTR			0	/* data transfer register */
33 #define REG_OFFSET_BSR			1	/* buffer status register */
34 #define REG_OFFSET_SCR			2	/* sync control register  */
35 
36 /* buffer status register flags */
37 #define BSR_BULK_OUT_FULL		0x01
38 #define BSR_BULK_IN_FULL		0x02
39 
40 /* sync control register flags */
41 #define SCR_POWER_DOWN			0x01
42 #define SCR_PULSE_INTERRUPT		0x02
43 #define SCR_HOST_TO_READER_DONE		0x04
44 #define SCR_READER_TO_HOST_DONE		0x08
45 #define SCR_ACK_NOTIFY			0x10
46 #define SCR_EN_NOTIFY			0x20
47 #define SCR_ABORT			0x40
48 #define SCR_HOST_TO_READER_START	0x80
49 
50 /* CCID commands */
51 #define CMD_PC_TO_RDR_SETPARAMETERS	0x61
52 #define CMD_PC_TO_RDR_ICCPOWERON	0x62
53 #define CMD_PC_TO_RDR_ICCPOWEROFF	0x63
54 #define CMD_PC_TO_RDR_GETSLOTSTATUS	0x65
55 #define CMD_PC_TO_RDR_SECURE		0x69
56 #define CMD_PC_TO_RDR_ESCAPE		0x6B
57 #define CMD_PC_TO_RDR_GETPARAMETERS	0x6C
58 #define CMD_PC_TO_RDR_RESETPARAMETERS	0x6D
59 #define CMD_PC_TO_RDR_ICCCLOCK		0x6E
60 #define CMD_PC_TO_RDR_XFRBLOCK		0x6F
61 #define CMD_PC_TO_RDR_TEST_SECURE	0x74
62 #define CMD_PC_TO_RDR_OK_SECURE		0x89
63 #define CMD_RDR_TO_PC_DATABLOCK		0x80
64 #define CMD_RDR_TO_PC_SLOTSTATUS	0x81
65 #define CMD_RDR_TO_PC_PARAMETERS	0x82
66 #define CMD_RDR_TO_PC_ESCAPE		0x83
67 #define CMD_RDR_TO_PC_OK_SECURE		0x89
68