From eabcec107ed6078468f48f913679f7e15bc5ff5c Mon Sep 17 00:00:00 2001 From: Niibe Yutaka Date: Fri, 17 Jun 2016 14:54:52 +0900 Subject: [PATCH] Update to Chopstx 1.0 --- ChangeLog | 4 ++++ chopstx | 2 +- src/usb-ccid.c | 23 +++++++++++++---------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13eb7d2..c9200e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2016-06-17 Niibe Yutaka + + * chopstx: Update to 1.0. + 2016-06-15 NIIBE Yutaka * src/gnuk.ld.in (__process2_stack_size__): Update diff --git a/chopstx b/chopstx index 52626a3..40adf95 160000 --- a/chopstx +++ b/chopstx @@ -1 +1 @@ -Subproject commit 52626a33684f4124c468d946deba82e44afab1bd +Subproject commit 40adf95c24f85f475896e1c55e1af5f32349729a diff --git a/src/usb-ccid.c b/src/usb-ccid.c index 8fa04dc..6288c16 100644 --- a/src/usb-ccid.c +++ b/src/usb-ccid.c @@ -1492,13 +1492,8 @@ ccid_thread (void *arg) { chopstx_intr_t interrupt; uint32_t timeout; - eventmask_t m; struct usb_dev dev; - - struct ep_in *epi = &endpoint_in; - struct ep_out *epo = &endpoint_out; struct ccid *c = &ccid; - struct apdu *a = &apdu; (void)arg; @@ -1510,10 +1505,16 @@ ccid_thread (void *arg) usb_event_handle (&dev); /* For old SYS < 3.0 */ device_reset: - epi_init (epi, ENDP1, notify_tx, c); - epo_init (epo, ENDP1, notify_icc, c); - apdu_init (a); - ccid_init (c, epi, epo, a); + { + struct ep_in *epi = &endpoint_in; + struct ep_out *epo = &endpoint_out; + struct apdu *a = &apdu; + + epi_init (epi, ENDP1, notify_tx, c); + epo_init (epo, ENDP1, notify_icc, c); + apdu_init (a); + ccid_init (c, epi, epo, a); + } while (bDeviceState != CONFIGURED) { @@ -1521,7 +1522,7 @@ ccid_thread (void *arg) if (interrupt.ready) usb_event_handle (&dev); - m = eventflag_get (&c->ccid_comm); + eventflag_get (&c->ccid_comm); /* Ignore event while not-configured. */ } @@ -1531,6 +1532,8 @@ ccid_thread (void *arg) ccid_notify_slot_change (c); while (1) { + eventmask_t m; + poll_event_intr (&timeout, &c->ccid_comm, &interrupt); if (interrupt.ready) {