linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arend van Spriel <arend@broadcom.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	Hante Meuleman <meuleman@broadcom.com>,
	Arend van Spriel <arend@broadcom.com>
Subject: [PATCH 08/11] brcmfmac: Make 5G join preference configurable.
Date: Wed, 25 Nov 2015 11:32:44 +0100	[thread overview]
Message-ID: <1448447567-12189-9-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1448447567-12189-1-git-send-email-arend@broadcom.com>

From: Hante Meuleman <meuleman@broadcom.com>

By default the 5G band has an advantage of 8 dBm on the RSSI when
it comes to selection during join and roam. This patch adds a
module param to make this value configurable. Using the value 99
results in configuration that 5G has always preference over 2.4G.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 .../wireless/broadcom/brcm80211/brcmfmac/common.c  | 31 +++++++++++++++++-----
 1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
index 474de11..6bc0ae9 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
@@ -15,6 +15,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/string.h>
 #include <linux/netdevice.h>
 #include <brcmu_wifi.h>
@@ -32,8 +33,18 @@ const u8 ALLFFMAC[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 #define BRCMF_DEFAULT_SCAN_CHANNEL_TIME	40
 #define BRCMF_DEFAULT_SCAN_UNASSOC_TIME	40
 
-/* boost value for RSSI_DELTA in preferred join selection */
+/* default boost value for RSSI_DELTA in preferred join selection */
 #define BRCMF_JOIN_PREF_RSSI_BOOST	8
+#define BRCMF_RSSI_BOOST_IS_5G		99
+
+/* Module param joinboost_5g used for preferred join selection.
+ * Use value 99 to configure preferred join to choose 5G always over 2.4G, any
+ * other value configures the advantage of 5G signal strength over 2.4G signal
+ * strength.
+ */
+static int brcmf_joinboost_5g_rssi = BRCMF_JOIN_PREF_RSSI_BOOST;
+module_param_named(joinboost_5g, brcmf_joinboost_5g_rssi, int, 0);
+MODULE_PARM_DESC(joinboost_5g, "Join preference 5G RSSI boost");
 
 int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
 {
@@ -106,11 +117,19 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
 		goto done;
 	}
 
-	/* Setup join_pref to select target by RSSI(with boost on 5GHz) */
-	join_pref_params[0].type = BRCMF_JOIN_PREF_RSSI_DELTA;
-	join_pref_params[0].len = 2;
-	join_pref_params[0].rssi_gain = BRCMF_JOIN_PREF_RSSI_BOOST;
-	join_pref_params[0].band = WLC_BAND_5G;
+	if (brcmf_joinboost_5g_rssi == BRCMF_RSSI_BOOST_IS_5G) {
+		/* Setup join_pref to select 5GHz over 2.4Ghz */
+		join_pref_params[0].type = BRCMF_JOIN_PREF_BAND;
+		join_pref_params[0].len = 2;
+		join_pref_params[0].rssi_gain = 0;
+		join_pref_params[0].band = WLC_BAND_5G;
+	} else {
+		/* Setup join_pref to select target by RSSI (boost on 5GHz) */
+		join_pref_params[0].type = BRCMF_JOIN_PREF_RSSI_DELTA;
+		join_pref_params[0].len = 2;
+		join_pref_params[0].rssi_gain = brcmf_joinboost_5g_rssi;
+		join_pref_params[0].band = WLC_BAND_5G;
+	}
 	join_pref_params[1].type = BRCMF_JOIN_PREF_RSSI;
 	join_pref_params[1].len = 2;
 	join_pref_params[1].rssi_gain = 0;
-- 
1.9.1


  parent reply	other threads:[~2015-11-25 10:32 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 10:32 [PATCH 00/11] brcmfmac: beamforming support and cleanup Arend van Spriel
2015-11-25 10:32 ` [PATCH 01/11] brcmfmac: Cleanup ssid storage Arend van Spriel
2015-11-30 12:48   ` [01/11] " Kalle Valo
2015-11-30 12:49     ` Kalle Valo
2015-11-25 10:32 ` [PATCH 02/11] brcmfmac: Return actual error by fwil Arend van Spriel
2015-11-25 10:32 ` [PATCH 03/11] brcmfmac: Change error print on wlan0 existence Arend van Spriel
2015-11-25 10:32 ` [PATCH 04/11] brcmfmac: no retries on rxglom superframe errors Arend van Spriel
2015-11-25 10:32 ` [PATCH 05/11] brcmfmac: Remove redundant parameter action from scan Arend van Spriel
2015-11-25 10:32 ` [PATCH 06/11] brcmfmac: Cleanup roaming configuration Arend van Spriel
2015-11-25 10:32 ` [PATCH 07/11] brcmfmac: Add beamforming support Arend van Spriel
2015-11-25 10:32 ` Arend van Spriel [this message]
2015-11-30 10:58   ` [PATCH 08/11] brcmfmac: Make 5G join preference configurable Kalle Valo
2015-12-01  8:33     ` Arend van Spriel
2015-12-01  9:48       ` Kalle Valo
2015-12-01 11:08         ` Jouni Malinen
2015-12-02 13:32           ` Arend van Spriel
2015-12-02 15:12             ` Jouni Malinen
2015-12-02 16:38             ` Dan Williams
2015-12-02 18:00               ` Paul Stewart
2015-12-02 21:07                 ` Dan Williams
2015-12-03 21:28                 ` Arend van Spriel
2015-11-25 10:32 ` [PATCH 09/11] brcmfmac: assure net_ratelimit() is declared before use Arend van Spriel
2015-11-25 10:32 ` [PATCH 10/11] brcmfmac: Unify methods to define and map firmware files Arend van Spriel
2015-11-25 10:32 ` [PATCH 11/11] brcmfmac: Fix double free on exception at module load Arend van Spriel
2015-11-30 11:00   ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448447567-12189-9-git-send-email-arend@broadcom.com \
    --to=arend@broadcom.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=meuleman@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).