aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/llcp/commands.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-03-05 01:03:42 +0100
committerJohn W. Linville <linville@tuxdriver.com>2012-03-06 15:16:22 -0500
commitd094afa155273e03b82981ea818d39c7a2dfba86 (patch)
tree85aafb65a5612c9d30fb68118a18948e22178f68 /net/nfc/llcp/commands.c
parentNFC: Set the right LLCP N(R) value for I frames (diff)
downloadlinux-dev-d094afa155273e03b82981ea818d39c7a2dfba86.tar.xz
linux-dev-d094afa155273e03b82981ea818d39c7a2dfba86.zip
NFC: Send LLCP RR frames to acknowledge received I frames
In order to acknowledge an I frame, we have to either queue pending local I frames or queue a receiver ready frame. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/nfc/llcp/commands.c')
-rw-r--r--net/nfc/llcp/commands.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/net/nfc/llcp/commands.c b/net/nfc/llcp/commands.c
index f6c2257c11aa..8ebd322b11eb 100644
--- a/net/nfc/llcp/commands.c
+++ b/net/nfc/llcp/commands.c
@@ -428,3 +428,27 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock,
return 0;
}
+
+int nfc_llcp_send_rr(struct nfc_llcp_sock *sock)
+{
+ struct sk_buff *skb;
+ struct nfc_llcp_local *local;
+
+ pr_debug("Send rr nr %d\n", sock->recv_n);
+
+ local = sock->local;
+ if (local == NULL)
+ return -ENODEV;
+
+ skb = llcp_allocate_pdu(sock, LLCP_PDU_RR, LLCP_SEQUENCE_SIZE);
+ if (skb == NULL)
+ return -ENOMEM;
+
+ skb_put(skb, LLCP_SEQUENCE_SIZE);
+
+ skb->data[2] = sock->recv_n % 16;
+
+ skb_queue_head(&local->tx_queue, skb);
+
+ return 0;
+}