wake on wlan无线唤醒_睡眠后重启才能连接WiFi

wake on wlan无线唤醒_睡眠后重启才能连接WiFi(1)添加头文件:       #include “core.h”      在core.h文件中有:       #ifdef CONFIG_HAS_EARLYSUSPEND             #include        #endif (2)在wifi驱动ath6kl结构体中添加early_suspend结构:        #ifdef CO

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

1)添加头文件:

        #include “core.h”

       在core.h文件中有:

        #ifdef CONFIG_HAS_EARLYSUSPEND

              #include <linux/earlysuspend.h>

        #endif

 

2)在wifi驱动ath6kl结构体中添加early_suspend结构:

        #ifdef CONFIG_HAS_EARLYSUSPEND

               struct early_suspend early_suspend;

               bool screen_off;

        #endif

 

3)在wifi驱动的电源管理文件pm.c中填充early_suspend结构体,并将其向android电源管理系统注册

         #ifdef CONFIG_HAS_EARLYSUSPEND

               ar->screen_off = false;

               ar->early_suspend.suspend = ath6kl_early_suspend;

               ar->early_suspend.resume = ath6kl_late_resume;

               ar->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN;

               register_early_suspend(&ar->early_suspend);

        #endif

        所有注册到系统中的early_suspend结构都会按level值按顺序加入到全局链表early_suspend_handlers中。 

       希望执行early suspend的设备,他的设备驱动程序需要向电源管理系统注册,该结构体用于向电源管理系统注册earlysuspend/lateresume,当电源管理系统启动suspend流程时,回调函数suspend会被调用,相反,resume的最后阶段,回调函数resume会被调用,level字段用于调整该结构体在注册链表中的位置,suspend时,level的数值越小,回调函数的被调用的时间越早resume时则反过来。

       Android在earlysuspend.h预先定义了3level等级

       enum {

                 EARLY_SUSPEND_LEVEL_BLANK_SCREEN = 50,

                 EARLY_SUSPEND_LEVEL_STOP_DRAWING = 100,

                 EARLY_SUSPEND_LEVEL_DISABLE_FB = 150,

       };

      具体请见附件kernel/include/linux/earlysuspend.h

 

4)在wifi驱动电源管理文件pm.c取消early_suspend结构体的注册:

         #ifdef CONFIG_HAS_EARLYSUSPEND

                 unregister_early_suspend(&ar->early_suspend);

         #endif

 

5)定义相关suspendresume函数:

       #ifdef CONFIG_HAS_EARLYSUSPEND

static void ath6kl_early_suspend(struct early_suspend *handler)

{

        struct ath6kl *ar = container_of(handler, struct ath6kl, early_suspend);

        if (ar)

                ar->screen_off = true;

}

static void ath6kl_late_resume(struct early_suspend *handler)

{

        struct ath6kl *ar = container_of(handler, struct ath6kl, early_suspend);

        if (ar)

                ar->screen_off = false;

}

#endif


 

附:kernel/include/linux/earlysuspend.h

#ifndef _LINUX_EARLYSUSPEND_H

#define _LINUX_EARLYSUSPEND_H

#ifdef CONFIG_HAS_EARLYSUSPEND

#include <linux/list.h>

#endif

/* The early_suspend structure defines suspend and resume hooks to be called

 * when the user visible sleep state of the system changes, and a level to

 * control the order. They can be used to turn off the screen and input

 * devices that are not used for wakeup.

 * Suspend handlers are called in low to high level order, resume handlers are

 * called in the opposite order. If, when calling register_early_suspend,

 * the suspend handlers have already been called without a matching call to the

 * Suspend handlers are called in low to high level order, resume handlers are

 * called in the opposite order. If, when calling register_early_suspend,

 * the suspend handlers have already been called without a matching call to the

 * resume handlers, the suspend handler will be called directly from

 * register_early_suspend. This direct call can violate the normal level order.

 */

enum {

        EARLY_SUSPEND_LEVEL_BLANK_SCREEN = 50,

        EARLY_SUSPEND_LEVEL_STOP_DRAWING = 100,

        EARLY_SUSPEND_LEVEL_DISABLE_FB = 150,

};

struct early_suspend {

#ifdef CONFIG_HAS_EARLYSUSPEND

        struct list_head link;

        int level;

        void (*suspend)(struct early_suspend *h);

        void (*resume)(struct early_suspend *h);

#endif

};

#ifdef CONFIG_HAS_EARLYSUSPEND

void register_early_suspend(struct early_suspend *handler);

void unregister_early_suspend(struct early_suspend *handler);

#else

#define register_early_suspend(handler) do { } while (0)

#define unregister_early_suspend(handler) do { } while (0)

#endif

#endif

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/192266.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • pycharm创建mysql数据库_自学语言的步骤

    pycharm创建mysql数据库_自学语言的步骤Python连接mysql并进行一些基本操作之前有讲过Python如何连接Oracle,在这一期。在连接mysql数据库时,原理相同,这里我们先说明理论部分,再给出一个具体实例。Python操作MySQL数据库需要下载PyMySQL.PyMySQL是一个Python编写的MySQL驱动程序。安装代码:pipinstallPyMySQL在Python中建立连接,先导入包:导入代码为:importpymysql#创建连接:连接代码:通过工具类调用connect()方法。注意:(必

    2022年8月28日
    7
  • 代理重加密-入门学习笔记(四)

    代理重加密-入门学习笔记(四)代理重加密(PRE)(重密码学!)原文:https://blog.csdn.net/Black_BearB/article/details/812280301、基本思想-流程结算在云计算中,云计算服务提供商作为代理人,用户A不能完全相信云计算服务提供商,因此需要将自己的数据在本地用自己的公钥加密后在云中存储,这样代理人无法得到数据的明文信息。当他要和用户B共享文件时,A根据自己的信…

    2022年9月9日
    1
  • html一个汉字空格占位_html空格字符

    html一个汉字空格占位_html空格字符1.&nbsp;(常用)不换行空格,全称No-BreakSpace,它是按下space键产生的空格。空格不会累加(只显示一个)。使用html表示才会累加,该空格占据宽度受字体影响。2.&ensp;半角空格,全称EnSpace,en为em宽度的一半(em类似于px受设置不同为20px=1em或其他自定义大小)。占据0.5个中文宽度,不受字体影响。3、&em…

    2022年10月4日
    1
  • FGC频繁

    FGC频繁1、假如FGC次数增加,达到一小时一次,但是gc之后,内存也立马降下来了;这说明并没有发生内存泄露;只是新生代的对象过早的进入的老年代;解决办法有增加年轻代空间,以减少youngGc,这样就不会有对象过早的进入老年代 增加年轻代进入老年代的年代阀值,可以增加到最大的15次…

    2022年6月19日
    37
  • POJ 1979 Red and Black

    POJ 1979 Red and Black

    2021年11月16日
    41
  • java和c语言哪个简单_Java编程和C语言哪个好学

    java和c语言哪个简单_Java编程和C语言哪个好学学哪种编程语言好?计算机编程语言非常多,诸如Java、C、C++、PHP等,很多人在选择的时候都会觉得头大。到底学哪种编程语言好?很多人都拿Java和c相比较,那么今天小编就来先说说我的个人理解吧,学习Java很简单上手很容易,只需要会拼音就可以,简直而且没有门槛,而c语言学习成本高,要想学会需要投入较大的精力,才能有一个相对不错的回报。下面是Java和c的市场占有率,可以看出,二者不分伯仲,第一…

    2022年7月9日
    20

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号