mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
1802d0beec
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 655 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35 lines
590 B
C
35 lines
590 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
|
|
*/
|
|
|
|
#include "mt7601u.h"
|
|
|
|
void mt76_remove_hdr_pad(struct sk_buff *skb)
|
|
{
|
|
int len = ieee80211_get_hdrlen_from_skb(skb);
|
|
|
|
memmove(skb->data + 2, skb->data, len);
|
|
skb_pull(skb, 2);
|
|
}
|
|
|
|
int mt76_insert_hdr_pad(struct sk_buff *skb)
|
|
{
|
|
int len = ieee80211_get_hdrlen_from_skb(skb);
|
|
int ret;
|
|
|
|
if (len % 4 == 0)
|
|
return 0;
|
|
|
|
ret = skb_cow(skb, 2);
|
|
if (ret)
|
|
return ret;
|
|
|
|
skb_push(skb, 2);
|
|
memmove(skb->data, skb->data + 2, len);
|
|
|
|
skb->data[len] = 0;
|
|
skb->data[len + 1] = 0;
|
|
return 0;
|
|
}
|