diff options
author | Ivan Safonov <insafonov@gmail.com> | 2017-05-02 09:01:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-15 07:41:59 +0200 |
commit | d86e16da6a5d0a705eda2bd0c9640c3b503a61b7 (patch) | |
tree | fefaa1c3839aa1de626227d49aafbe93666186d1 /drivers | |
parent | 2ba8444c97b1ff72a80219d9baeec5e75995c926 (diff) | |
download | linux-stable-d86e16da6a5d0a705eda2bd0c9640c3b503a61b7.tar.gz linux-stable-d86e16da6a5d0a705eda2bd0c9640c3b503a61b7.tar.bz2 linux-stable-d86e16da6a5d0a705eda2bd0c9640c3b503a61b7.zip |
staging:r8188eu: use different mon_recv_decrypted() inside rtl88eu_mon_recv_hook() and rtl88eu_mon_xmit_hook().
Create mon_recv_decrypted_recv() to change rtl88eu_mon_recv_hook()
without affect to rtl88eu_mon_xmit_hook().
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/mon.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/staging/rtl8188eu/os_dep/mon.c b/drivers/staging/rtl8188eu/os_dep/mon.c index cfe37eb026d6..7eac87d641cf 100644 --- a/drivers/staging/rtl8188eu/os_dep/mon.c +++ b/drivers/staging/rtl8188eu/os_dep/mon.c @@ -66,6 +66,27 @@ static void mon_recv_decrypted(struct net_device *dev, const u8 *data, netif_rx(skb); } +static void mon_recv_decrypted_recv(struct net_device *dev, const u8 *data, + int data_len, int iv_len, int icv_len) +{ + struct sk_buff *skb; + + skb = netdev_alloc_skb(dev, data_len); + if (!skb) + return; + memcpy(skb_put(skb, data_len), data, data_len); + + /* + * Frame data is not encrypted. Strip off protection so + * userspace doesn't think that it is. + */ + unprotect_frame(skb, iv_len, icv_len); + + skb->ip_summed = CHECKSUM_UNNECESSARY; + skb->protocol = eth_type_trans(skb, dev); + netif_rx(skb); +} + static void mon_recv_encrypted(struct net_device *dev, const u8 *data, int data_len) { @@ -99,7 +120,7 @@ void rtl88eu_mon_recv_hook(struct net_device *dev, struct recv_frame *frame) SET_ICE_IV_LEN(iv_len, icv_len, attr->encrypt); if (attr->bdecrypted) - mon_recv_decrypted(dev, data, data_len, iv_len, icv_len); + mon_recv_decrypted_recv(dev, data, data_len, iv_len, icv_len); else mon_recv_encrypted(dev, data, data_len); } |