18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 28c2ecf20Sopenharmony_ci/* Copyright(c) 2018-2019 Realtek Corporation 38c2ecf20Sopenharmony_ci */ 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#ifndef __RTW_WOW_H__ 68c2ecf20Sopenharmony_ci#define __RTW_WOW_H__ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#define PNO_CHECK_BYTE 4 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_cienum rtw_wow_pattern_type { 118c2ecf20Sopenharmony_ci RTW_PATTERN_BROADCAST = 0, 128c2ecf20Sopenharmony_ci RTW_PATTERN_MULTICAST, 138c2ecf20Sopenharmony_ci RTW_PATTERN_UNICAST, 148c2ecf20Sopenharmony_ci RTW_PATTERN_VALID, 158c2ecf20Sopenharmony_ci RTW_PATTERN_INVALID, 168c2ecf20Sopenharmony_ci}; 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_cienum rtw_wake_reason { 198c2ecf20Sopenharmony_ci RTW_WOW_RSN_RX_PTK_REKEY = 0x1, 208c2ecf20Sopenharmony_ci RTW_WOW_RSN_RX_GTK_REKEY = 0x2, 218c2ecf20Sopenharmony_ci RTW_WOW_RSN_RX_DEAUTH = 0x8, 228c2ecf20Sopenharmony_ci RTW_WOW_RSN_DISCONNECT = 0x10, 238c2ecf20Sopenharmony_ci RTW_WOW_RSN_RX_MAGIC_PKT = 0x21, 248c2ecf20Sopenharmony_ci RTW_WOW_RSN_RX_PATTERN_MATCH = 0x23, 258c2ecf20Sopenharmony_ci RTW_WOW_RSN_RX_NLO = 0x55, 268c2ecf20Sopenharmony_ci}; 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_cistruct rtw_fw_media_status_iter_data { 298c2ecf20Sopenharmony_ci struct rtw_dev *rtwdev; 308c2ecf20Sopenharmony_ci u8 connect; 318c2ecf20Sopenharmony_ci}; 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_cistruct rtw_fw_key_type_iter_data { 348c2ecf20Sopenharmony_ci struct rtw_dev *rtwdev; 358c2ecf20Sopenharmony_ci u8 group_key_type; 368c2ecf20Sopenharmony_ci u8 pairwise_key_type; 378c2ecf20Sopenharmony_ci}; 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_cistatic inline bool rtw_wow_mgd_linked(struct rtw_dev *rtwdev) 408c2ecf20Sopenharmony_ci{ 418c2ecf20Sopenharmony_ci struct ieee80211_vif *wow_vif = rtwdev->wow.wow_vif; 428c2ecf20Sopenharmony_ci struct rtw_vif *rtwvif = (struct rtw_vif *)wow_vif->drv_priv; 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci return (rtwvif->net_type == RTW_NET_MGD_LINKED); 458c2ecf20Sopenharmony_ci} 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_cistatic inline bool rtw_wow_no_link(struct rtw_dev *rtwdev) 488c2ecf20Sopenharmony_ci{ 498c2ecf20Sopenharmony_ci struct ieee80211_vif *wow_vif = rtwdev->wow.wow_vif; 508c2ecf20Sopenharmony_ci struct rtw_vif *rtwvif = (struct rtw_vif *)wow_vif->drv_priv; 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci return (rtwvif->net_type == RTW_NET_NO_LINK); 538c2ecf20Sopenharmony_ci} 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ciint rtw_wow_suspend(struct rtw_dev *rtwdev, struct cfg80211_wowlan *wowlan); 568c2ecf20Sopenharmony_ciint rtw_wow_resume(struct rtw_dev *rtwdev); 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci#endif 59