Lines Matching refs:reqp

252 #define SEARCH_REMOVE_REQ_LOCKED(reqp, queue, link, tmp, id)		\  argument
254 STAILQ_FOREACH_SAFE(reqp, queue, link, tmp) { \
255 if (reqp->vss_req.opt_msg.msgid == id) { \
257 reqp, hv_vss_req_internal, link); \
310 hv_vss_notify_host_result_locked(struct hv_vss_req_internal *reqp, uint32_t status) in hv_vss_notify_host_result_locked() argument
312 struct hv_vss_msg* msg = (struct hv_vss_msg *)reqp->rcv_buf; in hv_vss_notify_host_result_locked()
313 hv_vss_sc *sc = reqp->sc; in hv_vss_notify_host_result_locked()
314 if (reqp->vss_req.opt_msg.opt == HV_VSS_CHECK) { in hv_vss_notify_host_result_locked()
318 vss_opt_name[reqp->vss_req.opt_msg.opt], in hv_vss_notify_host_result_locked()
320 hv_vss_respond_host(reqp->rcv_buf, vmbus_get_channel(reqp->sc->dev), in hv_vss_notify_host_result_locked()
321 reqp->host_msg_len, reqp->host_msg_id, status); in hv_vss_notify_host_result_locked()
323 LIST_INSERT_HEAD(&sc->req_free_list, reqp, link); in hv_vss_notify_host_result_locked()
327 hv_vss_notify_host_result(struct hv_vss_req_internal *reqp, uint32_t status) in hv_vss_notify_host_result() argument
329 mtx_lock(&reqp->sc->pending_mutex); in hv_vss_notify_host_result()
330 hv_vss_notify_host_result_locked(reqp, status); in hv_vss_notify_host_result()
331 mtx_unlock(&reqp->sc->pending_mutex); in hv_vss_notify_host_result()
335 hv_vss_cp_vssreq_to_user(struct hv_vss_req_internal *reqp, in hv_vss_cp_vssreq_to_user() argument
339 hv_vss_dev_buf = &reqp->vss_req; in hv_vss_cp_vssreq_to_user()
341 switch (reqp->vss_req.msg.hdr.vss_hdr.operation) { in hv_vss_cp_vssreq_to_user()
368 struct hv_vss_req_internal *reqp, *tmp; in hv_vss_drain_req_queue_locked() local
369 SEARCH_REMOVE_REQ_LOCKED(reqp, &sc->daemon_sc.to_notify_queue, in hv_vss_drain_req_queue_locked()
371 if (reqp == NULL) in hv_vss_drain_req_queue_locked()
372 SEARCH_REMOVE_REQ_LOCKED(reqp, &sc->daemon_sc.to_ack_queue, in hv_vss_drain_req_queue_locked()
374 if (reqp == NULL) in hv_vss_drain_req_queue_locked()
375 SEARCH_REMOVE_REQ_LOCKED(reqp, &sc->app_sc.to_notify_queue, in hv_vss_drain_req_queue_locked()
377 if (reqp == NULL) in hv_vss_drain_req_queue_locked()
378 SEARCH_REMOVE_REQ_LOCKED(reqp, &sc->app_sc.to_ack_queue, slink, in hv_vss_drain_req_queue_locked()
380 return (reqp); in hv_vss_drain_req_queue_locked()
388 struct hv_vss_req_internal *reqp; in hv_vss_notified() local
391 reqp = STAILQ_FIRST(&dev_sc->to_notify_queue); in hv_vss_notified()
392 hv_vss_cp_vssreq_to_user(reqp, userdata); in hv_vss_notified()
395 STAILQ_INSERT_TAIL(&dev_sc->to_ack_queue, reqp, slink); in hv_vss_notified()
406 hv_vss_notify(struct hv_vss_dev_sc *dev_sc, struct hv_vss_req_internal *reqp) in hv_vss_notify() argument
408 uint32_t opt = reqp->vss_req.opt_msg.opt; in hv_vss_notify()
410 STAILQ_INSERT_TAIL(&dev_sc->to_notify_queue, reqp, slink); in hv_vss_notify()
412 vss_opt_name[opt], (uintmax_t)reqp->vss_req.opt_msg.msgid, in hv_vss_notify()
424 struct hv_vss_req_internal *reqp, *tmp; in hv_vss_daemon_acked() local
436 SEARCH_REMOVE_REQ_LOCKED(reqp, &dev_sc->to_ack_queue, slink, tmp, req_id); in hv_vss_daemon_acked()
438 if (reqp == NULL) { in hv_vss_daemon_acked()
444 KASSERT(opt == reqp->vss_req.opt_msg.opt, ("Mismatched VSS operation!")); in hv_vss_daemon_acked()
450 callout_drain(&reqp->callout); in hv_vss_daemon_acked()
451 hv_vss_notify_host_result(reqp, in hv_vss_daemon_acked()
457 hv_vss_notify(&dev_sc->sc->app_sc, reqp); in hv_vss_daemon_acked()
460 callout_drain(&reqp->callout); in hv_vss_daemon_acked()
461 hv_vss_notify_host_result(reqp, HV_E_FAIL); in hv_vss_daemon_acked()
464 callout_drain(&reqp->callout); in hv_vss_daemon_acked()
465 hv_vss_notify_host_result(reqp, in hv_vss_daemon_acked()
478 struct hv_vss_req_internal *reqp, *tmp; in hv_vss_app_acked() local
490 SEARCH_REMOVE_REQ_LOCKED(reqp, &dev_sc->to_ack_queue, slink, tmp, req_id); in hv_vss_app_acked()
492 if (reqp == NULL) { in hv_vss_app_acked()
498 KASSERT(opt == reqp->vss_req.opt_msg.opt, ("Mismatched VSS operation!")); in hv_vss_app_acked()
506 hv_vss_notify(&dev_sc->sc->daemon_sc, reqp); in hv_vss_app_acked()
509 callout_drain(&reqp->callout); in hv_vss_app_acked()
510 hv_vss_notify_host_result(reqp, HV_E_FAIL); in hv_vss_app_acked()
514 callout_drain(&reqp->callout); in hv_vss_app_acked()
515 hv_vss_notify_host_result(reqp, in hv_vss_app_acked()
689 hv_vss_req_internal *reqp = arg; in hv_vss_timeout() local
691 hv_vss_sc* sc = reqp->sc; in hv_vss_timeout()
692 uint64_t req_id = reqp->vss_req.opt_msg.msgid; in hv_vss_timeout()
697 hv_vss_notify_host_result_locked(reqp, HV_E_FAIL); in hv_vss_timeout()
704 hv_vss_init_req(hv_vss_req_internal *reqp, in hv_vss_init_req() argument
710 memset(reqp, 0, __offsetof(hv_vss_req_internal, callout)); in hv_vss_init_req()
711 reqp->host_msg_len = recvlen; in hv_vss_init_req()
712 reqp->host_msg_id = requestid; in hv_vss_init_req()
713 reqp->rcv_buf = vss_buf; in hv_vss_init_req()
714 reqp->sc = sc; in hv_vss_init_req()
715 memcpy(&reqp->vss_req.msg, in hv_vss_init_req()
720 reqp->vss_req.opt_msg.opt = HV_VSS_FREEZE; in hv_vss_init_req()
723 reqp->vss_req.opt_msg.opt = HV_VSS_THAW; in hv_vss_init_req()
726 reqp->vss_req.opt_msg.opt = HV_VSS_CHECK; in hv_vss_init_req()
731 reqp->vss_req.opt_msg.msgid = (vm_ts.tv_sec * NANOSEC) + vm_ts.tv_nsec; in hv_vss_init_req()
737 hv_vss_req_internal *reqp; in hv_vss_get_new_req_locked() local
755 reqp = LIST_FIRST(&sc->req_free_list); in hv_vss_get_new_req_locked()
756 LIST_REMOVE(reqp, link); in hv_vss_get_new_req_locked()
757 return (reqp); in hv_vss_get_new_req_locked()
761 hv_vss_start_notify(hv_vss_req_internal *reqp, uint32_t opt) in hv_vss_start_notify() argument
763 hv_vss_sc *sc = reqp->sc; in hv_vss_start_notify()
775 hv_vss_notify(&sc->app_sc, reqp); in hv_vss_start_notify()
777 hv_vss_notify(&sc->daemon_sc, reqp); in hv_vss_start_notify()
778 callout_reset(&reqp->callout, TIMEOUT_LIMIT * hz, in hv_vss_start_notify()
779 hv_vss_timeout, reqp); in hv_vss_start_notify()
782 hv_vss_notify(&sc->daemon_sc, reqp); in hv_vss_start_notify()
783 callout_reset(&reqp->callout, TIMEOUT_LIMIT * hz, in hv_vss_start_notify()
784 hv_vss_timeout, reqp); in hv_vss_start_notify()
803 hv_vss_req_internal *reqp; in hv_vss_process_request() local
832 reqp = hv_vss_get_new_req_locked(sc); in hv_vss_process_request()
834 if (reqp == NULL) { in hv_vss_process_request()
838 hv_vss_init_req(reqp, recvlen, requestid, vss_buf, sc); in hv_vss_process_request()
841 vss_opt_name[reqp->vss_req.opt_msg.opt], in hv_vss_process_request()
842 (uintmax_t)reqp->vss_req.opt_msg.msgid); in hv_vss_process_request()
843 hv_vss_start_notify(reqp, msg->hdr.vss_hdr.operation); in hv_vss_process_request()
912 struct hv_vss_req_internal* reqp; in hv_vss_init_send_receive_queue() local
921 reqp = malloc(sizeof(struct hv_vss_req_internal), in hv_vss_init_send_receive_queue()
923 LIST_INSERT_HEAD(&sc->req_free_list, reqp, link); in hv_vss_init_send_receive_queue()
924 callout_init_mtx(&reqp->callout, &sc->pending_mutex, 0); in hv_vss_init_send_receive_queue()
933 hv_vss_req_internal* reqp; in hv_vss_destroy_send_receive_queue() local
936 reqp = LIST_FIRST(&sc->req_free_list); in hv_vss_destroy_send_receive_queue()
937 LIST_REMOVE(reqp, link); in hv_vss_destroy_send_receive_queue()
938 free(reqp, M_DEVBUF); in hv_vss_destroy_send_receive_queue()
942 reqp = STAILQ_FIRST(&sc->daemon_sc.to_notify_queue); in hv_vss_destroy_send_receive_queue()
944 free(reqp, M_DEVBUF); in hv_vss_destroy_send_receive_queue()
948 reqp = STAILQ_FIRST(&sc->daemon_sc.to_ack_queue); in hv_vss_destroy_send_receive_queue()
950 free(reqp, M_DEVBUF); in hv_vss_destroy_send_receive_queue()
954 reqp = STAILQ_FIRST(&sc->app_sc.to_notify_queue); in hv_vss_destroy_send_receive_queue()
956 free(reqp, M_DEVBUF); in hv_vss_destroy_send_receive_queue()
960 reqp = STAILQ_FIRST(&sc->app_sc.to_ack_queue); in hv_vss_destroy_send_receive_queue()
962 free(reqp, M_DEVBUF); in hv_vss_destroy_send_receive_queue()