aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-04-10 13:43:14 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-12 15:10:41 -0400
commit279cf174aea84202c5fef4675ff3f1265f071c8e (patch)
tree6195f9cd789cf21314d77ce9941f416d63b762be /net/nfc
parent4be646ecc94b34acec41aba628b57cfc02ab7ae0 (diff)
NFC: No need to apply twice the modulo op to LLCP's recv_n
recv_n is set properly when receiving an HDLC frame. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/llcp/commands.c2
-rw-r--r--net/nfc/llcp/llcp.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/net/nfc/llcp/commands.c b/net/nfc/llcp/commands.c
index ef10ffcb4b6f..4aa52b8b6c0c 100644
--- a/net/nfc/llcp/commands.c
+++ b/net/nfc/llcp/commands.c
@@ -522,7 +522,7 @@ int nfc_llcp_send_rr(struct nfc_llcp_sock *sock)
522 522
523 skb_put(skb, LLCP_SEQUENCE_SIZE); 523 skb_put(skb, LLCP_SEQUENCE_SIZE);
524 524
525 skb->data[2] = sock->recv_n % 16; 525 skb->data[2] = sock->recv_n;
526 526
527 skb_queue_head(&local->tx_queue, skb); 527 skb_queue_head(&local->tx_queue, skb);
528 528
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c
index d5e87c35002a..2cf01e642566 100644
--- a/net/nfc/llcp/llcp.c
+++ b/net/nfc/llcp/llcp.c
@@ -428,7 +428,7 @@ static u8 nfc_llcp_nr(struct sk_buff *pdu)
428 428
429static void nfc_llcp_set_nrns(struct nfc_llcp_sock *sock, struct sk_buff *pdu) 429static void nfc_llcp_set_nrns(struct nfc_llcp_sock *sock, struct sk_buff *pdu)
430{ 430{
431 pdu->data[2] = (sock->send_n << 4) | (sock->recv_n % 16); 431 pdu->data[2] = (sock->send_n << 4) | (sock->recv_n);
432 sock->send_n = (sock->send_n + 1) % 16; 432 sock->send_n = (sock->send_n + 1) % 16;
433 sock->recv_ack_n = (sock->recv_n - 1) % 16; 433 sock->recv_ack_n = (sock->recv_n - 1) % 16;
434} 434}