Lines Matching refs:hvs

251 	struct hvsock *hvs = vsk->trans;  in hvs_channel_cb()  local
252 struct vmbus_channel *chan = hvs->chan; in hvs_channel_cb()
303 struct hvsock *hvs = NULL; in hvs_open_connection() local
353 hvs = vsock_sk(sk)->trans; in hvs_open_connection()
354 hvs->chan = chan; in hvs_open_connection()
393 hvs->chan = NULL; in hvs_open_connection()
444 struct hvsock *hvs; in hvs_sock_init() local
447 hvs = kzalloc(sizeof(*hvs), GFP_KERNEL); in hvs_sock_init()
448 if (!hvs) in hvs_sock_init()
451 vsk->trans = hvs; in hvs_sock_init()
452 hvs->vsk = vsk; in hvs_sock_init()
474 static void hvs_shutdown_lock_held(struct hvsock *hvs, int mode) in hvs_shutdown_lock_held() argument
478 if (hvs->fin_sent || !hvs->chan) in hvs_shutdown_lock_held()
482 (void)__hvs_send_data(hvs->chan, &hdr, 0); in hvs_shutdown_lock_held()
483 hvs->fin_sent = true; in hvs_shutdown_lock_held()
545 struct hvsock *hvs = vsk->trans; in hvs_destruct() local
546 struct vmbus_channel *chan = hvs->chan; in hvs_destruct()
551 kfree(hvs); in hvs_destruct()
577 static int hvs_update_recv_data(struct hvsock *hvs) in hvs_update_recv_data() argument
582 pkt_len = hv_pkt_len(hvs->recv_desc); in hvs_update_recv_data()
587 recv_buf = (struct hvs_recv_buf *)(hvs->recv_desc + 1); in hvs_update_recv_data()
595 hvs->vsk->peer_shutdown |= SEND_SHUTDOWN; in hvs_update_recv_data()
597 hvs->recv_data_len = payload_len; in hvs_update_recv_data()
598 hvs->recv_data_off = 0; in hvs_update_recv_data()
606 struct hvsock *hvs = vsk->trans; in hvs_stream_dequeue() local
607 bool need_refill = !hvs->recv_desc; in hvs_stream_dequeue()
616 hvs->recv_desc = hv_pkt_iter_first(hvs->chan); in hvs_stream_dequeue()
617 if (!hvs->recv_desc) in hvs_stream_dequeue()
619 ret = hvs_update_recv_data(hvs); in hvs_stream_dequeue()
624 recv_buf = (struct hvs_recv_buf *)(hvs->recv_desc + 1); in hvs_stream_dequeue()
625 to_read = min_t(u32, len, hvs->recv_data_len); in hvs_stream_dequeue()
626 ret = memcpy_to_msg(msg, recv_buf->data + hvs->recv_data_off, to_read); in hvs_stream_dequeue()
630 hvs->recv_data_len -= to_read; in hvs_stream_dequeue()
631 if (hvs->recv_data_len == 0) { in hvs_stream_dequeue()
632 hvs->recv_desc = hv_pkt_iter_next(hvs->chan, hvs->recv_desc); in hvs_stream_dequeue()
633 if (hvs->recv_desc) { in hvs_stream_dequeue()
634 ret = hvs_update_recv_data(hvs); in hvs_stream_dequeue()
639 hvs->recv_data_off += to_read; in hvs_stream_dequeue()
648 struct hvsock *hvs = vsk->trans; in hvs_stream_enqueue() local
649 struct vmbus_channel *chan = hvs->chan; in hvs_stream_enqueue()
678 ret = hvs_send_data(hvs->chan, send_buf, to_write); in hvs_stream_enqueue()
695 struct hvsock *hvs = vsk->trans; in hvs_stream_has_data() local
698 if (hvs->recv_data_len > 0) in hvs_stream_has_data()
701 switch (hvs_channel_readable_payload(hvs->chan)) { in hvs_stream_has_data()
719 struct hvsock *hvs = vsk->trans; in hvs_stream_has_space() local
721 return hvs_channel_writable_bytes(hvs->chan); in hvs_stream_has_space()
731 struct hvsock *hvs = vsk->trans; in hvs_stream_is_active() local
733 return hvs->chan != NULL; in hvs_stream_is_active()
747 struct hvsock *hvs = vsk->trans; in hvs_notify_poll_in() local
749 *readable = hvs_channel_readable(hvs->chan); in hvs_notify_poll_in()