staging: r8188eu: clean up update_recvframe_phyinfo_88e
cover staging: r8188eu: clean up update_recvframe_phyinfo_88e
Here's three simple cleanups in the update_recvframe_phyinfo_88e function.
Martin Kaiser (3):
staging: r8188eu: use ether_addr_equal for address comparison
staging: r8188eu: use hdr->frame_control instead of fc
staging: r8188eu: use ieee80211_get_SA
drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.30.2
PATCH 1/3 staging: r8188eu: use ether_addr_equal for address comparison
We can use ether_addr_equal instead of memcmp in update_recvframe_phyinfo_88e for comparing the incoming frame's destination address with our local address.
Both struct ieee80211_hdr and struct eeprom_priv's mac_addr component are 2-byte aligned.
--- drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c +2 -2
@@ -126,8 +126,8 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat get_bssid(&padapter->mlmepriv), ETH_ALEN)); pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID && - (!memcmp (ieee80211_get_DA (hdr), -myid (&padapter->eeprompriv),ETH_ALEN )); +ether_addr_equal (ieee80211_get_DA (hdr), +myid (&padapter->eeprompriv)); pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID &&ieee80211_is_beacon (fc);if (pkt_info.bPacketBeacon) {
Signature · 1 line
2.30.2
PATCH 2/3 staging: r8188eu: use hdr->frame_control instead of fc
In reply to Martin KaiserWe can remove the fc variable in update_recvframe_phyinfo_88e and use hdr->frame_control instead.
--- drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c +3 -3
@@ -114,13 +114,12 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_statstruct hal_data_8188e *pHalData = &padapter->haldata;struct phy_info *pPHYInfo = &pattrib->phy_info;u8 *wlanhdr = precvframe->rx_data; -__le16 fc = *(__le16 *)wlanhdr;struct odm_per_pkt_info pkt_info;u8 *sa =NULL ;struct sta_priv *pstapriv;struct sta_info *psta; - pkt_info.bPacketMatchBSSID = ((!ieee80211_is_ctl (fc)) && + pkt_info.bPacketMatchBSSID = ((!ieee80211_is_ctl (hdr->frame_control)) && !pattrib->icv_err && !pattrib->crc_err && !memcmp (get_hdr_bssid (wlanhdr),get_bssid (&padapter->mlmepriv),ETH_ALEN ));
@@ -129,7 +128,8 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_statether_addr_equal (ieee80211_get_DA (hdr),myid (&padapter->eeprompriv)); - pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID &&ieee80211_is_beacon (fc); + pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && +ieee80211_is_beacon (hdr->frame_control);if (pkt_info.bPacketBeacon) {if (check_fwstate (&padapter->mlmepriv,WIFI_STATION_STATE )) sa = padapter->mlmepriv.cur_network.network.MacAddress;
Signature · 1 line
2.30.2
PATCH 3/3 staging: r8188eu: use ieee80211_get_SA
In reply to Martin KaiserUse ieee80211_get_SA in update_recvframe_phyinfo_88e instead of the driver-specific get_sa function.
--- drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c +1 -1
@@ -135,7 +135,7 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat sa = padapter->mlmepriv.cur_network.network.MacAddress;/* to do Ad-hoc */ }else { - sa =get_sa (wlanhdr); + sa =ieee80211_get_SA (hdr); } pstapriv = &padapter->stapriv;
Signature · 1 line
2.30.2
Quoted 10 lines · Martin Kaiser
Here's three simple cleanups in the
update_recvframe_phyinfo_88efunction.Martin Kaiser (3):
staging: r8188eu: useether_addr_equalfor address comparison
staging: r8188eu: usehdr->frame_controlinstead of fc
staging: r8188eu: useieee80211_get_SAdrivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)