From: Abel Moyo Date: Thu, 4 Dec 2014 13:13:21 +0000 (+0100) Subject: Staging: rtl8188eu: {core, hal, include}: Removed inline function X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=74df1cd75966e1456274cdcf51d7e64df7aa2a58;p=linux-beck.git Staging: rtl8188eu: {core, hal, include}: Removed inline function Removed inline function get_my_bssid and open coded all its references Signed-off-by: Abel Moyo Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index e4b7ee4c99d5..901ede99a2bc 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -577,13 +577,14 @@ unsigned int OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame) uint len = precv_frame->len; struct wlan_bssid_ex *pbss; int ret = _SUCCESS; + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { report_survey_event(padapter, precv_frame); return _SUCCESS; } - if (!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) { + if (!memcmp(GetAddr3Ptr(pframe), pnetwork->MacAddress, ETH_ALEN)) { if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) { /* we should update current network before auth, or some IE is wrong */ pbss = (struct wlan_bssid_ex *)rtw_malloc(sizeof(struct wlan_bssid_ex)); @@ -1445,10 +1446,10 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 *pframe = precv_frame->rx_data; + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); /* check A3 */ - if (memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), - ETH_ALEN)) + if (memcmp(GetAddr3Ptr(pframe), pnetwork->MacAddress, ETH_ALEN)) return _SUCCESS; reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN)); @@ -1499,10 +1500,10 @@ unsigned int OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 *pframe = precv_frame->rx_data; + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); /* check A3 */ - if (memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), - ETH_ALEN)) + if (memcmp(GetAddr3Ptr(pframe), pnetwork->MacAddress, ETH_ALEN)) return _SUCCESS; reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN)); @@ -2018,7 +2019,7 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); - memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); + memcpy(pwlanhdr->addr3, cur_network->MacAddress, ETH_ALEN); SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); /* pmlmeext->mgnt_seq++; */ @@ -2422,6 +2423,7 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (pmgntframe == NULL) @@ -2487,9 +2489,9 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short } else { __le32 le_tmp32; __le16 le_tmp16; - memcpy(pwlanhdr->addr1, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); + memcpy(pwlanhdr->addr1, pnetwork->MacAddress, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&padapter->eeprompriv), ETH_ALEN); - memcpy(pwlanhdr->addr3, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); + memcpy(pwlanhdr->addr3, pnetwork->MacAddress, ETH_ALEN); /* setting auth algo number */ val16 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared) ? 1 : 0;/* 0:OPEN System, 1:Shared key */ @@ -2582,7 +2584,7 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i memcpy((void *)GetAddr1Ptr(pwlanhdr), pstat->hwaddr, ETH_ALEN); memcpy((void *)GetAddr2Ptr(pwlanhdr), myid(&(padapter->eeprompriv)), ETH_ALEN); - memcpy((void *)GetAddr3Ptr(pwlanhdr), get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy((void *)GetAddr3Ptr(pwlanhdr), pnetwork->MacAddress, ETH_ALEN); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); @@ -2687,6 +2689,7 @@ void issue_assocreq(struct adapter *padapter) struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); int bssrate_len = 0, sta_bssrate_len = 0; + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (pmgntframe == NULL) @@ -2702,9 +2705,9 @@ void issue_assocreq(struct adapter *padapter) fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; - memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy(pwlanhdr->addr1, pnetwork->MacAddress, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); - memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy(pwlanhdr->addr3, pnetwork->MacAddress, ETH_ALEN); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; @@ -2879,6 +2882,7 @@ static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned struct xmit_priv *pxmitpriv; struct mlme_ext_priv *pmlmeext; struct mlme_ext_info *pmlmeinfo; + struct wlan_bssid_ex *pnetwork; if (!padapter) goto exit; @@ -2886,6 +2890,7 @@ static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned pxmitpriv = &(padapter->xmitpriv); pmlmeext = &(padapter->mlmeextpriv); pmlmeinfo = &(pmlmeext->mlmext_info); + pnetwork = &(pmlmeinfo->network); pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (pmgntframe == NULL) @@ -2914,7 +2919,7 @@ static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned memcpy(pwlanhdr->addr1, da, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); - memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy(pwlanhdr->addr3, pnetwork->MacAddress, ETH_ALEN); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; @@ -2946,10 +2951,11 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow u32 start = jiffies; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); /* da == NULL, assume it's null data for sta to ap*/ if (da == NULL) - da = get_my_bssid(&(pmlmeinfo->network)); + da = pnetwork->MacAddress; do { ret = _issue_nulldata(padapter, da, power_mode, wait_ms > 0 ? true : false); @@ -2995,6 +3001,7 @@ static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); DBG_88E("%s\n", __func__); @@ -3038,7 +3045,7 @@ static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 memcpy(pwlanhdr->addr1, da, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); - memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy(pwlanhdr->addr3, pnetwork->MacAddress, ETH_ALEN); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; @@ -3069,10 +3076,11 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int u32 start = jiffies; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); /* da == NULL, assume it's null data for sta to ap*/ if (da == NULL) - da = get_my_bssid(&(pmlmeinfo->network)); + da = pnetwork->MacAddress; do { ret = _issue_qos_nulldata(padapter, da, tid, wait_ms > 0 ? true : false); @@ -3115,6 +3123,7 @@ static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned s struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); int ret = _FAIL; __le16 le_tmp; @@ -3137,7 +3146,7 @@ static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned s memcpy(pwlanhdr->addr1, da, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); - memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy(pwlanhdr->addr3, pnetwork->MacAddress, ETH_ALEN); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; @@ -3288,6 +3297,7 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch struct sta_info *psta; struct sta_priv *pstapriv = &padapter->stapriv; struct registry_priv *pregpriv = &padapter->registrypriv; + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); DBG_88E("%s, category=%d, action=%d, status=%d\n", __func__, category, action, status); @@ -3310,7 +3320,7 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch /* memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); */ memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); - memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy(pwlanhdr->addr3, pnetwork->MacAddress, ETH_ALEN); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; @@ -3420,6 +3430,8 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) struct __queue *queue = &(pmlmepriv->scanned_queue); u8 InfoContent[16] = {0}; u8 ICS[8][15]; + struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network); + if ((pmlmepriv->num_FortyMHzIntolerant == 0) || (pmlmepriv->num_sta_no_ht == 0)) return; @@ -3449,9 +3461,9 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; - memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy(pwlanhdr->addr1, cur_network->MacAddress, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); - memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy(pwlanhdr->addr3, cur_network->MacAddress, ETH_ALEN); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; @@ -4042,9 +4054,10 @@ unsigned int receive_disconnect(struct adapter *padapter, unsigned char *MacAddr { struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); /* check A3 */ - if (memcmp(MacAddr, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) + if (memcmp(MacAddr, pnetwork->MacAddress, ETH_ALEN)) return _SUCCESS; DBG_88E("%s\n", __func__); diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c index 324c1a7fd0bc..3e9b6e932641 100644 --- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c @@ -405,11 +405,6 @@ int get_bsstype(unsigned short capability) return 0; } -__inline u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork) -{ - return pnetwork->MacAddress; -} - u16 get_beacon_interval(struct wlan_bssid_ex *bss) { __le16 val; diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c index 7f30dea1b53b..0d513e3390b8 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c @@ -276,7 +276,7 @@ static void ConstructBeacon(struct adapter *adapt, u8 *pframe, u32 *pLength) memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(adapt->eeprompriv)), ETH_ALEN); - memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); + memcpy(pwlanhdr->addr3, cur_network->MacAddress, ETH_ALEN); SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); SetFrameSubType(pframe, WIFI_BEACON); @@ -350,6 +350,7 @@ static void ConstructPSPoll(struct adapter *adapt, u8 *pframe, u32 *pLength) struct mlme_ext_priv *pmlmeext = &(adapt->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); __le16 *fctrl; + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -363,7 +364,7 @@ static void ConstructPSPoll(struct adapter *adapt, u8 *pframe, u32 *pLength) SetDuration(pframe, (pmlmeinfo->aid | 0xc000)); /* BSSID. */ - memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy(pwlanhdr->addr1, pnetwork->MacAddress, ETH_ALEN); /* TA. */ memcpy(pwlanhdr->addr2, myid(&(adapt->eeprompriv)), ETH_ALEN); @@ -386,6 +387,7 @@ static void ConstructNullFunctionData(struct adapter *adapt, u8 *pframe, struct wlan_network *cur_network = &pmlmepriv->cur_network; struct mlme_ext_priv *pmlmeext = &(adapt->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network); pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -397,21 +399,21 @@ static void ConstructNullFunctionData(struct adapter *adapt, u8 *pframe, switch (cur_network->network.InfrastructureMode) { case Ndis802_11Infrastructure: SetToDs(fctrl); - memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy(pwlanhdr->addr1, pnetwork->MacAddress, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(adapt->eeprompriv)), ETH_ALEN); memcpy(pwlanhdr->addr3, StaAddr, ETH_ALEN); break; case Ndis802_11APMode: SetFrDs(fctrl); memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN); - memcpy(pwlanhdr->addr2, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy(pwlanhdr->addr2, pnetwork->MacAddress, ETH_ALEN); memcpy(pwlanhdr->addr3, myid(&(adapt->eeprompriv)), ETH_ALEN); break; case Ndis802_11IBSS: default: memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(adapt->eeprompriv)), ETH_ALEN); - memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + memcpy(pwlanhdr->addr3, pnetwork->MacAddress, ETH_ALEN); break; } @@ -498,6 +500,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished) u16 BufIndex; u32 TotalPacketLen; struct rsvdpage_loc RsvdPageLoc; + struct wlan_bssid_ex *pnetwork; DBG_88E("%s\n", __func__); ReservedPagePacket = kzalloc(1000, GFP_KERNEL); @@ -510,6 +513,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished) pxmitpriv = &adapt->xmitpriv; pmlmeext = &adapt->mlmeextpriv; pmlmeinfo = &pmlmeext->mlmext_info; + pnetwork = &(pmlmeinfo->network); TxDescLen = TXDESC_SIZE; PageNum = 0; @@ -541,7 +545,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished) /* 3 (3) null data * 1 page */ RsvdPageLoc.LocNullData = PageNum; - ConstructNullFunctionData(adapt, &ReservedPagePacket[BufIndex], &NullDataLength, get_my_bssid(&pmlmeinfo->network), false, 0, 0, false); + ConstructNullFunctionData(adapt, &ReservedPagePacket[BufIndex], &NullDataLength, pnetwork->MacAddress, false, 0, 0, false); rtl8188e_fill_fake_txdesc(adapt, &ReservedPagePacket[BufIndex-TxDescLen], NullDataLength, false, false); PageNeed = (u8)PageNum_128(TxDescLen + NullDataLength); @@ -551,7 +555,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished) /* 3 (4) probe response * 1page */ RsvdPageLoc.LocProbeRsp = PageNum; - ConstructProbeRsp(adapt, &ReservedPagePacket[BufIndex], &ProbeRspLength, get_my_bssid(&pmlmeinfo->network), false); + ConstructProbeRsp(adapt, &ReservedPagePacket[BufIndex], &ProbeRspLength, pnetwork->MacAddress, false); rtl8188e_fill_fake_txdesc(adapt, &ReservedPagePacket[BufIndex-TxDescLen], ProbeRspLength, false, false); PageNeed = (u8)PageNum_128(TxDescLen + ProbeRspLength); @@ -562,7 +566,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished) /* 3 (5) Qos null data */ RsvdPageLoc.LocQosNull = PageNum; ConstructNullFunctionData(adapt, &ReservedPagePacket[BufIndex], - &QosNullLength, get_my_bssid(&pmlmeinfo->network), true, 0, 0, false); + &QosNullLength, pnetwork->MacAddress, true, 0, 0, false); rtl8188e_fill_fake_txdesc(adapt, &ReservedPagePacket[BufIndex-TxDescLen], QosNullLength, false, false); PageNeed = (u8)PageNum_128(TxDescLen + QosNullLength); diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h index 8d72ccf5f2a0..1920b1cdf9a5 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h @@ -496,7 +496,6 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src, struct adapter *adapter, bool update_ie); int get_bsstype(unsigned short capability); -u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork); u16 get_beacon_interval(struct wlan_bssid_ex *bss); int is_client_associated_to_ap(struct adapter *padapter); @@ -516,7 +515,7 @@ void ERP_IE_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE); void VCS_update(struct adapter *padapter, struct sta_info *psta); void update_beacon_info(struct adapter *padapter, u8 *pframe, uint len, - struct sta_info *psta); + struct sta_info *psta); int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len); void update_IOT_info(struct adapter *padapter); void update_capinfo(struct adapter *adapter, u16 updatecap);