Lines Matching refs:ctx
14 static void handle_nonesp(struct espintcp_ctx *ctx, struct sk_buff *skb, in handle_nonesp() argument
27 skb_queue_tail(&ctx->ike_queue, skb); in handle_nonesp()
28 ctx->saved_data_ready(sk); in handle_nonesp()
55 struct espintcp_ctx *ctx = container_of(strp, struct espintcp_ctx, in espintcp_rcv() local
108 handle_nonesp(ctx, skb, strp->sk); in espintcp_rcv()
137 struct espintcp_ctx *ctx = espintcp_getctx(sk); in espintcp_recvmsg() local
143 skb = __skb_recv_datagram(sk, &ctx->ike_queue, flags, &off, &err); in espintcp_recvmsg()
170 struct espintcp_ctx *ctx = espintcp_getctx(sk); in espintcp_queue_out() local
172 if (skb_queue_len(&ctx->out_queue) >= READ_ONCE(netdev_max_backlog)) in espintcp_queue_out()
175 __skb_queue_tail(&ctx->out_queue, skb); in espintcp_queue_out()
259 struct espintcp_ctx *ctx = espintcp_getctx(sk); in espintcp_push_msgs() local
260 struct espintcp_msg *emsg = &ctx->partial; in espintcp_push_msgs()
266 if (ctx->tx_running) in espintcp_push_msgs()
268 ctx->tx_running = 1; in espintcp_push_msgs()
275 ctx->tx_running = 0; in espintcp_push_msgs()
281 ctx->tx_running = 0; in espintcp_push_msgs()
288 struct espintcp_ctx *ctx = espintcp_getctx(sk); in espintcp_push_skb() local
289 struct espintcp_msg *emsg = &ctx->partial; in espintcp_push_skb()
323 struct espintcp_ctx *ctx = espintcp_getctx(sk); in espintcp_sendmsg() local
324 struct espintcp_msg *emsg = &ctx->partial; in espintcp_sendmsg()
405 struct espintcp_ctx *ctx = espintcp_getctx(sk); in espintcp_data_ready() local
409 strp_data_ready(&ctx->strp); in espintcp_data_ready()
414 struct espintcp_ctx *ctx = container_of(work, in espintcp_tx_work() local
416 struct sock *sk = ctx->strp.sk; in espintcp_tx_work()
419 if (!ctx->tx_running) in espintcp_tx_work()
426 struct espintcp_ctx *ctx = espintcp_getctx(sk); in espintcp_write_space() local
428 schedule_work(&ctx->work); in espintcp_write_space()
429 ctx->saved_write_space(sk); in espintcp_write_space()
434 struct espintcp_ctx *ctx = espintcp_getctx(sk); in espintcp_destruct() local
436 ctx->saved_destruct(sk); in espintcp_destruct()
437 kfree(ctx); in espintcp_destruct()
457 struct espintcp_ctx *ctx; in espintcp_init_sk() local
464 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); in espintcp_init_sk()
465 if (!ctx) in espintcp_init_sk()
468 err = strp_init(&ctx->strp, sk, &cb); in espintcp_init_sk()
474 strp_check_rcv(&ctx->strp); in espintcp_init_sk()
475 skb_queue_head_init(&ctx->ike_queue); in espintcp_init_sk()
476 skb_queue_head_init(&ctx->out_queue); in espintcp_init_sk()
490 ctx->saved_data_ready = sk->sk_data_ready; in espintcp_init_sk()
491 ctx->saved_write_space = sk->sk_write_space; in espintcp_init_sk()
492 ctx->saved_destruct = sk->sk_destruct; in espintcp_init_sk()
496 rcu_assign_pointer(icsk->icsk_ulp_data, ctx); in espintcp_init_sk()
497 INIT_WORK(&ctx->work, espintcp_tx_work); in espintcp_init_sk()
506 kfree(ctx); in espintcp_init_sk()
512 struct espintcp_ctx *ctx = espintcp_getctx(sk); in espintcp_release() local
517 skb_queue_splice_init(&ctx->out_queue, &queue); in espintcp_release()
527 struct espintcp_ctx *ctx = espintcp_getctx(sk); in espintcp_close() local
528 struct espintcp_msg *emsg = &ctx->partial; in espintcp_close()
530 strp_stop(&ctx->strp); in espintcp_close()
535 cancel_work_sync(&ctx->work); in espintcp_close()
536 strp_done(&ctx->strp); in espintcp_close()
538 skb_queue_purge(&ctx->out_queue); in espintcp_close()
539 skb_queue_purge(&ctx->ike_queue); in espintcp_close()
556 struct espintcp_ctx *ctx = espintcp_getctx(sk); in espintcp_poll() local
558 if (!skb_queue_empty(&ctx->ike_queue)) in espintcp_poll()