diff options
author | Thierry Escande <thierry.escande@linux.intel.com> | 2014-01-06 23:34:37 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-01-07 18:48:12 +0100 |
commit | 48e1044515967a0d88ee076045b2141535557d8e (patch) | |
tree | 564a069a933c1567908725f4a9150c2d7afbb5c4 /net/nfc/digital_dep.c | |
parent | NFC: nfcmrvl: Add setup handler (diff) | |
download | linux-48e1044515967a0d88ee076045b2141535557d8e.tar.xz linux-48e1044515967a0d88ee076045b2141535557d8e.zip |
NFC: digital: Set current target active on activate_target() call
The curr_protocol field of nfc_digital_dev structure used to determine
if a target is currently active was set too soon, immediately when a
target is found. This is not good since there is no other way than
deactivate_target() to reset curr_protocol and if activate_target() is
not called, the target remains active and it's not possible to put the
device in poll mode anymore.
With this patch curr_protocol is set when nfc core activates a target,
puts a device up, or when an ATR_REQ is received in target mode.
Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/digital_dep.c')
-rw-r--r-- | net/nfc/digital_dep.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/nfc/digital_dep.c b/net/nfc/digital_dep.c index 470a0b4016ed..562bec9ad8d9 100644 --- a/net/nfc/digital_dep.c +++ b/net/nfc/digital_dep.c @@ -681,6 +681,8 @@ void digital_tg_recv_atr_req(struct nfc_digital_dev *ddev, void *arg, ddev->skb_check_crc = digital_skb_check_crc_none; } + ddev->curr_protocol = NFC_PROTO_NFC_DEP_MASK; + rc = ddev->skb_check_crc(resp); if (rc) { PROTOCOL_ERR("14.4.1.6"); |