staging: rtl8723bs: replace RTW_GET_BE16 with get_unaligned_be16
Replace RTW_GET_BE16 macro with get_unlaligned_be16. Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com> Link: https://lore.kernel.org/r/20201004011743.10750-7-ross.schm.dev@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
d48603afda
Коммит
d2e8f201a0
|
@ -801,8 +801,8 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8 *buf_att
|
|||
|
||||
while (attr_ptr - wps_ie < wps_ielen) {
|
||||
/* 4 = 2(Attribute ID) + 2(Length) */
|
||||
u16 attr_id = RTW_GET_BE16(attr_ptr);
|
||||
u16 attr_data_len = RTW_GET_BE16(attr_ptr + 2);
|
||||
u16 attr_id = get_unaligned_be16(attr_ptr);
|
||||
u16 attr_data_len = get_unaligned_be16(attr_ptr + 2);
|
||||
u16 attr_len = attr_data_len + 4;
|
||||
|
||||
/* DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len); */
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <linux/jiffies.h>
|
||||
#include <rtw_recv.h>
|
||||
#include <net/cfg80211.h>
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
static u8 SNAP_ETH_TYPE_IPX[2] = {0x81, 0x37};
|
||||
static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3};
|
||||
|
@ -1906,7 +1907,7 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
while (a_len > ETH_HLEN) {
|
||||
|
||||
/* Offset 12 denote 2 mac address */
|
||||
nSubframe_Length = RTW_GET_BE16(pdata + 12);
|
||||
nSubframe_Length = get_unaligned_be16(pdata + 12);
|
||||
|
||||
if (a_len < (ETHERNET_HEADER_SIZE + nSubframe_Length)) {
|
||||
DBG_871X("nRemain_Length is %d and nSubframe_Length is : %d\n", a_len, nSubframe_Length);
|
||||
|
|
|
@ -150,8 +150,6 @@ extern void rtw_free_netdev(struct net_device * netdev);
|
|||
|
||||
/* Macros for handling unaligned memory accesses */
|
||||
|
||||
#define RTW_GET_BE16(a) ((u16) (((a)[0] << 8) | (a)[1]))
|
||||
|
||||
void rtw_buf_free(u8 **buf, u32 *buf_len);
|
||||
void rtw_buf_update(u8 **buf, u32 *buf_len, u8 *src, u32 src_len);
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <rtw_debug.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <net/cfg80211.h>
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
void rtw_os_free_recvframe(union recv_frame *precvframe)
|
||||
{
|
||||
|
@ -69,7 +70,7 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8
|
|||
skb_reserve(sub_skb, 12);
|
||||
skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length);
|
||||
|
||||
eth_type = RTW_GET_BE16(&sub_skb->data[6]);
|
||||
eth_type = get_unaligned_be16(&sub_skb->data[6]);
|
||||
|
||||
if (sub_skb->len >= 8 &&
|
||||
((!memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) &&
|
||||
|
|
Загрузка…
Ссылка в новой задаче