diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-03-04 19:03:42 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-06 15:16:22 -0500 |
commit | d094afa155273e03b82981ea818d39c7a2dfba86 (patch) | |
tree | 85aafb65a5612c9d30fb68118a18948e22178f68 /net/nfc/llcp/commands.c | |
parent | 0767a7fa87ff18f6a11e3de954c5386a45b9d96e (diff) |
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.c | 24 |
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, | |||
428 | 428 | ||
429 | return 0; | 429 | return 0; |
430 | } | 430 | } |
431 | |||
432 | int nfc_llcp_send_rr(struct nfc_llcp_sock *sock) | ||
433 | { | ||
434 | struct sk_buff *skb; | ||
435 | struct nfc_llcp_local *local; | ||
436 | |||
437 | pr_debug("Send rr nr %d\n", sock->recv_n); | ||
438 | |||
439 | local = sock->local; | ||
440 | if (local == NULL) | ||
441 | return -ENODEV; | ||
442 | |||
443 | skb = llcp_allocate_pdu(sock, LLCP_PDU_RR, LLCP_SEQUENCE_SIZE); | ||
444 | if (skb == NULL) | ||
445 | return -ENOMEM; | ||
446 | |||
447 | skb_put(skb, LLCP_SEQUENCE_SIZE); | ||
448 | |||
449 | skb->data[2] = sock->recv_n % 16; | ||
450 | |||
451 | skb_queue_head(&local->tx_queue, skb); | ||
452 | |||
453 | return 0; | ||
454 | } | ||