Linux wireless drivers development
 help / color / mirror / Atom feed
From: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
To: "John W . Linville" <linville@tuxdriver.com>
Cc: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>,
	<linux-wireless@vger.kernel.org>, <wil6210@qca.qualcomm.com>
Subject: [PATCH 1/7] wil6210: limit MTU
Date: Tue, 27 May 2014 14:45:44 +0300	[thread overview]
Message-ID: <1401191150-29037-2-git-send-email-qca_vkondrat@qca.qualcomm.com> (raw)
In-Reply-To: <1401191150-29037-1-git-send-email-qca_vkondrat@qca.qualcomm.com>

Obey 802.11 spec that defines max. data size 7920 bytes

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/netdev.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c
index fdcaeb8..106b6dc 100644
--- a/drivers/net/wireless/ath/wil6210/netdev.c
+++ b/drivers/net/wireless/ath/wil6210/netdev.c
@@ -32,12 +32,26 @@ static int wil_stop(struct net_device *ndev)
 	return wil_down(wil);
 }
 
+static int wil_change_mtu(struct net_device *ndev, int new_mtu)
+{
+	struct wil6210_priv *wil = ndev_to_wil(ndev);
+
+	if (new_mtu < 68 || new_mtu > IEEE80211_MAX_DATA_LEN_DMG)
+		return -EINVAL;
+
+	wil_dbg_misc(wil, "change MTU %d -> %d\n", ndev->mtu, new_mtu);
+	ndev->mtu = new_mtu;
+
+	return 0;
+}
+
 static const struct net_device_ops wil_netdev_ops = {
 	.ndo_open		= wil_open,
 	.ndo_stop		= wil_stop,
 	.ndo_start_xmit		= wil_start_xmit,
 	.ndo_set_mac_address	= eth_mac_addr,
 	.ndo_validate_addr	= eth_validate_addr,
+	.ndo_change_mtu		= wil_change_mtu,
 };
 
 static int wil6210_netdev_poll_rx(struct napi_struct *napi, int budget)
-- 
1.9.1


  reply	other threads:[~2014-05-27 11:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27 11:45 [PATCH 0/7] wil6210 patches Vladimir Kondratiev
2014-05-27 11:45 ` Vladimir Kondratiev [this message]
2014-05-27 11:45 ` [PATCH 2/7] wil6210: limit fw error recovery attempts Vladimir Kondratiev
2014-05-27 11:45 ` [PATCH 3/7] wil6210: inline functions for vring hi/lo watermarks Vladimir Kondratiev
2014-05-27 11:45 ` [PATCH 4/7] wil6210: improve debug for WMI receive Vladimir Kondratiev
2014-05-27 13:59   ` Joe Perches
2014-05-27 14:11     ` Vladimir Kondratiev
2014-05-27 14:15       ` Joe Perches
2014-05-27 14:46         ` Vladimir Kondratiev
2014-05-29 15:37           ` Resubmitting [PATCH 4/7 v2] Vladimir Kondratiev
2014-05-29 15:37           ` [PATCH 4/7 v2] wil6210: improve debug for WMI receive Vladimir Kondratiev
2014-05-27 11:45 ` [PATCH 5/7] wil6210: detect scan timeouts Vladimir Kondratiev
2014-05-27 11:45 ` [PATCH 6/7] wil6210: improve pointers printing Vladimir Kondratiev
2014-05-27 11:45 ` [PATCH 7/7] wil6210: optimize wil_release_reorder_frames Vladimir Kondratiev

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=1401191150-29037-2-git-send-email-qca_vkondrat@qca.qualcomm.com \
    --to=qca_vkondrat@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox