staging: r8188eu: remove get_da
authorMartin Kaiser <martin@kaiser.cx>
Sat, 29 Oct 2022 17:10:11 +0000 (19:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2022 08:07:36 +0000 (09:07 +0100)
Replace the last get_da call with ieee80211_get_DA and remove the get_da
function.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20221029171011.1572091-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c
drivers/staging/r8188eu/include/wifi.h

index dff0cba751df45433b6e231224d08fb8254ed292..f01ae71bcdb115a5fe0a8fc83f8dbdad3b17c0f6 100644 (file)
@@ -108,6 +108,7 @@ void update_recvframe_attrib_88e(struct recv_frame *precvframe, struct recv_stat
  */
 void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat *pphy_status)
 {
+       struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precvframe->rx_data;
        struct adapter *padapter = precvframe->adapter;
        struct rx_pkt_attrib *pattrib = &precvframe->attrib;
        struct hal_data_8188e *pHalData = &padapter->haldata;
@@ -125,7 +126,7 @@ 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(get_da(wlanhdr),
+                                (!memcmp(ieee80211_get_DA(hdr),
                                  myid(&padapter->eeprompriv), ETH_ALEN));
 
        pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && ieee80211_is_beacon(fc);
index 6b50089cea2942d22beaa03035957bd464d10dab..92a584a8b6c07bd6f8987424f42f618ccec6de33 100644 (file)
@@ -217,28 +217,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;