diff options
author | Mark A. Greer <mgreer@animalcreek.com> | 2014-04-23 11:00:56 -0700 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-05-19 23:52:40 +0200 |
commit | 4b8b6267bed9261c5c2f52e6b1ff258cd9305ad2 (patch) | |
tree | f374f1917387a773def8ddc78c3b8ccc124ee121 /net | |
parent | 96e829b433056d8325916631dc370a4ba42bdaf8 (diff) |
NFC: digital: Handle multiple SENSF_REQ frames
According to section 5.15.1.3 of the NFC Activity
Specification, multiple SENSF_REQ commands can be
received by a target before it receives an ATR_REQ
command. To handle this, add a routine that checks
whether a SENSF_REQ or ATR_REQ has been recieved.
If its a SENSF_REQ, respond appropriately and
continue waiting for a ATR_REQ. If its an ATR_REQ,
handle it as before.
CC: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/nfc/digital_technology.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/net/nfc/digital_technology.c b/net/nfc/digital_technology.c index c8dfb1b90fa0..12a233e9ece5 100644 --- a/net/nfc/digital_technology.c +++ b/net/nfc/digital_technology.c @@ -1091,6 +1091,18 @@ exit: dev_kfree_skb(resp); } +static void digital_tg_recv_atr_or_sensf_req(struct nfc_digital_dev *ddev, + void *arg, struct sk_buff *resp) +{ + if (!IS_ERR(resp) && (resp->len >= 2) && + (resp->data[1] == DIGITAL_CMD_SENSF_REQ)) + digital_tg_recv_sensf_req(ddev, arg, resp); + else + digital_tg_recv_atr_req(ddev, arg, resp); + + return; +} + static int digital_tg_send_sensf_res(struct nfc_digital_dev *ddev, struct digital_sensf_req *sensf_req) { @@ -1136,7 +1148,7 @@ static int digital_tg_send_sensf_res(struct nfc_digital_dev *ddev, digital_skb_add_crc_f(skb); rc = digital_tg_send_cmd(ddev, skb, 300, - digital_tg_recv_atr_req, NULL); + digital_tg_recv_atr_or_sensf_req, NULL); if (rc) kfree_skb(skb); |