Confirm for safe removing network controller

Hi folks,

When I developing Xen Windows Para-virtual Drivers, I use a pci driver
to enumerate block and network device. A NDIS miniport driver will
service the network device and a SCSI miniport driver will service the
block device. Now I have a problem when implement Safe Remove feature. I
want to remove network/block device safely like eject a USB device. When
network/block device is busy, system will pop up a warning dialog to
notice the current network/block device is busy and cannot remove now.

In my pci driver, I use IoRequestDeviceEject to the child PDO which I
want to safe remove. Block device works fine. When I use SDStress to
take a heavy load for the block device, windows will pop the warning
dialog. But for network device, even I use iperf to take a heavy load
for the network controller, PnP manager still send some IRP to notify my
pci driver that the network controller can safe remove and of course my
NDIS miniport driver remove the network device. Windows pops a message
that the network controller can now be safe removed.

So does any flag I missed in NDIS miniport driver to give a wrong
message that let NDIS port driver ignore to detect whether device is
busy when my pci driver call IoRequestDeviceEject? Or Does windows PnP
manager has a policy that network controller is not critical as block
device and can safe remove even it has heavy load? Please give me some
tips to search or something I need to read first.

Thanks
Wayne

> busy when my pci driver call IoRequestDeviceEject? Or Does windows PnP

manager has a policy that network controller is not critical as block
device and can safe remove even it has heavy load?

I think yes. This is what I always saw on all network controllers.

Note that the main reason for asking the user on removal is cache flush, and network has no caches.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Gong,

Chances are your NDIS driver sets the NDIS_ATTRIBUTE_SURPRISE_REMOVE_OK as one of its adapter attributes?

Thanks,

Ilya Faenson
Rockvile, MD USA

> Chances are your NDIS driver sets the NDIS_ATTRIBUTE_SURPRISE_REMOVE_OK as one of its adapter attributes?

Yes, but in my opinion, that’s take effect for surprise remove. My NDIS
driver supports to surprise remove a network device.

Thanks
Wayne

> Chances are your NDIS driver sets the NDIS_ATTRIBUTE_SURPRISE_REMOVE_OK as one of its adapter attributes?

Yes, I set this flag. I think that just for surprise remove. My pci and
NDIS miniport driver also support to surprise remove a network device.

Thanks
Wayne