aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/llcp/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/nfc/llcp/commands.c')
-rw-r--r--net/nfc/llcp/commands.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/net/nfc/llcp/commands.c b/net/nfc/llcp/commands.c
index c6bc3bd95052..c8a209665792 100644
--- a/net/nfc/llcp/commands.c
+++ b/net/nfc/llcp/commands.c
@@ -184,10 +184,10 @@ int nfc_llcp_parse_connection_tlv(struct nfc_llcp_sock *sock,
184 184
185 switch (type) { 185 switch (type) {
186 case LLCP_TLV_MIUX: 186 case LLCP_TLV_MIUX:
187 sock->miu = llcp_tlv_miux(tlv) + 128; 187 sock->remote_miu = llcp_tlv_miux(tlv) + 128;
188 break; 188 break;
189 case LLCP_TLV_RW: 189 case LLCP_TLV_RW:
190 sock->rw = llcp_tlv_rw(tlv); 190 sock->remote_rw = llcp_tlv_rw(tlv);
191 break; 191 break;
192 case LLCP_TLV_SN: 192 case LLCP_TLV_SN:
193 break; 193 break;
@@ -200,7 +200,8 @@ int nfc_llcp_parse_connection_tlv(struct nfc_llcp_sock *sock,
200 tlv += length + 2; 200 tlv += length + 2;
201 } 201 }
202 202
203 pr_debug("sock %p rw %d miu %d\n", sock, sock->rw, sock->miu); 203 pr_debug("sock %p rw %d miu %d\n", sock,
204 sock->remote_rw, sock->remote_miu);
204 205
205 return 0; 206 return 0;
206} 207}
@@ -532,8 +533,8 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock,
532 533
533 /* Remote is ready but has not acknowledged our frames */ 534 /* Remote is ready but has not acknowledged our frames */
534 if((sock->remote_ready && 535 if((sock->remote_ready &&
535 skb_queue_len(&sock->tx_pending_queue) >= sock->rw && 536 skb_queue_len(&sock->tx_pending_queue) >= sock->remote_rw &&
536 skb_queue_len(&sock->tx_queue) >= 2 * sock->rw)) { 537 skb_queue_len(&sock->tx_queue) >= 2 * sock->remote_rw)) {
537 pr_err("Pending queue is full %d frames\n", 538 pr_err("Pending queue is full %d frames\n",
538 skb_queue_len(&sock->tx_pending_queue)); 539 skb_queue_len(&sock->tx_pending_queue));
539 return -ENOBUFS; 540 return -ENOBUFS;
@@ -541,7 +542,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock,
541 542
542 /* Remote is not ready and we've been queueing enough frames */ 543 /* Remote is not ready and we've been queueing enough frames */
543 if ((!sock->remote_ready && 544 if ((!sock->remote_ready &&
544 skb_queue_len(&sock->tx_queue) >= 2 * sock->rw)) { 545 skb_queue_len(&sock->tx_queue) >= 2 * sock->remote_rw)) {
545 pr_err("Tx queue is full %d frames\n", 546 pr_err("Tx queue is full %d frames\n",
546 skb_queue_len(&sock->tx_queue)); 547 skb_queue_len(&sock->tx_queue));
547 return -ENOBUFS; 548 return -ENOBUFS;
@@ -561,7 +562,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock,
561 562
562 while (remaining_len > 0) { 563 while (remaining_len > 0) {
563 564
564 frag_len = min_t(size_t, sock->miu, remaining_len); 565 frag_len = min_t(size_t, sock->remote_miu, remaining_len);
565 566
566 pr_debug("Fragment %zd bytes remaining %zd", 567 pr_debug("Fragment %zd bytes remaining %zd",
567 frag_len, remaining_len); 568 frag_len, remaining_len);
@@ -621,7 +622,7 @@ int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap,
621 622
622 while (remaining_len > 0) { 623 while (remaining_len > 0) {
623 624
624 frag_len = min_t(size_t, sock->miu, remaining_len); 625 frag_len = min_t(size_t, sock->remote_miu, remaining_len);
625 626
626 pr_debug("Fragment %zd bytes remaining %zd", 627 pr_debug("Fragment %zd bytes remaining %zd",
627 frag_len, remaining_len); 628 frag_len, remaining_len);