Lines Matching refs:srv

249 	struct tipc_topsrv *srv = con->server;  in tipc_conn_send_to_sock()  local
283 tipc_topsrv_kern_evt(srv->net, evt); in tipc_conn_send_to_sock()
314 struct tipc_topsrv *srv = tipc_topsrv(net); in tipc_topsrv_queue_evt() local
318 con = tipc_conn_lookup(srv, conid); in tipc_topsrv_queue_evt()
334 if (queue_work(srv->send_wq, &con->swork)) in tipc_topsrv_queue_evt()
358 static int tipc_conn_rcv_sub(struct tipc_topsrv *srv, in tipc_conn_rcv_sub() argument
362 struct tipc_net *tn = tipc_net(srv->net); in tipc_conn_rcv_sub()
375 sub = tipc_sub_subscribe(srv->net, s, con->conid); in tipc_conn_rcv_sub()
387 struct tipc_topsrv *srv = con->server; in tipc_conn_rcv_from_sock() local
405 ret = tipc_conn_rcv_sub(srv, con, &s); in tipc_conn_rcv_from_sock()
452 struct tipc_topsrv *srv = container_of(work, struct tipc_topsrv, awork); in tipc_topsrv_accept() local
453 struct socket *lsock = srv->listener; in tipc_topsrv_accept()
463 con = tipc_conn_alloc(srv); in tipc_topsrv_accept()
488 struct tipc_topsrv *srv; in tipc_topsrv_listener_data_ready() local
491 srv = sk->sk_user_data; in tipc_topsrv_listener_data_ready()
492 if (srv->listener) in tipc_topsrv_listener_data_ready()
493 queue_work(srv->rcv_wq, &srv->awork); in tipc_topsrv_listener_data_ready()
497 static int tipc_topsrv_create_listener(struct tipc_topsrv *srv) in tipc_topsrv_create_listener() argument
504 rc = sock_create_kern(srv->net, AF_TIPC, SOCK_SEQPACKET, 0, &lsock); in tipc_topsrv_create_listener()
508 srv->listener = lsock; in tipc_topsrv_create_listener()
512 sk->sk_user_data = srv; in tipc_topsrv_create_listener()
647 struct tipc_topsrv *srv; in tipc_topsrv_start() local
650 srv = kzalloc(sizeof(*srv), GFP_ATOMIC); in tipc_topsrv_start()
651 if (!srv) in tipc_topsrv_start()
654 srv->net = net; in tipc_topsrv_start()
655 INIT_WORK(&srv->awork, tipc_topsrv_accept); in tipc_topsrv_start()
657 strscpy(srv->name, name, sizeof(srv->name)); in tipc_topsrv_start()
658 tn->topsrv = srv; in tipc_topsrv_start()
661 spin_lock_init(&srv->idr_lock); in tipc_topsrv_start()
662 idr_init(&srv->conn_idr); in tipc_topsrv_start()
663 srv->idr_in_use = 0; in tipc_topsrv_start()
665 ret = tipc_topsrv_work_start(srv); in tipc_topsrv_start()
669 ret = tipc_topsrv_create_listener(srv); in tipc_topsrv_start()
676 tipc_topsrv_work_stop(srv); in tipc_topsrv_start()
678 kfree(srv); in tipc_topsrv_start()
684 struct tipc_topsrv *srv = tipc_topsrv(net); in tipc_topsrv_stop() local
685 struct socket *lsock = srv->listener; in tipc_topsrv_stop()
689 spin_lock_bh(&srv->idr_lock); in tipc_topsrv_stop()
690 for (id = 0; srv->idr_in_use; id++) { in tipc_topsrv_stop()
691 con = idr_find(&srv->conn_idr, id); in tipc_topsrv_stop()
693 spin_unlock_bh(&srv->idr_lock); in tipc_topsrv_stop()
695 spin_lock_bh(&srv->idr_lock); in tipc_topsrv_stop()
700 srv->listener = NULL; in tipc_topsrv_stop()
701 spin_unlock_bh(&srv->idr_lock); in tipc_topsrv_stop()
703 tipc_topsrv_work_stop(srv); in tipc_topsrv_stop()
704 idr_destroy(&srv->conn_idr); in tipc_topsrv_stop()
705 kfree(srv); in tipc_topsrv_stop()