diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 3f671a8e6a..aaf7b141be 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -2913,6 +2913,59 @@ typedef struct { } tSirPrefNetworkFoundInd, *tpSirPrefNetworkFoundInd; #endif /* FEATURE_WLAN_SCAN_PNO */ +/* + * ALLOWED_ACTION_FRAMES_BITMAP + * + * Bitmask is based on the below. The frames with 0's + * set to their corresponding bit can be dropped in FW. + * + * -----------------------------+-----+-------+ + * Type | Bit | Allow | + * -----------------------------+-----+-------+ + * SIR_MAC_ACTION_SPECTRUM_MGMT 0 1 + * SIR_MAC_ACTION_QOS_MGMT 1 1 + * SIR_MAC_ACTION_DLP 2 0 + * SIR_MAC_ACTION_BLKACK 3 0 + * SIR_MAC_ACTION_PUBLIC_USAGE 4 1 + * SIR_MAC_ACTION_RRM 5 1 + * SIR_MAC_ACTION_FAST_BSS_TRNST 6 0 + * SIR_MAC_ACTION_HT 7 0 + * SIR_MAC_ACTION_SA_QUERY 8 1 + * SIR_MAC_ACTION_PROT_DUAL_PUB 9 1 + * SIR_MAC_ACTION_WNM 10 1 + * SIR_MAC_ACTION_UNPROT_WNM 11 0 + * SIR_MAC_ACTION_TDLS 12 0 + * SIR_MAC_ACITON_MESH 13 0 + * SIR_MAC_ACTION_MHF 14 0 + * SIR_MAC_SELF_PROTECTED 15 0 + * SIR_MAC_ACTION_WME 17 1 + * SIR_MAC_ACTION_FST 18 1 + * SIR_MAC_ACTION_VHT 21 1 + * ----------------------------+------+-------+ + */ +#define ALLOWED_ACTION_FRAMES_BITMAP0 \ + ((1 << SIR_MAC_ACTION_SPECTRUM_MGMT) | \ + (1 << SIR_MAC_ACTION_QOS_MGMT) | \ + (1 << SIR_MAC_ACTION_PUBLIC_USAGE) | \ + (1 << SIR_MAC_ACTION_RRM) | \ + (1 << SIR_MAC_ACTION_SA_QUERY) | \ + (1 << SIR_MAC_ACTION_PROT_DUAL_PUB) | \ + (1 << SIR_MAC_ACTION_WNM) | \ + (1 << SIR_MAC_ACTION_WME) | \ + (1 << SIR_MAC_ACTION_FST) | \ + (1 << SIR_MAC_ACTION_VHT)) + +#define ALLOWED_ACTION_FRAMES_BITMAP1 0x0 +#define ALLOWED_ACTION_FRAMES_BITMAP2 0x0 +#define ALLOWED_ACTION_FRAMES_BITMAP3 0x0 +#define ALLOWED_ACTION_FRAMES_BITMAP4 0x0 +#define ALLOWED_ACTION_FRAMES_BITMAP5 0x0 +#define ALLOWED_ACTION_FRAMES_BITMAP6 0x0 +#define ALLOWED_ACTION_FRAMES_BITMAP7 0x0 + +#define ALLOWED_ACTION_FRAME_MAP_WORDS (SIR_MAC_ACTION_MAX / 32) + + #ifdef WLAN_FEATURE_ROAM_OFFLOAD typedef struct { uint8_t acvo_uapsd:1; diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index 2d5bc2b8d5..75b8303525 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -144,6 +144,7 @@ #define SIR_MAC_ACTION_WME 17 #define SIR_MAC_ACTION_FST 18 #define SIR_MAC_ACTION_VHT 21 +#define SIR_MAC_ACTION_MAX 256 #define SIR_MAC_ACTION_TX 1 #define SIR_MAC_ACTION_RX 2 diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 7f03e70983..321096435e 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -175,6 +175,9 @@ void wma_enable_disable_wakeup_event(WMA_HANDLE handle, void wma_register_wow_wakeup_events(WMA_HANDLE handle, uint8_t vdev_id, uint8_t vdev_type, uint8_t sub_type); void wma_register_wow_default_patterns(WMA_HANDLE handle, uint8_t vdev_id); +QDF_STATUS wma_register_action_frame_patterns(WMA_HANDLE handle, + uint8_t vdev_id); + int8_t wma_get_hw_mode_idx_from_dbs_hw_list(enum hw_mode_ss_config mac0_ss, enum hw_mode_bandwidth mac0_bw, enum hw_mode_ss_config mac1_ss, diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 4a0f2bbb99..d8ea0ecf52 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1810,6 +1810,9 @@ void *wma_vdev_attach(tp_wma_handle wma_handle, wma_register_wow_wakeup_events(wma_handle, self_sta_req->session_id, self_sta_req->type, self_sta_req->sub_type); + + wma_register_action_frame_patterns(wma_handle, + self_sta_req->session_id); wma_register_wow_default_patterns(wma_handle, self_sta_req->session_id); end: diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index ada3fd3c89..5cb3c2ae88 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -3683,6 +3683,53 @@ static QDF_STATUS wma_configure_ssdp(tp_wma_handle wma, uint8_t vdev_id) return wma_configure_wow_ssdp(wma, vdev_id); } +/** + * wma_register_action_frame_patterns() - register action frame map to fw + * @handle: Pointer to wma handle + * @vdev_id: VDEV ID + * + * This is called to push action frames wow patterns from local + * cache to firmware. + * + * Return: QDF_STATUS + */ +QDF_STATUS wma_register_action_frame_patterns(WMA_HANDLE handle, + uint8_t vdev_id) +{ + tp_wma_handle wma = handle; + struct action_wakeup_set_param cmd = {0}; + int32_t err; + int i = 0; + + cmd.vdev_id = vdev_id; + cmd.operation = WOW_ACTION_WAKEUP_OPERATION_SET; + + cmd.action_category_map[i++] = ALLOWED_ACTION_FRAMES_BITMAP0; + cmd.action_category_map[i++] = ALLOWED_ACTION_FRAMES_BITMAP1; + cmd.action_category_map[i++] = ALLOWED_ACTION_FRAMES_BITMAP2; + cmd.action_category_map[i++] = ALLOWED_ACTION_FRAMES_BITMAP3; + cmd.action_category_map[i++] = ALLOWED_ACTION_FRAMES_BITMAP4; + cmd.action_category_map[i++] = ALLOWED_ACTION_FRAMES_BITMAP5; + cmd.action_category_map[i++] = ALLOWED_ACTION_FRAMES_BITMAP6; + cmd.action_category_map[i++] = ALLOWED_ACTION_FRAMES_BITMAP7; + + for (i = 0; i < WMI_SUPPORTED_ACTION_CATEGORY_ELE_LIST; i++) { + if (i < ALLOWED_ACTION_FRAME_MAP_WORDS) + WMA_LOGD("%s: %d action Wakeup pattern 0x%x in fw", + __func__, i, cmd.action_category_map[i]); + else + cmd.action_category_map[i] = 0; + } + + err = wmi_unified_action_frame_patterns_cmd(wma->wmi_handle, &cmd); + if (err) { + WMA_LOGE("Failed to config wow action frame map, ret %d", err); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + /** * wma_wow_sta() - set WOW patterns in sta mode * @wma: wma handle