Merge "qcacmn: Remove redundant definition of WEXT macros"
diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h
index 6918b9a..791f846 100644
--- a/dp/inc/cdp_txrx_cmn.h
+++ b/dp/inc/cdp_txrx_cmn.h
@@ -170,7 +170,7 @@
vdev_mac_addr, vdev_id, op_mode);
}
-#ifdef CONFIG_MCL
+#ifdef DP_FLOW_CTL
/**
* cdp_flow_pool_map() - Create flow pool for vdev
* @soc - data path soc handle
diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h
index 866146d..bab6950 100644
--- a/dp/inc/cdp_txrx_cmn_struct.h
+++ b/dp/inc/cdp_txrx_cmn_struct.h
@@ -34,7 +34,7 @@
#include "qdf_types.h"
#include "qdf_nbuf.h"
#include "qdf_atomic.h"
-#ifdef CONFIG_MCL
+#ifdef DP_MOB_DEFS
#include <cdp_txrx_mob_def.h>
#endif
#include <cdp_txrx_handle.h>
diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h
index c8ba190..a04702f 100644
--- a/dp/inc/cdp_txrx_ops.h
+++ b/dp/inc/cdp_txrx_ops.h
@@ -920,10 +920,10 @@
struct cdp_lro_hash_config *rx_offld_hash);
void (*update_dp_stats)(void *soc, void *stats, uint16_t id,
uint8_t type);
-#ifdef CONFIG_MCL
- uint8_t (*rx_invalid_peer)(uint8_t vdev_id, void *wh);
-#else
+#ifdef FEATURE_NAC_RSSI
uint8_t (*rx_invalid_peer)(void *ctrl_pdev, void *msg);
+#else
+ uint8_t (*rx_invalid_peer)(uint8_t vdev_id, void *wh);
#endif
int (*peer_map_event)(void *ol_soc_handle, uint16_t peer_id, uint16_t hw_peer_id,
uint8_t vdev_id, uint8_t *peer_mac_addr,
@@ -973,8 +973,7 @@
/* TODO: Add any other control path calls required to OL_IF/WMA layer */
};
-#ifdef CONFIG_MCL
-/* From here MCL specific OPs */
+#ifdef DP_PEER_EXTENDED_API
/**
* struct cdp_misc_ops - mcl ops not classified
* @set_ibss_vdev_heart_beat_timer:
@@ -1039,22 +1038,95 @@
};
/**
- * struct cdp_tx_delay_ops - mcl tx delay ops
- * @tx_delay:
- * @tx_delay_hist:
- * @tx_packet_count:
- * @tx_set_compute_interval:
+ * struct cdp_ocb_ops - mcl ocb ops
+ * @set_ocb_chan_info:
+ * @get_ocb_chan_info:
*/
-struct cdp_tx_delay_ops {
- void (*tx_delay)(struct cdp_pdev *pdev, uint32_t *queue_delay_microsec,
- uint32_t *tx_delay_microsec, int category);
- void (*tx_delay_hist)(struct cdp_pdev *pdev,
- uint16_t *bin_values, int category);
- void (*tx_packet_count)(struct cdp_pdev *pdev,
- uint16_t *out_packet_count,
- uint16_t *out_packet_loss_count, int category);
- void (*tx_set_compute_interval)(struct cdp_pdev *pdev,
- uint32_t interval);
+struct cdp_ocb_ops {
+ void (*set_ocb_chan_info)(struct cdp_vdev *vdev,
+ struct ol_txrx_ocb_set_chan ocb_set_chan);
+ struct ol_txrx_ocb_chan_info *
+ (*get_ocb_chan_info)(struct cdp_vdev *vdev);
+};
+
+/**
+ * struct cdp_peer_ops - mcl peer related ops
+ * @register_peer:
+ * @clear_peer:
+ * @cfg_attach:
+ * @find_peer_by_addr:
+ * @find_peer_by_addr_and_vdev:
+ * @local_peer_id:
+ * @peer_find_by_local_id:
+ * @peer_state_update:
+ * @get_vdevid:
+ * @get_vdev_by_sta_id:
+ * @register_ocb_peer:
+ * @peer_get_peer_mac_addr:
+ * @get_peer_state:
+ * @get_vdev_for_peer:
+ * @update_ibss_add_peer_num_of_vdev:
+ * @remove_peers_for_vdev:
+ * @remove_peers_for_vdev_no_lock:
+ * @copy_mac_addr_raw:
+ * @add_last_real_peer:
+ * @is_vdev_restore_last_peer:
+ * @update_last_real_peer:
+ */
+struct cdp_peer_ops {
+ QDF_STATUS (*register_peer)(struct cdp_pdev *pdev,
+ struct ol_txrx_desc_type *sta_desc);
+ QDF_STATUS (*clear_peer)(struct cdp_pdev *pdev, uint8_t sta_id);
+ QDF_STATUS (*change_peer_state)(uint8_t sta_id,
+ enum ol_txrx_peer_state sta_state,
+ bool roam_synch_in_progress);
+ void * (*peer_get_ref_by_addr)(struct cdp_pdev *pdev,
+ uint8_t *peer_addr, uint8_t *peer_id,
+ enum peer_debug_id_type debug_id);
+ void (*peer_release_ref)(void *peer, enum peer_debug_id_type debug_id);
+ void * (*find_peer_by_addr)(struct cdp_pdev *pdev,
+ uint8_t *peer_addr, uint8_t *peer_id);
+ void * (*find_peer_by_addr_and_vdev)(struct cdp_pdev *pdev,
+ struct cdp_vdev *vdev,
+ uint8_t *peer_addr, uint8_t *peer_id);
+ uint16_t (*local_peer_id)(void *peer);
+ void * (*peer_find_by_local_id)(struct cdp_pdev *pdev,
+ uint8_t local_peer_id);
+ QDF_STATUS (*peer_state_update)(struct cdp_pdev *pdev,
+ uint8_t *peer_addr,
+ enum ol_txrx_peer_state state);
+ QDF_STATUS (*get_vdevid)(void *peer, uint8_t *vdev_id);
+ struct cdp_vdev * (*get_vdev_by_sta_id)(struct cdp_pdev *pdev,
+ uint8_t sta_id);
+ QDF_STATUS (*register_ocb_peer)(uint8_t *mac_addr, uint8_t *peer_id);
+ uint8_t * (*peer_get_peer_mac_addr)(void *peer);
+ int (*get_peer_state)(void *peer);
+ struct cdp_vdev * (*get_vdev_for_peer)(void *peer);
+ int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_vdev *vdev,
+ int16_t peer_num_delta);
+ void (*remove_peers_for_vdev)(struct cdp_vdev *vdev,
+ ol_txrx_vdev_peer_remove_cb callback,
+ void *callback_context, bool remove_last_peer);
+ void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev,
+ ol_txrx_vdev_peer_remove_cb callback,
+ void *callback_context);
+ void (*copy_mac_addr_raw)(struct cdp_vdev *vdev, uint8_t *bss_addr);
+ void (*add_last_real_peer)(struct cdp_pdev *pdev,
+ struct cdp_vdev *vdev, uint8_t *peer_id);
+ bool (*is_vdev_restore_last_peer)(void *peer);
+ void (*update_last_real_peer)(struct cdp_pdev *pdev, void *vdev,
+ uint8_t *peer_id, bool restore_last_peer);
+ void (*peer_detach_force_delete)(void *peer);
+};
+
+/**
+ * struct cdp_ocb_ops - mcl ocb ops
+ * @clear_stats:
+ * @stats:
+ */
+struct cdp_mob_stats_ops {
+ void (*clear_stats)(uint16_t bitmap);
+ int (*stats)(uint8_t vdev_id, char *buffer, unsigned buf_len);
};
/**
@@ -1065,7 +1137,10 @@
void (*get_pn_info)(void *peer, uint8_t **last_pn_valid,
uint64_t **last_pn, uint32_t **rmf_pn_replays);
};
+#endif
+
+#ifdef DP_FLOW_CTL
/**
* struct cdp_cfg_ops - mcl configuration ops
* @set_cfg_rx_fwd_disabled: set rx_fwd_disabled flag
@@ -1168,6 +1243,18 @@
void (*vdev_unpause)(struct cdp_vdev *vdev, uint32_t reason);
};
+/**
+ * struct cdp_ocb_ops - mcl ocb ops
+ * @throttle_init_period:
+ * @throttle_set_level:
+ */
+struct cdp_throttle_ops {
+ void (*throttle_init_period)(struct cdp_pdev *pdev, int period,
+ uint8_t *dutycycle_level);
+ void (*throttle_set_level)(struct cdp_pdev *pdev, int level);
+};
+#endif
+
#ifdef IPA_OFFLOAD
/**
* struct cdp_ipa_ops - mcl ipa data path ops
@@ -1229,6 +1316,26 @@
};
#endif
+#ifdef DP_POWER_SAVE
+/**
+ * struct cdp_tx_delay_ops - mcl tx delay ops
+ * @tx_delay:
+ * @tx_delay_hist:
+ * @tx_packet_count:
+ * @tx_set_compute_interval:
+ */
+struct cdp_tx_delay_ops {
+ void (*tx_delay)(struct cdp_pdev *pdev, uint32_t *queue_delay_microsec,
+ uint32_t *tx_delay_microsec, int category);
+ void (*tx_delay_hist)(struct cdp_pdev *pdev,
+ uint16_t *bin_values, int category);
+ void (*tx_packet_count)(struct cdp_pdev *pdev,
+ uint16_t *out_packet_count,
+ uint16_t *out_packet_loss_count, int category);
+ void (*tx_set_compute_interval)(struct cdp_pdev *pdev,
+ uint32_t interval);
+};
+
/**
* struct cdp_bus_ops - mcl bus suspend/resume ops
* @bus_suspend:
@@ -1238,110 +1345,7 @@
QDF_STATUS (*bus_suspend)(struct cdp_pdev *opaque_pdev);
QDF_STATUS (*bus_resume)(struct cdp_pdev *opaque_pdev);
};
-
-/**
- * struct cdp_ocb_ops - mcl ocb ops
- * @set_ocb_chan_info:
- * @get_ocb_chan_info:
- */
-struct cdp_ocb_ops {
- void (*set_ocb_chan_info)(struct cdp_vdev *vdev,
- struct ol_txrx_ocb_set_chan ocb_set_chan);
- struct ol_txrx_ocb_chan_info *
- (*get_ocb_chan_info)(struct cdp_vdev *vdev);
-};
-
-/**
- * struct cdp_peer_ops - mcl peer related ops
- * @register_peer:
- * @clear_peer:
- * @cfg_attach:
- * @find_peer_by_addr:
- * @find_peer_by_addr_and_vdev:
- * @local_peer_id:
- * @peer_find_by_local_id:
- * @peer_state_update:
- * @get_vdevid:
- * @get_vdev_by_sta_id:
- * @register_ocb_peer:
- * @peer_get_peer_mac_addr:
- * @get_peer_state:
- * @get_vdev_for_peer:
- * @update_ibss_add_peer_num_of_vdev:
- * @remove_peers_for_vdev:
- * @remove_peers_for_vdev_no_lock:
- * @copy_mac_addr_raw:
- * @add_last_real_peer:
- * @is_vdev_restore_last_peer:
- * @update_last_real_peer:
- */
-struct cdp_peer_ops {
- QDF_STATUS (*register_peer)(struct cdp_pdev *pdev,
- struct ol_txrx_desc_type *sta_desc);
- QDF_STATUS (*clear_peer)(struct cdp_pdev *pdev, uint8_t sta_id);
- QDF_STATUS (*change_peer_state)(uint8_t sta_id,
- enum ol_txrx_peer_state sta_state,
- bool roam_synch_in_progress);
- void * (*peer_get_ref_by_addr)(struct cdp_pdev *pdev,
- uint8_t *peer_addr, uint8_t *peer_id,
- enum peer_debug_id_type debug_id);
- void (*peer_release_ref)(void *peer, enum peer_debug_id_type debug_id);
- void * (*find_peer_by_addr)(struct cdp_pdev *pdev,
- uint8_t *peer_addr, uint8_t *peer_id);
- void * (*find_peer_by_addr_and_vdev)(struct cdp_pdev *pdev,
- struct cdp_vdev *vdev,
- uint8_t *peer_addr, uint8_t *peer_id);
- uint16_t (*local_peer_id)(void *peer);
- void * (*peer_find_by_local_id)(struct cdp_pdev *pdev,
- uint8_t local_peer_id);
- QDF_STATUS (*peer_state_update)(struct cdp_pdev *pdev,
- uint8_t *peer_addr,
- enum ol_txrx_peer_state state);
- QDF_STATUS (*get_vdevid)(void *peer, uint8_t *vdev_id);
- struct cdp_vdev * (*get_vdev_by_sta_id)(struct cdp_pdev *pdev,
- uint8_t sta_id);
- QDF_STATUS (*register_ocb_peer)(uint8_t *mac_addr, uint8_t *peer_id);
- uint8_t * (*peer_get_peer_mac_addr)(void *peer);
- int (*get_peer_state)(void *peer);
- struct cdp_vdev * (*get_vdev_for_peer)(void *peer);
- int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_vdev *vdev,
- int16_t peer_num_delta);
- void (*remove_peers_for_vdev)(struct cdp_vdev *vdev,
- ol_txrx_vdev_peer_remove_cb callback,
- void *callback_context, bool remove_last_peer);
- void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev,
- ol_txrx_vdev_peer_remove_cb callback,
- void *callback_context);
- void (*copy_mac_addr_raw)(struct cdp_vdev *vdev, uint8_t *bss_addr);
- void (*add_last_real_peer)(struct cdp_pdev *pdev,
- struct cdp_vdev *vdev, uint8_t *peer_id);
- bool (*is_vdev_restore_last_peer)(void *peer);
- void (*update_last_real_peer)(struct cdp_pdev *pdev, void *vdev,
- uint8_t *peer_id, bool restore_last_peer);
- void (*peer_detach_force_delete)(void *peer);
-};
-
-/**
- * struct cdp_ocb_ops - mcl ocb ops
- * @throttle_init_period:
- * @throttle_set_level:
- */
-struct cdp_throttle_ops {
- void (*throttle_init_period)(struct cdp_pdev *pdev, int period,
- uint8_t *dutycycle_level);
- void (*throttle_set_level)(struct cdp_pdev *pdev, int level);
-};
-
-/**
- * struct cdp_ocb_ops - mcl ocb ops
- * @clear_stats:
- * @stats:
- */
-struct cdp_mob_stats_ops {
- void (*clear_stats)(uint16_t bitmap);
- int (*stats)(uint8_t vdev_id, char *buffer, unsigned buf_len);
-};
-#endif /* CONFIG_MCL */
+#endif
#ifdef RECEIVE_OFFLOAD
/**
@@ -1364,24 +1368,28 @@
struct cdp_wds_ops *wds_ops;
struct cdp_raw_ops *raw_ops;
struct cdp_pflow_ops *pflow_ops;
-#ifdef CONFIG_MCL
+#ifdef DP_PEER_EXTENDED_API
struct cdp_misc_ops *misc_ops;
+ struct cdp_peer_ops *peer_ops;
+ struct cdp_ocb_ops *ocb_ops;
+ struct cdp_mob_stats_ops *mob_stats_ops;
+ struct cdp_pmf_ops *pmf_ops;
+#endif
+#ifdef DP_FLOW_CTL
struct cdp_cfg_ops *cfg_ops;
struct cdp_flowctl_ops *flowctl_ops;
struct cdp_lflowctl_ops *l_flowctl_ops;
+ struct cdp_throttle_ops *throttle_ops;
+#endif
+#ifdef DP_POWER_SAVE
+ struct cdp_bus_ops *bus_ops;
+ struct cdp_tx_delay_ops *delay_ops;
+#endif
#ifdef IPA_OFFLOAD
struct cdp_ipa_ops *ipa_ops;
#endif
#ifdef RECEIVE_OFFLOAD
struct cdp_rx_offld_ops *rx_offld_ops;
#endif
- struct cdp_bus_ops *bus_ops;
- struct cdp_ocb_ops *ocb_ops;
- struct cdp_peer_ops *peer_ops;
- struct cdp_throttle_ops *throttle_ops;
- struct cdp_mob_stats_ops *mob_stats_ops;
- struct cdp_tx_delay_ops *delay_ops;
- struct cdp_pmf_ops *pmf_ops;
-#endif
};
#endif
diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h
index 081bd99..54aea8b 100644
--- a/dp/inc/cdp_txrx_stats_struct.h
+++ b/dp/inc/cdp_txrx_stats_struct.h
@@ -23,9 +23,6 @@
*/
#ifndef _CDP_TXRX_STATS_STRUCT_H_
#define _CDP_TXRX_STATS_STRUCT_H_
-#ifdef CONFIG_MCL
-#include <wlan_defs.h>
-#endif
#define TXRX_STATS_LEVEL_OFF 0
#define TXRX_STATS_LEVEL_BASIC 1
#define TXRX_STATS_LEVEL_FULL 2
@@ -1619,6 +1616,8 @@
OL_ATH_PARAM_TBTT_CTRL = 420,
/* Enable/disable AP OBSS_PD_THRESHOLD */
OL_ATH_PARAM_SET_CMD_OBSS_PD_THRESHOLD_ENABLE = 421,
+ /* Get baseline radio level channel width */
+ OL_ATH_PARAM_RCHWIDTH = 422,
};
#endif
/* Bitmasks for stats that can block */
diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h
index e3baa6f..cfbd311 100644
--- a/dp/wifi3.0/dp_internal.h
+++ b/dp/wifi3.0/dp_internal.h
@@ -132,7 +132,7 @@
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_##LVL, \
fmt, ## args)
-#ifdef CONFIG_MCL
+#ifdef DP_PRINT_NO_CONSOLE
/* Stat prints should not go to console or kernel logs.*/
#define DP_PRINT_STATS(fmt, args ...)\
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_HIGH, \
@@ -751,7 +751,7 @@
extern struct dp_peer *dp_peer_find_hash_find(struct dp_soc *soc,
uint8_t *peer_mac_addr, int mac_addr_is_aligned, uint8_t vdev_id);
-#ifndef CONFIG_WIN
+#ifdef DP_PEER_EXTENDED_API
QDF_STATUS dp_register_peer(struct cdp_pdev *pdev_handle,
struct ol_txrx_desc_type *sta_desc);
QDF_STATUS dp_clear_peer(struct cdp_pdev *pdev_handle, uint8_t local_id);
diff --git a/dp/wifi3.0/dp_ipa.c b/dp/wifi3.0/dp_ipa.c
index 5cca621..a8f74b8 100644
--- a/dp/wifi3.0/dp_ipa.c
+++ b/dp/wifi3.0/dp_ipa.c
@@ -1057,8 +1057,8 @@
struct dp_ipa_resources *ipa_res = &pdev->ipa_resource;
qdf_ipa_ep_cfg_t *tx_cfg;
qdf_ipa_ep_cfg_t *rx_cfg;
- qdf_ipa_wdi_pipe_setup_info_t *tx;
- qdf_ipa_wdi_pipe_setup_info_t *rx;
+ qdf_ipa_wdi_pipe_setup_info_t *tx = NULL;
+ qdf_ipa_wdi_pipe_setup_info_t *rx = NULL;
qdf_ipa_wdi_pipe_setup_info_smmu_t *tx_smmu;
qdf_ipa_wdi_pipe_setup_info_smmu_t *rx_smmu;
qdf_ipa_wdi_conn_in_params_t pipe_in;
@@ -1068,9 +1068,6 @@
if (!wlan_cfg_is_ipa_enabled(soc->wlan_cfg_ctx))
return QDF_STATUS_SUCCESS;
-
- qdf_mem_zero(&tx, sizeof(qdf_ipa_wdi_pipe_setup_info_t));
- qdf_mem_zero(&rx, sizeof(qdf_ipa_wdi_pipe_setup_info_t));
qdf_mem_zero(&pipe_in, sizeof(pipe_in));
qdf_mem_zero(&pipe_out, sizeof(pipe_out));
diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c
index 5d9416e..17982e3 100644
--- a/dp/wifi3.0/dp_main.c
+++ b/dp/wifi3.0/dp_main.c
@@ -66,7 +66,7 @@
#ifdef ATH_SUPPORT_IQUE
#include "dp_txrx_me.h"
#endif
-#ifdef CONFIG_MCL
+#if defined(DP_CON_MON)
extern int con_mode_monitor;
#ifndef REMOVE_PKT_LOG
#include <pktlog_ac_api.h>
@@ -306,7 +306,7 @@
};
/* MCL specific functions */
-#ifdef CONFIG_MCL
+#if defined(DP_CON_MON)
/**
* dp_soc_get_mon_mask_for_interrupt_mode() - get mon mode mask for intr mode
* @soc: pointer to dp_soc handle
@@ -1707,7 +1707,7 @@
}
static QDF_STATUS dp_soc_interrupt_attach(void *txrx_soc);
-#if defined(CONFIG_MCL)
+#if defined(DP_INTR_POLL_BOTH)
/*
* dp_soc_interrupt_attach_wrapper() - Register handlers for DP interrupts
* @txrx_soc: DP SOC handle
@@ -3014,8 +3014,6 @@
*/
static void dp_soc_cmn_cleanup(struct dp_soc *soc)
{
- dp_tx_soc_detach(soc);
-
qdf_spinlock_destroy(&soc->rx.defrag.defrag_lock);
dp_reo_cmdlist_destroy(soc);
@@ -3870,6 +3868,11 @@
dp_cal_client_detach(&pdev->cal_client_ctx);
soc->pdev_count--;
+
+ /* only do soc common cleanup when last pdev do detach */
+ if (!(soc->pdev_count))
+ dp_soc_cmn_cleanup(soc);
+
wlan_cfg_pdev_detach(pdev->wlan_cfg_ctx);
if (pdev->invalid_peer)
qdf_mem_free(pdev->invalid_peer);
@@ -3971,11 +3974,6 @@
dp_pdev_deinit(txrx_pdev, force);
dp_pdev_detach(txrx_pdev, force);
}
-
- /* only do soc common cleanup when last pdev do detach */
- if (!(soc->pdev_count))
- dp_soc_cmn_cleanup(soc);
-
}
/*
@@ -4152,6 +4150,8 @@
/* Common rings */
dp_srng_cleanup(soc, &soc->wbm_desc_rel_ring, SW2WBM_RELEASE, 0);
+ dp_tx_soc_detach(soc);
+
/* Tx data rings */
if (!wlan_cfg_per_pdev_tx_ring(soc->wlan_cfg_ctx)) {
for (i = 0; i < soc->num_tcl_data_rings; i++) {
@@ -6064,6 +6064,7 @@
if (status != QDF_STATUS_SUCCESS) {
dp_err("Failed to send tlv filter for monitor mode rings");
+ qdf_spin_unlock_bh(&pdev->mon_lock);
return status;
}
@@ -9162,7 +9163,7 @@
return tx_success;
}
-#ifndef CONFIG_WIN
+#ifdef DP_PEER_EXTENDED_API
static struct cdp_misc_ops dp_ops_misc = {
#ifdef FEATURE_WLAN_TDLS
.tx_non_std = dp_tx_non_std,
@@ -9177,7 +9178,9 @@
.get_num_rx_contexts = dp_get_num_rx_contexts,
.get_tx_ack_stats = dp_tx_get_success_ack_stats,
};
+#endif
+#ifdef DP_FLOW_CTL
static struct cdp_flowctl_ops dp_ops_flowctl = {
/* WIFI 3.0 DP implement as required. */
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
@@ -9192,6 +9195,7 @@
static struct cdp_lflowctl_ops dp_ops_l_flowctl = {
/* WIFI 3.0 DP NOT IMPLEMENTED YET */
};
+#endif
#ifdef IPA_OFFLOAD
static struct cdp_ipa_ops dp_ops_ipa = {
@@ -9214,6 +9218,7 @@
};
#endif
+#ifdef DP_POWER_SAVE
static QDF_STATUS dp_bus_suspend(struct cdp_pdev *opaque_pdev)
{
struct dp_pdev *pdev = (struct dp_pdev *)opaque_pdev;
@@ -9252,21 +9257,24 @@
.bus_suspend = dp_bus_suspend,
.bus_resume = dp_bus_resume
};
+#endif
-static struct cdp_ocb_ops dp_ops_ocb = {
- /* WIFI 3.0 DP NOT IMPLEMENTED YET */
-};
-
-
+#ifdef DP_FLOW_CTL
static struct cdp_throttle_ops dp_ops_throttle = {
/* WIFI 3.0 DP NOT IMPLEMENTED YET */
};
-static struct cdp_mob_stats_ops dp_ops_mob_stats = {
+static struct cdp_cfg_ops dp_ops_cfg = {
+ /* WIFI 3.0 DP NOT IMPLEMENTED YET */
+};
+#endif
+
+#ifdef DP_PEER_EXTENDED_API
+static struct cdp_ocb_ops dp_ops_ocb = {
/* WIFI 3.0 DP NOT IMPLEMENTED YET */
};
-static struct cdp_cfg_ops dp_ops_cfg = {
+static struct cdp_mob_stats_ops dp_ops_mob_stats = {
/* WIFI 3.0 DP NOT IMPLEMENTED YET */
};
@@ -9340,19 +9348,23 @@
#ifdef PEER_FLOW_CONTROL
.pflow_ops = &dp_ops_pflow,
#endif /* PEER_FLOW_CONTROL */
-#ifndef CONFIG_WIN
+#ifdef DP_PEER_EXTENDED_API
.misc_ops = &dp_ops_misc,
+ .ocb_ops = &dp_ops_ocb,
+ .peer_ops = &dp_ops_peer,
+ .mob_stats_ops = &dp_ops_mob_stats,
+#endif
+#ifdef DP_FLOW_CTL
.cfg_ops = &dp_ops_cfg,
.flowctl_ops = &dp_ops_flowctl,
.l_flowctl_ops = &dp_ops_l_flowctl,
+ .throttle_ops = &dp_ops_throttle,
+#endif
#ifdef IPA_OFFLOAD
.ipa_ops = &dp_ops_ipa,
#endif
+#ifdef DP_POWER_SAVE
.bus_ops = &dp_ops_bus,
- .ocb_ops = &dp_ops_ocb,
- .peer_ops = &dp_ops_peer,
- .throttle_ops = &dp_ops_throttle,
- .mob_stats_ops = &dp_ops_mob_stats,
#endif
};
diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c
index 66250c2..6b0c0ad 100644
--- a/dp/wifi3.0/dp_peer.c
+++ b/dp/wifi3.0/dp_peer.c
@@ -27,10 +27,6 @@
#include "dp_rx.h"
#include <hal_api.h>
#include <hal_reo.h>
-#ifdef CONFIG_MCL
-#include <cds_ieee80211_common.h>
-#include <cds_api.h>
-#endif
#include <cdp_txrx_handle.h>
#include <wlan_cfg.h>
@@ -900,7 +896,13 @@
peer->vdev->vdev_id, flags, ast_entry->mac_addr.raw,
peer->mac_addr.raw);
- if (ast_entry->delete_in_progress)
+ /* Do not send AST update in below cases
+ * 1) Ast entry delete has already triggered
+ * 2) Peer delete is already triggered
+ * 3) We did not get the HTT map for create event
+ */
+ if (ast_entry->delete_in_progress || peer->delete_in_progress ||
+ !ast_entry->is_mapped)
return ret;
if ((ast_entry->type == CDP_TXRX_AST_TYPE_STATIC) ||
@@ -2277,12 +2279,13 @@
delba_rcode = rx_tid->delba_rcode;
qdf_spin_unlock_bh(&rx_tid->tid_lock);
- peer->vdev->pdev->soc->cdp_soc.ol_ops->send_delba(
- peer->vdev->pdev->ctrl_pdev,
- peer->ctrl_peer,
- peer->mac_addr.raw,
- tid, peer->vdev->ctrl_vdev,
- delba_rcode);
+ if (peer->vdev->pdev->soc->cdp_soc.ol_ops->send_delba)
+ peer->vdev->pdev->soc->cdp_soc.ol_ops->send_delba(
+ peer->vdev->pdev->ctrl_pdev,
+ peer->ctrl_peer,
+ peer->mac_addr.raw,
+ tid, peer->vdev->ctrl_vdev,
+ delba_rcode);
} else {
qdf_spin_unlock_bh(&rx_tid->tid_lock);
}
@@ -2605,10 +2608,11 @@
rx_tid->delba_tx_retry++;
rx_tid->delba_tx_status = 1;
qdf_spin_unlock_bh(&rx_tid->tid_lock);
- peer->vdev->pdev->soc->cdp_soc.ol_ops->send_delba(
- peer->vdev->pdev->ctrl_pdev, peer->ctrl_peer,
- peer->mac_addr.raw, tid, peer->vdev->ctrl_vdev,
- rx_tid->delba_rcode);
+ if (peer->vdev->pdev->soc->cdp_soc.ol_ops->send_delba)
+ peer->vdev->pdev->soc->cdp_soc.ol_ops->send_delba(
+ peer->vdev->pdev->ctrl_pdev, peer->ctrl_peer,
+ peer->mac_addr.raw, tid, peer->vdev->ctrl_vdev,
+ rx_tid->delba_rcode);
}
return QDF_STATUS_SUCCESS;
} else {
@@ -2818,7 +2822,7 @@
dp_peer_unref_del_find_by_id(peer);
}
-#ifdef CONFIG_MCL
+#ifdef DP_PEER_EXTENDED_API
/**
* dp_register_peer() - Register peer into physical device
* @pdev - data path device instance
diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c
index 9033e9d..37b9b4e 100644
--- a/dp/wifi3.0/dp_rx.c
+++ b/dp/wifi3.0/dp_rx.c
@@ -2038,7 +2038,7 @@
dp_peer_unref_del_find_by_id(peer);
}
- if (deliver_list_head)
+ if (deliver_list_head && peer)
dp_rx_deliver_to_stack(vdev, peer, deliver_list_head,
deliver_list_tail);
diff --git a/dp/wifi3.0/dp_rx_defrag.h b/dp/wifi3.0/dp_rx_defrag.h
index 0c24f88..0cfc840 100644
--- a/dp/wifi3.0/dp_rx_defrag.h
+++ b/dp/wifi3.0/dp_rx_defrag.h
@@ -21,10 +21,6 @@
#include "hal_rx.h"
-#ifdef CONFIG_MCL
-#include <cds_ieee80211_common.h>
-#endif
-
#define DEFRAG_IEEE80211_KEY_LEN 8
#define DEFRAG_IEEE80211_FCS_LEN 4
diff --git a/dp/wifi3.0/dp_rx_err.c b/dp/wifi3.0/dp_rx_err.c
index 1423828..aeb13a5 100644
--- a/dp/wifi3.0/dp_rx_err.c
+++ b/dp/wifi3.0/dp_rx_err.c
@@ -24,9 +24,6 @@
#include "hal_api.h"
#include "qdf_trace.h"
#include "qdf_nbuf.h"
-#ifdef CONFIG_MCL
-#include <cds_ieee80211_common.h>
-#endif
#include "dp_rx_defrag.h"
#ifdef FEATURE_WDS
#include "dp_txrx_wds.h"
@@ -401,7 +398,7 @@
mac_id, quota);
}
-#ifdef CONFIG_MCL
+#ifdef DP_INVALID_PEER_ASSERT
#define DP_PDEV_INVALID_PEER_MSDU_CHECK(head, tail) \
do { \
qdf_assert_always(!(head)); \
@@ -546,12 +543,13 @@
rx_tid->delba_rcode =
IEEE80211_REASON_QOS_SETUP_REQUIRED;
qdf_spin_unlock_bh(&rx_tid->tid_lock);
- soc->cdp_soc.ol_ops->send_delba(peer->vdev->pdev->ctrl_pdev,
- peer->ctrl_peer,
- peer->mac_addr.raw,
- tid,
- peer->vdev->ctrl_vdev,
- rx_tid->delba_rcode);
+ if (soc->cdp_soc.ol_ops->send_delba)
+ soc->cdp_soc.ol_ops->send_delba(peer->vdev->pdev->ctrl_pdev,
+ peer->ctrl_peer,
+ peer->mac_addr.raw,
+ tid,
+ peer->vdev->ctrl_vdev,
+ rx_tid->delba_rcode);
} else {
qdf_spin_unlock_bh(&rx_tid->tid_lock);
}
@@ -1404,7 +1402,8 @@
while (nbuf) {
struct dp_peer *peer;
uint16_t peer_id;
-
+ uint8_t e_code;
+ uint8_t *tlv_hdr;
rx_tlv_hdr = qdf_nbuf_data(nbuf);
peer_id = hal_rx_mpdu_start_sw_peer_id_get(rx_tlv_hdr);
@@ -1505,8 +1504,24 @@
continue;
case HAL_RXDMA_ERR_DECRYPT:
- if (peer)
- DP_STATS_INC(peer, rx.err.decrypt_err, 1);
+ pool_id = wbm_err_info.pool_id;
+ e_code = wbm_err_info.rxdma_err_code;
+ tlv_hdr = rx_tlv_hdr;
+ if (peer) {
+ DP_STATS_INC(peer, rx.err.
+ decrypt_err, 1);
+ } else {
+ dp_rx_process_rxdma_err(soc,
+ nbuf,
+ tlv_hdr,
+ NULL,
+ e_code,
+ pool_id
+ );
+ nbuf = next;
+ continue;
+ }
+
QDF_TRACE(QDF_MODULE_ID_DP,
QDF_TRACE_LEVEL_DEBUG,
"Packet received with Decrypt error");
diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h
index 8bab926..54c1cae 100644
--- a/dp/wifi3.0/dp_types.h
+++ b/dp/wifi3.0/dp_types.h
@@ -30,10 +30,10 @@
#include <htt_common.h>
#include <cdp_txrx_cmn.h>
-#ifdef CONFIG_MCL
+#ifdef DP_MOB_DEFS
#include <cds_ieee80211_common.h>
-#include <wdi_event_api.h> /* WDI subscriber event list */
#endif
+#include <wdi_event_api.h> /* WDI subscriber event list */
#include "hal_hw_headers.h"
#include <hal_tx.h>
@@ -71,7 +71,7 @@
#define MAX_MON_LINK_DESC_BANKS 2
#define DP_VDEV_ALL 0xff
-#if defined(CONFIG_MCL)
+#if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
#define MAX_PDEV_CNT 1
#else
#define MAX_PDEV_CNT 3
diff --git a/hal/wifi3.0/hal_api.h b/hal/wifi3.0/hal_api.h
index 75be311..b373f34 100644
--- a/hal/wifi3.0/hal_api.h
+++ b/hal/wifi3.0/hal_api.h
@@ -881,6 +881,20 @@
}
/**
+ * hal_get_entrysize_from_srng() - Retrieve ring entry size
+ * @hal_ring: Source ring pointer
+ *
+ * Return: uint8_t
+ */
+static inline
+uint8_t hal_get_entrysize_from_srng(void *hal_ring)
+{
+ struct hal_srng *srng = (struct hal_srng *)hal_ring;
+
+ return srng->entry_size;
+}
+
+/**
* hal_get_sw_hptp - Get SW head and tail pointer location for any ring
* @hal_soc: Opaque HAL SOC handle
* @hal_ring: Source ring pointer
diff --git a/hal/wifi3.0/hal_reo.h b/hal/wifi3.0/hal_reo.h
index 86f872f..c9b1265 100644
--- a/hal/wifi3.0/hal_reo.h
+++ b/hal/wifi3.0/hal_reo.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -492,6 +492,10 @@
/* Prototypes */
/* REO command ring routines */
+void hal_reo_cmd_set_descr_addr(uint32_t *reo_desc,
+ enum hal_reo_cmd_type type,
+ uint32_t paddr_lo,
+ uint8_t paddr_hi);
int hal_reo_cmd_queue_stats(void *reo_ring, struct hal_soc *soc,
struct hal_reo_cmd_params *cmd);
int hal_reo_cmd_flush_queue(void *reo_ring, struct hal_soc *soc,
diff --git a/hif/configs/ap_hif.config b/hif/configs/ap_hif.config
index ac35e75..f49aee9 100644
--- a/hif/configs/ap_hif.config
+++ b/hif/configs/ap_hif.config
@@ -1 +1,3 @@
EXTRA_CFLAGS += -DQCA_NAPI_DEF_SCALE_BIN_SHIFT=1
+EXTRA_CFLAGS += -DHIF_MAX_GROUP=12
+EXTRA_CFLAGS += -DHTC_MSG_NACK_SUSPEND=7
diff --git a/hif/inc/hif.h b/hif/inc/hif.h
index 225a932..25885f7 100644
--- a/hif/inc/hif.h
+++ b/hif/inc/hif.h
@@ -114,9 +114,7 @@
#define CE_COUNT_MAX 12
#define HIF_MAX_GRP_IRQ 16
-#ifdef CONFIG_WIN
-#define HIF_MAX_GROUP 12
-#else
+#ifndef HIF_MAX_GROUP
#define HIF_MAX_GROUP 8
#endif
@@ -866,6 +864,10 @@
struct hif_pm_runtime_lock *lock);
int hif_pm_runtime_prevent_suspend_timeout(struct hif_opaque_softc *ol_sc,
struct hif_pm_runtime_lock *lock, unsigned int delay);
+bool hif_pm_runtime_is_suspended(struct hif_opaque_softc *hif_ctx);
+int hif_pm_runtime_get_monitor_wake_intr(struct hif_opaque_softc *hif_ctx);
+void hif_pm_runtime_set_monitor_wake_intr(struct hif_opaque_softc *hif_ctx,
+ int val);
#else
struct hif_pm_runtime_lock {
const char *name;
@@ -900,6 +902,14 @@
hif_pm_runtime_prevent_suspend_timeout(struct hif_opaque_softc *ol_sc,
struct hif_pm_runtime_lock *lock, unsigned int delay)
{ return 0; }
+static inline bool hif_pm_runtime_is_suspended(struct hif_opaque_softc *hif_ctx)
+{ return false; }
+static inline int
+hif_pm_runtime_get_monitor_wake_intr(struct hif_opaque_softc *hif_ctx)
+{ return 0; }
+static inline void
+hif_pm_runtime_set_monitor_wake_intr(struct hif_opaque_softc *hif_ctx, int val)
+{ return; }
#endif
void hif_enable_power_management(struct hif_opaque_softc *hif_ctx,
diff --git a/hif/src/ce/ce_internal.h b/hif/src/ce/ce_internal.h
index ca62f31..b7fb7f9 100644
--- a/hif/src/ce/ce_internal.h
+++ b/hif/src/ce/ce_internal.h
@@ -380,6 +380,18 @@
};
/**
+ * union ce_srng_desc - unified data type for ce srng descriptors
+ * @src_desc: ce srng Source ring descriptor
+ * @dest_desc: ce srng destination ring descriptor
+ * @dest_status_desc: ce srng status ring descriptor
+ */
+union ce_srng_desc {
+ struct ce_srng_src_desc src_desc;
+ struct ce_srng_dest_desc dest_desc;
+ struct ce_srng_dest_status_desc dest_status_desc;
+};
+
+/**
* enum hif_ce_event_type - HIF copy engine event type
* @HIF_RX_DESC_POST: event recorded before updating write index of RX ring.
* @HIF_RX_DESC_COMPLETION: event recorded before updating sw index of RX ring.
@@ -408,6 +420,13 @@
* @NAPI_POLL_ENTER: records the start of the napi poll function
* @NAPI_COMPLETE: records when interrupts are reenabled
* @NAPI_POLL_EXIT: records when the napi poll function returns
+ * @HIF_RX_NBUF_ALLOC_FAILURE: record the packet when nbuf fails to allocate
+ * @HIF_RX_NBUF_MAP_FAILURE: record the packet when dma map fails
+ * @HIF_RX_NBUF_ENQUEUE_FAILURE: record the packet when enqueue to ce fails
+ * @HIF_CE_SRC_RING_BUFFER_POST: record the packet when buffer is posted to ce src ring
+ * @HIF_CE_DEST_RING_BUFFER_POST: record the packet when buffer is posted to ce dst ring
+ * @HIF_CE_DEST_RING_BUFFER_REAP: record the packet when buffer is reaped from ce dst ring
+ * @HIF_CE_DEST_STATUS_RING_REAP: record the packet when status ring is reaped
*/
enum hif_ce_event_type {
HIF_RX_DESC_POST,
@@ -437,6 +456,11 @@
HIF_RX_NBUF_ALLOC_FAILURE = 0x20,
HIF_RX_NBUF_MAP_FAILURE,
HIF_RX_NBUF_ENQUEUE_FAILURE,
+
+ HIF_CE_SRC_RING_BUFFER_POST,
+ HIF_CE_DEST_RING_BUFFER_POST,
+ HIF_CE_DEST_RING_BUFFER_REAP,
+ HIF_CE_DEST_STATUS_RING_REAP,
};
void ce_init_ce_desc_event_log(struct hif_softc *scn, int ce_id, int size);
@@ -513,10 +537,6 @@
*/
int hif_get_wake_ce_id(struct hif_softc *scn, uint8_t *ce_id);
-/*
- * Note: For MCL, #if defined (HIF_CONFIG_SLUB_DEBUG_ON) needs to be checked
- * for defined here
- */
#if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF)
#ifndef HIF_CE_HISTORY_MAX
@@ -524,10 +544,13 @@
#endif
#define CE_DEBUG_MAX_DATA_BUF_SIZE 64
+
/**
* struct hif_ce_desc_event - structure for detailing a ce event
* @type: what the event was
* @time: when it happened
+ * @current_hp: holds the current ring hp value
+ * @current_tp: holds the current ring tp value
* @descriptor: descriptor enqueued or dequeued
* @memory: virtual address that was used
* @index: location of the descriptor in the ce ring;
@@ -535,19 +558,77 @@
* @actual_data_len: length of the data
*/
struct hif_ce_desc_event {
- uint16_t index;
+ int index;
enum hif_ce_event_type type;
uint64_t time;
+#ifdef HELIUMPLUS
union ce_desc descriptor;
+#else
+ uint32_t current_hp;
+ uint32_t current_tp;
+ union ce_srng_desc descriptor;
+#endif
void *memory;
#ifdef HIF_CE_DEBUG_DATA_BUF
uint8_t *data;
size_t actual_data_len;
#endif /* HIF_CE_DEBUG_DATA_BUF */
};
+#else
+struct hif_ce_desc_event;
#endif /*#if defined(HIF_CONFIG_SLUB_DEBUG_ON)||defined(HIF_CE_DEBUG_DATA_BUF)*/
+/**
+ * get_next_record_index() - get the next record index
+ * @table_index: atomic index variable to increment
+ * @array_size: array size of the circular buffer
+ *
+ * Increment the atomic index and reserve the value.
+ * Takes care of buffer wrap.
+ * Guaranteed to be thread safe as long as fewer than array_size contexts
+ * try to access the array. If there are more than array_size contexts
+ * trying to access the array, full locking of the recording process would
+ * be needed to have sane logging.
+ */
+int get_next_record_index(qdf_atomic_t *table_index, int array_size);
+
+#if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF)
+/**
+ * hif_record_ce_srng_desc_event() - Record data pointed by the CE descriptor
+ * @scn: structure detailing a ce event
+ * @ce_id: length of the data
+ * @type: event_type
+ * @descriptor: ce src/dest/status ring descriptor
+ * @memory: nbuf
+ * @index: current sw/write index
+ * @len: len of the buffer
+ * @hal_ring: ce hw ring
+ *
+ * Return: None
+ */
+void hif_record_ce_srng_desc_event(struct hif_softc *scn, int ce_id,
+ enum hif_ce_event_type type,
+ union ce_srng_desc *descriptor,
+ void *memory, int index,
+ int len, void *hal_ring);
+#else
+static inline
+void hif_record_ce_srng_desc_event(struct hif_softc *scn, int ce_id,
+ enum hif_ce_event_type type,
+ union ce_srng_desc *descriptor,
+ void *memory, int index,
+ int len, void *hal_ring)
+{
+}
+#endif
#ifdef HIF_CE_DEBUG_DATA_BUF
+/**
+ * hif_ce_desc_data_record() - Record data pointed by the CE descriptor
+ * @event: structure detailing a ce event
+ * @len: length of the data
+ * Return:
+ */
+void hif_ce_desc_data_record(struct hif_ce_desc_event *event, int len);
QDF_STATUS alloc_mem_ce_debug_hist_data(struct hif_softc *scn, uint32_t ce_id);
void free_mem_ce_debug_hist_data(struct hif_softc *scn, uint32_t ce_id);
#else
@@ -559,6 +640,11 @@
static inline
void free_mem_ce_debug_hist_data(struct hif_softc *scn, uint32_t ce_id) { }
+
+static inline
+void hif_ce_desc_data_record(struct hif_ce_desc_event *event, int len)
+{
+}
#endif /*HIF_CE_DEBUG_DATA_BUF*/
#ifdef HIF_CONFIG_SLUB_DEBUG_ON
diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c
index 56e2255..94ee185 100644
--- a/hif/src/ce/ce_main.c
+++ b/hif/src/ce/ce_main.c
@@ -1279,7 +1279,7 @@
}
#endif /* HIF_CE_DEBUG_DATA_BUF */
-#if defined(CONFIG_MCL)
+#ifndef HIF_CE_DEBUG_DATA_DYNAMIC_BUF
#if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF)
struct hif_ce_desc_event hif_ce_desc_history[CE_COUNT_MAX][HIF_CE_HISTORY_MAX];
@@ -1336,7 +1336,7 @@
static inline void
free_mem_ce_debug_history(struct hif_softc *scn, unsigned int CE_id) { }
#endif /* (HIF_CONFIG_SLUB_DEBUG_ON) || (HIF_CE_DEBUG_DATA_BUF) */
-#elif defined(CONFIG_WIN)
+#else
#if defined(HIF_CE_DEBUG_DATA_BUF)
static QDF_STATUS
@@ -1385,7 +1385,7 @@
static inline void
free_mem_ce_debug_history(struct hif_softc *scn, unsigned int CE_id) { }
#endif /* HIF_CE_DEBUG_DATA_BUF */
-#endif /* CONFIG_MCL */
+#endif /* HIF_CE_DEBUG_DATA_DYNAMIC_BUF */
#if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF)
/**
diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c
index 6dadc18..024d66c 100644
--- a/hif/src/ce/ce_service.c
+++ b/hif/src/ce/ce_service.c
@@ -92,19 +92,7 @@
static const char *ce_event_type_to_str(enum hif_ce_event_type type);
-/**
- * get_next_record_index() - get the next record index
- * @table_index: atomic index variable to increment
- * @array_size: array size of the circular buffer
- *
- * Increment the atomic index and reserve the value.
- * Takes care of buffer wrap.
- * Guaranteed to be thread safe as long as fewer than array_size contexts
- * try to access the array. If there are more than array_size contexts
- * trying to access the array, full locking of the recording process would
- * be needed to have sane logging.
- */
-static int get_next_record_index(qdf_atomic_t *table_index, int array_size)
+int get_next_record_index(qdf_atomic_t *table_index, int array_size)
{
int record_index = qdf_atomic_inc_return(table_index);
@@ -113,17 +101,11 @@
while (record_index >= array_size)
record_index -= array_size;
+
return record_index;
}
#ifdef HIF_CE_DEBUG_DATA_BUF
-/**
- * hif_ce_desc_data_record() - Record data pointed by the CE descriptor
- * @event: structure detailing a ce event
- * @len: length of the data
- * Return:
- */
-static inline
void hif_ce_desc_data_record(struct hif_ce_desc_event *event, int len)
{
uint8_t *data = NULL;
@@ -146,12 +128,7 @@
event->actual_data_len = len;
}
}
-#else
-static inline
-void hif_ce_desc_data_record(struct hif_ce_desc_event *event, int len)
-{
-}
-#endif /* HIF_CE_DEBUG_DATA_BUF */
+#endif
/**
* hif_record_ce_desc_event() - record ce descriptor events
@@ -193,14 +170,14 @@
event = &hist_ev[record_index];
+ qdf_mem_zero(event, sizeof(struct hif_ce_desc_event));
+
event->type = type;
event->time = qdf_get_log_timestamp();
- if (descriptor) {
- qdf_mem_copy(&event->descriptor, descriptor, sizeof(union ce_desc));
- } else {
- qdf_mem_zero(&event->descriptor, sizeof(union ce_desc));
- }
+ if (descriptor)
+ qdf_mem_copy(&event->descriptor, descriptor,
+ sizeof(union ce_desc));
event->memory = memory;
event->index = index;
diff --git a/hif/src/ce/ce_service_legacy.c b/hif/src/ce/ce_service_legacy.c
index 2651872..2a473b6 100644
--- a/hif/src/ce/ce_service_legacy.c
+++ b/hif/src/ce/ce_service_legacy.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -748,9 +748,11 @@
dest_ring->per_transfer_context[write_index] =
per_recv_context;
- hif_record_ce_desc_event(scn, CE_state->id, HIF_RX_DESC_POST,
- (union ce_desc *)dest_desc, per_recv_context,
- write_index, 0);
+ hif_record_ce_desc_event(scn, CE_state->id,
+ HIF_RX_DESC_POST,
+ (union ce_desc *)dest_desc,
+ per_recv_context,
+ write_index, 0);
/* Update Destination Ring Write Index */
write_index = CE_RING_IDX_INCR(nentries_mask, write_index);
diff --git a/hif/src/ce/ce_service_srng.c b/hif/src/ce/ce_service_srng.c
index a6d0d63..18593b1 100644
--- a/hif/src/ce/ce_service_srng.c
+++ b/hif/src/ce/ce_service_srng.c
@@ -15,8 +15,6 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
-
-#include "hif.h"
#include "hif_io32.h"
#include "reg_struct.h"
#include "ce_api.h"
@@ -30,6 +28,7 @@
#include "hal_api.h"
#include "pld_common.h"
#include "qdf_module.h"
+#include "hif.h"
/*
* Support for Copy Engine hardware, which is mainly used for
@@ -78,6 +77,58 @@
(uint32_t)(((dma_addr) >> 32) & 0xFF);\
} while (0)
+#if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF)
+void hif_record_ce_srng_desc_event(struct hif_softc *scn, int ce_id,
+ enum hif_ce_event_type type,
+ union ce_srng_desc *descriptor,
+ void *memory, int index,
+ int len, void *hal_ring)
+{
+ int record_index;
+ struct hif_ce_desc_event *event;
+ struct ce_desc_hist *ce_hist = &scn->hif_ce_desc_hist;
+ struct hif_ce_desc_event *hist_ev = NULL;
+
+ if (ce_id < CE_COUNT_MAX)
+ hist_ev = (struct hif_ce_desc_event *)ce_hist->hist_ev[ce_id];
+ else
+ return;
+
+ if (ce_id >= CE_COUNT_MAX)
+ return;
+
+ if (!ce_hist->enable[ce_id])
+ return;
+
+ if (!hist_ev)
+ return;
+
+ record_index = get_next_record_index(
+ &ce_hist->history_index[ce_id], HIF_CE_HISTORY_MAX);
+
+ event = &hist_ev[record_index];
+
+ qdf_mem_zero(event, sizeof(struct hif_ce_desc_event));
+
+ event->type = type;
+ event->time = qdf_get_log_timestamp();
+
+ if (descriptor)
+ qdf_mem_copy(&event->descriptor, descriptor,
+ hal_get_entrysize_from_srng(hal_ring));
+
+ if (hal_ring)
+ hal_get_sw_hptp(scn->hal_soc, hal_ring, &event->current_tp,
+ &event->current_hp);
+
+ event->memory = memory;
+ event->index = index;
+
+ if (ce_hist->data_enable[ce_id])
+ hif_ce_desc_data_record(event, len);
+}
+#endif
+
static int
ce_send_nolock_srng(struct CE_handle *copyeng,
void *per_transfer_context,
@@ -104,7 +155,7 @@
return QDF_STATUS_E_FAILURE;
}
{
- enum hif_ce_event_type event_type = HIF_TX_GATHER_DESC_POST;
+ enum hif_ce_event_type event_type = HIF_CE_SRC_RING_BUFFER_POST;
struct ce_srng_src_desc *src_desc;
if (hal_srng_access_start(scn->hal_soc, src_ring->srng_ctx)) {
@@ -148,9 +199,11 @@
/* src_ring->write index hasn't been updated event though
* the register has allready been written to.
*/
- hif_record_ce_desc_event(scn, CE_state->id, event_type,
- (union ce_desc *) src_desc, per_transfer_context,
- src_ring->write_index, nbytes);
+ hif_record_ce_srng_desc_event(scn, CE_state->id, event_type,
+ (union ce_srng_desc *)src_desc,
+ per_transfer_context,
+ src_ring->write_index, nbytes,
+ src_ring->srng_ctx);
src_ring->write_index = write_index;
status = QDF_STATUS_SUCCESS;
@@ -252,6 +305,7 @@
unsigned int sw_index;
uint64_t dma_addr = buffer;
struct hif_softc *scn = CE_state->scn;
+ struct ce_srng_dest_desc *dest_desc;
qdf_spin_lock_bh(&CE_state->ce_index_lock);
write_index = dest_ring->write_index;
@@ -269,9 +323,8 @@
if ((hal_srng_src_num_avail(scn->hal_soc,
dest_ring->srng_ctx, false) > 0)) {
- struct ce_srng_dest_desc *dest_desc =
- hal_srng_src_get_next(scn->hal_soc,
- dest_ring->srng_ctx);
+ dest_desc = hal_srng_src_get_next(scn->hal_soc,
+ dest_ring->srng_ctx);
if (!dest_desc) {
status = QDF_STATUS_E_FAILURE;
@@ -292,6 +345,13 @@
dest_ring->write_index = write_index;
hal_srng_access_end(scn->hal_soc, dest_ring->srng_ctx);
+ hif_record_ce_srng_desc_event(scn, CE_state->id,
+ HIF_CE_DEST_RING_BUFFER_POST,
+ (union ce_srng_desc *)dest_desc,
+ per_recv_context,
+ dest_ring->write_index, 0,
+ dest_ring->srng_ctx);
+
Q_TARGET_ACCESS_END(scn);
qdf_spin_unlock_bh(&CE_state->ce_index_lock);
return status;
@@ -412,6 +472,23 @@
done:
hal_srng_access_end(scn->hal_soc, status_ring->srng_ctx);
+ if (status == QDF_STATUS_SUCCESS) {
+ hif_record_ce_srng_desc_event(scn, CE_state->id,
+ HIF_CE_DEST_RING_BUFFER_REAP,
+ NULL,
+ dest_ring->
+ per_transfer_context[sw_index],
+ dest_ring->sw_index, nbytes,
+ dest_ring->srng_ctx);
+
+ hif_record_ce_srng_desc_event(scn, CE_state->id,
+ HIF_CE_DEST_STATUS_RING_REAP,
+ (union ce_srng_desc *)dest_status,
+ NULL,
+ -1, 0,
+ status_ring->srng_ctx);
+ }
+
return status;
}
@@ -482,11 +559,13 @@
src_desc = hal_srng_src_reap_next(scn->hal_soc, src_ring->srng_ctx);
if (src_desc) {
- hif_record_ce_desc_event(scn, CE_state->id,
- HIF_TX_DESC_COMPLETION,
- (union ce_desc *)src_desc,
- src_ring->per_transfer_context[swi],
- swi, src_desc->nbytes);
+ hif_record_ce_srng_desc_event(scn, CE_state->id,
+ HIF_TX_DESC_COMPLETION,
+ (union ce_srng_desc *)src_desc,
+ src_ring->
+ per_transfer_context[swi],
+ swi, src_desc->nbytes,
+ src_ring->srng_ctx);
/* Return data from completed source descriptor */
*bufferp = (qdf_dma_addr_t)
diff --git a/hif/src/ce/ce_tasklet.c b/hif/src/ce/ce_tasklet.c
index 414343a..9a5b615 100644
--- a/hif/src/ce/ce_tasklet.c
+++ b/hif/src/ce/ce_tasklet.c
@@ -154,7 +154,7 @@
struct CE_state *CE_state = scn->ce_id_to_state[tasklet_entry->ce_id];
hif_record_ce_desc_event(scn, tasklet_entry->ce_id,
- HIF_CE_TASKLET_ENTRY, NULL, NULL, 0, 0);
+ HIF_CE_TASKLET_ENTRY, NULL, NULL, -1, 0);
if (qdf_atomic_read(&scn->link_suspended)) {
HIF_ERROR("%s: ce %d tasklet fired after link suspend.",
@@ -171,7 +171,7 @@
* any of the Copy Engine pipes.
*/
hif_record_ce_desc_event(scn, tasklet_entry->ce_id,
- HIF_CE_TASKLET_RESCHEDULE, NULL, NULL, 0, 0);
+ HIF_CE_TASKLET_RESCHEDULE, NULL, NULL, -1, 0);
ce_schedule_tasklet(tasklet_entry);
return;
@@ -181,7 +181,7 @@
hif_irq_enable(scn, tasklet_entry->ce_id);
hif_record_ce_desc_event(scn, tasklet_entry->ce_id, HIF_CE_TASKLET_EXIT,
- NULL, NULL, 0, 0);
+ NULL, NULL, -1, 0);
qdf_atomic_dec(&scn->active_tasklet_cnt);
}
diff --git a/hif/src/hif_exec.c b/hif/src/hif_exec.c
index 944d5a8..339359b 100644
--- a/hif/src/hif_exec.c
+++ b/hif/src/hif_exec.c
@@ -53,7 +53,7 @@
struct hif_event_record *record;
int record_index;
- if (!event)
+ if (!hif_state->hif_num_extgroup)
return;
if (scn->event_disable_mask & BIT(event->type))
diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c
index 3f1a717..305da89 100644
--- a/hif/src/hif_main.c
+++ b/hif/src/hif_main.c
@@ -816,6 +816,8 @@
case QCN7605_DEVICE_ID:
case QCN7605_COMPOSITE:
case QCN7605_STANDALONE:
+ case QCN7605_STANDALONE_V2:
+ case QCN7605_COMPOSITE_V2:
*hif_type = HIF_TYPE_QCN7605;
*target_type = TARGET_TYPE_QCN7605;
HIF_INFO(" *********** QCN7605 *************\n");
@@ -1273,7 +1275,11 @@
if (scn->initial_wakeup_cb)
scn->initial_wakeup_cb(scn->initial_wakeup_priv);
- hif_pm_runtime_request_resume(hif_ctx);
+ if (hif_pm_runtime_get_monitor_wake_intr(hif_ctx) &&
+ hif_pm_runtime_is_suspended(hif_ctx)) {
+ hif_pm_runtime_set_monitor_wake_intr(hif_ctx, 0);
+ hif_pm_runtime_request_resume(hif_ctx);
+ }
return IRQ_HANDLED;
}
diff --git a/hif/src/hif_main.h b/hif/src/hif_main.h
index 0a26d39..02fab8e 100644
--- a/hif/src/hif_main.h
+++ b/hif/src/hif_main.h
@@ -98,8 +98,10 @@
#define QCA6018_DEVICE_ID (0xfffd) /* Todo: replace this with actual number */
/* Genoa */
#define QCN7605_DEVICE_ID (0x1102) /* Genoa PCIe device ID*/
-#define QCN7605_COMPOSITE (0x9900)
-#define QCN7605_STANDALONE (0x9901)
+#define QCN7605_COMPOSITE (0x9901)
+#define QCN7605_STANDALONE (0x9900)
+#define QCN7605_STANDALONE_V2 (0x9902)
+#define QCN7605_COMPOSITE_V2 (0x9903)
#define RUMIM2M_DEVICE_ID_NODE0 0xabc0
#define RUMIM2M_DEVICE_ID_NODE1 0xabc1
diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c
index 43ef8e2..b762cfe 100644
--- a/hif/src/pcie/if_pci.c
+++ b/hif/src/pcie/if_pci.c
@@ -2799,6 +2799,7 @@
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
hif_runtime_pm_set_state_suspended(scn);
+ hif_pm_runtime_set_monitor_wake_intr(hif_ctx, 1);
hif_log_runtime_suspend_success(scn);
}
@@ -2811,6 +2812,7 @@
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
+ hif_pm_runtime_set_monitor_wake_intr(hif_ctx, 0);
hif_runtime_pm_set_state_inprogress(scn);
}
@@ -4358,6 +4360,54 @@
qdf_mem_free(context);
}
+
+/**
+ * hif_pm_runtime_is_suspended() - API to check if driver has runtime suspended
+ * @hif_ctx: HIF context
+ *
+ * Return: true for runtime suspended, otherwise false
+ */
+bool hif_pm_runtime_is_suspended(struct hif_opaque_softc *hif_ctx)
+{
+ struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(hif_ctx);
+
+ return qdf_atomic_read(&sc->pm_state) ==
+ HIF_PM_RUNTIME_STATE_SUSPENDED;
+}
+
+/**
+ * hif_pm_runtime_get_monitor_wake_intr() - API to get monitor_wake_intr
+ * @hif_ctx: HIF context
+ *
+ * monitor_wake_intr variable can be used to indicate if driver expects wake
+ * MSI for runtime PM
+ *
+ * Return: monitor_wake_intr variable
+ */
+int hif_pm_runtime_get_monitor_wake_intr(struct hif_opaque_softc *hif_ctx)
+{
+ struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(hif_ctx);
+
+ return qdf_atomic_read(&sc->monitor_wake_intr);
+}
+
+/**
+ * hif_pm_runtime_set_monitor_wake_intr() - API to set monitor_wake_intr
+ * @hif_ctx: HIF context
+ * @val: value to set
+ *
+ * monitor_wake_intr variable can be used to indicate if driver expects wake
+ * MSI for runtime PM
+ *
+ * Return: void
+ */
+void hif_pm_runtime_set_monitor_wake_intr(struct hif_opaque_softc *hif_ctx,
+ int val)
+{
+ struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(hif_ctx);
+
+ qdf_atomic_set(&sc->monitor_wake_intr, val);
+}
#endif /* FEATURE_RUNTIME_PM */
int hif_pci_legacy_map_ce_to_irq(struct hif_softc *scn, int ce_id)
diff --git a/hif/src/pcie/if_pci.h b/hif/src/pcie/if_pci.h
index 19cc503..6dbb9d2 100644
--- a/hif/src/pcie/if_pci.h
+++ b/hif/src/pcie/if_pci.h
@@ -130,6 +130,7 @@
uint32_t lcr_val;
#ifdef FEATURE_RUNTIME_PM
atomic_t pm_state;
+ atomic_t monitor_wake_intr;
uint32_t prevent_suspend_cnt;
struct hif_pci_pm_stats pm_stats;
struct work_struct pm_work;
diff --git a/htc/htc_recv.c b/htc/htc_recv.c
index ce09ee0..2d6047d 100644
--- a/htc/htc_recv.c
+++ b/htc/htc_recv.c
@@ -229,10 +229,6 @@
}
#endif
-#ifdef CONFIG_WIN
-#define HTC_MSG_NACK_SUSPEND 7
-#endif
-
QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf,
uint8_t pipeID)
{
diff --git a/htc/htc_send.c b/htc/htc_send.c
index 57106b7..2a7b81c 100644
--- a/htc/htc_send.c
+++ b/htc/htc_send.c
@@ -334,9 +334,36 @@
pEndpoint->UL_PipeID,
pEndpoint->Id, data_len,
bundleBuf, data_attr);
- if (status != QDF_STATUS_SUCCESS) {
- qdf_print("%s:hif_send_head failed(len=%zu).", __func__,
- data_len);
+ if (qdf_unlikely(QDF_IS_STATUS_ERROR(status))) {
+ HTC_PACKET_QUEUE requeue;
+
+ qdf_print("hif_send_head failed(len=%zu).", data_len);
+ INIT_HTC_PACKET_QUEUE(&requeue);
+ LOCK_HTC_TX(target);
+ pEndpoint->ul_outstanding_cnt--;
+ HTC_PACKET_REMOVE(&pEndpoint->TxLookupQueue, pPacketTx);
+
+ if (pPacketTx->PktInfo.AsTx.Tag == HTC_TX_PACKET_TAG_BUNDLED) {
+ HTC_PACKET *temp_packet;
+ HTC_PACKET_QUEUE *packet_queue =
+ (HTC_PACKET_QUEUE *)pPacketTx->pContext;
+
+ HTC_PACKET_QUEUE_ITERATE_ALLOW_REMOVE(packet_queue,
+ temp_packet) {
+ HTC_PACKET_ENQUEUE(&requeue, temp_packet);
+ } HTC_PACKET_QUEUE_ITERATE_END;
+
+ UNLOCK_HTC_TX(target);
+ free_htc_bundle_packet(target, pPacketTx);
+ LOCK_HTC_TX(target);
+
+ } else {
+ HTC_PACKET_ENQUEUE(&requeue, pPacketTx);
+ }
+
+ HTC_PACKET_QUEUE_TRANSFER_TO_HEAD(&pEndpoint->TxQueue,
+ &requeue);
+ UNLOCK_HTC_TX(target);
}
return status;
}
@@ -1041,8 +1068,10 @@
/* pop off caller's queue */
pPacket = htc_packet_dequeue(pCallersSendQueue);
A_ASSERT(pPacket);
- /* insert into local queue */
- HTC_PACKET_ENQUEUE(&sendQueue, pPacket);
+ if (pPacket)
+ /* insert into local queue */
+ HTC_PACKET_ENQUEUE(&sendQueue,
+ pPacket);
}
/* the caller's queue has all the packets that won't fit
diff --git a/os_if/linux/scan/src/wlan_cfg80211_scan.c b/os_if/linux/scan/src/wlan_cfg80211_scan.c
index 441641b..d29bf5e 100644
--- a/os_if/linux/scan/src/wlan_cfg80211_scan.c
+++ b/os_if/linux/scan/src/wlan_cfg80211_scan.c
@@ -1306,11 +1306,13 @@
}
/*
- * If a scan is already going on i.e the qdf_list ( scan que) is not
- * empty, and the simultaneous scan is disabled, dont allow 2nd scan
+ * For a non-SAP vdevs, if a scan is already going on i.e the scan queue
+ * is not empty, and the simultaneous scan is disabled, dont allow 2nd
+ * scan.
*/
if (!wlan_cfg80211_allow_simultaneous_scan(psoc) &&
- !qdf_list_empty(&osif_priv->osif_scan->scan_req_q)) {
+ !qdf_list_empty(&osif_priv->osif_scan->scan_req_q) &&
+ wlan_vdev_mlme_get_opmode(vdev) != QDF_SAP_MODE) {
osif_err("Simultaneous scan disabled, reject scan");
return -EBUSY;
}
diff --git a/os_if/linux/spectral/inc/os_if_spectral_netlink.h b/os_if/linux/spectral/inc/os_if_spectral_netlink.h
index b94815c..156eaac 100644
--- a/os_if/linux/spectral/inc/os_if_spectral_netlink.h
+++ b/os_if/linux/spectral/inc/os_if_spectral_netlink.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011, 2017-2019 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -56,12 +56,16 @@
/**
* os_if_spectral_prep_skb() - Prepare socket buffer
* @pdev : Pointer to pdev
+ * @smsg_type: Spectral scan message type
+ * @buf_type: Spectral report buffer type
*
* Prepare socket buffer to send the data to application layer
*
* Return: NLMSG_DATA of the created skb or NULL if no memory
*/
-void *os_if_spectral_prep_skb(struct wlan_objmgr_pdev *pdev);
+void *os_if_spectral_prep_skb(struct wlan_objmgr_pdev *pdev,
+ enum spectral_msg_type smsg_type,
+ enum spectral_msg_buf_type buf_type);
/**
* os_if_spectral_netlink_deinit() - De-initialize Spectral Netlink data
diff --git a/os_if/linux/spectral/src/os_if_spectral_netlink.c b/os_if/linux/spectral/src/os_if_spectral_netlink.c
index d345ec7..748a078 100644
--- a/os_if/linux/spectral/src/os_if_spectral_netlink.c
+++ b/os_if/linux/spectral/src/os_if_spectral_netlink.c
@@ -26,6 +26,7 @@
#ifdef CNSS_GENL
#include <net/cnss_nl.h>
#endif
+#include <wlan_cfg80211.h>
/**
* os_if_spectral_remove_nbuf_debug_entry() - Remove nbuf from nbuf debug table
@@ -161,14 +162,14 @@
memset(&cfg, 0, sizeof(cfg));
if (!pdev) {
- spectral_err("PDEV is NULL!");
+ osif_err("PDEV is NULL!");
return -EINVAL;
}
ps = wlan_objmgr_pdev_get_comp_private_obj(pdev,
WLAN_UMAC_COMP_SPECTRAL);
if (!ps) {
- spectral_err("PDEV SPECTRAL object is NULL!");
+ osif_err("PDEV SPECTRAL object is NULL!");
return -EINVAL;
}
os_if_spectral_init_nl_cfg(&cfg);
@@ -177,14 +178,14 @@
os_if_spectral_create_nl_sock(&cfg);
if (!os_if_spectral_nl_sock) {
- spectral_err("NETLINK_KERNEL_CREATE FAILED");
+ osif_err("NETLINK_KERNEL_CREATE FAILED");
return -ENODEV;
}
}
ps->spectral_sock = os_if_spectral_nl_sock;
if (!ps->spectral_sock) {
- spectral_err("ps->spectral_sock is NULL");
+ osif_err("ps->spectral_sock is NULL");
return -ENODEV;
}
atomic_inc(&spectral_nl_users);
@@ -205,14 +206,14 @@
struct pdev_spectral *ps = NULL;
if (!pdev) {
- spectral_err("PDEV is NULL!");
+ osif_err("PDEV is NULL!");
return -EINVAL;
}
ps = wlan_objmgr_pdev_get_comp_private_obj(pdev,
WLAN_UMAC_COMP_SPECTRAL);
if (!ps) {
- spectral_err("PDEV SPECTRAL object is NULL!");
+ osif_err("PDEV SPECTRAL object is NULL!");
return -EINVAL;
}
ps->spectral_sock = NULL;
@@ -238,48 +239,79 @@
#endif
void *
-os_if_spectral_prep_skb(struct wlan_objmgr_pdev *pdev)
+os_if_spectral_prep_skb(struct wlan_objmgr_pdev *pdev,
+ enum spectral_msg_type smsg_type,
+ enum spectral_msg_buf_type buf_type)
{
struct pdev_spectral *ps = NULL;
struct nlmsghdr *spectral_nlh = NULL;
+ void *buf = NULL;
if (!pdev) {
- spectral_err("PDEV is NULL!");
+ osif_err("PDEV is NULL!");
return NULL;
}
+
+ if (smsg_type >= SPECTRAL_MSG_TYPE_MAX) {
+ osif_err("Invalid Spectral message type %u", smsg_type);
+ return NULL;
+ }
+
+ if (buf_type >= SPECTRAL_MSG_BUF_TYPE_MAX) {
+ osif_err("Invalid Spectral message buffer type %u",
+ buf_type);
+ return NULL;
+ }
+
ps = wlan_objmgr_pdev_get_comp_private_obj(pdev,
WLAN_UMAC_COMP_SPECTRAL);
if (!ps) {
- spectral_err("PDEV SPECTRAL object is NULL!");
- return NULL;
- }
- ps->skb = qdf_nbuf_alloc(NULL, MAX_SPECTRAL_PAYLOAD, 0, 0, false);
-
- if (!ps->skb) {
- spectral_err("allocate skb (len=%u) failed",
- MAX_SPECTRAL_PAYLOAD);
+ osif_err("PDEV SPECTRAL object is NULL!");
return NULL;
}
- qdf_nbuf_put_tail(ps->skb, MAX_SPECTRAL_PAYLOAD);
- spectral_nlh = (struct nlmsghdr *)ps->skb->data;
+ if (buf_type == SPECTRAL_MSG_BUF_NEW) {
+ QDF_ASSERT(!ps->skb[smsg_type]);
+ ps->skb[smsg_type] =
+ qdf_nbuf_alloc(NULL, MAX_SPECTRAL_PAYLOAD,
+ 0, 0, false);
- qdf_mem_zero(spectral_nlh, sizeof(*spectral_nlh));
+ if (!ps->skb[smsg_type]) {
+ osif_err("alloc skb (len=%u, msg_type=%u) failed",
+ MAX_SPECTRAL_PAYLOAD, smsg_type);
+ return NULL;
+ }
- /*
- * Possible bug that size of struct spectral_samp_msg and
- * SPECTRAL_MSG differ by 3 bytes so we miss 3 bytes
- */
+ qdf_nbuf_put_tail(ps->skb[smsg_type], MAX_SPECTRAL_PAYLOAD);
+ spectral_nlh = (struct nlmsghdr *)ps->skb[smsg_type]->data;
- spectral_nlh->nlmsg_len = NLMSG_SPACE(sizeof(struct spectral_samp_msg));
- spectral_nlh->nlmsg_pid = 0;
- spectral_nlh->nlmsg_flags = 0;
- spectral_nlh->nlmsg_type = WLAN_NL_MSG_SPECTRAL_SCAN;
+ qdf_mem_zero(spectral_nlh, sizeof(*spectral_nlh));
- qdf_mem_zero(NLMSG_DATA(spectral_nlh),
- sizeof(struct spectral_samp_msg));
- return NLMSG_DATA(spectral_nlh);
+ /*
+ * Possible bug that size of struct spectral_samp_msg and
+ * SPECTRAL_MSG differ by 3 bytes so we miss 3 bytes
+ */
+
+ spectral_nlh->nlmsg_len =
+ NLMSG_SPACE(sizeof(struct spectral_samp_msg));
+ spectral_nlh->nlmsg_pid = 0;
+ spectral_nlh->nlmsg_flags = 0;
+ spectral_nlh->nlmsg_type = WLAN_NL_MSG_SPECTRAL_SCAN;
+
+ qdf_mem_zero(NLMSG_DATA(spectral_nlh),
+ sizeof(struct spectral_samp_msg));
+ buf = NLMSG_DATA(spectral_nlh);
+ } else if (buf_type == SPECTRAL_MSG_BUF_SAVED) {
+ QDF_ASSERT(ps->skb[smsg_type]);
+ spectral_nlh = (struct nlmsghdr *)ps->skb[smsg_type]->data;
+ buf = NLMSG_DATA(spectral_nlh);
+ } else {
+ osif_err("Failed to get spectral report buffer");
+ buf = NULL;
+ }
+
+ return buf;
}
#if (KERNEL_VERSION(2, 6, 31) > LINUX_VERSION_CODE)
@@ -319,91 +351,108 @@
* os_if_spectral_nl_unicast_msg() - Sends unicast Spectral message to user
* space
* @pdev : Pointer to pdev
+ * @smsg_type: Spectral message type
*
* Return: void
*/
#ifndef CNSS_GENL
static int
-os_if_spectral_nl_unicast_msg(struct wlan_objmgr_pdev *pdev)
+os_if_spectral_nl_unicast_msg(struct wlan_objmgr_pdev *pdev,
+ enum spectral_msg_type smsg_type)
{
struct pdev_spectral *ps = NULL;
int status;
if (!pdev) {
- spectral_err("PDEV is NULL!");
+ osif_err("PDEV is NULL!");
+ return -EINVAL;
+ }
+
+ if (smsg_type >= SPECTRAL_MSG_TYPE_MAX) {
+ osif_err("Invalid Spectral message type %u", smsg_type);
return -EINVAL;
}
ps = wlan_objmgr_pdev_get_comp_private_obj(pdev,
WLAN_UMAC_COMP_SPECTRAL);
if (!ps) {
- spectral_err("PDEV SPECTRAL object is NULL!");
+ osif_err("PDEV SPECTRAL object is NULL!");
return -EINVAL;
}
- if (!ps->skb) {
- spectral_err("Socket buffer is null");
+ if (!ps->skb[smsg_type]) {
+ osif_err("Socket buffer is null, msg_type= %u", smsg_type);
return -EINVAL;
}
if (!ps->spectral_sock) {
- spectral_err("Spectral Socket is invalid");
- qdf_nbuf_free(ps->skb);
+ osif_err("Spectral Socket is invalid, msg_type= %u",
+ smsg_type);
+ qdf_nbuf_free(ps->skb[smsg_type]);
+ ps->skb[smsg_type] = NULL;
+
return -EINVAL;
}
- os_if_init_spectral_skb_dst_pid(ps->skb, ps);
+ os_if_init_spectral_skb_dst_pid(ps->skb[smsg_type], ps);
- os_if_init_spectral_skb_pid_portid(ps->skb);
+ os_if_init_spectral_skb_pid_portid(ps->skb[smsg_type]);
/* to mcast group 1<<0 */
- NETLINK_CB(ps->skb).dst_group = 0;
+ NETLINK_CB(ps->skb[smsg_type]).dst_group = 0;
- os_if_spectral_remove_nbuf_debug_entry(ps->skb);
+ os_if_spectral_remove_nbuf_debug_entry(ps->skb[smsg_type]);
status = netlink_unicast(ps->spectral_sock,
- ps->skb,
+ ps->skb[smsg_type],
ps->spectral_pid, MSG_DONTWAIT);
- /* clear the local copy */
- ps->skb = NULL;
+ /* clear the local copy, free would be done by netlink layer */
+ ps->skb[smsg_type] = NULL;
return status;
}
#else
static int
-os_if_spectral_nl_unicast_msg(struct wlan_objmgr_pdev *pdev)
+os_if_spectral_nl_unicast_msg(struct wlan_objmgr_pdev *pdev,
+ enum spectral_msg_type smsg_type)
{
struct pdev_spectral *ps = NULL;
int status;
if (!pdev) {
- spectral_err("PDEV is NULL!");
+ osif_err("PDEV is NULL!");
+ return -EINVAL;
+ }
+
+ if (smsg_type >= SPECTRAL_MSG_TYPE_MAX) {
+ osif_err("Invalid Spectral message type %u", smsg_type);
return -EINVAL;
}
ps = wlan_objmgr_pdev_get_comp_private_obj(pdev,
WLAN_UMAC_COMP_SPECTRAL);
if (!ps) {
- spectral_err("PDEV SPECTRAL object is NULL!");
+ osif_err("PDEV SPECTRAL object is NULL!");
return -EINVAL;
}
- if (!ps->skb) {
- spectral_err("Socket buffer is null");
+ if (!ps->skb[smsg_type]) {
+ osif_err("Socket buffer is null, msg_type= %u", smsg_type);
return -EINVAL;
}
- os_if_init_spectral_skb_pid_portid(ps->skb);
+ os_if_init_spectral_skb_pid_portid(ps->skb[smsg_type]);
- os_if_spectral_remove_nbuf_debug_entry(ps->skb);
- status = nl_srv_ucast(ps->skb, ps->spectral_pid, MSG_DONTWAIT,
- WLAN_NL_MSG_SPECTRAL_SCAN, CLD80211_MCGRP_OEM_MSGS);
+ os_if_spectral_remove_nbuf_debug_entry(ps->skb[smsg_type]);
+ status = nl_srv_ucast(ps->skb[smsg_type], ps->spectral_pid,
+ MSG_DONTWAIT, WLAN_NL_MSG_SPECTRAL_SCAN,
+ CLD80211_MCGRP_OEM_MSGS);
if (status < 0)
- spectral_err("failed to send to spectral scan app");
+ osif_err("failed to send to spectral scan app");
- /* clear the local copy */
- ps->skb = NULL;
+ /* clear the local copy, free would be done by netlink layer */
+ ps->skb[smsg_type] = NULL;
return status;
}
@@ -414,11 +463,13 @@
* os_if_spectral_nl_bcast_msg() - Sends broadcast Spectral message to user
* space
* @pdev : Pointer to pdev
+ * @smsg_type: Spectral message type
*
* Return: void
*/
static int
-os_if_spectral_nl_bcast_msg(struct wlan_objmgr_pdev *pdev)
+os_if_spectral_nl_bcast_msg(struct wlan_objmgr_pdev *pdev,
+ enum spectral_msg_type smsg_type)
{
#if (KERNEL_VERSION(2, 6, 31) >= LINUX_VERSION_CODE)
fd_set write_set;
@@ -431,34 +482,42 @@
#endif
if (!pdev) {
- spectral_err("PDEV is NULL!");
+ osif_err("PDEV is NULL!");
return -EINVAL;
}
+
+ if (smsg_type >= SPECTRAL_MSG_TYPE_MAX) {
+ osif_err("Invalid Spectral message type %u", smsg_type);
+ return -EINVAL;
+ }
+
ps = wlan_objmgr_pdev_get_comp_private_obj(pdev,
WLAN_UMAC_COMP_SPECTRAL);
if (!ps) {
- spectral_err("PDEV SPECTRAL object is NULL!");
+ osif_err("PDEV SPECTRAL object is NULL!");
return -EINVAL;
}
- if (!ps->skb) {
- spectral_err("Socket buffer is null");
+ if (!ps->skb[smsg_type]) {
+ osif_err("Socket buffer is null, msg_type= %u", smsg_type);
return -EINVAL;
}
if (!ps->spectral_sock) {
- qdf_nbuf_free(ps->skb);
+ qdf_nbuf_free(ps->skb[smsg_type]);
+ ps->skb[smsg_type] = NULL;
+
return -EINVAL;
}
- os_if_spectral_remove_nbuf_debug_entry(ps->skb);
+ os_if_spectral_remove_nbuf_debug_entry(ps->skb[smsg_type]);
status = netlink_broadcast(ps->spectral_sock,
- ps->skb,
+ ps->skb[smsg_type],
0, 1, GFP_ATOMIC);
- /* clear the local copy */
- ps->skb = NULL;
+ /* clear the local copy, free would be done by netlink layer */
+ ps->skb[smsg_type] = NULL;
return status;
}
@@ -467,36 +526,44 @@
* os_if_spectral_free_skb() - Free spectral SAMP message skb
*
* @pdev : Pointer to pdev
+ * @smsg_type: Spectral message type
*
* Return: void
*/
static void
-os_if_spectral_free_skb(struct wlan_objmgr_pdev *pdev)
+os_if_spectral_free_skb(struct wlan_objmgr_pdev *pdev,
+ enum spectral_msg_type smsg_type)
{
struct pdev_spectral *ps = NULL;
if (!pdev) {
- spectral_err("PDEV is NULL!");
+ osif_err("PDEV is NULL!");
return;
}
+
+ if (smsg_type >= SPECTRAL_MSG_TYPE_MAX) {
+ osif_err("Invalid Spectral message type %u", smsg_type);
+ return;
+ }
+
ps = wlan_objmgr_pdev_get_comp_private_obj(pdev,
WLAN_UMAC_COMP_SPECTRAL);
if (!ps) {
- spectral_err("PDEV SPECTRAL object is NULL!");
+ osif_err("PDEV SPECTRAL object is NULL!");
return;
}
- if (!ps->skb) {
- spectral_err("Socket buffer is null");
+ if (!ps->skb[smsg_type]) {
+ osif_info("Socket buffer is null, msg_type= %u", smsg_type);
return;
}
/* Free buffer */
- qdf_nbuf_free(ps->skb);
+ qdf_nbuf_free(ps->skb[smsg_type]);
/* clear the local copy */
- ps->skb = NULL;
+ ps->skb[smsg_type] = NULL;
}
qdf_export_symbol(os_if_spectral_free_skb);
@@ -508,24 +575,24 @@
struct spectral_context *sptrl_ctx;
if (!pdev) {
- spectral_err("PDEV is NULL!");
+ osif_err("PDEV is NULL!");
return;
}
sptrl_ctx = spectral_get_spectral_ctx_from_pdev(pdev);
if (!sptrl_ctx) {
- spectral_err("Spectral context is NULL!");
+ osif_err("Spectral context is NULL!");
return;
}
os_if_spectral_init_nl(pdev);
/* Register Netlink handlers */
- nl_cb.get_nbuff = os_if_spectral_prep_skb;
+ nl_cb.get_sbuff = os_if_spectral_prep_skb;
nl_cb.send_nl_bcast = os_if_spectral_nl_bcast_msg;
nl_cb.send_nl_unicast = os_if_spectral_nl_unicast_msg;
- nl_cb.free_nbuff = os_if_spectral_free_skb;
+ nl_cb.free_sbuff = os_if_spectral_free_skb;
if (sptrl_ctx->sptrlc_register_netlink_cb)
sptrl_ctx->sptrlc_register_netlink_cb(pdev, &nl_cb);
@@ -535,20 +602,22 @@
void os_if_spectral_netlink_deinit(struct wlan_objmgr_pdev *pdev)
{
struct spectral_context *sptrl_ctx;
+ enum spectral_msg_type msg_type = SPECTRAL_MSG_NORMAL_MODE;
if (!pdev) {
- spectral_err("PDEV is NULL!");
+ osif_err("PDEV is NULL!");
return;
}
sptrl_ctx = spectral_get_spectral_ctx_from_pdev(pdev);
if (!sptrl_ctx) {
- spectral_err("Spectral context is NULL!");
+ osif_err("Spectral context is NULL!");
return;
}
- os_if_spectral_free_skb(pdev);
+ for (; msg_type < SPECTRAL_MSG_TYPE_MAX; msg_type++)
+ os_if_spectral_free_skb(pdev, msg_type);
if (sptrl_ctx->sptrlc_deregister_netlink_cb)
sptrl_ctx->sptrlc_deregister_netlink_cb(pdev);
diff --git a/qdf/inc/qdf_mem.h b/qdf/inc/qdf_mem.h
index 8615524..4cc1642 100644
--- a/qdf/inc/qdf_mem.h
+++ b/qdf/inc/qdf_mem.h
@@ -128,6 +128,28 @@
#define qdf_mem_free(ptr) \
qdf_mem_free_debug(ptr, __func__, __LINE__)
+void qdf_mem_multi_pages_alloc_debug(qdf_device_t osdev,
+ struct qdf_mem_multi_page_t *pages,
+ size_t element_size, uint16_t element_num,
+ qdf_dma_context_t memctxt, bool cacheable,
+ const char *func, uint32_t line,
+ void *caller);
+
+#define qdf_mem_multi_pages_alloc(osdev, pages, element_size, element_num,\
+ memctxt, cacheable) \
+ qdf_mem_multi_pages_alloc_debug(osdev, pages, element_size, \
+ element_num, memctxt, cacheable, \
+ __func__, __LINE__, QDF_RET_IP)
+
+void qdf_mem_multi_pages_free_debug(qdf_device_t osdev,
+ struct qdf_mem_multi_page_t *pages,
+ qdf_dma_context_t memctxt, bool cacheable,
+ const char *func, uint32_t line);
+
+#define qdf_mem_multi_pages_free(osdev, pages, memctxt, cacheable) \
+ qdf_mem_multi_pages_free_debug(osdev, pages, memctxt, cacheable, \
+ __func__, __LINE__)
+
/**
* qdf_mem_check_for_leaks() - Assert that the current memory domain is empty
*
@@ -257,6 +279,15 @@
qdf_size_t size, void *vaddr,
qdf_dma_addr_t paddr, qdf_dma_context_t memctx);
+void qdf_mem_multi_pages_alloc(qdf_device_t osdev,
+ struct qdf_mem_multi_page_t *pages,
+ size_t element_size, uint16_t element_num,
+ qdf_dma_context_t memctxt, bool cacheable);
+
+void qdf_mem_multi_pages_free(qdf_device_t osdev,
+ struct qdf_mem_multi_page_t *pages,
+ qdf_dma_context_t memctxt, bool cacheable);
+
#endif /* MEMORY_DEBUG */
/**
@@ -504,13 +535,6 @@
qdf_size_t size,
__dma_data_direction direction);
-void qdf_mem_multi_pages_alloc(qdf_device_t osdev,
- struct qdf_mem_multi_page_t *pages,
- size_t element_size, uint16_t element_num,
- qdf_dma_context_t memctxt, bool cacheable);
-void qdf_mem_multi_pages_free(qdf_device_t osdev,
- struct qdf_mem_multi_page_t *pages,
- qdf_dma_context_t memctxt, bool cacheable);
int qdf_mem_multi_page_link(qdf_device_t osdev,
struct qdf_mem_multi_page_t *pages,
uint32_t elem_size, uint32_t elem_count, uint8_t cacheable);
diff --git a/qdf/inc/qdf_nbuf.h b/qdf/inc/qdf_nbuf.h
index 35ee1ab..7acbe01 100644
--- a/qdf/inc/qdf_nbuf.h
+++ b/qdf/inc/qdf_nbuf.h
@@ -3478,7 +3478,7 @@
return __qdf_nbuf_orphan(buf);
}
-#ifdef CONFIG_WIN
+#ifdef CONFIG_NBUF_AP_PLATFORM
#include <i_qdf_nbuf_api_w.h>
#else
#include <i_qdf_nbuf_api_m.h>
diff --git a/qdf/inc/qdf_threads.h b/qdf/inc/qdf_threads.h
index 5c624b8..aa430d9 100644
--- a/qdf/inc/qdf_threads.h
+++ b/qdf/inc/qdf_threads.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -134,4 +134,13 @@
*/
const char *qdf_get_current_comm(void);
+/**
+ * qdf_thread_set_cpus_allowed_mask() - set cpu mask for a particular thread
+ * @thread: thread for which new cpu mask is set
+ * @new_mask: new cpu mask to be set for the thread
+ *
+ * Return: None
+ */
+void
+qdf_thread_set_cpus_allowed_mask(qdf_thread_t *thread, qdf_cpu_mask *new_mask);
#endif /* __QDF_THREADS_H */
diff --git a/qdf/inc/qdf_trace.h b/qdf/inc/qdf_trace.h
index 48c4c9b..d9e3b6c 100644
--- a/qdf/inc/qdf_trace.h
+++ b/qdf/inc/qdf_trace.h
@@ -494,7 +494,7 @@
void qdf_trace_dump_all(void *, uint8_t, uint8_t, uint32_t, uint32_t);
QDF_STATUS qdf_trace_spin_lock_init(void);
#else
-#ifdef CONFIG_MCL
+#ifndef QDF_TRACE_PRINT_ENABLE
static inline
void qdf_trace_init(void)
{
diff --git a/qdf/inc/qdf_types.h b/qdf/inc/qdf_types.h
index 886a509..653fe78 100644
--- a/qdf/inc/qdf_types.h
+++ b/qdf/inc/qdf_types.h
@@ -158,6 +158,11 @@
typedef __sgtable_t sgtable_t;
/**
+ * typepdef qdf_cpu_mask - CPU Mask
+ */
+typedef __qdf_cpu_mask qdf_cpu_mask;
+
+/**
* pointer to net device
*/
typedef __qdf_netdev_t qdf_netdev_t;
@@ -640,28 +645,7 @@
void qdf_vtrace_msg(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
const char *str_format, va_list val);
-#ifdef CONFIG_MCL
-
-#define qdf_print(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_QDF, ## params)
-#define qdf_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_QDF, ## params)
-#define qdf_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_QDF, ## params)
-#define qdf_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_QDF, ## params)
-#define qdf_info(params...) QDF_TRACE_INFO(QDF_MODULE_ID_QDF, ## params)
-#define qdf_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_QDF, ## params)
-
-#define qdf_nofl_alert(params...) \
- QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_QDF, ## params)
-#define qdf_nofl_err(params...) \
- QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_QDF, ## params)
-#define qdf_nofl_warn(params...) \
- QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_QDF, ## params)
-#define qdf_nofl_info(params...) \
- QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_QDF, ## params)
-#define qdf_nofl_debug(params...) \
- QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_QDF, ## params)
-
-#else /* CONFIG_MCL */
-
+#ifdef QDF_TRACE_PRINT_ENABLE
#define qdf_print(args...) QDF_TRACE_INFO(QDF_MODULE_ID_ANY, ## args)
#define qdf_alert(args...) QDF_TRACE_FATAL(QDF_MODULE_ID_ANY, ## args)
#define qdf_err(args...) QDF_TRACE_ERROR(QDF_MODULE_ID_ANY, ## args)
@@ -682,7 +666,26 @@
#define qdf_nofl_debug(params...) \
QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_ANY, ## params)
-#endif /* CONFIG_MCL */
+#else /* QDF_TRACE_PRINT_ENABLE */
+#define qdf_print(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_QDF, ## params)
+#define qdf_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_QDF, ## params)
+#define qdf_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_QDF, ## params)
+#define qdf_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_QDF, ## params)
+#define qdf_info(params...) QDF_TRACE_INFO(QDF_MODULE_ID_QDF, ## params)
+#define qdf_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_QDF, ## params)
+
+#define qdf_nofl_alert(params...) \
+ QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_QDF, ## params)
+#define qdf_nofl_err(params...) \
+ QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_QDF, ## params)
+#define qdf_nofl_warn(params...) \
+ QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_QDF, ## params)
+#define qdf_nofl_info(params...) \
+ QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_QDF, ## params)
+#define qdf_nofl_debug(params...) \
+ QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_QDF, ## params)
+
+#endif /* QDF_TRACE_PRINT_ENABLE */
#define qdf_rl_alert(params...) QDF_TRACE_FATAL_RL(QDF_MODULE_ID_QDF, ## params)
#define qdf_rl_err(params...) QDF_TRACE_ERROR_RL(QDF_MODULE_ID_QDF, ## params)
diff --git a/qdf/linux/src/i_qdf_nbuf.h b/qdf/linux/src/i_qdf_nbuf.h
index 3d0139c..df5e634 100644
--- a/qdf/linux/src/i_qdf_nbuf.h
+++ b/qdf/linux/src/i_qdf_nbuf.h
@@ -2178,7 +2178,7 @@
return skb_queue_purge(skb_queue_head);
}
-#ifdef CONFIG_WIN
+#ifdef CONFIG_NBUF_AP_PLATFORM
#include <i_qdf_nbuf_w.h>
#else
#include <i_qdf_nbuf_m.h>
diff --git a/qdf/linux/src/i_qdf_types.h b/qdf/linux/src/i_qdf_types.h
index 44f501a..60d21b2 100644
--- a/qdf/linux/src/i_qdf_types.h
+++ b/qdf/linux/src/i_qdf_types.h
@@ -171,6 +171,7 @@
typedef size_t __qdf_dma_size_t;
typedef dma_addr_t __qdf_dma_context_t;
typedef struct net_device *__qdf_netdev_t;
+typedef struct cpumask __qdf_cpu_mask;
typedef __le16 __qdf_le16_t;
typedef __le32 __qdf_le32_t;
typedef __le64 __qdf_le64_t;
diff --git a/qdf/linux/src/qdf_lock.c b/qdf/linux/src/qdf_lock.c
index 474d6fe..f07e7ac 100644
--- a/qdf/linux/src/qdf_lock.c
+++ b/qdf/linux/src/qdf_lock.c
@@ -23,7 +23,7 @@
#include <qdf_types.h>
#include <i_host_diag_core_event.h>
-#ifdef CONFIG_MCL
+#ifdef FEATURE_RUNTIME_PM
#include <cds_api.h>
#include <hif.h>
#endif
diff --git a/qdf/linux/src/qdf_mem.c b/qdf/linux/src/qdf_mem.c
index 0093f97..d29e14c 100644
--- a/qdf/linux/src/qdf_mem.c
+++ b/qdf/linux/src/qdf_mem.c
@@ -1067,6 +1067,163 @@
panic("%u fatal memory leaks detected!", leaks_count);
}
+/**
+ * qdf_mem_multi_pages_alloc_debug() - Debug version of
+ * qdf_mem_multi_pages_alloc
+ * @osdev: OS device handle pointer
+ * @pages: Multi page information storage
+ * @element_size: Each element size
+ * @element_num: Total number of elements should be allocated
+ * @memctxt: Memory context
+ * @cacheable: Coherent memory or cacheable memory
+ * @func: Caller of this allocator
+ * @line: Line number of the caller
+ * @caller: Return address of the caller
+ *
+ * This function will allocate large size of memory over multiple pages.
+ * Large size of contiguous memory allocation will fail frequently, then
+ * instead of allocate large memory by one shot, allocate through multiple, non
+ * contiguous memory and combine pages when actual usage
+ *
+ * Return: None
+ */
+void qdf_mem_multi_pages_alloc_debug(qdf_device_t osdev,
+ struct qdf_mem_multi_page_t *pages,
+ size_t element_size, uint16_t element_num,
+ qdf_dma_context_t memctxt, bool cacheable,
+ const char *func, uint32_t line,
+ void *caller)
+{
+ uint16_t page_idx;
+ struct qdf_mem_dma_page_t *dma_pages;
+ void **cacheable_pages = NULL;
+ uint16_t i;
+
+ pages->num_element_per_page = PAGE_SIZE / element_size;
+ if (!pages->num_element_per_page) {
+ qdf_print("Invalid page %d or element size %d",
+ (int)PAGE_SIZE, (int)element_size);
+ goto out_fail;
+ }
+
+ pages->num_pages = element_num / pages->num_element_per_page;
+ if (element_num % pages->num_element_per_page)
+ pages->num_pages++;
+
+ if (cacheable) {
+ /* Pages information storage */
+ pages->cacheable_pages = qdf_mem_malloc_debug(
+ pages->num_pages * sizeof(pages->cacheable_pages),
+ func, line, caller, 0);
+ if (!pages->cacheable_pages)
+ goto out_fail;
+
+ cacheable_pages = pages->cacheable_pages;
+ for (page_idx = 0; page_idx < pages->num_pages; page_idx++) {
+ cacheable_pages[page_idx] = qdf_mem_malloc_debug(
+ PAGE_SIZE, func, line, caller, 0);
+ if (!cacheable_pages[page_idx])
+ goto page_alloc_fail;
+ }
+ pages->dma_pages = NULL;
+ } else {
+ pages->dma_pages = qdf_mem_malloc_debug(
+ pages->num_pages * sizeof(struct qdf_mem_dma_page_t),
+ func, line, caller, 0);
+ if (!pages->dma_pages)
+ goto out_fail;
+
+ dma_pages = pages->dma_pages;
+ for (page_idx = 0; page_idx < pages->num_pages; page_idx++) {
+ dma_pages->page_v_addr_start =
+ qdf_mem_alloc_consistent_debug(
+ osdev, osdev->dev, PAGE_SIZE,
+ &dma_pages->page_p_addr,
+ func, line, caller);
+ if (!dma_pages->page_v_addr_start) {
+ qdf_print("dmaable page alloc fail pi %d",
+ page_idx);
+ goto page_alloc_fail;
+ }
+ dma_pages->page_v_addr_end =
+ dma_pages->page_v_addr_start + PAGE_SIZE;
+ dma_pages++;
+ }
+ pages->cacheable_pages = NULL;
+ }
+ return;
+
+page_alloc_fail:
+ if (cacheable) {
+ for (i = 0; i < page_idx; i++)
+ qdf_mem_free_debug(pages->cacheable_pages[i],
+ func, line);
+ qdf_mem_free_debug(pages->cacheable_pages, func, line);
+ } else {
+ dma_pages = pages->dma_pages;
+ for (i = 0; i < page_idx; i++) {
+ qdf_mem_free_consistent_debug(
+ osdev, osdev->dev,
+ PAGE_SIZE, dma_pages->page_v_addr_start,
+ dma_pages->page_p_addr, memctxt, func, line);
+ dma_pages++;
+ }
+ qdf_mem_free_debug(pages->dma_pages, func, line);
+ }
+
+out_fail:
+ pages->cacheable_pages = NULL;
+ pages->dma_pages = NULL;
+ pages->num_pages = 0;
+}
+
+qdf_export_symbol(qdf_mem_multi_pages_alloc_debug);
+
+/**
+ * qdf_mem_multi_pages_free_debug() - Debug version of qdf_mem_multi_pages_free
+ * @osdev: OS device handle pointer
+ * @pages: Multi page information storage
+ * @memctxt: Memory context
+ * @cacheable: Coherent memory or cacheable memory
+ * @func: Caller of this allocator
+ * @line: Line number of the caller
+ *
+ * This function will free large size of memory over multiple pages.
+ *
+ * Return: None
+ */
+void qdf_mem_multi_pages_free_debug(qdf_device_t osdev,
+ struct qdf_mem_multi_page_t *pages,
+ qdf_dma_context_t memctxt, bool cacheable,
+ const char *func, uint32_t line)
+{
+ unsigned int page_idx;
+ struct qdf_mem_dma_page_t *dma_pages;
+
+ if (cacheable) {
+ for (page_idx = 0; page_idx < pages->num_pages; page_idx++)
+ qdf_mem_free_debug(pages->cacheable_pages[page_idx],
+ func, line);
+ qdf_mem_free_debug(pages->cacheable_pages, func, line);
+ } else {
+ dma_pages = pages->dma_pages;
+ for (page_idx = 0; page_idx < pages->num_pages; page_idx++) {
+ qdf_mem_free_consistent_debug(
+ osdev, osdev->dev, PAGE_SIZE,
+ dma_pages->page_v_addr_start,
+ dma_pages->page_p_addr, memctxt, func, line);
+ dma_pages++;
+ }
+ qdf_mem_free_debug(pages->dma_pages, func, line);
+ }
+
+ pages->cacheable_pages = NULL;
+ pages->dma_pages = NULL;
+ pages->num_pages = 0;
+}
+
+qdf_export_symbol(qdf_mem_multi_pages_free_debug);
+
#else
static void qdf_mem_debug_init(void) {}
@@ -1136,37 +1293,6 @@
}
qdf_export_symbol(qdf_mem_free);
-#endif
-
-void *qdf_aligned_malloc_fl(qdf_size_t size, uint32_t ring_base_align,
- void **vaddr_unaligned,
- const char *func, uint32_t line)
-{
- void *vaddr_aligned;
-
- *vaddr_unaligned = qdf_mem_malloc_fl(size, func, line);
- if (!*vaddr_unaligned) {
- qdf_warn("Failed to alloc %zuB @ %s:%d", size, func, line);
- return NULL;
- }
-
- if ((unsigned long)(*vaddr_unaligned) % ring_base_align) {
- qdf_mem_free(*vaddr_unaligned);
- *vaddr_unaligned = qdf_mem_malloc_fl(size + ring_base_align - 1,
- func, line);
- if (!*vaddr_unaligned) {
- qdf_warn("Failed to alloc %zuB @ %s:%d",
- size, func, line);
- return NULL;
- }
- }
-
- vaddr_aligned = (*vaddr_unaligned) +
- ((unsigned long)(*vaddr_unaligned) % ring_base_align);
-
- return vaddr_aligned;
-}
-qdf_export_symbol(qdf_aligned_malloc_fl);
/**
* qdf_mem_multi_pages_alloc() - allocate large size of kernel memory
@@ -1307,6 +1433,38 @@
return;
}
qdf_export_symbol(qdf_mem_multi_pages_free);
+#endif
+
+void *qdf_aligned_malloc_fl(qdf_size_t size, uint32_t ring_base_align,
+ void **vaddr_unaligned,
+ const char *func, uint32_t line)
+{
+ void *vaddr_aligned;
+
+ *vaddr_unaligned = qdf_mem_malloc_fl(size, func, line);
+ if (!*vaddr_unaligned) {
+ qdf_warn("Failed to alloc %zuB @ %s:%d", size, func, line);
+ return NULL;
+ }
+
+ if ((unsigned long)(*vaddr_unaligned) % ring_base_align) {
+ qdf_mem_free(*vaddr_unaligned);
+ *vaddr_unaligned = qdf_mem_malloc_fl(size + ring_base_align - 1,
+ func, line);
+ if (!*vaddr_unaligned) {
+ qdf_warn("Failed to alloc %zuB @ %s:%d",
+ size, func, line);
+ return NULL;
+ }
+ }
+
+ vaddr_aligned = (*vaddr_unaligned) +
+ ((unsigned long)(*vaddr_unaligned) % ring_base_align);
+
+ return vaddr_aligned;
+}
+
+qdf_export_symbol(qdf_aligned_malloc_fl);
/**
* qdf_mem_multi_page_link() - Make links for multi page elements
diff --git a/qdf/linux/src/qdf_nbuf.c b/qdf/linux/src/qdf_nbuf.c
index 3a5a1c6..30553f9 100644
--- a/qdf/linux/src/qdf_nbuf.c
+++ b/qdf/linux/src/qdf_nbuf.c
@@ -91,7 +91,7 @@
#define RADIOTAP_CCK_CHANNEL 0x0020
#define RADIOTAP_OFDM_CHANNEL 0x0040
-#ifdef CONFIG_MCL
+#ifdef FEATURE_NBUFF_REPLENISH_TIMER
#include <qdf_mc_timer.h>
struct qdf_track_timer {
diff --git a/qdf/linux/src/qdf_threads.c b/qdf/linux/src/qdf_threads.c
index bad4a22..b0b22ab 100644
--- a/qdf/linux/src/qdf_threads.c
+++ b/qdf/linux/src/qdf_threads.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -228,3 +228,11 @@
return current->comm;
}
qdf_export_symbol(qdf_get_current_comm);
+
+void
+qdf_thread_set_cpus_allowed_mask(qdf_thread_t *thread, qdf_cpu_mask *new_mask)
+{
+ set_cpus_allowed_ptr(thread, new_mask);
+}
+
+qdf_export_symbol(qdf_thread_set_cpus_allowed_mask);
diff --git a/spectral/core/spectral_defs_i.h b/spectral/core/spectral_defs_i.h
index 1867352..f5073b0 100644
--- a/spectral/core/spectral_defs_i.h
+++ b/spectral/core/spectral_defs_i.h
@@ -89,7 +89,7 @@
struct wlan_objmgr_pdev *psptrl_pdev;
struct sock *spectral_sock;
void *psptrl_target_handle;
- struct sk_buff *skb;
+ struct sk_buff *skb[SPECTRAL_MSG_TYPE_MAX];
uint32_t spectral_pid;
};
diff --git a/spectral/dispatcher/inc/wlan_spectral_public_structs.h b/spectral/dispatcher/inc/wlan_spectral_public_structs.h
index ffa053b..9788f9e 100644
--- a/spectral/dispatcher/inc/wlan_spectral_public_structs.h
+++ b/spectral/dispatcher/inc/wlan_spectral_public_structs.h
@@ -133,6 +133,34 @@
/* End of temporary section for hard-coded values */
/**
+ * enum spectral_msg_buf_type - Spectral message buffer type
+ * @SPECTRAL_MSG_BUF_NEW: Allocate new buffer
+ * @SPECTRAL_MSG_BUF_SAVED: Reuse last buffer, used for secondary segment report
+ * in case of 160 MHz.
+ */
+enum spectral_msg_buf_type {
+ SPECTRAL_MSG_BUF_NEW,
+ SPECTRAL_MSG_BUF_SAVED,
+ SPECTRAL_MSG_BUF_TYPE_MAX,
+};
+
+/**
+ * enum spectral_msg_type - Spectral SAMP message type
+ * @SPECTRAL_MSG_NORMAL_MODE: Normal mode Spectral SAMP message
+ * @SPECTRAL_MSG_AGILE_MODE: Agile mode Spectral SAMP message
+ * @SPECTRAL_MSG_INTERFERENCE_NOTIFICATION: Interference notification to
+ * external auto channel selection
+ * entity
+ * @SPECTRAL_MSG_TYPE_MAX: Spectral SAMP message type max
+ */
+enum spectral_msg_type {
+ SPECTRAL_MSG_NORMAL_MODE,
+ SPECTRAL_MSG_AGILE_MODE,
+ SPECTRAL_MSG_INTERFERENCE_NOTIFICATION,
+ SPECTRAL_MSG_TYPE_MAX,
+};
+
+/**
* enum wlan_cfg80211_spectral_vendorcmd_handler_idx - Indices to cfg80211
* spectral vendor command handlers
* @SPECTRAL_SCAN_START_HANDLER_IDX: Index to SPECTRAL_SCAN_START handler
@@ -260,15 +288,21 @@
/**
* struct spectral_nl_cb - Spectral Netlink callbacks
- * @get_nbuff: Get the socket buffer to send the data to the application
+ * @get_sbuff: Get the socket buffer to send the data to the application
* @send_nl_bcast: Send data to the application using netlink broadcast
* @send_nl_unicast: Send data to the application using netlink unicast
+ * @free_sbuff: Free the socket buffer for a particular message type
*/
struct spectral_nl_cb {
- void *(*get_nbuff)(struct wlan_objmgr_pdev *pdev);
- int (*send_nl_bcast)(struct wlan_objmgr_pdev *pdev);
- int (*send_nl_unicast)(struct wlan_objmgr_pdev *pdev);
- void (*free_nbuff)(struct wlan_objmgr_pdev *pdev);
+ void *(*get_sbuff)(struct wlan_objmgr_pdev *pdev,
+ enum spectral_msg_type smsg_type,
+ enum spectral_msg_buf_type buf_type);
+ int (*send_nl_bcast)(struct wlan_objmgr_pdev *pdev,
+ enum spectral_msg_type smsg_type);
+ int (*send_nl_unicast)(struct wlan_objmgr_pdev *pdev,
+ enum spectral_msg_type smsg_type);
+ void (*free_sbuff)(struct wlan_objmgr_pdev *pdev,
+ enum spectral_msg_type smsg_type);
};
/**
diff --git a/target_if/mlme/vdev_mgr/inc/target_if_vdev_mgr_tx_ops.h b/target_if/mlme/vdev_mgr/inc/target_if_vdev_mgr_tx_ops.h
index e3caf0a..f48e4d1 100644
--- a/target_if/mlme/vdev_mgr/inc/target_if_vdev_mgr_tx_ops.h
+++ b/target_if/mlme/vdev_mgr/inc/target_if_vdev_mgr_tx_ops.h
@@ -62,6 +62,30 @@
QDF_STATUS
target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
+/**
+ * target_if_vdev_mgr_assert_mgmt() - vdev assert mgmt api
+ * @vdev: pointer to objmgr vdev
+ * @vdev_rsp: pointer to vdev mlme response timer
+ * @set_bit: bit to be set
+ *
+ * Return: NA
+ */
+#ifdef VDEV_ASSERT_MANAGEMENT
+static void target_if_vdev_mgr_assert_mgmt(
+ struct wlan_objmgr_vdev *vdev,
+ struct vdev_response_timer *vdev_rsp,
+ uint8_t set_bit)
+{
+}
+#else
+static void target_if_vdev_mgr_assert_mgmt(
+ struct wlan_objmgr_vdev *vdev,
+ struct vdev_response_timer *vdev_rsp,
+ uint8_t set_bit)
+{
+ QDF_ASSERT(0);
+}
+#endif
#else
static inline QDF_STATUS
diff --git a/target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c b/target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c
index 8764b27..981524b 100644
--- a/target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c
+++ b/target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c
@@ -87,25 +87,6 @@
return QDF_STATUS_E_FAILURE;
}
-#ifdef VDEV_ASSERT_MANAGEMENT
-static void target_if_vdev_mgr_assert_mgmt(
- struct wlan_objmgr_vdev *vdev,
- struct vdev_response_timer *vdev_rsp,
- uint8_t set_bit)
-{
- target_if_vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
- set_bit);
-}
-#else
-static void target_if_vdev_mgr_assert_mgmt(
- struct wlan_objmgr_vdev *vdev,
- struct vdev_response_timer *vdev_rsp,
- uint8_t set_bit)
-{
- QDF_ASSERT(0);
-}
-#endif
-
static QDF_STATUS target_if_vdev_mgr_rsp_timer_start(
struct wlan_objmgr_vdev *vdev,
struct vdev_response_timer *vdev_rsp,
@@ -128,21 +109,26 @@
if (rsp_pos != set_bit) {
if (qdf_atomic_test_bit(rsp_pos,
&vdev_rsp->rsp_status)) {
- mlme_err("PSOC_%d VDEV_%d: Response bit is set %d",
+ mlme_err("PSOC_%d VDEV_%d: Request bit %d, response bit %d",
wlan_psoc_get_id(psoc),
- vdev_id, vdev_rsp->rsp_status);
+ vdev_id, set_bit,
+ vdev_rsp->rsp_status);
target_if_vdev_mgr_assert_mgmt(vdev, vdev_rsp,
rsp_pos);
+ target_if_vdev_mgr_rsp_timer_stop(vdev,
+ vdev_rsp,
+ set_bit);
}
}
}
if (qdf_atomic_test_and_set_bit(set_bit, &vdev_rsp->rsp_status)) {
- mlme_err("PSOC_%d VDEV_%d: Response bit is set %d",
+ mlme_err("PSOC_%d VDEV_%d: Request bit: %d, response bit %d",
wlan_psoc_get_id(psoc),
- vdev_id, vdev_rsp->rsp_status);
+ vdev_id, set_bit, vdev_rsp->rsp_status);
target_if_vdev_mgr_assert_mgmt(vdev, vdev_rsp,
set_bit);
+ target_if_vdev_mgr_rsp_timer_stop(vdev, vdev_rsp, set_bit);
}
/* reference taken for timer start, will be released with stop */
diff --git a/target_if/spectral/target_if_spectral.c b/target_if/spectral/target_if_spectral.c
index f142c63..9b83119 100644
--- a/target_if/spectral/target_if_spectral.c
+++ b/target_if/spectral/target_if_spectral.c
@@ -1824,8 +1824,6 @@
spectral_info("spectral detach");
if (spectral) {
- if (spectral->spectral_gen == SPECTRAL_GEN3)
- deinit_160mhz_delivery_state_machine(spectral);
qdf_spinlock_destroy(&spectral->param_info.osps_lock);
target_if_spectral_detach_simulation(spectral);
@@ -2891,8 +2889,10 @@
struct target_if_spectral *spectral = NULL;
spectral = get_target_if_spectral_handle_from_pdev(pdev);
- msg = (struct spectral_samp_msg *)spectral->nl_cb.get_nbuff(
- spectral->pdev_obj);
+ msg = (struct spectral_samp_msg *)spectral->nl_cb.get_sbuff(
+ spectral->pdev_obj,
+ SPECTRAL_MSG_INTERFERENCE_NOTIFICATION,
+ SPECTRAL_MSG_BUF_NEW);
if (msg) {
msg->int_type = cw_int ?
@@ -2901,7 +2901,9 @@
msg->signature = SPECTRAL_SIGNATURE;
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
p_sops->get_mac_address(spectral, msg->macaddr);
- if (spectral->send_phy_data(pdev) == 0)
+ if (spectral->send_phy_data
+ (pdev,
+ SPECTRAL_MSG_INTERFERENCE_NOTIFICATION) == 0)
spectral->spectral_sent_msg++;
}
}
diff --git a/target_if/spectral/target_if_spectral.h b/target_if/spectral/target_if_spectral.h
index 39470d9..19d078c 100644
--- a/target_if/spectral/target_if_spectral.h
+++ b/target_if/spectral/target_if_spectral.h
@@ -145,18 +145,6 @@
};
/**
- * enum spectral_160mhz_report_delivery_event - 160 MHz state machine event
- * @SPECTRAL_REPORT_EVENT_DETECTORID0: Received detector id 0
- * @SPECTRAL_REPORT_EVENT_DETECTORID1: Received detector id 1
- * @SPECTRAL_REPORT_EVENT_DETECTORID_INVALID: Received invalid detector id
- */
-enum spectral_160mhz_report_delivery_event {
- SPECTRAL_REPORT_EVENT_DETECTORID0,
- SPECTRAL_REPORT_EVENT_DETECTORID1,
- SPECTRAL_REPORT_EVENT_DETECTORID_INVALID,
-};
-
-/**
* struct spectral_search_fft_info_gen2 - spectral search fft report for gen2
* @relpwr_db: Total bin power in db
* @num_str_bins_ib: Number of strong bins
@@ -788,7 +776,7 @@
* generation
* @nl_cb: Netlink callbacks
* @use_nl_bcast: Whether to use Netlink broadcast/unicast
- * @send_phy_data: Send data to the applicaton layer
+ * @send_phy_data: Send data to the application layer for a particular msg type
* @inband_fftbin_size_adj: Whether to carry out FFT bin size adjustment for
* in-band report format. This would be required on some chipsets under the
* following circumstances: In report mode 2 only the in-band bins are DMA'ed.
@@ -908,7 +896,8 @@
struct wmi_spectral_cmd_ops param_wmi_cmd_ops;
struct spectral_nl_cb nl_cb;
bool use_nl_bcast;
- int (*send_phy_data)(struct wlan_objmgr_pdev *pdev);
+ int (*send_phy_data)(struct wlan_objmgr_pdev *pdev,
+ enum spectral_msg_type smsg_type);
enum spectral_fftbin_size_war fftbin_size_war;
u_int8_t inband_fftbin_size_adj;
u_int8_t null_fftbin_adj;
@@ -997,6 +986,7 @@
uint8_t agc_total_gain_sec80;
uint8_t gainchange;
uint8_t gainchange_sec80;
+ enum spectral_scan_mode smode;
};
#ifdef WLAN_CONV_SPECTRAL_ENABLE
@@ -1375,65 +1365,25 @@
tsf64, acs_stats);
}
-/**
- * save_spectral_report_skb() - Save Spectral report skb
- * @spectral: Pointer to Spectral
- * @skb: Pointer to skb
- *
- * Save spectral report skb
- *
- * Return: void
- */
-static inline void
-save_spectral_report_skb(struct target_if_spectral *spectral, void *skb) {
- if (spectral->ch_width == CH_WIDTH_160MHZ)
- spectral->spectral_report_cache = skb;
-}
+static QDF_STATUS
+target_if_get_spectral_msg_type(enum spectral_scan_mode smode,
+ enum spectral_msg_type *msg_type) {
-/**
- * restore_spectral_report_skb() - Restore Spectral report skb
- * @spectral: Pointer to Spectral
- * @skb: Pointer to restore location
- *
- * Restore spectral report skb
- *
- * Return: void
- */
-static inline void
-restore_spectral_report_skb(struct target_if_spectral *spectral, void **dest) {
- if (spectral->ch_width == CH_WIDTH_160MHZ) {
- QDF_ASSERT(spectral->spectral_report_cache);
- *dest = spectral->spectral_report_cache;
+ switch (smode) {
+ case SPECTRAL_SCAN_MODE_NORMAL:
+ *msg_type = SPECTRAL_MSG_NORMAL_MODE;
+ break;
+
+ case SPECTRAL_SCAN_MODE_AGILE:
+ *msg_type = SPECTRAL_MSG_AGILE_MODE;
+ break;
+
+ default:
+ spectral_err("Invalid spectral mode");
+ return QDF_STATUS_E_FAILURE;
}
-}
-/**
- * clear_spectral_report_skb() - Clear Spectral report skb
- * @spectral: Pointer to Spectral
- *
- * Clear spectral report skb
- *
- * Return: void
- */
-static inline void
-clear_spectral_report_skb(struct target_if_spectral *spectral) {
- if (spectral->ch_width == CH_WIDTH_160MHZ)
- spectral->spectral_report_cache = NULL;
-}
-
-/**
- * free_and_clear_spectral_report_skb() - Free and clear Spectral report skb
- * @spectral: Pointer to Spectral
- *
- * Free and clear spectral report skb
- *
- * Return: void
- */
-static inline void
-free_and_clear_spectral_report_skb(struct target_if_spectral *spectral) {
- if (spectral->spectral_report_cache)
- spectral->nl_cb.free_nbuff(spectral->pdev_obj);
- spectral->spectral_report_cache = NULL;
+ return QDF_STATUS_SUCCESS;
}
/**
@@ -1446,27 +1396,10 @@
* Return: void
*/
static inline void
-init_160mhz_delivery_state_machine(struct target_if_spectral *spectral) {
+init_160mhz_delivery_state_machine(struct target_if_spectral *spectral)
+{
spectral->state_160mhz_delivery =
SPECTRAL_REPORT_WAIT_PRIMARY80;
- spectral->spectral_report_cache = NULL;
-}
-
-/**
- * deinit_160mhz_delivery_state_machine() - Deinitialize 160MHz Spectral
- * state machine
- * @spectral: Pointer to Spectral
- *
- * Deinitialize 160MHz Spectral state machine
- *
- * Return: void
- */
-static inline void
-deinit_160mhz_delivery_state_machine(struct target_if_spectral *spectral) {
- if (spectral->spectral_report_cache && spectral->nl_cb.free_nbuff) {
- spectral->nl_cb.free_nbuff(spectral->pdev_obj);
- spectral->spectral_report_cache = NULL;
- }
}
/**
@@ -1478,11 +1411,24 @@
* Return: void
*/
static inline void
-reset_160mhz_delivery_state_machine(struct target_if_spectral *spectral) {
+reset_160mhz_delivery_state_machine(struct target_if_spectral *spectral,
+ enum spectral_scan_mode smode)
+{
+ enum spectral_msg_type smsg_type;
+ QDF_STATUS ret;
+
if (spectral->ch_width == CH_WIDTH_160MHZ) {
spectral->state_160mhz_delivery =
SPECTRAL_REPORT_WAIT_PRIMARY80;
- free_and_clear_spectral_report_skb(spectral);
+
+ ret = target_if_get_spectral_msg_type(smode, &smsg_type);
+ if (QDF_IS_STATUS_ERROR(ret)) {
+ spectral_err("Failed to reset 160 MHz state machine");
+ return;
+ }
+
+ spectral->nl_cb.free_sbuff(spectral->pdev_obj,
+ smsg_type);
}
}
@@ -1872,19 +1818,6 @@
void target_if_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev,
void *outdata);
-/*
- * target_if_spectral_send_tlv_to_host - target_if_spectral_send_tlv_to_host
- * @spectral: Send the TLV information to Host
- * @data: Pointer to the TLV
- * @datalen: tlv length
- *
- * Return: Success/Failure
- *
- */
-int target_if_spectral_send_tlv_to_host(
- struct target_if_spectral *spectral,
- uint8_t *data, uint32_t datalen);
-
void target_if_register_wmi_spectral_cmd_ops(
struct wlan_objmgr_pdev *pdev,
struct wmi_spectral_cmd_ops *cmd_ops);
diff --git a/target_if/spectral/target_if_spectral_netlink.c b/target_if/spectral/target_if_spectral_netlink.c
index 85f2e2e..a57746a 100644
--- a/target_if/spectral/target_if_spectral_netlink.c
+++ b/target_if/spectral/target_if_spectral_netlink.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011,2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011,2017-2019 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -49,23 +49,31 @@
static int samp_msg_index;
size_t pwr_count = 0;
size_t pwr_count_sec80 = 0;
+ enum spectral_msg_type msg_type;
+ QDF_STATUS ret;
- if (is_primaryseg_rx_inprog(spectral)) {
+ ret = target_if_get_spectral_msg_type(params->smode, &msg_type);
+ if (QDF_IS_STATUS_ERROR(ret))
+ return;
+
+ if ((params->smode == SPECTRAL_SCAN_MODE_AGILE) ||
+ is_primaryseg_rx_inprog(spectral)) {
spec_samp_msg = (struct spectral_samp_msg *)
- spectral->nl_cb.get_nbuff(spectral->pdev_obj);
+ spectral->nl_cb.get_sbuff(spectral->pdev_obj,
+ msg_type,
+ SPECTRAL_MSG_BUF_NEW);
if (!spec_samp_msg)
return;
samp_data = &spec_samp_msg->samp_data;
- if (spectral->spectral_gen == SPECTRAL_GEN3)
- save_spectral_report_skb(spectral, spec_samp_msg);
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
bin_pwr_data = params->bin_pwr_data;
spec_samp_msg->signature = SPECTRAL_SIGNATURE;
spec_samp_msg->freq = params->freq;
spec_samp_msg->freq_loading = params->freq_loading;
+ samp_data->spectral_mode = params->smode;
samp_data->spectral_data_len = params->datalen;
samp_data->spectral_rssi = params->rssi;
samp_data->ch_width = spectral->ch_width;
@@ -150,9 +158,11 @@
}
if (is_secondaryseg_rx_inprog(spectral)) {
- if (spectral->spectral_gen == SPECTRAL_GEN3)
- restore_spectral_report_skb(spectral,
- (void **)&spec_samp_msg);
+ spec_samp_msg = (struct spectral_samp_msg *)
+ spectral->nl_cb.get_sbuff(spectral->pdev_obj,
+ msg_type,
+ SPECTRAL_MSG_BUF_SAVED);
+
if (!spec_samp_msg) {
spectral_err("Spectral SAMP message is NULL");
return;
@@ -214,17 +224,18 @@
}
if ((spectral->ch_width != CH_WIDTH_160MHZ) ||
+ (params->smode == SPECTRAL_SCAN_MODE_AGILE) ||
is_secondaryseg_rx_inprog(spectral)) {
- if (spectral->send_phy_data(spectral->pdev_obj) == 0)
+ if (spectral->send_phy_data(spectral->pdev_obj,
+ msg_type) == 0)
spectral->spectral_sent_msg++;
samp_msg_index++;
- if (spectral->spectral_gen == SPECTRAL_GEN3)
- clear_spectral_report_skb(spectral);
}
/* Take care of state transitions for 160MHz/ 80p80 */
- if (spectral->spectral_gen == SPECTRAL_GEN3)
+ if ((spectral->spectral_gen == SPECTRAL_GEN3) &&
+ (params->smode != SPECTRAL_SCAN_MODE_AGILE))
target_if_160mhz_delivery_state_change(
spectral,
- SPECTRAL_REPORT_EVENT_DETECTORID_INVALID);
+ SPECTRAL_DETECTOR_INVALID);
}
diff --git a/target_if/spectral/target_if_spectral_phyerr.c b/target_if/spectral/target_if_spectral_phyerr.c
index 6d4dd75..819cf51 100644
--- a/target_if/spectral/target_if_spectral_phyerr.c
+++ b/target_if/spectral/target_if_spectral_phyerr.c
@@ -100,33 +100,6 @@
return 0;
}
-/**
- * target_if_spectral_send_tlv_to_host() - Send the TLV information to Host
- * @spectral: Pointer to target_if spectral object
- * @data: Pointer to the TLV
- * @datalen: data length
- *
- * Send the TLV information to Host
- *
- * Return: Success or failure
- */
-int
-target_if_spectral_send_tlv_to_host(struct target_if_spectral *spectral,
- uint8_t *data, uint32_t datalen)
-{
- int status = true;
- void *nl_data = spectral->nl_cb.get_nbuff(spectral->pdev_obj);
-
- if (nl_data) {
- memcpy(nl_data, data, datalen);
- if (spectral->send_phy_data(spectral->pdev_obj) == 0)
- spectral->spectral_sent_msg++;
- } else {
- status = false;
- }
- return status;
-}
-
void
target_if_dbg_print_samp_param(struct target_if_samp_msg_params *p)
{
@@ -806,6 +779,8 @@
}
OS_MEMZERO(¶ms, sizeof(params));
+ /* Gen 2 only supports normal Spectral scan currently */
+ params.smode = SPECTRAL_SCAN_MODE_NORMAL;
if (ptlv->tag == TLV_TAG_SEARCH_FFT_REPORT_GEN2) {
if (spectral->is_160_format) {
@@ -1307,6 +1282,12 @@
if (spectral->ch_width != CH_WIDTH_160MHZ)
return QDF_STATUS_E_FAILURE;
+ /* agile reports should not be coupled with 160 MHz state machine
+ * for normal Spectral
+ */
+ if (detector_id == SPECTRAL_DETECTOR_AGILE)
+ return QDF_STATUS_SUCCESS;
+
switch (spectral->state_160mhz_delivery) {
case SPECTRAL_REPORT_WAIT_PRIMARY80:
if (detector_id == SPECTRAL_DETECTOR_PRIMARY)
@@ -1331,8 +1312,9 @@
break;
case SPECTRAL_REPORT_RX_SECONDARY80:
- /* We don't care about detector id in this state */
- reset_160mhz_delivery_state_machine(spectral);
+ /* We don't care about detector id in this state. */
+ reset_160mhz_delivery_state_machine(spectral,
+ SPECTRAL_SCAN_MODE_NORMAL);
break;
case SPECTRAL_REPORT_RX_PRIMARY80:
@@ -1444,6 +1426,27 @@
return idx;
}
+static QDF_STATUS
+target_if_get_spectral_mode(enum spectral_detector_id detector_id,
+ enum spectral_scan_mode *smode) {
+ switch (detector_id) {
+ case SPECTRAL_DETECTOR_PRIMARY:
+ case SPECTRAL_DETECTOR_SECONDARY:
+ *smode = SPECTRAL_SCAN_MODE_NORMAL;
+ break;
+
+ case SPECTRAL_DETECTOR_AGILE:
+ *smode = SPECTRAL_SCAN_MODE_AGILE;
+ break;
+
+ default:
+ spectral_err("Invalid Spectral detector id");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ return QDF_STATUS_SUCCESS;
+}
+
int
target_if_consume_spectral_report_gen3(
struct target_if_spectral *spectral,
@@ -1490,41 +1493,45 @@
struct wlan_objmgr_vdev *vdev;
uint8_t vdev_rxchainmask;
struct sscan_report_fields_gen3 sscan_report_fields;
- uint8_t detector_id;
+ enum spectral_detector_id detector_id;
QDF_STATUS ret;
- if (is_primaryseg_expected(spectral)) {
- /* Process Spectral scan summary report */
- if (target_if_verify_sig_and_tag_gen3(
- spectral, data,
- TLV_TAG_SPECTRAL_SUMMARY_REPORT_GEN3) != 0) {
- spectral_err_rl("Wrong tag/sig in sscan summary(0)");
- goto fail;
- }
+ params.smode = SPECTRAL_SCAN_MODE_NORMAL;
- detector_id = target_if_get_detector_id_sscan_report_gen3(data);
- /* Agile detector is not supported */
- if (detector_id >= SPECTRAL_DETECTOR_AGILE) {
- spectral->diag_stats.spectral_invalid_detector_id++;
- spectral_err("Invalid detector id %u, expected is 0",
- detector_id);
- goto fail;
- }
- target_if_consume_sscan_report_gen3(spectral, data,
- &sscan_report_fields);
+ /* Process Spectral scan summary report */
+ if (target_if_verify_sig_and_tag_gen3(
+ spectral, data,
+ TLV_TAG_SPECTRAL_SUMMARY_REPORT_GEN3) != 0) {
+ spectral_err_rl("Wrong tag/sig in sscan summary");
+ goto fail;
+ }
+
+ detector_id = target_if_get_detector_id_sscan_report_gen3(data);
+ if (detector_id > SPECTRAL_DETECTOR_AGILE) {
+ spectral->diag_stats.spectral_invalid_detector_id++;
+ spectral_err("Invalid detector id %u, expected is 0/1/2",
+ detector_id);
+ goto fail;
+ }
+ target_if_consume_sscan_report_gen3(spectral, data,
+ &sscan_report_fields);
+ /* Advance buf pointer to the search fft report */
+ data += sizeof(struct spectral_sscan_report_gen3);
+
+ if ((detector_id == SPECTRAL_DETECTOR_AGILE) ||
+ is_primaryseg_expected(spectral)) {
/* RSSI is in 1/2 dBm steps, Covert it to dBm scale */
rssi = (sscan_report_fields.inband_pwr_db) >> 1;
params.agc_total_gain =
sscan_report_fields.sscan_agc_total_gain;
params.gainchange = sscan_report_fields.sscan_gainchange;
- /* Advance buf pointer to the search fft report */
- data += sizeof(struct spectral_sscan_report_gen3);
/* Process Spectral search FFT report */
if (target_if_verify_sig_and_tag_gen3(
spectral, data,
TLV_TAG_SEARCH_FFT_REPORT_GEN3) != 0) {
- spectral_err_rl("Unexpected tag/signature in sfft(0)");
+ spectral_err_rl("Unexpected tag/sig in sfft, detid= %u",
+ detector_id);
goto fail;
}
p_fft_report = (struct spectral_phyerr_fft_report_gen3 *)data;
@@ -1569,7 +1576,23 @@
}
target_if_process_sfft_report_gen3(p_fft_report, p_sfft);
+ /* It is expected to have same detector id for
+ * summary and fft report
+ */
+ if (detector_id != p_sfft->fft_detector_id) {
+ spectral_err_rl
+ ("Different detid in ssummary(%u) and sfft(%u)",
+ detector_id, p_sfft->fft_detector_id);
+ goto fail;
+ }
+
detector_id = p_sfft->fft_detector_id;
+ ret = target_if_get_spectral_mode(detector_id, ¶ms.smode);
+ if (QDF_IS_STATUS_ERROR(ret)) {
+ spectral_err_rl("Failed to get mode from detid= %u",
+ detector_id);
+ goto fail;
+ }
if (report->reset_delay) {
spectral->timestamp_war_offset += (report->reset_delay +
@@ -1579,10 +1602,9 @@
spectral->last_fft_timestamp = p_sfft->timestamp;
tsf64 += spectral->timestamp_war_offset;
- /* Agile detector is not supported */
- if (detector_id >= SPECTRAL_DETECTOR_AGILE) {
+ if (detector_id > SPECTRAL_DETECTOR_AGILE) {
spectral->diag_stats.spectral_invalid_detector_id++;
- spectral_err("Invalid detector id %u, expected is 0",
+ spectral_err("Invalid detector id %u, expected is 0/2",
detector_id);
goto fail;
}
@@ -1605,7 +1627,9 @@
vdev = target_if_spectral_get_vdev(spectral);
if (!vdev) {
spectral_info("First vdev is NULL");
- reset_160mhz_delivery_state_machine(spectral);
+ reset_160mhz_delivery_state_machine
+ (spectral,
+ SPECTRAL_SCAN_MODE_NORMAL);
return -EPERM;
}
vdev_rxchainmask = wlan_vdev_mlme_get_rxchainmask(vdev);
@@ -1638,37 +1662,18 @@
params.pwr_count = fft_bin_len;
params.tstamp = (tsf64 & SPECTRAL_TSMASK);
} else if (is_secondaryseg_expected(spectral)) {
- /* Process Spectral scan summary report */
- if (target_if_verify_sig_and_tag_gen3(
- spectral, data,
- TLV_TAG_SPECTRAL_SUMMARY_REPORT_GEN3) != 0) {
- spectral_err_rl("Wrong tag/sig in sscan summary(1)");
- goto fail;
- }
-
- detector_id = target_if_get_detector_id_sscan_report_gen3(data);
- /* Agile detector is not supported */
- if (detector_id >= SPECTRAL_DETECTOR_AGILE) {
- spectral->diag_stats.spectral_invalid_detector_id++;
- spectral_err("Invalid detector id %u, expected is 1",
- detector_id);
- goto fail;
- }
- target_if_consume_sscan_report_gen3(spectral, data,
- &sscan_report_fields);
/* RSSI is in 1/2 dBm steps, Covert it to dBm scale */
rssi = (sscan_report_fields.inband_pwr_db) >> 1;
params.agc_total_gain_sec80 =
sscan_report_fields.sscan_agc_total_gain;
params.gainchange_sec80 = sscan_report_fields.sscan_gainchange;
- /* Advance buf pointer to the search fft report */
- data += sizeof(struct spectral_sscan_report_gen3);
/* Process Spectral search FFT report */
if (target_if_verify_sig_and_tag_gen3(
spectral, data,
TLV_TAG_SEARCH_FFT_REPORT_GEN3) != 0) {
- spectral_err_rl("Unexpected tag/signature in sfft(1)");
+ spectral_err_rl("Unexpected tag/sig in sfft, detid= %u",
+ detector_id);
goto fail;
}
p_fft_report = (struct spectral_phyerr_fft_report_gen3 *)data;
@@ -1714,15 +1719,30 @@
}
target_if_process_sfft_report_gen3(p_fft_report, p_sfft);
- detector_id = p_sfft->fft_detector_id;
- /* Agile detector is not supported */
- if (detector_id >= SPECTRAL_DETECTOR_AGILE) {
+ if (detector_id > SPECTRAL_DETECTOR_AGILE) {
spectral->diag_stats.spectral_invalid_detector_id++;
spectral_err("Invalid detector id %u, expected is 1",
detector_id);
goto fail;
}
+ /* It is expected to have same detector id for
+ * summary and fft report
+ */
+ if (detector_id != p_sfft->fft_detector_id) {
+ spectral_err_rl
+ ("Different detid in ssummary(%u) and sfft(%u)",
+ detector_id, p_sfft->fft_detector_id);
+ goto fail;
+ }
+ detector_id = p_sfft->fft_detector_id;
+ ret = target_if_get_spectral_mode(detector_id, ¶ms.smode);
+ if (QDF_IS_STATUS_ERROR(ret)) {
+ spectral_err("Failed to get mode from detid= %u",
+ detector_id);
+ goto fail;
+ }
+
/* Take care of state transitions for 160 MHz and 80p80 */
if (spectral->ch_width == CH_WIDTH_160MHZ) {
ret = target_if_160mhz_delivery_state_change(
@@ -1744,7 +1764,9 @@
vdev = target_if_spectral_get_vdev(spectral);
if (!vdev) {
spectral_info("First vdev is NULL");
- reset_160mhz_delivery_state_machine(spectral);
+ reset_160mhz_delivery_state_machine
+ (spectral,
+ SPECTRAL_SCAN_MODE_NORMAL);
return -EPERM;
}
vdev_rxchainmask = wlan_vdev_mlme_get_rxchainmask(vdev);
@@ -1786,7 +1808,8 @@
fail:
spectral_err_rl("Error while processing Spectral report");
- reset_160mhz_delivery_state_machine(spectral);
+ reset_160mhz_delivery_state_machine(spectral,
+ SPECTRAL_SCAN_MODE_NORMAL);
return -EPERM;
}
diff --git a/umac/cmn_services/crypto/inc/wlan_crypto_global_def.h b/umac/cmn_services/crypto/inc/wlan_crypto_global_def.h
index 87c7e56..84c96f6 100644
--- a/umac/cmn_services/crypto/inc/wlan_crypto_global_def.h
+++ b/umac/cmn_services/crypto/inc/wlan_crypto_global_def.h
@@ -198,8 +198,9 @@
WLAN_CRYPTO_KEY_MGMT_FT_FILS_SHA384 = 21,
WLAN_CRYPTO_KEY_MGMT_OWE = 22,
WLAN_CRYPTO_KEY_MGMT_DPP = 23,
+ WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X_SHA384 = 24,
/** Keep WLAN_CRYPTO_KEY_MGMT_MAX at the end. */
- WLAN_CRYPTO_KEY_MGMT_MAX = WLAN_CRYPTO_KEY_MGMT_DPP,
+ WLAN_CRYPTO_KEY_MGMT_MAX = WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X_SHA384,
} wlan_crypto_key_mgmt;
enum wlan_crypto_key_type {
diff --git a/umac/cmn_services/crypto/src/wlan_crypto_def_i.h b/umac/cmn_services/crypto/src/wlan_crypto_def_i.h
index d25e8ff..7c21ccc 100644
--- a/umac/cmn_services/crypto/src/wlan_crypto_def_i.h
+++ b/umac/cmn_services/crypto/src/wlan_crypto_def_i.h
@@ -255,7 +255,7 @@
WLAN_RSN_SEL(11)
#define RSN_AUTH_KEY_MGMT_802_1X_SUITE_B_192\
WLAN_RSN_SEL(12)
-#define RSN_AUTH_KEY_MGMT_FT_802_1X_SUITE_B_192\
+#define RSN_AUTH_KEY_MGMT_FT_802_1X_SUITE_B_384\
WLAN_RSN_SEL(13)
#define RSN_AUTH_KEY_MGMT_FILS_SHA256 WLAN_RSN_SEL(14)
#define RSN_AUTH_KEY_MGMT_FILS_SHA384 WLAN_RSN_SEL(15)
diff --git a/umac/cmn_services/crypto/src/wlan_crypto_global_api.c b/umac/cmn_services/crypto/src/wlan_crypto_global_api.c
index 53ff4fa..ddb87d8 100644
--- a/umac/cmn_services/crypto/src/wlan_crypto_global_api.c
+++ b/umac/cmn_services/crypto/src/wlan_crypto_global_api.c
@@ -2259,6 +2259,8 @@
return WLAN_CRYPTO_KEY_MGMT_OWE;
case RSN_AUTH_KEY_MGMT_DPP:
return WLAN_CRYPTO_KEY_MGMT_DPP;
+ case RSN_AUTH_KEY_MGMT_FT_802_1X_SUITE_B_384:
+ return WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X_SHA384;
}
return status;
diff --git a/umac/cmn_services/inc/wlan_cmn.h b/umac/cmn_services/inc/wlan_cmn.h
index fa0b241..df9b84e 100644
--- a/umac/cmn_services/inc/wlan_cmn.h
+++ b/umac/cmn_services/inc/wlan_cmn.h
@@ -394,6 +394,19 @@
#define WLAN_PHYMODE_MAX (WLAN_PHYMODE_11AXA_HE80_80 + 1)
+#define IS_WLAN_PHYMODE_HE(_mode) ({typeof(_mode) mode = (_mode); \
+ ((mode) == WLAN_PHYMODE_11AXA_HE20) || \
+ ((mode) == WLAN_PHYMODE_11AXG_HE20) || \
+ ((mode) == WLAN_PHYMODE_11AXA_HE40PLUS) || \
+ ((mode) == WLAN_PHYMODE_11AXA_HE40MINUS) || \
+ ((mode) == WLAN_PHYMODE_11AXG_HE40PLUS) || \
+ ((mode) == WLAN_PHYMODE_11AXG_HE40MINUS) || \
+ ((mode) == WLAN_PHYMODE_11AXA_HE40) || \
+ ((mode) == WLAN_PHYMODE_11AXG_HE40) || \
+ ((mode) == WLAN_PHYMODE_11AXA_HE80) || \
+ ((mode) == WLAN_PHYMODE_11AXA_HE160) || \
+ ((mode) == WLAN_PHYMODE_11AXA_HE80_80); })
+
/**
* enum phy_ch_width - channel width
* @CH_WIDTH_20MHZ: 20 mhz width
diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c
index cf087b4..1f1d6c8 100644
--- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c
+++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c
@@ -26,11 +26,15 @@
#include <wlan_objmgr_peer_obj.h>
#include "wlan_objmgr_global_obj_i.h"
#include <qdf_mem.h>
+#include <qdf_platform.h>
#define LOG_DEL_OBJ_TIMEOUT_VALUE_MSEC 5000
#define LOG_DEL_OBJ_DESTROY_DURATION_SEC 5
-/* The max duration for which a obj can be allowed to remain in L-state */
-#define LOG_DEL_OBJ_DESTROY_ASSERT_DURATION_SEC 10
+/*
+ * The max duration for which a obj can be allowed to remain in L-state
+ * The duration should be higher than the psoc idle timeout.
+ */
+#define LOG_DEL_OBJ_DESTROY_ASSERT_DURATION_SEC 15
#define LOG_DEL_OBJ_LIST_MAX_COUNT (3 + 5 + 48 + 4096)
/**
@@ -357,8 +361,10 @@
wlan_objmgr_print_pending_refs(del_obj->obj, obj_type);
if (cur_tstamp > del_obj->tstamp +
- LOG_DEL_OBJ_DESTROY_ASSERT_DURATION_SEC)
- wlan_objmgr_debug_obj_destroyed_panic(obj_name);
+ LOG_DEL_OBJ_DESTROY_ASSERT_DURATION_SEC) {
+ if (!qdf_is_recovering() && !qdf_is_fw_down())
+ wlan_objmgr_debug_obj_destroyed_panic(obj_name);
+ }
status = qdf_list_peek_next(log_del_obj_list, node, &node);
diff --git a/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c b/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c
index b4eb746..187a55e 100644
--- a/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c
+++ b/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c
@@ -31,6 +31,20 @@
#include <wlan_cp_stats_utils_api.h>
#include "../../core/src/wlan_cp_stats_defs.h"
+static bool tgt_mc_cp_stats_is_last_event(struct stats_event *ev)
+{
+ bool is_last_event;
+
+ if (IS_MSB_SET(ev->last_event)) {
+ is_last_event = IS_LSB_SET(ev->last_event);
+ cp_stats_debug("is_last_event %d", is_last_event);
+ } else {
+ cp_stats_debug("FW does not support last event bit");
+ is_last_event = !!ev->peer_stats;
+ }
+ return is_last_event;
+}
+
void tgt_cp_stats_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
{
rx_ops->cp_stats_rx_ops.process_stats_event =
@@ -520,8 +534,10 @@
return;
tgt_mc_cp_stats_extract_peer_extd_stats(psoc, ev);
- tgt_mc_cp_stats_prepare_raw_peer_rssi(psoc, &last_req);
- ucfg_mc_cp_stats_reset_pending_req(psoc, TYPE_PEER_STATS);
+ if (tgt_mc_cp_stats_is_last_event(ev)) {
+ tgt_mc_cp_stats_prepare_raw_peer_rssi(psoc, &last_req);
+ ucfg_mc_cp_stats_reset_pending_req(psoc, TYPE_PEER_STATS);
+ }
}
static void tgt_mc_cp_stats_extract_cca_stats(struct wlan_objmgr_psoc *psoc,
@@ -804,14 +820,8 @@
struct stats_event *ev)
{
QDF_STATUS status;
- bool is_last_event;
struct request_info last_req = {0};
- if (IS_MSB_SET(ev->last_event))
- is_last_event = IS_LSB_SET(ev->last_event);
- else
- is_last_event = !!ev->peer_stats;
-
status = ucfg_mc_cp_stats_get_pending_req(psoc,
TYPE_STATION_STATS,
&last_req);
@@ -829,7 +839,7 @@
* PEER stats are the last stats sent for get_station statistics.
* reset type_map bit for station stats .
*/
- if (is_last_event) {
+ if (tgt_mc_cp_stats_is_last_event(ev)) {
tgt_mc_cp_stats_prepare_n_send_raw_station_stats(psoc,
&last_req);
ucfg_mc_cp_stats_reset_pending_req(psoc, TYPE_STATION_STATS);
diff --git a/umac/dfs/core/src/misc/dfs_random_chan_sel.c b/umac/dfs/core/src/misc/dfs_random_chan_sel.c
index 734177d..1ac50a0 100644
--- a/umac/dfs/core/src/misc/dfs_random_chan_sel.c
+++ b/umac/dfs/core/src/misc/dfs_random_chan_sel.c
@@ -1262,6 +1262,7 @@
bool flag_no_japan_w53 = 0;
int i;
bool found = false;
+ uint16_t j;
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN, "flags %d", flags);
flag_no_weather = (dfs_region == DFS_ETSI_REGION_VAL) ?
@@ -1299,8 +1300,8 @@
}
if (acs_info && acs_info->acs_mode) {
- for (i = 0; i < acs_info->num_of_channel; i++) {
- if (acs_info->channel_list[i] ==
+ for (j = 0; j < acs_info->num_of_channel; j++) {
+ if (acs_info->channel_list[j] ==
chan->dfs_ch_ieee) {
found = true;
break;
diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h
index 03e5fb1..776854b 100644
--- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h
+++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h
@@ -212,7 +212,7 @@
* @beacon_tmpl_send: function to send beacon template
* @vdev_bcn_miss_offload_send: function to send beacon miss offload
* @vdev_sta_ps_param_send: function to sent STA power save config
- * @target_is_pre_lithium: function to get target type status
+ * @peer_delete_all_send: function to send vdev delete all peer request
*/
struct wlan_lmac_if_mlme_tx_ops {
void (*scan_sta_power_events)(struct wlan_objmgr_pdev *pdev,
@@ -277,6 +277,9 @@
QDF_STATUS (*vdev_bcn_miss_offload_send)(struct wlan_objmgr_vdev *vdev);
QDF_STATUS (*vdev_sta_ps_param_send)(struct wlan_objmgr_vdev *vdev,
struct sta_ps_params *param);
+ QDF_STATUS (*peer_delete_all_send)(
+ struct wlan_objmgr_vdev *vdev,
+ struct peer_delete_all_params *param);
#endif
};
@@ -1389,13 +1392,16 @@
* @wlan_mlme_get_traffic_indication_timestamp: function to get tid timestamp
* @wlan_mlme_get_acs_in_progress: function to get ACS progress
* @wlan_mlme_end_scan: function to end scan
- * @mlme_get_rsp_timer: function to get vdev mgr response timer
- * @mlme_response_timeout_cb: function to trigger on response time expiry
- * @mlme_start_response: function to handle vdev start response
- * @mlme_stop_response: function to handle vdev stop response
- * @mlme_offload_bcn_tx_status_event_handle: function to get offload beacon tx
- * status
- * @mlme_tbttoffset_update_handle: function to handle tbttoffset event
+ * @vdev_mgr_get_response_timer_info: function to get response timer info
+ * @vdev_mgr_start_response: function to handle start response
+ * @vdev_mgr_stop_response: function to handle stop response
+ * @vdev_mgr_delete_response: function to handle delete response
+ * @vdev_mgr_offload_bcn_tx_status_event_handle: function to handle offload
+ * beacon tx
+ * @vdev_mgr_tbttoffset_update_handle: function to handle tbtt offset event
+ * @vdev_mgr_peer_delete_all_response: function to handle vdev delete all peer
+ * event
+ * @vdev_mgr_get_wakelock_info: function to get wakelock info
*/
struct wlan_lmac_if_mlme_rx_ops {
@@ -1473,6 +1479,9 @@
QDF_STATUS (*vdev_mgr_tbttoffset_update_handle)(
uint32_t num_vdevs,
bool is_ext);
+ QDF_STATUS (*vdev_mgr_peer_delete_all_response)(
+ struct wlan_objmgr_psoc *psoc,
+ struct peer_delete_all_response *rsp);
#ifdef FEATURE_VDEV_RSP_WAKELOCK
struct vdev_mlme_wakelock *(*vdev_mgr_get_wakelock_info)(
struct wlan_objmgr_vdev *vdev);
diff --git a/umac/mlme/include/wlan_vdev_mlme.h b/umac/mlme/include/wlan_vdev_mlme.h
index 2742582..d5e2ef3 100644
--- a/umac/mlme/include/wlan_vdev_mlme.h
+++ b/umac/mlme/include/wlan_vdev_mlme.h
@@ -438,6 +438,8 @@
* @mlme_vdev_notify_start_state_exit: callback to notify on vdev start
* start state exit
* @mlme_vdev_is_newchan_no_cac: callback to check CAC is required
+ * @mlme_vdev_ext_peer_delete_all_rsp: callback to initiate actions for
+ * vdev mlme peer delete all response
*/
struct vdev_mlme_ops {
QDF_STATUS (*mlme_vdev_validate_basic_params)(
@@ -509,6 +511,9 @@
struct vdev_mlme_obj *vdev_mlme);
QDF_STATUS (*mlme_vdev_is_newchan_no_cac)(
struct vdev_mlme_obj *vdev_mlme);
+ QDF_STATUS (*mlme_vdev_ext_peer_delete_all_rsp)(
+ struct vdev_mlme_obj *vdev_mlme,
+ struct peer_delete_all_response *rsp);
};
#ifdef FEATURE_VDEV_RSP_WAKELOCK
diff --git a/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c b/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c
index fa3002c..70404a1 100644
--- a/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c
+++ b/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c
@@ -526,3 +526,41 @@
return tgt_vdev_mgr_set_custom_aggr_size_send(vdev_mlme, ¶m);
}
+
+static QDF_STATUS vdev_mgr_peer_delete_all_param_update(
+ struct vdev_mlme_obj *mlme_obj,
+ struct peer_delete_all_params *param)
+{
+ struct wlan_objmgr_vdev *vdev;
+
+ vdev = mlme_obj->vdev;
+ if (!vdev) {
+ mlme_err("VDEV is NULL");
+ return QDF_STATUS_E_INVAL;
+ }
+
+ param->vdev_id = wlan_vdev_get_id(vdev);
+ return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS vdev_mgr_peer_delete_all_send(struct vdev_mlme_obj *mlme_obj)
+{
+ QDF_STATUS status;
+ struct peer_delete_all_params param = {0};
+
+ if (!mlme_obj) {
+ mlme_err("Invalid input");
+ return QDF_STATUS_E_INVAL;
+ }
+
+ status = vdev_mgr_peer_delete_all_param_update(mlme_obj, ¶m);
+ if (QDF_IS_STATUS_ERROR(status)) {
+ mlme_err("Param Update Error: %d", status);
+ return status;
+ }
+
+ status = tgt_vdev_mgr_peer_delete_all_send(mlme_obj, ¶m);
+
+ return status;
+}
+
diff --git a/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.h b/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.h
index 9ce437d..06ba419 100644
--- a/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.h
+++ b/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.h
@@ -229,5 +229,13 @@
uint32_t *vdev_ids,
uint32_t num_vdevs);
+/**
+ * vdev_mgr_peer_delete_all_send() – MLME API to send peer delete all request
+ * @mlme_obj: pointer to vdev_mlme_obj
+ *
+ * Return: QDF_STATUS - Success or Failure
+ */
+QDF_STATUS vdev_mgr_peer_delete_all_send(struct vdev_mlme_obj *mlme_obj);
+
#endif /* CMN_VDEV_MGR_TGT_IF_ENABLE */
#endif /* __VDEV_MGR_OPS_H__ */
diff --git a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_rx_defs.h b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_rx_defs.h
index 2dce8e7..a237b58 100644
--- a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_rx_defs.h
+++ b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_rx_defs.h
@@ -32,12 +32,13 @@
#define RESTART_RESPONSE_BIT 0x2
#define STOP_RESPONSE_BIT 0x3
#define DELETE_RESPONSE_BIT 0x4
-#define RESPONSE_BIT_MAX (START_RESPONSE_BIT | RESTART_RESPONSE_BIT |\
- STOP_RESPONSE_BIT | DELETE_RESPONSE_BIT)
+#define PEER_DELETE_ALL_RESPONSE_BIT 0x5
+#define RESPONSE_BIT_MAX PEER_DELETE_ALL_RESPONSE_BIT
#define START_RESPONSE_TIMER 6000 /* 6 seconds */
#define STOP_RESPONSE_TIMER 3000 /* 3 seconds */
#define DELETE_RESPONSE_TIMER 3000 /* 3 seconds */
+#define PEER_DELETE_ALL_RESPONSE_TIMER 6000 /* 6 seconds */
/**
* struct vdev_response_timer - vdev mgmt response ops timer
@@ -93,4 +94,14 @@
uint8_t vdev_id;
};
+/**
+ * struct peer_delete_all_response - peer delete all response structure
+ * @vdev_id: vdev id
+ * @status: FW status for vdev delete all peer request
+ */
+struct peer_delete_all_response {
+ uint8_t vdev_id;
+ uint8_t status;
+};
+
#endif /* __WLAN_VDEV_MGR_TGT_IF_RX_DEFS_H__ */
diff --git a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_api.h b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_api.h
index bb50fef..fda5343 100644
--- a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_api.h
+++ b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_api.h
@@ -253,5 +253,16 @@
*/
QDF_STATUS tgt_vdev_mgr_bcn_miss_offload_send(struct vdev_mlme_obj *mlme_obj);
+/**
+ * tgt_vdev_mgr_peer_delete_all_send() – API to send peer delete all request
+ * @mlme_obj: pointer to vdev_mlme_obj
+ * @param: pointer to peer_delete_all_params
+ *
+ * Return: QDF_STATUS - Success or Failure
+ */
+QDF_STATUS tgt_vdev_mgr_peer_delete_all_send(
+ struct vdev_mlme_obj *mlme_obj,
+ struct peer_delete_all_params *param);
+
#endif /* CMN_VDEV_MGR_TGT_IF_ENABLE */
#endif /* __WLAN_VDEV_MGR_TX_OPS_API_H__ */
diff --git a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h
index 71e1b9f..eaef5b8 100644
--- a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h
+++ b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h
@@ -442,5 +442,13 @@
uint8_t vdev_id;
};
+/**
+ * struct peer_delete_all_params - peer delete all request parameter
+ * @vdev_id: vdev id
+ */
+struct peer_delete_all_params {
+ uint8_t vdev_id;
+};
+
#endif
#endif /* __WLAN_VDEV_MGR_TX_OPS_DEFS_H__ */
diff --git a/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_rx_api.c b/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_rx_api.c
index e00cb35..cfacf07 100644
--- a/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_rx_api.c
+++ b/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_rx_api.c
@@ -72,11 +72,6 @@
}
vdev_rsp = &vdev_mlme->vdev_rt;
- if (!vdev_rsp) {
- mlme_err("VDEV_%d: Invalid response", rsp->vdev_id);
- goto tgt_vdev_mgr_start_response_handler_end;
- }
-
tx_ops = target_if_vdev_mgr_get_tx_ops(psoc);
if (rsp->resp_type == RESTART_RESPONSE)
status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
@@ -127,11 +122,6 @@
}
vdev_rsp = &vdev_mlme->vdev_rt;
- if (!vdev_rsp) {
- mlme_err("VDEV_%d: Invalid response", rsp->vdev_id);
- goto tgt_vdev_mgr_stop_response_handler_end;
- }
-
tx_ops = target_if_vdev_mgr_get_tx_ops(psoc);
status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
STOP_RESPONSE_BIT);
@@ -149,7 +139,7 @@
return status;
}
-QDF_STATUS tgt_vdev_mgr_delete_response_handler(
+static QDF_STATUS tgt_vdev_mgr_delete_response_handler(
struct wlan_objmgr_psoc *psoc,
struct vdev_delete_response *rsp)
{
@@ -179,11 +169,6 @@
}
vdev_rsp = &vdev_mlme->vdev_rt;
- if (!vdev_rsp) {
- mlme_err("VDEV_%d: Invalid response", rsp->vdev_id);
- goto tgt_vdev_mgr_delete_response_handler_end;
- }
-
tx_ops = target_if_vdev_mgr_get_tx_ops(psoc);
status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
DELETE_RESPONSE_BIT);
@@ -203,6 +188,55 @@
return status;
}
+static QDF_STATUS tgt_vdev_mgr_peer_delete_all_response_handler(
+ struct wlan_objmgr_psoc *psoc,
+ struct peer_delete_all_response *rsp)
+{
+ QDF_STATUS status = QDF_STATUS_E_FAILURE;
+ struct vdev_mlme_obj *vdev_mlme;
+ struct wlan_objmgr_vdev *vdev;
+ struct vdev_response_timer *vdev_rsp;
+ struct wlan_lmac_if_mlme_tx_ops *tx_ops;
+
+ if (!rsp || !psoc) {
+ mlme_err("Invalid input");
+ return QDF_STATUS_E_INVAL;
+ }
+
+ vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc,
+ rsp->vdev_id,
+ WLAN_VDEV_TARGET_IF_ID);
+ if (!vdev) {
+ mlme_err("VDEV is NULL");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
+ if (!vdev_mlme) {
+ mlme_err("VDEV_%d: VDEV_MLME is NULL", rsp->vdev_id);
+ goto tgt_vdev_mgr_peer_delete_all_response_handler_end;
+ }
+
+ vdev_rsp = &vdev_mlme->vdev_rt;
+ tx_ops = target_if_vdev_mgr_get_tx_ops(psoc);
+ status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
+ PEER_DELETE_ALL_RESPONSE_BIT);
+ if (QDF_IS_STATUS_ERROR(status)) {
+ mlme_err("VDEV_%d: Unexpected response", rsp->vdev_id);
+ goto tgt_vdev_mgr_peer_delete_all_response_handler_end;
+ }
+
+ if ((vdev_mlme->ops) &&
+ vdev_mlme->ops->mlme_vdev_ext_peer_delete_all_rsp)
+ status = vdev_mlme->ops->mlme_vdev_ext_peer_delete_all_rsp(
+ vdev_mlme,
+ rsp);
+
+tgt_vdev_mgr_peer_delete_all_response_handler_end:
+ wlan_objmgr_vdev_release_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
+ return status;
+}
+
static QDF_STATUS
tgt_vdev_mgr_offload_bcn_tx_status_event_handler(uint32_t vdev_id,
uint32_t tx_status)
@@ -272,6 +306,8 @@
tgt_vdev_mgr_stop_response_handler;
mlme_rx_ops->vdev_mgr_delete_response =
tgt_vdev_mgr_delete_response_handler;
+ mlme_rx_ops->vdev_mgr_peer_delete_all_response =
+ tgt_vdev_mgr_peer_delete_all_response_handler;
mlme_rx_ops->vdev_mgr_get_response_timer_info =
tgt_vdev_mgr_get_response_timer_info;
diff --git a/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_tx_api.c b/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_tx_api.c
index a27b2e6..1344bc2 100644
--- a/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_tx_api.c
+++ b/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_tx_api.c
@@ -575,3 +575,32 @@
return status;
}
+
+QDF_STATUS tgt_vdev_mgr_peer_delete_all_send(
+ struct vdev_mlme_obj *mlme_obj,
+ struct peer_delete_all_params *param)
+{
+ QDF_STATUS status;
+ struct wlan_lmac_if_mlme_tx_ops *txops;
+ struct wlan_objmgr_vdev *vdev;
+ uint8_t vdev_id;
+
+ if (!param) {
+ mlme_err("Invalid input");
+ return QDF_STATUS_E_INVAL;
+ }
+
+ vdev = mlme_obj->vdev;
+ vdev_id = wlan_vdev_get_id(vdev);
+ txops = wlan_vdev_mlme_get_lmac_txops(vdev);
+ if (!txops || !txops->peer_delete_all_send) {
+ mlme_err("VDEV_%d: No Tx Ops", vdev_id);
+ return QDF_STATUS_E_INVAL;
+ }
+
+ status = txops->peer_delete_all_send(vdev, param);
+ if (QDF_IS_STATUS_ERROR(status))
+ mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
+
+ return QDF_STATUS_SUCCESS;
+}
diff --git a/umac/regulatory/core/src/reg_lte.c b/umac/regulatory/core/src/reg_lte.c
index 20a1e7d..22ccbfb 100644
--- a/umac/regulatory/core/src/reg_lte.c
+++ b/umac/regulatory/core/src/reg_lte.c
@@ -190,6 +190,11 @@
reg_err("reg psoc private obj is NULL");
return QDF_STATUS_E_FAILURE;
}
+ if (CH_AVOID_RULE_DO_NOT_RESTART ==
+ psoc_priv_obj->restart_beaconing) {
+ reg_debug("skipping all LTE Coex unsafe channel range");
+ return QDF_STATUS_SUCCESS;
+ }
/* Make unsafe channel list */
reg_debug("band count %d", ch_avoid_event->ch_avoid_range_cnt);
diff --git a/umac/scan/core/src/wlan_scan_manager.c b/umac/scan/core/src/wlan_scan_manager.c
index 32490a8..140f8aa 100644
--- a/umac/scan/core/src/wlan_scan_manager.c
+++ b/umac/scan/core/src/wlan_scan_manager.c
@@ -747,6 +747,46 @@
}
}
+/**
+ * scm_scan_chlist_concurrency_modify() - modify chan list to skip 5G if
+ * required
+ * @vdev: vdev object
+ * @req: scan request
+ *
+ * Check and skip 5G chan list based on DFS AP present and current hw mode.
+ *
+ * Return: void
+ */
+static inline void scm_scan_chlist_concurrency_modify(
+ struct wlan_objmgr_vdev *vdev, struct scan_start_request *req)
+{
+ struct wlan_objmgr_psoc *psoc;
+ uint32_t i;
+ uint32_t num_scan_channels;
+
+ psoc = wlan_vdev_get_psoc(vdev);
+ if (!psoc)
+ return;
+ /* do this only for STA and P2P-CLI mode */
+ if (!(wlan_vdev_mlme_get_opmode(req->vdev) == QDF_STA_MODE) &&
+ !(wlan_vdev_mlme_get_opmode(req->vdev) == QDF_P2P_CLIENT_MODE))
+ return;
+ if (!policy_mgr_scan_trim_5g_chnls_for_dfs_ap(psoc))
+ return;
+ num_scan_channels = 0;
+ for (i = 0; i < req->scan_req.chan_list.num_chan; i++) {
+ if (WLAN_REG_IS_5GHZ_CH_FREQ(
+ req->scan_req.chan_list.chan[i].freq)) {
+ continue;
+ }
+ req->scan_req.chan_list.chan[num_scan_channels++] =
+ req->scan_req.chan_list.chan[i];
+ }
+ if (num_scan_channels < req->scan_req.chan_list.num_chan)
+ scm_debug("5g chan skipped (%d, %d)",
+ req->scan_req.chan_list.num_chan, num_scan_channels);
+ req->scan_req.chan_list.num_chan = num_scan_channels;
+}
#else
static inline
void scm_req_update_concurrency_params(struct wlan_objmgr_vdev *vdev,
@@ -759,6 +799,11 @@
scm_update_dbs_scan_ctrl_ext_flag(struct scan_start_request *req)
{
}
+
+static inline void scm_scan_chlist_concurrency_modify(
+ struct wlan_objmgr_vdev *vdev, struct scan_start_request *req)
+{
+}
#endif
/**
@@ -831,6 +876,7 @@
req->scan_req.chan_list.chan[i];
}
req->scan_req.chan_list.num_chan = num_scan_channels;
+ scm_scan_chlist_concurrency_modify(req->vdev, req);
}
/**
diff --git a/utils/pktlog/pktlog_internal.c b/utils/pktlog/pktlog_internal.c
index 9e8ced8..f774929 100644
--- a/utils/pktlog/pktlog_internal.c
+++ b/utils/pktlog/pktlog_internal.c
@@ -1413,6 +1413,11 @@
struct ath_pktlog_info *pl_info;
qdf_nbuf_t log_nbuf = (qdf_nbuf_t)data;
+ if (!pl_dev) {
+ qdf_err("Pktlog handle is NULL");
+ return -EINVAL;
+ }
+
pl_info = pl_dev->pl_info;
qdf_mem_zero(&pl_hdr, sizeof(pl_hdr));
pl_hdr.flags = (1 << PKTLOG_FLG_FRM_TYPE_REMOTE_S);
@@ -1427,7 +1432,7 @@
if (!rxstat_log.rx_desc) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
"%s: Rx descriptor is NULL", __func__);
- return -EFAULT;
+ return -EINVAL;
}
qdf_mem_copy(rxstat_log.rx_desc, qdf_nbuf_data(log_nbuf), pl_hdr.size);
@@ -1446,6 +1451,11 @@
size_t log_size;
qdf_nbuf_t log_nbuf = (qdf_nbuf_t)log_data;
+ if (!pl_dev) {
+ qdf_err("Pktlog handle is NULL");
+ return -EINVAL;
+ }
+
pl_info = pl_dev->pl_info;
qdf_mem_zero(&pl_hdr, sizeof(pl_hdr));
pl_hdr.flags = (1 << PKTLOG_FLG_FRM_TYPE_REMOTE_S);
@@ -1459,7 +1469,7 @@
if (!rxstat_log.rx_desc) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
"%s: Rx descriptor is NULL", __func__);
- return -EFAULT;
+ return -EINVAL;
}
qdf_mem_copy(rxstat_log.rx_desc, qdf_nbuf_data(log_nbuf), pl_hdr.size);
diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h
index 402bba6..40e64e7 100644
--- a/wlan_cfg/cfg_dp.h
+++ b/wlan_cfg/cfg_dp.h
@@ -38,7 +38,6 @@
#define WLAN_CFG_NUM_TCL_DATA_RINGS_MIN 3
#define WLAN_CFG_NUM_TCL_DATA_RINGS_MAX 3
-#ifdef CONFIG_MCL
#if defined(QCA_LL_TX_FLOW_CONTROL_V2) || \
defined(QCA_LL_PDEV_TX_FLOW_CONTROL)
#define WLAN_CFG_TX_FLOW_START_QUEUE_OFFSET 10
@@ -47,12 +46,11 @@
#define WLAN_CFG_TX_FLOW_START_QUEUE_OFFSET 0
#define WLAN_CFG_TX_FLOW_STOP_QUEUE_TH 0
#endif
-#endif
#define WLAN_CFG_PER_PDEV_TX_RING_MIN 0
#define WLAN_CFG_PER_PDEV_TX_RING_MAX 1
-#ifdef CONFIG_MCL
+#if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
#define WLAN_CFG_PER_PDEV_RX_RING 0
#define WLAN_CFG_PER_PDEV_LMAC_RING 0
#define WLAN_LRO_ENABLE 0
diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c
index 44a5ffb..0e416cf 100644
--- a/wlan_cfg/wlan_cfg.c
+++ b/wlan_cfg/wlan_cfg.c
@@ -90,7 +90,7 @@
#define WLAN_CFG_HOST2RXDMA_RING_MASK_2 0x4
#define WLAN_CFG_HOST2RXDMA_RING_MASK_3 0x0
-#ifdef CONFIG_MCL
+#if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
static const int tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = {
WLAN_CFG_TX_RING_MASK_0, 0, 0, 0, 0, 0, 0};
@@ -201,7 +201,7 @@
WLAN_CFG_REO_STATUS_RING_MASK_1,
WLAN_CFG_REO_STATUS_RING_MASK_2,
WLAN_CFG_REO_STATUS_RING_MASK_3};
-#endif /*CONFIG_MCL*/
+#endif /* MAX_PDEV_CNT == 1 */
/**
* g_wlan_srng_cfg[] - Per ring_type specific configuration
diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h
index a50fcc0..4c57563 100644
--- a/wlan_cfg/wlan_cfg.h
+++ b/wlan_cfg/wlan_cfg.h
@@ -23,7 +23,7 @@
* Temporary place holders. These should come either from target config
* or platform configuration
*/
-#if defined(CONFIG_MCL)
+#if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
#define WLAN_CFG_DST_RING_CACHED_DESC 0
#define MAX_PDEV_CNT 1
#define WLAN_CFG_INT_NUM_CONTEXTS 7
@@ -56,7 +56,7 @@
#define MAX_RX_MAC_RINGS 2
/* DP process status */
-#ifdef CONFIG_MCL
+#if defined(MAX_PDEV_CNT) && (MAX_PDEV_CNT == 1)
#define CONFIG_PROCESS_RX_STATUS 1
#define CONFIG_PROCESS_TX_STATUS 1
#else
diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h
index 4d1a963..d279493 100644
--- a/wmi/inc/wmi_unified_param.h
+++ b/wmi/inc/wmi_unified_param.h
@@ -622,6 +622,7 @@
* @allow_ht: HT allowed in chan
* @allow_vht: VHT allowed on chan
* @set_agile: is agile mode
+ * @allow_he: HE allowed on chan
* @phy_mode: phymode (vht80 or ht40 or ...)
* @cfreq1: centre frequency on primary
* @cfreq2: centre frequency on secondary
@@ -643,7 +644,8 @@
is_chan_passive:1,
allow_ht:1,
allow_vht:1,
- set_agile:1;
+ set_agile:1,
+ allow_he:1;
uint32_t phy_mode;
uint32_t cfreq1;
uint32_t cfreq2;
diff --git a/wmi/src/wmi_unified_pmo_tlv.c b/wmi/src/wmi_unified_pmo_tlv.c
index ee45ba5..e401bd4 100644
--- a/wmi/src/wmi_unified_pmo_tlv.c
+++ b/wmi/src/wmi_unified_pmo_tlv.c
@@ -808,8 +808,8 @@
cmd->flags = gtk_offload_opcode;
/* Copy the keys and replay counter */
- qdf_mem_copy(cmd->KCK, params->kck, PMO_KCK_LEN);
- qdf_mem_copy(cmd->KEK, params->kek, PMO_KEK_LEN_LEGACY);
+ qdf_mem_copy(cmd->KCK, params->kck, sizeof(cmd->KCK));
+ qdf_mem_copy(cmd->KEK, params->kek, sizeof(cmd->KEK));
qdf_mem_copy(cmd->replay_counter, ¶ms->replay_counter,
GTK_REPLAY_COUNTER_BYTES);
} else {
diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c
index 89b6033..1a16bb7 100644
--- a/wmi/src/wmi_unified_tlv.c
+++ b/wmi/src/wmi_unified_tlv.c
@@ -3005,6 +3005,9 @@
if (tchan_info->dfs_set)
WMI_SET_CHANNEL_FLAG(chan_info,
WMI_CHAN_FLAG_DFS);
+ if (tchan_info->allow_he)
+ WMI_SET_CHANNEL_FLAG(chan_info,
+ WMI_CHAN_FLAG_ALLOW_HE);
if (tchan_info->allow_vht)
WMI_SET_CHANNEL_FLAG(chan_info,