lkml.org 
[lkml]   [2020]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH net] drivers/net/wan/hdlc_cisco: Add hard_header_len
Date
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

\
 
 \ /
  Last update: 2020-08-28 12:43    [W:0.053 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site