summaryrefslogtreecommitdiff
path: root/drivers/net/usb/qmi_wwan.c
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2017-12-06 22:21:24 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-16 18:25:45 +0300
commit80ad5bd1b45f5d64fba26046556882fa989b775e (patch)
treec8fe6a2983a14aedae8e6c2c5901be2469e52cdb /drivers/net/usb/qmi_wwan.c
parent5471afeef41388ec08e6cf610640aaf89805d6db (diff)
downloadlinux-80ad5bd1b45f5d64fba26046556882fa989b775e.tar.xz
usbnet: fix alignment for frames with no ethernet header
[ Upstream commit a4abd7a80addb4a9547f7dfc7812566b60ec505c ] The qmi_wwan minidriver support a 'raw-ip' mode where frames are received without any ethernet header. This causes alignment issues because the skbs allocated by usbnet are "IP aligned". Fix by allowing minidrivers to disable the additional alignment offset. This is implemented using a per-device flag, since the same minidriver also supports 'ethernet' mode. Fixes: 32f7adf633b9 ("net: qmi_wwan: support "raw IP" mode") Reported-and-tested-by: Jay Foster <jay@systech.com> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/usb/qmi_wwan.c')
-rw-r--r--drivers/net/usb/qmi_wwan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 97a16e23c19a..62725655d8e4 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -74,9 +74,11 @@ static void qmi_wwan_netdev_setup(struct net_device *net)
net->hard_header_len = 0;
net->addr_len = 0;
net->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
+ set_bit(EVENT_NO_IP_ALIGN, &dev->flags);
netdev_dbg(net, "mode: raw IP\n");
} else if (!net->header_ops) { /* don't bother if already set */
ether_setup(net);
+ clear_bit(EVENT_NO_IP_ALIGN, &dev->flags);
netdev_dbg(net, "mode: Ethernet\n");
}