[PATCH 6/8] staging: r8188eu: use is_multicast_ether_addr in core/rtw_xmit.c

Michael Straube
2021-08-23T12:02:59Z

Use is_multicast_ether_addr instead of custom macro IS_MCAST, all
buffers are properly aligned.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
drivers/staging/r8188eu/core/rtw_xmit.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index f242f3ffca70..b901d4398f03 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -411,7 +411,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
struct sta_info *psta = NULL;
struct ethhdr etherhdr;

- int bmcast;
+ bool bmcast;
struct sta_priv *pstapriv = &padapter->stapriv;
struct security_priv *psecuritypriv = &padapter->securitypriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@@ -472,7 +472,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
if ((pattrib->ether_type == 0x0806) || (pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1))
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SPECIAL_PACKET, 1);

- bmcast = IS_MCAST(pattrib->ra);
+ bmcast = is_multicast_ether_addr(pattrib->ra);

/* get sta_info */
if (bmcast) {
@@ -597,7 +597,6 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
u8 priority[4] = {0x0, 0x0, 0x0, 0x0};
u8 hw_hdr_offset = 0;
- int bmcst = IS_MCAST(pattrib->ra);

if (pattrib->psta)
stainfo = pattrib->psta;
@@ -615,7 +614,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr

pframe = pxmitframe->buf_addr + hw_hdr_offset;

- if (bmcst) {
+ if (is_multicast_ether_addr(pattrib->ra)) {
if (!memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16))
return _FAIL;
/* start to calculate the mic code */
@@ -715,12 +714,10 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr

struct sta_info *psta;

- int bmcst = IS_MCAST(pattrib->ra);
-
if (pattrib->psta) {
psta = pattrib->psta;
} else {
- if (bmcst) {
+ if (is_multicast_ether_addr(pattrib->ra)) {
psta = rtw_get_bcmc_stainfo(padapter);
} else {
psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
@@ -907,7 +904,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct pkt_attrib *pattrib = &pxmitframe->attrib;
u8 *pbuf_start;
- s32 bmcst = IS_MCAST(pattrib->ra);
+ bool bmcst = is_multicast_ether_addr(pattrib->ra);
s32 res = _SUCCESS;

if (!pkt)
@@ -1801,7 +1798,7 @@ int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fra
struct sta_priv *pstapriv = &padapter->stapriv;
struct pkt_attrib *pattrib = &pxmitframe->attrib;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
- int bmcst = IS_MCAST(pattrib->ra);
+ bool bmcst = is_multicast_ether_addr(pattrib->ra);

if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
return ret;
--
2.32.0