Lines Matching full:hvs
242 struct hvsock *hvs = vsk->trans; in hvs_channel_cb() local
243 struct vmbus_channel *chan = hvs->chan; in hvs_channel_cb()
294 struct hvsock *hvs = NULL; in hvs_open_connection() local
344 hvs = vsock_sk(sk)->trans; in hvs_open_connection()
345 hvs->chan = chan; in hvs_open_connection()
382 hvs->chan = NULL; in hvs_open_connection()
433 struct hvsock *hvs; in hvs_sock_init() local
436 hvs = kzalloc(sizeof(*hvs), GFP_KERNEL); in hvs_sock_init()
437 if (!hvs) in hvs_sock_init()
440 vsk->trans = hvs; in hvs_sock_init()
441 hvs->vsk = vsk; in hvs_sock_init()
463 static void hvs_shutdown_lock_held(struct hvsock *hvs, int mode) in hvs_shutdown_lock_held() argument
467 if (hvs->fin_sent || !hvs->chan) in hvs_shutdown_lock_held()
471 (void)hvs_send_data(hvs->chan, (struct hvs_send_buf *)&hdr, 0); in hvs_shutdown_lock_held()
472 hvs->fin_sent = true; in hvs_shutdown_lock_held()
534 struct hvsock *hvs = vsk->trans; in hvs_destruct() local
535 struct vmbus_channel *chan = hvs->chan; in hvs_destruct()
540 kfree(hvs); in hvs_destruct()
566 static int hvs_update_recv_data(struct hvsock *hvs) in hvs_update_recv_data() argument
571 recv_buf = (struct hvs_recv_buf *)(hvs->recv_desc + 1); in hvs_update_recv_data()
578 hvs->vsk->peer_shutdown |= SEND_SHUTDOWN; in hvs_update_recv_data()
580 hvs->recv_data_len = payload_len; in hvs_update_recv_data()
581 hvs->recv_data_off = 0; in hvs_update_recv_data()
589 struct hvsock *hvs = vsk->trans; in hvs_stream_dequeue() local
590 bool need_refill = !hvs->recv_desc; in hvs_stream_dequeue()
599 hvs->recv_desc = hv_pkt_iter_first(hvs->chan); in hvs_stream_dequeue()
600 ret = hvs_update_recv_data(hvs); in hvs_stream_dequeue()
605 recv_buf = (struct hvs_recv_buf *)(hvs->recv_desc + 1); in hvs_stream_dequeue()
606 to_read = min_t(u32, len, hvs->recv_data_len); in hvs_stream_dequeue()
607 ret = memcpy_to_msg(msg, recv_buf->data + hvs->recv_data_off, to_read); in hvs_stream_dequeue()
611 hvs->recv_data_len -= to_read; in hvs_stream_dequeue()
612 if (hvs->recv_data_len == 0) { in hvs_stream_dequeue()
613 hvs->recv_desc = hv_pkt_iter_next(hvs->chan, hvs->recv_desc); in hvs_stream_dequeue()
614 if (hvs->recv_desc) { in hvs_stream_dequeue()
615 ret = hvs_update_recv_data(hvs); in hvs_stream_dequeue()
620 hvs->recv_data_off += to_read; in hvs_stream_dequeue()
629 struct hvsock *hvs = vsk->trans; in hvs_stream_enqueue() local
630 struct vmbus_channel *chan = hvs->chan; in hvs_stream_enqueue()
659 ret = hvs_send_data(hvs->chan, send_buf, to_write); in hvs_stream_enqueue()
676 struct hvsock *hvs = vsk->trans; in hvs_stream_has_data() local
679 if (hvs->recv_data_len > 0) in hvs_stream_has_data()
682 switch (hvs_channel_readable_payload(hvs->chan)) { in hvs_stream_has_data()
700 struct hvsock *hvs = vsk->trans; in hvs_stream_has_space() local
702 return hvs_channel_writable_bytes(hvs->chan); in hvs_stream_has_space()
712 struct hvsock *hvs = vsk->trans; in hvs_stream_is_active() local
714 return hvs->chan != NULL; in hvs_stream_is_active()
728 struct hvsock *hvs = vsk->trans; in hvs_notify_poll_in() local
730 *readable = hvs_channel_readable(hvs->chan); in hvs_notify_poll_in()