
Wake on WLAN(wowlan) is a feature which allows devices to be woken up from suspend state through wlan events. When user enables wowlan feature and then let the device enter suspend state, wowlan firmware will be loaded by the driver and periodically monitors wifi packets. Power consumption of wifi chip will be reduced in this state. If wowlan firmware detects that specific wlan event happens, it will issue wakeup signal to trigger resume process. Driver will load normal firmware and let wifi chip return to the original state. Currently supported wlan events include receiving magic packet, rekey packet and deauth packet, and disconnecting from AP. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
37 lines
1.1 KiB
C
37 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
|
/* Copyright(c) 2018-2019 Realtek Corporation
|
|
*/
|
|
|
|
#ifndef __RTW_UTIL_H__
|
|
#define __RTW_UTIL_H__
|
|
|
|
struct rtw_dev;
|
|
|
|
#define rtw_iterate_vifs(rtwdev, iterator, data) \
|
|
ieee80211_iterate_active_interfaces(rtwdev->hw, \
|
|
IEEE80211_IFACE_ITER_NORMAL, iterator, data)
|
|
#define rtw_iterate_vifs_atomic(rtwdev, iterator, data) \
|
|
ieee80211_iterate_active_interfaces_atomic(rtwdev->hw, \
|
|
IEEE80211_IFACE_ITER_NORMAL, iterator, data)
|
|
#define rtw_iterate_stas_atomic(rtwdev, iterator, data) \
|
|
ieee80211_iterate_stations_atomic(rtwdev->hw, iterator, data)
|
|
#define rtw_iterate_keys(rtwdev, vif, iterator, data) \
|
|
ieee80211_iter_keys(rtwdev->hw, vif, iterator, data)
|
|
|
|
static inline u8 *get_hdr_bssid(struct ieee80211_hdr *hdr)
|
|
{
|
|
__le16 fc = hdr->frame_control;
|
|
u8 *bssid;
|
|
|
|
if (ieee80211_has_tods(fc))
|
|
bssid = hdr->addr1;
|
|
else if (ieee80211_has_fromds(fc))
|
|
bssid = hdr->addr2;
|
|
else
|
|
bssid = hdr->addr3;
|
|
|
|
return bssid;
|
|
}
|
|
|
|
#endif
|