[Pcsclite-cvs-commit] Drivers/ccid/src/protocol_t1 protocol_t1.h,1.1,1.2 protocol_t1.c,1.4,1.5

rousseau@quantz.debian.org rousseau@quantz.debian.org
Wed, 11 Feb 2004 11:10:31 +0100


Update of /cvsroot/pcsclite/Drivers/ccid/src/protocol_t1
In directory quantz:/tmp/cvs-serv880/protocol_t1

Modified Files:
	protocol_t1.h protocol_t1.c 
Log Message:
add Protocol_T1_Negociate_IFSD()


Index: protocol_t1.h
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/protocol_t1/protocol_t1.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- protocol_t1.h	15 Jan 2004 14:34:21 -0000	1.1
+++ protocol_t1.h	11 Feb 2004 10:10:29 -0000	1.2
@@ -55,6 +55,10 @@
  * Exported functions declaration
  */
 
+/* negociate IFSD */
+int
+Protocol_T1_Negociate_IFSD(Protocol_T1 * t1, int ifsd);
+
 /* Create a new protocol handler */
 extern Protocol_T1 * 
 Protocol_T1_New (void);

Index: protocol_t1.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/protocol_t1/protocol_t1.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- protocol_t1.c	3 Feb 2004 15:42:24 -0000	1.4
+++ protocol_t1.c	11 Feb 2004 10:10:29 -0000	1.5
@@ -64,6 +64,26 @@
  */
 
 int
+Protocol_T1_Negociate_IFSD(Protocol_T1 * t1, int ifsd)
+{
+	T1_Block *sblock;
+	BYTE inf[1];
+
+	inf[0] = ifsd;
+	sblock = T1_Block_NewSBlock(T1_BLOCK_S_IFS_REQ, 1, inf);
+
+	Protocol_T1_SendBlock(t1, sblock);
+	T1_Block_Delete(sblock);
+
+	Protocol_T1_ReceiveBlock(t1, &sblock);
+
+	DEBUG_XXD("data: ", sblock -> data, sblock -> length);
+	t1 -> ifsd = T1_Block_GetInf(sblock)[0];
+
+	return PROTOCOL_T1_OK;
+} /* Protocol_T1_Negociate_IFSD */
+
+int
 Protocol_T1_Init (Protocol_T1 * t1, int lun)
 {
   BYTE ta, tc;
@@ -99,9 +119,6 @@
   /* Set initial send sequence (NS) */
   t1->ns = 1;
   
-  DEBUG_COMM4 ("T=1: IFSC=%d, IFSD=%d, EDC=%s\n",
-     t1->ifsc, t1->ifsd, (t1->edc == PROTOCOL_T1_EDC_LRC) ? "LRC" : "CRC");
-
   return PROTOCOL_T1_OK;
 }