Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Wen Gong <wgong@codeaurora.org>, ath10k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: Store max_mtu in ieee80211_hw
Date: Wed, 04 Sep 2019 09:03:54 +0200	[thread overview]
Message-ID: <582e0a7eef96bb7d97fee4bae340ded97fda86a2.camel@sipsolutions.net> (raw)
In-Reply-To: <1567577743-27684-1-git-send-email-wgong@codeaurora.org>

On Wed, 2019-09-04 at 14:15 +0800, Wen Gong wrote:
> Make it possibly for drivers to adjust the default mat_mtu
> by storing it in the hardware struct.
> 
> +++ b/net/mac80211/iface.c
> @@ -1877,7 +1877,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
>  
>  		/* MTU range: 256 - 2304 */
>  		ndev->min_mtu = 256;
> -		ndev->max_mtu = IEEE80211_MAX_DATA_LEN;
> +		if (local->hw.max_mtu)
> +			ndev->max_mtu = local->hw.max_mtu;
> +		else
> +			ndev->max_mtu = IEEE80211_MAX_DATA_LEN;

It seems (slightly) preferable to me to just initialize the value in
local->hw.max_mtu in alloc_hw(), so the driver can override it before
register_hw(), and then use it here unconditionally. Any particular
reason for it being this way?

johannes


  reply	other threads:[~2019-09-04  7:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04  6:15 [PATCH] mac80211: Store max_mtu in ieee80211_hw Wen Gong
2019-09-04  7:03 ` Johannes Berg [this message]
2019-09-04  9:16   ` Wen Gong

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=582e0a7eef96bb7d97fee4bae340ded97fda86a2.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=ath10k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wgong@codeaurora.org \
    /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