Lines Matching refs:hvs
295 struct hvsock *hvs = vsk->trans; in hvs_channel_cb() local
296 struct vmbus_channel *chan = hvs->chan; in hvs_channel_cb()
332 struct hvsock *hvs, *hvs_new; in hvs_open_connection() local
370 hvs = vsock_sk(sk)->trans; in hvs_open_connection()
371 hvs->chan = chan; in hvs_open_connection()
383 hvs->chan = NULL; in hvs_open_connection()
427 struct hvsock *hvs; in hvs_sock_init() local
429 hvs = kzalloc(sizeof(*hvs), GFP_KERNEL); in hvs_sock_init()
430 if (!hvs) in hvs_sock_init()
433 vsk->trans = hvs; in hvs_sock_init()
434 hvs->vsk = vsk; in hvs_sock_init()
460 struct hvsock *hvs; in hvs_shutdown() local
467 hvs = vsk->trans; in hvs_shutdown()
468 if (hvs->fin_sent) in hvs_shutdown()
474 (void)hvs_send_data(hvs->chan, send_buf, 0); in hvs_shutdown()
476 hvs->fin_sent = true; in hvs_shutdown()
485 struct hvsock *hvs = vsk->trans; in hvs_release() local
495 chan = hvs->chan; in hvs_release()
503 struct hvsock *hvs = vsk->trans; in hvs_destruct() local
504 struct vmbus_channel *chan = hvs->chan; in hvs_destruct()
509 kfree(hvs); in hvs_destruct()
535 static int hvs_update_recv_data(struct hvsock *hvs) in hvs_update_recv_data() argument
540 recv_buf = (struct hvs_recv_buf *)(hvs->recv_desc + 1); in hvs_update_recv_data()
547 hvs->vsk->peer_shutdown |= SEND_SHUTDOWN; in hvs_update_recv_data()
549 hvs->recv_data_len = payload_len; in hvs_update_recv_data()
550 hvs->recv_data_off = 0; in hvs_update_recv_data()
558 struct hvsock *hvs = vsk->trans; in hvs_stream_dequeue() local
559 bool need_refill = !hvs->recv_desc; in hvs_stream_dequeue()
568 hvs->recv_desc = hv_pkt_iter_first(hvs->chan); in hvs_stream_dequeue()
569 ret = hvs_update_recv_data(hvs); in hvs_stream_dequeue()
574 recv_buf = (struct hvs_recv_buf *)(hvs->recv_desc + 1); in hvs_stream_dequeue()
575 to_read = min_t(u32, len, hvs->recv_data_len); in hvs_stream_dequeue()
576 ret = memcpy_to_msg(msg, recv_buf->data + hvs->recv_data_off, to_read); in hvs_stream_dequeue()
580 hvs->recv_data_len -= to_read; in hvs_stream_dequeue()
581 if (hvs->recv_data_len == 0) { in hvs_stream_dequeue()
582 hvs->recv_desc = hv_pkt_iter_next(hvs->chan, hvs->recv_desc); in hvs_stream_dequeue()
583 if (hvs->recv_desc) { in hvs_stream_dequeue()
584 ret = hvs_update_recv_data(hvs); in hvs_stream_dequeue()
589 hvs->recv_data_off += to_read; in hvs_stream_dequeue()
598 struct hvsock *hvs = vsk->trans; in hvs_stream_enqueue() local
599 struct vmbus_channel *chan = hvs->chan; in hvs_stream_enqueue()
617 ret = hvs_send_data(hvs->chan, send_buf, to_write); in hvs_stream_enqueue()
629 struct hvsock *hvs = vsk->trans; in hvs_stream_has_data() local
632 if (hvs->recv_data_len > 0) in hvs_stream_has_data()
635 switch (hvs_channel_readable_payload(hvs->chan)) { in hvs_stream_has_data()
653 struct hvsock *hvs = vsk->trans; in hvs_stream_has_space() local
654 struct vmbus_channel *chan = hvs->chan; in hvs_stream_has_space()
680 struct hvsock *hvs = vsk->trans; in hvs_stream_is_active() local
682 return hvs->chan != NULL; in hvs_stream_is_active()
706 struct hvsock *hvs = vsk->trans; in hvs_notify_poll_in() local
708 *readable = hvs_channel_readable(hvs->chan); in hvs_notify_poll_in()