Patchwork [v2,01/10] libcacard: change default ATR

login
register
mail settings
Submitter Alon Levy
Date March 27, 2013, 8:36 p.m.
Message ID <1364416595-25830-2-git-send-email-alevy@redhat.com>
Download mbox | patch
Permalink /patch/231821/
State New
Headers show

Comments

Alon Levy - March 27, 2013, 8:36 p.m.
Signed-off-by: Alon Levy <alevy@redhat.com>
---
 libcacard/vcardt.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Patch

diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
index 538bdde..3b9a619 100644
--- a/libcacard/vcardt.h
+++ b/libcacard/vcardt.h
@@ -26,9 +26,17 @@  typedef struct VCardEmulStruct VCardEmul;
 #define MAX_CHANNEL 4
 
 /* create an ATR with appropriate historical bytes */
-#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
-                               'V', 'C', 'A', 'R', 'D', '_'
+#define TS_DIRECT_CONVENTION 0x3b
+#define TA_PRESENT 0x10
+#define TB_PRESENT 0x20
+#define TC_PRESENT 0x40
+#define TD_PRESENT 0x80
 
+#define VCARD_ATR_PREFIX(size) \
+    TS_DIRECT_CONVENTION, \
+    TD_PRESENT + (6 + size), \
+    0x00, \
+    'V', 'C', 'A', 'R', 'D', '_'
 
 typedef enum {
     VCARD_DONE,