wmi.c (f57ad6a9885e8399897daee3249cabccf9c972f8) | wmi.c (79802b13a492d0fdeb922e98628e5ff1a8b74026) |
---|---|
1// SPDX-License-Identifier: BSD-3-Clause-Clear 2/* 3 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. 4 */ 5#include <linux/skbuff.h> 6#include <linux/ctype.h> 7#include <net/mac80211.h> 8#include <net/cfg80211.h> --- 6686 unchanged lines hidden (view full) --- 6695 if (ev->tx_status) 6696 ath11k_warn(ab, 6697 "Probe response transmission failed for vdev_id %u, status %u\n", 6698 ev->vdev_id, ev->tx_status); 6699 6700 kfree(tb); 6701} 6702 | 1// SPDX-License-Identifier: BSD-3-Clause-Clear 2/* 3 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. 4 */ 5#include <linux/skbuff.h> 6#include <linux/ctype.h> 7#include <net/mac80211.h> 8#include <net/cfg80211.h> --- 6686 unchanged lines hidden (view full) --- 6695 if (ev->tx_status) 6696 ath11k_warn(ab, 6697 "Probe response transmission failed for vdev_id %u, status %u\n", 6698 ev->vdev_id, ev->tx_status); 6699 6700 kfree(tb); 6701} 6702 |
6703static int ath11k_wmi_tlv_wow_wakeup_host_parse(struct ath11k_base *ab, 6704 u16 tag, u16 len, 6705 const void *ptr, void *data) 6706{ 6707 struct wmi_wow_ev_arg *ev = data; 6708 const char *wow_pg_fault; 6709 int wow_pg_len; 6710 6711 switch (tag) { 6712 case WMI_TAG_WOW_EVENT_INFO: 6713 memcpy(ev, ptr, sizeof(*ev)); 6714 ath11k_dbg(ab, ATH11K_DBG_WMI, "wow wakeup host reason %d %s\n", 6715 ev->wake_reason, wow_reason(ev->wake_reason)); 6716 break; 6717 6718 case WMI_TAG_ARRAY_BYTE: 6719 if (ev && ev->wake_reason == WOW_REASON_PAGE_FAULT) { 6720 wow_pg_fault = ptr; 6721 /* the first 4 bytes are length */ 6722 wow_pg_len = *(int *)wow_pg_fault; 6723 wow_pg_fault += sizeof(int); 6724 ath11k_dbg(ab, ATH11K_DBG_WMI, "wow data_len = %d\n", 6725 wow_pg_len); 6726 ath11k_dbg_dump(ab, ATH11K_DBG_WMI, 6727 "wow_event_info_type packet present", 6728 "wow_pg_fault ", 6729 wow_pg_fault, 6730 wow_pg_len); 6731 } 6732 break; 6733 default: 6734 break; 6735 } 6736 6737 return 0; 6738} 6739 6740static void ath11k_wmi_event_wow_wakeup_host(struct ath11k_base *ab, struct sk_buff *skb) 6741{ 6742 struct wmi_wow_ev_arg ev = { }; 6743 int ret; 6744 6745 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, 6746 ath11k_wmi_tlv_wow_wakeup_host_parse, 6747 &ev); 6748 if (ret) { 6749 ath11k_warn(ab, "failed to parse wmi wow tlv: %d\n", ret); 6750 return; 6751 } 6752 6753 complete(&ab->wow.wakeup_completed); 6754} 6755 |
|
6703static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb) 6704{ 6705 struct wmi_cmd_hdr *cmd_hdr; 6706 enum wmi_tlv_event_id id; 6707 6708 cmd_hdr = (struct wmi_cmd_hdr *)skb->data; 6709 id = FIELD_GET(WMI_CMD_HDR_CMD_ID, (cmd_hdr->cmd_id)); 6710 --- 91 unchanged lines hidden (view full) --- 6802 "ignoring unsupported event 0x%x\n", id); 6803 break; 6804 case WMI_PDEV_DFS_RADAR_DETECTION_EVENTID: 6805 ath11k_wmi_pdev_dfs_radar_detected_event(ab, skb); 6806 break; 6807 case WMI_VDEV_DELETE_RESP_EVENTID: 6808 ath11k_vdev_delete_resp_event(ab, skb); 6809 break; | 6756static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb) 6757{ 6758 struct wmi_cmd_hdr *cmd_hdr; 6759 enum wmi_tlv_event_id id; 6760 6761 cmd_hdr = (struct wmi_cmd_hdr *)skb->data; 6762 id = FIELD_GET(WMI_CMD_HDR_CMD_ID, (cmd_hdr->cmd_id)); 6763 --- 91 unchanged lines hidden (view full) --- 6855 "ignoring unsupported event 0x%x\n", id); 6856 break; 6857 case WMI_PDEV_DFS_RADAR_DETECTION_EVENTID: 6858 ath11k_wmi_pdev_dfs_radar_detected_event(ab, skb); 6859 break; 6860 case WMI_VDEV_DELETE_RESP_EVENTID: 6861 ath11k_vdev_delete_resp_event(ab, skb); 6862 break; |
6863 case WMI_WOW_WAKEUP_HOST_EVENTID: 6864 ath11k_wmi_event_wow_wakeup_host(ab, skb); 6865 break; |
|
6810 /* TODO: Add remaining events */ 6811 default: 6812 ath11k_dbg(ab, ATH11K_DBG_WMI, "Unknown eventid: 0x%x\n", id); 6813 break; 6814 } 6815 6816out: 6817 dev_kfree_skb(skb); --- 198 unchanged lines hidden (view full) --- 7016 7017 /* TODO: Deinit wmi resource specific to SOC as required */ 7018 7019 for (i = 0; i < ab->htc.wmi_ep_count; i++) 7020 ath11k_wmi_pdev_detach(ab, i); 7021 7022 ath11k_wmi_free_dbring_caps(ab); 7023} | 6866 /* TODO: Add remaining events */ 6867 default: 6868 ath11k_dbg(ab, ATH11K_DBG_WMI, "Unknown eventid: 0x%x\n", id); 6869 break; 6870 } 6871 6872out: 6873 dev_kfree_skb(skb); --- 198 unchanged lines hidden (view full) --- 7072 7073 /* TODO: Deinit wmi resource specific to SOC as required */ 7074 7075 for (i = 0; i < ab->htc.wmi_ep_count; i++) 7076 ath11k_wmi_pdev_detach(ab, i); 7077 7078 ath11k_wmi_free_dbring_caps(ab); 7079} |
7080 7081int ath11k_wmi_wow_host_wakeup_ind(struct ath11k *ar) 7082{ 7083 struct wmi_wow_host_wakeup_ind *cmd; 7084 struct sk_buff *skb; 7085 size_t len; 7086 7087 len = sizeof(*cmd); 7088 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); 7089 if (!skb) 7090 return -ENOMEM; 7091 7092 cmd = (struct wmi_wow_host_wakeup_ind *)skb->data; 7093 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, 7094 WMI_TAG_WOW_HOSTWAKEUP_FROM_SLEEP_CMD) | 7095 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); 7096 7097 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "wmi tlv wow host wakeup ind\n"); 7098 7099 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID); 7100} 7101 7102int ath11k_wmi_wow_enable(struct ath11k *ar) 7103{ 7104 struct wmi_wow_enable_cmd *cmd; 7105 struct sk_buff *skb; 7106 int len; 7107 7108 len = sizeof(*cmd); 7109 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); 7110 if (!skb) 7111 return -ENOMEM; 7112 7113 cmd = (struct wmi_wow_enable_cmd *)skb->data; 7114 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_WOW_ENABLE_CMD) | 7115 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); 7116 7117 cmd->enable = 1; 7118 cmd->pause_iface_config = WOW_IFACE_PAUSE_ENABLED; 7119 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "wmi tlv wow enable\n"); 7120 7121 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_ENABLE_CMDID); 7122} |
|