Loading net/nfc/llcp/llcp.c +28 −17 Original line number Original line Diff line number Diff line Loading @@ -616,6 +616,33 @@ static void nfc_llcp_recv_connect(struct nfc_llcp_local *local, } } void nfc_llcp_queue_i_frames(struct nfc_llcp_sock *sock) { struct nfc_llcp_local *local = sock->local; pr_debug("Remote ready %d tx queue len %d remote rw %d", sock->remote_ready, skb_queue_len(&sock->tx_pending_queue), local->remote_rw); /* Try to queue some I frames for transmission */ while (sock->remote_ready && skb_queue_len(&sock->tx_pending_queue) < local->remote_rw) { struct sk_buff *pdu, *pending_pdu; pdu = skb_dequeue(&sock->tx_queue); if (pdu == NULL) break; /* Update N(S)/N(R) */ nfc_llcp_set_nrns(sock, pdu); pending_pdu = skb_clone(pdu, GFP_KERNEL); skb_queue_tail(&local->tx_queue, pdu); skb_queue_tail(&sock->tx_pending_queue, pending_pdu); } } static void nfc_llcp_recv_hdlc(struct nfc_llcp_local *local, static void nfc_llcp_recv_hdlc(struct nfc_llcp_local *local, struct sk_buff *skb) struct sk_buff *skb) { { Loading Loading @@ -673,23 +700,7 @@ static void nfc_llcp_recv_hdlc(struct nfc_llcp_local *local, } } } } /* Queue some I frames for transmission */ nfc_llcp_queue_i_frames(llcp_sock); while (llcp_sock->remote_ready && skb_queue_len(&llcp_sock->tx_pending_queue) <= local->remote_rw) { struct sk_buff *pdu, *pending_pdu; pdu = skb_dequeue(&llcp_sock->tx_queue); if (pdu == NULL) break; /* Update N(S)/N(R) */ nfc_llcp_set_nrns(llcp_sock, pdu); pending_pdu = skb_clone(pdu, GFP_KERNEL); skb_queue_tail(&local->tx_queue, pdu); skb_queue_tail(&llcp_sock->tx_pending_queue, pending_pdu); } release_sock(sk); release_sock(sk); nfc_llcp_sock_put(llcp_sock); nfc_llcp_sock_put(llcp_sock); Loading net/nfc/llcp/llcp.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -165,6 +165,7 @@ u8 nfc_llcp_get_sdp_ssap(struct nfc_llcp_local *local, struct nfc_llcp_sock *sock); struct nfc_llcp_sock *sock); u8 nfc_llcp_get_local_ssap(struct nfc_llcp_local *local); u8 nfc_llcp_get_local_ssap(struct nfc_llcp_local *local); void nfc_llcp_put_ssap(struct nfc_llcp_local *local, u8 ssap); void nfc_llcp_put_ssap(struct nfc_llcp_local *local, u8 ssap); void nfc_llcp_queue_i_frames(struct nfc_llcp_sock *sock); /* Sock API */ /* Sock API */ struct sock *nfc_llcp_sock_alloc(struct socket *sock, int type, gfp_t gfp); struct sock *nfc_llcp_sock_alloc(struct socket *sock, int type, gfp_t gfp); Loading Loading
net/nfc/llcp/llcp.c +28 −17 Original line number Original line Diff line number Diff line Loading @@ -616,6 +616,33 @@ static void nfc_llcp_recv_connect(struct nfc_llcp_local *local, } } void nfc_llcp_queue_i_frames(struct nfc_llcp_sock *sock) { struct nfc_llcp_local *local = sock->local; pr_debug("Remote ready %d tx queue len %d remote rw %d", sock->remote_ready, skb_queue_len(&sock->tx_pending_queue), local->remote_rw); /* Try to queue some I frames for transmission */ while (sock->remote_ready && skb_queue_len(&sock->tx_pending_queue) < local->remote_rw) { struct sk_buff *pdu, *pending_pdu; pdu = skb_dequeue(&sock->tx_queue); if (pdu == NULL) break; /* Update N(S)/N(R) */ nfc_llcp_set_nrns(sock, pdu); pending_pdu = skb_clone(pdu, GFP_KERNEL); skb_queue_tail(&local->tx_queue, pdu); skb_queue_tail(&sock->tx_pending_queue, pending_pdu); } } static void nfc_llcp_recv_hdlc(struct nfc_llcp_local *local, static void nfc_llcp_recv_hdlc(struct nfc_llcp_local *local, struct sk_buff *skb) struct sk_buff *skb) { { Loading Loading @@ -673,23 +700,7 @@ static void nfc_llcp_recv_hdlc(struct nfc_llcp_local *local, } } } } /* Queue some I frames for transmission */ nfc_llcp_queue_i_frames(llcp_sock); while (llcp_sock->remote_ready && skb_queue_len(&llcp_sock->tx_pending_queue) <= local->remote_rw) { struct sk_buff *pdu, *pending_pdu; pdu = skb_dequeue(&llcp_sock->tx_queue); if (pdu == NULL) break; /* Update N(S)/N(R) */ nfc_llcp_set_nrns(llcp_sock, pdu); pending_pdu = skb_clone(pdu, GFP_KERNEL); skb_queue_tail(&local->tx_queue, pdu); skb_queue_tail(&llcp_sock->tx_pending_queue, pending_pdu); } release_sock(sk); release_sock(sk); nfc_llcp_sock_put(llcp_sock); nfc_llcp_sock_put(llcp_sock); Loading
net/nfc/llcp/llcp.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -165,6 +165,7 @@ u8 nfc_llcp_get_sdp_ssap(struct nfc_llcp_local *local, struct nfc_llcp_sock *sock); struct nfc_llcp_sock *sock); u8 nfc_llcp_get_local_ssap(struct nfc_llcp_local *local); u8 nfc_llcp_get_local_ssap(struct nfc_llcp_local *local); void nfc_llcp_put_ssap(struct nfc_llcp_local *local, u8 ssap); void nfc_llcp_put_ssap(struct nfc_llcp_local *local, u8 ssap); void nfc_llcp_queue_i_frames(struct nfc_llcp_sock *sock); /* Sock API */ /* Sock API */ struct sock *nfc_llcp_sock_alloc(struct socket *sock, int type, gfp_t gfp); struct sock *nfc_llcp_sock_alloc(struct socket *sock, int type, gfp_t gfp); Loading