All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maya Erez <qca_merez@qca.qualcomm.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Lior David <qca_liord@qca.qualcomm.com>,
	linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com,
	Maya Erez <qca_merez@qca.qualcomm.com>
Subject: [PATCH 7/9] wil6210: configurable broadcast TX MCS
Date: Tue, 12 Dec 2017 21:04:00 +0200	[thread overview]
Message-ID: <1513105442-28041-8-git-send-email-qca_merez@qca.qualcomm.com> (raw)
In-Reply-To: <1513105442-28041-1-git-send-email-qca_merez@qca.qualcomm.com>

From: Lior David <qca_liord@qca.qualcomm.com>

Add 2 module parameters that control broadcast/multicast
TX packets:
1. bcast_mcs0_limit - specify the maximum packet size
that will be sent with MCS 0.
2. bcast_mcs - specify the MCS index to use when sending
packets larger than above limit.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/txrx.c | 59 +++++++++++++++++++++++++++++++--
 1 file changed, 57 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index 89967ce..4fc05f7 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -67,6 +67,60 @@ static int headroom_size_set(const char *val, const struct kernel_param *kp)
 MODULE_PARM_DESC(headroom_size,
 		 " headroom size for rx skb allocation, default - 0");
 
+static uint bcast_mcs0_limit = WIL_BCAST_MCS0_LIMIT;
+static int bcast_mcs0_limit_set(const char *val, const struct kernel_param *kp)
+{
+	int ret;
+	uint saved = bcast_mcs0_limit;
+
+	ret = param_set_uint(val, kp);
+	if (ret)
+		return ret;
+
+	if (bcast_mcs0_limit > WIL_BCAST_MCS0_LIMIT) {
+		bcast_mcs0_limit = saved;
+		ret = -EINVAL;
+	}
+
+	return ret;
+}
+
+static const struct kernel_param_ops bcast_mcs0_limit_ops = {
+	.set = bcast_mcs0_limit_set,
+	.get = param_get_uint,
+};
+
+module_param_cb(bcast_mcs0_limit_set, &bcast_mcs0_limit_ops,
+		&bcast_mcs0_limit, 0644);
+MODULE_PARM_DESC(bcast_mcs0_limit,
+		 " max broadcast packet size with MCS0, default - 1024 bytes");
+
+static uint bcast_mcs = 1;
+static int bcast_mcs_set(const char *val, const struct kernel_param *kp)
+{
+	int ret;
+	uint saved = bcast_mcs;
+
+	ret = param_set_uint(val, kp);
+	if (ret)
+		return ret;
+
+	if (bcast_mcs > WIL_MCS_MAX || bcast_mcs == 0) {
+		bcast_mcs = saved;
+		ret = -EINVAL;
+	}
+
+	return ret;
+}
+
+static const struct kernel_param_ops bcast_mcs_ops = {
+	.set = bcast_mcs_set,
+	.get = param_get_uint,
+};
+
+module_param_cb(bcast_mcs, &bcast_mcs_ops, &bcast_mcs, 0644);
+MODULE_PARM_DESC(bcast_mcs, " MCS index for large bcast TX, default - 1");
+
 static inline uint wil_rx_snaplen(void)
 {
 	return rx_align_2 ? 6 : 0;
@@ -1783,8 +1837,9 @@ static int __wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
 	wil_tx_desc_map(d, pa, len, vring_index);
 	if (unlikely(mcast)) {
 		d->mac.d[0] |= BIT(MAC_CFG_DESC_TX_0_MCS_EN_POS); /* MCS 0 */
-		if (unlikely(len > WIL_BCAST_MCS0_LIMIT)) /* set MCS 1 */
-			d->mac.d[0] |= (1 << MAC_CFG_DESC_TX_0_MCS_INDEX_POS);
+		if (unlikely(len > bcast_mcs0_limit)) /* use bcast_mcs */
+			d->mac.d[0] |= (bcast_mcs <<
+					MAC_CFG_DESC_TX_0_MCS_INDEX_POS);
 	}
 	/* Process TCP/UDP checksum offloading */
 	if (unlikely(wil_tx_desc_offload_setup(d, skb))) {
-- 
1.9.1

  parent reply	other threads:[~2017-12-12 19:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 19:03 [PATCH 0/9] wil6210 patches Maya Erez
2017-12-12 19:03 ` [PATCH 1/9] wil6210: support Scheduled scan Maya Erez
2017-12-13  8:58   ` Arend van Spriel
2017-12-12 19:03 ` [PATCH 2/9] wil6210: support 40bit DMA addresses Maya Erez
2017-12-12 19:03 ` [PATCH 3/9] wil6210: add platform capabilities bitmap Maya Erez
2017-12-12 19:03 ` [PATCH 4/9] wil6210: set platform features based on FW capabilities Maya Erez
2017-12-12 19:03 ` [PATCH 5/9] wil6210: prevent parallel suspend and dump collection Maya Erez
2017-12-12 19:03 ` [PATCH 6/9] wil6210: add support for headroom configuration Maya Erez
2017-12-12 19:04 ` Maya Erez [this message]
2017-12-12 19:04 ` [PATCH 8/9] wil6210: remove leftover "FIXME"s Maya Erez
2017-12-12 19:04 ` [PATCH 9/9] wil6210: remove reference to preset_chandef Maya Erez

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=1513105442-28041-8-git-send-email-qca_merez@qca.qualcomm.com \
    --to=qca_merez@qca.qualcomm.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=qca_liord@qca.qualcomm.com \
    --cc=wil6210@qca.qualcomm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.