staging: rtl8192e: Replace struct rtllib_hdr_3addr in r8192E_dev.c
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Fri, 15 Sep 2023 16:07:23 +0000 (18:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Sep 2023 07:47:56 +0000 (09:47 +0200)
Replace struct rtllib_hdr_3addr with struct ieee80211_hdr_3addr to avoid
proprietary struct in r8192E_dev.c, rtllib_tx.c and in functions of
rtllib.h.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/8e5901c4ecb0961374610f627deb6a6ad9bc53df.1694792595.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
drivers/staging/rtl8192e/rtllib.h
drivers/staging/rtl8192e/rtllib_tx.c

index 70e1eff9c6000de2d69fb518d729373f89614a24..6528807311bab082d93a7701d1c5065f5881a31b 100644 (file)
@@ -1411,12 +1411,12 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
        static u32 slide_beacon_adc_pwdb_index;
        static u32 slide_beacon_adc_pwdb_statistics;
        static u32 last_beacon_adc_pwdb;
-       struct rtllib_hdr_3addr *hdr;
+       struct ieee80211_hdr_3addr *hdr;
        u16 sc;
        unsigned int seq;
 
-       hdr = (struct rtllib_hdr_3addr *)buffer;
-       sc = le16_to_cpu(hdr->seq_ctl);
+       hdr = (struct ieee80211_hdr_3addr *)buffer;
+       sc = le16_to_cpu(hdr->seq_ctrl);
        seq = WLAN_GET_SEQ_SEQ(sc);
        curr_st->Seq_Num = seq;
        if (!prev_st->bIsAMPDU)
@@ -1561,7 +1561,7 @@ static void _rtl92e_translate_rx_signal_stats(struct net_device *dev,
        struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
        bool bpacket_match_bssid, bpacket_toself;
        bool bPacketBeacon = false;
-       struct rtllib_hdr_3addr *hdr;
+       struct ieee80211_hdr_3addr *hdr;
        bool bToSelfBA = false;
        static struct rtllib_rx_stats  previous_stats;
        u16 fc, type;
@@ -1570,8 +1570,8 @@ static void _rtl92e_translate_rx_signal_stats(struct net_device *dev,
 
        tmp_buf = skb->data + pstats->RxDrvInfoSize + pstats->RxBufShift;
 
-       hdr = (struct rtllib_hdr_3addr *)tmp_buf;
-       fc = le16_to_cpu(hdr->frame_ctl);
+       hdr = (struct ieee80211_hdr_3addr *)tmp_buf;
+       fc = le16_to_cpu(hdr->frame_control);
        type = WLAN_FC_GET_TYPE(fc);
        praddr = hdr->addr1;
 
@@ -1584,7 +1584,7 @@ static void _rtl92e_translate_rx_signal_stats(struct net_device *dev,
                 (!pstats->bHwError) && (!pstats->bCRC) && (!pstats->bICV));
        bpacket_toself = bpacket_match_bssid &&         /* check this */
                         ether_addr_equal(praddr, priv->rtllib->dev->dev_addr);
-       if (ieee80211_is_beacon(hdr->frame_ctl))
+       if (ieee80211_is_beacon(hdr->frame_control))
                bPacketBeacon = true;
        _rtl92e_process_phyinfo(priv, tmp_buf, &previous_stats, pstats);
        _rtl92e_query_rxphystatus(priv, pstats, pdesc, pdrvinfo,
index 3ffebe12e279b54bcf4bd7036059f86d346715cc..c13268ad6b56ec4a5b2b871dbc18cfcfe9607413 100644 (file)
@@ -931,11 +931,11 @@ static inline const char *eap_get_type(int type)
 
 static inline u8 Frame_QoSTID(u8 *buf)
 {
-       struct rtllib_hdr_3addr *hdr;
+       struct ieee80211_hdr_3addr *hdr;
        u16 fc;
 
-       hdr = (struct rtllib_hdr_3addr *)buf;
-       fc = le16_to_cpu(hdr->frame_ctl);
+       hdr = (struct ieee80211_hdr_3addr *)buf;
+       fc = le16_to_cpu(hdr->frame_control);
        return (u8)((union frameqos *)(buf + (((fc & RTLLIB_FCTL_TODS) &&
                    (fc & RTLLIB_FCTL_FROMDS)) ? 30 : 24)))->field.tid;
 }
index 53eaf6330a98a947c7b960ca6f8dbb990471f38f..a244a072e5518fe602a3792ebc452ee205deeb3b 100644 (file)
@@ -853,7 +853,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
                                ieee->seq_ctrl[0]++;
                }
        } else {
-               if (unlikely(skb->len < sizeof(struct rtllib_hdr_3addr))) {
+               if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) {
                        netdev_warn(ieee->dev, "skb too small (%d).\n",
                                    skb->len);
                        goto success;