xref: /dflybsd-src/sys/dev/misc/cmx/cmxreg.h (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino /*-
286d7f5d3SJohn Marino  * Copyright (c) 2006-2007 Daniel Roethlisberger <daniel@roe.ch>
386d7f5d3SJohn Marino  * Copyright (c) 2000-2004 OMNIKEY GmbH (www.omnikey.com)
486d7f5d3SJohn Marino  * All rights reserved.
586d7f5d3SJohn Marino  *
686d7f5d3SJohn Marino  * Redistribution and use in source and binary forms, with or without
786d7f5d3SJohn Marino  * modification, are permitted provided that the following conditions
886d7f5d3SJohn Marino  * are met:
986d7f5d3SJohn Marino  * 1. Redistributions of source code must retain the above copyright
1086d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer.
1186d7f5d3SJohn Marino  * 2. Redistributions in binary form must reproduce the above copyright
1286d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer in the
1386d7f5d3SJohn Marino  *    documentation and/or other materials provided with the distribution.
1486d7f5d3SJohn Marino  *
1586d7f5d3SJohn Marino  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1686d7f5d3SJohn Marino  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1786d7f5d3SJohn Marino  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1886d7f5d3SJohn Marino  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1986d7f5d3SJohn Marino  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2086d7f5d3SJohn Marino  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2186d7f5d3SJohn Marino  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2286d7f5d3SJohn Marino  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2386d7f5d3SJohn Marino  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2486d7f5d3SJohn Marino  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2586d7f5d3SJohn Marino  * SUCH DAMAGE.
2686d7f5d3SJohn Marino  *
2786d7f5d3SJohn Marino  * $FreeBSD: src/sys/dev/cmx/cmxreg.h,v 1.1 2008/03/06 08:09:45 rink Exp $
2886d7f5d3SJohn Marino  * $DragonFly: src/sys/dev/misc/cmx/cmxreg.h,v 1.1 2008/04/23 08:57:10 hasso Exp $
2986d7f5d3SJohn Marino  */
3086d7f5d3SJohn Marino 
3186d7f5d3SJohn Marino /* I/O port registers */
3286d7f5d3SJohn Marino #define REG_OFFSET_DTR			0	/* data transfer register */
3386d7f5d3SJohn Marino #define REG_OFFSET_BSR			1	/* buffer status register */
3486d7f5d3SJohn Marino #define REG_OFFSET_SCR			2	/* sync control register  */
3586d7f5d3SJohn Marino 
3686d7f5d3SJohn Marino /* buffer status register flags */
3786d7f5d3SJohn Marino #define BSR_BULK_OUT_FULL		0x01
3886d7f5d3SJohn Marino #define BSR_BULK_IN_FULL		0x02
3986d7f5d3SJohn Marino 
4086d7f5d3SJohn Marino /* sync control register flags */
4186d7f5d3SJohn Marino #define SCR_POWER_DOWN			0x01
4286d7f5d3SJohn Marino #define SCR_PULSE_INTERRUPT		0x02
4386d7f5d3SJohn Marino #define SCR_HOST_TO_READER_DONE		0x04
4486d7f5d3SJohn Marino #define SCR_READER_TO_HOST_DONE		0x08
4586d7f5d3SJohn Marino #define SCR_ACK_NOTIFY			0x10
4686d7f5d3SJohn Marino #define SCR_EN_NOTIFY			0x20
4786d7f5d3SJohn Marino #define SCR_ABORT			0x40
4886d7f5d3SJohn Marino #define SCR_HOST_TO_READER_START	0x80
4986d7f5d3SJohn Marino 
5086d7f5d3SJohn Marino /* CCID commands */
5186d7f5d3SJohn Marino #define CMD_PC_TO_RDR_SETPARAMETERS	0x61
5286d7f5d3SJohn Marino #define CMD_PC_TO_RDR_ICCPOWERON	0x62
5386d7f5d3SJohn Marino #define CMD_PC_TO_RDR_ICCPOWEROFF	0x63
5486d7f5d3SJohn Marino #define CMD_PC_TO_RDR_GETSLOTSTATUS	0x65
5586d7f5d3SJohn Marino #define CMD_PC_TO_RDR_SECURE		0x69
5686d7f5d3SJohn Marino #define CMD_PC_TO_RDR_ESCAPE		0x6B
5786d7f5d3SJohn Marino #define CMD_PC_TO_RDR_GETPARAMETERS	0x6C
5886d7f5d3SJohn Marino #define CMD_PC_TO_RDR_RESETPARAMETERS	0x6D
5986d7f5d3SJohn Marino #define CMD_PC_TO_RDR_ICCCLOCK		0x6E
6086d7f5d3SJohn Marino #define CMD_PC_TO_RDR_XFRBLOCK		0x6F
6186d7f5d3SJohn Marino #define CMD_PC_TO_RDR_TEST_SECURE	0x74
6286d7f5d3SJohn Marino #define CMD_PC_TO_RDR_OK_SECURE		0x89
6386d7f5d3SJohn Marino #define CMD_RDR_TO_PC_DATABLOCK		0x80
6486d7f5d3SJohn Marino #define CMD_RDR_TO_PC_SLOTSTATUS	0x81
6586d7f5d3SJohn Marino #define CMD_RDR_TO_PC_PARAMETERS	0x82
6686d7f5d3SJohn Marino #define CMD_RDR_TO_PC_ESCAPE		0x83
6786d7f5d3SJohn Marino #define CMD_RDR_TO_PC_OK_SECURE		0x89
68