summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-11-24 00:56:44 -0700
committerLinux Build Service Account <lnxbuild@localhost>2016-11-24 00:56:44 -0700
commit73ea65b4b2ffd0474a5cab76075aa84d498d0e51 (patch)
tree7f6b1dcf606dfc5370447d8bce90a93ba29f4ffa
parentd7dab9f4d00bef449233cae27b18a01bd8bc17eb (diff)
parentd61a5d8007581f009d1db38fe0c907941a51103a (diff)
Promotion of wlan-cmn.driver.lnx.1.0-00103.
CRs Change ID Subject -------------------------------------------------------------------------------------------------------------- 1092258 I3bdf43594f68cb0780f2947fff9db723644b5dac qcacmn: Populate qos_enabled in roam_scan_offload_cmd 962246 I6c3dca17c82fdfd2bdadcee319cc157e6aa2ead9 qcacmn: Define IBSS mode 688141 I1d5e03e7c16a8bb6ae5ca8ba603430fcb9c2e8c4 Release 5.1.0.25O 1089902 I0d42c716ab8941b1de22a456447797c9ba5475c8 qcacmn: Use sched_clock instead of jiffies to calc yield 1043805 I4706c57e8c1b684bfe164b23fc0902c376d4d80a qcacmn: Adjust buffer size for fw dump 688141 Iecd5b17c3e79f3dd457e3161e2689c8d3a3edce2 Release 5.1.0.25P 688141 I30fb40ebefa922bc4ef05dae6a941f8daed6250d Release 5.1.0.25S 946520 Id880c5fe423eb0b2a2c01677d8fa7c4a784c74df qcacmn: Add support for multiple instances of the host d 688141 Ifefe797d084641aa3620d7d29821f4b6d697d42c Release 5.1.0.25Q 688141 Ife7715e747808b946a2c8e7fbf69513fcd939910 Release 5.1.0.25M 1077223 I6844f1329427e7065dc3e4e64bf105087d963dd9 qcacmn: Protect the TxQueue in failure 1076563 Iaf52a3dcecac2f7b24fde2f8220fbfddc767965b qcacmn: Add NAPI statistics to dumpstats 688141 I739e87ab5f677e4dc44b735299f7ececd172d563 Release 5.1.0.25R 1091702 I342360f48f73a1e5ef42ebc4ca38366669eea0e0 qcacmn: Fix -Wmissing-prototypes in HIF 1091483 Ieb81b2eeec546a6128c6b878db4c65ccb8b62bda qcacmn: correct napi bucket calculation 688141 If8d0a08e9fe6c0aa1177ec662db02f966ff8fd6e Release 5.1.0.25N Change-Id: I4b96b819dc5cb171e327312a83eba3351af87949 CRs-Fixed: 1091483, 1092258, 688141, 1091702, 1077223, 1043805, 962246, 1089902, 1076563, 946520
-rw-r--r--VERSION.txt2
-rw-r--r--dp/inc/cdp_txrx_stats.h5
-rw-r--r--hif/inc/hif.h6
-rw-r--r--hif/inc/hif_napi.h16
-rw-r--r--hif/src/ath_procfs.c4
-rw-r--r--hif/src/ce/ce_bmi.c1
-rw-r--r--hif/src/ce/ce_diag.c4
-rw-r--r--hif/src/ce/ce_internal.h3
-rw-r--r--hif/src/ce/ce_main.c14
-rw-r--r--hif/src/ce/ce_main.h4
-rw-r--r--hif/src/ce/ce_service.c40
-rw-r--r--hif/src/ce/ce_tasklet.c5
-rw-r--r--hif/src/dispatcher/multibus.c1
-rw-r--r--hif/src/hif_napi.c102
-rw-r--r--hif/src/mp_dev.c3
-rw-r--r--hif/src/pcie/if_pci.c32
-rw-r--r--hif/src/snoc/if_snoc.c1
-rw-r--r--hif/src/usb/if_usb.c13
-rw-r--r--hif/src/usb/if_usb.h3
-rw-r--r--htc/htc_send.c3
-rw-r--r--qdf/inc/qdf_types.h2
-rw-r--r--wmi/src/wmi_unified_tlv.c2
22 files changed, 198 insertions, 68 deletions
diff --git a/VERSION.txt b/VERSION.txt
index 9d8872cacc40..e8239ac52e49 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1,2 +1,2 @@
-Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.25L
+Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.25S
Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22D
diff --git a/dp/inc/cdp_txrx_stats.h b/dp/inc/cdp_txrx_stats.h
index 419282008f9e..68bdad74ad1b 100644
--- a/dp/inc/cdp_txrx_stats.h
+++ b/dp/inc/cdp_txrx_stats.h
@@ -31,9 +31,10 @@
*/
#ifndef _CDP_TXRX_STATS_H_
#define _CDP_TXRX_STATS_H_
+#include <qdf_status.h>
-void ol_txrx_display_stats(uint16_t bitmap);
-void ol_txrx_clear_stats(uint16_t bitmap);
+QDF_STATUS ol_txrx_display_stats(uint16_t bitmap);
+QDF_STATUS ol_txrx_clear_stats(uint16_t bitmap);
int ol_txrx_stats(uint8_t vdev_id, char *buffer, unsigned buf_len);
#endif /* _CDP_TXRX_STATS_H_ */
diff --git a/hif/inc/hif.h b/hif/inc/hif.h
index 1267f919ff62..39dfa059a5ad 100644
--- a/hif/inc/hif.h
+++ b/hif/inc/hif.h
@@ -108,13 +108,15 @@ struct CE_state;
/* NOTE: "napi->scale" can be changed,
but this does not change the number of buckets */
-#define QCA_NAPI_NUM_BUCKETS (QCA_NAPI_BUDGET / QCA_NAPI_DEF_SCALE)
+#define QCA_NAPI_NUM_BUCKETS 4
struct qca_napi_stat {
uint32_t napi_schedules;
uint32_t napi_polls;
uint32_t napi_completes;
uint32_t napi_workdone;
uint32_t napi_budget_uses[QCA_NAPI_NUM_BUCKETS];
+ uint32_t time_limit_reached;
+ uint32_t rxpkt_thresh_reached;
};
/**
@@ -127,7 +129,7 @@ struct qca_napi_stat {
struct qca_napi_info {
struct net_device netdev; /* dummy net_dev */
void *hif_ctx;
- struct napi_struct napi; /* one NAPI Instance per CE in phase I */
+ struct napi_struct napi;
uint8_t scale; /* currently same on all instances */
uint8_t id;
int irq;
diff --git a/hif/inc/hif_napi.h b/hif/inc/hif_napi.h
index b742a9ddb016..8d34dd34a233 100644
--- a/hif/inc/hif_napi.h
+++ b/hif/inc/hif_napi.h
@@ -129,6 +129,20 @@ int hif_napi_schedule(struct hif_opaque_softc *scn, int ce_id);
/* called by hdd_napi, which is called by kernel */
int hif_napi_poll(struct hif_opaque_softc *hif_ctx,
struct napi_struct *napi, int budget);
+#ifdef HELIUMPLUS
+/* called to retrieve NAPI CPU statistics */
+void hif_napi_stats(struct qca_napi_data *napid);
+void hif_napi_update_yield_stats(struct CE_state *ce_state,
+ bool time_limit_reached,
+ bool rxpkt_thresh_reached);
+#else
+static inline void hif_napi_stats(struct qca_napi_data *napid) { }
+
+static inline void hif_napi_update_yield_stats(struct CE_state *ce_state,
+ bool time_limit_reached,
+ bool rxpkt_thresh_reached) { }
+
+#endif
#ifdef FEATURE_NAPI_DEBUG
#define NAPI_DEBUG(fmt, ...) \
@@ -224,6 +238,8 @@ static inline int hif_napi_schedule(struct hif_opaque_softc *hif, int ce_id)
static inline int hif_napi_poll(struct napi_struct *napi, int budget)
{ return -EPERM; }
+static inline void hif_napi_stats(struct qca_napi_data *napid) { }
+
#endif /* FEATURE_NAPI */
#endif /* __HIF_NAPI_H__ */
diff --git a/hif/src/ath_procfs.c b/hif/src/ath_procfs.c
index d1f720286633..0a19c65eaa58 100644
--- a/hif/src/ath_procfs.c
+++ b/hif/src/ath_procfs.c
@@ -43,7 +43,11 @@
#include "pld_common.h"
#define PROCFS_NAME "athdiagpfs"
+#ifdef MULTI_IF_NAME
+#define PROCFS_DIR "cld" MULTI_IF_NAME
+#else
#define PROCFS_DIR "cld"
+#endif
/**
* This structure hold information about the /proc file
diff --git a/hif/src/ce/ce_bmi.c b/hif/src/ce/ce_bmi.c
index 4f3bcc6d790f..15fcdcbf5aa2 100644
--- a/hif/src/ce/ce_bmi.c
+++ b/hif/src/ce/ce_bmi.c
@@ -38,6 +38,7 @@
#include <a_debug.h>
#include "hif_main.h"
#include "ce_api.h"
+#include "ce_bmi.h"
#include "qdf_trace.h"
#include "hif_debug.h"
diff --git a/hif/src/ce/ce_diag.c b/hif/src/ce/ce_diag.c
index c96d0a316e79..8b956c5f9b06 100644
--- a/hif/src/ce/ce_diag.c
+++ b/hif/src/ce/ce_diag.c
@@ -103,8 +103,8 @@ hif_ce_dump_target_memory(struct hif_softc *scn, void *ramdump_base,
*
* Return: soc physical address
*/
-qdf_dma_addr_t get_ce_phy_addr(struct hif_softc *sc, uint32_t address,
- unsigned int target_type)
+static qdf_dma_addr_t get_ce_phy_addr(struct hif_softc *sc, uint32_t address,
+ unsigned int target_type)
{
qdf_dma_addr_t ce_phy_addr;
struct hif_softc *scn = sc;
diff --git a/hif/src/ce/ce_internal.h b/hif/src/ce/ce_internal.h
index 74edde2f2037..4862b139115e 100644
--- a/hif/src/ce/ce_internal.h
+++ b/hif/src/ce/ce_internal.h
@@ -135,7 +135,8 @@ struct CE_state {
bool force_break; /* Flag to indicate whether to
* break out the DPC context */
- qdf_time_t ce_service_yield_time;
+ /* time in nanoseconds to yield control of napi poll */
+ unsigned long long ce_service_yield_time;
unsigned int receive_count; /* count Num Of Receive Buffers
* handled for one interrupt
* DPC routine */
diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c
index 47ddef6aba19..ec5ed91ed73d 100644
--- a/hif/src/ce/ce_main.c
+++ b/hif/src/ce/ce_main.c
@@ -513,7 +513,7 @@ static struct service_to_pipe target_service_to_ce_map_wlan_epping[] = {
* false (attribute set to false)
* true (attribute set to true);
*/
-bool ce_mark_datapath(struct CE_state *ce_state)
+static bool ce_mark_datapath(struct CE_state *ce_state)
{
struct service_to_pipe *svc_map;
size_t map_sz;
@@ -1327,7 +1327,7 @@ hif_get_free_queue_number(struct hif_opaque_softc *hif_ctx, uint8_t pipe)
}
/* Called by lower (CE) layer when a send to Target completes. */
-void
+static void
hif_pci_ce_send_done(struct CE_handle *copyeng, void *ce_context,
void *transfer_context, qdf_dma_addr_t CE_data,
unsigned int nbytes, unsigned int transfer_id,
@@ -1395,7 +1395,7 @@ static inline void hif_ce_do_recv(struct hif_msg_callbacks *msg_callbacks,
}
/* Called by lower (CE) layer when data is received from the Target. */
-void
+static void
hif_pci_ce_recv_data(struct CE_handle *copyeng, void *ce_context,
void *transfer_context, qdf_dma_addr_t CE_data,
unsigned int nbytes, unsigned int transfer_id,
@@ -1458,7 +1458,7 @@ hif_post_init(struct hif_opaque_softc *hif_ctx, void *unused,
}
-int hif_completion_thread_startup(struct HIF_CE_state *hif_state)
+static int hif_completion_thread_startup(struct HIF_CE_state *hif_state)
{
struct CE_handle *ce_diag = hif_state->ce_diag;
int pipe_num;
@@ -1738,7 +1738,7 @@ QDF_STATUS hif_start(struct hif_opaque_softc *hif_ctx)
return QDF_STATUS_SUCCESS;
}
-void hif_recv_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info)
+static void hif_recv_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info)
{
struct hif_softc *scn;
struct CE_handle *ce_hdl;
@@ -1774,7 +1774,7 @@ void hif_recv_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info)
}
}
-void hif_send_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info)
+static void hif_send_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info)
{
struct CE_handle *ce_hdl;
struct HIF_CE_state *hif_state;
@@ -1837,7 +1837,7 @@ void hif_send_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info)
* not yet processed are on a completion queue. They
* are handled when the completion thread shuts down.
*/
-void hif_buffer_cleanup(struct HIF_CE_state *hif_state)
+static void hif_buffer_cleanup(struct HIF_CE_state *hif_state)
{
int pipe_num;
struct hif_softc *scn = HIF_GET_SOFTC(hif_state);
diff --git a/hif/src/ce/ce_main.h b/hif/src/ce/ce_main.h
index 3023be80fe4c..4a68618bd1bc 100644
--- a/hif/src/ce/ce_main.h
+++ b/hif/src/ce/ce_main.h
@@ -112,7 +112,7 @@ struct ce_tasklet_entry {
void *hif_ce_state;
};
-struct ce_intr_stats {
+struct ce_stats {
uint32_t ce_per_cpu[CE_COUNT_MAX][QDF_MAX_AVAILABLE_CPU];
};
@@ -140,7 +140,7 @@ struct HIF_CE_state {
/* Copy Engine used for Diagnostic Accesses */
struct CE_handle *ce_diag;
- struct ce_intr_stats stats;
+ struct ce_stats stats;
};
/*
diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c
index 770f72c5126a..ac49eed9b8e6 100644
--- a/hif/src/ce/ce_service.c
+++ b/hif/src/ce/ce_service.c
@@ -35,6 +35,7 @@
#include "regtable.h"
#include "hif_main.h"
#include "hif_debug.h"
+#include "hif_napi.h"
#ifdef IPA_OFFLOAD
#ifdef QCA_WIFI_3_0
@@ -199,9 +200,21 @@ inline void ce_init_ce_desc_event_log(int ce_id, int size)
bool hif_ce_service_should_yield(struct hif_softc *scn,
struct CE_state *ce_state)
{
- bool yield = qdf_system_time_after_eq(qdf_system_ticks(),
- ce_state->ce_service_yield_time) ||
- hif_max_num_receives_reached(scn, ce_state->receive_count);
+ bool yield, time_limit_reached, rxpkt_thresh_reached = 0;
+
+ time_limit_reached =
+ sched_clock() > ce_state->ce_service_yield_time ? 1 : 0;
+
+ if (!time_limit_reached)
+ rxpkt_thresh_reached = hif_max_num_receives_reached
+ (scn, ce_state->receive_count);
+
+ yield = time_limit_reached || rxpkt_thresh_reached;
+
+ if (yield)
+ hif_napi_update_yield_stats(ce_state,
+ time_limit_reached,
+ rxpkt_thresh_reached);
return yield;
}
@@ -259,6 +272,7 @@ ce_completed_send_next_nolock(struct CE_state *CE_state,
unsigned int *sw_idx, unsigned int *hw_idx,
uint32_t *toeplitz_hash_result);
+static
void war_ce_src_ring_write_idx_set(struct hif_softc *scn,
u32 ctrl_addr, unsigned int write_index)
{
@@ -315,7 +329,7 @@ static void ce_validate_nbytes(uint32_t nbytes, struct CE_state *ce_state)
}
#endif
-int
+static int
ce_send_nolock(struct CE_handle *copyeng,
void *per_transfer_context,
qdf_dma_addr_t buffer,
@@ -1082,7 +1096,7 @@ unsigned int ce_recv_entries_avail(struct CE_handle *copyeng)
* Guts of ce_send_entries_done.
* The caller takes responsibility for any necessary locking.
*/
-unsigned int
+static unsigned int
ce_send_entries_done_nolock(struct hif_softc *scn,
struct CE_state *CE_state)
{
@@ -1114,7 +1128,7 @@ unsigned int ce_send_entries_done(struct CE_handle *copyeng)
* Guts of ce_recv_entries_done.
* The caller takes responsibility for any necessary locking.
*/
-unsigned int
+static unsigned int
ce_recv_entries_done_nolock(struct hif_softc *scn,
struct CE_state *CE_state)
{
@@ -1152,7 +1166,7 @@ void *ce_debug_cmplsn_context; /* completed send next context */
* Guts of ce_completed_recv_next.
* The caller takes responsibility for any necessary locking.
*/
-int
+static int
ce_completed_recv_next_nolock(struct CE_state *CE_state,
void **per_CE_contextp,
void **per_transfer_contextp,
@@ -1724,7 +1738,6 @@ more_data:
FAST_RX_SOFTWARE_INDEX_UPDATE,
NULL, NULL, sw_index);
dest_ring->sw_index = sw_index;
-
ce_fastpath_rx_handle(ce_state, cmpl_msdus,
MSG_FLUSH_NUM, ctrl_addr);
@@ -1789,7 +1802,11 @@ static void ce_per_engine_service_fast(struct hif_softc *scn, int ce_id)
}
#endif /* WLAN_FEATURE_FASTPATH */
-#define CE_PER_ENGINE_SERVICE_MAX_TIME_JIFFIES 2
+/* Maximum amount of time in nano seconds before which the CE per engine service
+ * should yield. ~1 jiffie.
+ */
+#define CE_PER_ENGINE_SERVICE_MAX_YIELD_TIME_NS (10 * 1000 * 1000)
+
/*
* Guts of interrupt handler for per-engine interrupts on a particular CE.
*
@@ -1826,8 +1843,9 @@ int ce_per_engine_service(struct hif_softc *scn, unsigned int CE_id)
/* Clear force_break flag and re-initialize receive_count to 0 */
CE_state->receive_count = 0;
CE_state->force_break = 0;
- CE_state->ce_service_yield_time = qdf_system_ticks() +
- CE_PER_ENGINE_SERVICE_MAX_TIME_JIFFIES;
+ CE_state->ce_service_yield_time =
+ sched_clock() +
+ (unsigned long long)CE_PER_ENGINE_SERVICE_MAX_YIELD_TIME_NS;
qdf_spin_lock(&CE_state->ce_index_lock);
diff --git a/hif/src/ce/ce_tasklet.c b/hif/src/ce/ce_tasklet.c
index c820d874f788..b604c30dc4d1 100644
--- a/hif/src/ce/ce_tasklet.c
+++ b/hif/src/ce/ce_tasklet.c
@@ -437,7 +437,6 @@ void hif_display_ce_stats(struct HIF_CE_state *hif_ce_state)
for (i = 0; i < CE_COUNT_MAX; i++) {
size = STR_SIZE;
pos = 0;
- qdf_print("CE id: %d", i);
for (j = 0; j < QDF_MAX_AVAILABLE_CPU; j++) {
ret = snprintf(str_buffer + pos, size, "[%d]: %d",
j, hif_ce_state->stats.ce_per_cpu[i][j]);
@@ -446,7 +445,7 @@ void hif_display_ce_stats(struct HIF_CE_state *hif_ce_state)
size -= ret;
pos += ret;
}
- qdf_print("%s", str_buffer);
+ qdf_print("CE id[%d] - %s", i, str_buffer);
}
#undef STR_SIZE
}
@@ -459,7 +458,7 @@ void hif_display_ce_stats(struct HIF_CE_state *hif_ce_state)
*/
void hif_clear_ce_stats(struct HIF_CE_state *hif_ce_state)
{
- qdf_mem_zero(&hif_ce_state->stats, sizeof(struct ce_intr_stats));
+ qdf_mem_zero(&hif_ce_state->stats, sizeof(struct ce_stats));
}
/**
diff --git a/hif/src/dispatcher/multibus.c b/hif/src/dispatcher/multibus.c
index 5643b6f05715..a510fc53b3ae 100644
--- a/hif/src/dispatcher/multibus.c
+++ b/hif/src/dispatcher/multibus.c
@@ -30,6 +30,7 @@
#include "hif_debug.h"
#include "hif.h"
#include "hif_main.h"
+#include "hif_io32.h"
#include "multibus.h"
#include "dummy.h"
#if defined(HIF_PCI) || defined(HIF_SNOC) || defined(HIF_AHB)
diff --git a/hif/src/hif_napi.c b/hif/src/hif_napi.c
index 90c04dec7365..8a627b291f36 100644
--- a/hif/src/hif_napi.c
+++ b/hif/src/hif_napi.c
@@ -76,7 +76,7 @@ static int hif_napi_cpu_migrate(struct qca_napi_data *napid, int cpu,
return 0;
}
-int hif_napi_cpu_blacklist(bool is_on) { return 0; }
+static int hif_napi_cpu_blacklist(bool is_on) { return 0; }
#endif /* HELIUMPLUS */
/**
@@ -754,7 +754,12 @@ int hif_napi_poll(struct hif_opaque_softc *hif_ctx, struct napi_struct *napi,
*/
if (rc)
normalized++;
- bucket = (normalized / QCA_NAPI_DEF_SCALE);
+ bucket = normalized / (QCA_NAPI_BUDGET / QCA_NAPI_NUM_BUCKETS);
+ if (bucket >= QCA_NAPI_NUM_BUCKETS) {
+ bucket = QCA_NAPI_NUM_BUCKETS - 1;
+ HIF_ERROR("Bad bucket#(%d) > QCA_NAPI_NUM_BUCKETS(%d)",
+ bucket, QCA_NAPI_NUM_BUCKETS);
+ }
napi_info->stats[cpu].napi_budget_uses[bucket]++;
/* if ce_per engine reports 0, then poll should be terminated */
@@ -799,22 +804,78 @@ out:
}
#ifdef HELIUMPLUS
-/*
- * Local functions
- * - no argument checks, all internal/trusted callers
+/**
+ *
+ * hif_napi_update_yield_stats() - update NAPI yield related stats
+ * @cpu_id: CPU ID for which stats needs to be updates
+ * @ce_id: Copy Engine ID for which yield stats needs to be updates
+ * @time_limit_reached: indicates whether the time limit was reached
+ * @rxpkt_thresh_reached: indicates whether rx packet threshold was reached
+ *
+ * Return: None
*/
+void hif_napi_update_yield_stats(struct CE_state *ce_state,
+ bool time_limit_reached,
+ bool rxpkt_thresh_reached)
+{
+ struct hif_softc *hif;
+ struct qca_napi_data *napi_data = NULL;
+ int ce_id = 0;
+ int cpu_id = 0;
+
+ if (unlikely(NULL == ce_state)) {
+ QDF_ASSERT(NULL != ce_state);
+ return;
+ }
-#ifdef FEATURE_NAPI_DEBUG
-static void hnc_dump_cpus(struct qca_napi_data *napid)
+ hif = ce_state->scn;
+
+ if (unlikely(NULL == hif)) {
+ QDF_ASSERT(NULL != hif);
+ return;
+ } else {
+ napi_data = &(hif->napi_data);
+ if (unlikely(NULL == napi_data))
+ QDF_ASSERT(NULL != napi_data);
+ return;
+ }
+
+ ce_id = ce_state->id;
+ cpu_id = qdf_get_cpu();
+
+ if (time_limit_reached)
+ napi_data->napis[ce_id].stats[cpu_id].time_limit_reached++;
+ else
+ napi_data->napis[ce_id].stats[cpu_id].rxpkt_thresh_reached++;
+}
+
+/**
+ *
+ * hif_napi_stats() - display NAPI CPU statistics
+ * @napid: pointer to qca_napi_data
+ *
+ * Description:
+ * Prints the various CPU cores on which the NAPI instances /CEs interrupts
+ * are being executed. Can be called from outside NAPI layer.
+ *
+ * Return: None
+ */
+void hif_napi_stats(struct qca_napi_data *napid)
{
int i;
- struct qca_napi_cpu *cpu = napid->napi_cpu;
+ struct qca_napi_cpu *cpu;
+
+ if (napid == NULL) {
+ qdf_print("%s: napiid struct is null", __func__);
+ return;
+ }
- NAPI_DEBUG("%s: NAPI CPU TABLE", __func__);
- NAPI_DEBUG("lilclhead=%d, bigclhead=%d",
+ cpu = napid->napi_cpu;
+ qdf_print("NAPI CPU TABLE");
+ qdf_print("lilclhead=%d, bigclhead=%d",
napid->lilcl_head, napid->bigcl_head);
for (i = 0; i < NR_CPUS; i++) {
- NAPI_DEBUG("CPU[%02d]: state:%d crid=%02d clid=%02d "
+ qdf_print("CPU[%02d]: state:%d crid=%02d clid=%02d "
"crmk:0x%0lx thmk:0x%0lx frq:%d "
"napi = 0x%08x lnk:%d",
i,
@@ -824,7 +885,16 @@ static void hnc_dump_cpus(struct qca_napi_data *napid)
cpu[i].max_freq, cpu[i].napis,
cpu[i].cluster_nxt);
}
- /* return; -- Linus does not like it, I do. */
+}
+
+#ifdef FEATURE_NAPI_DEBUG
+/*
+ * Local functions
+ * - no argument checks, all internal/trusted callers
+ */
+static void hnc_dump_cpus(struct qca_napi_data *napid)
+{
+ hif_napi_stats(napid);
}
#else
static void hnc_dump_cpus(struct qca_napi_data *napid) { /* no-op */ };
@@ -1176,9 +1246,9 @@ int hif_napi_cpu_deinit(void *ctx)
* =0 : success
* <0 : error
*/
-int hncm_migrate_to(struct qca_napi_data *napid,
- int napi_ce,
- int didx)
+static int hncm_migrate_to(struct qca_napi_data *napid,
+ int napi_ce,
+ int didx)
{
int rc = 0;
cpumask_t cpumask;
@@ -1207,7 +1277,7 @@ int hncm_migrate_to(struct qca_napi_data *napid,
* Return: >=0 : index in the cpu topology table
* : < 0 : error
*/
-int hncm_dest_cpu(struct qca_napi_data *napid, int act)
+static int hncm_dest_cpu(struct qca_napi_data *napid, int act)
{
int destidx = -1;
int head, i;
diff --git a/hif/src/mp_dev.c b/hif/src/mp_dev.c
index b8f078bdd422..94ba0b13223a 100644
--- a/hif/src/mp_dev.c
+++ b/hif/src/mp_dev.c
@@ -27,6 +27,7 @@
#include "hif_io32.h"
#include "hif_debug.h"
+#include "mp_dev.h"
/*chaninfo*/
#define CHANINFOMEM_S2_READ_MASK 0x00000008
@@ -116,7 +117,7 @@ void priv_start_agc(struct hif_softc *scn)
0x0f);
}
-void priv_stop_agc(struct hif_softc *scn)
+static void priv_stop_agc(struct hif_softc *scn)
{
set_target_reg_bits(scn->mem, BB_gains_min_offsets,
AGC_HISTORY_DUMP_MASK,
diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c
index cf9fa0135a93..11df30322fbd 100644
--- a/hif/src/pcie/if_pci.c
+++ b/hif/src/pcie/if_pci.c
@@ -356,7 +356,7 @@ inline void hif_pci_cancel_deferred_target_sleep(struct hif_softc *scn)
*
* Return: true if target is awake
*/
-bool hif_targ_is_awake(struct hif_softc *hif_ctx, void *__iomem *mem)
+static bool hif_targ_is_awake(struct hif_softc *hif_ctx, void *__iomem *mem)
{
return true;
}
@@ -367,7 +367,7 @@ bool hif_targ_is_awake(struct hif_softc *hif_ctx, void *__iomem *mem)
*
* Return: true if the targets clocks are on
*/
-bool hif_targ_is_awake(struct hif_softc *scn, void *__iomem *mem)
+static bool hif_targ_is_awake(struct hif_softc *scn, void *__iomem *mem)
{
uint32_t val;
@@ -452,7 +452,7 @@ static void hif_pci_device_reset(struct hif_pci_softc *sc)
* 4. Reset all CEs to clear any pending CE tarnsactions
* 5. Warm reset CPU
*/
-void hif_pci_device_warm_reset(struct hif_pci_softc *sc)
+static void hif_pci_device_warm_reset(struct hif_pci_softc *sc)
{
void __iomem *mem = sc->mem;
int i;
@@ -1448,7 +1448,7 @@ static void hif_register_bmi_callbacks(struct hif_softc *hif_sc)
* Send an interrupt to the device to wake up the Target CPU
* so it has an opportunity to notice any changed state.
*/
-void hif_wake_target_cpu(struct hif_softc *scn)
+static void hif_wake_target_cpu(struct hif_softc *scn)
{
QDF_STATUS rv;
uint32_t core_ctrl;
@@ -1530,7 +1530,7 @@ static void hif_sleep_entry(void *arg)
#define HIF_HIA_POLLING_DELAY_MS 10
#ifdef CONFIG_WIN
-void hif_set_hia_extnd(struct hif_softc *scn)
+static void hif_set_hia_extnd(struct hif_softc *scn)
{
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_target_info *tgt_info = hif_get_target_info_handle(hif_hdl);
@@ -1666,7 +1666,7 @@ void hif_set_hia_extnd(struct hif_softc *scn)
#else
-void hif_set_hia_extnd(struct hif_softc *scn)
+static void hif_set_hia_extnd(struct hif_softc *scn)
{
}
@@ -1683,7 +1683,7 @@ void hif_set_hia_extnd(struct hif_softc *scn)
*
* Return: 0 for success.
*/
-int hif_set_hia(struct hif_softc *scn)
+static int hif_set_hia(struct hif_softc *scn)
{
QDF_STATUS rv;
uint32_t interconnect_targ_addr = 0;
@@ -2053,9 +2053,9 @@ void hif_pci_close(struct hif_softc *hif_sc)
#define BAR_NUM 0
-int hif_enable_pci(struct hif_pci_softc *sc,
- struct pci_dev *pdev,
- const struct pci_device_id *id)
+static int hif_enable_pci(struct hif_pci_softc *sc,
+ struct pci_dev *pdev,
+ const struct pci_device_id *id)
{
void __iomem *mem;
int ret = 0;
@@ -2150,7 +2150,7 @@ err_region:
return ret;
}
-void hif_disable_pci(struct hif_pci_softc *sc)
+static void hif_disable_pci(struct hif_pci_softc *sc)
{
struct hif_softc *ol_sc = HIF_GET_SOFTC(sc);
@@ -2168,7 +2168,7 @@ void hif_disable_pci(struct hif_pci_softc *sc)
pci_disable_device(sc->pdev);
}
-int hif_pci_probe_tgt_wakeup(struct hif_pci_softc *sc)
+static int hif_pci_probe_tgt_wakeup(struct hif_pci_softc *sc)
{
int ret = 0;
int targ_awake_limit = 500;
@@ -2236,7 +2236,7 @@ end:
return ret;
}
-void wlan_tasklet_msi(unsigned long data)
+static void wlan_tasklet_msi(unsigned long data)
{
struct hif_tasklet_entry *entry = (struct hif_tasklet_entry *)data;
struct hif_pci_softc *sc = (struct hif_pci_softc *) entry->hif_handler;
@@ -2268,7 +2268,7 @@ irq_handled:
}
-int hif_configure_msi(struct hif_pci_softc *sc)
+static int hif_configure_msi(struct hif_pci_softc *sc)
{
int ret = 0;
int num_msi_desired;
@@ -2957,7 +2957,6 @@ void hif_process_runtime_resume_success(struct hif_opaque_softc *hif_ctx)
hif_pm_runtime_mark_last_busy(hif_pci_sc->dev);
hif_runtime_pm_set_state_on(scn);
}
-#endif
/**
* hif_runtime_suspend() - do the bus suspend part of a runtime suspend
@@ -3017,6 +3016,7 @@ int hif_runtime_resume(struct hif_opaque_softc *hif_ctx)
return status;
}
+#endif /* #ifdef FEATURE_RUNTIME_PM */
#if CONFIG_PCIE_64BIT_MSI
static void hif_free_msi_ctx(struct hif_softc *scn)
@@ -3440,7 +3440,7 @@ end:
*
* Return: none
*/
-void hif_target_sync(struct hif_softc *scn)
+static void hif_target_sync(struct hif_softc *scn)
{
hif_write32_mb(scn->mem+(SOC_CORE_BASE_ADDRESS |
PCIE_INTR_ENABLE_ADDRESS),
diff --git a/hif/src/snoc/if_snoc.c b/hif/src/snoc/if_snoc.c
index 7a2dea08da41..6c34f43122e1 100644
--- a/hif/src/snoc/if_snoc.c
+++ b/hif/src/snoc/if_snoc.c
@@ -348,6 +348,7 @@ void hif_snoc_irq_disable(struct hif_softc *scn, int ce_id)
*
* Return: 0 for success
*/
+static
QDF_STATUS hif_snoc_setup_wakeup_sources(struct hif_softc *scn, bool enable)
{
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
diff --git a/hif/src/usb/if_usb.c b/hif/src/usb/if_usb.c
index 7b6cc54d9b26..ae86a37c6b9b 100644
--- a/hif/src/usb/if_usb.c
+++ b/hif/src/usb/if_usb.c
@@ -575,6 +575,10 @@ void hif_fw_assert_ramdump_pattern(struct hif_usb_softc *sc)
uint8_t *data;
uint8_t *ram_ptr = NULL;
char *fw_ram_seg_name[FW_RAM_SEG_CNT] = {"DRAM", "IRAM", "AXI"};
+ size_t fw_ram_reg_size[FW_RAM_SEG_CNT] = {
+ FW_RAMDUMP_DRAMSIZE,
+ FW_RAMDUMP_IRAMSIZE,
+ FW_RAMDUMP_AXISIZE };
data = sc->fw_data;
len = sc->fw_data_len;
@@ -588,7 +592,7 @@ void hif_fw_assert_ramdump_pattern(struct hif_usb_softc *sc)
HIF_ERROR("Firmware %s dump:\n", fw_ram_seg_name[i]);
sc->ramdump[i] =
qdf_mem_malloc(sizeof(struct fw_ramdump) +
- FW_RAMDUMP_SEG_SIZE);
+ fw_ram_reg_size[i]);
if (!sc->ramdump[i]) {
pr_err("Fail to allocate memory for ram dump");
QDF_BUG(0);
@@ -606,7 +610,12 @@ void hif_fw_assert_ramdump_pattern(struct hif_usb_softc *sc)
reg++;
ram_ptr = (sc->ramdump[i])->mem + (sc->ramdump[i])->length;
(sc->ramdump[i])->length += (len - 8);
- qdf_mem_copy(ram_ptr, (A_UINT8 *) reg, len - 8);
+ if (sc->ramdump[i]->length <= fw_ram_reg_size[i]) {
+ qdf_mem_copy(ram_ptr, (A_UINT8 *) reg, len - 8);
+ } else {
+ HIF_ERROR("memory copy overlap\n");
+ QDF_BUG(0);
+ }
if (pattern == FW_RAMDUMP_END_PATTERN) {
HIF_ERROR("%s memory size = %d\n", fw_ram_seg_name[i],
diff --git a/hif/src/usb/if_usb.h b/hif/src/usb/if_usb.h
index 861f36e66860..1232602d4542 100644
--- a/hif/src/usb/if_usb.h
+++ b/hif/src/usb/if_usb.h
@@ -61,6 +61,9 @@
#define FW_RAMDUMP_PATTERN 0x0000f600
#define FW_RAMDUMP_END_PATTERN 0x0000f601
#define FW_RAMDUMP_PATTERN_MASK 0xfffffff0
+#define FW_RAMDUMP_DRAMSIZE 0x00098000
+#define FW_RAMDUMP_IRAMSIZE 0x000C0000
+#define FW_RAMDUMP_AXISIZE 0x00020000
/* FW RAM segments (Rome USB) */
enum {
diff --git a/htc/htc_send.c b/htc/htc_send.c
index 6eace3812f51..8b53dab847dc 100644
--- a/htc/htc_send.c
+++ b/htc/htc_send.c
@@ -1210,10 +1210,9 @@ static HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target,
for (i = HTC_PACKET_QUEUE_DEPTH(&sendQueue); i > 0; i--)
hif_pm_runtime_put(target->hif_dev);
-
+ LOCK_HTC_TX(target);
HTC_PACKET_QUEUE_TRANSFER_TO_HEAD(&pEndpoint->TxQueue,
&sendQueue);
- LOCK_HTC_TX(target);
break;
}
diff --git a/qdf/inc/qdf_types.h b/qdf/inc/qdf_types.h
index bd179083f8d6..55c9515eec97 100644
--- a/qdf/inc/qdf_types.h
+++ b/qdf/inc/qdf_types.h
@@ -314,6 +314,7 @@ enum tQDF_ADAPTER_MODE {
* @QDF_GLOBAL_MISSION_MODE: mission mode (STA, SAP...)
* @QDF_GLOBAL_MONITOR_MODE: Monitor Mode
* @QDF_GLOBAL_FTM_MODE: FTM mode
+ * @QDF_GLOBAL_IBSS_MODE: IBSS mode
* @QDF_GLOBAL_EPPING_MODE: EPPING mode
* @QDF_GLOBAL_QVIT_MODE: QVIT global mode
* @QDF_GLOBAL_MAX_MODE: Max place holder
@@ -322,6 +323,7 @@ enum tQDF_GLOBAL_CON_MODE {
QDF_GLOBAL_MISSION_MODE,
QDF_GLOBAL_MONITOR_MODE = 4,
QDF_GLOBAL_FTM_MODE = 5,
+ QDF_GLOBAL_IBSS_MODE = 6,
QDF_GLOBAL_EPPING_MODE = 8,
QDF_GLOBAL_QVIT_MODE = 9,
QDF_GLOBAL_MAX_MODE
diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c
index 7d598eab6297..d91e7deb763b 100644
--- a/wmi/src/wmi_unified_tlv.c
+++ b/wmi/src/wmi_unified_tlv.c
@@ -4294,6 +4294,8 @@ QDF_STATUS send_roam_scan_offload_mode_cmd_tlv(wmi_unified_t wmi_handle,
roam_req->roam_offload_params.asel_cap;
roam_offload_params->qos_caps =
roam_req->roam_offload_params.qos_caps;
+ roam_offload_params->qos_enabled =
+ roam_req->roam_offload_params.qos_enabled;
roam_offload_params->wmm_caps =
roam_req->roam_offload_params.wmm_caps;
qdf_mem_copy((uint8_t *)roam_offload_params->mcsset,