Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Krzysztof Hałasa" <khalasa@piap.pl>
To: Xie He <xie.he.0141@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Martin Schiller <ms@dev.tdt.de>
Subject: Re: [PATCH net] drivers/net/wan/hdlc_cisco: Add hard_header_len
Date: Fri, 28 Aug 2020 12:37:37 +0200	[thread overview]
Message-ID: <m3pn7b6opa.fsf@t19.piap.pl> (raw)
In-Reply-To: <20200828070752.54444-1-xie.he.0141@gmail.com> (Xie He's message of "Fri, 28 Aug 2020 00:07:52 -0700")

Hello Xie,

Xie He <xie.he.0141@gmail.com> writes:

> This driver didn't set hard_header_len. This patch sets hard_header_len
> for it according to its header_ops->create function.

BTW it's 4 bytes long:

struct hdlc_header {
        u8 address;
        u8 control;
        __be16 protocol;
}__packed;

OTOH hdlc_setup_dev() initializes hard_header_len to 16,
but in this case I guess 4 bytes are better.

Acked-by: Krzysztof Halasa <khc@pm.waw.pl>

> Cc: Martin Schiller <ms@dev.tdt.de>
> Signed-off-by: Xie He <xie.he.0141@gmail.com>
> ---

> --- a/drivers/net/wan/hdlc_cisco.c
> +++ b/drivers/net/wan/hdlc_cisco.c
> @@ -370,6 +370,7 @@ static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
>  		memcpy(&state(hdlc)->settings, &new_settings, size);
>  		spin_lock_init(&state(hdlc)->lock);
>  		dev->header_ops = &cisco_header_ops;
> +		dev->hard_header_len = sizeof(struct hdlc_header);
>  		dev->type = ARPHRD_CISCO;
>  		call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE, dev);
>  		netif_dormant_on(dev);

-- 
Krzysztof Halasa

Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa

  reply	other threads:[~2020-08-28 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-28  7:07 Xie He
2020-08-28 10:37 ` Krzysztof Hałasa [this message]
2020-08-28 21:05   ` Xie He
2020-08-31 19:23 ` David Miller

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=m3pn7b6opa.fsf@t19.piap.pl \
    --to=khalasa@piap.pl \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ms@dev.tdt.de \
    --cc=netdev@vger.kernel.org \
    --cc=xie.he.0141@gmail.com \
    --subject='Re: [PATCH net] drivers/net/wan/hdlc_cisco: Add hard_header_len' \
    /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

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).