Prev: Application can not receive WM_DEVICECHANGE
Next: How can I request OIDs to Native 802.11 miniport driver?
From: Doron Holan [MSFT] on 21 Feb 2008 02:04 1) you should connect / disconnect in D0Entry and D0Exit in the parent....unless it belongs entirely to the child in which case you can leave it alone in the parent and connect/disconnect in the child's D0Entry/D0Exit routines. EvtInterruptEnable/Disable are only applicable if you use the WDFINTERRUPT. since you are not using the WDFINTERRUPT, these callbacks make no sense. If you need the same functionality, you can do this KeAcquireInterruptSpinLock(pkinterrupt object, &irql) EvtInterruptEnable() KeReleaseInterruptSpinLock(pkinterrupt object, irql) and the same for EvtInterruptDisable() 2) WDF cannot mamange the interrupt in the child b/c it needs to see the interrupt in the assigned resource list, so the child must use wdm to manage the itnerrupt's state d -- Please do not send e-mail directly to this alias. this alias is for newsgroup purposes only. This posting is provided "AS IS" with no warranties, and confers no rights. "$B^"<cIT(B?$B=.(B" <ZivHuang(a)gmail.com> wrote in message news:76d0da81-7121-47a9-9170-ce4c79931735(a)28g2000hsw.googlegroups.com... > Thanks Doronh, > > For answer 1: > > If I connect/disconnect interrupt by myself, which functions are the > right places to place WDM IoConnectInterrupt/IoDisconnectInterrupt? > > If I connect/disconnect the interrupt by myself, how can I let the WDF > management EvtInterruptEnable/EvtInterruptDisable for me? Or just to > enable interrupt before leaving EvtDeviceD0Entry and disable interrupt > when EvtDeviceD0Exit called? > > For answer 2: > > If I get the interrupt resource from private interface, does the WDF > management all interrupt issue for me? Or I need to take care of all > thing by myself (I think it's the right answer. Orz)? > > Thanks for your reply. ^_^ > > On 2$B7n(B21$BF|(B, $B>e8a(B2$B;~(B38$BJ,(B, "Doron Holan [MSFT]" > <dor...(a)online.microsoft.com> > wrote: >> 1) if you want to control the interrupts connected state, you can do >> this. >> do not create a WDFINTERRUPT and then you can connect/disconnect however >> you >> choose >> 2) you can assign your own resources to child devices. this requires >> internal interfaces which are not exposed to KMDF or though KMDF. >> instead >> you need to create a private interface to query for the interrupt >> resources >> and assign them through this private interface, this >> articlehttp://blogs.msdn.com/doronh/archive/2007/10/24/how-to-share-hw-resou... >> talks about the basic principles, although there are things you do not >> need >> to worry about like the interrupt resource going away before the child >> >> d >> >> -- >> Please do not send e-mail directly to this alias. this alias is for >> newsgroup purposes only. >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> >> "?????" <ZivHu...(a)gmail.com> wrote in message >> >> news:cd6eec86-218b-4fac-999f-211ff514c11a(a)h25g2000hsf.googlegroups.com... >> >> >> >> > Hi all, >> >> > I have a PCI card and I need to create a KMDF bus driver and create a >> > static KMDF child driver above that bus driver. >> >> > The bus driver can get hardware resources and the WDF automatically >> > connects and disconnects interrupts for the driver . >> >> > In the WDM, I can create a IOCTL to get interrupt resource from bus >> > driver and connect/disconnect the interrupt in the child driver. >> >> > I have no idea how to do that in WDF, because WDF will do that >> > automatically. My KMDF child driver never get any hardware resouces >> > when loaded. >> >> > I try this method below, but it can't work. The child report there is >> > no available resources and fail to load the driver. >> >> > May you hlep me? Thanks. ^_^ >> >> > Step1: >> > Copy the CM_PARTIAL_RESOURCE_DESCRIPTOR about interrupt into the bus >> > driver's device extension. >> >> > Step2: >> > //---------------------------------------------------------------------- >> > // When the bus driver create PDO for that child >> > //---------------------------------------------------------------------- >> > WDF_PDO_EVENT_CALLBACKS_INIT(&pdoCallbacks); >> > pdoCallbacks.EvtDeviceResourceRequirementsQuery = >> > BusPdo_EvtDeviceResourceRequirementsQuery; >> > WdfPdoInitSetEventCallbacks(pDeviceInit, &pdoCallbacks); >> >> > Step3 >> >> > In the BusPdo_EvtDeviceResourceRequirementsQuery function, >> > I try to copy the interrupt resource from step 2. Like this >> >> > //----------------------------------------------------------------------- >> > NTSTATUS status = STATUS_SUCCESS; >> > WDFIORESLIST logConfig; >> > IO_RESOURCE_DESCRIPTOR descriptor; >> >> > status = WdfIoResourceListCreate( >> > IoResourceRequirementsList, >> > WDF_NO_OBJECT_ATTRIBUTES, >> > &logConfig >> > ); >> > if(!NT_SUCCESS(status)){ >> > return status; >> > } >> >> > RtlZeroMemory(&descriptor, sizeof(descriptor)); >> >> > descriptor.Option = 0; >> > descriptor.Type = CmResourceTypeInterrupt; >> > descriptor.ShareDisposition = CmResourceShareShared >> > descriptor.Flags= RESOURCE_INTERRUPT_LEVEL_SENSITIVE >> > descriptor.u.Interrupt.MinimumVector = >> > fdoData->InterruptDescriptor.u.Interrupt.Vector; >> >> > descriptor.u.Interrupt.MaximumVector = >> > fdoData->InterruptDescriptor.u.Interrupt.Vector; >> >> > descriptor.u.Interrupt.TargetedProcessors= >> > fdoData->InterruptDescriptor.u.Interrupt.Affinity; >> >> > descriptor.u.Interrupt.AffinityPolicy= IrqPolicyMachineDefault; >> > descriptor.u.Interrupt.PriorityPolicy = IrqPriorityUndefined; >> >> > status = WdfIoResourceListAppendDescriptor(logConfig, &descriptor); >> > if(!NT_SUCCESS(status)){ >> > return status; >> > } >> >> > status = WdfIoResourceRequirementsListAppendIoResList( >> >> > IoResourceRequirementsList, >> > logConfig >> > ); >> >> > status = WdfIoResourceListAppendDescriptor(logConfig, &descriptor); >> > if(!NT_SUCCESS(status)){ >> > return status; >> > } >> >> > return status;- $Bp,i6Ho0zMQJ8;z(B - >> >> - $Bp}<(Ho0zMQJ8;z(B - >
From: 泛若不繫舟 on 21 Feb 2008 02:19 Thank you very much. ^_^ On 2$B7n(B21$BF|(B, $B2<8a(B3$B;~(B04$BJ,(B, "Doron Holan [MSFT]" <dor...(a)online.microsoft.com> wrote: > 1) you should connect / disconnect in D0Entry and D0Exit in the > parent....unless it belongs entirely to the child in which case you can > leave it alone in the parent and connect/disconnect in the child's > D0Entry/D0Exit routines. EvtInterruptEnable/Disable are only applicable if > you use the WDFINTERRUPT. since you are not using the WDFINTERRUPT, these > callbacks make no sense. If you need the same functionality, you can do > this > > KeAcquireInterruptSpinLock(pkinterrupt object, &irql) > EvtInterruptEnable() > KeReleaseInterruptSpinLock(pkinterrupt object, irql) > > and the same for EvtInterruptDisable() > > 2) WDF cannot mamange the interrupt in the child b/c it needs to see the > interrupt in the assigned resource list, so the child must use wdm to manage > the itnerrupt's state > > d > -- > Please do not send e-mail directly to this alias. this alias is for > newsgroup purposes only. > This posting is provided "AS IS" with no warranties, and confers no rights. > > "$B^"<cIT(B?$B=.(B" <ZivHu...(a)gmail.com> wrote in message > > news:76d0da81-7121-47a9-9170-ce4c79931735(a)28g2000hsw.googlegroups.com... > > > > > Thanks Doronh, > > > For answer 1: > > > If I connect/disconnect interrupt by myself, which functions are the > > right places to place WDM IoConnectInterrupt/IoDisconnectInterrupt? > > > If I connect/disconnect the interrupt by myself, how can I let the WDF > > management EvtInterruptEnable/EvtInterruptDisable for me? Or just to > > enable interrupt before leaving EvtDeviceD0Entry and disable interrupt > > when EvtDeviceD0Exit called? > > > For answer 2: > > > If I get the interrupt resource from private interface, does the WDF > > management all interrupt issue for me? Or I need to take care of all > > thing by myself (I think it's the right answer. Orz)? > > > Thanks for your reply. ^_^ > > > On 2$B7n(B21$BF|(B, $B>e8a(B2$B;~(B38$BJ,(B, "Doron Holan [MSFT]" > > <dor...(a)online.microsoft.com> > > wrote: > >> 1) if you want to control the interrupts connected state, you can do > >> this. > >> do not create a WDFINTERRUPT and then you can connect/disconnect however > >> you > >> choose > >> 2) you can assign your own resources to child devices. this requires > >> internal interfaces which are not exposed to KMDF or though KMDF. > >> instead > >> you need to create a private interface to query for the interrupt > >> resources > >> and assign them through this private interface, this > >> articlehttp://blogs.msdn.com/doronh/archive/2007/10/24/how-to-share-hw-resou... > >> talks about the basic principles, although there are things you do not > >> need > >> to worry about like the interrupt resource going away before the child > > >> d > > >> -- > >> Please do not send e-mail directly to this alias. this alias is for > >> newsgroup purposes only. > >> This posting is provided "AS IS" with no warranties, and confers no > >> rights. > > >> "?????" <ZivHu...(a)gmail.com> wrote in message > > >>news:cd6eec86-218b-4fac-999f-211ff514c11a(a)h25g2000hsf.googlegroups.com... > > >> > Hi all, > > >> > I have a PCI card and I need to create a KMDF bus driver and create a > >> > static KMDF child driver above that bus driver. > > >> > The bus driver can get hardware resources and the WDF automatically > >> > connects and disconnects interrupts for the driver . > > >> > In the WDM, I can create a IOCTL to get interrupt resource from bus > >> > driver and connect/disconnect the interrupt in the child driver. > > >> > I have no idea how to do that in WDF, because WDF will do that > >> > automatically. My KMDF child driver never get any hardware resouces > >> > when loaded. > > >> > I try this method below, but it can't work. The child report there is > >> > no available resources and fail to load the driver. > > >> > May you hlep me? Thanks. ^_^ > > >> > Step1: > >> > Copy the CM_PARTIAL_RESOURCE_DESCRIPTOR about interrupt into the bus > >> > driver's device extension. > > >> > Step2: > >> > //---------------------------------------------------------------------- > >> > // When the bus driver create PDO for that child > >> > //---------------------------------------------------------------------- > >> > WDF_PDO_EVENT_CALLBACKS_INIT(&pdoCallbacks); > >> > pdoCallbacks.EvtDeviceResourceRequirementsQuery = > >> > BusPdo_EvtDeviceResourceRequirementsQuery; > >> > WdfPdoInitSetEventCallbacks(pDeviceInit, &pdoCallbacks); > > >> > Step3 > > >> > In the BusPdo_EvtDeviceResourceRequirementsQuery function, > >> > I try to copy the interrupt resource from step 2. Like this > > >> > //----------------------------------------------------------------------- > >> > NTSTATUS status = STATUS_SUCCESS; > >> > WDFIORESLIST logConfig; > >> > IO_RESOURCE_DESCRIPTOR descriptor; > > >> > status = WdfIoResourceListCreate( > >> > IoResourceRequirementsList, > >> > WDF_NO_OBJECT_ATTRIBUTES, > >> > &logConfig > >> > ); > >> > if(!NT_SUCCESS(status)){ > >> > return status; > >> > } > > >> > RtlZeroMemory(&descriptor, sizeof(descriptor)); > > >> > descriptor.Option = 0; > >> > descriptor.Type = CmResourceTypeInterrupt; > >> > descriptor.ShareDisposition = CmResourceShareShared > >> > descriptor.Flags= RESOURCE_INTERRUPT_LEVEL_SENSITIVE > >> > descriptor.u.Interrupt.MinimumVector = > >> > fdoData->InterruptDescriptor.u.Interrupt.Vector; > > >> > descriptor.u.Interrupt.MaximumVector = > >> > fdoData->InterruptDescriptor.u.Interrupt.Vector; > > >> > descriptor.u.Interrupt.TargetedProcessors= > >> > fdoData->InterruptDescriptor.u.Interrupt.Affinity; > > >> > descriptor.u.Interrupt.AffinityPolicy= IrqPolicyMachineDefault; > >> > descriptor.u.Interrupt.PriorityPolicy = IrqPriorityUndefined; > > >> > status = WdfIoResourceListAppendDescriptor(logConfig, &descriptor); > >> > if(!NT_SUCCESS(status)){ > >> > return status; > >> > } > > >> > status = WdfIoResourceRequirementsListAppendIoResList( > > >> > IoResourceRequirementsList, > >> > logConfig > >> > ); > > >> > status = WdfIoResourceListAppendDescriptor(logConfig, &descriptor); > >> > if(!NT_SUCCESS(status)){ > >> > return status; > >> > } > > >> > return status;- $Bp,i6Ho0zMQJ8;z(B - > > >> - $Bp}<(Ho0zMQJ8;z(B -- $Bp,i6Ho0zMQJ8;z(B - > > - $Bp}<(Ho0zMQJ8;z(B -
From: 泛若不繫舟 on 21 Feb 2008 03:45 I'm wondering that design of my model is okay or bad. My consideration is that the user may disable driver A and let driver B and the radio bus still run. When the user disable the radio bus, the driver A and B shall be disabled too. If the design model is just okay, is there any chance that WDF can provide some function and let the bus share it's interrupt with child easily? Maybe WDF can provide a function called WdfGetParentSharedInterrupt() . Then the child can call this function and let the WDF management interrupt for it. Just my wild flights of fancy. ^_^ Thanks for your time. Ziv On 2$B7n(B21$BF|(B, $B2<8a(B3$B;~(B04$BJ,(B, "Doron Holan [MSFT]" <dor...(a)online.microsoft.com> wrote: > 1) you should connect / disconnect in D0Entry and D0Exit in the > parent....unless it belongs entirely to the child in which case you can > leave it alone in the parent and connect/disconnect in the child's > D0Entry/D0Exit routines. EvtInterruptEnable/Disable are only applicable if > you use the WDFINTERRUPT. since you are not using the WDFINTERRUPT, these > callbacks make no sense. If you need the same functionality, you can do > this > > KeAcquireInterruptSpinLock(pkinterrupt object, &irql) > EvtInterruptEnable() > KeReleaseInterruptSpinLock(pkinterrupt object, irql) > > and the same for EvtInterruptDisable() > > 2) WDF cannot mamange the interrupt in the child b/c it needs to see the > interrupt in the assigned resource list, so the child must use wdm to manage > the itnerrupt's state > > d > -- > Please do not send e-mail directly to this alias. this alias is for > newsgroup purposes only. > This posting is provided "AS IS" with no warranties, and confers no rights. > > "$B^"<cIT(B?$B=.(B" <ZivHu...(a)gmail.com> wrote in message > > news:76d0da81-7121-47a9-9170-ce4c79931735(a)28g2000hsw.googlegroups.com... > > > > > Thanks Doronh, > > > For answer 1: > > > If I connect/disconnect interrupt by myself, which functions are the > > right places to place WDM IoConnectInterrupt/IoDisconnectInterrupt? > > > If I connect/disconnect the interrupt by myself, how can I let the WDF > > management EvtInterruptEnable/EvtInterruptDisable for me? Or just to > > enable interrupt before leaving EvtDeviceD0Entry and disable interrupt > > when EvtDeviceD0Exit called? > > > For answer 2: > > > If I get the interrupt resource from private interface, does the WDF > > management all interrupt issue for me? Or I need to take care of all > > thing by myself (I think it's the right answer. Orz)? > > > Thanks for your reply. ^_^ > > > On 2$B7n(B21$BF|(B, $B>e8a(B2$B;~(B38$BJ,(B, "Doron Holan [MSFT]" > > <dor...(a)online.microsoft.com> > > wrote: > >> 1) if you want to control the interrupts connected state, you can do > >> this. > >> do not create a WDFINTERRUPT and then you can connect/disconnect however > >> you > >> choose > >> 2) you can assign your own resources to child devices. this requires > >> internal interfaces which are not exposed to KMDF or though KMDF. > >> instead > >> you need to create a private interface to query for the interrupt > >> resources > >> and assign them through this private interface, this > >> articlehttp://blogs.msdn.com/doronh/archive/2007/10/24/how-to-share-hw-resou... > >> talks about the basic principles, although there are things you do not > >> need > >> to worry about like the interrupt resource going away before the child > > >> d > > >> -- > >> Please do not send e-mail directly to this alias. this alias is for > >> newsgroup purposes only. > >> This posting is provided "AS IS" with no warranties, and confers no > >> rights. > > >> "?????" <ZivHu...(a)gmail.com> wrote in message > > >>news:cd6eec86-218b-4fac-999f-211ff514c11a(a)h25g2000hsf.googlegroups.com... > > >> > Hi all, > > >> > I have a PCI card and I need to create a KMDF bus driver and create a > >> > static KMDF child driver above that bus driver. > > >> > The bus driver can get hardware resources and the WDF automatically > >> > connects and disconnects interrupts for the driver . > > >> > In the WDM, I can create a IOCTL to get interrupt resource from bus > >> > driver and connect/disconnect the interrupt in the child driver. > > >> > I have no idea how to do that in WDF, because WDF will do that > >> > automatically. My KMDF child driver never get any hardware resouces > >> > when loaded. > > >> > I try this method below, but it can't work. The child report there is > >> > no available resources and fail to load the driver. > > >> > May you hlep me? Thanks. ^_^ > > >> > Step1: > >> > Copy the CM_PARTIAL_RESOURCE_DESCRIPTOR about interrupt into the bus > >> > driver's device extension. > > >> > Step2: > >> > //---------------------------------------------------------------------- > >> > // When the bus driver create PDO for that child > >> > //---------------------------------------------------------------------- > >> > WDF_PDO_EVENT_CALLBACKS_INIT(&pdoCallbacks); > >> > pdoCallbacks.EvtDeviceResourceRequirementsQuery = > >> > BusPdo_EvtDeviceResourceRequirementsQuery; > >> > WdfPdoInitSetEventCallbacks(pDeviceInit, &pdoCallbacks); > > >> > Step3 > > >> > In the BusPdo_EvtDeviceResourceRequirementsQuery function, > >> > I try to copy the interrupt resource from step 2. Like this > > >> > //----------------------------------------------------------------------- > >> > NTSTATUS status = STATUS_SUCCESS; > >> > WDFIORESLIST logConfig; > >> > IO_RESOURCE_DESCRIPTOR descriptor; > > >> > status = WdfIoResourceListCreate( > >> > IoResourceRequirementsList, > >> > WDF_NO_OBJECT_ATTRIBUTES, > >> > &logConfig > >> > ); > >> > if(!NT_SUCCESS(status)){ > >> > return status; > >> > } > > >> > RtlZeroMemory(&descriptor, sizeof(descriptor)); > > >> > descriptor.Option = 0; > >> > descriptor.Type = CmResourceTypeInterrupt; > >> > descriptor.ShareDisposition = CmResourceShareShared > >> > descriptor.Flags= RESOURCE_INTERRUPT_LEVEL_SENSITIVE > >> > descriptor.u.Interrupt.MinimumVector = > >> > fdoData->InterruptDescriptor.u.Interrupt.Vector; > > >> > descriptor.u.Interrupt.MaximumVector = > >> > fdoData->InterruptDescriptor.u.Interrupt.Vector; > > >> > descriptor.u.Interrupt.TargetedProcessors= > >> > fdoData->InterruptDescriptor.u.Interrupt.Affinity; > > >> > descriptor.u.Interrupt.AffinityPolicy= IrqPolicyMachineDefault; > >> > descriptor.u.Interrupt.PriorityPolicy = IrqPriorityUndefined; > > >> > status = WdfIoResourceListAppendDescriptor(logConfig, &descriptor); > >> > if(!NT_SUCCESS(status)){ > >> > return status; > >> > } > > >> > status = WdfIoResourceRequirementsListAppendIoResList( > > >> > IoResourceRequirementsList, > >> > logConfig > >> > ); > > >> > status = WdfIoResourceListAppendDescriptor(logConfig, &descriptor); > >> > if(!NT_SUCCESS(status)){ > >> > return status; > >> > } > > >> > return status;- $Bp,i6Ho0zMQJ8;z(B - > > >> - $Bp}<(Ho0zMQJ8;z(B -- $Bp,i6Ho0zMQJ8;z(B - > > - $Bp}<(Ho0zMQJ8;z(B -
From: Doron Holan [MSFT] on 21 Feb 2008 14:16 as long as the child stack behave properly and turns off the interrupt when it is disabled, i do not see a problem with the design. d -- Please do not send e-mail directly to this alias. this alias is for newsgroup purposes only. This posting is provided "AS IS" with no warranties, and confers no rights. "$B^"<cIT=z%j=.(B" <ZivHuang(a)gmail.com> wrote in message news:d851bedc-71f9-46d7-a311-46b8ace4bfeb(a)b29g2000hsa.googlegroups.com... > I'm wondering that design of my model is okay or bad. > > My consideration is that the user may disable driver A and let driver > B and the radio bus still run. > When the user disable the radio bus, the driver A and B shall be > disabled too. > > If the design model is just okay, is there any chance that WDF can > provide some function and let the bus share it's interrupt with child > easily? > > Maybe WDF can provide a function called > WdfGetParentSharedInterrupt() . > Then the child can call this function and let the WDF management > interrupt for it. > > Just my wild flights of fancy. ^_^ > Thanks for your time. > > Ziv > > > On 2$B7n(B21$BF|(B, $B2<8a(B3$B;~(B04$BJ,(B, "Doron Holan [MSFT]" > <dor...(a)online.microsoft.com> > wrote: >> 1) you should connect / disconnect in D0Entry and D0Exit in the >> parent....unless it belongs entirely to the child in which case you can >> leave it alone in the parent and connect/disconnect in the child's >> D0Entry/D0Exit routines. EvtInterruptEnable/Disable are only applicable >> if >> you use the WDFINTERRUPT. since you are not using the WDFINTERRUPT, >> these >> callbacks make no sense. If you need the same functionality, you can do >> this >> >> KeAcquireInterruptSpinLock(pkinterrupt object, &irql) >> EvtInterruptEnable() >> KeReleaseInterruptSpinLock(pkinterrupt object, irql) >> >> and the same for EvtInterruptDisable() >> >> 2) WDF cannot mamange the interrupt in the child b/c it needs to see the >> interrupt in the assigned resource list, so the child must use wdm to >> manage >> the itnerrupt's state >> >> d >> -- >> Please do not send e-mail directly to this alias. this alias is for >> newsgroup purposes only. >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> >> "$B^"<cIT(B?$B=.(B" <ZivHu...(a)gmail.com> wrote in message >> >> news:76d0da81-7121-47a9-9170-ce4c79931735(a)28g2000hsw.googlegroups.com... >> >> >> >> > Thanks Doronh, >> >> > For answer 1: >> >> > If I connect/disconnect interrupt by myself, which functions are the >> > right places to place WDM IoConnectInterrupt/IoDisconnectInterrupt? >> >> > If I connect/disconnect the interrupt by myself, how can I let the WDF >> > management EvtInterruptEnable/EvtInterruptDisable for me? Or just to >> > enable interrupt before leaving EvtDeviceD0Entry and disable interrupt >> > when EvtDeviceD0Exit called? >> >> > For answer 2: >> >> > If I get the interrupt resource from private interface, does the WDF >> > management all interrupt issue for me? Or I need to take care of all >> > thing by myself (I think it's the right answer. Orz)? >> >> > Thanks for your reply. ^_^ >> >> > On 2$B7n(B21$BF|(B, $B>e8a(B2$B;~(B38$BJ,(B, "Doron Holan [MSFT]" >> > <dor...(a)online.microsoft.com> >> > wrote: >> >> 1) if you want to control the interrupts connected state, you can do >> >> this. >> >> do not create a WDFINTERRUPT and then you can connect/disconnect >> >> however >> >> you >> >> choose >> >> 2) you can assign your own resources to child devices. this requires >> >> internal interfaces which are not exposed to KMDF or though KMDF. >> >> instead >> >> you need to create a private interface to query for the interrupt >> >> resources >> >> and assign them through this private interface, this >> >> articlehttp://blogs.msdn.com/doronh/archive/2007/10/24/how-to-share-hw-resou... >> >> talks about the basic principles, although there are things you do not >> >> need >> >> to worry about like the interrupt resource going away before the child >> >> >> d >> >> >> -- >> >> Please do not send e-mail directly to this alias. this alias is for >> >> newsgroup purposes only. >> >> This posting is provided "AS IS" with no warranties, and confers no >> >> rights. >> >> >> "?????" <ZivHu...(a)gmail.com> wrote in message >> >> >>news:cd6eec86-218b-4fac-999f-211ff514c11a(a)h25g2000hsf.googlegroups.com... >> >> >> > Hi all, >> >> >> > I have a PCI card and I need to create a KMDF bus driver and create >> >> > a >> >> > static KMDF child driver above that bus driver. >> >> >> > The bus driver can get hardware resources and the WDF automatically >> >> > connects and disconnects interrupts for the driver . >> >> >> > In the WDM, I can create a IOCTL to get interrupt resource from bus >> >> > driver and connect/disconnect the interrupt in the child driver. >> >> >> > I have no idea how to do that in WDF, because WDF will do that >> >> > automatically. My KMDF child driver never get any hardware resouces >> >> > when loaded. >> >> >> > I try this method below, but it can't work. The child report there >> >> > is >> >> > no available resources and fail to load the driver. >> >> >> > May you hlep me? Thanks. ^_^ >> >> >> > Step1: >> >> > Copy the CM_PARTIAL_RESOURCE_DESCRIPTOR about interrupt into the bus >> >> > driver's device extension. >> >> >> > Step2: >> >> > //---------------------------------------------------------------------- >> >> > // When the bus driver create PDO for that child >> >> > //---------------------------------------------------------------------- >> >> > WDF_PDO_EVENT_CALLBACKS_INIT(&pdoCallbacks); >> >> > pdoCallbacks.EvtDeviceResourceRequirementsQuery = >> >> > BusPdo_EvtDeviceResourceRequirementsQuery; >> >> > WdfPdoInitSetEventCallbacks(pDeviceInit, &pdoCallbacks); >> >> >> > Step3 >> >> >> > In the BusPdo_EvtDeviceResourceRequirementsQuery function, >> >> > I try to copy the interrupt resource from step 2. Like this >> >> >> > //----------------------------------------------------------------------- >> >> > NTSTATUS status = STATUS_SUCCESS; >> >> > WDFIORESLIST logConfig; >> >> > IO_RESOURCE_DESCRIPTOR descriptor; >> >> >> > status = WdfIoResourceListCreate( >> >> > IoResourceRequirementsList, >> >> > WDF_NO_OBJECT_ATTRIBUTES, >> >> > &logConfig >> >> > ); >> >> > if(!NT_SUCCESS(status)){ >> >> > return status; >> >> > } >> >> >> > RtlZeroMemory(&descriptor, sizeof(descriptor)); >> >> >> > descriptor.Option = 0; >> >> > descriptor.Type = CmResourceTypeInterrupt; >> >> > descriptor.ShareDisposition = CmResourceShareShared >> >> > descriptor.Flags= RESOURCE_INTERRUPT_LEVEL_SENSITIVE >> >> > descriptor.u.Interrupt.MinimumVector = >> >> > fdoData->InterruptDescriptor.u.Interrupt.Vector; >> >> >> > descriptor.u.Interrupt.MaximumVector = >> >> > fdoData->InterruptDescriptor.u.Interrupt.Vector; >> >> >> > descriptor.u.Interrupt.TargetedProcessors= >> >> > fdoData->InterruptDescriptor.u.Interrupt.Affinity; >> >> >> > descriptor.u.Interrupt.AffinityPolicy= IrqPolicyMachineDefault; >> >> > descriptor.u.Interrupt.PriorityPolicy = IrqPriorityUndefined; >> >> >> > status = WdfIoResourceListAppendDescriptor(logConfig, &descriptor); >> >> > if(!NT_SUCCESS(status)){ >> >> > return status; >> >> > } >> >> >> > status = WdfIoResourceRequirementsListAppendIoResList( >> >> >> > IoResourceRequirementsList, >> >> > logConfig >> >> > ); >> >> >> > status = WdfIoResourceListAppendDescriptor(logConfig, &descriptor); >> >> > if(!NT_SUCCESS(status)){ >> >> > return status; >> >> > } >> >> >> > return status;- $Bp,i6Ho0zMQJ8;z(B - >> >> >> - $Bp}<(Ho0zMQJ8;z(B -- $Bp,i6Ho0zMQJ8;z(B - >> >> - $Bp}<(Ho0zMQJ8;z(B - >
First
|
Prev
|
Pages: 1 2 Prev: Application can not receive WM_DEVICECHANGE Next: How can I request OIDs to Native 802.11 miniport driver? |