Lines Matching full:ipc
158 static void qrtr_port_put(struct qrtr_sock *ipc);
426 struct qrtr_sock *ipc; in qrtr_endpoint_post() local
500 ipc = qrtr_port_lookup(cb->dst_port); in qrtr_endpoint_post()
501 if (!ipc) in qrtr_endpoint_post()
504 if (sock_queue_rcv_skb(&ipc->sk, skb)) in qrtr_endpoint_post()
507 qrtr_port_put(ipc); in qrtr_endpoint_post()
627 struct qrtr_sock *ipc; in qrtr_port_lookup() local
633 ipc = idr_find(&qrtr_ports, port); in qrtr_port_lookup()
634 if (ipc) in qrtr_port_lookup()
635 sock_hold(&ipc->sk); in qrtr_port_lookup()
638 return ipc; in qrtr_port_lookup()
642 static void qrtr_port_put(struct qrtr_sock *ipc) in qrtr_port_put() argument
644 sock_put(&ipc->sk); in qrtr_port_put()
648 static void qrtr_port_remove(struct qrtr_sock *ipc) in qrtr_port_remove() argument
652 int port = ipc->us.sq_port; in qrtr_port_remove()
662 pkt->client.node = cpu_to_le32(ipc->us.sq_node); in qrtr_port_remove()
663 pkt->client.port = cpu_to_le32(ipc->us.sq_port); in qrtr_port_remove()
665 skb_set_owner_w(skb, &ipc->sk); in qrtr_port_remove()
666 qrtr_bcast_enqueue(NULL, skb, QRTR_TYPE_DEL_CLIENT, &ipc->us, in qrtr_port_remove()
673 __sock_put(&ipc->sk); in qrtr_port_remove()
694 static int qrtr_port_assign(struct qrtr_sock *ipc, int *port) in qrtr_port_assign() argument
702 rc = idr_alloc_u32(&qrtr_ports, ipc, &min_port, QRTR_MAX_EPH_SOCKET, GFP_ATOMIC); in qrtr_port_assign()
709 rc = idr_alloc_u32(&qrtr_ports, ipc, &min_port, 0, GFP_ATOMIC); in qrtr_port_assign()
712 rc = idr_alloc_u32(&qrtr_ports, ipc, &min_port, *port, GFP_ATOMIC); in qrtr_port_assign()
723 sock_hold(&ipc->sk); in qrtr_port_assign()
731 struct qrtr_sock *ipc; in qrtr_reset_ports() local
735 idr_for_each_entry(&qrtr_ports, ipc, id) { in qrtr_reset_ports()
740 sock_hold(&ipc->sk); in qrtr_reset_ports()
741 ipc->sk.sk_err = ENETRESET; in qrtr_reset_ports()
742 ipc->sk.sk_error_report(&ipc->sk); in qrtr_reset_ports()
743 sock_put(&ipc->sk); in qrtr_reset_ports()
755 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in __qrtr_bind() local
761 if (!zapped && addr->sq_port == ipc->us.sq_port) in __qrtr_bind()
765 rc = qrtr_port_assign(ipc, &port); in __qrtr_bind()
771 qrtr_port_remove(ipc); in __qrtr_bind()
772 ipc->us.sq_port = port; in __qrtr_bind()
803 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_bind() local
810 if (addr->sq_node != ipc->us.sq_node) in qrtr_bind()
825 struct qrtr_sock *ipc; in qrtr_local_enqueue() local
828 ipc = qrtr_port_lookup(to->sq_port); in qrtr_local_enqueue()
829 if (!ipc || &ipc->sk == skb->sk) { /* do not send to self */ in qrtr_local_enqueue()
838 if (sock_queue_rcv_skb(&ipc->sk, skb)) { in qrtr_local_enqueue()
839 qrtr_port_put(ipc); in qrtr_local_enqueue()
844 qrtr_port_put(ipc); in qrtr_local_enqueue()
877 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_sendmsg() local
910 addr = &ipc->peer; in qrtr_sendmsg()
924 } else if (addr->sq_node == ipc->us.sq_node) { in qrtr_sendmsg()
949 if (ipc->us.sq_port == QRTR_PORT_CTRL) { in qrtr_sendmsg()
961 rc = enqueue_fn(node, skb, type, &ipc->us, addr); in qrtr_sendmsg()
1056 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_connect() local
1074 ipc->peer = *addr; in qrtr_connect()
1086 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_getname() local
1097 qaddr = ipc->peer; in qrtr_getname()
1099 qaddr = ipc->us; in qrtr_getname()
1113 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_ioctl() local
1143 *sq = ipc->us; in qrtr_ioctl()
1173 struct qrtr_sock *ipc; in qrtr_release() local
1180 ipc = qrtr_sk(sk); in qrtr_release()
1190 qrtr_port_remove(ipc); in qrtr_release()
1229 struct qrtr_sock *ipc; in qrtr_create() local
1244 ipc = qrtr_sk(sk); in qrtr_create()
1245 ipc->us.sq_family = AF_QIPCRTR; in qrtr_create()
1246 ipc->us.sq_node = qrtr_local_nid; in qrtr_create()
1247 ipc->us.sq_port = 0; in qrtr_create()
1286 MODULE_DESCRIPTION("Qualcomm IPC-router driver");