Return-path: Received: from mail-qa0-f46.google.com ([209.85.216.46]:58541 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753822Ab2CWSxp (ORCPT ); Fri, 23 Mar 2012 14:53:45 -0400 Received: by qaeb19 with SMTP id b19so1131566qae.19 for ; Fri, 23 Mar 2012 11:53:44 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1332524894.5884.15.camel@sortiz-mobl> References: <4F6C5C59.2060708@linux.intel.com> <1332524894.5884.15.camel@sortiz-mobl> Date: Fri, 23 Mar 2012 15:53:44 -0300 Message-ID: (sfid-20120323_195348_543477_A189B056) Subject: Re: [PATCH] NFC: Add Core support to generate tag lost event From: Lauro Ramos Venancio To: Samuel Ortiz Cc: Eric Lapuyade , "John W. Linville" , linux-wireless@vger.kernel.org, Samuel Ortiz , Aloisio Almeida Jr Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: HI Samuel, 2012/3/23 Samuel Ortiz : > On Fri, 2012-03-23 at 14:11 -0300, Lauro Ramos Venancio wrote: >> 2012/3/23 Eric Lapuyade : >> > Some HW/drivers get notifications when a tag moves out of the radio field. >> > This notification is now forwarded to user space through netlink. >> >> I think to put a timer in the NFC core is not the best solution for >> this problem. >> This solution is not suitable for devices that receive an event when >> the tag moves out of the field. > One more thing: If the device provides such capability, the driver can > then call nfc_target_lost() directly, and not register a > presence_check() ops. Without such an ops, the timer won't get started, > obviously. > presence_check() is for drivers that are limited to asking the firmware > about the target being on the field or not. > I am fine with this kind of solution. My concern is that, maybe, it shouldn't be put in the core. We should avoid having an event that is sometimes generated by the device driver and sometimes generated by the core. My suggestion is to make the check_presence the first helper function in a "nfc-utils". The device drivers would be able to decide to use or not the nfc-utils helpers. The nfc core would be cleaner and would be easier to anyone understand what must be implemented in a new device driver. This is just a suggestion. I will no oppose if you decide to keep the current implementation. Regards, Lauro