qcacld-3.0: Change the maximum serialization pending commands

The host driver serialization module currently supports upto 4
commands in non scan pending queue. This is calculated at the
wlan_serialization_vdev_create_handler() as:
    max_pending_cmds = (WLAN_SER_MAX_PENDING_CMDS /
                        WLAN_SER_MAX_VDEVS)

But in SAP case, if multiple STA sends deauth at the same time,
4 pending commands in non scan pending queue is not sufficient
and will result in only disassoc from the first 4 STA getting
honored.

The current host wlan driver supports 3 SAP mode and
2 STA vdevs amounting to a total of 5 vdevs supported.
So calculate the total non scan pending commands for
serialization based on the total peers supported for each
mode to fix this issue.

In SAP case, maximum 32 peer are supported and for STA case,
maximum 4 pending commands for serialization. So change the
max pending commands calculation as:
 max_pending_cmds = (No. of sap modes supported * 32) +
                    (No .of STA modes supported *4 )

Change-Id: I30b2d79f2c15a092060dbdd729e1d035eb36fd83
CRs-Fixed: 2468945
diff --git a/Kbuild b/Kbuild
index 9ca4b23..f113518 100644
--- a/Kbuild
+++ b/Kbuild
@@ -2727,6 +2727,29 @@
 CONFIG_WLAN_MAX_VDEVS ?= 5
 ccflags-y += -DWLAN_MAX_VDEVS=$(CONFIG_WLAN_MAX_VDEVS)
 
+#Maximum pending commands for a vdev is calculated in vdev create handler
+#by WLAN_SER_MAX_PENDING_CMDS/WLAN_SER_MAX_VDEVS. For SAP case, we will need
+#to accommodate 32 Pending commands to handle multiple STA sending
+#deauth/disassoc at the same time and for STA vdev,4 non scan pending commands
+#are supported. So calculate WLAN_SER_MAX_PENDING_COMMANDS based on the SAP
+#modes supported and no of STA vdev total non scan pending queue. Reserve
+#additional 3 pending commands for WLAN_SER_MAX_PENDING_CMDS_AP to account for
+#other commands like hardware mode change.
+
+ifdef CONFIG_SIR_SAP_MAX_NUM_PEERS
+CONFIG_WLAN_SER_MAX_PENDING_CMDS_AP ?=$(CONFIG_SIR_SAP_MAX_NUM_PEERS)
+else
+CONFIG_WLAN_SER_MAX_PENDING_CMDS_AP ?=32
+endif
+ccflags-y += -DWLAN_SER_MAX_PENDING_CMDS_AP=$(CONFIG_WLAN_SER_MAX_PENDING_CMDS_AP)+3
+
+CONFIG_WLAN_SER_MAX_PENDING_CMDS_STA ?= 4
+ccflags-y += -DWLAN_SER_MAX_PENDING_CMDS_STA=$(CONFIG_WLAN_SER_MAX_PENDING_CMDS_STA)
+
+CONFIG_WLAN_MAX_PENDING_CMDS ?= $(CONFIG_WLAN_SER_MAX_PENDING_CMDS_AP)*3+$(CONFIG_WLAN_SER_MAX_PENDING_CMDS_STA)*2
+
+ccflags-y += -DWLAN_SER_MAX_PENDING_CMDS=$(CONFIG_WLAN_MAX_PENDING_CMDS)
+
 CONFIG_WLAN_PDEV_MAX_VDEVS ?= $(CONFIG_WLAN_MAX_VDEVS)
 ccflags-y += -DWLAN_PDEV_MAX_VDEVS=$(CONFIG_WLAN_PDEV_MAX_VDEVS)