staging: rtl8192e: Remove struct rtllib_hdr_3addrqos
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Fri, 15 Sep 2023 16:09:18 +0000 (18:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Sep 2023 07:47:56 +0000 (09:47 +0200)
Replace struct rtllib_hdr_3addrqos with struct ieee80211_qos_hdr to avoid
proprietary code.

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

index dfdc45d0636585885f11205da8204e6fbf14a512..e73292201e3a1c905214e237f03bd7e2d5ae0fd4 100644 (file)
@@ -679,17 +679,6 @@ struct rtllib_pspoll_hdr {
        u8 ta[ETH_ALEN];
 } __packed;
 
-struct rtllib_hdr_3addrqos {
-       __le16 frame_ctl;
-       __le16 duration_id;
-       u8 addr1[ETH_ALEN];
-       u8 addr2[ETH_ALEN];
-       u8 addr3[ETH_ALEN];
-       __le16 seq_ctl;
-       __le16 qos_ctl;
-       u8 payload[];
-} __packed;
-
 struct rtllib_hdr_4addrqos {
        __le16 frame_ctl;
        __le16 duration_id;
index 05d1d47bed47b52fab2942c3e9902cde97e03493..265a718a20a40b2b79c91cc38049733e580bfc6d 100644 (file)
@@ -93,7 +93,7 @@ rtllib_frag_cache_get(struct rtllib_device *ieee,
        unsigned int frag = WLAN_GET_SEQ_FRAG(sc);
        unsigned int seq = WLAN_GET_SEQ_SEQ(sc);
        struct rtllib_frag_entry *entry;
-       struct rtllib_hdr_3addrqos *hdr_3addrqos;
+       struct ieee80211_qos_hdr *hdr_3addrqos;
        struct rtllib_hdr_4addrqos *hdr_4addrqos;
        u8 tid;
 
@@ -104,8 +104,8 @@ rtllib_frag_cache_get(struct rtllib_device *ieee,
                tid = UP2AC(tid);
                tid++;
        } else if (RTLLIB_QOS_HAS_SEQ(fc)) {
-               hdr_3addrqos = (struct rtllib_hdr_3addrqos *)hdr;
-               tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & RTLLIB_QCTL_TID;
+               hdr_3addrqos = (struct ieee80211_qos_hdr *)hdr;
+               tid = le16_to_cpu(hdr_3addrqos->qos_ctrl) & RTLLIB_QCTL_TID;
                tid = UP2AC(tid);
                tid++;
        } else {
@@ -162,7 +162,7 @@ static int rtllib_frag_cache_invalidate(struct rtllib_device *ieee,
        u16 sc = le16_to_cpu(hdr->seq_ctrl);
        unsigned int seq = WLAN_GET_SEQ_SEQ(sc);
        struct rtllib_frag_entry *entry;
-       struct rtllib_hdr_3addrqos *hdr_3addrqos;
+       struct ieee80211_qos_hdr *hdr_3addrqos;
        struct rtllib_hdr_4addrqos *hdr_4addrqos;
        u8 tid;
 
@@ -173,8 +173,8 @@ static int rtllib_frag_cache_invalidate(struct rtllib_device *ieee,
                tid = UP2AC(tid);
                tid++;
        } else if (RTLLIB_QOS_HAS_SEQ(fc)) {
-               hdr_3addrqos = (struct rtllib_hdr_3addrqos *)hdr;
-               tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & RTLLIB_QCTL_TID;
+               hdr_3addrqos = (struct ieee80211_qos_hdr *)hdr;
+               tid = le16_to_cpu(hdr_3addrqos->qos_ctrl) & RTLLIB_QCTL_TID;
                tid = UP2AC(tid);
                tid++;
        } else {
@@ -355,7 +355,7 @@ static int is_duplicate_packet(struct rtllib_device *ieee,
        u16 frag = WLAN_GET_SEQ_FRAG(sc);
        u16 *last_seq, *last_frag;
        unsigned long *last_time;
-       struct rtllib_hdr_3addrqos *hdr_3addrqos;
+       struct ieee80211_qos_hdr *hdr_3addrqos;
        struct rtllib_hdr_4addrqos *hdr_4addrqos;
        u8 tid;
 
@@ -366,8 +366,8 @@ static int is_duplicate_packet(struct rtllib_device *ieee,
                tid = UP2AC(tid);
                tid++;
        } else if (RTLLIB_QOS_HAS_SEQ(fc)) {
-               hdr_3addrqos = (struct rtllib_hdr_3addrqos *)header;
-               tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & RTLLIB_QCTL_TID;
+               hdr_3addrqos = (struct ieee80211_qos_hdr *)header;
+               tid = le16_to_cpu(hdr_3addrqos->qos_ctrl) & RTLLIB_QCTL_TID;
                tid = UP2AC(tid);
                tid++;
        } else {
index a244a072e5518fe602a3792ebc452ee205deeb3b..4b730b2c9fef86fd217df55edcbabf9acf888ce3 100644 (file)
@@ -544,17 +544,17 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
        struct rtllib_device *ieee = (struct rtllib_device *)
                                     netdev_priv_rsl(dev);
        struct rtllib_txb *txb = NULL;
-       struct rtllib_hdr_3addrqos *frag_hdr;
+       struct ieee80211_qos_hdr *frag_hdr;
        int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size;
        unsigned long flags;
        struct net_device_stats *stats = &ieee->stats;
        int ether_type = 0, encrypt;
        int bytes, fc, qos_ctl = 0, hdr_len;
        struct sk_buff *skb_frag;
-       struct rtllib_hdr_3addrqos header = { /* Ensure zero initialized */
+       struct ieee80211_qos_hdr header = { /* Ensure zero initialized */
                .duration_id = 0,
-               .seq_ctl = 0,
-               .qos_ctl = 0
+               .seq_ctrl = 0,
+               .qos_ctrl = 0
        };
        int qos_activated = ieee->current_network.qos_data.active;
        u8 dest[ETH_ALEN];
@@ -689,7 +689,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
 
                bIsMulticast = is_multicast_ether_addr(header.addr1);
 
-               header.frame_ctl = cpu_to_le16(fc);
+               header.frame_control = cpu_to_le16(fc);
 
                /* Determine fragmentation size based on destination (multicast
                 * and broadcast are not fragmented)
@@ -716,7 +716,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
                        }
 
                        qos_ctl |= skb->priority;
-                       header.qos_ctl = cpu_to_le16(qos_ctl & RTLLIB_QOS_TID);
+                       header.qos_ctrl = cpu_to_le16(qos_ctl & RTLLIB_QOS_TID);
 
                } else {
                        hdr_len = RTLLIB_3ADDR_LEN;
@@ -798,7 +798,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
                         * MOREFRAGS bit to the frame control
                         */
                        if (i != nr_frags - 1) {
-                               frag_hdr->frame_ctl = cpu_to_le16(fc |
+                               frag_hdr->frame_control = cpu_to_le16(fc |
                                                                  RTLLIB_FCTL_MOREFRAGS);
                                bytes = bytes_per_frag;
 
@@ -807,13 +807,13 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
                                bytes = bytes_last_frag;
                        }
                        if ((qos_activated) && (!bIsMulticast)) {
-                               frag_hdr->seq_ctl =
+                               frag_hdr->seq_ctrl =
                                         cpu_to_le16(rtllib_query_seqnum(ieee, skb_frag,
                                                                         header.addr1));
-                               frag_hdr->seq_ctl =
-                                        cpu_to_le16(le16_to_cpu(frag_hdr->seq_ctl) << 4 | i);
+                               frag_hdr->seq_ctrl =
+                                        cpu_to_le16(le16_to_cpu(frag_hdr->seq_ctrl) << 4 | i);
                        } else {
-                               frag_hdr->seq_ctl =
+                               frag_hdr->seq_ctrl =
                                         cpu_to_le16(ieee->seq_ctrl[0] << 4 | i);
                        }
                        /* Put a SNAP header on the first fragment */