1.增加宏控制806驱动是否获取唤醒源

2.同步优化recovery的acm连接
This commit is contained in:
张兆鹏 2025-04-30 16:39:58 +08:00
parent ce0a481a23
commit b26be295d7
6 changed files with 18 additions and 2 deletions

View File

@ -914,6 +914,7 @@ CONFIG_NET_CORE=y
# CONFIG_USB_NET_DRIVERS is not set # CONFIG_USB_NET_DRIVERS is not set
CONFIG_WLAN=y CONFIG_WLAN=y
CONFIG_XR806_WLAN=y CONFIG_XR806_WLAN=y
CONFIG_XR806_GET_WAKEUP_SRC=y
# CONFIG_USB_NET_RNDIS_WLAN is not set # CONFIG_USB_NET_RNDIS_WLAN is not set
# CONFIG_VIRT_WIFI is not set # CONFIG_VIRT_WIFI is not set

View File

@ -895,6 +895,7 @@ CONFIG_NET_CORE=y
# CONFIG_USB_NET_DRIVERS is not set # CONFIG_USB_NET_DRIVERS is not set
CONFIG_WLAN=y CONFIG_WLAN=y
CONFIG_XR806_WLAN=y CONFIG_XR806_WLAN=y
# CONFIG_XR806_GET_WAKEUP_SRC is not set
# CONFIG_USB_NET_RNDIS_WLAN is not set # CONFIG_USB_NET_RNDIS_WLAN is not set
# CONFIG_VIRT_WIFI is not set # CONFIG_VIRT_WIFI is not set

View File

@ -3,3 +3,10 @@ config XR806_WLAN
default n default n
---help--- ---help---
To compile this code as a module, choose M here. To compile this code as a module, choose M here.
config XR806_GET_WAKEUP_SRC
bool "XR806 get wake up source support"
depends on XR806_WLAN
default n
---help---
no need to choose this opt in recovery system.

View File

@ -268,7 +268,6 @@ end:
} }
static struct cmd_has_payload *has_cmd = NULL;
static int xradio_rx_process(struct xradio_priv *priv, struct sk_buff *skb) static int xradio_rx_process(struct xradio_priv *priv, struct sk_buff *skb)
{ {
@ -279,7 +278,10 @@ static int xradio_rx_process(struct xradio_priv *priv, struct sk_buff *skb)
u16 checksum = 0, c_checksum = 0; u16 checksum = 0, c_checksum = 0;
u8 seq = 0; u8 seq = 0;
static int dev_seq = -1; static int dev_seq = -1;
#if defined(CONFIG_XR806_GET_WAKEUP_SRC)
static unsigned char get_wksrc_flag = 0; static unsigned char get_wksrc_flag = 0;
static struct cmd_has_payload *has_cmd = NULL;
#endif
int i; int i;
if (!priv || !skb) if (!priv || !skb)
@ -330,6 +332,7 @@ static int xradio_rx_process(struct xradio_priv *priv, struct sk_buff *skb)
/* incom data */ /* incom data */
if (type_id == XR_REQ_CMD) { if (type_id == XR_REQ_CMD) {
xradio_rx_cmd_process(priv, skb, cur_len, seq); xradio_rx_cmd_process(priv, skb, cur_len, seq);
#if defined(CONFIG_XR806_GET_WAKEUP_SRC)
if (get_wksrc_flag == 0) if (get_wksrc_flag == 0)
{ {
has_cmd = (struct cmd_has_payload *)skb->data; has_cmd = (struct cmd_has_payload *)skb->data;
@ -347,6 +350,7 @@ static int xradio_rx_process(struct xradio_priv *priv, struct sk_buff *skb)
get_wksrc_flag = 1; get_wksrc_flag = 1;
} }
} }
#endif
} else { } else {
#if DATA_TEST #if DATA_TEST
xradio_data_test_rx_handle(skb->data, skb->len); xradio_data_test_rx_handle(skb->data, skb->len);
@ -434,6 +438,7 @@ static int xradio_txrx_thread(void *data)
int status = 0; int status = 0;
int rx_len = 0; int rx_len = 0;
int tx_status = 0; int tx_status = 0;
#if defined(CONFIG_XR806_GET_WAKEUP_SRC)
const struct cmd_has_payload wakeup_src_cmd = const struct cmd_has_payload wakeup_src_cmd =
{ {
.unkown1 = 0x003f, // TODO:全志通信协议 .unkown1 = 0x003f, // TODO:全志通信协议
@ -444,10 +449,12 @@ static int xradio_txrx_thread(void *data)
.has_app_proto.payload_size = 1, .has_app_proto.payload_size = 1,
.has_app_proto.wakeupsrc = 0, .has_app_proto.wakeupsrc = 0,
}; };
#endif
xradio_k_atomic_set(&priv->tranc_ready, 1); xradio_k_atomic_set(&priv->tranc_ready, 1);
#if defined(CONFIG_XR806_GET_WAKEUP_SRC)
xradio_tx_cmd_process(priv, (char *)&wakeup_src_cmd, sizeof(wakeup_src_cmd)); // 获取唤醒源 xradio_tx_cmd_process(priv, (char *)&wakeup_src_cmd, sizeof(wakeup_src_cmd)); // 获取唤醒源
#endif
while (1) { while (1) {
status = wait_event_interruptible(priv->txrx_wq, ({ status = wait_event_interruptible(priv->txrx_wq, ({
rx = xradio_hwio_rx_pending(); rx = xradio_hwio_rx_pending();