Lines Matching refs:sock

251 int nfc_llcp_parse_connection_tlv(struct nfc_llcp_sock *sock,
258 if (sock == NULL)
269 sock->remote_miu = llcp_tlv_miux(tlv) + 128;
272 sock->remote_rw = llcp_tlv_rw(tlv);
285 pr_debug("sock %p rw %d miu %d\n", sock,
286 sock->remote_rw, sock->remote_miu);
321 static struct sk_buff *llcp_allocate_pdu(struct nfc_llcp_sock *sock,
327 if (sock->ssap == 0)
330 skb = nfc_alloc_send_skb(sock->dev, &sock->sk, MSG_DONTWAIT,
337 skb = llcp_add_header(skb, sock->dsap, sock->ssap, cmd);
342 int nfc_llcp_disconnect(struct nfc_llcp_sock *sock)
350 local = sock->local;
354 dev = sock->dev;
358 skb = llcp_allocate_pdu(sock, LLCP_PDU_DISC, 0);
398 int nfc_llcp_send_connect(struct nfc_llcp_sock *sock)
410 local = sock->local;
414 if (sock->service_name != NULL) {
416 sock->service_name,
417 sock->service_name_len,
423 miux = be16_to_cpu(sock->miux) > LLCP_MAX_MIUX ?
424 local->miux : sock->miux;
425 rw = sock->rw > LLCP_MAX_RW ? local->rw : sock->rw;
434 pr_debug("SKB size %d SN length %zu\n", size, sock->service_name_len);
436 skb = llcp_allocate_pdu(sock, LLCP_PDU_CONNECT, size);
463 int nfc_llcp_send_cc(struct nfc_llcp_sock *sock)
474 local = sock->local;
479 miux = be16_to_cpu(sock->miux) > LLCP_MAX_MIUX ?
480 local->miux : sock->miux;
481 rw = sock->rw > LLCP_MAX_RW ? local->rw : sock->rw;
490 skb = llcp_allocate_pdu(sock, LLCP_PDU_CC, size);
633 int nfc_llcp_send_disconnect(struct nfc_llcp_sock *sock)
640 local = sock->local;
644 skb = llcp_allocate_pdu(sock, LLCP_PDU_DISC, 0);
653 int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock,
657 struct sock *sk = &sock->sk;
665 local = sock->local;
670 if((sock->remote_ready &&
671 skb_queue_len(&sock->tx_pending_queue) >= sock->remote_rw &&
672 skb_queue_len(&sock->tx_queue) >= 2 * sock->remote_rw)) {
674 skb_queue_len(&sock->tx_pending_queue));
679 if ((!sock->remote_ready &&
680 skb_queue_len(&sock->tx_queue) >= 2 * sock->remote_rw)) {
682 skb_queue_len(&sock->tx_queue));
699 remote_miu = sock->remote_miu > LLCP_MAX_MIU ?
700 local->remote_miu : sock->remote_miu;
707 pdu = llcp_allocate_pdu(sock, LLCP_PDU_I,
717 skb_queue_tail(&sock->tx_queue, pdu);
721 nfc_llcp_queue_i_frames(sock);
734 int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap,
746 local = sock->local;
763 remote_miu = sock->remote_miu > LLCP_MAX_MIU ?
764 local->remote_miu : sock->remote_miu;
771 pdu = nfc_alloc_send_skb(sock->dev, &sock->sk, MSG_DONTWAIT,
795 int nfc_llcp_send_rr(struct nfc_llcp_sock *sock)
800 pr_debug("Send rr nr %d\n", sock->recv_n);
802 local = sock->local;
806 skb = llcp_allocate_pdu(sock, LLCP_PDU_RR, LLCP_SEQUENCE_SIZE);
812 skb->data[2] = sock->recv_n;