• Home
  • Raw
  • Download

Lines Matching refs:ipc

158 static void qrtr_port_put(struct qrtr_sock *ipc);
429 struct qrtr_sock *ipc; in qrtr_endpoint_post() local
503 ipc = qrtr_port_lookup(cb->dst_port); in qrtr_endpoint_post()
504 if (!ipc) in qrtr_endpoint_post()
507 if (sock_queue_rcv_skb(&ipc->sk, skb)) { in qrtr_endpoint_post()
508 qrtr_port_put(ipc); in qrtr_endpoint_post()
512 qrtr_port_put(ipc); in qrtr_endpoint_post()
632 struct qrtr_sock *ipc; in qrtr_port_lookup() local
638 ipc = idr_find(&qrtr_ports, port); in qrtr_port_lookup()
639 if (ipc) in qrtr_port_lookup()
640 sock_hold(&ipc->sk); in qrtr_port_lookup()
643 return ipc; in qrtr_port_lookup()
647 static void qrtr_port_put(struct qrtr_sock *ipc) in qrtr_port_put() argument
649 sock_put(&ipc->sk); in qrtr_port_put()
653 static void qrtr_port_remove(struct qrtr_sock *ipc) in qrtr_port_remove() argument
657 int port = ipc->us.sq_port; in qrtr_port_remove()
667 pkt->client.node = cpu_to_le32(ipc->us.sq_node); in qrtr_port_remove()
668 pkt->client.port = cpu_to_le32(ipc->us.sq_port); in qrtr_port_remove()
670 skb_set_owner_w(skb, &ipc->sk); in qrtr_port_remove()
671 qrtr_bcast_enqueue(NULL, skb, QRTR_TYPE_DEL_CLIENT, &ipc->us, in qrtr_port_remove()
678 __sock_put(&ipc->sk); in qrtr_port_remove()
699 static int qrtr_port_assign(struct qrtr_sock *ipc, int *port) in qrtr_port_assign() argument
707 rc = idr_alloc_u32(&qrtr_ports, ipc, &min_port, QRTR_MAX_EPH_SOCKET, GFP_ATOMIC); in qrtr_port_assign()
714 rc = idr_alloc_u32(&qrtr_ports, ipc, &min_port, 0, GFP_ATOMIC); in qrtr_port_assign()
717 rc = idr_alloc_u32(&qrtr_ports, ipc, &min_port, *port, GFP_ATOMIC); in qrtr_port_assign()
728 sock_hold(&ipc->sk); in qrtr_port_assign()
736 struct qrtr_sock *ipc; in qrtr_reset_ports() local
740 idr_for_each_entry(&qrtr_ports, ipc, id) { in qrtr_reset_ports()
745 sock_hold(&ipc->sk); in qrtr_reset_ports()
746 ipc->sk.sk_err = ENETRESET; in qrtr_reset_ports()
747 ipc->sk.sk_error_report(&ipc->sk); in qrtr_reset_ports()
748 sock_put(&ipc->sk); in qrtr_reset_ports()
760 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in __qrtr_bind() local
766 if (!zapped && addr->sq_port == ipc->us.sq_port) in __qrtr_bind()
770 rc = qrtr_port_assign(ipc, &port); in __qrtr_bind()
776 qrtr_port_remove(ipc); in __qrtr_bind()
777 ipc->us.sq_port = port; in __qrtr_bind()
808 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_bind() local
815 if (addr->sq_node != ipc->us.sq_node) in qrtr_bind()
830 struct qrtr_sock *ipc; in qrtr_local_enqueue() local
833 ipc = qrtr_port_lookup(to->sq_port); in qrtr_local_enqueue()
834 if (!ipc || &ipc->sk == skb->sk) { /* do not send to self */ in qrtr_local_enqueue()
835 if (ipc) in qrtr_local_enqueue()
836 qrtr_port_put(ipc); in qrtr_local_enqueue()
845 if (sock_queue_rcv_skb(&ipc->sk, skb)) { in qrtr_local_enqueue()
846 qrtr_port_put(ipc); in qrtr_local_enqueue()
851 qrtr_port_put(ipc); in qrtr_local_enqueue()
884 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_sendmsg() local
917 addr = &ipc->peer; in qrtr_sendmsg()
931 } else if (addr->sq_node == ipc->us.sq_node) { in qrtr_sendmsg()
958 if (ipc->us.sq_port == QRTR_PORT_CTRL) { in qrtr_sendmsg()
970 rc = enqueue_fn(node, skb, type, &ipc->us, addr); in qrtr_sendmsg()
1070 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_connect() local
1088 ipc->peer = *addr; in qrtr_connect()
1100 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_getname() local
1111 qaddr = ipc->peer; in qrtr_getname()
1113 qaddr = ipc->us; in qrtr_getname()
1127 struct qrtr_sock *ipc = qrtr_sk(sock->sk); in qrtr_ioctl() local
1157 *sq = ipc->us; in qrtr_ioctl()
1187 struct qrtr_sock *ipc; in qrtr_release() local
1194 ipc = qrtr_sk(sk); in qrtr_release()
1204 qrtr_port_remove(ipc); in qrtr_release()
1243 struct qrtr_sock *ipc; in qrtr_create() local
1258 ipc = qrtr_sk(sk); in qrtr_create()
1259 ipc->us.sq_family = AF_QIPCRTR; in qrtr_create()
1260 ipc->us.sq_node = qrtr_local_nid; in qrtr_create()
1261 ipc->us.sq_port = 0; in qrtr_create()