Looking for help to solve a driver installation issue

Hi,
to explain the issue, I need a bit of explanation. I try to make it as short as possible. I have written a USB driver for a CX3 device. If the device is connected to the USB port, no dedictated firmware is running. My driver acts on a specific VID/PID combination and downloads the respective device firmware. After that the device is restarted with the new firmware running. Now the driver is running in normal mode, supporting the device.
This works quite well and I guess this is not unusual for a CX3 device.

Now, the issue is, that during first time installation on some machines, when the device is connected, Windows is complaining that the installation of the firmware loader driver was unsuccessful. This is stated in the bubble that appears in the taskbar or in the details view during driver installation. There is no error stated in setupapi.dev.log and the drivers are working as expected afterwards. The problem is, that this is an annoying and irritating indication for our customers.

I would need a hint to overcome this issue, here are my questions:

  • is there a way to tell windows during driver installation to not show up that message?

  • is there a driver callback which tells the driver that the installation procedure has finished? Will it be possible to send the USB request to restart the device using that callback?

  • I assume that the restart and enumeration of the device comes to quickly during the installation process of the driver. Maybe this causes Windows to complain. I tried to implement a delay timer in my driver that will be started after the firmware is downloaded. When the timer expires I send the restart address via a WdfUsbTargetDeviceSendControlTransferSynchronously to the device to request the restart, while being in the EvtTimerFunc callback. When doing this I get a blue screen with the following error code:

ATTEMPTED_SWITCH_FROM_DPC (b8) A wait operation, attach process, or yield was attempted from a DPC routine.

I assume that this is caused by my USB request during the timer callback.
Can someone give me a hint where and when it is safe to trigger the restart after the timeout expired?
Currently the timer is started in the EvtDeviceSelfManagedIoInit callback. This was my best guess to place it.

I would be grateful for every advice that could solve my issue. Don’t hesitate to point me to any stupid assumption I made. I am quite new to it and I am sure there are mistakes in my approach.

Thank a lot for your support

Andreas

Either send the request async or queue a workitem from the timer callback and send the request from the worker

d

Bent from my phone


From: xxxxx@gmx.netmailto:xxxxx
Sent: ?1/?31/?2015 7:41 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] Looking for help to solve a driver installation issue

Hi,
to explain the issue, I need a bit of explanation. I try to make it as short as possible. I have written a USB driver for a CX3 device. If the device is connected to the USB port, no dedictated firmware is running. My driver acts on a specific VID/PID combination and downloads the respective device firmware. After that the device is restarted with the new firmware running. Now the driver is running in normal mode, supporting the device.
This works quite well and I guess this is not unusual for a CX3 device.

Now, the issue is, that during first time installation on some machines, when the device is connected, Windows is complaining that the installation of the firmware loader driver was unsuccessful. This is stated in the bubble that appears in the taskbar or in the details view during driver installation. There is no error stated in setupapi.dev.log and the drivers are working as expected afterwards. The problem is, that this is an annoying and irritating indication for our customers.

I would need a hint to overcome this issue, here are my questions:

- is there a way to tell windows during driver installation to not show up that message?

- is there a driver callback which tells the driver that the installation procedure has finished? Will it be possible to send the USB request to restart the device using that callback?

- I assume that the restart and enumeration of the device comes to quickly during the installation process of the driver. Maybe this causes Windows to complain. I tried to implement a delay timer in my driver that will be started after the firmware is downloaded. When the timer expires I send the restart address via a WdfUsbTargetDeviceSendControlTransferSynchronously to the device to request the restart, while being in the EvtTimerFunc callback. When doing this I get a blue screen with the following error code:

ATTEMPTED_SWITCH_FROM_DPC (b8) A wait operation, attach process, or yield was attempted from a DPC routine.

I assume that this is caused by my USB request during the timer callback.
Can someone give me a hint where and when it is safe to trigger the restart after the timeout expired?
Currently the timer is started in the EvtDeviceSelfManagedIoInit callback. This was my best guess to place it.

I would be grateful for every advice that could solve my issue. Don’t hesitate to point me to any stupid assumption I made. I am quite new to it and I am sure there are mistakes in my approach.

Thank a lot for your support

Andreas


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

Thanks Doron,

the async request is now working as expected

regards andreas