Lines Matching refs:ipc

159 static void qrtr_port_put(struct qrtr_sock *ipc);
436 struct qrtr_sock *ipc; in qrtr_endpoint_post() local
521 ipc = qrtr_port_lookup(cb->dst_port); in qrtr_endpoint_post()
522 if (!ipc) in qrtr_endpoint_post()
525 if (sock_queue_rcv_skb(&ipc->sk, skb)) { in qrtr_endpoint_post()
526 qrtr_port_put(ipc); in qrtr_endpoint_post()
530 qrtr_port_put(ipc); in qrtr_endpoint_post()
660 struct qrtr_sock *ipc; in qrtr_port_lookup() local
666 ipc = xa_load(&qrtr_ports, port); in qrtr_port_lookup()
667 if (ipc) in qrtr_port_lookup()
668 sock_hold(&ipc->sk); in qrtr_port_lookup()
671 return ipc; in qrtr_port_lookup()
675 static void qrtr_port_put(struct qrtr_sock *ipc) in qrtr_port_put() argument
677 sock_put(&ipc->sk); in qrtr_port_put()
681 static void qrtr_port_remove(struct qrtr_sock *ipc) in qrtr_port_remove() argument
685 int port = ipc->us.sq_port; in qrtr_port_remove()
695 pkt->client.node = cpu_to_le32(ipc->us.sq_node); in qrtr_port_remove()
696 pkt->client.port = cpu_to_le32(ipc->us.sq_port); in qrtr_port_remove()
698 skb_set_owner_w(skb, &ipc->sk); in qrtr_port_remove()
699 qrtr_bcast_enqueue(NULL, skb, QRTR_TYPE_DEL_CLIENT, &ipc->us, in qrtr_port_remove()
706 __sock_put(&ipc->sk); in qrtr_port_remove()
725 static int qrtr_port_assign(struct qrtr_sock *ipc, int *port) in qrtr_port_assign() argument
730 rc = xa_alloc(&qrtr_ports, port, ipc, QRTR_EPH_PORT_RANGE, in qrtr_port_assign()
735 rc = xa_insert(&qrtr_ports, 0, ipc, GFP_KERNEL); in qrtr_port_assign()
737 rc = xa_insert(&qrtr_ports, *port, ipc, GFP_KERNEL); in qrtr_port_assign()
745 sock_hold(&ipc->sk); in qrtr_port_assign()
753 struct qrtr_sock *ipc; in qrtr_reset_ports() local
757 xa_for_each_start(&qrtr_ports, index, ipc, 1) { in qrtr_reset_ports()
758 sock_hold(&ipc->sk); in qrtr_reset_ports()
759 ipc->sk.sk_err = ENETRESET; in qrtr_reset_ports()
760 sk_error_report(&ipc->sk); in qrtr_reset_ports()
761 sock_put(&ipc->sk); in qrtr_reset_ports()
773 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in __qrtr_bind() local
779 if (!zapped && addr->sq_port == ipc->us.sq_port) in __qrtr_bind()
783 rc = qrtr_port_assign(ipc, &port); in __qrtr_bind()
789 qrtr_port_remove(ipc); in __qrtr_bind()
790 ipc->us.sq_port = port; in __qrtr_bind()
821 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_bind() local
828 if (addr->sq_node != ipc->us.sq_node) in qrtr_bind()
843 struct qrtr_sock *ipc; in qrtr_local_enqueue() local
846 ipc = qrtr_port_lookup(to->sq_port); in qrtr_local_enqueue()
847 if (!ipc || &ipc->sk == skb->sk) { /* do not send to self */ in qrtr_local_enqueue()
848 if (ipc) in qrtr_local_enqueue()
849 qrtr_port_put(ipc); in qrtr_local_enqueue()
858 if (sock_queue_rcv_skb(&ipc->sk, skb)) { in qrtr_local_enqueue()
859 qrtr_port_put(ipc); in qrtr_local_enqueue()
864 qrtr_port_put(ipc); in qrtr_local_enqueue()
897 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_sendmsg() local
930 addr = &ipc->peer; in qrtr_sendmsg()
944 } else if (addr->sq_node == ipc->us.sq_node) { in qrtr_sendmsg()
971 if (ipc->us.sq_port == QRTR_PORT_CTRL) { in qrtr_sendmsg()
983 rc = enqueue_fn(node, skb, type, &ipc->us, addr); in qrtr_sendmsg()
1083 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_connect() local
1101 ipc->peer = *addr; in qrtr_connect()
1113 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_getname() local
1124 qaddr = ipc->peer; in qrtr_getname()
1126 qaddr = ipc->us; in qrtr_getname()
1140 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_ioctl() local
1170 *sq = ipc->us; in qrtr_ioctl()
1200 struct qrtr_sock *ipc; in qrtr_release() local
1207 ipc = qrtr_sk(sk); in qrtr_release()
1217 qrtr_port_remove(ipc); in qrtr_release()
1256 struct qrtr_sock *ipc; in qrtr_create() local
1271 ipc = qrtr_sk(sk); in qrtr_create()
1272 ipc->us.sq_family = AF_QIPCRTR; in qrtr_create()
1273 ipc->us.sq_node = qrtr_local_nid; in qrtr_create()
1274 ipc->us.sq_port = 0; in qrtr_create()