Lines Matching refs:fedata
56 struct pvcalls_fedata *fedata; member
77 struct pvcalls_fedata *fedata; member
89 struct pvcalls_fedata *fedata,
264 struct pvcalls_fedata *fedata; in pvcalls_back_socket() local
268 fedata = dev_get_drvdata(&dev->dev); in pvcalls_back_socket()
280 rsp = RING_GET_RESPONSE(&fedata->ring, fedata->ring.rsp_prod_pvt++); in pvcalls_back_socket()
317 struct pvcalls_fedata *fedata, in pvcalls_new_active_socket() argument
333 map->fedata = fedata; in pvcalls_new_active_socket()
338 ret = xenbus_map_ring_valloc(fedata->dev, &ref, 1, &page); in pvcalls_new_active_socket()
350 ret = xenbus_map_ring_valloc(fedata->dev, map->ring->ref, in pvcalls_new_active_socket()
357 fedata->dev, evtchn, in pvcalls_new_active_socket()
372 down(&fedata->socket_lock); in pvcalls_new_active_socket()
373 list_add_tail(&map->list, &fedata->socket_mappings); in pvcalls_new_active_socket()
374 up(&fedata->socket_lock); in pvcalls_new_active_socket()
385 down(&fedata->socket_lock); in pvcalls_new_active_socket()
387 pvcalls_back_release_active(fedata->dev, fedata, map); in pvcalls_new_active_socket()
388 up(&fedata->socket_lock); in pvcalls_new_active_socket()
395 struct pvcalls_fedata *fedata; in pvcalls_back_connect() local
402 fedata = dev_get_drvdata(&dev->dev); in pvcalls_back_connect()
418 map = pvcalls_new_active_socket(fedata, in pvcalls_back_connect()
427 rsp = RING_GET_RESPONSE(&fedata->ring, fedata->ring.rsp_prod_pvt++); in pvcalls_back_connect()
437 struct pvcalls_fedata *fedata, in pvcalls_back_release_active() argument
462 struct pvcalls_fedata *fedata, in pvcalls_back_release_passive() argument
481 struct pvcalls_fedata *fedata; in pvcalls_back_release() local
487 fedata = dev_get_drvdata(&dev->dev); in pvcalls_back_release()
489 down(&fedata->socket_lock); in pvcalls_back_release()
490 list_for_each_entry_safe(map, n, &fedata->socket_mappings, list) { in pvcalls_back_release()
493 up(&fedata->socket_lock); in pvcalls_back_release()
494 ret = pvcalls_back_release_active(dev, fedata, map); in pvcalls_back_release()
498 mappass = radix_tree_lookup(&fedata->socketpass_mappings, in pvcalls_back_release()
501 radix_tree_delete(&fedata->socketpass_mappings, mappass->id); in pvcalls_back_release()
502 up(&fedata->socket_lock); in pvcalls_back_release()
503 ret = pvcalls_back_release_passive(dev, fedata, mappass); in pvcalls_back_release()
505 up(&fedata->socket_lock); in pvcalls_back_release()
508 rsp = RING_GET_RESPONSE(&fedata->ring, fedata->ring.rsp_prod_pvt++); in pvcalls_back_release()
526 struct pvcalls_fedata *fedata; in __pvcalls_back_accept() local
534 fedata = mappass->fedata; in __pvcalls_back_accept()
561 map = pvcalls_new_active_socket(fedata, in __pvcalls_back_accept()
578 rsp = RING_GET_RESPONSE(&fedata->ring, fedata->ring.rsp_prod_pvt++); in __pvcalls_back_accept()
583 RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&fedata->ring, notify); in __pvcalls_back_accept()
585 notify_remote_via_irq(fedata->irq); in __pvcalls_back_accept()
593 struct pvcalls_fedata *fedata; in pvcalls_pass_sk_data_ready() local
603 fedata = mappass->fedata; in pvcalls_pass_sk_data_ready()
606 rsp = RING_GET_RESPONSE(&fedata->ring, in pvcalls_pass_sk_data_ready()
607 fedata->ring.rsp_prod_pvt++); in pvcalls_pass_sk_data_ready()
616 RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&fedata->ring, notify); in pvcalls_pass_sk_data_ready()
618 notify_remote_via_irq(mappass->fedata->irq); in pvcalls_pass_sk_data_ready()
628 struct pvcalls_fedata *fedata; in pvcalls_back_bind() local
633 fedata = dev_get_drvdata(&dev->dev); in pvcalls_back_bind()
658 map->fedata = fedata; in pvcalls_back_bind()
661 down(&fedata->socket_lock); in pvcalls_back_bind()
662 ret = radix_tree_insert(&fedata->socketpass_mappings, map->id, in pvcalls_back_bind()
664 up(&fedata->socket_lock); in pvcalls_back_bind()
682 rsp = RING_GET_RESPONSE(&fedata->ring, fedata->ring.rsp_prod_pvt++); in pvcalls_back_bind()
693 struct pvcalls_fedata *fedata; in pvcalls_back_listen() local
698 fedata = dev_get_drvdata(&dev->dev); in pvcalls_back_listen()
700 down(&fedata->socket_lock); in pvcalls_back_listen()
701 map = radix_tree_lookup(&fedata->socketpass_mappings, req->u.listen.id); in pvcalls_back_listen()
702 up(&fedata->socket_lock); in pvcalls_back_listen()
709 rsp = RING_GET_RESPONSE(&fedata->ring, fedata->ring.rsp_prod_pvt++); in pvcalls_back_listen()
720 struct pvcalls_fedata *fedata; in pvcalls_back_accept() local
726 fedata = dev_get_drvdata(&dev->dev); in pvcalls_back_accept()
728 down(&fedata->socket_lock); in pvcalls_back_accept()
729 mappass = radix_tree_lookup(&fedata->socketpass_mappings, in pvcalls_back_accept()
731 up(&fedata->socket_lock); in pvcalls_back_accept()
754 rsp = RING_GET_RESPONSE(&fedata->ring, fedata->ring.rsp_prod_pvt++); in pvcalls_back_accept()
765 struct pvcalls_fedata *fedata; in pvcalls_back_poll() local
774 fedata = dev_get_drvdata(&dev->dev); in pvcalls_back_poll()
776 down(&fedata->socket_lock); in pvcalls_back_poll()
777 mappass = radix_tree_lookup(&fedata->socketpass_mappings, in pvcalls_back_poll()
779 up(&fedata->socket_lock); in pvcalls_back_poll()
810 rsp = RING_GET_RESPONSE(&fedata->ring, fedata->ring.rsp_prod_pvt++); in pvcalls_back_poll()
847 struct pvcalls_fedata *fedata; in pvcalls_back_handle_cmd() local
850 fedata = dev_get_drvdata(&dev->dev); in pvcalls_back_handle_cmd()
852 &fedata->ring, fedata->ring.rsp_prod_pvt++); in pvcalls_back_handle_cmd()
862 static void pvcalls_back_work(struct pvcalls_fedata *fedata) in pvcalls_back_work() argument
866 struct xenbus_device *dev = fedata->dev; in pvcalls_back_work()
869 while (RING_HAS_UNCONSUMED_REQUESTS(&fedata->ring)) { in pvcalls_back_work()
870 RING_COPY_REQUEST(&fedata->ring, in pvcalls_back_work()
871 fedata->ring.req_cons++, in pvcalls_back_work()
876 &fedata->ring, notify); in pvcalls_back_work()
882 notify_remote_via_irq(fedata->irq); in pvcalls_back_work()
886 RING_FINAL_CHECK_FOR_REQUESTS(&fedata->ring, more); in pvcalls_back_work()
893 struct pvcalls_fedata *fedata = NULL; in pvcalls_back_event() local
897 fedata = dev_get_drvdata(&dev->dev); in pvcalls_back_event()
898 if (fedata) { in pvcalls_back_event()
899 pvcalls_back_work(fedata); in pvcalls_back_event()
935 struct pvcalls_fedata *fedata = NULL; in backend_connect() local
937 fedata = kzalloc(sizeof(struct pvcalls_fedata), GFP_KERNEL); in backend_connect()
938 if (!fedata) in backend_connect()
941 fedata->irq = -1; in backend_connect()
962 fedata->irq = err; in backend_connect()
964 err = request_threaded_irq(fedata->irq, NULL, pvcalls_back_event, in backend_connect()
970 (void **)&fedata->sring); in backend_connect()
974 BACK_RING_INIT(&fedata->ring, fedata->sring, XEN_PAGE_SIZE * 1); in backend_connect()
975 fedata->dev = dev; in backend_connect()
977 INIT_LIST_HEAD(&fedata->socket_mappings); in backend_connect()
978 INIT_RADIX_TREE(&fedata->socketpass_mappings, GFP_KERNEL); in backend_connect()
979 sema_init(&fedata->socket_lock, 1); in backend_connect()
980 dev_set_drvdata(&dev->dev, fedata); in backend_connect()
983 list_add_tail(&fedata->list, &pvcalls_back_global.frontends); in backend_connect()
989 if (fedata->irq >= 0) in backend_connect()
990 unbind_from_irqhandler(fedata->irq, dev); in backend_connect()
991 if (fedata->sring != NULL) in backend_connect()
992 xenbus_unmap_ring_vfree(dev, fedata->sring); in backend_connect()
993 kfree(fedata); in backend_connect()
999 struct pvcalls_fedata *fedata; in backend_disconnect() local
1006 fedata = dev_get_drvdata(&dev->dev); in backend_disconnect()
1008 down(&fedata->socket_lock); in backend_disconnect()
1009 list_for_each_entry_safe(map, n, &fedata->socket_mappings, list) { in backend_disconnect()
1011 pvcalls_back_release_active(dev, fedata, map); in backend_disconnect()
1014 radix_tree_for_each_slot(slot, &fedata->socketpass_mappings, &iter, 0) { in backend_disconnect()
1022 radix_tree_delete(&fedata->socketpass_mappings, in backend_disconnect()
1024 pvcalls_back_release_passive(dev, fedata, mappass); in backend_disconnect()
1027 up(&fedata->socket_lock); in backend_disconnect()
1029 unbind_from_irqhandler(fedata->irq, dev); in backend_disconnect()
1030 xenbus_unmap_ring_vfree(dev, fedata->sring); in backend_disconnect()
1032 list_del(&fedata->list); in backend_disconnect()
1033 kfree(fedata); in backend_disconnect()
1235 struct pvcalls_fedata *fedata, *nfedata; in pvcalls_back_fin() local
1238 list_for_each_entry_safe(fedata, nfedata, in pvcalls_back_fin()
1240 backend_disconnect(fedata->dev); in pvcalls_back_fin()