I'll very exciting about your reply. In short, I
want to develop a pair of virtual driver( frontend and backend) which
can communicate with each other by Share memory ,event channel and
xenstore, I've realized this in linux dom0 and domU, Now I want to port
the frontend driver to windows DomU. I want to take advantage of the
Gnttable/event channel/xenbus mechanism in your GPLPV driver. But I don't know
how?
I've seen you have register some interfaces in
version 0.4.0 as following which can be queryed by other driver. But these have
been removed in your latest driver.
So I think, Is there any other way to use these
interfaces in your latest driver, or can you open these interfaces again.
So all the developers who work on frontend and backend communication
will appreciate it.
Thanks.
Sincerely.
RtlZeroMemory(&EvtChnInterface, sizeof(EvtChnInterface));
EvtChnInterface.InterfaceHeader.Size = sizeof(EvtChnInterface);
EvtChnInterface.InterfaceHeader.Version = 1;
EvtChnInterface.InterfaceHeader.Context = NULL;
EvtChnInterface.InterfaceHeader.InterfaceReference = WdfDeviceInterfaceReferenceNoOp;
EvtChnInterface.InterfaceHeader.InterfaceDereference = WdfDeviceInterfaceDereferenceNoOp;
EvtChnInterface.Bind = EvtChn_Bind;
EvtChnInterface.Unbind = EvtChn_Unbind;
EvtChnInterface.Mask = EvtChn_Mask;
EvtChnInterface.Unmask = EvtChn_Unmask;
EvtChnInterface.Notify = EvtChn_Notify;
EvtChnInterface.AllocUnbound = EvtChn_AllocUnbound;
WDF_QUERY_INTERFACE_CONFIG_INIT(&qiConfig, (PINTERFACE)&EvtChnInterface, &GUID_XEN_IFACE_EVTCHN, NULL);
status = WdfDeviceAddQueryInterface(ChildDevice, &qiConfig);
if (!NT_SUCCESS(status))
{
return status;
}
RtlZeroMemory(&XenInterface, sizeof(XenInterface));
XenInterface.InterfaceHeader.Size = sizeof(XenInterface);
XenInterface.InterfaceHeader.Version = 1;
XenInterface.InterfaceHeader.Context = NULL;
XenInterface.InterfaceHeader.InterfaceReference = WdfDeviceInterfaceReferenceNoOp;
XenInterface.InterfaceHeader.InterfaceDereference = WdfDeviceInterfaceDereferenceNoOp;
XenInterface.AllocMMIO = XenPCI_AllocMMIO;
WDF_QUERY_INTERFACE_CONFIG_INIT(&qiConfig, (PINTERFACE)&XenInterface, &GUID_XEN_IFACE_XEN, NULL);
status = WdfDeviceAddQueryInterface(ChildDevice, &qiConfig);
if (!NT_SUCCESS(status)) {
return status;
}
RtlZeroMemory(&GntTblInterface, sizeof(GntTblInterface));
GntTblInterface.InterfaceHeader.Size = sizeof(GntTblInterface);
GntTblInterface.InterfaceHeader.Version = 1;
GntTblInterface.InterfaceHeader.Context = NULL;
GntTblInterface.InterfaceHeader.InterfaceReference = WdfDeviceInterfaceReferenceNoOp;
GntTblInterface.InterfaceHeader.InterfaceDereference = WdfDeviceInterfaceDereferenceNoOp;
GntTblInterface.GrantAccess = GntTbl_GrantAccess;
GntTblInterface.EndAccess = GntTbl_EndAccess;
WDF_QUERY_INTERFACE_CONFIG_INIT(&qiConfig, (PINTERFACE)&GntTblInterface, &GUID_XEN_IFACE_GNTTBL, NULL);
status = WdfDeviceAddQueryInterface(ChildDevice, &qiConfig);
if (!NT_SUCCESS(status)) {
return status;
}
RtlZeroMemory(&XenBusInterface, sizeof(XenBusInterface));
XenBusInterface.InterfaceHeader.Size = sizeof(XenBusInterface);
XenBusInterface.InterfaceHeader.Version = 1;
XenBusInterface.InterfaceHeader.Context = NULL;
//XenBusInterface.InterfaceHeader.Context = ExAllocatePoolWithTag(NonPagedPool, (strlen(XenIdentificationDesc->Path) + 1), XENPCI_POOL_TAG);
//strcpy(XenBusInterface.InterfaceHeader.Context, XenIdentificationDesc->Path);
XenBusInterface.Read = XenBus_Read;
XenBusInterface.Write = XenBus_Write;
XenBusInterface.Printf = XenBus_Printf;
XenBusInterface.StartTransaction = XenBus_StartTransaction;
XenBusInterface.EndTransaction = XenBus_EndTransaction;
XenBusInterface.List = XenBus_List;
XenBusInterface.AddWatch = XenBus_AddWatch;
XenBusInterface.RemWatch = XenBus_RemWatch;
WDF_QUERY_INTERFACE_CONFIG_INIT(&qiConfig, (PINTERFACE)&XenBusInterface, &GUID_XEN_IFACE_XENBUS, NULL);
status = WdfDeviceAddQueryInterface(ChildDevice, &qiConfig);
if (!NT_SUCCESS(status)) {
return status;
}
>
> Hi, I want to develop a device driver based on the GPLPV. But I don't know
> how to take advantage of the xen mechanism(xenbus, event channel, grant
> table) realized by GPLPV in the current version.
> I have seen that there are three interfaces which can be accessed by other
> driver in earlier version,but I'm very puzzle to use these interfaces in the
> current version.
>
> Can anyone is kindly enought to help me out.
>
The vector table and other details is accessed by a fairly clunky shared memory page method. It's not very pretty but does mean that the setup and teardown is done automatically.
What sort of device are you developing for? Is it something where the config is static? (eg event channel, xenstore entries etc don't change after init)
James