• 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: 's avatarThierry Escande <thierry.escande@collabora.com>
    Signed-off-by: 's avatarSamuel Ortiz <sameo@linux.intel.com>
    482333b2
Name
Last commit
Last update
..
hci Loading commit data...
nci Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
af_nfc.c Loading commit data...
core.c Loading commit data...
digital.h Loading commit data...
digital_core.c Loading commit data...
digital_dep.c Loading commit data...
digital_technology.c Loading commit data...
llcp.h Loading commit data...
llcp_commands.c Loading commit data...
llcp_core.c Loading commit data...
llcp_sock.c Loading commit data...
netlink.c Loading commit data...
nfc.h Loading commit data...
rawsock.c Loading commit data...