|
@@ -141,6 +141,7 @@ void hif_trigger_dump(struct hif_opaque_softc *hif_ctx,
|
|
|
static void ce_poll_timeout(void *arg)
|
|
|
{
|
|
|
struct CE_state *CE_state = (struct CE_state *)arg;
|
|
|
+
|
|
|
if (CE_state->timer_inited) {
|
|
|
ce_per_engine_service(CE_state->scn, CE_state->id);
|
|
|
qdf_timer_mod(&CE_state->poll_timer, CE_POLL_TIMEOUT);
|
|
@@ -782,7 +783,8 @@ static void ce_ring_setup(struct hif_softc *scn, uint8_t ring_type,
|
|
|
{
|
|
|
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn);
|
|
|
|
|
|
- hif_state->ce_services->ce_ring_setup(scn, ring_type, ce_id, ring, attr);
|
|
|
+ hif_state->ce_services->ce_ring_setup(scn, ring_type, ce_id,
|
|
|
+ ring, attr);
|
|
|
}
|
|
|
|
|
|
int hif_ce_bus_early_suspend(struct hif_softc *scn)
|
|
@@ -790,6 +792,7 @@ int hif_ce_bus_early_suspend(struct hif_softc *scn)
|
|
|
uint8_t ul_pipe, dl_pipe;
|
|
|
int ce_id, status, ul_is_polled, dl_is_polled;
|
|
|
struct CE_state *ce_state;
|
|
|
+
|
|
|
status = hif_map_service_to_pipe(&scn->osc, WMI_CONTROL_SVC,
|
|
|
&ul_pipe, &dl_pipe,
|
|
|
&ul_is_polled, &dl_is_polled);
|
|
@@ -926,6 +929,7 @@ struct CE_handle *ce_init(struct hif_softc *scn,
|
|
|
nentries = attr->src_nentries;
|
|
|
if (nentries) {
|
|
|
struct CE_ring_state *src_ring;
|
|
|
+
|
|
|
nentries = roundup_pwr2(nentries);
|
|
|
if (CE_state->src_ring) {
|
|
|
QDF_ASSERT(CE_state->src_ring->nentries == nentries);
|
|
@@ -946,13 +950,12 @@ struct CE_handle *ce_init(struct hif_softc *scn,
|
|
|
malloc_CE_state = false;
|
|
|
}
|
|
|
return NULL;
|
|
|
- } else {
|
|
|
- /* we can allocate src ring.
|
|
|
- * Mark that the src ring is
|
|
|
- * allocated locally
|
|
|
- */
|
|
|
- malloc_src_ring = true;
|
|
|
}
|
|
|
+ /* we can allocate src ring. Mark that the src ring is
|
|
|
+ * allocated locally
|
|
|
+ */
|
|
|
+ malloc_src_ring = true;
|
|
|
+
|
|
|
/*
|
|
|
* Also allocate a shadow src ring in
|
|
|
* regular mem to use for faster access.
|
|
@@ -1009,7 +1012,8 @@ struct CE_handle *ce_init(struct hif_softc *scn,
|
|
|
if (Q_TARGET_ACCESS_BEGIN(scn) < 0)
|
|
|
goto error_target_access;
|
|
|
|
|
|
- ce_ring_setup(scn, CE_RING_DEST, CE_id, dest_ring, attr);
|
|
|
+ ce_ring_setup(scn, CE_RING_DEST, CE_id,
|
|
|
+ dest_ring, attr);
|
|
|
|
|
|
if (Q_TARGET_ACCESS_END(scn) < 0)
|
|
|
goto error_target_access;
|
|
@@ -1157,13 +1161,13 @@ void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int id)
|
|
|
*
|
|
|
* Return: none
|
|
|
*/
|
|
|
-void
|
|
|
-ce_h2t_tx_ce_cleanup(struct CE_handle *ce_hdl)
|
|
|
+void ce_h2t_tx_ce_cleanup(struct CE_handle *ce_hdl)
|
|
|
{
|
|
|
struct CE_state *ce_state = (struct CE_state *)ce_hdl;
|
|
|
struct CE_ring_state *src_ring = ce_state->src_ring;
|
|
|
struct hif_softc *sc = ce_state->scn;
|
|
|
uint32_t sw_index, write_index;
|
|
|
+
|
|
|
if (hif_is_nss_wifi_enabled(sc))
|
|
|
return;
|
|
|
|
|
@@ -1467,9 +1471,9 @@ void hif_send_complete_check(struct hif_opaque_softc *hif_ctx, uint8_t pipe,
|
|
|
* If at least 50% of the total resources are still available,
|
|
|
* don't bother checking again yet.
|
|
|
*/
|
|
|
- if (resources > (hif_state->host_ce_config[pipe].src_nentries >> 1)) {
|
|
|
+ if (resources > (hif_state->host_ce_config[pipe].src_nentries >>
|
|
|
+ 1))
|
|
|
return;
|
|
|
- }
|
|
|
}
|
|
|
#if ATH_11AC_TXCOMPACT
|
|
|
ce_per_engine_servicereap(scn, pipe);
|
|
@@ -1599,7 +1603,8 @@ hif_pci_ce_recv_data(struct CE_handle *copyeng, void *ce_context,
|
|
|
nbytes, pipe_info);
|
|
|
|
|
|
/* Set up force_break flag if num of receices reaches
|
|
|
- * MAX_NUM_OF_RECEIVES */
|
|
|
+ * MAX_NUM_OF_RECEIVES
|
|
|
+ */
|
|
|
ce_state->receive_count++;
|
|
|
if (qdf_unlikely(hif_ce_service_should_yield(scn, ce_state))) {
|
|
|
ce_state->force_break = 1;
|
|
@@ -1656,9 +1661,8 @@ static int hif_completion_thread_startup(struct HIF_CE_state *hif_state)
|
|
|
struct HIF_CE_pipe_info *pipe_info;
|
|
|
|
|
|
pipe_info = &hif_state->pipe_info[pipe_num];
|
|
|
- if (pipe_info->ce_hdl == ce_diag) {
|
|
|
+ if (pipe_info->ce_hdl == ce_diag)
|
|
|
continue; /* Handle Diagnostic CE specially */
|
|
|
- }
|
|
|
attr = hif_state->host_ce_config[pipe_num];
|
|
|
if (attr.src_nentries) {
|
|
|
/* pipe used to send to target */
|
|
@@ -1881,13 +1885,13 @@ static int hif_post_recv_buffers(struct hif_softc *scn)
|
|
|
A_TARGET_ACCESS_LIKELY(scn);
|
|
|
for (pipe_num = 0; pipe_num < scn->ce_count; pipe_num++) {
|
|
|
struct HIF_CE_pipe_info *pipe_info;
|
|
|
+
|
|
|
ce_state = scn->ce_id_to_state[pipe_num];
|
|
|
pipe_info = &hif_state->pipe_info[pipe_num];
|
|
|
|
|
|
if (hif_is_nss_wifi_enabled(scn) &&
|
|
|
- ce_state && (ce_state->htt_rx_data)) {
|
|
|
+ ce_state && (ce_state->htt_rx_data))
|
|
|
continue;
|
|
|
- }
|
|
|
|
|
|
if (hif_post_recv_buffers_for_pipe(pipe_info)) {
|
|
|
rv = 1;
|
|
@@ -1937,22 +1941,20 @@ static void hif_recv_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info)
|
|
|
void *per_CE_context;
|
|
|
|
|
|
buf_sz = pipe_info->buf_sz;
|
|
|
- if (buf_sz == 0) {
|
|
|
- /* Unused Copy Engine */
|
|
|
+ /* Unused Copy Engine */
|
|
|
+ if (buf_sz == 0)
|
|
|
return;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
hif_state = pipe_info->HIF_CE_state;
|
|
|
- if (!hif_state->started) {
|
|
|
+ if (!hif_state->started)
|
|
|
return;
|
|
|
- }
|
|
|
|
|
|
scn = HIF_GET_SOFTC(hif_state);
|
|
|
ce_hdl = pipe_info->ce_hdl;
|
|
|
|
|
|
- if (scn->qdf_dev == NULL) {
|
|
|
+ if (scn->qdf_dev == NULL)
|
|
|
return;
|
|
|
- }
|
|
|
while (ce_revoke_recv_next
|
|
|
(ce_hdl, &per_CE_context, (void **)&netbuf,
|
|
|
&CE_data) == QDF_STATUS_SUCCESS) {
|
|
@@ -2006,9 +2008,9 @@ static void hif_send_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info)
|
|
|
if (id == scn->htc_htt_tx_endpoint)
|
|
|
return;
|
|
|
/* Indicate the completion to higher
|
|
|
- * layer to free the buffer */
|
|
|
- if (pipe_info->pipe_callbacks.
|
|
|
- txCompletionHandler)
|
|
|
+ * layer to free the buffer
|
|
|
+ */
|
|
|
+ if (pipe_info->pipe_callbacks.txCompletionHandler)
|
|
|
pipe_info->pipe_callbacks.
|
|
|
txCompletionHandler(pipe_info->
|
|
|
pipe_callbacks.Context,
|
|
@@ -2403,7 +2405,6 @@ static void hif_post_static_buf_to_target(struct hif_softc *scn)
|
|
|
#else
|
|
|
static inline void hif_post_static_buf_to_target(struct hif_softc *scn)
|
|
|
{
|
|
|
- return;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
@@ -2450,6 +2451,7 @@ int hif_config_ce(struct hif_softc *scn)
|
|
|
|
|
|
for (pipe_num = 0; pipe_num < scn->ce_count; pipe_num++) {
|
|
|
struct CE_attr *attr;
|
|
|
+
|
|
|
pipe_info = &hif_state->pipe_info[pipe_num];
|
|
|
pipe_info->pipe_num = pipe_num;
|
|
|
pipe_info->HIF_CE_state = hif_state;
|
|
@@ -2467,7 +2469,8 @@ int hif_config_ce(struct hif_softc *scn)
|
|
|
|
|
|
if (attr->flags & CE_ATTR_DIAG) {
|
|
|
/* Reserve the ultimate CE for
|
|
|
- * Diagnostic Window support */
|
|
|
+ * Diagnostic Window support
|
|
|
+ */
|
|
|
hif_state->ce_diag = pipe_info->ce_hdl;
|
|
|
continue;
|
|
|
}
|
|
@@ -2586,7 +2589,6 @@ void hif_ce_ipa_get_ce_resource(struct hif_softc *scn,
|
|
|
|
|
|
ce_ipa_get_resource(ce_hdl, ce_sr_base_paddr, ce_sr_ring_size,
|
|
|
ce_reg_paddr);
|
|
|
- return;
|
|
|
}
|
|
|
#endif /* IPA_OFFLOAD */
|
|
|
|
|
@@ -2594,71 +2596,71 @@ void hif_ce_ipa_get_ce_resource(struct hif_softc *scn,
|
|
|
#ifdef ADRASTEA_SHADOW_REGISTERS
|
|
|
|
|
|
/*
|
|
|
- Current shadow register config
|
|
|
-
|
|
|
- -----------------------------------------------------------
|
|
|
- Shadow Register | CE | src/dst write index
|
|
|
- -----------------------------------------------------------
|
|
|
- 0 | 0 | src
|
|
|
- 1 No Config - Doesn't point to anything
|
|
|
- 2 No Config - Doesn't point to anything
|
|
|
- 3 | 3 | src
|
|
|
- 4 | 4 | src
|
|
|
- 5 | 5 | src
|
|
|
- 6 No Config - Doesn't point to anything
|
|
|
- 7 | 7 | src
|
|
|
- 8 No Config - Doesn't point to anything
|
|
|
- 9 No Config - Doesn't point to anything
|
|
|
- 10 No Config - Doesn't point to anything
|
|
|
- 11 No Config - Doesn't point to anything
|
|
|
- -----------------------------------------------------------
|
|
|
- 12 No Config - Doesn't point to anything
|
|
|
- 13 | 1 | dst
|
|
|
- 14 | 2 | dst
|
|
|
- 15 No Config - Doesn't point to anything
|
|
|
- 16 No Config - Doesn't point to anything
|
|
|
- 17 No Config - Doesn't point to anything
|
|
|
- 18 No Config - Doesn't point to anything
|
|
|
- 19 | 7 | dst
|
|
|
- 20 | 8 | dst
|
|
|
- 21 No Config - Doesn't point to anything
|
|
|
- 22 No Config - Doesn't point to anything
|
|
|
- 23 No Config - Doesn't point to anything
|
|
|
- -----------------------------------------------------------
|
|
|
-
|
|
|
-
|
|
|
- ToDo - Move shadow register config to following in the future
|
|
|
- This helps free up a block of shadow registers towards the end.
|
|
|
- Can be used for other purposes
|
|
|
-
|
|
|
- -----------------------------------------------------------
|
|
|
- Shadow Register | CE | src/dst write index
|
|
|
- -----------------------------------------------------------
|
|
|
- 0 | 0 | src
|
|
|
- 1 | 3 | src
|
|
|
- 2 | 4 | src
|
|
|
- 3 | 5 | src
|
|
|
- 4 | 7 | src
|
|
|
- -----------------------------------------------------------
|
|
|
- 5 | 1 | dst
|
|
|
- 6 | 2 | dst
|
|
|
- 7 | 7 | dst
|
|
|
- 8 | 8 | dst
|
|
|
- -----------------------------------------------------------
|
|
|
- 9 No Config - Doesn't point to anything
|
|
|
- 12 No Config - Doesn't point to anything
|
|
|
- 13 No Config - Doesn't point to anything
|
|
|
- 14 No Config - Doesn't point to anything
|
|
|
- 15 No Config - Doesn't point to anything
|
|
|
- 16 No Config - Doesn't point to anything
|
|
|
- 17 No Config - Doesn't point to anything
|
|
|
- 18 No Config - Doesn't point to anything
|
|
|
- 19 No Config - Doesn't point to anything
|
|
|
- 20 No Config - Doesn't point to anything
|
|
|
- 21 No Config - Doesn't point to anything
|
|
|
- 22 No Config - Doesn't point to anything
|
|
|
- 23 No Config - Doesn't point to anything
|
|
|
- -----------------------------------------------------------
|
|
|
+ * Current shadow register config
|
|
|
+ *
|
|
|
+ * -----------------------------------------------------------
|
|
|
+ * Shadow Register | CE | src/dst write index
|
|
|
+ * -----------------------------------------------------------
|
|
|
+ * 0 | 0 | src
|
|
|
+ * 1 No Config - Doesn't point to anything
|
|
|
+ * 2 No Config - Doesn't point to anything
|
|
|
+ * 3 | 3 | src
|
|
|
+ * 4 | 4 | src
|
|
|
+ * 5 | 5 | src
|
|
|
+ * 6 No Config - Doesn't point to anything
|
|
|
+ * 7 | 7 | src
|
|
|
+ * 8 No Config - Doesn't point to anything
|
|
|
+ * 9 No Config - Doesn't point to anything
|
|
|
+ * 10 No Config - Doesn't point to anything
|
|
|
+ * 11 No Config - Doesn't point to anything
|
|
|
+ * -----------------------------------------------------------
|
|
|
+ * 12 No Config - Doesn't point to anything
|
|
|
+ * 13 | 1 | dst
|
|
|
+ * 14 | 2 | dst
|
|
|
+ * 15 No Config - Doesn't point to anything
|
|
|
+ * 16 No Config - Doesn't point to anything
|
|
|
+ * 17 No Config - Doesn't point to anything
|
|
|
+ * 18 No Config - Doesn't point to anything
|
|
|
+ * 19 | 7 | dst
|
|
|
+ * 20 | 8 | dst
|
|
|
+ * 21 No Config - Doesn't point to anything
|
|
|
+ * 22 No Config - Doesn't point to anything
|
|
|
+ * 23 No Config - Doesn't point to anything
|
|
|
+ * -----------------------------------------------------------
|
|
|
+ *
|
|
|
+ *
|
|
|
+ * ToDo - Move shadow register config to following in the future
|
|
|
+ * This helps free up a block of shadow registers towards the end.
|
|
|
+ * Can be used for other purposes
|
|
|
+ *
|
|
|
+ * -----------------------------------------------------------
|
|
|
+ * Shadow Register | CE | src/dst write index
|
|
|
+ * -----------------------------------------------------------
|
|
|
+ * 0 | 0 | src
|
|
|
+ * 1 | 3 | src
|
|
|
+ * 2 | 4 | src
|
|
|
+ * 3 | 5 | src
|
|
|
+ * 4 | 7 | src
|
|
|
+ * -----------------------------------------------------------
|
|
|
+ * 5 | 1 | dst
|
|
|
+ * 6 | 2 | dst
|
|
|
+ * 7 | 7 | dst
|
|
|
+ * 8 | 8 | dst
|
|
|
+ * -----------------------------------------------------------
|
|
|
+ * 9 No Config - Doesn't point to anything
|
|
|
+ * 12 No Config - Doesn't point to anything
|
|
|
+ * 13 No Config - Doesn't point to anything
|
|
|
+ * 14 No Config - Doesn't point to anything
|
|
|
+ * 15 No Config - Doesn't point to anything
|
|
|
+ * 16 No Config - Doesn't point to anything
|
|
|
+ * 17 No Config - Doesn't point to anything
|
|
|
+ * 18 No Config - Doesn't point to anything
|
|
|
+ * 19 No Config - Doesn't point to anything
|
|
|
+ * 20 No Config - Doesn't point to anything
|
|
|
+ * 21 No Config - Doesn't point to anything
|
|
|
+ * 22 No Config - Doesn't point to anything
|
|
|
+ * 23 No Config - Doesn't point to anything
|
|
|
+ * -----------------------------------------------------------
|
|
|
*/
|
|
|
|
|
|
u32 shadow_sr_wr_ind_addr(struct hif_softc *scn, u32 ctrl_addr)
|
|
@@ -2999,6 +3001,7 @@ static inline void hif_config_rri_on_ddr(struct hif_softc *scn)
|
|
|
unsigned int i;
|
|
|
qdf_dma_addr_t paddr_rri_on_ddr;
|
|
|
uint32_t high_paddr, low_paddr;
|
|
|
+
|
|
|
scn->vaddr_rri_on_ddr =
|
|
|
(uint32_t *)qdf_mem_alloc_consistent(scn->qdf_dev,
|
|
|
scn->qdf_dev->dev, (CE_COUNT*sizeof(uint32_t)),
|
|
@@ -3017,7 +3020,6 @@ static inline void hif_config_rri_on_ddr(struct hif_softc *scn)
|
|
|
|
|
|
qdf_mem_zero(scn->vaddr_rri_on_ddr, CE_COUNT*sizeof(uint32_t));
|
|
|
|
|
|
- return;
|
|
|
}
|
|
|
#else
|
|
|
|
|
@@ -3033,7 +3035,6 @@ static inline void hif_config_rri_on_ddr(struct hif_softc *scn)
|
|
|
*/
|
|
|
static inline void hif_config_rri_on_ddr(struct hif_softc *scn)
|
|
|
{
|
|
|
- return;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
@@ -3065,8 +3066,8 @@ int hif_dump_ce_registers(struct hif_softc *scn)
|
|
|
ce_reg_word_size * sizeof(uint32_t));
|
|
|
|
|
|
if (status != QDF_STATUS_SUCCESS) {
|
|
|
- HIF_ERROR("Dumping CE register failed!");
|
|
|
- return -EACCES;
|
|
|
+ HIF_ERROR("Dumping CE register failed!");
|
|
|
+ return -EACCES;
|
|
|
}
|
|
|
HIF_ERROR("CE%d=>\n", i);
|
|
|
qdf_trace_hex_dump(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_DEBUG,
|