TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Device Drivers

Notices

How to trigger IRP_MN_SURPRISE_REMOVAL?

Microsoft Device Drivers


Reply
 
Thread Tools Display Modes
Old 26-06-2008, 08:43 PM   #1
Sathyanarayanan
Guest
 
Posts: n/a
How to trigger IRP_MN_SURPRISE_REMOVAL?

When certain event occurs, I want to restart another device in the system
(driver is either written by MSFT or by my company) from my driver.

I couldn't come across any mechanism to do it from kernel code, but I could
do it only from user mode (using devcon sample).

I was wondering if IRP_MN_SURPRISE_REMOVAL could be triggered (simulation)
to target device and the driver would be removed, then the rescan (or add
device trigger if possible) will load the driver again.

How can this IRP or surprise removal event could be triggered (from BIOS or
from my driver)?

--
++Sathya
  Reply With Quote
Old 26-06-2008, 08:43 PM   #2
Calvin Guan
Guest
 
Posts: n/a
Re: How to trigger IRP_MN_SURPRISE_REMOVAL?

It's triggered by a bus driver reported one or more PDOs as missing while
handling QDR for bus relations.

--
Calvin Guan
Principal Engineer
NetXtreme 10Gbps Converged NIC Bus Driver
Broadcom Corporation
Connecting Everything(r)

"Sathyanarayanan" <> wrote in
message news:...
> When certain event occurs, I want to restart another device in the system
> (driver is either written by MSFT or by my company) from my driver.
>
> I couldn't come across any mechanism to do it from kernel code, but I
> could
> do it only from user mode (using devcon sample).
>
> I was wondering if IRP_MN_SURPRISE_REMOVAL could be triggered (simulation)
> to target device and the driver would be removed, then the rescan (or add
> device trigger if possible) will load the driver again.
>
> How can this IRP or surprise removal event could be triggered (from BIOS
> or
> from my driver)?
>
> --
> ++Sathya



  Reply With Quote
Old 26-06-2008, 08:43 PM   #3
Sathyanarayanan
Guest
 
Posts: n/a
Re: How to trigger IRP_MN_SURPRISE_REMOVAL?

How do I simulate the surprise removal? So that, bus driver sends this IRP to
the target device.

I'm ok to modify BIOS code or my driver code to simulate the surprise
removal of target device - so, I'll know when to trigger the simulation, but
don't know *how* to do it?
--
++Sathya


"Calvin Guan" wrote:

> It's triggered by a bus driver reported one or more PDOs as missing while
> handling QDR for bus relations.
>
> --
> Calvin Guan
> Principal Engineer
> NetXtreme 10Gbps Converged NIC Bus Driver
> Broadcom Corporation
> Connecting Everything(r)
>
> "Sathyanarayanan" <> wrote in
> message news:...
> > When certain event occurs, I want to restart another device in the system
> > (driver is either written by MSFT or by my company) from my driver.
> >
> > I couldn't come across any mechanism to do it from kernel code, but I
> > could
> > do it only from user mode (using devcon sample).
> >
> > I was wondering if IRP_MN_SURPRISE_REMOVAL could be triggered (simulation)
> > to target device and the driver would be removed, then the rescan (or add
> > device trigger if possible) will load the driver again.
> >
> > How can this IRP or surprise removal event could be triggered (from BIOS
> > or
> > from my driver)?
> >
> > --
> > ++Sathya

>
>
>

  Reply With Quote
Old 26-06-2008, 08:44 PM   #4
Alexander Grigoriev
Guest
 
Posts: n/a
Re: How to trigger IRP_MN_SURPRISE_REMOVAL?

IoInvalidateDeviceState, then return
PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED for IRP_MN_QUERY_DEVICE_STATE

"Sathyanarayanan" <> wrote in
message news:...
> How do I simulate the surprise removal? So that, bus driver sends this IRP
> to
> the target device.
>
> I'm ok to modify BIOS code or my driver code to simulate the surprise
> removal of target device - so, I'll know when to trigger the simulation,
> but
> don't know *how* to do it?
> --
> ++Sathya
>
>
> "Calvin Guan" wrote:
>
>> It's triggered by a bus driver reported one or more PDOs as missing while
>> handling QDR for bus relations.
>>
>> --
>> Calvin Guan
>> Principal Engineer
>> NetXtreme 10Gbps Converged NIC Bus Driver
>> Broadcom Corporation
>> Connecting Everything(r)
>>
>> "Sathyanarayanan" <> wrote in
>> message news:...
>> > When certain event occurs, I want to restart another device in the
>> > system
>> > (driver is either written by MSFT or by my company) from my driver.
>> >
>> > I couldn't come across any mechanism to do it from kernel code, but I
>> > could
>> > do it only from user mode (using devcon sample).
>> >
>> > I was wondering if IRP_MN_SURPRISE_REMOVAL could be triggered
>> > (simulation)
>> > to target device and the driver would be removed, then the rescan (or
>> > add
>> > device trigger if possible) will load the driver again.
>> >
>> > How can this IRP or surprise removal event could be triggered (from
>> > BIOS
>> > or
>> > from my driver)?
>> >
>> > --
>> > ++Sathya

>>
>>
>>



  Reply With Quote
Old 26-06-2008, 08:44 PM   #5
Doron Holan [MSFT]
Guest
 
