diff options
author | Thierry Escande <thierry.escande@collabora.com> | 2016-07-08 13:52:42 (GMT) |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2016-07-10 23:58:46 (GMT) |
commit | 482333b277de181ce80c833d84f2598e2527b267 (patch) | |
tree | c21195b9d804a9cf02abec6ccf3bab3db253459d /block/bio-integrity.c | |
parent | f23a9868b1c45e77ec6082eb95508885111ffda1 (diff) | |
download | linux-482333b277de181ce80c833d84f2598e2527b267.tar.xz |
NFC: digital: Fix ACK & NACK PDUs handling in target mode
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: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'block/bio-integrity.c')
0 files changed, 0 insertions, 0 deletions