From patchwork Tue Jul 28 16:36:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: etienne X-Patchwork-Id: 501305 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (unknown [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 25E36140D25 for ; Wed, 29 Jul 2015 02:42:43 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 528995C6A; Tue, 28 Jul 2015 16:42:36 +0000 (UTC) X-Original-To: baseband-devel@lists.osmocom.org Delivered-To: baseband-devel@lists.osmocom.org X-Greylist: delayed 383 seconds by postgrey-1.34 at lists.osmocom.org; Tue, 28 Jul 2015 16:42:34 UTC Received: from mwork.nabble.com (mwork.nabble.com [162.253.133.43]) by lists.osmocom.org (Postfix) with ESMTP id AF5115C5C for ; Tue, 28 Jul 2015 16:42:34 +0000 (UTC) Received: from mben.nabble.com (unknown [162.253.133.72]) by mwork.nabble.com (Postfix) with ESMTP id 3AA8F24A8608 for ; Tue, 28 Jul 2015 09:36:18 -0700 (PDT) Date: Tue, 28 Jul 2015 09:36:09 -0700 (MST) From: etienne To: baseband-devel@lists.osmocom.org Message-ID: <1438101369892-4026719.post@n3.nabble.com> Subject: [patch] sim.c waiting char issue MIME-Version: 1.0 X-BeenThere: baseband-devel@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OsmocomBB - open source GSM baseband firmware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: baseband-devel-bounces@lists.osmocom.org Sender: "baseband-devel" Hello, The sim driver was not working with my sim card. After some successful apdu requests, it was ceasing to work. It turned out that the sim is sending waiting chars before some rx acks. The following patch solved the problem. Regards, Etienne --- View this message in context: http://baseband-devel.722152.n3.nabble.com/patch-sim-c-waiting-char-issue-tp4026719.html Sent from the baseband-devel mailing list archive at Nabble.com. diff --git a/src/target/firmware/calypso/sim.c b/src/target/firmware/calypso/sim.c index 752628f..b35909f 100644 --- a/src/target/firmware/calypso/sim.c +++ b/src/target/firmware/calypso/sim.c @@ -536,6 +536,8 @@ void sim_handler(void) /* Case 2: No input / Output of known length */ if (mode == SIM_APDU_PUT) { sim_state = SIM_STATE_RX_ACK; + /* ignore waiting char here*/ + sim_ignore_waiting_char = 1; calypso_sim_receive(response, 1); break; /* Case 4: Input / No output */ @@ -563,6 +565,8 @@ void sim_handler(void) break; /* wait until data is received */ /* Disable all interrupt driven functions */ writew(0xFF, REG_SIM_MASKIT); + /*stop ignoring waiting char*/ + sim_ignore_waiting_char = 0; /* error received */ if (sim_rx_character_count == 2) { puts("SIM: command failed\n");