Commit e3e02588 authored by Thierry Escande's avatar Thierry Escande Committed by Samuel Ortiz

NFC: port100: Don't send a new command if one is still pending

This patch ensures that a command is not still in process before sending
a new one to the device. This can happen when neard is in constant
polling mode: the configure_hw command can be sent when neard restarts
polling after a LLCP SYMM timeout but before the device has returned in
timeout from the last DEP frame sent.
Signed-off-by: default avatarThierry Escande <thierry.escande@collabora.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 256f3ee3
...@@ -809,6 +809,12 @@ static int port100_send_cmd_async(struct port100 *dev, u8 cmd_code, ...@@ -809,6 +809,12 @@ static int port100_send_cmd_async(struct port100 *dev, u8 cmd_code,
PORT100_FRAME_MAX_PAYLOAD_LEN + PORT100_FRAME_MAX_PAYLOAD_LEN +
PORT100_FRAME_TAIL_LEN; PORT100_FRAME_TAIL_LEN;
if (dev->cmd) {
nfc_err(&dev->interface->dev,
"A command is still in process\n");
return -EBUSY;
}
resp = alloc_skb(resp_len, GFP_KERNEL); resp = alloc_skb(resp_len, GFP_KERNEL);
if (!resp) if (!resp)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment