Parcourir la source

qcacmn: add size parameter for dp_prealloc_get_context

add size parameter for dp_prealloc_get_context.

Change-Id: I0171124cf35010e793c18d4c8f6916497f053f8d
CRs-Fixed: 3222817
Jinwei Chen il y a 3 ans
Parent
commit
fdb2193820
2 fichiers modifiés avec 7 ajouts et 5 suppressions
  1. 1 1
      dp/inc/cdp_txrx_ops.h
  2. 6 4
      dp/wifi3.0/dp_main.c

+ 1 - 1
dp/inc/cdp_txrx_ops.h

@@ -1391,7 +1391,7 @@ struct ol_if_ops {
 				   uint8_t *peer_mac_addr);
 #endif
 #ifdef DP_MEM_PRE_ALLOC
-	void *(*dp_prealloc_get_context)(uint32_t ctxt_type);
+	void *(*dp_prealloc_get_context)(uint32_t ctxt_type, size_t ctxt_size);
 
 	QDF_STATUS(*dp_prealloc_put_context)(uint32_t ctxt_type, void *vaddr);
 	void *(*dp_prealloc_get_consistent)(uint32_t *size,

+ 6 - 4
dp/wifi3.0/dp_main.c

@@ -1937,13 +1937,15 @@ void *dp_context_alloc_mem(struct dp_soc *soc, enum dp_ctxt_type ctxt_type,
 		goto dynamic_alloc;
 	}
 
-	ctxt_mem = soc->cdp_soc.ol_ops->dp_prealloc_get_context(ctxt_type);
+	ctxt_mem = soc->cdp_soc.ol_ops->dp_prealloc_get_context(ctxt_type,
+								ctxt_size);
 
 	if (ctxt_mem)
 		goto end;
 
 dynamic_alloc:
-	dp_info("Pre-alloc of ctxt failed. Dynamic allocation");
+	dp_info("Pre-alloc type %d, size %zu failed, need dynamic-alloc",
+		ctxt_type, ctxt_size);
 	ctxt_mem = qdf_mem_malloc(ctxt_size);
 end:
 	return ctxt_mem;
@@ -1959,12 +1961,12 @@ void dp_context_free_mem(struct dp_soc *soc, enum dp_ctxt_type ctxt_type,
 								ctxt_type,
 								vaddr);
 	} else {
-		dp_warn("dp_prealloc_get_context null!");
+		dp_warn("dp_prealloc_put_context null!");
 		status = QDF_STATUS_E_NOSUPPORT;
 	}
 
 	if (QDF_IS_STATUS_ERROR(status)) {
-		dp_info("Context not pre-allocated");
+		dp_info("Context type %d not pre-allocated", ctxt_type);
 		qdf_mem_free(vaddr);
 	}
 }