diff options
| author | Arun Khandavalli <akhandav@codeaurora.org> | 2016-08-17 10:20:29 +0530 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-08-19 18:33:04 -0700 |
| commit | 3dd06deb03577b30a7c93de466ced76a099ad71b (patch) | |
| tree | dc0b4f0d1b350791119d24a49e723c3851392e72 | |
| parent | c67110c9b2178dd76c75564647ec6a1f334f5179 (diff) | |
qcacld-3.0: BPF fixes for check connection state, set maxwow filter
qcacld-2.0 to qcacld-3.0 propagation
* Set BPF filter only if the station/p2p client is in the connected
state.
* Depending on the BPF service enabled in firmware dynamically
configure the number of wow filters.
- If bpf enabled maxwowfilter is 2.
- If bpf is disabled maxwowfilter is read from ini.
Change-Id: I14c722c9a1189f4ba4fbc2c8a554ae85b7a61fa8
CRs-Fixed: 967535
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg80211.c | 17 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 4 | ||||
| -rw-r--r-- | core/wma/inc/wma_types.h | 2 | ||||
| -rw-r--r-- | core/wma/src/wma_features.c | 2 | ||||
| -rw-r--r-- | core/wma/src/wma_main.c | 6 |
5 files changed, 27 insertions, 4 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 4506423f706e..dac9770fc942 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -6073,13 +6073,13 @@ static int hdd_get_bpf_offload(hdd_context_t *hdd_ctx) * hdd_set_reset_bpf_offload - Post set/reset bpf to SME * @hdd_ctx: Hdd context * @tb: Length of @data - * @session_id: Session identifier + * @adapter: pointer to adapter struct * * Return: 0 on success; errno on failure */ static int hdd_set_reset_bpf_offload(hdd_context_t *hdd_ctx, struct nlattr **tb, - uint8_t session_id) + hdd_adapter_t *adapter) { struct sir_bpf_set_offload *bpf_set_offload; QDF_STATUS status; @@ -6088,6 +6088,15 @@ static int hdd_set_reset_bpf_offload(hdd_context_t *hdd_ctx, ENTER(); + if (adapter->device_mode == QDF_STA_MODE || + adapter->device_mode == QDF_P2P_CLIENT_MODE) { + if (!hdd_conn_is_connected( + WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { + hdd_err("Not in Connected state!"); + return -ENOTSUPP; + } + } + bpf_set_offload = qdf_mem_malloc(sizeof(*bpf_set_offload)); if (bpf_set_offload == NULL) { hdd_err("qdf_mem_malloc failed for bpf_set_offload"); @@ -6126,7 +6135,7 @@ static int hdd_set_reset_bpf_offload(hdd_context_t *hdd_ctx, bpf_set_offload->current_length = prog_len; nla_memcpy(bpf_set_offload->program, tb[BPF_PROGRAM], prog_len); - bpf_set_offload->session_id = session_id; + bpf_set_offload->session_id = adapter->sessionId; /* Parse and fetch filter Id */ if (!tb[BPF_FILTER_ID]) { @@ -6221,7 +6230,7 @@ __wlan_hdd_cfg80211_bpf_offload(struct wiphy *wiphy, return hdd_get_bpf_offload(hdd_ctx); else return hdd_set_reset_bpf_offload(hdd_ctx, tb, - pAdapter->sessionId); + pAdapter); } /** diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 30e2c6b35d86..249d31db769e 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1496,6 +1496,10 @@ void hdd_update_tgt_cfg(void *context, void *param) cfg->bpf_enabled, hdd_ctx->config->bpf_packet_filter_enable); hdd_ctx->bpf_enabled = (cfg->bpf_enabled && hdd_ctx->config->bpf_packet_filter_enable); + + if (hdd_ctx->bpf_enabled) + hdd_ctx->config->maxWoWFilters = MAX_WOW_FILTERS; + /* Configure NAN datapath features */ hdd_nan_datapath_target_config(hdd_ctx, cfg); } diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index a49ad83552f3..c63042e328b4 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -475,6 +475,8 @@ /* Bit 6 will be used to control BD rate for Management frames */ #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 +#define MAX_WOW_FILTERS 2 + #define wma_tx_frame(hHal, pFrmBuf, frmLen, frmType, txDir, tid, pCompFunc, \ pData, txFlag, sessionid, channel_freq) \ (QDF_STATUS)( wma_tx_packet( \ diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 6ef1dc9967dd..bbc4431c8b7f 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -2357,6 +2357,8 @@ static const u8 *wma_wow_wake_reason_str(A_INT32 wake_reason) return "REASSOC_RES_RECV"; case WOW_REASON_ACTION_FRAME_RECV: return "ACTION_FRAME_RECV"; + case WOW_REASON_BPF_ALLOW: + return "WOW_REASON_BPF_ALLOW"; } return "unknown"; } diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 6e1695f4313f..d7036b981a37 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -3319,6 +3319,12 @@ static void wma_update_fw_config(tp_wma_handle wma_handle, wma_handle->max_frag_entry); wma_handle->max_frag_entry = tgt_cap->wlan_resource_config.max_frag_entries; + + /* Update no. of maxWoWFilters depending on BPF service */ + if (WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap, + WMI_SERVICE_BPF_OFFLOAD)) + tgt_cap->wlan_resource_config.num_wow_filters = + MAX_WOW_FILTERS; } /** |
