|
@@ -25,6 +25,7 @@
|
|
|
#include <wmi_unified_param.h>
|
|
|
#include <wlan_iot_sim_utils_api.h>
|
|
|
#include <wlan_lmac_if_api.h>
|
|
|
+#include <wlan_objmgr_peer_obj.h>
|
|
|
|
|
|
/*
|
|
|
* iot_sim_oper_to_str - function to return iot sim operation string
|
|
@@ -803,6 +804,11 @@ iot_sim_del_rule(struct iot_sim_rule_per_seq **s_e,
|
|
|
qdf_mem_free((*f_e)->dwork);
|
|
|
qdf_nbuf_free((*f_e)->nbuf_list[0]);
|
|
|
(*f_e)->nbuf_list[0] = NULL;
|
|
|
+ if ((*f_e)->peer) {
|
|
|
+ wlan_objmgr_peer_release_ref((*f_e)->peer,
|
|
|
+ WLAN_IOT_SIM_ID);
|
|
|
+ (*f_e)->peer = NULL;
|
|
|
+ }
|
|
|
qdf_nbuf_free((*f_e)->nbuf_list[1]);
|
|
|
(*f_e)->nbuf_list[1] = NULL;
|
|
|
(*f_e)->sec_buf = NULL;
|
|
@@ -921,6 +927,11 @@ static void iot_sim_delay_cb(void *ctxt)
|
|
|
{
|
|
|
struct wlan_objmgr_psoc *psoc = NULL;
|
|
|
struct iot_sim_cb_context *context = ctxt;
|
|
|
+ uint8_t *buf;
|
|
|
+ struct ieee80211_frame *wh;
|
|
|
+ struct qdf_mac_addr *mac_addr;
|
|
|
+ struct mgmt_rx_event_params *param = context->piot_sim_rule->rx_param;
|
|
|
+ struct wlan_objmgr_peer **peer = &context->piot_sim_rule->peer;
|
|
|
|
|
|
qdf_spin_lock_bh(&context->piot_sim_rule->iot_sim_delay_lock);
|
|
|
qdf_spin_lock_bh(&context->isc->iot_sim_lock);
|
|
@@ -930,14 +941,30 @@ static void iot_sim_delay_cb(void *ctxt)
|
|
|
mgmt_txrx_rx_handler(psoc, context->piot_sim_rule->sec_buf,
|
|
|
context->piot_sim_rule->rx_param);
|
|
|
qdf_spin_lock_bh(&context->isc->iot_sim_lock);
|
|
|
+ if (*peer) {
|
|
|
+ wlan_objmgr_peer_release_ref(*peer, WLAN_IOT_SIM_ID);
|
|
|
+ *peer = NULL;
|
|
|
+ }
|
|
|
if (context->piot_sim_rule->nbuf_list[1]) {
|
|
|
context->piot_sim_rule->nbuf_list[0] =
|
|
|
context->piot_sim_rule->nbuf_list[1];
|
|
|
+ buf = qdf_nbuf_data(context->piot_sim_rule->nbuf_list[0]);
|
|
|
+ wh = (struct ieee80211_frame *)buf;
|
|
|
+ mac_addr = (struct qdf_mac_addr *)wh->i_addr2;
|
|
|
+ *peer = wlan_objmgr_get_peer(psoc, param->pdev_id,
|
|
|
+ (uint8_t *)mac_addr,
|
|
|
+ WLAN_IOT_SIM_ID);
|
|
|
+
|
|
|
if (!qdf_delayed_work_start(context->piot_sim_rule->dwork,
|
|
|
context->
|
|
|
piot_sim_rule->delay_dur)) {
|
|
|
iot_sim_err("delayed_work_start failed");
|
|
|
qdf_nbuf_free(context->piot_sim_rule->nbuf_list[0]);
|
|
|
+ if (*peer) {
|
|
|
+ wlan_objmgr_peer_release_ref(*peer,
|
|
|
+ WLAN_IOT_SIM_ID);
|
|
|
+ *peer = NULL;
|
|
|
+ }
|
|
|
qdf_mem_free(context->piot_sim_rule->
|
|
|
rx_param->rx_params);
|
|
|
qdf_mem_free(context->piot_sim_rule->rx_param);
|
|
@@ -1023,6 +1050,7 @@ iot_sim_add_rule(struct iot_sim_rule_per_seq **s_e,
|
|
|
|
|
|
(*f_e)->nbuf_list[0] = NULL;
|
|
|
(*f_e)->nbuf_list[1] = NULL;
|
|
|
+ (*f_e)->peer = NULL;
|
|
|
iot_sim_err("delayed_work_created");
|
|
|
qdf_spinlock_create(&((*f_e)->iot_sim_delay_lock));
|
|
|
}
|