1. 19 Jul, 2016 1 commit
  2. 11 Jul, 2016 3 commits
  3. 10 Jul, 2016 5 commits
    • Thierry Escande's avatar
      NFC: digital: Rework ACK PDU handling in initiator mode · e073eb67
      Thierry Escande authored
      With this patch, ACK PDU sk_buffs are now freed and code has been
      refactored for better errors handling.
      Signed-off-by: default avatarThierry Escande <thierry.escande@collabora.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      e073eb67
    • Thierry Escande's avatar
      NFC: digital: Fix ACK & NACK PDUs handling in target mode · 482333b2
      Thierry Escande authored
      When the target receives a NACK PDU, it re-sends the last sent PDU.
      
      ACK PDUs are received by the target as a reply from the initiator to
      chained I-PDUs. There are 3 cases to handle:
      - If the target has previously received 1 or more ATN PDUs and the PNI
        in the ACK PDU is equal to the target PNI - 1, then it means that the
        initiator did not received the last issued PDU from the target. In
        this case it re-sends this PDU.
      - If the target has received 1 or more ATN PDUs but the ACK PNI is not
        the target PNI - 1, then this means that this ACK is the reply of the
        previous chained I-PDU sent by the target. The target did not received
        it on the first attempt and it is being re-sent by the initiator. The
        process continues as usual.
      - No ATN PDU received before this ACK PDU. This is the reply of a
        chained I-PDU. The target keeps on processing its chained I-PDU.
      
      The code has been refactored to avoid too many indentation levels.
      
      Also, ACK and NACK PDUs were not freed. This is now fixed.
      Signed-off-by: default avatarThierry Escande <thierry.escande@collabora.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      482333b2
    • Thierry Escande's avatar
      NFC: digital: Fix target DEP_REQ I-PDU handling after ATN PDU · f23a9868
      Thierry Escande authored
      When the initiator sends a DEP_REQ I-PDU, the target device may not
      reply in a timely manner. In this case the initiator device must send an
      attention PDU (ATN) and if the recipient replies with an ATN PDU in
      return, then the last I-PDU must be sent again by the initiator.
      
      This patch fixes how the target handles I-PDU received after an ATN PDU
      has been received.
      
      There are 2 possible cases:
      - The target has received the initial DEP_REQ and sends back the DEP_RES
        but the initiator did not receive it. In this case, after the
        initiator has sent an ATN PDU and the target replied it (with an ATN
        as well), the initiator sends the saved skb of the initial DEP_REQ
        again and the target replies with the saved skb of the initial
        DEP_RES.
      - Or the target did not even received the initial DEP_REQ. In this case,
        after the ATN PDUs exchange, the initiator sends the saved skb and the
        target simply passes it up, just as usual.
      
      This behavior is controlled using the atn_count and the PNI field of the
      digital device structure.
      Signed-off-by: default avatarThierry Escande <thierry.escande@collabora.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      f23a9868
    • Thierry Escande's avatar
      NFC: digital: Remove useless call to skb_reserve() · e8e7f421
      Thierry Escande authored
      When allocating chained I-PDUs, there is no need to call skb_reserve()
      since it's already done by digital_alloc_skb() and contains enough room
      for the driver head and tail data.
      Signed-off-by: default avatarThierry Escande <thierry.escande@collabora.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      e8e7f421
    • Thierry Escande's avatar
      NFC: digital: Fix handling of saved PDU sk_buff pointers · 1d984c2e
      Thierry Escande authored
      This patch fixes the way an I-PDU is saved in case it needs to be sent
      again. It is now copied using pskb_copy() and not simply referenced
      using skb_get() since it could be modified by the driver.
      
      digital_in_send_saved_skb() and digital_tg_send_saved_skb() still get a
      reference on the saved skb which is re-sent but release it if the send
      operation fails. That way the caller doesn't have to take care about skb
      ref in case of error.
      
      RTOX supervisor PDU must not be saved as this can override a previously
      saved I-PDU that should be re-sent later on.
      Signed-off-by: default avatarThierry Escande <thierry.escande@collabora.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      1d984c2e
  4. 06 Jul, 2016 12 commits
  5. 04 Jul, 2016 9 commits
  6. 02 Jul, 2016 10 commits