|
@@ -548,6 +548,9 @@ int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state,
|
|
|
return error;
|
|
|
}
|
|
|
|
|
|
+#define ONE_MEGABYTE (1024 * 1024)
|
|
|
+#define MAX_ALLOWED_PKTLOG_SIZE (16 * ONE_MEGABYTE)
|
|
|
+
|
|
|
static int __pktlog_setsize(struct hif_opaque_softc *scn, int32_t size)
|
|
|
{
|
|
|
ol_txrx_pdev_handle pdev_txrx_handle =
|
|
@@ -568,7 +571,11 @@ static int __pktlog_setsize(struct hif_opaque_softc *scn, int32_t size)
|
|
|
|
|
|
pl_info->curr_pkt_state = PKTLOG_OPR_IN_PROGRESS;
|
|
|
|
|
|
- if (size < 0) {
|
|
|
+ if (size < ONE_MEGABYTE || size > MAX_ALLOWED_PKTLOG_SIZE) {
|
|
|
+ qdf_print("%s: Cannot Set Pktlog Buffer size of %d bytes."
|
|
|
+ "Min required is %d MB and Max allowed is %d MB.\n",
|
|
|
+ __func__, size, (ONE_MEGABYTE/ONE_MEGABYTE),
|
|
|
+ (MAX_ALLOWED_PKTLOG_SIZE/ONE_MEGABYTE));
|
|
|
pl_info->curr_pkt_state = PKTLOG_OPR_NOT_IN_PROGRESS;
|
|
|
return -EINVAL;
|
|
|
}
|