Dean
Thu May 08 08:16:31 PDT 2008
yes - don't have the app do that. Artificial removal/insertion at resume is
the way these devices are handled. Your app should be aware of this and not
erroneously tell the user that a real card change has taken place.
--
Dean Ramsier - eMVP
BSQUARE Corporation
"Jack.S" <JackS@discussions.microsoft.com> wrote in message
news:21D90BE7-1273-4C6E-8C58-D140FFE68056@microsoft.com...
> Hi Graeme
> My point is unload/reload the driver will cause system to broadcast a
> device changed message. The App have a thread for polling the message,
> when
> get the message , the App will determine "Is it card-insert?" or "Is it
> card-eject?".
> Because when unload/reload SD client driver , parse the device change
> message, we can get card eject/insert information.
> So if App is running ,suspend and then resume the system, if we unload and
> then reload the SD client driver, the App will get card-eject message,
> then
> App will pop a message to notify user that the SD card is removed. It will
> cause the user a confusion,because the sd card is still in the card slot.
> So could you give me another suggestion.?
>
> BR
> Jack
>
>
> "Graeme Wintle" wrote:
>
>> Typically when you susend/resume you can safely shut down your SD driver
>> and
>> restart it without any issues to the application, the reason for this is
>> if
>> the filesystem finds any IO operations fail it waits for a set amount of
>> time, then re-tries, this is to handle suspend and resume where the
>> driver
>> beneath the filesystem is not ready yet. This timeout is set from the
>> registry and is hardcoded, only one re-retry is allowed. It is assumed
>> that
>> on this second attempt your driver have started back up from a suspend.
>>
>> You can see this if you quickly remove and insert your sdcard the
>> filesystem
>> doesn't remove the "SDCARD" folder.
>>
>> The major drawback of this method is that if the timeout is too short you
>> application (say its media player) will fail after a resume as the
>> filesystem tried to read from the sdcard before the driver was ready. If
>> the
>> timeout is set too long media will hang whilst the filesystem is doing
>> this
>> Sleep(timeout) statement!
>>
>> The resgitry entry you may want to google is:
>>
>> [HKEY_LOCAL_MACHINE\System\StorageManager]
>> "PNPUnloadDelay"=dword:1000
>> "PNPWaitIODelay"=dword:1000
>>
>> Hope that helps!
>>
>> --
>> --
>> GraemeW
>> Web -
http://www.bytesnap.co.uk
>> Blog -
http://ce4all.blogspot.com
>>
>> "Jack.S" <JackS@discussions.microsoft.com> wrote in message
>> news:180C01A6-5B71-446C-9052-84E72B4CD276@microsoft.com...
>> > Hi all
>> > I am developing SD card driver (SD Host,SD Bus, SD Client), the SD Bus
>> > and
>> > SD Client Drivers are got from \PUBLIC\COMMON\OAK\DRIVERS\SDCARD\...
>> > Now ,I am facing a serial problem, and have no idea to solve it.
>> > The condition is:
>> > When system suspend and resume , we dont want unload and reload SD
>> > Cleint
>> > Driver,the reason is if the App is running and read/write data from/to
>> > SD
>> > card, we hope the App is keeping running, not broken by resume
>> > system.(Unload
>> > or reload will cause system to broadcast a device changed message, we
>> > dont
>> > want to get it)
>> > In SD host driver,my method is when system resume ,I call the function
>> > SDHCDIndicateSlotStateChange(m_pHCContext, 0, SlotResetRequest);
>> > And I do a test , that is "I do a file copy/paste by File Explore",
>> > but
>> > it
>> > always failed.
>> > I check the data of SD card, it is integrity and identical , nothing
>> > lose.
>> > And I do other test, that I execute a App(the App is a multimedia tool)
>> > to
>> > read/write data to SD.
>> > When reading/writing from/to SD card, I suspend and resume the system ,
>> > the
>> > App is keeping playing.
>> > So I am confused, what happened to it? I really have no idea about
>> > it...
>> > Could some one help me? ...
>> > BRs
>> > Jack
>>
>>
>>