diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-02-02 21:25:31 -0700 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2017-02-02 21:25:31 -0700 |
| commit | cd7defe070af55cba2ceefe7d6f44bc787d357f8 (patch) | |
| tree | bdfdbf2843af19608c07d79da729e55b149a579f | |
| parent | 54518a369bf4a288fb6126e069581940164c428d (diff) | |
| parent | 88060596c1676411c27d44d4fda22875dfe9b3ea (diff) | |
Promotion of wlan-cmn.driver.lnx.1.0-00124.
CRs Change ID Subject
--------------------------------------------------------------------------------------------------------------
1114161 I4d780fa8780b42a668006e13a49eb1299304e633 qcacmn: modify HIF NAPI blacklist mechanism
1113550 Iccb68e1816c897a63414fff849f3d505ef6361e5 qcacmn: Enable HW broadcast filter
688141 I5ca0e27fb2e9fd8b5128a3088aea4e019f4078a2 Release 5.1.0.27G
1114150 I37413ab7ccf6bd5171815af0038401925aa7831b qcacmn: Add msdu index for tso stats in msdu info
1116509 I4dcba604e803faa0e14fac6403610391895e382e qcacmn: Change semantics of Runtime Lock APIs
688141 I559e55fa311c542afb6ead0947f0d3cfe31eff7b Release 5.1.0.27B
688141 I9c711618b0c63de5dac25bada88e4113feaa8b49 Release 5.1.0.27F
688141 I17a418b687199e85e20605f0d89fed56049e51b4 Release 5.1.0.27C
1095770 I41e36d11bc3e71928866a27afc2fbf046b59f0f5 qcacmn: Add boundary check for number of APs
1114602 I299d39131e7ab0ebae6bd10f41bc4549debda048 qcacmn: Send Grat-ARP Keep Alive request to FW
688141 I2297b21a65290057b2316ce4abdd59cc53b82d86 Release 5.1.0.27E
865207 Ifacb8c220e9f3a3c44136e9c937ea4e6b387ea5f qcacmn: CL 2779193 - update fw common interface files
688141 I86174be98dad43dfdb08d3f95f2bd8cbdfe7bfe6 Release 5.1.0.27H
1105495 I59cf4181f60f5b4cd87a32fbcf29160d87ca59c8 qcacmn: Add support to include selective scan IEs only
688141 Ie661266207c90b6e3a7899860bb72e722251e6e8 Release 5.1.0.27D
688141 I1b83c43f4f504b32761d03789d7936f9234fa391 Release 5.1.0.27A
865207 I49e59125320ce5f079b8dc6c86d4b43775829238 qcacmn: CL 2776384 - update fw common interface files
1111400 I8c0778b3fa73d148422aa103b0fc0950433fec95 qcacmn: Add APIs to configure Active BPF Mode
688141 I7232845ec4b78fcececda0932f0b2d8e7023cc7a Release 5.1.0.27I
Change-Id: I3bb0e1db2641d82f1a7a6a5f46723475fef704ea
CRs-Fixed: 1116509, 1114161, 1113550, 1114602, 1095770, 1105495, 1114150, 1111400, 688141, 865207
| -rw-r--r-- | VERSION.txt | 2 | ||||
| -rw-r--r-- | hif/inc/hif.h | 10 | ||||
| -rw-r--r-- | hif/inc/hif_napi.h | 4 | ||||
| -rw-r--r-- | hif/src/hif_napi.c | 95 | ||||
| -rw-r--r-- | hif/src/pcie/if_pci.c | 25 | ||||
| -rw-r--r-- | hif/src/pcie/if_pci.h | 4 | ||||
| -rw-r--r-- | qdf/inc/qdf_lock.h | 16 | ||||
| -rw-r--r-- | qdf/inc/qdf_types.h | 2 | ||||
| -rw-r--r-- | qdf/linux/src/qdf_lock.c | 25 | ||||
| -rw-r--r-- | wmi/inc/wmi_unified_api.h | 28 | ||||
| -rw-r--r-- | wmi/inc/wmi_unified_param.h | 48 | ||||
| -rw-r--r-- | wmi/inc/wmi_unified_priv.h | 8 | ||||
| -rw-r--r-- | wmi/inc/wmi_unified_tlv.h | 29 | ||||
| -rw-r--r-- | wmi/src/wmi_unified.c | 3 | ||||
| -rw-r--r-- | wmi/src/wmi_unified_api.c | 30 | ||||
| -rw-r--r-- | wmi/src/wmi_unified_tlv.c | 210 |
16 files changed, 468 insertions, 71 deletions
diff --git a/VERSION.txt b/VERSION.txt index c5b29b96eaea..d5025a5d312d 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.27 +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.27I Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22D diff --git a/hif/inc/hif.h b/hif/inc/hif.h index 775bb7f817de..4aa72e43c3fd 100644 --- a/hif/inc/hif.h +++ b/hif/inc/hif.h @@ -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. * @@ -573,7 +573,7 @@ struct hif_pm_runtime_lock; int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx); void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx); int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx); -struct hif_pm_runtime_lock *hif_runtime_lock_init(const char *name); +int hif_runtime_lock_init(qdf_runtime_lock_t *lock, const char *name); void hif_runtime_lock_deinit(struct hif_opaque_softc *hif_ctx, struct hif_pm_runtime_lock *lock); int hif_pm_runtime_prevent_suspend(struct hif_opaque_softc *ol_sc, @@ -594,9 +594,9 @@ static inline int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx) { return 0; } static inline int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx) { return 0; } -static inline struct hif_pm_runtime_lock *hif_runtime_lock_init( - const char *name) -{ return NULL; } +static inline int hif_runtime_lock_init(qdf_runtime_lock_t *lock, + const char *name) +{ return 0; } static inline void hif_runtime_lock_deinit(struct hif_opaque_softc *hif_ctx, struct hif_pm_runtime_lock *lock) {} diff --git a/hif/inc/hif_napi.h b/hif/inc/hif_napi.h index ebf9dff179d9..3ff8a3c2e02f 100644 --- a/hif/inc/hif_napi.h +++ b/hif/inc/hif_napi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -173,7 +173,7 @@ enum qca_blacklist_op { BLACKLIST_ON }; -int hif_napi_cpu_blacklist(uint8_t flags, enum qca_blacklist_op op); +int hif_napi_cpu_blacklist(struct qca_napi_data *napid, enum qca_blacklist_op op); /** * Local interface to HIF implemented functions of NAPI CPU affinity management. * Note: diff --git a/hif/src/hif_napi.c b/hif/src/hif_napi.c index 2209b2bd9a7b..46b87e5e89d4 100644 --- a/hif/src/hif_napi.c +++ b/hif/src/hif_napi.c @@ -39,6 +39,7 @@ #include <linux/cpu.h> #include <linux/topology.h> #include <linux/interrupt.h> +#include <linux/irq.h> #ifdef HELIUMPLUS #include <soc/qcom/irq-helper.h> #include <linux/sched/core_ctl.h> @@ -76,7 +77,8 @@ static int hif_napi_cpu_migrate(struct qca_napi_data *napid, int cpu, return 0; } -int hif_napi_cpu_blacklist(uint8_t flags, enum qca_blacklist_op op) +int hif_napi_cpu_blacklist(struct qca_napi_data *napid, + enum qca_blacklist_op op) { return 0; } @@ -597,22 +599,21 @@ int hif_napi_event(struct hif_opaque_softc *hif_ctx, enum qca_napi_event event, }; /* switch */ - qdf_spin_unlock_bh(&(napid->lock)); - - /* Call this API without spin_locks hif_napi_cpu_blacklist */ switch (blacklist_pending) { case BLACKLIST_ON_PENDING: /* assume the control of WLAN IRQs */ - hif_napi_cpu_blacklist(napid->flags, BLACKLIST_ON); + hif_napi_cpu_blacklist(napid, BLACKLIST_ON); break; case BLACKLIST_OFF_PENDING: /* yield the control of WLAN IRQs */ - hif_napi_cpu_blacklist(napid->flags, BLACKLIST_OFF); + hif_napi_cpu_blacklist(napid, BLACKLIST_OFF); break; default: /* nothing to do */ break; } /* switch blacklist_pending */ + qdf_spin_unlock_bh(&(napid->lock)); + if (prev_state != napid->state) { if (napid->state == ENABLE_NAPI_MASK) { rc = 1; @@ -727,15 +728,19 @@ bool hif_napi_correct_cpu(struct qca_napi_info *napi_info) if (napid->flags & QCA_NAPI_FEATURE_CPU_CORRECTION) { cpu = qdf_get_cpu(); - if (unlikely((hif_napi_cpu_blacklist(napid->flags, + if (unlikely((hif_napi_cpu_blacklist(napid, BLACKLIST_QUERY) > 0) && (cpu != napi_info->cpu))) { right_cpu = false; NAPI_DEBUG("interrupt on wrong CPU, correcting"); cpumask.bits[0] = (0x01 << napi_info->cpu); + + irq_modify_status(napi_info->irq, IRQ_NO_BALANCING, 0); rc = irq_set_affinity_hint(napi_info->irq, &cpumask); + irq_modify_status(napi_info->irq, 0, IRQ_NO_BALANCING); + if (rc) HIF_ERROR("error setting irq affinity hint: %d", rc); else @@ -903,9 +908,10 @@ void hif_napi_update_yield_stats(struct CE_state *ce_state, return; } else { napi_data = &(hif->napi_data); - if (unlikely(NULL == napi_data)) + if (unlikely(NULL == napi_data)) { QDF_ASSERT(NULL != napi_data); - return; + return; + } } ce_id = ce_state->id; @@ -1326,6 +1332,8 @@ static int hncm_migrate_to(struct qca_napi_data *napid, NAPI_DEBUG("-->%s(napi_cd=%d, didx=%d)", __func__, napi_ce, didx); cpumask.bits[0] = (1 << didx); + + irq_modify_status(napid->napis[napi_ce].irq, IRQ_NO_BALANCING, 0); rc = irq_set_affinity_hint(napid->napis[napi_ce].irq, &cpumask); /* unmark the napis bitmap in the cpu table */ @@ -1483,20 +1491,56 @@ hncm_return: return rc; } + +/** + * hif_napi_bl_irq() - calls irq_modify_status to enable/disable blacklisting + * @napid: pointer to qca_napi_data structure + * @bl_flag: blacklist flag to enable/disable blacklisting + * + * The function enables/disables blacklisting for all the copy engine + * interrupts on which NAPI is enabled. + * + * Return: None + */ +static inline void hif_napi_bl_irq(struct qca_napi_data *napid, bool bl_flag) +{ + int i; + for (i = 0; i < CE_COUNT_MAX; i++) { + /* check if NAPI is enabled on the CE */ + if (!(napid->ce_map & (0x01 << i))) + continue; + + if (bl_flag == true) + irq_modify_status(napid->napis[i].irq, + 0, IRQ_NO_BALANCING); + else + irq_modify_status(napid->napis[i].irq, + IRQ_NO_BALANCING, 0); + HIF_INFO("%s: bl_flag %d CE %d", __func__, bl_flag, i); + } +} + /** - * hif_napi_cpu_blacklist() - calls kernel API to enable/disable blacklisting - * @flags: NAPI feature flags + * hif_napi_cpu_blacklist() - en(dis)ables blacklisting for NAPI RX interrupts. + * @napid: pointer to qca_napi_data structure * @op: blacklist operation to perform * + * The function enables/disables/queries blacklisting for all CE RX + * interrupts with NAPI enabled. Besides blacklisting, it also enables/disables + * core_ctl_set_boost. + * Once blacklisting is enabled, the interrupts will not be managed by the IRQ + * balancer. + * * Return: -EINVAL, in case IRQ_BLACKLISTING and CORE_CTL_BOOST is not enabled * for BLACKLIST_QUERY op - blacklist refcount - * for BLACKLIST_ON op - return value from kernel blacklist API - * for BLACKLIST_OFF op - return value from kernel blacklist API + * for BLACKLIST_ON op - return value from core_ctl_set_boost API + * for BLACKLIST_OFF op - return value from core_ctl_set_boost API */ -int hif_napi_cpu_blacklist(uint8_t flags, enum qca_blacklist_op op) +int hif_napi_cpu_blacklist(struct qca_napi_data *napid, enum qca_blacklist_op op) { int rc = 0; static int ref_count; /* = 0 by the compiler */ + uint8_t flags = napid->flags; bool bl_en = flags & QCA_NAPI_FEATURE_IRQ_BLACKLISTING; bool ccb_en = flags & QCA_NAPI_FEATURE_CORE_CTL_BOOST; @@ -1513,22 +1557,23 @@ int hif_napi_cpu_blacklist(uint8_t flags, enum qca_blacklist_op op) break; case BLACKLIST_ON: ref_count++; - rc = irq_blacklist_on(); - NAPI_DEBUG("blacklist_on() returns %d", rc); - - rc = core_ctl_set_boost(true); - NAPI_DEBUG("boost_on() returns %d - refcnt=%d", rc, ref_count); + rc = 0; + if (ref_count == 1) { + rc = core_ctl_set_boost(true); + NAPI_DEBUG("boost_on() returns %d - refcnt=%d", + rc, ref_count); + hif_napi_bl_irq(napid, true); + } break; - case BLACKLIST_OFF: - while (ref_count > 0) { - rc = irq_blacklist_off(); - NAPI_DEBUG("blacklist_off() returns %d", rc); - + if (ref_count) + ref_count--; + rc = 0; + if (ref_count == 0) { rc = core_ctl_set_boost(false); NAPI_DEBUG("boost_off() returns %d - refcnt=%d", rc, ref_count); - ref_count--; + hif_napi_bl_irq(napid, false); } break; default: diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index 022b0c552fa0..21a6b83edad1 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -1180,8 +1180,7 @@ static void hif_pm_runtime_open(struct hif_pci_softc *sc) spin_lock_init(&sc->runtime_lock); qdf_atomic_init(&sc->pm_state); - sc->prevent_linkdown_lock = - hif_runtime_lock_init("linkdown suspend disabled"); + qdf_runtime_lock_init(&sc->prevent_linkdown_lock); qdf_atomic_set(&sc->pm_state, HIF_PM_RUNTIME_STATE_NONE); INIT_LIST_HEAD(&sc->prevent_suspend_list); } @@ -1262,8 +1261,8 @@ static void hif_pm_runtime_close(struct hif_pci_softc *sc) if (qdf_atomic_read(&sc->pm_state) == HIF_PM_RUNTIME_STATE_NONE) return; - else - hif_pm_runtime_stop(sc); + + hif_pm_runtime_stop(sc); hif_is_recovery_in_progress(scn) ? hif_pm_runtime_sanitize_on_ssr_exit(sc) : @@ -2539,11 +2538,9 @@ static void hif_runtime_prevent_linkdown(struct hif_softc *scn, bool flag) struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); if (flag) - hif_pm_runtime_prevent_suspend(hif_hdl, - sc->prevent_linkdown_lock); + qdf_runtime_pm_prevent_suspend(&sc->prevent_linkdown_lock); else - hif_pm_runtime_allow_suspend(hif_hdl, - sc->prevent_linkdown_lock); + qdf_runtime_pm_allow_suspend(&sc->prevent_linkdown_lock); } #else static void hif_runtime_prevent_linkdown(struct hif_softc *scn, bool flag) @@ -4064,21 +4061,23 @@ int hif_pm_runtime_prevent_suspend_timeout(struct hif_opaque_softc *ol_sc, * This API initalizes the Runtime PM context of the caller and * return the pointer. * - * Return: void * + * Return: None */ -struct hif_pm_runtime_lock *hif_runtime_lock_init(const char *name) +int hif_runtime_lock_init(qdf_runtime_lock_t *lock, const char *name) { struct hif_pm_runtime_lock *context; context = qdf_mem_malloc(sizeof(*context)); if (!context) { HIF_ERROR("%s: No memory for Runtime PM wakelock context\n", - __func__); - return NULL; + __func__); + return -ENOMEM; } context->name = name ? name : "Default"; - return context; + lock->lock = context; + + return 0; } /** diff --git a/hif/src/pcie/if_pci.h b/hif/src/pcie/if_pci.h index ab89f7d6d6ca..9c19b4a358dd 100644 --- a/hif/src/pcie/if_pci.h +++ b/hif/src/pcie/if_pci.h @@ -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. * @@ -137,7 +137,7 @@ struct hif_pci_softc { struct timer_list runtime_timer; struct list_head prevent_suspend_list; unsigned long runtime_timer_expires; - struct hif_pm_runtime_lock *prevent_linkdown_lock; + qdf_runtime_lock_t prevent_linkdown_lock; #ifdef WLAN_OPEN_SOURCE struct dentry *pm_dentry; #endif diff --git a/qdf/inc/qdf_lock.h b/qdf/inc/qdf_lock.h index b375ac781922..915f66ad6d2e 100644 --- a/qdf/inc/qdf_lock.h +++ b/qdf/inc/qdf_lock.h @@ -488,14 +488,20 @@ QDF_STATUS qdf_wake_lock_release(qdf_wake_lock_t *lock, uint32_t reason); QDF_STATUS qdf_wake_lock_destroy(qdf_wake_lock_t *lock); struct hif_pm_runtime_lock; -typedef struct hif_pm_runtime_lock *qdf_runtime_lock_t; +typedef struct qdf_runtime_lock { + struct hif_pm_runtime_lock *lock; +} qdf_runtime_lock_t; QDF_STATUS qdf_runtime_pm_get(void); QDF_STATUS qdf_runtime_pm_put(void); -QDF_STATUS qdf_runtime_pm_prevent_suspend(qdf_runtime_lock_t lock); -QDF_STATUS qdf_runtime_pm_allow_suspend(qdf_runtime_lock_t lock); -qdf_runtime_lock_t qdf_runtime_lock_init(const char *name); -void qdf_runtime_lock_deinit(qdf_runtime_lock_t lock); +QDF_STATUS qdf_runtime_pm_prevent_suspend(qdf_runtime_lock_t *lock); +QDF_STATUS qdf_runtime_pm_allow_suspend(qdf_runtime_lock_t *lock); + +QDF_STATUS __qdf_runtime_lock_init(qdf_runtime_lock_t *lock, const char *name); + +#define qdf_runtime_lock_init(lock) __qdf_runtime_lock_init(lock, #lock) + +void qdf_runtime_lock_deinit(qdf_runtime_lock_t *lock); QDF_STATUS qdf_spinlock_acquire(qdf_spinlock_t *lock); diff --git a/qdf/inc/qdf_types.h b/qdf/inc/qdf_types.h index 543cec5bfeaf..ad26a54acc7f 100644 --- a/qdf/inc/qdf_types.h +++ b/qdf/inc/qdf_types.h @@ -597,6 +597,7 @@ struct qdf_tso_num_seg_elem_t { * @tso_seg_list: list of TSO segments for this jumbo packet * @curr_seg: segment that is currently being processed * @tso_num_seg_list: num of tso seg for this jumbo packet + * @msdu_stats_idx: msdu index for tso stats * * This structure holds the TSO information extracted after parsing the TSO * jumbo network buffer. It contains a chain of the TSO segments belonging to @@ -608,6 +609,7 @@ struct qdf_tso_info_t { struct qdf_tso_seg_elem_t *tso_seg_list; struct qdf_tso_seg_elem_t *curr_seg; struct qdf_tso_num_seg_elem_t *tso_num_seg_list; + uint32_t msdu_stats_idx; }; /** diff --git a/qdf/linux/src/qdf_lock.c b/qdf/linux/src/qdf_lock.c index ffddb53438dc..b05f43782eab 100644 --- a/qdf/linux/src/qdf_lock.c +++ b/qdf/linux/src/qdf_lock.c @@ -470,7 +470,7 @@ EXPORT_SYMBOL(qdf_runtime_pm_put); * * return: QDF_STATUS_SUCCESS or failure code. */ -QDF_STATUS qdf_runtime_pm_prevent_suspend(qdf_runtime_lock_t lock) +QDF_STATUS qdf_runtime_pm_prevent_suspend(qdf_runtime_lock_t *lock) { void *ol_sc; int ret; @@ -484,7 +484,7 @@ QDF_STATUS qdf_runtime_pm_prevent_suspend(qdf_runtime_lock_t lock) return QDF_STATUS_E_INVAL; } - ret = hif_pm_runtime_prevent_suspend(ol_sc, lock); + ret = hif_pm_runtime_prevent_suspend(ol_sc, lock->lock); if (ret) return QDF_STATUS_E_FAILURE; @@ -493,14 +493,14 @@ QDF_STATUS qdf_runtime_pm_prevent_suspend(qdf_runtime_lock_t lock) EXPORT_SYMBOL(qdf_runtime_pm_prevent_suspend); /** - * qdf_runtime_pm_prevent_suspend() - prevent a runtime bus suspend + * qdf_runtime_pm_allow_suspend() - prevent a runtime bus suspend * @lock: an opaque context for tracking * * The lock can only be acquired once per lock context and is tracked. * * return: QDF_STATUS_SUCCESS or failure code. */ -QDF_STATUS qdf_runtime_pm_allow_suspend(qdf_runtime_lock_t lock) +QDF_STATUS qdf_runtime_pm_allow_suspend(qdf_runtime_lock_t *lock) { void *ol_sc; int ret; @@ -513,7 +513,7 @@ QDF_STATUS qdf_runtime_pm_allow_suspend(qdf_runtime_lock_t lock) return QDF_STATUS_E_INVAL; } - ret = hif_pm_runtime_allow_suspend(ol_sc, lock); + ret = hif_pm_runtime_allow_suspend(ol_sc, lock->lock); if (ret) return QDF_STATUS_E_FAILURE; return QDF_STATUS_SUCCESS; @@ -530,11 +530,16 @@ EXPORT_SYMBOL(qdf_runtime_pm_allow_suspend); * * Return: runtime_pm_lock_t */ -qdf_runtime_lock_t qdf_runtime_lock_init(const char *name) +QDF_STATUS __qdf_runtime_lock_init(qdf_runtime_lock_t *lock, const char *name) { - return hif_runtime_lock_init(name); + int ret = hif_runtime_lock_init(lock, name); + + if (ret) + return QDF_STATUS_E_NOMEM; + + return QDF_STATUS_SUCCESS; } -EXPORT_SYMBOL(qdf_runtime_lock_init); +EXPORT_SYMBOL(__qdf_runtime_lock_init); /** * qdf_runtime_lock_deinit() - deinitialize runtime pm lock @@ -544,10 +549,10 @@ EXPORT_SYMBOL(qdf_runtime_lock_init); * * Return: void */ -void qdf_runtime_lock_deinit(qdf_runtime_lock_t lock) +void qdf_runtime_lock_deinit(qdf_runtime_lock_t *lock) { void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); - hif_runtime_lock_deinit(hif_ctx, lock); + hif_runtime_lock_deinit(hif_ctx, lock->lock); } EXPORT_SYMBOL(qdf_runtime_lock_deinit); diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 32e38f46fc57..310132fc04d8 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -842,6 +842,20 @@ QDF_STATUS wmi_unified_enable_arp_ns_offload_cmd(void *wmi_hdl, bool arp_only, uint8_t vdev_id); +/** + * wmi_unified_configure_broadcast_filter_cmd() - Enable/Disable Broadcast + * filter + * when target goes to wow suspend/resume mode + * @wmi_hdl: wmi handle + * @vdev_id: device identifier + * @bc_filter: enable/disable Broadcast filter + * + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_configure_broadcast_filter_cmd(void *wmi_hdl, + uint8_t vdev_id, bool bc_filter); + QDF_STATUS wmi_unified_set_led_flashing_cmd(void *wmi_hdl, struct flashing_req_params *flashing); @@ -900,6 +914,20 @@ QDF_STATUS wmi_unified_get_buf_extscan_hotlist_cmd(void *wmi_hdl, struct ext_scan_setbssi_hotlist_params * photlist, int *buf_len); +/** + * wmi_unified_set_active_bpf_mode_cmd() - config active BPF mode in FW + * @wmi_hdl: the WMI handle + * @vdev_id: the Id of the vdev to apply the configuration to + * @ucast_mode: the active BPF mode to configure for unicast packets + * @mcast_bcast_mode: the active BPF mode to configure for multicast/broadcast + * packets + */ +QDF_STATUS +wmi_unified_set_active_bpf_mode_cmd(void *wmi_hdl, + uint8_t vdev_id, + FW_ACTIVE_BPF_MODE ucast_mode, + FW_ACTIVE_BPF_MODE mcast_bcast_mode); + QDF_STATUS wmi_unified_stats_request_send(void *wmi_hdl, uint8_t macaddr[IEEE80211_ADDR_LEN], struct stats_request_params *param); diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index ee7a5ba1582c..1a1dc484b1be 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -215,6 +215,8 @@ #define WMI_HOST_MAX_NUM_CHAINS 4 #define WMI_MAX_NUM_OF_RATE_THRESH 4 +#define PROBE_REQ_BITMAP_LEN 8 + #include "qdf_atomic.h" #ifdef BIG_ENDIAN_HOST @@ -953,6 +955,16 @@ struct ap_ps_params { uint32_t value; }; +/** + * struct vendor_oui - probe request ie vendor oui information + * @oui_type: type of the vendor oui (3 valid octets) + * @oui_subtype: subtype of the vendor oui (1 valid octet) + */ +struct vendor_oui { + uint32_t oui_type; + uint32_t oui_subtype; +}; + #define WMI_HOST_SCAN_CHAN_FREQ_SHIFT 0 #define WMI_HOST_SCAN_CHAN_FREQ_MASK 0xffff #define WMI_HOST_SCAN_CHAN_MODE_SHIFT 16 @@ -1003,6 +1015,11 @@ struct ap_ps_params { * @mac_addr_mask: MAC address mask used with randomization, bits that * are 0 in the mask should be randomized, bits that are 1 should * be taken from the @mac_addr + * @ie_whitelist: set to true for enabling ie whitelisting + * @probe_req_ie_bitmap: contains IEs to be included in probe req + * @num_vendor_oui: number of vendor OUIs + * @oui_field_len: size of total number of OUIs + * @voui: pointer to OUI buffer */ struct scan_start_params { uint32_t scan_id; @@ -1049,6 +1066,13 @@ struct scan_start_params { bool enable_scan_randomization; uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; uint8_t mac_addr_mask[QDF_MAC_ADDR_SIZE]; + + /* probe req ie whitelisting attrs */ + bool ie_whitelist; + uint32_t probe_req_ie_bitmap[PROBE_REQ_BITMAP_LEN]; + uint32_t num_vendor_oui; + uint32_t oui_field_len; + uint8_t *voui; }; /** @@ -1622,11 +1646,22 @@ struct rssi_monitor_param { * @vdev_id: session id * @enb_probe_req_sno_randomization: set to true for enabling * seq number randomization of probe req frames + * @ie_whitelist: set to true for enabling ie whitelisting + * @probe_req_ie_bitmap: contains IEs to be included in probe req + * @num_vendor_oui: number of vendor OUIs + * @oui_field_len: size of total number of OUIs + * @voui: pointer to OUI buffer */ struct scan_mac_oui { uint8_t oui[WMI_WIFI_SCANNING_MAC_OUI_LENGTH]; uint32_t vdev_id; bool enb_probe_req_sno_randomization; + /* probe req ie whitelisting attrs */ + bool ie_whitelist; + uint32_t probe_req_ie_bitmap[PROBE_REQ_BITMAP_LEN]; + uint32_t num_vendor_oui; + uint32_t oui_field_len; + uint8_t *voui; }; #define WMI_PASSPOINT_REALM_LEN 256 @@ -2048,6 +2083,11 @@ struct pno_nw_type { * @mac_addr_mask: MAC address mask used with randomization, bits that * are 0 in the mask should be randomized, bits that are 1 should * be taken from the @mac_addr + * @ie_whitelist: set to true for enabling ie whitelisting + * @probe_req_ie_bitmap: contains IEs to be included in probe req + * @num_vendor_oui: number of vendor OUIs + * @oui_field_len: size of total number of OUIs + * @voui: pointer to OUI buffer */ struct pno_scan_req_params { uint8_t enable; @@ -2078,8 +2118,14 @@ struct pno_scan_req_params { bool enable_pno_scan_randomization; uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; uint8_t mac_addr_mask[QDF_MAC_ADDR_SIZE]; -}; + /* probe req ie whitelisting attrs */ + bool ie_whitelist; + uint32_t probe_req_ie_bitmap[PROBE_REQ_BITMAP_LEN]; + uint32_t num_vendor_oui; + uint32_t oui_field_len; + uint8_t *voui; +}; #define WMI_WLAN_EXTSCAN_MAX_CHANNELS 36 #define WMI_WLAN_EXTSCAN_MAX_BUCKETS 16 diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 59a1511f41d8..dacb5eb2f1ad 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -179,6 +179,9 @@ QDF_STATUS (*send_vdev_delete_cmd)(wmi_unified_t wmi_handle, QDF_STATUS (*send_vdev_stop_cmd)(wmi_unified_t wmi, uint8_t vdev_id); +QDF_STATUS (*send_enable_broadcast_filter_cmd)(wmi_unified_t wmi_handle, + uint8_t vdev_id, bool enable); + QDF_STATUS (*send_vdev_down_cmd)(wmi_unified_t wmi, uint8_t vdev_id); @@ -717,6 +720,11 @@ QDF_STATUS (*send_get_buf_extscan_hotlist_cmd)(wmi_unified_t wmi_handle, struct ext_scan_setbssi_hotlist_params * photlist, int *buf_len); +QDF_STATUS (*send_set_active_bpf_mode_cmd)(wmi_unified_t wmi_handle, + uint8_t vdev_id, + FW_ACTIVE_BPF_MODE ucast_mode, + FW_ACTIVE_BPF_MODE mcast_bcast_mode); + QDF_STATUS (*send_pdev_get_tpc_config_cmd)(wmi_unified_t wmi_handle, uint32_t param); diff --git a/wmi/inc/wmi_unified_tlv.h b/wmi/inc/wmi_unified_tlv.h index f18cf8c61779..08f888a2ac44 100644 --- a/wmi/inc/wmi_unified_tlv.h +++ b/wmi/inc/wmi_unified_tlv.h @@ -529,6 +529,19 @@ QDF_STATUS send_enable_arp_ns_offload_cmd_tlv(wmi_unified_t wmi_handle, bool arp_only, uint8_t vdev_id); +/** + * send_enable_broadcast_filter_cmd_tlv() - Enable/Disable Broadcast filter + * when target goes to wow suspend/resume mode + * @wma: wmi handle + * @vdev_id: device identifier + * @enable: enable/disable broadcast filter + * + * + * Return: QDF Status + */ +QDF_STATUS send_enable_broadcast_filter_cmd_tlv(wmi_unified_t wmi_handle, + uint8_t vdev_id, bool enable); + QDF_STATUS send_set_led_flashing_cmd_tlv(wmi_unified_t wmi_handle, struct flashing_req_params *flashing); @@ -585,5 +598,21 @@ QDF_STATUS send_per_roam_config_cmd_tlv(wmi_unified_t wmi_handle, QDF_STATUS send_get_buf_extscan_hotlist_cmd_tlv(wmi_unified_t wmi_handle, struct ext_scan_setbssi_hotlist_params * photlist, int *buf_len); + +/** + * send_set_active_bpf_mode_cmd_tlv() - configure active BPF mode in FW + * @wmi_handle: the WMI handle + * @vdev_id: the Id of the vdev to apply the configuration to + * @ucast_mode: the active BPF mode to configure for unicast packets + * @mcast_bcast_mode: the active BPF mode to configure for multicast/broadcast + * packets + * + * Return: QDF status + */ +QDF_STATUS +send_set_active_bpf_mode_cmd_tlv(wmi_unified_t wmi_handle, + uint8_t vdev_id, + FW_ACTIVE_BPF_MODE ucast_mode, + FW_ACTIVE_BPF_MODE mcast_bcast_mode); #endif diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index f1e99b27ae01..8845ec14e1ff 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -1652,6 +1652,9 @@ static uint8_t *wmi_id_to_name(uint32_t wmi_command) CASE_RETURN_STRING(WMI_11D_SCAN_STOP_CMDID); CASE_RETURN_STRING(WMI_REQUEST_RADIO_CHAN_STATS_CMDID); CASE_RETURN_STRING(WMI_ROAM_PER_CONFIG_CMDID); + CASE_RETURN_STRING(WMI_VDEV_ADD_MAC_ADDR_TO_RX_FILTER_CMDID); + CASE_RETURN_STRING(WMI_BPF_SET_VDEV_ACTIVE_MODE_CMDID); + CASE_RETURN_STRING(WMI_HW_DATA_FILTER_CMDID); } return "Invalid WMI cmd"; diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 2d8c9767a610..44a42aa30310 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -3177,6 +3177,18 @@ QDF_STATUS wmi_unified_enable_arp_ns_offload_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } +QDF_STATUS wmi_unified_configure_broadcast_filter_cmd(void *wmi_hdl, + uint8_t vdev_id, bool bc_filter) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_enable_broadcast_filter_cmd) + return wmi_handle->ops->send_enable_broadcast_filter_cmd( + wmi_handle, vdev_id, bc_filter); + + return QDF_STATUS_E_FAILURE; +} + /** * wmi_unified_set_led_flashing_cmd() - set led flashing in fw * @wmi_hdl: wmi handle @@ -3481,6 +3493,24 @@ QDF_STATUS wmi_unified_get_buf_extscan_hotlist_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } +QDF_STATUS +wmi_unified_set_active_bpf_mode_cmd(void *wmi_hdl, + uint8_t vdev_id, + FW_ACTIVE_BPF_MODE ucast_mode, + FW_ACTIVE_BPF_MODE mcast_bcast_mode) +{ + wmi_unified_t wmi = (wmi_unified_t)wmi_hdl; + + if (!wmi->ops->send_set_active_bpf_mode_cmd) { + WMI_LOGI("send_set_active_bpf_mode_cmd op is NULL"); + return QDF_STATUS_E_FAILURE; + } + + return wmi->ops->send_set_active_bpf_mode_cmd(wmi, vdev_id, + ucast_mode, + mcast_bcast_mode); +} + /** * wmi_unified_pdev_get_tpc_config_cmd_send() - WMI get tpc config function * @param wmi_handle : handle to WMI. diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index d8c6f699f335..4d5b40805459 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -1421,6 +1421,36 @@ QDF_STATUS send_peer_assoc_cmd_tlv(wmi_unified_t wmi_handle, return ret; } +/* + * wmi_fill_vendor_oui() - fill vendor OUIs + * @buf_ptr: pointer to wmi tlv buffer + * @num_vendor_oui: number of vendor OUIs to be filled + * @param_voui: pointer to OUI buffer + * + * This function populates the wmi tlv buffer when vendor specific OUIs are + * present. + * + * Return: None + */ +static void wmi_fill_vendor_oui(uint8_t *buf_ptr, uint32_t num_vendor_oui, + void *param_voui) +{ + wmi_vendor_oui *voui = NULL; + struct vendor_oui *pvoui = NULL; + uint32_t i; + + voui = (wmi_vendor_oui *)buf_ptr; + pvoui = (struct vendor_oui *)param_voui; + + for (i = 0; i < num_vendor_oui; i++) { + WMITLV_SET_HDR(&voui[i].tlv_header, + WMITLV_TAG_STRUC_wmi_vendor_oui, + WMITLV_GET_STRUCT_TLVLEN(wmi_vendor_oui)); + voui[i].oui_type_subtype = pvoui[i].oui_type | + (pvoui[i].oui_subtype << 24); + } +} + /** * send_scan_start_cmd_tlv() - WMI scan start function * @param wmi_handle : handle to WMI. @@ -1461,6 +1491,10 @@ QDF_STATUS send_scan_start_cmd_tlv(wmi_unified_t wmi_handle, if (params->ie_len) len += roundup(params->ie_len, sizeof(uint32_t)); + len += WMI_TLV_HDR_SIZE; /* Length of TLV for array of wmi_vendor_oui */ + if (params->num_vendor_oui) + len += params->num_vendor_oui * sizeof(wmi_vendor_oui); + /* Allocate the memory */ wmi_buf = wmi_buf_alloc(wmi_handle, len); if (!wmi_buf) { @@ -1506,6 +1540,15 @@ QDF_STATUS send_scan_start_cmd_tlv(wmi_unified_t wmi_handle, &cmd->mac_mask); } + if (params->ie_whitelist) { + cmd->scan_ctrl_flags |= + WMI_SCAN_ENABLE_IE_WHTELIST_IN_PROBE_REQ; + for (i = 0; i < PROBE_REQ_BITMAP_LEN; i++) + cmd->ie_bitmap[i] = params->probe_req_ie_bitmap[i]; + + cmd->num_vendor_oui = params->num_vendor_oui; + } + WMI_LOGI("scan_ctrl_flags = %x", cmd->scan_ctrl_flags); buf_ptr += sizeof(*cmd); @@ -1550,6 +1593,17 @@ QDF_STATUS send_scan_start_cmd_tlv(wmi_unified_t wmi_handle, } buf_ptr += WMI_TLV_HDR_SIZE + params->ie_len_with_pad; + /* probe req ie whitelisting */ + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, + params->num_vendor_oui * sizeof(wmi_vendor_oui)); + + buf_ptr += WMI_TLV_HDR_SIZE; + + if (cmd->num_vendor_oui != 0) { + wmi_fill_vendor_oui(buf_ptr, cmd->num_vendor_oui, params->voui); + buf_ptr += cmd->num_vendor_oui * sizeof(wmi_vendor_oui); + } + ret = wmi_unified_cmd_send(wmi_handle, wmi_buf, len, WMI_START_SCAN_CMDID); if (ret) { @@ -3408,7 +3462,9 @@ QDF_STATUS send_set_sta_keep_alive_cmd_tlv(wmi_unified_t wmi_handle, WMITLV_TAG_STRUC_WMI_STA_KEEPALVE_ARP_RESPONSE, WMITLV_GET_STRUCT_TLVLEN(WMI_STA_KEEPALVE_ARP_RESPONSE)); - if (params->method == WMI_KEEP_ALIVE_UNSOLICIT_ARP_RSP) { + if ((params->method == WMI_KEEP_ALIVE_UNSOLICIT_ARP_RSP) || + (params->method == + WMI_STA_KEEPALIVE_METHOD_GRATUITOUS_ARP_REQUEST)) { if ((NULL == params->hostv4addr) || (NULL == params->destv4addr) || (NULL == params->destmac)) { @@ -3418,7 +3474,7 @@ QDF_STATUS send_set_sta_keep_alive_cmd_tlv(wmi_unified_t wmi_handle, wmi_buf_free(buf); return QDF_STATUS_E_FAILURE; } - cmd->method = WMI_STA_KEEPALIVE_METHOD_UNSOLICITED_ARP_RESPONSE; + cmd->method = params->method; qdf_mem_copy(&arp_rsp->sender_prot_addr, params->hostv4addr, WMI_IPV4_ADDR_LEN); qdf_mem_copy(&arp_rsp->target_prot_addr, params->destv4addr, @@ -4098,8 +4154,11 @@ QDF_STATUS send_scan_probe_setoui_cmd_tlv(wmi_unified_t wmi_handle, uint32_t len; uint8_t *buf_ptr; uint32_t *oui_buf; + uint32_t i = 0; + + len = sizeof(*cmd) + WMI_TLV_HDR_SIZE + + psetoui->num_vendor_oui * sizeof(wmi_vendor_oui); - len = sizeof(*cmd); wmi_buf = wmi_buf_alloc(wmi_handle, len); if (!wmi_buf) { WMI_LOGE("%s: wmi_buf_alloc failed", __func__); @@ -4124,8 +4183,27 @@ QDF_STATUS send_scan_probe_setoui_cmd_tlv(wmi_unified_t wmi_handle, if (psetoui->enb_probe_req_sno_randomization) cmd->flags |= WMI_SCAN_PROBE_OUI_RANDOM_SEQ_NO_IN_PROBE_REQ; + if (psetoui->ie_whitelist) { + cmd->flags |= + WMI_SCAN_PROBE_OUI_ENABLE_IE_WHITELIST_IN_PROBE_REQ; + cmd->num_vendor_oui = psetoui->num_vendor_oui; + for (i = 0; i < PROBE_REQ_BITMAP_LEN; i++) + cmd->ie_bitmap[i] = psetoui->probe_req_ie_bitmap[i]; + } + WMI_LOGI(FL("vdev_id = %d, flags = %x"), cmd->vdev_id, cmd->flags); + buf_ptr += sizeof(*cmd); + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, + psetoui->num_vendor_oui * sizeof(wmi_vendor_oui)); + buf_ptr += WMI_TLV_HDR_SIZE; + + if (cmd->num_vendor_oui != 0) { + wmi_fill_vendor_oui(buf_ptr, cmd->num_vendor_oui, + psetoui->voui); + buf_ptr += cmd->num_vendor_oui * sizeof(wmi_vendor_oui); + } + if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len, WMI_SCAN_PROB_REQ_OUI_CMDID)) { WMI_LOGE("%s: failed to send command", __func__); @@ -5981,15 +6059,19 @@ QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, * TLV place holder for array nlo_configured_parameters(nlo_list) * TLV place holder for array of uint32_t channel_list * TLV place holder for chnnl prediction cfg + * TLV place holder for array of wmi_vendor_oui */ len = sizeof(*cmd) + - WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE; + WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE + + WMI_TLV_HDR_SIZE; len += sizeof(uint32_t) * QDF_MIN(pno->aNetworks[0].ucChannelCount, WMI_NLO_MAX_CHAN); len += sizeof(nlo_configured_parameters) * QDF_MIN(pno->ucNetworksCount, WMI_NLO_MAX_SSIDS); len += sizeof(nlo_channel_prediction_cfg); + len += sizeof(enlo_candidate_score_params); + len += sizeof(wmi_vendor_oui) * pno->num_vendor_oui; buf = wmi_buf_alloc(wmi_handle, len); if (!buf) { @@ -6089,11 +6171,15 @@ QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, sizeof(nlo_channel_prediction_cfg)); buf_ptr += WMI_TLV_HDR_SIZE; wmi_set_pno_channel_prediction(buf_ptr, pno); - buf_ptr += WMI_TLV_HDR_SIZE; + buf_ptr += sizeof(nlo_channel_prediction_cfg); /** TODO: Discrete firmware doesn't have command/option to configure * App IE which comes from wpa_supplicant as of part PNO start request. */ + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_STRUC_enlo_candidate_score_param, + WMITLV_GET_STRUCT_TLVLEN(enlo_candidate_score_params)); + buf_ptr += sizeof(enlo_candidate_score_params); + /* mac randomization attributes */ if (pno->enable_pno_scan_randomization) { cmd->flags |= WMI_NLO_CONFIG_SPOOFED_MAC_IN_PROBE_REQ | @@ -6101,8 +6187,25 @@ QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, WMI_CHAR_ARRAY_TO_MAC_ADDR(pno->mac_addr, &cmd->mac_addr); WMI_CHAR_ARRAY_TO_MAC_ADDR(pno->mac_addr_mask, &cmd->mac_mask); } + if (pno->ie_whitelist) { + cmd->flags |= WMI_NLO_CONFIG_ENABLE_IE_WHITELIST_IN_PROBE_REQ; + cmd->num_vendor_oui = pno->num_vendor_oui; + for (i = 0; i < PROBE_REQ_BITMAP_LEN; i++) + cmd->ie_bitmap[i] = pno->probe_req_ie_bitmap[i]; + } WMI_LOGI("pno flags = %x", cmd->flags); + /* ie white list */ + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, pno->num_vendor_oui * + sizeof(wmi_vendor_oui)); + + buf_ptr += WMI_TLV_HDR_SIZE; + + if (cmd->num_vendor_oui != 0) { + wmi_fill_vendor_oui(buf_ptr, cmd->num_vendor_oui, pno->voui); + buf_ptr += cmd->num_vendor_oui * sizeof(wmi_vendor_oui); + } + ret = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID); if (ret) { @@ -10357,6 +10460,49 @@ QDF_STATUS send_enable_arp_ns_offload_cmd_tlv(wmi_unified_t wmi_handle, return QDF_STATUS_SUCCESS; } +QDF_STATUS send_enable_broadcast_filter_cmd_tlv(wmi_unified_t wmi_handle, + uint8_t vdev_id, bool enable) +{ + int32_t res; + wmi_hw_data_filter_cmd_fixed_param *cmd; + A_UINT8 *buf_ptr; + wmi_buf_t buf; + int32_t len; + + /* + * TLV place holder size for array of ARP tuples + */ + len = sizeof(wmi_hw_data_filter_cmd_fixed_param); + + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMI_LOGE("%s: wmi_buf_alloc failed", __func__); + return QDF_STATUS_E_NOMEM; + } + + buf_ptr = (A_UINT8 *) wmi_buf_data(buf); + cmd = (wmi_hw_data_filter_cmd_fixed_param *) buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_hw_data_filter_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_hw_data_filter_cmd_fixed_param)); + cmd->vdev_id = vdev_id; + cmd->enable = enable; + cmd->hw_filter_bitmap = WMI_HW_DATA_FILTER_DROP_NON_ARP_BC; + + WMI_LOGD("HW Broadcast Filter vdev_id: %d", cmd->vdev_id); + + res = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_HW_DATA_FILTER_CMDID); + if (res) { + WMI_LOGE("Failed to enable ARP NDP/NSffload"); + wmi_buf_free(buf); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + /** * send_set_ssid_hotlist_cmd_tlv() - Handle an SSID hotlist set request * @wmi_handle: wmi handle @@ -11080,8 +11226,8 @@ QDF_STATUS send_get_buf_extscan_hotlist_cmd_tlv(wmi_unified_t wmi_handle, /* setbssid hotlist expects the bssid list * to be non zero value */ - if (!numap) { - WMI_LOGE("%s: Invalid number of bssid's", __func__); + if ((numap <= 0) || (numap > WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS)) { + WMI_LOGE("Invalid number of APs: %d", numap); return QDF_STATUS_E_INVAL; } @@ -11166,6 +11312,53 @@ QDF_STATUS send_get_buf_extscan_hotlist_cmd_tlv(wmi_unified_t wmi_handle, return QDF_STATUS_SUCCESS; } +QDF_STATUS send_set_active_bpf_mode_cmd_tlv(wmi_unified_t wmi_handle, + uint8_t vdev_id, + FW_ACTIVE_BPF_MODE ucast_mode, + FW_ACTIVE_BPF_MODE mcast_bcast_mode) +{ + const WMITLV_TAG_ID tag_id = + WMITLV_TAG_STRUC_wmi_bpf_set_vdev_active_mode_cmd_fixed_param; + const uint32_t tlv_len = WMITLV_GET_STRUCT_TLVLEN( + wmi_bpf_set_vdev_active_mode_cmd_fixed_param); + QDF_STATUS status; + wmi_bpf_set_vdev_active_mode_cmd_fixed_param *cmd; + wmi_buf_t buf; + + WMI_LOGI("Sending WMI_BPF_SET_VDEV_ACTIVE_MODE_CMDID(%u, %d, %d)", + vdev_id, ucast_mode, mcast_bcast_mode); + + /* allocate command buffer */ + buf = wmi_buf_alloc(wmi_handle, sizeof(*cmd)); + if (!buf) { + WMI_LOGE("%s: wmi_buf_alloc failed", __func__); + return QDF_STATUS_E_NOMEM; + } + + /* set TLV header */ + cmd = (wmi_bpf_set_vdev_active_mode_cmd_fixed_param *)wmi_buf_data(buf); + WMITLV_SET_HDR(&cmd->tlv_header, tag_id, tlv_len); + + /* populate data */ + cmd->vdev_id = vdev_id; + cmd->uc_mode = ucast_mode; + cmd->mcbc_mode = mcast_bcast_mode; + + /* send to FW */ + status = wmi_unified_cmd_send(wmi_handle, buf, sizeof(*cmd), + WMI_BPF_SET_VDEV_ACTIVE_MODE_CMDID); + if (QDF_IS_STATUS_ERROR(status)) { + WMI_LOGE("Failed to send WMI_BPF_SET_VDEV_ACTIVE_MODE_CMDID:%d", + status); + wmi_buf_free(buf); + return status; + } + + WMI_LOGI("Sent WMI_BPF_SET_VDEV_ACTIVE_MODE_CMDID successfully"); + + return QDF_STATUS_SUCCESS; +} + /** * send_power_dbg_cmd_tlv() - send power debug commands * @wmi_handle: wmi handle @@ -12693,6 +12886,8 @@ struct wmi_ops tlv_ops = { send_pdev_set_dual_mac_config_cmd_tlv, .send_enable_arp_ns_offload_cmd = send_enable_arp_ns_offload_cmd_tlv, + .send_enable_broadcast_filter_cmd = + send_enable_broadcast_filter_cmd_tlv, .send_app_type1_params_in_fw_cmd = send_app_type1_params_in_fw_cmd_tlv, .send_set_ssid_hotlist_cmd = send_set_ssid_hotlist_cmd_tlv, @@ -12709,6 +12904,7 @@ struct wmi_ops tlv_ops = { send_roam_scan_offload_rssi_change_cmd_tlv, .send_get_buf_extscan_hotlist_cmd = send_get_buf_extscan_hotlist_cmd_tlv, + .send_set_active_bpf_mode_cmd = send_set_active_bpf_mode_cmd_tlv, .send_adapt_dwelltime_params_cmd = send_adapt_dwelltime_params_cmd_tlv, .init_cmd_send = init_cmd_send_tlv, |
