T31如何获取ATBM6441唤醒事件
ATBM6441 SDK修改:
1,初始化GPIO,并设置为中断。
2,中断触发唤醒,
wakeup_host_reason = WAKEUP_TYPE_PIR; //WAKEUP_TYPE_CONNECT
HI_WakeupBT_Process(Wakeup_Gpio_Data_Get(),0);
T31则WiFi 驱动修改:
Index: hal_apollo/atbm_ioctl_ext.h
===================================================================
--- hal_apollo/atbm_ioctl_ext.h (revision 1850)
+++ hal_apollo/atbm_ioctl_ext.h (revision 1851)
@@ -1,7 +1,7 @@
ifndef ATBM_IOCTL_EXT_H
define ATBM_IOCTL_EXT_H
-#define PRIV_VERSION "2020-1125-1825"
+#define PRIV_VERSION "2020-1208-1347"
define ATBM_IOCTL (121)
Index: hal_apollo/main.c
===================================================================
--- hal_apollo/main.c (revision 1850)
+++ hal_apollo/main.c (revision 1851)
@@ -144,7 +144,8 @@
mutex_lock(&hw_priv->conf_mutex);
list_for_each_entry(event, &list, link) {
if ((event->evt.eventId != WSM_EVENT_HOST_RMMOD)
- && (event->evt.eventId != WSM_EVENT_HOST_INSMOD)){
+ && (event->evt.eventId != WSM_EVENT_HOST_INSMOD)
+ && (event->evt.eventId != WSM_EVENT_HOST_WAKEUP_REASON)){
priv = __ABwifi_hwpriv_to_vifpriv(hw_priv, event->if_id);
if (!priv) {
printk( "[CQM] Event for non existing interface, ignoring.\n");
@@ -219,6 +220,12 @@
atbm_ioctl_driver_async(1);
break;
}
+ case WSM_EVENT_HOST_WAKEUP_REASON:
+ {
+ u8 reason = ((u8 )event->evt.buffer);
+ atbm_ioctl_wakeup_async(reason);
+ break;
+ }
}
}
mutex_unlock(&hw_priv->conf_mutex);
Index: hal_apollo/wsm.c
===================================================================
--- hal_apollo/wsm.c (revision 1850)
+++ hal_apollo/wsm.c (revision 1851)
@@ -208,7 +208,8 @@
eventid=__le32_to_cpu(WSM_GET32(buf));
if ((eventid != WSM_EVENT_HOST_RMMOD)
- && (eventid != WSM_EVENT_HOST_INSMOD)){
+ && (eventid != WSM_EVENT_HOST_INSMOD)
+ && (eventid != WSM_EVENT_HOST_WAKEUP_REASON)){
priv = ABwifi_hwpriv_to_vifpriv(hw_priv, interface_link_id);
if (unlikely(!priv)) {
Index: hal_apollo/wsm.h
===================================================================
--- hal_apollo/wsm.h (revision 1850)
+++ hal_apollo/wsm.h (revision 1851)
@@ -422,6 +422,9 @@
/HOST insmod/
define WSM_EVENT_HOST_INSMOD (11)
+/HOST wakeup reason/
+#define WSM_EVENT_HOST_WAKEUP_REASON (12)
+
/ MAC Addr Filter /
define WSM_MIB_ID_MAC_ADDR_FILTER 0x1030
Index: hal_apollo/atbm_ioctl.c
===================================================================
--- hal_apollo/atbm_ioctl.c (revision 1850)
+++ hal_apollo/atbm_ioctl.c (revision 1851)
@@ -24,7 +24,7 @@
struct status_async{
u8 is_connected;
- u8 type; / 0: connect msg, 1: driver msg, 2:scan complete/
+ u8 type; / 0: connect msg, 1: driver msg, 2:scan complete, 3:wakeup host reason/
u8 driver_mode; / 0: rmmod, 1: insmod/
u8 reserved[1];
struct HostConnectEvent event;
@@ -70,6 +70,13 @@
kill_fasync (&connect_async, SIGIO, POLL_IN);
}
+void atbm_ioctl_wakeup_async(int reason)
+{
+ status.type = 3;
+ status.driver_mode = reason;
+ kill_fasync (&connect_async, SIGIO, POLL_IN);
+}
+
static int atbm_wsm_ps(struct atbm_common *hw_priv, unsigned int data)
{
int ret = 0;
Index: hal_apollo/atbm_ioctl.h
===================================================================
--- hal_apollo/atbm_ioctl.h (revision 1850)
+++ hal_apollo/atbm_ioctl.h (revision 1851)
@@ -14,6 +14,7 @@
void atbm_ioctl_connect_async(struct HostConnectEvent *event, char is_connected);
void atbm_ioctl_driver_async(int insmod);
+void atbm_ioctl_wakeup_async(int reason);
int atbm_ioctl_add(void);
void atbm_ioctl_free(void);
Index: tools/atbm_tool.h
===================================================================
--- tools/atbm_tool.h (revision 1850)
+++ tools/atbm_tool.h (revision 1851)
@@ -269,7 +269,7 @@
struct status_async{
u8 is_connected;
- u8 type; /0: connect msg; 1: rmmod; 2: scan complete/
+ u8 type; /0: connect msg; 1: rmmod; 2: scan complet, 3:wakeup host reasone/
u8 driver_mode; / 0: rmmod, 1: insmod/
u8 reserved[1];
struct HostConnectEvent event;
@@ -351,6 +351,12 @@
CHECK_MAX
}check_type;
+enum{
+ WAKEUP_IO,
+ WAKEUP_NETWORK,
+ WAKEUP_CONNECT,
+ WAKEUP_KEEPALIVE
+};
endif / ATBM_TOOL_H /
Index: tools/tools.c
===================================================================
--- tools/tools.c (revision 1850)
+++ tools/tools.c (revision 1851)
@@ -2290,6 +2290,26 @@
printf("Scan Completed...\n");
printf("CTRL-EVENT-SCAN-RESULTS\n");
}
+ else if (status.type == 3)
+ {
+ switch (status.driver_mode){
+ case WAKEUP_IO:
+ printf("IO wakeup\n");
+ break;
+ case WAKEUP_NETWORK:
+ printf("NETWORK wakeup\n");
+ break;
+ case WAKEUP_CONNECT:
+ printf("AP RECONNECT wakeup\n");
+ break;
+ case WAKEUP_KEEPALIVE:
+ printf("KEEPALIVE wakeup\n");
+ break;
+ default:
+ printf("UNKNOWN wakeup\n");
+ break;
+ }
+ }
}
sem_post(&sem_status);
- 分享
- 举报
-
浏览量:5077次2021-05-31 17:00:35
-
浏览量:5595次2021-05-31 17:08:23
-
浏览量:2423次2020-04-16 13:20:10
-
浏览量:4038次2021-05-07 17:10:16
-
浏览量:9819次2020-04-16 11:05:11
-
浏览量:7405次2020-07-28 19:05:15
-
浏览量:4667次2020-04-23 20:06:57
-
浏览量:3966次2020-10-12 17:33:14
-
浏览量:6106次2021-04-07 18:53:43
-
浏览量:6607次2021-05-07 17:21:24
-
浏览量:13207次2020-11-14 10:44:48
-
浏览量:2941次2019-11-08 13:56:39
-
浏览量:4138次2020-10-29 19:20:24
-
浏览量:5627次2020-10-29 19:40:14
-
浏览量:2734次2020-07-28 10:58:45
-
浏览量:2314次2020-07-28 11:05:08
-
浏览量:2532次2020-07-28 10:56:05
-
浏览量:3388次2020-07-28 19:20:20
-
浏览量:378883次2020-02-28 18:51:06
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
冰糖炖雪梨
感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明