mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 22:08:33 -04:00
staging:r8188eu: replace get_(d|s)a with ieee80211_get_(D|S)A
get_da()/get_sa() duplicate native ieee80211_get_(D|S)A functions. Remove get_(d|s)a, use ieee80211_get_(D|S)A instead. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Link: https://lore.kernel.org/r/20210314090247.21181-2-insafonov@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
dff20ceb91
commit
703b830fab
@@ -2526,7 +2526,7 @@ static unsigned int OnProbeReq(struct adapter *padapter,
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) &&
|
||||
pmlmepriv->cur_network.join_res)
|
||||
issue_probersp(padapter, get_sa(pframe));
|
||||
issue_probersp(padapter, ieee80211_get_SA((struct ieee80211_hdr *)pframe));
|
||||
}
|
||||
return _SUCCESS;
|
||||
}
|
||||
@@ -2819,7 +2819,7 @@ static unsigned int OnAuthClient(struct adapter *padapter,
|
||||
DBG_88E("%s\n", __func__);
|
||||
|
||||
/* check A1 matches or not */
|
||||
if (memcmp(myid(&padapter->eeprompriv), get_da(pframe), ETH_ALEN))
|
||||
if (memcmp(myid(&padapter->eeprompriv), ieee80211_get_DA((struct ieee80211_hdr *)pframe), ETH_ALEN))
|
||||
return _SUCCESS;
|
||||
|
||||
if (!(pmlmeinfo->state & WIFI_FW_AUTH_STATE))
|
||||
@@ -3332,7 +3332,7 @@ static unsigned int OnAssocRsp(struct adapter *padapter,
|
||||
DBG_88E("%s\n", __func__);
|
||||
|
||||
/* check A1 matches or not */
|
||||
if (memcmp(myid(&padapter->eeprompriv), get_da(pframe), ETH_ALEN))
|
||||
if (memcmp(myid(&padapter->eeprompriv), ieee80211_get_DA((struct ieee80211_hdr *)pframe), ETH_ALEN))
|
||||
return _SUCCESS;
|
||||
|
||||
if (!(pmlmeinfo->state & (WIFI_FW_AUTH_SUCCESS | WIFI_FW_ASSOC_STATE)))
|
||||
|
||||
@@ -1029,8 +1029,8 @@ static int validate_recv_data_frame(struct adapter *adapter,
|
||||
int ret = _SUCCESS;
|
||||
|
||||
bretry = GetRetry(ptr);
|
||||
pda = get_da(ptr);
|
||||
psa = get_sa(ptr);
|
||||
pda = ieee80211_get_DA((struct ieee80211_hdr *)ptr);
|
||||
psa = ieee80211_get_SA((struct ieee80211_hdr *)ptr);
|
||||
pbssid = get_hdr_bssid(ptr);
|
||||
|
||||
if (!pbssid) {
|
||||
|
||||
@@ -150,7 +150,7 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe,
|
||||
get_bssid(&padapter->mlmepriv), ETH_ALEN));
|
||||
|
||||
pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID &&
|
||||
(!memcmp(get_da(wlanhdr),
|
||||
(!memcmp(ieee80211_get_DA((struct ieee80211_hdr *)wlanhdr),
|
||||
myid(&padapter->eeprompriv), ETH_ALEN));
|
||||
|
||||
pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID &&
|
||||
@@ -161,7 +161,7 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe,
|
||||
sa = padapter->mlmepriv.cur_network.network.MacAddress;
|
||||
/* to do Ad-hoc */
|
||||
} else {
|
||||
sa = get_sa(wlanhdr);
|
||||
sa = ieee80211_get_SA((struct ieee80211_hdr *)wlanhdr);
|
||||
}
|
||||
|
||||
pstapriv = &padapter->stapriv;
|
||||
|
||||
@@ -201,50 +201,6 @@ enum WIFI_REG_DOMAIN {
|
||||
|
||||
#define GetAddr4Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 24))
|
||||
|
||||
static inline unsigned char *get_da(unsigned char *pframe)
|
||||
{
|
||||
unsigned char *da;
|
||||
unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe);
|
||||
|
||||
switch (to_fr_ds) {
|
||||
case 0x00: /* ToDs=0, FromDs=0 */
|
||||
da = GetAddr1Ptr(pframe);
|
||||
break;
|
||||
case 0x01: /* ToDs=0, FromDs=1 */
|
||||
da = GetAddr1Ptr(pframe);
|
||||
break;
|
||||
case 0x02: /* ToDs=1, FromDs=0 */
|
||||
da = GetAddr3Ptr(pframe);
|
||||
break;
|
||||
default: /* ToDs=1, FromDs=1 */
|
||||
da = GetAddr3Ptr(pframe);
|
||||
break;
|
||||
}
|
||||
return da;
|
||||
}
|
||||
|
||||
static inline unsigned char *get_sa(unsigned char *pframe)
|
||||
{
|
||||
unsigned char *sa;
|
||||
unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe);
|
||||
|
||||
switch (to_fr_ds) {
|
||||
case 0x00: /* ToDs=0, FromDs=0 */
|
||||
sa = GetAddr2Ptr(pframe);
|
||||
break;
|
||||
case 0x01: /* ToDs=0, FromDs=1 */
|
||||
sa = GetAddr3Ptr(pframe);
|
||||
break;
|
||||
case 0x02: /* ToDs=1, FromDs=0 */
|
||||
sa = GetAddr2Ptr(pframe);
|
||||
break;
|
||||
default: /* ToDs=1, FromDs=1 */
|
||||
sa = GetAddr4Ptr(pframe);
|
||||
break;
|
||||
}
|
||||
return sa;
|
||||
}
|
||||
|
||||
static inline unsigned char *get_hdr_bssid(unsigned char *pframe)
|
||||
{
|
||||
unsigned char *sa;
|
||||
|
||||
Reference in New Issue
Block a user