mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 03:10:30 -04:00
staging: r8188eu: replace custom macros with is_broadcast_ether_addr
Replace usage of custom macros with is_broadcast_ether_addr. All buffers are properly aligned. Remove the now unsued macros MacAddr_isBcst and IS_MAC_ADDRESS_BROADCAST. Signed-off-by: Michael Straube <straube.linux@gmail.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210805205010.31192-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d28a4c009b
commit
282bd08229
@@ -13,13 +13,6 @@
|
||||
|
||||
extern void indicate_wx_scan_complete_event(struct adapter *padapter);
|
||||
|
||||
#define IS_MAC_ADDRESS_BROADCAST(addr) \
|
||||
(\
|
||||
((addr[0] == 0xff) && (addr[1] == 0xff) && \
|
||||
(addr[2] == 0xff) && (addr[3] == 0xff) && \
|
||||
(addr[4] == 0xff) && (addr[5] == 0xff)) ? true : false \
|
||||
)
|
||||
|
||||
u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid)
|
||||
{
|
||||
u8 i;
|
||||
@@ -540,7 +533,7 @@ u8 rtw_set_802_11_add_key(struct adapter *padapter, struct ndis_802_11_key *key)
|
||||
}
|
||||
|
||||
/* check BSSID */
|
||||
if (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == true) {
|
||||
if (is_broadcast_ether_addr(key->BSSID)) {
|
||||
ret = false;
|
||||
goto exit;
|
||||
}
|
||||
@@ -592,7 +585,7 @@ u8 rtw_set_802_11_add_key(struct adapter *padapter, struct ndis_802_11_key *key)
|
||||
encryptionalgo = padapter->securitypriv.dot118021XGrpPrivacy;
|
||||
}
|
||||
|
||||
if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE) == true) && (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == false)) {
|
||||
if (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE) && !is_broadcast_ether_addr(key->BSSID)) {
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -622,7 +622,7 @@ static void count_rx_stats(struct adapter *padapter, struct recv_frame *prframe,
|
||||
|
||||
padapter->mlmepriv.LinkDetectInfo.NumRxOkInPeriod++;
|
||||
|
||||
if ((!MacAddr_isBcst(pattrib->dst)) && (!IS_MCAST(pattrib->dst)))
|
||||
if (!is_broadcast_ether_addr(pattrib->dst) && !IS_MCAST(pattrib->dst))
|
||||
padapter->mlmepriv.LinkDetectInfo.NumRxUnicastOkInPeriod++;
|
||||
|
||||
if (sta)
|
||||
|
||||
@@ -368,13 +368,6 @@ enum WIFI_REG_DOMAIN {
|
||||
|
||||
#define GetAddr4Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 24))
|
||||
|
||||
#define MacAddr_isBcst(addr) \
|
||||
( \
|
||||
((addr[0] == 0xff) && (addr[1] == 0xff) && \
|
||||
(addr[2] == 0xff) && (addr[3] == 0xff) && \
|
||||
(addr[4] == 0xff) && (addr[5] == 0xff)) ? true : false \
|
||||
)
|
||||
|
||||
static inline int IS_MCAST(unsigned char *da)
|
||||
{
|
||||
if ((*da) & 0x01)
|
||||
|
||||
Reference in New Issue
Block a user