Posts: n/a
Re: How to trigger IRP_MN_SURPRISE_REMOVAL?

this will get you what you want. it will only tear the stack down, it will
not restart it. you cannot get a restart to happen from KM unless the bus
driver supports it (by surprise removing the PDO via QDR and then recreating
the PDO and rereporting it).

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.


"Alexander Grigoriev" <> wrote in message
news:.gbl...
> IoInvalidateDeviceState, then return
> PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED for IRP_MN_QUERY_DEVICE_STATE
>
> "Sathyanarayanan" <> wrote in
> message news:...
>> How do I simulate the surprise removal? So that, bus driver sends this
>> IRP to
>> the target device.
>>
>> I'm ok to modify BIOS code or my driver code to simulate the surprise
>> removal of target device - so, I'll know when to trigger the simulation,
>> but
>> don't know *how* to do it?
>> --
>> ++Sathya
>>
>>
>> "Calvin Guan" wrote:
>>
>>> It's triggered by a bus driver reported one or more PDOs as missing
>>> while
>>> handling QDR for bus relations.
>>>
>>> --
>>> Calvin Guan
>>> Principal Engineer
>>> NetXtreme 10Gbps Converged NIC Bus Driver
>>> Broadcom Corporation
>>> Connecting Everything(r)
>>>
>>> "Sathyanarayanan" <> wrote in
>>> message news:...
>>> > When certain event occurs, I want to restart another device in the
>>> > system
>>> > (driver is either written by MSFT or by my company) from my driver.
>>> >
>>> > I couldn't come across any mechanism to do it from kernel code, but I
>>> > could
>>> > do it only from user mode (using devcon sample).
>>> >
>>> > I was wondering if IRP_MN_SURPRISE_REMOVAL could be triggered
>>> > (simulation)
>>> > to target device and the driver would be removed, then the rescan (or
>>> > add
>>> > device trigger if possible) will load the driver again.
>>> >
>>> > How can this IRP or surprise removal event could be triggered (from
>>> > BIOS
>>> > or
>>> > from my driver)?
>>> >
>>> > --
>>> > ++Sathya
>>>
>>>
>>>

>
>


  Reply With Quote
Old 26-06-2008, 08:45 PM   #6
Sathyanarayanan
Guest
 
Posts: n/a
Re: How to trigger IRP_MN_SURPRISE_REMOVAL?

Here are more details about the problem. HDMI audio controller (or even audio
device) driver written by MSFT (or by OEMs) scans for topology only during
init.
I don't have more info about why.

Consider this situation: when audio is being played in one HDMI port and
other
port is currently not connected with any device. NOW, a HDMI device is
connected
to other port, then HDMI audio controller *should* be restarted to scan both
ports. This will disturb existing port stream & also has end-user impact.

But looks like (according to MSFT), restart of HDMI controller device is only
possible solution. Now, I'm figuring out how best to restart it (existing
stream
disturbance can't be avoided) from my display driver when I detect new HDMI
device is connected.

How do I solve the problem?
--
++Sathya


"Doron Holan [MSFT]" wrote:

> this will get you what you want. it will only tear the stack down, it will
> not restart it. you cannot get a restart to happen from KM unless the bus
> driver supports it (by surprise removing the PDO via QDR and then recreating
> the PDO and rereporting it).
>
> 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.
>
>
> "Alexander Grigoriev" <> wrote in message
> news:.gbl...
> > IoInvalidateDeviceState, then return
> > PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED for IRP_MN_QUERY_DEVICE_STATE
> >
> > "Sathyanarayanan" <> wrote in
> > message news:...
> >> How do I simulate the surprise removal? So that, bus driver sends this
> >> IRP to
> >> the target device.
> >>
> >> I'm ok to modify BIOS code or my driver code to simulate the surprise
> >> removal of target device - so, I'll know when to trigger the simulation,
> >> but
> >> don't know *how* to do it?
> >> --
> >> ++Sathya
> >>
> >>
> >> "Calvin Guan" wrote:
> >>
> >>> It's triggered by a bus driver reported one or more PDOs as missing
> >>> while
> >>> handling QDR for bus relations.
> >>>
> >>> --
> >>> Calvin Guan
> >>> Principal Engineer
> >>> NetXtreme 10Gbps Converged NIC Bus Driver
> >>> Broadcom Corporation
> >>> Connecting Everything(r)
> >>>
> >>> "Sathyanarayanan" <> wrote in
> >>> message news:...
> >>> > When certain event occurs, I want to restart another device in the
> >>> > system
> >>> > (driver is either written by MSFT or by my company) from my driver.
> >>> >
> >>> > I couldn't come across any mechanism to do it from kernel code, but I
> >>> > could
> >>> > do it only from user mode (using devcon sample).
> >>> >
> >>> > I was wondering if IRP_MN_SURPRISE_REMOVAL could be triggered
> >>> > (simulation)
> >>> > to target device and the driver would be removed, then the rescan (or
> >>> > add
> >>> > device trigger if possible) will load the driver again.
> >>> >
> >>> > How can this IRP or surprise removal event could be triggered (from
> >>> > BIOS
> >>> > or
> >>> > from my driver)?
> >>> >
> >>> > --
> >>> > ++Sathya
> >>>
> >>>
> >>>

> >
> >

>
>

  Reply With Quote
Reply

Thread Tools
Display Modes



< Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 03:47 AM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional