- reduced binary size with AES constants, there was twice included (thanks to lpm11...
[oscam.git] / csctapi / icc_async.h
blobd4577fc49d6ea161d0ab199bd4fb0a1aa2aab228
1 /*
2 icc_async.h
3 Asynchronous integrated circuit cards handling functions
5 This file is part of the Unix driver for Towitoko smartcard readers
6 Copyright (C) 2000 2001 Carlos Prados <cprados@yahoo.com>
8 This version is modified by doz21 to work in a special manner ;)
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version.
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #ifndef _ICC_ASYNC_
26 #define _ICC_ASYNC_
28 #include "atr.h"
31 * Exported types definition
34 /* Initialization and Deactivation */
35 int32_t ICC_Async_Activate(struct s_reader *reader, ATR *newatr, uint16_t deprecated);
36 int32_t ICC_Async_Close(struct s_reader *reader);
37 int32_t ICC_Async_Device_Init(struct s_reader *reader);
38 int32_t ICC_Async_Init_Locks(void);
40 /* Attributes */
41 int32_t ICC_Async_GetTimings(struct s_reader *reader, uint32_t wait_etu);
42 int32_t ICC_Async_GetStatus(struct s_reader *reader, int32_t *has_card);
44 /* Operations */
45 int32_t ICC_Async_CardWrite(struct s_reader *reader, unsigned char *cmd, uint16_t lc, unsigned char *rsp, uint16_t *lr);
46 int32_t ICC_Async_Transmit(struct s_reader *reader, uint32_t size, uint32_t expectedlen, unsigned char *buffer, uint32_t delay, uint32_t timeout);
47 int32_t ICC_Async_Receive(struct s_reader *reader, uint32_t size, unsigned char *buffer, uint32_t delay, uint32_t timeout);
49 void ICC_Async_DisplayMsg(struct s_reader *, char *msg);
50 int32_t ICC_Async_Reset(struct s_reader *, struct s_ATR *, int32_t (*rdr_activate_card)(struct s_reader *, struct s_ATR *, uint16_t deprecated), int32_t (*rdr_get_cardsystem)(struct s_reader *, struct s_ATR *));
52 #ifdef READER_NAGRA_MERLIN
53 void calculate_cak7_cmd(struct s_reader *reader, uint8_t *cmdin,uint8_t cmdlen,uint8_t *cmdout);
54 void do_cak7_cmd(struct s_reader *reader,unsigned char *cta_res, uint16_t *p_cta_lr,uint8_t *data,uint8_t inlen,uint8_t resplen);
55 #endif
57 #endif /* _ICC_ASYNC_ */