Skip to content

Commit 1eb9d1e

Browse files
Dedy Lanskylinvjw
authored andcommitted
wil6210: Limit max number of associated stations
Add a module parameter to support setting the maximum number of stations that can be associated to an AP. Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent a214208 commit 1eb9d1e

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

  • drivers/net/wireless/ath/wil6210

‎drivers/net/wireless/ath/wil6210/wmi.c‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1515
*/
1616

17+
#include <linux/moduleparam.h>
1718
#include <linux/etherdevice.h>
1819
#include <linux/if_arp.h>
1920

@@ -22,6 +23,10 @@
2223
#include "wmi.h"
2324
#include "trace.h"
2425

26+
static uint max_assoc_sta = 1;
27+
module_param(max_assoc_sta, uint, S_IRUGO | S_IWUSR);
28+
MODULE_PARM_DESC(max_assoc_sta, " Max number of stations associated to the AP");
29+
2530
/**
2631
* WMI event receiving - theory of operations
2732
*
@@ -794,7 +799,7 @@ int wmi_pcp_start(struct wil6210_priv *wil, int bi, u8 wmi_nettype, u8 chan)
794799
.network_type = wmi_nettype,
795800
.disable_sec_offload = 1,
796801
.channel = chan - 1,
797-
.pcp_max_assoc_sta = WIL6210_MAX_CID,
802+
.pcp_max_assoc_sta = max_assoc_sta,
798803
};
799804
struct {
800805
struct wil6210_mbox_hdr_wmi wmi;
@@ -804,6 +809,14 @@ int wmi_pcp_start(struct wil6210_priv *wil, int bi, u8 wmi_nettype, u8 chan)
804809
if (!wil->secure_pcp)
805810
cmd.disable_sec = 1;
806811

812+
if ((cmd.pcp_max_assoc_sta > WIL6210_MAX_CID) ||
813+
(cmd.pcp_max_assoc_sta <= 0)) {
814+
wil_info(wil,
815+
"Requested connection limit %u, valid values are 1 - %d. Setting to %d\n",
816+
max_assoc_sta, WIL6210_MAX_CID, WIL6210_MAX_CID);
817+
cmd.pcp_max_assoc_sta = WIL6210_MAX_CID;
818+
}
819+
807820
/*
808821
* Processing time may be huge, in case of secure AP it takes about
809822
* 3500ms for FW to start AP

0 commit comments

Comments
 (0)