staging: rtl8723bs: Use common packet header constants
authorPascal Terjan <pterjan@google.com>
Wed, 27 May 2020 20:51:00 +0000 (21:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 May 2020 10:36:00 +0000 (12:36 +0200)
This driver contains a local version of the rfc1042 header and bridge
tunnel header constants which are available from cfg80211.h, switch to
those.

Signed-off-by: Pascal Terjan <pterjan@google.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200527205100.35794-1-pterjan@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_recv.c
drivers/staging/rtl8723bs/include/rtw_recv.h
drivers/staging/rtl8723bs/os_dep/recv_linux.c

index 5245098b9ecfccbdec1998d32ac5c7c633dc3385..7e1da0e35812bc77f13856c6097851fb2fa8d0b7 100644 (file)
 #include <rtw_debug.h>
 #include <linux/jiffies.h>
 #include <rtw_recv.h>
+#include <net/cfg80211.h>
 
 static u8 SNAP_ETH_TYPE_IPX[2] = {0x81, 0x37};
 static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3};
 
-u8 rtw_rfc1042_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
-/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
-u8 rtw_bridge_tunnel_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
-
 static void rtw_signal_stat_timer_hdl(struct timer_list *t);
 
 void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
@@ -1625,11 +1622,11 @@ sint wlanhdr_to_ethhdr(union recv_frame *precvframe)
        psnap_type = ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
        /* convert hdr + possible LLC headers into Ethernet header */
        /* eth_type = (psnap_type[0] << 8) | psnap_type[1]; */
-       if ((!memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) &&
+       if ((!memcmp(psnap, rfc1042_header, SNAP_SIZE) &&
                (memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2)) &&
                (memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2))) ||
                /* eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || */
-                !memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE)) {
+                !memcmp(psnap, bridge_tunnel_header, SNAP_SIZE)) {
                /* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */
                bsnaphdr = true;
        } else
index 98c3e92245b7f796b933285e18f6b2edfa5f5557..a851b818ef0ec76f48109c54db91b002e387f15b 100644 (file)
@@ -38,8 +38,6 @@
 #define RX_MAX_QUEUE                           2
 
 #define MAX_SUBFRAME_COUNT     64
-extern u8 rtw_rfc1042_header[];
-extern u8 rtw_bridge_tunnel_header[];
 
 /* for Rx reordering buffer control */
 struct recv_reorder_ctrl
index 2a7b9922b1d4c32ab912832f6bd37496e5d8c026..eb4d1c3008fea63f53d5c6aeaf72d3dc1bd04c68 100644 (file)
@@ -9,6 +9,7 @@
 #include <drv_types.h>
 #include <rtw_debug.h>
 #include <linux/jiffies.h>
+#include <net/cfg80211.h>
 
 void rtw_os_free_recvframe(union recv_frame *precvframe)
 {
@@ -71,9 +72,9 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8
        eth_type = RTW_GET_BE16(&sub_skb->data[6]);
 
        if (sub_skb->len >= 8 &&
-               ((!memcmp(sub_skb->data, rtw_rfc1042_header, SNAP_SIZE) &&
+               ((!memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) &&
                  eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) ||
-                !memcmp(sub_skb->data, rtw_bridge_tunnel_header, SNAP_SIZE))) {
+                !memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE))) {
                /*
                 * remove RFC1042 or Bridge-Tunnel encapsulation and replace
                 * EtherType