1. 20 Jul, 2014 2 commits
    • Mark A. Greer's avatar
      NFC: digital: Clear poll_tech_count before activating target · 0529a7ad
      Mark A. Greer authored
      Currently, digital_target_found() has a race between
      the events started by calling nfc_targets_found()
      (which ultimately expect ddev->poll_tech_count to be
      zero) and setting ddev->poll_tech_count to zero after
      the call to nfc_targets_found().  When the race is
      "lost" (i.e., ddev->poll_tech_count is found to not
      be zero by the events started by nfc_targets_found()),
      an error message is printed and the target is not found.
      A similar race exists when digital_tg_recv_atr_req()
      calls nfc_tm_activated().
      
      Fix this by first saving the current value of
      ddev->poll_tech_count and then clearing it before
      calling nfc_targets_found()/nfc_tm_activated().
      Clearing ddev->poll_tech_count before calling
      nfc_targets_found()/nfc_tm_activated() eliminates
      the race.  Saving the value is required so it can be
      restored when nfc_targets_found()/nfc_tm_activated()
      fails and polling needs to continue.
      Acked-by: default avatarThierry Escande <thierry.escande@linux.intel.com>
      Signed-off-by: default avatarMark A. Greer <mgreer@animalcreek.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      0529a7ad
    • Mark A. Greer's avatar
      NFC: digital: Check for NFC-DEP before checking for Type 4 tag · 4b4dbca5
      Mark A. Greer authored
      In digital_in_recv_sel_res(), the code that determines
      the tag type will interpret bits 7:6 (lsb being b1 as
      per the Digital Specification) of a SEL RES set to 11b
      as a Type 4 tag.  This is okay except that the neard
      will interpret the same value as an NFC-DEP device
      (in src/tag.c:set_tag_type() in the neard source).
      
      Make the digital layer's interpretation match neard's
      interpretation by changing the order of the checks in
      digital_in_recv_sel_res() so that a value of 11b in
      bits 7:6 is interpreted as an NFC-DEP device instead
      of a Type 4 tag.
      Acked-by: default avatarThierry Escande <thierry.escande@linux.intel.com>
      Signed-off-by: default avatarMark A. Greer <mgreer@animalcreek.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      4b4dbca5
  2. 18 Jul, 2014 24 commits
  3. 16 Jul, 2014 1 commit
  4. 15 Jul, 2014 13 commits