August 2 USB continue

Source: Internet
Author: User

Today, I didn't do much technical work. I was played by Yamazaki and longhorn (I don't know whether it was active or passive ).

Some records:

Kernel Status of Power Management

When a device is required to be suspended, the power supply is continuously maintained at one point, and Ram is kept in a self-Refresh state. The device is awakened when an interruption occurs.
There are generally three ways to suspend:
1. the keyboard driver sends a vk_off to GWES. Eventually, gwespoweroffsystem is called;
2. The OEM layer calls gwespoweroffsystem directly;
3. The OEM layer calls setsystempowerstate directly.

The gwespoweroff function performs key operations before a device can suspend.

To suspend a device

Every y the taskbar that the device is being suincluded.
Post the wm_powerbroadcast message with the flag pbt_apmsuspend. Only the registered taskbar will get this message.

Abort calibration if the calibration screen is up and in one of the following States:
Waiting at cross hairs.
If calibration was waiting at confirmation.
Turn off window message queues, stopping the processing of messages.
Determine if the startup UI screen needs to appear on resume.
Save video RAM to system Ram is necessary to preserve State on resume.
Call setsystempowerstate with the arguments (null, power_state_suspend, power_force ). this callinto the Power Manager that coordinates the rest of the suspend operation. at this point, gwespoweroff is not completed until the system resumes.
Power Manager performs the following actions:
CILS filesystempowerfunction (fsnotify_power_off) to power off file system drivers.
Callpoweroffsystem.
Callsleep (0) to allow the kernel schedend to run and perform the final suspend process.
The Kernel performs the following final steps to suspend:
Power off GWES process.
Power off filesys.exe.
If this is an shx microprocessor, call oemflushcache.
Call oempoweroff.

========================================================== ====================
When a resume occurs the kernel is the first to execute. A device will only resume from a halted state if an interrupt occurs and the CPU has been programmed to wake when an interrupt occurs.

To resume a device

The Kernel performs the following clean-up tasks before resuming normal scheduling:
If this is an shx, it calloemflushcache.
Callinitclock to re-Initialize timer hardware to a 1 MS tick.
CILS filesys.exe with a power on notification.
Callgwes with a power on notification.
Initializes the kitl interrupt if one is in use.
Power Manager then CILS filesystempowerfunction with the (fsnotify_power_on) argument.
On the resume, GWES performs the following tasks:
Restores video memory from Ram.
Powers on the window manager.
Sets the screen contrast.
Shows the startup UI screen, if required.
Posts A message to the taskbar to tell it the device has resumed by send a wm_powerbroadcast message with pbt_apmresumesuspend parameter.
Sends the same message to the user notification subsystem.
Triggers applications that have requested to be triggered on resume.

 USB function driver
It is also divided into function controller and function client driver.
From the USB spec 2.0 perspective, the function belongs to the device's top layer.

Boot-time Initialization

The following steps show the boot-time initialization process:

    1. The OS locates the function controller, and then loads the function controller driver by loading the dynamic-link library (DLL) that contains the PDD and the MDD.
    2. The dllmain function in the PDD CILSDllentryIn the MDD.
    3. The OS activates the stream interface that the MDD contains by callingUfn_init.
    4. Ufn_initCallinto the PDD to initialize the hardware.
    5. Ufn_initDetermines the client driver to load, and then callthe client driver's initialization routine.

The hardware initialization function carries out its responsibilities in the following order:

    1. Initializes the function controller on its bus.
    2. Places the function controller in the initialized State because the configuration might persist after a soft reset.
    3. Disables the USB connection.
    4. Disables device and Endpoint interrupts.
    5. Clears pending device and Endpoint interrupts.
    6. Clears configuration registers and the first in, first out (FIFO) buffer.
    7. Resets any internal data structures.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.