Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2532eeb1 authored by Lin Bai's avatar Lin Bai
Browse files

cnss_prealloc: Differentiate prealloc table by WLAN chip



Different WLAN chip may be attached to same kernel, and different
prealloc table required accordingly.

Here use CNSS_QCA6390 to identify if QCA6390 attached.

Change-Id: I7879379fb58d197c0c109b34cfacf6c23164713a
CRs-Fixed: 2516686
Signed-off-by: default avatarLin Bai <lbai@codeaurora.org>
parent d08071ee
Loading
Loading
Loading
Loading
+52 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012,2014-2017 The Linux Foundation. All rights reserved.
/* Copyright (c) 2012,2014-2017,2019 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -43,6 +43,56 @@ struct wcnss_prealloc {
};

/* pre-alloced mem for WLAN driver */

#ifdef CONFIG_CNSS_QCA6390
/* This table should be paired with WLAN chip attached ideally.
 * For QCA6390, roughly 800KB pre-allocation required.
 *
 * Be noted, currently not all QCA6390 attachment defined CNSS_QCA6390,
 * like on which single-DT feature enabled.
 */
static struct wcnss_prealloc wcnss_allocs[] = {
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
	{0, 16 * 1024, NULL},
	{0, 16 * 1024, NULL},
	{0, 16 * 1024, NULL},
	{0, 16 * 1024, NULL},
	{0, 16 * 1024, NULL},
	{0, 16 * 1024, NULL},
	{0, 32 * 1024, NULL},
	{0, 32 * 1024, NULL},
	{0, 32 * 1024, NULL},
	{0, 32 * 1024, NULL},
	{0, 32 * 1024, NULL},
	{0, 32 * 1024, NULL},
	{0, 64 * 1024, NULL},
	{0, 64 * 1024, NULL},
	{0, 64 * 1024, NULL},
	{0, 64 * 1024, NULL},
};
#else
static struct wcnss_prealloc wcnss_allocs[] = {
	{0, 8  * 1024, NULL},
	{0, 8  * 1024, NULL},
@@ -118,6 +168,7 @@ static struct wcnss_prealloc wcnss_allocs[] = {
	{0, 128 * 1024, NULL},
	{0, 128 * 1024, NULL},
};
#endif

int wcnss_prealloc_init(void)
{