staging: r8188eu: use is_multicast_ether_addr in core/rtw_xmit.c
authorMichael Straube <straube.linux@gmail.com>
Mon, 23 Aug 2021 12:01:04 +0000 (14:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Aug 2021 10:23:13 +0000 (12:23 +0200)
Use is_multicast_ether_addr instead of custom macro IS_MCAST, all
buffers are properly aligned.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210823120106.9633-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_xmit.c

index 611dbfb..71d60d3 100644 (file)
@@ -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;