• Thierry Escande's avatar
    NFC: digital: Add support for NFC DEP Response Waiting Time · 1a09c56f
    Thierry Escande authored
    When sending an ATR_REQ, the initiator must wait for the ATR_RES at
    least 'RWT(nfcdep,activation) + dRWT(nfcdep)' and no more than
    'RWT(nfcdep,activation) + dRWT(nfcdep) + dT(nfcdep,initiator)'. This
    gives a timeout value between 1237 ms and 1337 ms. This patch defines
    DIGITAL_ATR_RES_RWT to 1337 used for the timeout value of ATR_REQ
    command.
    
    For other DEP PDUs, the initiator must wait between 'RWT + dRWT(nfcdep)'
    and 'RWT + dRWT(nfcdep) + dT(nfcdep,initiator)' where RWT is given by
    the following formula: '(256 * 16 / f(c)) * 2^wt' where wt is the value
    of the TO field in the ATR_RES response and is in the range between 0
    and 14. This patch declares a mapping table for wt values and gives RWT
    max values between 100 ms and 5049 ms.
    
    This patch also defines DIGITAL_ATR_RES_TO_WT, the maximum wt value in
    target mode, to 8.
    Signed-off-by: default avatarThierry Escande <thierry.escande@collabora.com>
    Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
    1a09c56f
digital.h 8.82 KB