From patchwork Fri Jun 16 03:57:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Greer X-Patchwork-Id: 9790485 X-Patchwork-Delegate: sameo@linux.intel.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 19B5760326 for ; Fri, 16 Jun 2017 03:57:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03F582841D for ; Fri, 16 Jun 2017 03:57:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECC262856A; Fri, 16 Jun 2017 03:57:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88CA42841D for ; Fri, 16 Jun 2017 03:57:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbdFPD5j (ORCPT ); Thu, 15 Jun 2017 23:57:39 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:44555 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751641AbdFPD5b (ORCPT ); Thu, 15 Jun 2017 23:57:31 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 4E5FC2082D; Thu, 15 Jun 2017 23:57:30 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Thu, 15 Jun 2017 23:57:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=animalcreek.com; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=5l2 KcVjfDixxjXPhapfCTnbOsKQorfnW6FzWKnbQYFk=; b=JSpiy8J6KyPoGZt+YYg 9M40v5en123OUO0kzZjlRH6jF6Q9BVI1ezDRuWDNA+6W+7XoJ8RUB1iTTdLKIREI ta//6/OjGlbsYIkQu+1dclo9Ev66OtsVqpNs+GJwcwe/0uFTfro/hL93UdPFXHMK aoF00mQsEXE/YdpU09F0cckY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=5l2KcVjfDixxjXPhapfCTnbOsKQorfnW6FzWKnbQY Fk=; b=p8ZgRDGk3gEwYLPR+EkyHaCEw/hnOoPKX8hu9ztqWcJYKyIU6Gy8e66VD BqMsu8l7aDV1v0DFhHlMbrJ2005TkAfnz1kUUWBLnHVADAFrfvrrtX5TcyOx2oKj wYLgJLz94qqZOejPOg1pyQchmOLyFxXYa4Dr456z7DexJDndPGBLHXIgHNU8oHvT 0815N80s/kULTsdoWfeCFHNe1R7UI1dZiz7oqPoQFh1VynPKePnF/Isit8S/Pq0W o3TjYZmkqsERc7U5bwsne4Snfhsyw/LawghJ8LAE3h0Irbii+Mh0lUfH6D4dWPjg gLRoZIspOGSXpGMGsmRzXrvSKpKxw== X-ME-Sender: X-Sasl-enc: MB+zLUqcZtt+iDJL2fhyBhcVefFMykF+YfZyAe3llgHd 1497585450 Received: from blue.animalcreek.com (ip68-2-81-12.ph.ph.cox.net [68.2.81.12]) by mail.messagingengine.com (Postfix) with ESMTPA id 009B6241E0; Thu, 15 Jun 2017 23:57:30 -0400 (EDT) Received: from blue.animalcreek.com (localhost [127.0.0.1]) by blue.animalcreek.com (Postfix) with ESMTP id 6D94FA2029A; Thu, 15 Jun 2017 20:57:29 -0700 (MST) From: Mark Greer To: Samuel Ortiz Cc: linux-wireless@vger.kernel.org, linux-nfc@lists.01.org, Mark Greer Subject: [PATCH 1/4] adapter: Make adapter_start_poll() global Date: Thu, 15 Jun 2017 20:57:25 -0700 Message-Id: <20170616035728.19415-2-mgreer@animalcreek.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170616035728.19415-1-mgreer@animalcreek.com> References: <20170616035728.19415-1-mgreer@animalcreek.com> Organization: Animal Creek Technologies, Inc. Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP An upcoming commit will need to call adapter_start_poll() from the tag code so make it global. To be consistent with the names of other global routines in adapter.c, add the '__near_' prefix. Signed-off-by: Mark Greer --- src/adapter.c | 22 +++++++++++----------- src/near.h | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 9e3e75e..e8c7c61 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -152,7 +152,7 @@ static void rf_mode_changed(struct near_adapter *adapter) NFC_ADAPTER_INTERFACE, "Mode"); } -static int adapter_start_poll(struct near_adapter *adapter) +int __near_adapter_start_poll(struct near_adapter *adapter) { int err; uint32_t im_protos, tm_protos; @@ -375,7 +375,7 @@ static DBusMessage *start_poll_loop(DBusConnection *conn, else adapter->poll_mode = NEAR_ADAPTER_MODE_INITIATOR; - err = adapter_start_poll(adapter); + err = __near_adapter_start_poll(adapter); if (err < 0) return __near_error_failed(msg, -err); @@ -433,7 +433,7 @@ static gboolean check_presence(gpointer user_data) out_err: near_adapter_disconnect(adapter->idx); if (adapter->constant_poll) - adapter_start_poll(adapter); + __near_adapter_start_poll(adapter); return FALSE; } @@ -447,7 +447,7 @@ static gboolean dep_timer(gpointer user_data) if (!adapter) return FALSE; - adapter_start_poll(adapter); + __near_adapter_start_poll(adapter); return FALSE; } @@ -469,7 +469,7 @@ static void tag_present_cb(uint32_t adapter_idx, uint32_t target_idx, near_adapter_disconnect(adapter->idx); if (adapter->constant_poll) - adapter_start_poll(adapter); + __near_adapter_start_poll(adapter); return; } @@ -606,7 +606,7 @@ int __near_adapter_set_dep_state(uint32_t idx, bool dep) * that very moment. In this case we need to try polling later * again, so constant polling will work properly. */ - if(adapter_start_poll(adapter) == -EBUSY) { + if(__near_adapter_start_poll(adapter) == -EBUSY) { near_error("Adapter is busy, retry polling later"); g_timeout_add_seconds(1, dep_timer, adapter); } @@ -688,7 +688,7 @@ static void tag_read_cb(uint32_t adapter_idx, uint32_t target_idx, int status) if (status < 0) { near_adapter_disconnect(adapter->idx); if (adapter->constant_poll) - adapter_start_poll(adapter); + __near_adapter_start_poll(adapter); return; } @@ -717,7 +717,7 @@ static void device_read_cb(uint32_t adapter_idx, uint32_t target_idx, } if (adapter->constant_poll) - adapter_start_poll(adapter); + __near_adapter_start_poll(adapter); return; } @@ -838,7 +838,7 @@ int __near_adapter_add_target(uint32_t idx, uint32_t target_idx, iso15693_uid_len, iso15693_uid); if (ret < 0 && adapter->constant_poll) - adapter_start_poll(adapter); + __near_adapter_start_poll(adapter); return ret; } @@ -879,7 +879,7 @@ static gboolean poll_error(gpointer user_data) __near_netlink_adapter_enable(adapter->idx, true); } - adapter_start_poll(adapter); + __near_adapter_start_poll(adapter); return FALSE; } @@ -954,7 +954,7 @@ int __near_adapter_remove_device(uint32_t idx) adapter->dep_up = false; if (adapter->constant_poll) - adapter_start_poll(adapter); + __near_adapter_start_poll(adapter); return 0; } diff --git a/src/near.h b/src/near.h index 1ac6191..7795e61 100644 --- a/src/near.h +++ b/src/near.h @@ -94,6 +94,7 @@ int __near_adapter_remove_device(uint32_t idx); int __near_adapter_set_dep_state(uint32_t idx, bool dep); bool __near_adapter_get_dep_state(uint32_t idx); void __near_adapter_listen(struct near_device_driver *driver); +int __near_adapter_start_poll(struct near_adapter *adapter); void __near_adapter_start_check_presence(uint32_t adapter_idx, uint32_t target_idx); void __near_adapter_stop_check_presence(uint32_t adapter_idx, uint32_t target_idx); int __near_adapter_init(void);